]> granicus.if.org Git - clang/commitdiff
Move instantiateTemplateAttribute into the sema namespace, make helpers static.
authorBenjamin Kramer <benny.kra@googlemail.com>
Mon, 6 Feb 2012 11:13:08 +0000 (11:13 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Mon, 6 Feb 2012 11:13:08 +0000 (11:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149864 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/LayoutOverrideSource.cpp
lib/Lex/ModuleMap.cpp
lib/Sema/SemaExpr.cpp
lib/Sema/SemaTemplateInstantiate.cpp
lib/Sema/SemaTemplateInstantiateDecl.cpp
utils/TableGen/ClangAttrEmitter.cpp

index 9cc066785052acb874d0ebf3d8d982e46dcf6073..eb7865e1124a39264f919551fcf9e6d8043c1327 100644 (file)
@@ -15,7 +15,7 @@
 using namespace clang;
 
 /// \brief Parse a simple identifier.
-std::string parseName(StringRef S) {
+static std::string parseName(StringRef S) {
   unsigned Offset = 0;
   while (Offset < S.size() &&
          (isalpha(S[Offset]) || S[Offset] == '_' ||
index 84ac08081ea4ea51e2563c6c79033951f33d93d4..1f56a2f941d9443db6c591d1c069425bfef6df91 100644 (file)
@@ -1015,7 +1015,8 @@ void ModuleMapParser::parseRequiresDecl() {
 
 /// \brief Append to \p Paths the set of paths needed to get to the 
 /// subframework in which the given module lives.
-void appendSubframeworkPaths(Module *Mod, llvm::SmallVectorImpl<char> &Path) {
+static void appendSubframeworkPaths(Module *Mod,
+                                    llvm::SmallVectorImpl<char> &Path) {
   // Collect the framework names from the given module to the top-level module.
   llvm::SmallVector<StringRef, 2> Paths;
   for (; Mod; Mod = Mod->Parent) {
index 2a9fd61d9c2c67509ed8a14a49b6cb608ff37219..15dfb0b8c202970a77a18ec1f87f63be03b1775d 100644 (file)
@@ -9325,7 +9325,7 @@ ExprResult Sema::HandleExprEvaluationContextForTypeof(Expr *E) {
   return TranformToPotentiallyEvaluated(E);
 }
 
-bool IsPotentiallyEvaluatedContext(Sema &SemaRef) {
+static bool IsPotentiallyEvaluatedContext(Sema &SemaRef) {
   // Do not mark anything as "used" within a dependent context; wait for
   // an instantiation.
   if (SemaRef.CurContext->isDependentContext())
index dde782672fa173cc96e3fca95cf70cf53a14e3af..8abb6e149a5fa91ce79e2320c27c1ebc4ccbb755 100644 (file)
@@ -1665,8 +1665,12 @@ Sema::SubstBaseSpecifiers(CXXRecordDecl *Instantiation,
 }
 
 // Defined via #include from SemaTemplateInstantiateDecl.cpp
-Attr* instantiateTemplateAttribute(const Attr *At, ASTContext &C, Sema &S,
-        const MultiLevelTemplateArgumentList &TemplateArgs);
+namespace clang {
+  namespace sema {
+    Attr *instantiateTemplateAttribute(const Attr *At, ASTContext &C, Sema &S,
+                            const MultiLevelTemplateArgumentList &TemplateArgs);
+  }
+}
 
 /// \brief Instantiate the definition of a class from a given pattern.
 ///
index a957f25ef2747e173a239c1622d51709be57d761..3cf816a332f826c149068ddd4c54d8f4f5ba804b 100644 (file)
@@ -100,8 +100,8 @@ void Sema::InstantiateAttrs(const MultiLevelTemplateArgumentList &TemplateArgs,
         Saved = CurrentInstantiationScope->cloneScopes(OuterMostScope);
       LateAttrs->push_back(LateInstantiatedAttribute(TmplAttr, Saved, New));
     } else {
-      Attr *NewAttr =
-        instantiateTemplateAttribute(TmplAttr, Context, *this, TemplateArgs);
+      Attr *NewAttr = sema::instantiateTemplateAttribute(TmplAttr, Context,
+                                                         *this, TemplateArgs);
       New->addAttr(NewAttr);
     }
   }
index 7db1ababb10ab38d22f94c3dbbcee26477d45f00..38889ec98cd09c2b22707482308a9f558b868172 100644 (file)
@@ -942,7 +942,9 @@ void ClangAttrTemplateInstantiateEmitter::run(raw_ostream &OS) {
 
   std::vector<Record*> Attrs = Records.getAllDerivedDefinitions("Attr");
 
-  OS << "Attr* instantiateTemplateAttribute(const Attr *At, ASTContext &C, "
+  OS << "namespace clang {\n"
+     << "namespace sema {\n\n"
+     << "Attr *instantiateTemplateAttribute(const Attr *At, ASTContext &C, "
      << "Sema &S,\n"
      << "        const MultiLevelTemplateArgumentList &TemplateArgs) {\n"
      << "  switch (At->getKind()) {\n"
@@ -992,6 +994,8 @@ void ClangAttrTemplateInstantiateEmitter::run(raw_ostream &OS) {
   OS << "  } // end switch\n"
      << "  llvm_unreachable(\"Unknown attribute!\");\n"
      << "  return 0;\n"
-     << "}\n\n";
+     << "}\n\n"
+     << "} // end namespace sema\n"
+     << "} // end namespace clang\n";
 }