diff options
Diffstat (limited to 'contrib/llvm/tools/clang/lib/Sema/SemaAttr.cpp')
-rw-r--r-- | contrib/llvm/tools/clang/lib/Sema/SemaAttr.cpp | 42 |
1 files changed, 29 insertions, 13 deletions
diff --git a/contrib/llvm/tools/clang/lib/Sema/SemaAttr.cpp b/contrib/llvm/tools/clang/lib/Sema/SemaAttr.cpp index e12bbde0..8f9ab32 100644 --- a/contrib/llvm/tools/clang/lib/Sema/SemaAttr.cpp +++ b/contrib/llvm/tools/clang/lib/Sema/SemaAttr.cpp @@ -13,6 +13,7 @@ //===----------------------------------------------------------------------===// #include "clang/Sema/SemaInternal.h" +#include "clang/AST/ASTConsumer.h" #include "clang/AST/Attr.h" #include "clang/AST/Expr.h" #include "clang/Basic/TargetInfo.h" @@ -263,6 +264,30 @@ void Sema::ActOnPragmaMSStruct(PragmaMSStructKind Kind) { MSStructPragmaOn = (Kind == PMSST_ON); } +void Sema::ActOnPragmaMSComment(PragmaMSCommentKind Kind, StringRef Arg) { + // FIXME: Serialize this. + switch (Kind) { + case PCK_Unknown: + llvm_unreachable("unexpected pragma comment kind"); + case PCK_Linker: + Consumer.HandleLinkerOptionPragma(Arg); + return; + case PCK_Lib: + Consumer.HandleDependentLibrary(Arg); + return; + case PCK_Compiler: + case PCK_ExeStr: + case PCK_User: + return; // We ignore all of these. + } + llvm_unreachable("invalid pragma comment kind"); +} + +void Sema::ActOnPragmaDetectMismatch(StringRef Name, StringRef Value) { + // FIXME: Serialize this. + Consumer.HandleDetectMismatch(Name, Value); +} + void Sema::ActOnPragmaUnused(const Token &IdTok, Scope *curScope, SourceLocation PragmaLoc) { @@ -343,21 +368,12 @@ void Sema::ActOnPragmaVisibility(const IdentifierInfo* VisType, SourceLocation PragmaLoc) { if (VisType) { // Compute visibility to use. - VisibilityAttr::VisibilityType type; - if (VisType->isStr("default")) - type = VisibilityAttr::Default; - else if (VisType->isStr("hidden")) - type = VisibilityAttr::Hidden; - else if (VisType->isStr("internal")) - type = VisibilityAttr::Hidden; // FIXME - else if (VisType->isStr("protected")) - type = VisibilityAttr::Protected; - else { - Diag(PragmaLoc, diag::warn_attribute_unknown_visibility) << - VisType->getName(); + VisibilityAttr::VisibilityType T; + if (!VisibilityAttr::ConvertStrToVisibilityType(VisType->getName(), T)) { + Diag(PragmaLoc, diag::warn_attribute_unknown_visibility) << VisType; return; } - PushPragmaVisibility(*this, type, PragmaLoc); + PushPragmaVisibility(*this, T, PragmaLoc); } else { PopPragmaVisibility(false, PragmaLoc); } |