diff options
author | John McCall <rjmccall@apple.com> | 2010-08-26 09:15:37 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-08-26 09:15:37 +0000 |
commit | b1be523752355213d751deebba285f96b6000330 (patch) | |
tree | 8eb49f5e07b69fd6f8b40eb7afc8416d325c962d /clang/lib/Sema/SemaAttr.cpp | |
parent | a9a0599b39ee4fb97c82d36733349840372fb7c5 (diff) | |
download | bcm5719-llvm-b1be523752355213d751deebba285f96b6000330.tar.gz bcm5719-llvm-b1be523752355213d751deebba285f96b6000330.zip |
Move things around so that Sema.h no longer depends on even DeclBase.h.
It still depends on Type because DeclarationName.h does.
llvm-svn: 112177
Diffstat (limited to 'clang/lib/Sema/SemaAttr.cpp')
-rw-r--r-- | clang/lib/Sema/SemaAttr.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/clang/lib/Sema/SemaAttr.cpp b/clang/lib/Sema/SemaAttr.cpp index 4ba1a236ff8..917bf2bc3b6 100644 --- a/clang/lib/Sema/SemaAttr.cpp +++ b/clang/lib/Sema/SemaAttr.cpp @@ -315,6 +315,16 @@ void Sema::FreeVisContext() { VisContext = 0; } +static void PushPragmaVisibility(Sema &S, VisibilityAttr::VisibilityType type, + SourceLocation loc) { + // Put visibility on stack. + if (!S.VisContext) + S.VisContext = new VisStack; + + VisStack *Stack = static_cast<VisStack*>(S.VisContext); + Stack->push_back(std::make_pair(type, loc)); +} + void Sema::ActOnPragmaVisibility(bool IsPush, const IdentifierInfo* VisType, SourceLocation PragmaLoc) { if (IsPush) { @@ -333,20 +343,14 @@ void Sema::ActOnPragmaVisibility(bool IsPush, const IdentifierInfo* VisType, VisType->getName(); return; } - PushPragmaVisibility(type, PragmaLoc); + PushPragmaVisibility(*this, type, PragmaLoc); } else { PopPragmaVisibility(); } } -void Sema::PushPragmaVisibility(VisibilityAttr::VisibilityType type, - SourceLocation loc) { - // Put visibility on stack. - if (!VisContext) - VisContext = new VisStack; - - VisStack *Stack = static_cast<VisStack*>(VisContext); - Stack->push_back(std::make_pair(type, loc)); +void Sema::PushVisibilityAttr(const VisibilityAttr *Attr) { + PushPragmaVisibility(*this, Attr->getVisibility(), Attr->getLocation()); } void Sema::PopPragmaVisibility() { |