Move things around so that Sema.h no longer depends on even DeclBase.h.
It still depends on Type because DeclarationName.h does.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112177 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaAttr.cpp b/lib/Sema/SemaAttr.cpp
index 4ba1a23..917bf2b 100644
--- a/lib/Sema/SemaAttr.cpp
+++ b/lib/Sema/SemaAttr.cpp
@@ -315,6 +315,16 @@
   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 @@
         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() {