diff --git a/clang/utils/TableGen/ClangAttrEmitter.cpp b/clang/utils/TableGen/ClangAttrEmitter.cpp --- a/clang/utils/TableGen/ClangAttrEmitter.cpp +++ b/clang/utils/TableGen/ClangAttrEmitter.cpp @@ -2012,10 +2012,10 @@ return; // Generate a function that constructs a set of matching rules that describe // to which declarations the attribute should apply to. - OS << "virtual void getPragmaAttributeMatchRules(" + OS << "void getPragmaAttributeMatchRules(" << "llvm::SmallVectorImpl> &MatchRules, const LangOptions &LangOpts) const {\n"; + << ", bool>> &MatchRules, const LangOptions &LangOpts) const override {\n"; const Record *SubjectObj = Attr.getValueAsDef("Subjects"); std::vector Subjects = SubjectObj->getValueAsListOfDefs("Subjects"); for (const auto *Subject : Subjects) { @@ -3519,8 +3519,8 @@ // at all (for instance because it was applied to a type), or that the caller // has determined that the check should fail (perhaps prior to the creation // of the declaration). - OS << "virtual bool diagAppertainsToDecl(Sema &S, "; - OS << "const ParsedAttr &Attr, const Decl *D) const {\n"; + OS << "bool diagAppertainsToDecl(Sema &S, "; + OS << "const ParsedAttr &Attr, const Decl *D) const override {\n"; OS << " if ("; for (auto I = Subjects.begin(), E = Subjects.end(); I != E; ++I) { // If the subject has custom code associated with it, use the generated @@ -3594,8 +3594,8 @@ if (LangOpts.empty()) return; - OS << "virtual bool diagLangOpts(Sema &S, const ParsedAttr &Attr) "; - OS << "const {\n"; + OS << "bool diagLangOpts(Sema &S, const ParsedAttr &Attr) "; + OS << "const override {\n"; OS << " auto &LangOpts = S.LangOpts;\n"; OS << " if (" << GenerateTestExpression(LangOpts) << ")\n"; OS << " return true;\n\n"; @@ -3639,7 +3639,7 @@ std::string Test; bool UsesT = GenerateTargetSpecificAttrChecks(R, Arches, Test, &FnName); - OS << "virtual bool existsInTarget(const TargetInfo &Target) const {\n"; + OS << "bool existsInTarget(const TargetInfo &Target) const override {\n"; if (UsesT) OS << " const llvm::Triple &T = Target.getTriple(); (void)T;\n"; OS << " return " << Test << ";\n"; @@ -3664,8 +3664,8 @@ std::string Enum = CreateSemanticSpellings(Spellings, SemanticToSyntacticMap); std::string Name = Attr.getName().str() + "AttrSpellingMap"; - OS << "virtual unsigned spellingIndexToSemanticSpelling("; - OS << "const ParsedAttr &Attr) const {\n"; + OS << "unsigned spellingIndexToSemanticSpelling("; + OS << "const ParsedAttr &Attr) const override {\n"; OS << Enum; OS << " unsigned Idx = Attr.getAttributeSpellingListIndex();\n"; WriteSemanticSpellingSwitch("Idx", SemanticToSyntacticMap, OS); @@ -3678,8 +3678,8 @@ return; // Generate a function which just converts from ParsedAttr to the Attr type. - OS << "virtual AttrHandling handleDeclAttribute(Sema &S, Decl *D,"; - OS << "const ParsedAttr &Attr) const {\n"; + OS << "AttrHandling handleDeclAttribute(Sema &S, Decl *D,"; + OS << "const ParsedAttr &Attr) const override {\n"; OS << " D->addAttr(::new (S.Context) " << Attr.getName(); OS << "Attr(S.Context, Attr));\n"; OS << " return AttributeApplied;\n";