aboutsummaryrefslogtreecommitdiff
path: root/utils/TableGen/ClangAttrEmitter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'utils/TableGen/ClangAttrEmitter.cpp')
-rw-r--r--utils/TableGen/ClangAttrEmitter.cpp264
1 files changed, 162 insertions, 102 deletions
diff --git a/utils/TableGen/ClangAttrEmitter.cpp b/utils/TableGen/ClangAttrEmitter.cpp
index f315262ad0f4..0d92a321c747 100644
--- a/utils/TableGen/ClangAttrEmitter.cpp
+++ b/utils/TableGen/ClangAttrEmitter.cpp
@@ -10,6 +10,8 @@
//
//===----------------------------------------------------------------------===//
+#include "TableGenBackends.h"
+
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DenseSet.h"
@@ -303,6 +305,8 @@ namespace {
std::string getIsOmitted() const override {
if (type == "IdentifierInfo *")
return "!get" + getUpperName().str() + "()";
+ if (type == "TypeSourceInfo *")
+ return "!get" + getUpperName().str() + "Loc()";
if (type == "ParamIdx")
return "!get" + getUpperName().str() + "().isValid()";
return "false";
@@ -336,6 +340,8 @@ namespace {
<< " OS << \" \" << SA->get" << getUpperName()
<< "()->getName();\n";
} else if (type == "TypeSourceInfo *") {
+ if (isOptional())
+ OS << " if (SA->get" << getUpperName() << "Loc())";
OS << " OS << \" \" << SA->get" << getUpperName()
<< "().getAsString();\n";
} else if (type == "bool") {
@@ -1251,51 +1257,51 @@ createArgument(const Record &Arg, StringRef Attr,
llvm::StringRef ArgName = Search->getName();
if (ArgName == "AlignedArgument")
- Ptr = llvm::make_unique<AlignedArgument>(Arg, Attr);
+ Ptr = std::make_unique<AlignedArgument>(Arg, Attr);
else if (ArgName == "EnumArgument")
- Ptr = llvm::make_unique<EnumArgument>(Arg, Attr);
+ Ptr = std::make_unique<EnumArgument>(Arg, Attr);
else if (ArgName == "ExprArgument")
- Ptr = llvm::make_unique<ExprArgument>(Arg, Attr);
+ Ptr = std::make_unique<ExprArgument>(Arg, Attr);
else if (ArgName == "FunctionArgument")
- Ptr = llvm::make_unique<SimpleArgument>(Arg, Attr, "FunctionDecl *");
+ Ptr = std::make_unique<SimpleArgument>(Arg, Attr, "FunctionDecl *");
else if (ArgName == "NamedArgument")
- Ptr = llvm::make_unique<SimpleArgument>(Arg, Attr, "NamedDecl *");
+ Ptr = std::make_unique<SimpleArgument>(Arg, Attr, "NamedDecl *");
else if (ArgName == "IdentifierArgument")
- Ptr = llvm::make_unique<SimpleArgument>(Arg, Attr, "IdentifierInfo *");
+ Ptr = std::make_unique<SimpleArgument>(Arg, Attr, "IdentifierInfo *");
else if (ArgName == "DefaultBoolArgument")
- Ptr = llvm::make_unique<DefaultSimpleArgument>(
+ Ptr = std::make_unique<DefaultSimpleArgument>(
Arg, Attr, "bool", Arg.getValueAsBit("Default"));
else if (ArgName == "BoolArgument")
- Ptr = llvm::make_unique<SimpleArgument>(Arg, Attr, "bool");
+ Ptr = std::make_unique<SimpleArgument>(Arg, Attr, "bool");
else if (ArgName == "DefaultIntArgument")
- Ptr = llvm::make_unique<DefaultSimpleArgument>(
+ Ptr = std::make_unique<DefaultSimpleArgument>(
Arg, Attr, "int", Arg.getValueAsInt("Default"));
else if (ArgName == "IntArgument")
- Ptr = llvm::make_unique<SimpleArgument>(Arg, Attr, "int");
+ Ptr = std::make_unique<SimpleArgument>(Arg, Attr, "int");
else if (ArgName == "StringArgument")
- Ptr = llvm::make_unique<StringArgument>(Arg, Attr);
+ Ptr = std::make_unique<StringArgument>(Arg, Attr);
else if (ArgName == "TypeArgument")
- Ptr = llvm::make_unique<TypeArgument>(Arg, Attr);
+ Ptr = std::make_unique<TypeArgument>(Arg, Attr);
else if (ArgName == "UnsignedArgument")
- Ptr = llvm::make_unique<SimpleArgument>(Arg, Attr, "unsigned");
+ Ptr = std::make_unique<SimpleArgument>(Arg, Attr, "unsigned");
else if (ArgName == "VariadicUnsignedArgument")
- Ptr = llvm::make_unique<VariadicArgument>(Arg, Attr, "unsigned");
+ Ptr = std::make_unique<VariadicArgument>(Arg, Attr, "unsigned");
else if (ArgName == "VariadicStringArgument")
- Ptr = llvm::make_unique<VariadicStringArgument>(Arg, Attr);
+ Ptr = std::make_unique<VariadicStringArgument>(Arg, Attr);
else if (ArgName == "VariadicEnumArgument")
- Ptr = llvm::make_unique<VariadicEnumArgument>(Arg, Attr);
+ Ptr = std::make_unique<VariadicEnumArgument>(Arg, Attr);
else if (ArgName == "VariadicExprArgument")
- Ptr = llvm::make_unique<VariadicExprArgument>(Arg, Attr);
+ Ptr = std::make_unique<VariadicExprArgument>(Arg, Attr);
else if (ArgName == "VariadicParamIdxArgument")
- Ptr = llvm::make_unique<VariadicParamIdxArgument>(Arg, Attr);
+ Ptr = std::make_unique<VariadicParamIdxArgument>(Arg, Attr);
else if (ArgName == "VariadicParamOrParamIdxArgument")
- Ptr = llvm::make_unique<VariadicParamOrParamIdxArgument>(Arg, Attr);
+ Ptr = std::make_unique<VariadicParamOrParamIdxArgument>(Arg, Attr);
else if (ArgName == "ParamIdxArgument")
- Ptr = llvm::make_unique<SimpleArgument>(Arg, Attr, "ParamIdx");
+ Ptr = std::make_unique<SimpleArgument>(Arg, Attr, "ParamIdx");
else if (ArgName == "VariadicIdentifierArgument")
- Ptr = llvm::make_unique<VariadicIdentifierArgument>(Arg, Attr);
+ Ptr = std::make_unique<VariadicIdentifierArgument>(Arg, Attr);
else if (ArgName == "VersionArgument")
- Ptr = llvm::make_unique<VersionArgument>(Arg, Attr);
+ Ptr = std::make_unique<VersionArgument>(Arg, Attr);
if (!Ptr) {
// Search in reverse order so that the most-derived type is handled first.
@@ -1343,7 +1349,7 @@ static void writeGetSpellingFunction(Record &R, raw_ostream &OS) {
return;
}
- OS << " switch (SpellingListIndex) {\n"
+ OS << " switch (getAttributeSpellingListIndex()) {\n"
" default:\n"
" llvm_unreachable(\"Unknown attribute spelling!\");\n"
" return \"(No spelling)\";\n";
@@ -1371,11 +1377,10 @@ writePrettyPrintFunction(Record &R,
return;
}
- OS <<
- " switch (SpellingListIndex) {\n"
- " default:\n"
- " llvm_unreachable(\"Unknown attribute spelling!\");\n"
- " break;\n";
+ OS << " switch (getAttributeSpellingListIndex()) {\n"
+ " default:\n"
+ " llvm_unreachable(\"Unknown attribute spelling!\");\n"
+ " break;\n";
for (unsigned I = 0; I < Spellings.size(); ++ I) {
llvm::SmallString<16> Prefix;
@@ -1556,11 +1561,12 @@ static void writeAttrAccessorDefinition(const Record &R, raw_ostream &OS) {
const StringRef Name = Accessor->getValueAsString("Name");
std::vector<FlattenedSpelling> Spellings = GetFlattenedSpellings(*Accessor);
- OS << " bool " << Name << "() const { return SpellingListIndex == ";
+ OS << " bool " << Name
+ << "() const { return getAttributeSpellingListIndex() == ";
for (unsigned Index = 0; Index < Spellings.size(); ++Index) {
OS << getSpellingListIndex(SpellingList, Spellings[Index]);
if (Index != Spellings.size() - 1)
- OS << " ||\n SpellingListIndex == ";
+ OS << " ||\n getAttributeSpellingListIndex() == ";
else
OS << "; }\n";
}
@@ -1592,6 +1598,13 @@ CreateSemanticSpellings(const std::vector<FlattenedSpelling> &Spellings,
std::string Ret(" enum Spelling {\n");
std::set<std::string> Uniques;
unsigned Idx = 0;
+
+ // If we have a need to have this many spellings we likely need to add an
+ // extra bit to the SpellingIndex in AttributeCommonInfo, then increase the
+ // value of SpellingNotCalculated there and here.
+ assert(Spellings.size() < 15 &&
+ "Too many spellings, would step on SpellingNotCalculated in "
+ "AttributeCommonInfo");
for (auto I = Spellings.begin(), E = Spellings.end(); I != E; ++I, ++Idx) {
const FlattenedSpelling &S = *I;
const std::string &Variety = S.variety();
@@ -1625,6 +1638,7 @@ CreateSemanticSpellings(const std::vector<FlattenedSpelling> &Spellings,
// enumerator.
Ret += " " + EnumName + " = " + llvm::utostr(Idx);
}
+ Ret += ",\n SpellingNotCalculated = 15\n";
Ret += "\n };\n\n";
return Ret;
}
@@ -2207,16 +2221,15 @@ static void emitClangAttrThisIsaIdentifierArgList(RecordKeeper &Records,
OS << "#endif // CLANG_ATTR_THIS_ISA_IDENTIFIER_ARG_LIST\n\n";
}
-namespace clang {
-
// Emits the class definitions for attributes.
-void EmitClangAttrClass(RecordKeeper &Records, raw_ostream &OS) {
+void clang::EmitClangAttrClass(RecordKeeper &Records, raw_ostream &OS) {
emitSourceFileHeader("Attribute classes' definitions", OS);
OS << "#ifndef LLVM_CLANG_ATTR_CLASSES_INC\n";
OS << "#define LLVM_CLANG_ATTR_CLASSES_INC\n\n";
std::vector<Record*> Attrs = Records.getAllDerivedDefinitions("Attr");
+ ParsedAttrMap AttrMap = getParsedAttrList(Records);
for (const auto *Attr : Attrs) {
const Record &R = *Attr;
@@ -2285,38 +2298,97 @@ void EmitClangAttrClass(RecordKeeper &Records, raw_ostream &OS) {
if (!ElideSpelling)
OS << CreateSemanticSpellings(Spellings, SemanticToSyntacticMap);
+ const auto &ParsedAttrSpellingItr = llvm::find_if(
+ AttrMap, [R](const std::pair<std::string, const Record *> &P) {
+ return &R == P.second;
+ });
+
// Emit CreateImplicit factory methods.
- auto emitCreateImplicit = [&](bool emitFake) {
- OS << " static " << R.getName() << "Attr *CreateImplicit(";
+ auto emitCreate = [&](bool Implicit, bool emitFake) {
+ OS << " static " << R.getName() << "Attr *Create";
+ if (Implicit)
+ OS << "Implicit";
+ OS << "(";
OS << "ASTContext &Ctx";
- if (!ElideSpelling)
- OS << ", Spelling S";
for (auto const &ai : Args) {
if (ai->isFake() && !emitFake) continue;
OS << ", ";
ai->writeCtorParameters(OS);
}
- OS << ", SourceRange Loc = SourceRange()";
- OS << ") {\n";
+ OS << ", const AttributeCommonInfo &CommonInfo = {SourceRange{}}) {\n";
OS << " auto *A = new (Ctx) " << R.getName();
- OS << "Attr(Loc, Ctx, ";
+ OS << "Attr(Ctx, CommonInfo";
for (auto const &ai : Args) {
if (ai->isFake() && !emitFake) continue;
- ai->writeImplicitCtorArgs(OS);
OS << ", ";
+ ai->writeImplicitCtorArgs(OS);
+ }
+ OS << ");\n";
+ if (Implicit) {
+ OS << " A->setImplicit(true);\n";
+ }
+ if (Implicit || ElideSpelling) {
+ OS << " if (!A->isAttributeSpellingListCalculated() && "
+ "!A->getAttrName())\n";
+ OS << " A->setAttributeSpellingListIndex(0);\n";
}
- OS << (ElideSpelling ? "0" : "S") << ");\n";
- OS << " A->setImplicit(true);\n";
OS << " return A;\n }\n\n";
};
+ auto emitCreateNoCI = [&](bool Implicit, bool emitFake) {
+ OS <<" static " << R.getName() << "Attr *Create";
+ if (Implicit)
+ OS << "Implicit";
+ OS << "(";
+ OS << "ASTContext &Ctx";
+ for (auto const &ai : Args) {
+ if (ai->isFake() && !emitFake) continue;
+ OS << ", ";
+ ai->writeCtorParameters(OS);
+ }
+ OS << ", SourceRange Range, AttributeCommonInfo::Syntax Syntax";
+ if (!ElideSpelling)
+ OS << ", " << R.getName()
+ << "Attr::Spelling S = "
+ "static_cast<Spelling>(SpellingNotCalculated)";
+ OS << ") {\n";
+ OS << " AttributeCommonInfo I(Range, ";
+
+ if (ParsedAttrSpellingItr != std::end(AttrMap))
+ OS << "AT_" << ParsedAttrSpellingItr->first;
+ else
+ OS << "NoSemaHandlerAttribute";
+
+ OS << ", Syntax";
+ if (!ElideSpelling)
+ OS << ", S";
+ OS << ");\n";
+ OS << " return Create";
+ if (Implicit)
+ OS << "Implicit";
+ OS << "(Ctx";
+ for (auto const &ai : Args) {
+ if (ai->isFake() && !emitFake) continue;
+ OS << ", ";
+ ai->writeImplicitCtorArgs(OS);
+ }
+ OS << ", I);\n";
+ OS << " }\n";
+ };
+
+ auto emitCreates = [&](bool emitFake) {
+ emitCreate(true, emitFake);
+ emitCreate(false, emitFake);
+ emitCreateNoCI(true, emitFake);
+ emitCreateNoCI(false, emitFake);
+ };
+
// Emit a CreateImplicit that takes all the arguments.
- emitCreateImplicit(true);
+ emitCreates(true);
// Emit a CreateImplicit that takes all the non-fake arguments.
- if (HasFakeArg) {
- emitCreateImplicit(false);
- }
+ if (HasFakeArg)
+ emitCreates(false);
// Emit constructors.
auto emitCtor = [&](bool emitOpt, bool emitFake) {
@@ -2325,8 +2397,9 @@ void EmitClangAttrClass(RecordKeeper &Records, raw_ostream &OS) {
if (arg->isOptional()) return emitOpt;
return true;
};
-
- OS << " " << R.getName() << "Attr(SourceRange R, ASTContext &Ctx\n";
+ OS << " " << R.getName()
+ << "Attr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo";
+ OS << '\n';
for (auto const &ai : Args) {
if (!shouldEmitArg(ai)) continue;
OS << " , ";
@@ -2334,12 +2407,10 @@ void EmitClangAttrClass(RecordKeeper &Records, raw_ostream &OS) {
OS << "\n";
}
- OS << " , ";
- OS << "unsigned SI\n";
-
OS << " )\n";
- OS << " : " << SuperName << "(attr::" << R.getName() << ", R, SI, "
- << ( R.getValueAsBit("LateParsed") ? "true" : "false" );
+ OS << " : " << SuperName << "(Ctx, CommonInfo, ";
+ OS << "attr::" << R.getName() << ", "
+ << (R.getValueAsBit("LateParsed") ? "true" : "false");
if (Inheritable) {
OS << ", "
<< (R.getValueAsBit("InheritEvenIfAlreadyPresent") ? "true"
@@ -2371,14 +2442,12 @@ void EmitClangAttrClass(RecordKeeper &Records, raw_ostream &OS) {
emitCtor(true, true);
// Emit a constructor that takes all the non-fake arguments.
- if (HasFakeArg) {
+ if (HasFakeArg)
emitCtor(true, false);
- }
// Emit a constructor that takes all the non-fake, non-optional arguments.
- if (HasOptArg) {
+ if (HasOptArg)
emitCtor(false, false);
- }
OS << " " << R.getName() << "Attr *clone(ASTContext &C) const;\n";
OS << " void printPretty(raw_ostream &OS,\n"
@@ -2388,8 +2457,8 @@ void EmitClangAttrClass(RecordKeeper &Records, raw_ostream &OS) {
if (!ElideSpelling) {
assert(!SemanticToSyntacticMap.empty() && "Empty semantic mapping list");
OS << " Spelling getSemanticSpelling() const {\n";
- WriteSemanticSpellingSwitch("SpellingListIndex", SemanticToSyntacticMap,
- OS);
+ WriteSemanticSpellingSwitch("getAttributeSpellingListIndex()",
+ SemanticToSyntacticMap, OS);
OS << " }\n";
}
@@ -2422,7 +2491,7 @@ void EmitClangAttrClass(RecordKeeper &Records, raw_ostream &OS) {
}
// Emits the class method definitions for attributes.
-void EmitClangAttrImpl(RecordKeeper &Records, raw_ostream &OS) {
+void clang::EmitClangAttrImpl(RecordKeeper &Records, raw_ostream &OS) {
emitSourceFileHeader("Attribute classes' member function definitions", OS);
std::vector<Record*> Attrs = Records.getAllDerivedDefinitions("Attr");
@@ -2443,15 +2512,15 @@ void EmitClangAttrImpl(RecordKeeper &Records, raw_ostream &OS) {
OS << R.getName() << "Attr *" << R.getName()
<< "Attr::clone(ASTContext &C) const {\n";
- OS << " auto *A = new (C) " << R.getName() << "Attr(getLocation(), C";
+ OS << " auto *A = new (C) " << R.getName() << "Attr(C, *this";
for (auto const &ai : Args) {
OS << ", ";
ai->writeCloneArgs(OS);
}
- OS << ", getSpellingListIndex());\n";
+ OS << ");\n";
OS << " A->Inherited = Inherited;\n";
OS << " A->IsPackExpansion = IsPackExpansion;\n";
- OS << " A->Implicit = Implicit;\n";
+ OS << " A->setImplicit(Implicit);\n";
OS << " return A;\n}\n\n";
writePrettyPrintFunction(R, Args, OS);
@@ -2487,8 +2556,6 @@ void EmitClangAttrImpl(RecordKeeper &Records, raw_ostream &OS) {
EmitFunc("printPretty(OS, Policy)");
}
-} // end namespace clang
-
static void emitAttrList(raw_ostream &OS, StringRef Class,
const std::vector<Record*> &AttrList) {
for (auto Cur : AttrList) {
@@ -2751,24 +2818,23 @@ void EmitClangAttrPCHRead(RecordKeeper &Records, raw_ostream &OS) {
const Record &R = *Attr;
if (!R.getValueAsBit("ASTNode"))
continue;
-
+
OS << " case attr::" << R.getName() << ": {\n";
if (R.isSubClassOf(InhClass))
OS << " bool isInherited = Record.readInt();\n";
OS << " bool isImplicit = Record.readInt();\n";
- OS << " unsigned Spelling = Record.readInt();\n";
ArgRecords = R.getValueAsListOfDefs("Args");
Args.clear();
for (const auto *Arg : ArgRecords) {
Args.emplace_back(createArgument(*Arg, R.getName()));
Args.back()->writePCHReadDecls(OS);
}
- OS << " New = new (Context) " << R.getName() << "Attr(Range, Context";
+ OS << " New = new (Context) " << R.getName() << "Attr(Context, Info";
for (auto const &ri : Args) {
OS << ", ";
ri->writePCHReadArgs(OS);
}
- OS << ", Spelling);\n";
+ OS << ");\n";
if (R.isSubClassOf(InhClass))
OS << " cast<InheritableAttr>(New)->setInherited(isInherited);\n";
OS << " New->setImplicit(isImplicit);\n";
@@ -2798,7 +2864,6 @@ void EmitClangAttrPCHWrite(RecordKeeper &Records, raw_ostream &OS) {
if (R.isSubClassOf(InhClass))
OS << " Record.push_back(SA->isInherited());\n";
OS << " Record.push_back(A->isImplicit());\n";
- OS << " Record.push_back(A->getSpellingListIndex());\n";
for (const auto *Arg : Args)
createArgument(*Arg, R.getName())->writePCHWrite(OS);
@@ -3015,7 +3080,11 @@ void EmitClangAttrSpellingListIndex(RecordKeeper &Records, raw_ostream &OS) {
emitSourceFileHeader("Code to translate different attribute spellings "
"into internal identifiers", OS);
- OS << " switch (AttrKind) {\n";
+ OS << " switch (getParsedKind()) {\n";
+ OS << " case IgnoredAttribute:\n";
+ OS << " case UnknownAttribute:\n";
+ OS << " case NoSemaHandlerAttribute:\n";
+ OS << " llvm_unreachable(\"Ignored/unknown shouldn't get here\");\n";
ParsedAttrMap Attrs = getParsedAttrList(Records);
for (const auto &I : Attrs) {
@@ -3024,16 +3093,7 @@ void EmitClangAttrSpellingListIndex(RecordKeeper &Records, raw_ostream &OS) {
OS << " case AT_" << I.first << ": {\n";
for (unsigned I = 0; I < Spellings.size(); ++ I) {
OS << " if (Name == \"" << Spellings[I].name() << "\" && "
- << "SyntaxUsed == "
- << StringSwitch<unsigned>(Spellings[I].variety())
- .Case("GNU", 0)
- .Case("CXX11", 1)
- .Case("C2x", 2)
- .Case("Declspec", 3)
- .Case("Microsoft", 4)
- .Case("Keyword", 5)
- .Case("Pragma", 6)
- .Default(0)
+ << "getSyntax() == AttributeCommonInfo::AS_" << Spellings[I].variety()
<< " && Scope == \"" << Spellings[I].nameSpace() << "\")\n"
<< " return " << I << ";\n";
}
@@ -3154,12 +3214,12 @@ void EmitClangAttrTemplateInstantiateHelper(const std::vector<Record *> &Attrs,
for (auto const &ai : Args)
ai->writeTemplateInstantiation(OS);
- OS << " return new (C) " << R.getName() << "Attr(A->getLocation(), C";
+ OS << " return new (C) " << R.getName() << "Attr(C, *A";
for (auto const &ai : Args) {
OS << ", ";
ai->writeTemplateInstantiationArgs(OS);
}
- OS << ", A->getSpellingListIndex());\n }\n";
+ OS << ");\n }\n";
}
OS << " } // end switch\n"
<< " llvm_unreachable(\"Unknown attribute!\");\n"
@@ -3477,7 +3537,7 @@ static std::string GenerateLangOptRequirements(const Record &R,
OS << " if (" << GenerateTestExpression(LangOpts) << ")\n";
OS << " return true;\n\n";
OS << " S.Diag(Attr.getLoc(), diag::warn_attribute_ignored) ";
- OS << "<< Attr.getName();\n";
+ OS << "<< Attr;\n";
OS << " return false;\n";
OS << "}\n\n";
@@ -3671,10 +3731,10 @@ void EmitClangAttrParsedAttrKinds(RecordKeeper &Records, raw_ostream &OS) {
// specific attribute, or MSP430-specific attribute. Additionally, an
// attribute can be spelled GNU<"dllexport"> and Declspec<"dllexport">
// for the same semantic attribute. Ultimately, we need to map each of
- // these to a single ParsedAttr::Kind value, but the StringMatcher
- // class cannot handle duplicate match strings. So we generate a list of
- // string to match based on the syntax, and emit multiple string matchers
- // depending on the syntax used.
+ // these to a single AttributeCommonInfo::Kind value, but the
+ // StringMatcher class cannot handle duplicate match strings. So we
+ // generate a list of string to match based on the syntax, and emit
+ // multiple string matchers depending on the syntax used.
std::string AttrName;
if (Attr.isSubClassOf("TargetSpecificAttr") &&
!Attr.isValueUnset("ParseKind")) {
@@ -3719,33 +3779,33 @@ void EmitClangAttrParsedAttrKinds(RecordKeeper &Records, raw_ostream &OS) {
if (SemaHandler)
Matches->push_back(StringMatcher::StringPair(
- Spelling, "return ParsedAttr::AT_" + AttrName + ";"));
+ Spelling, "return AttributeCommonInfo::AT_" + AttrName + ";"));
else
Matches->push_back(StringMatcher::StringPair(
- Spelling, "return ParsedAttr::IgnoredAttribute;"));
+ Spelling, "return AttributeCommonInfo::IgnoredAttribute;"));
}
}
}
- OS << "static ParsedAttr::Kind getAttrKind(StringRef Name, ";
- OS << "ParsedAttr::Syntax Syntax) {\n";
- OS << " if (ParsedAttr::AS_GNU == Syntax) {\n";
+ OS << "static AttributeCommonInfo::Kind getAttrKind(StringRef Name, ";
+ OS << "AttributeCommonInfo::Syntax Syntax) {\n";
+ OS << " if (AttributeCommonInfo::AS_GNU == Syntax) {\n";
StringMatcher("Name", GNU, OS).Emit();
- OS << " } else if (ParsedAttr::AS_Declspec == Syntax) {\n";
+ OS << " } else if (AttributeCommonInfo::AS_Declspec == Syntax) {\n";
StringMatcher("Name", Declspec, OS).Emit();
- OS << " } else if (ParsedAttr::AS_Microsoft == Syntax) {\n";
+ OS << " } else if (AttributeCommonInfo::AS_Microsoft == Syntax) {\n";
StringMatcher("Name", Microsoft, OS).Emit();
- OS << " } else if (ParsedAttr::AS_CXX11 == Syntax) {\n";
+ OS << " } else if (AttributeCommonInfo::AS_CXX11 == Syntax) {\n";
StringMatcher("Name", CXX11, OS).Emit();
- OS << " } else if (ParsedAttr::AS_C2x == Syntax) {\n";
+ OS << " } else if (AttributeCommonInfo::AS_C2x == Syntax) {\n";
StringMatcher("Name", C2x, OS).Emit();
- OS << " } else if (ParsedAttr::AS_Keyword == Syntax || ";
- OS << "ParsedAttr::AS_ContextSensitiveKeyword == Syntax) {\n";
+ OS << " } else if (AttributeCommonInfo::AS_Keyword == Syntax || ";
+ OS << "AttributeCommonInfo::AS_ContextSensitiveKeyword == Syntax) {\n";
StringMatcher("Name", Keywords, OS).Emit();
- OS << " } else if (ParsedAttr::AS_Pragma == Syntax) {\n";
+ OS << " } else if (AttributeCommonInfo::AS_Pragma == Syntax) {\n";
StringMatcher("Name", Pragma, OS).Emit();
OS << " }\n";
- OS << " return ParsedAttr::UnknownAttribute;\n"
+ OS << " return AttributeCommonInfo::UnknownAttribute;\n"
<< "}\n";
}