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] == '_' ||
/// \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) {
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())
}
// 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.
///
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);
}
}
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"
OS << " } // end switch\n"
<< " llvm_unreachable(\"Unknown attribute!\");\n"
<< " return 0;\n"
- << "}\n\n";
+ << "}\n\n"
+ << "} // end namespace sema\n"
+ << "} // end namespace clang\n";
}