MS ABI: Add support for the -vm{b,g,s,m,v} flags
These flags control the inheritance model initially used by the
translation unit.
Differential Revision: http://llvm-reviews.chandlerc.com/D2741
llvm-svn: 201175
diff --git a/clang/lib/Parse/ParsePragma.cpp b/clang/lib/Parse/ParsePragma.cpp
index 2655996..8cf2b3f 100644
--- a/clang/lib/Parse/ParsePragma.cpp
+++ b/clang/lib/Parse/ParsePragma.cpp
@@ -182,8 +182,8 @@
void Parser::HandlePragmaMSPointersToMembers() {
assert(Tok.is(tok::annot_pragma_ms_pointers_to_members));
- Sema::PragmaMSPointersToMembersKind RepresentationMethod =
- static_cast<Sema::PragmaMSPointersToMembersKind>(
+ LangOptions::PragmaMSPointersToMembersKind RepresentationMethod =
+ static_cast<LangOptions::PragmaMSPointersToMembersKind>(
reinterpret_cast<uintptr_t>(Tok.getAnnotationValue()));
SourceLocation PragmaLoc = ConsumeToken(); // The annotation token.
Actions.ActOnPragmaMSPointersToMembers(RepresentationMethod, PragmaLoc);
@@ -834,9 +834,9 @@
}
PP.Lex(Tok);
- Sema::PragmaMSPointersToMembersKind RepresentationMethod;
+ LangOptions::PragmaMSPointersToMembersKind RepresentationMethod;
if (Arg->isStr("best_case")) {
- RepresentationMethod = Sema::PPTMK_BestCase;
+ RepresentationMethod = LangOptions::PPTMK_BestCase;
} else {
if (Arg->isStr("full_generality")) {
if (Tok.is(tok::comma)) {
@@ -854,7 +854,7 @@
// #pragma pointers_to_members(full_generality) implicitly specifies
// virtual_inheritance.
Arg = 0;
- RepresentationMethod = Sema::PPTMK_FullGeneralityVirtualInheritance;
+ RepresentationMethod = LangOptions::PPTMK_FullGeneralityVirtualInheritance;
} else {
PP.Diag(Tok.getLocation(), diag::err_expected_punc)
<< "full_generality";
@@ -864,11 +864,14 @@
if (Arg) {
if (Arg->isStr("single_inheritance")) {
- RepresentationMethod = Sema::PPTMK_FullGeneralitySingleInheritance;
+ RepresentationMethod =
+ LangOptions::PPTMK_FullGeneralitySingleInheritance;
} else if (Arg->isStr("multiple_inheritance")) {
- RepresentationMethod = Sema::PPTMK_FullGeneralityMultipleInheritance;
+ RepresentationMethod =
+ LangOptions::PPTMK_FullGeneralityMultipleInheritance;
} else if (Arg->isStr("virtual_inheritance")) {
- RepresentationMethod = Sema::PPTMK_FullGeneralityVirtualInheritance;
+ RepresentationMethod =
+ LangOptions::PPTMK_FullGeneralityVirtualInheritance;
} else {
PP.Diag(Tok.getLocation(),
diag::err_pragma_pointers_to_members_unknown_kind)