diff options
author | Martin Bohme <mboehme@google.com> | 2017-03-22 13:34:37 +0000 |
---|---|---|
committer | Martin Bohme <mboehme@google.com> | 2017-03-22 13:34:37 +0000 |
commit | 926572303e34c40a056a91df288734592ac03033 (patch) | |
tree | 39a1c907cadf0e7a981831ed1813cd0995bc4476 /clang/utils | |
parent | b41979640f96d48231f45f6075a37ec78a6fd0fd (diff) | |
download | bcm5719-llvm-926572303e34c40a056a91df288734592ac03033.tar.gz bcm5719-llvm-926572303e34c40a056a91df288734592ac03033.zip |
Revert "Correct class-template deprecation behavior"
This reverts commit r298410 (which produces incorrect warnings, see
comments on https://reviews.llvm.org/rL298410).
llvm-svn: 298504
Diffstat (limited to 'clang/utils')
-rw-r--r-- | clang/utils/TableGen/ClangAttrEmitter.cpp | 44 |
1 files changed, 16 insertions, 28 deletions
diff --git a/clang/utils/TableGen/ClangAttrEmitter.cpp b/clang/utils/TableGen/ClangAttrEmitter.cpp index c516b53101f..990b860deae 100644 --- a/clang/utils/TableGen/ClangAttrEmitter.cpp +++ b/clang/utils/TableGen/ClangAttrEmitter.cpp @@ -2451,19 +2451,26 @@ void EmitClangAttrASTVisitor(RecordKeeper &Records, raw_ostream &OS) { OS << "#endif // ATTR_VISITOR_DECLS_ONLY\n"; } -void EmitClangAttrTemplateInstantiateHelper(const std::vector<Record *> &Attrs, - raw_ostream &OS, - bool AppliesToDecl) { +// Emits code to instantiate dependent attributes on templates. +void EmitClangAttrTemplateInstantiate(RecordKeeper &Records, raw_ostream &OS) { + emitSourceFileHeader("Template instantiation code for attributes", OS); + + std::vector<Record*> Attrs = Records.getAllDerivedDefinitions("Attr"); + + 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 << " switch (At->getKind()) {\n"; for (const auto *Attr : Attrs) { const Record &R = *Attr; if (!R.getValueAsBit("ASTNode")) continue; + OS << " case attr::" << R.getName() << ": {\n"; - bool ShouldClone = R.getValueAsBit("Clone") && - (!AppliesToDecl || - R.getValueAsBit("MeaningfulToClassTemplateDefinition")); + bool ShouldClone = R.getValueAsBit("Clone"); if (!ShouldClone) { OS << " return nullptr;\n"; @@ -2500,27 +2507,8 @@ void EmitClangAttrTemplateInstantiateHelper(const std::vector<Record *> &Attrs, } OS << " } // end switch\n" << " llvm_unreachable(\"Unknown attribute!\");\n" - << " return nullptr;\n"; -} - -// Emits code to instantiate dependent attributes on templates. -void EmitClangAttrTemplateInstantiate(RecordKeeper &Records, raw_ostream &OS) { - emitSourceFileHeader("Template instantiation code for attributes", OS); - - std::vector<Record*> Attrs = Records.getAllDerivedDefinitions("Attr"); - - OS << "namespace clang {\n" - << "namespace sema {\n\n" - << "Attr *instantiateTemplateAttribute(const Attr *At, ASTContext &C, " - << "Sema &S,\n" - << " const MultiLevelTemplateArgumentList &TemplateArgs) {\n"; - EmitClangAttrTemplateInstantiateHelper(Attrs, OS, /*AppliesToDecl*/false); - OS << "}\n\n" - << "Attr *instantiateTemplateAttributeForDecl(const Attr *At,\n" - << " ASTContext &C, Sema &S,\n" - << " const MultiLevelTemplateArgumentList &TemplateArgs) {\n"; - EmitClangAttrTemplateInstantiateHelper(Attrs, OS, /*AppliesToDecl*/true); - OS << "}\n\n" + << " return nullptr;\n" + << "}\n\n" << "} // end namespace sema\n" << "} // end namespace clang\n"; } |