Index: include/clang/Sema/AttributeList.h =================================================================== --- include/clang/Sema/AttributeList.h +++ include/clang/Sema/AttributeList.h @@ -22,12 +22,15 @@ #include "llvm/ADT/PointerUnion.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Support/Allocator.h" +#include "llvm/Support/Registry.h" #include namespace clang { class ASTContext; class IdentifierInfo; class Expr; + class Sema; + class AttributeList; /// \brief Represents information about a change in availability for /// an entity, which is part of the encoding of the 'availability' @@ -82,6 +85,53 @@ typedef llvm::PointerUnion ArgsUnion; typedef llvm::SmallVector ArgsVector; +struct ParsedAttrInfo { + /// Corresponds to the AttributeList::Kind enum + unsigned AttrKind : 16; + /// Corresponds to the AttributeList::Syntax enum + unsigned Syntax : 3; + /// The number of required arguments of this attribute + unsigned NumArgs : 4; + /// The number of optional arguments of this attributes + unsigned OptArgs : 4; + /// True if the parsing does not match the semantic content + unsigned HasCustomParsing : 1; + /// True if this attribute is only available for certain targets + unsigned IsTargetSpecific : 1; + /// True if this attribute applies to types + unsigned IsType : 1; + /// True if this attribute applies to statements + unsigned IsStmt : 1; + /// True if this attribute has any spellings that are known to gcc + unsigned IsKnownToGCC : 1; + + ParsedAttrInfo() + : AttrKind(0), Syntax(0), NumArgs(0), OptArgs(0), HasCustomParsing(0), + IsTargetSpecific(0), IsType(0), IsStmt(0), IsKnownToGCC(0) { } + + virtual ~ParsedAttrInfo() {} + + /// Check if this attribute appertains to D, and issue a diagnostic if not + virtual bool diagAppertainsToDecl(Sema &S, const AttributeList &Attr, + const Decl *D) const { + return true; + } + /// Check if this attribute is allowed by the language we are compiling, and + /// issue a diagnostic if not + virtual bool diagLangOpts(Sema &S, const AttributeList &Attr) const { + return true; + } + /// Check if this attribute is allowed when compiling for the given target + virtual bool existsInTarget(const TargetInfo &Target) const { + return true; + } + /// Convert the spelling index of Attr to a semantic spelling enum value + virtual unsigned + spellingIndexToSemanticSpelling(const AttributeList &Attr) const { + return UINT_MAX; + } +}; + /// AttributeList - Represents a syntactic attribute. /// /// For a GNU attribute, there are four forms of this construct: @@ -118,7 +168,7 @@ SourceLocation ScopeLoc; SourceLocation EllipsisLoc; - unsigned AttrKind : 16; + std::unique_ptr Info; /// The number of expression arguments this attribute has. /// The expressions themselves are stored after the object. @@ -247,7 +297,7 @@ HasParsedType(false), HasProcessingCache(false), NextInPosition(nullptr), NextInPool(nullptr) { if (numArgs) memcpy(getArgsBuffer(), args, numArgs * sizeof(ArgsUnion)); - AttrKind = getKind(getName(), getScopeName(), syntaxUsed); + Info = getInfo(getName(), getScopeName(), syntaxUsed); } /// Constructor for availability attributes. @@ -270,7 +320,7 @@ memcpy(getArgsBuffer(), &PVal, sizeof(ArgsUnion)); new (getAvailabilityData()) AvailabilityData( introduced, deprecated, obsoleted, strict, replacementExpr); - AttrKind = getKind(getName(), getScopeName(), syntaxUsed); + Info = getInfo(getName(), getScopeName(), syntaxUsed); } /// Constructor for objc_bridge_related attributes. @@ -289,7 +339,7 @@ Args[0] = Parm1; Args[1] = Parm2; Args[2] = Parm3; - AttrKind = getKind(getName(), getScopeName(), syntaxUsed); + Info = getInfo(getName(), getScopeName(), syntaxUsed); } /// Constructor for type_tag_for_datatype attribute. @@ -308,7 +358,7 @@ new (&ExtraData.MatchingCType) ParsedType(matchingCType); ExtraData.LayoutCompatible = layoutCompatible; ExtraData.MustBeNull = mustBeNull; - AttrKind = getKind(getName(), getScopeName(), syntaxUsed); + Info = getInfo(getName(), getScopeName(), syntaxUsed); } /// Constructor for attributes with a single type argument. @@ -321,7 +371,7 @@ IsTypeTagForDatatype(false), IsProperty(false), HasParsedType(true), HasProcessingCache(false), NextInPosition(nullptr), NextInPool(nullptr){ new (&getTypeBuffer()) ParsedType(typeArg); - AttrKind = getKind(getName(), getScopeName(), syntaxUsed); + Info = getInfo(getName(), getScopeName(), syntaxUsed); } /// Constructor for microsoft __declspec(property) attribute. @@ -335,7 +385,7 @@ IsTypeTagForDatatype(false), IsProperty(true), HasParsedType(false), HasProcessingCache(false), NextInPosition(nullptr), NextInPool(nullptr) { new (&getPropertyDataBuffer()) PropertyData(getterId, setterId); - AttrKind = getKind(getName(), getScopeName(), syntaxUsed); + Info = getInfo(getName(), getScopeName(), syntaxUsed); } friend class AttributePool; @@ -402,9 +452,11 @@ bool isPackExpansion() const { return EllipsisLoc.isValid(); } SourceLocation getEllipsisLoc() const { return EllipsisLoc; } - Kind getKind() const { return Kind(AttrKind); } - static Kind getKind(const IdentifierInfo *Name, const IdentifierInfo *Scope, - Syntax SyntaxUsed); + const std::unique_ptr &getInfo() const { return Info; } + static std::unique_ptr getInfo(const IdentifierInfo *Name, + const IdentifierInfo *ScopeName, Syntax SyntaxUsed); + + Kind getKind() const { return Kind(Info->AttrKind); } AttributeList *getNext() const { return NextInPosition; } void setNext(AttributeList *N) { NextInPosition = N; } @@ -930,6 +982,8 @@ ExpectedNamedDecl, }; +typedef llvm::Registry AttrInfoRegistry; + } // end namespace clang #endif Index: include/clang/Sema/CMakeLists.txt =================================================================== --- include/clang/Sema/CMakeLists.txt +++ include/clang/Sema/CMakeLists.txt @@ -8,11 +8,6 @@ SOURCE ../Basic/Attr.td TARGET ClangAttrParsedAttrList) -clang_tablegen(AttrParsedAttrKinds.inc -gen-clang-attr-parsed-attr-kinds - -I ${CMAKE_CURRENT_SOURCE_DIR}/../../ - SOURCE ../Basic/Attr.td - TARGET ClangAttrParsedAttrKinds) - clang_tablegen(AttrSpellingListIndex.inc -gen-clang-attr-spelling-index -I ${CMAKE_CURRENT_SOURCE_DIR}/../../ SOURCE ../Basic/Attr.td Index: lib/Parse/ParseDecl.cpp =================================================================== --- lib/Parse/ParseDecl.cpp +++ lib/Parse/ParseDecl.cpp @@ -280,12 +280,14 @@ // Ignore the left paren location for now. ConsumeParen(); + std::unique_ptr Info = + AttributeList::getInfo(AttrName, ScopeName, Syntax); + ArgsVector ArgExprs; if (Tok.is(tok::identifier)) { // If this attribute wants an 'identifier' argument, make it so. bool IsIdentifierArg = attributeHasIdentifierArg(*AttrName); - AttributeList::Kind AttrKind = - AttributeList::getKind(AttrName, ScopeName, Syntax); + AttributeList::Kind AttrKind = AttributeList::Kind(Info->AttrKind); // If we don't know how to parse this attribute, but this is the only // token in this argument, assume it's meant to be an identifier. @@ -349,8 +351,9 @@ assert(Tok.is(tok::l_paren) && "Attribute arg list not starting with '('"); - AttributeList::Kind AttrKind = - AttributeList::getKind(AttrName, ScopeName, Syntax); + std::unique_ptr Info = + AttributeList::getInfo(AttrName, ScopeName, Syntax); + AttributeList::Kind AttrKind = AttributeList::Kind(Info->AttrKind); if (AttrKind == AttributeList::AT_Availability) { ParseAvailabilityAttribute(*AttrName, AttrNameLoc, Attrs, EndLoc, ScopeName, @@ -399,8 +402,9 @@ SourceLocation ScopeLoc, AttributeList::Syntax Syntax) { assert(Tok.is(tok::l_paren) && "Attribute arg list not starting with '('"); - AttributeList::Kind AttrKind = - AttributeList::getKind(AttrName, ScopeName, Syntax); + std::unique_ptr Info = + AttributeList::getInfo(AttrName, ScopeName, Syntax); + AttributeList::Kind AttrKind = AttributeList::Kind(Info->AttrKind); if (AttrKind == AttributeList::AT_ExternalSourceSymbol) { ParseExternalSourceSymbolAttribute(*AttrName, AttrNameLoc, Attrs, EndLoc, Index: lib/Parse/ParseDeclCXX.cpp =================================================================== --- lib/Parse/ParseDeclCXX.cpp +++ lib/Parse/ParseDeclCXX.cpp @@ -3796,8 +3796,8 @@ static bool IsBuiltInOrStandardCXX11Attribute(IdentifierInfo *AttrName, IdentifierInfo *ScopeName) { - switch (AttributeList::getKind(AttrName, ScopeName, - AttributeList::AS_CXX11)) { + switch (AttributeList::getInfo(AttrName, ScopeName, + AttributeList::AS_CXX11)->AttrKind) { case AttributeList::AT_CarriesDependency: case AttributeList::AT_Deprecated: case AttributeList::AT_FallThrough: Index: lib/Sema/AttributeList.cpp =================================================================== --- lib/Sema/AttributeList.cpp +++ lib/Sema/AttributeList.cpp @@ -22,6 +22,8 @@ #include "llvm/ADT/SmallString.h" using namespace clang; +LLVM_INSTANTIATE_REGISTRY(AttrInfoRegistry) + IdentifierLoc *IdentifierLoc::create(ASTContext &Ctx, SourceLocation Loc, IdentifierInfo *Ident) { IdentifierLoc *Result = new (Ctx) IdentifierLoc; @@ -106,8 +108,6 @@ } while (pool); } -#include "clang/Sema/AttrParsedAttrKinds.inc" - static StringRef normalizeAttrName(StringRef AttrName, StringRef ScopeName, AttributeList::Syntax SyntaxUsed) { // Normalize the attribute name, __foo__ becomes foo. This is only allowable @@ -121,9 +121,11 @@ return AttrName; } -AttributeList::Kind AttributeList::getKind(const IdentifierInfo *Name, - const IdentifierInfo *ScopeName, - Syntax SyntaxUsed) { +#include "clang/Sema/AttrParsedAttrImpl.inc" + +std::unique_ptr +AttributeList::getInfo(const IdentifierInfo *Name, + const IdentifierInfo *ScopeName, Syntax SyntaxUsed) { StringRef AttrName = Name->getName(); SmallString<64> FullName; @@ -138,7 +140,26 @@ FullName += "::"; FullName += AttrName; - return ::getAttrKind(FullName, SyntaxUsed); + // When context-sensitive keyword syntax is used it matches keyword attributes + if (SyntaxUsed == AS_ContextSensitiveKeyword) + SyntaxUsed = AS_Keyword; + + // Search for a ParsedAttrInfo whose name and syntax match + for (AttrInfoRegistry::iterator it = AttrInfoRegistry::begin(), + ie = AttrInfoRegistry::end(); + it != ie; ++it) { + if (FullName.equals(it->getName())) { + std::unique_ptr P = it->instantiate(); + if (P->Syntax == SyntaxUsed) { + return P; + } + } + } + + // If we failed to find a match then the attribute is unknown + std::unique_ptr ret = llvm::make_unique(); + ret->AttrKind = AttributeList::UnknownAttribute; + return ret; } unsigned AttributeList::getAttributeSpellingListIndex() const { @@ -147,86 +168,54 @@ StringRef Scope = ScopeName ? ScopeName->getName() : ""; StringRef Name = normalizeAttrName(AttrName->getName(), Scope, (AttributeList::Syntax)SyntaxUsed); + Kind AttrKind = Kind(getInfo()->AttrKind); #include "clang/Sema/AttrSpellingListIndex.inc" } -struct ParsedAttrInfo { - unsigned NumArgs : 4; - unsigned OptArgs : 4; - unsigned HasCustomParsing : 1; - unsigned IsTargetSpecific : 1; - unsigned IsType : 1; - unsigned IsStmt : 1; - unsigned IsKnownToGCC : 1; - - virtual bool diagAppertainsToDecl(Sema &S, const AttributeList &Attr, - const Decl *) const { - return true; - } - virtual bool diagLangOpts(Sema &S, const AttributeList &Attr) const { - return true; - } - virtual bool existsInTarget(const TargetInfo &Target) const { - return true; - } - virtual unsigned - spellingIndexToSemanticSpelling(const AttributeList &Attr) const { - return UINT_MAX; - } -}; - -namespace { - #include "clang/Sema/AttrParsedAttrImpl.inc" -} - -static const ParsedAttrInfo &getInfo(const AttributeList &A) { - return *AttrInfoMap[A.getKind()]; -} - unsigned AttributeList::getMinArgs() const { - return getInfo(*this).NumArgs; + return getInfo()->NumArgs; } unsigned AttributeList::getMaxArgs() const { - return getMinArgs() + getInfo(*this).OptArgs; + return getMinArgs() + getInfo()->OptArgs; } bool AttributeList::hasCustomParsing() const { - return getInfo(*this).HasCustomParsing; + return getInfo()->HasCustomParsing; } bool AttributeList::diagnoseAppertainsTo(Sema &S, const Decl *D) const { - return getInfo(*this).diagAppertainsToDecl(S, *this, D); + return getInfo()->diagAppertainsToDecl(S, *this, D); } bool AttributeList::diagnoseLangOpts(Sema &S) const { - return getInfo(*this).diagLangOpts(S, *this); + return getInfo()->diagLangOpts(S, *this); } bool AttributeList::isTargetSpecificAttr() const { - return getInfo(*this).IsTargetSpecific; + return getInfo()->IsTargetSpecific; } bool AttributeList::isTypeAttr() const { - return getInfo(*this).IsType; + return getInfo()->IsType; } bool AttributeList::isStmtAttr() const { - return getInfo(*this).IsStmt; + return getInfo()->IsStmt; } bool AttributeList::existsInTarget(const TargetInfo &Target) const { - return getInfo(*this).existsInTarget(Target); + return getInfo()->existsInTarget(Target); } bool AttributeList::isKnownToGCC() const { - return getInfo(*this).IsKnownToGCC; + return getInfo()->IsKnownToGCC; } unsigned AttributeList::getSemanticSpelling() const { - return getInfo(*this).spellingIndexToSemanticSpelling(*this); + return getInfo()->spellingIndexToSemanticSpelling(*this); } bool AttributeList::hasVariadicArg() const { @@ -234,5 +223,5 @@ // claim that as being variadic. If we someday get an attribute that // legitimately bumps up against that maximum, we can use another bit to track // whether it's truly variadic or not. - return getInfo(*this).OptArgs == 15; + return getInfo()->OptArgs == 15; } Index: utils/TableGen/ClangAttrEmitter.cpp =================================================================== --- utils/TableGen/ClangAttrEmitter.cpp +++ utils/TableGen/ClangAttrEmitter.cpp @@ -146,12 +146,14 @@ typedef std::vector> ParsedAttrMap; static ParsedAttrMap getParsedAttrList(const RecordKeeper &Records, + bool IncludeIgnored = false, ParsedAttrMap *Dupes = nullptr) { std::vector Attrs = Records.getAllDerivedDefinitions("Attr"); std::set Seen; ParsedAttrMap R; for (const auto *Attr : Attrs) { - if (Attr->getValueAsBit("SemaHandler")) { + if (Attr->getValueAsBit("SemaHandler") || + (IncludeIgnored && Attr->getValueAsBit("Ignored"))) { std::string AN; if (Attr->isSubClassOf("TargetSpecificAttr") && !Attr->isValueUnset("ParseKind")) { @@ -2860,144 +2862,58 @@ emitSourceFileHeader("Parsed attribute helpers", OS); // Get the list of parsed attributes, and accept the optional list of - // duplicates due to the ParseKind. + // duplicates due to the ParseKind. We also want to include ignored + // attributes as we want them to be successfully matched. ParsedAttrMap Dupes; - ParsedAttrMap Attrs = getParsedAttrList(Records, &Dupes); + ParsedAttrMap Attrs = getParsedAttrList(Records, true, &Dupes); - // Generate the appertainsTo diagnostic methods and write their names into - // another mapping. At the same time, generate the AttrInfoMap object - // contents. Due to the reliance on generated code, use separate streams so - // that code will not be interleaved. - for (auto I = Attrs.begin(), E = Attrs.end(); I != E; ++I) { + for (const auto &I : Attrs) { // TODO: If the attribute's kind appears in the list of duplicates, that is // because it is a target-specific attribute that appears multiple times. // It would be beneficial to test whether the duplicates are "similar // enough" to each other to not cause problems. For instance, check that // the spellings are identical, and custom parsing rules match, etc. - - // We need to generate struct instances based off ParsedAttrInfo from - // AttributeList.cpp. - const Record &Attr = *I->second; - OS << "struct ParsedAttrInfo" << I->first << " : public ParsedAttrInfo {\n"; - OS << " ParsedAttrInfo" << I->first << "() {\n"; - emitArgInfo(Attr, OS); - OS << " HasCustomParsing = "; - OS << Attr.getValueAsBit("HasCustomParsing") << ";\n"; - OS << " IsTargetSpecific = "; - OS << Attr.isSubClassOf("TargetSpecificAttr") << ";\n"; - OS << " IsType = "; - OS << Attr.isSubClassOf("TypeAttr") << ";\n"; - OS << " IsStmt = "; - OS << Attr.isSubClassOf("StmtAttr") << ";\n"; - OS << " IsKnownToGCC = "; - OS << IsKnownToGCC(Attr) << ";\n"; - OS << " }\n"; - GenerateAppertainsTo(Attr, OS); - GenerateLangOptRequirements(Attr, OS); - GenerateTargetRequirements(Attr, Dupes, OS); - GenerateSpellingIndexToSemanticSpelling(Attr, OS); - OS << "};\n"; - OS << "ParsedAttrInfo" << I->first; - OS << " parsedAttrInfo" << I->first << "Instance;\n\n"; - } - - OS << "static const ParsedAttrInfo *AttrInfoMap[AttributeList::UnknownAttribute + 1] = {\n"; - for (auto I = Attrs.begin(), E = Attrs.end(); I != E; ++I) { - OS << "&parsedAttrInfo" << I->first << "Instance,\n"; - } - OS << "};\n\n"; -} - -// Emits the kind list of parsed attributes -void EmitClangAttrParsedAttrKinds(RecordKeeper &Records, raw_ostream &OS) { - emitSourceFileHeader("Attribute name matcher", OS); - - std::vector Attrs = Records.getAllDerivedDefinitions("Attr"); - std::vector GNU, Declspec, Microsoft, CXX11, - Keywords, Pragma; - std::set Seen; - for (const auto *A : Attrs) { - const Record &Attr = *A; - - bool SemaHandler = Attr.getValueAsBit("SemaHandler"); - bool Ignored = Attr.getValueAsBit("Ignored"); - if (SemaHandler || Ignored) { - // Attribute spellings can be shared between target-specific attributes, - // and can be shared between syntaxes for the same attribute. For - // instance, an attribute can be spelled GNU<"interrupt"> for an ARM- - // 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 AttributeList::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")) { - AttrName = Attr.getValueAsString("ParseKind"); - if (Seen.find(AttrName) != Seen.end()) - continue; - Seen.insert(AttrName); - } else - AttrName = NormalizeAttrName(StringRef(Attr.getName())).str(); - - std::vector Spellings = GetFlattenedSpellings(Attr); - for (const auto &S : Spellings) { - const std::string &RawSpelling = S.name(); - std::vector *Matches = nullptr; - std::string Spelling; - const std::string &Variety = S.variety(); - if (Variety == "CXX11") { - Matches = &CXX11; - Spelling += S.nameSpace(); - Spelling += "::"; - } else if (Variety == "GNU") - Matches = &GNU; - else if (Variety == "Declspec") - Matches = &Declspec; - else if (Variety == "Microsoft") - Matches = &Microsoft; - else if (Variety == "Keyword") - Matches = &Keywords; - else if (Variety == "Pragma") - Matches = &Pragma; - - assert(Matches && "Unsupported spelling variety found"); - - if (Variety == "GNU") - Spelling += NormalizeGNUAttrSpelling(RawSpelling); - else - Spelling += RawSpelling; - - if (SemaHandler) - Matches->push_back(StringMatcher::StringPair(Spelling, - "return AttributeList::AT_" + AttrName + ";")); - else - Matches->push_back(StringMatcher::StringPair(Spelling, - "return AttributeList::IgnoredAttribute;")); + const Record &Attr = *I.second; + const std::string &AttrName = I.first; + std::vector Spellings = GetFlattenedSpellings(Attr); + unsigned SpellingIdx = 0; + for (const auto &S : Spellings) { + std::string Spelling; + if (S.variety() == "CXX11") { + Spelling += S.nameSpace(); + Spelling += "::"; + } + Spelling += (S.variety() == "GNU" ? NormalizeGNUAttrSpelling(S.name()) : StringRef(S.name())); + std::string AttrInfoName = "AttrInfo" + std::to_string(SpellingIdx) + AttrName; + OS << "struct " << AttrInfoName << " : public ParsedAttrInfo {\n"; + OS << " " << AttrInfoName << "() {\n"; + if (Attr.getValueAsBit("Ignored")) { + OS << " AttrKind = AttributeList::IgnoredAttribute;\n"; + } else { + OS << " AttrKind = AttributeList::AT_" << AttrName << ";\n"; } + OS << " Syntax = AttributeList::AS_" << S.variety() << ";\n"; + emitArgInfo(Attr, OS); + OS << " HasCustomParsing = "; + OS << Attr.getValueAsBit("HasCustomParsing") << ";\n"; + OS << " IsTargetSpecific = "; + OS << Attr.isSubClassOf("TargetSpecificAttr") << ";\n"; + OS << " IsType = "; + OS << Attr.isSubClassOf("TypeAttr") << ";\n"; + OS << " IsStmt = "; + OS << Attr.isSubClassOf("StmtAttr") << ";\n"; + OS << " IsKnownToGCC = "; + OS << IsKnownToGCC(Attr) << ";\n"; + OS << " }\n"; + GenerateAppertainsTo(Attr, OS); + GenerateLangOptRequirements(Attr, OS); + GenerateTargetRequirements(Attr, Dupes, OS); + GenerateSpellingIndexToSemanticSpelling(Attr, OS); + OS << "};\n"; + OS << "static AttrInfoRegistry::Add<" << AttrInfoName << "> " << AttrInfoName << "Instance(\"" << Spelling << "\",\"\");\n"; + ++SpellingIdx; } } - - OS << "static AttributeList::Kind getAttrKind(StringRef Name, "; - OS << "AttributeList::Syntax Syntax) {\n"; - OS << " if (AttributeList::AS_GNU == Syntax) {\n"; - StringMatcher("Name", GNU, OS).Emit(); - OS << " } else if (AttributeList::AS_Declspec == Syntax) {\n"; - StringMatcher("Name", Declspec, OS).Emit(); - OS << " } else if (AttributeList::AS_Microsoft == Syntax) {\n"; - StringMatcher("Name", Microsoft, OS).Emit(); - OS << " } else if (AttributeList::AS_CXX11 == Syntax) {\n"; - StringMatcher("Name", CXX11, OS).Emit(); - OS << " } else if (AttributeList::AS_Keyword == Syntax || "; - OS << "AttributeList::AS_ContextSensitiveKeyword == Syntax) {\n"; - StringMatcher("Name", Keywords, OS).Emit(); - OS << " } else if (AttributeList::AS_Pragma == Syntax) {\n"; - StringMatcher("Name", Pragma, OS).Emit(); - OS << " }\n"; - OS << " return AttributeList::UnknownAttribute;\n" - << "}\n"; } // Emits the code to dump an attribute. Index: utils/TableGen/TableGen.cpp =================================================================== --- utils/TableGen/TableGen.cpp +++ utils/TableGen/TableGen.cpp @@ -35,7 +35,6 @@ GenClangAttrTemplateInstantiate, GenClangAttrParsedAttrList, GenClangAttrParsedAttrImpl, - GenClangAttrParsedAttrKinds, GenClangAttrDump, GenClangDiagsDefs, GenClangDiagGroups, @@ -92,9 +91,6 @@ clEnumValN(GenClangAttrParsedAttrImpl, "gen-clang-attr-parsed-attr-impl", "Generate the clang parsed attribute helpers"), - clEnumValN(GenClangAttrParsedAttrKinds, - "gen-clang-attr-parsed-attr-kinds", - "Generate a clang parsed attribute kinds"), clEnumValN(GenClangAttrDump, "gen-clang-attr-dump", "Generate clang attribute dumper"), clEnumValN(GenClangDiagsDefs, "gen-clang-diags-defs", @@ -183,9 +179,6 @@ case GenClangAttrParsedAttrImpl: EmitClangAttrParsedAttrImpl(Records, OS); break; - case GenClangAttrParsedAttrKinds: - EmitClangAttrParsedAttrKinds(Records, OS); - break; case GenClangAttrDump: EmitClangAttrDump(Records, OS); break; Index: utils/TableGen/TableGenBackends.h =================================================================== --- utils/TableGen/TableGenBackends.h +++ utils/TableGen/TableGenBackends.h @@ -44,7 +44,6 @@ void EmitClangAttrTemplateInstantiate(RecordKeeper &Records, raw_ostream &OS); void EmitClangAttrParsedAttrList(RecordKeeper &Records, raw_ostream &OS); void EmitClangAttrParsedAttrImpl(RecordKeeper &Records, raw_ostream &OS); -void EmitClangAttrParsedAttrKinds(RecordKeeper &Records, raw_ostream &OS); void EmitClangAttrDump(RecordKeeper &Records, raw_ostream &OS); void EmitClangDiagsDefs(RecordKeeper &Records, raw_ostream &OS,