[cfe-commits] r149864 - in /cfe/trunk: lib/Frontend/LayoutOverrideSource.cpp lib/Lex/ModuleMap.cpp lib/Sema/SemaExpr.cpp lib/Sema/SemaTemplateInstantiate.cpp lib/Sema/SemaTemplateInstantiateDecl.cpp utils/TableGen/ClangAttrEmitter.cpp
Benjamin Kramer
benny.kra at googlemail.com
Mon Feb 6 03:13:08 PST 2012
Author: d0k
Date: Mon Feb 6 05:13:08 2012
New Revision: 149864
URL: http://llvm.org/viewvc/llvm-project?rev=149864&view=rev
Log:
Move instantiateTemplateAttribute into the sema namespace, make helpers static.
Modified:
cfe/trunk/lib/Frontend/LayoutOverrideSource.cpp
cfe/trunk/lib/Lex/ModuleMap.cpp
cfe/trunk/lib/Sema/SemaExpr.cpp
cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp
cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp
cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp
Modified: cfe/trunk/lib/Frontend/LayoutOverrideSource.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/LayoutOverrideSource.cpp?rev=149864&r1=149863&r2=149864&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/LayoutOverrideSource.cpp (original)
+++ cfe/trunk/lib/Frontend/LayoutOverrideSource.cpp Mon Feb 6 05:13:08 2012
@@ -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] == '_' ||
Modified: cfe/trunk/lib/Lex/ModuleMap.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/ModuleMap.cpp?rev=149864&r1=149863&r2=149864&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/ModuleMap.cpp (original)
+++ cfe/trunk/lib/Lex/ModuleMap.cpp Mon Feb 6 05:13:08 2012
@@ -1015,7 +1015,8 @@
/// \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) {
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=149864&r1=149863&r2=149864&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Mon Feb 6 05:13:08 2012
@@ -9325,7 +9325,7 @@
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())
Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp?rev=149864&r1=149863&r2=149864&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp Mon Feb 6 05:13:08 2012
@@ -1665,8 +1665,12 @@
}
// 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.
///
Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp?rev=149864&r1=149863&r2=149864&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp Mon Feb 6 05:13:08 2012
@@ -100,8 +100,8 @@
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);
}
}
Modified: cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp?rev=149864&r1=149863&r2=149864&view=diff
==============================================================================
--- cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp (original)
+++ cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp Mon Feb 6 05:13:08 2012
@@ -942,7 +942,9 @@
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 @@
OS << " } // end switch\n"
<< " llvm_unreachable(\"Unknown attribute!\");\n"
<< " return 0;\n"
- << "}\n\n";
+ << "}\n\n"
+ << "} // end namespace sema\n"
+ << "} // end namespace clang\n";
}
More information about the cfe-commits
mailing list