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 | d29393efed93fd291655ab02a4ebf42922c9a554 (patch) | |
tree | 4bb8571b981c63b6ee8db058f1b2f55382bea131 /utils | |
parent | f676817f1138aa0da898de0819b25ca447371c56 (diff) | |
download | clang-d29393efed93fd291655ab02a4ebf42922c9a554.tar.gz |
Revert "Correct class-template deprecation behavior"
This reverts commit r298410 (which produces incorrect warnings, see
comments on https://reviews.llvm.org/rL298410).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298504 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r-- | utils/TableGen/ClangAttrEmitter.cpp | 44 |
1 files changed, 16 insertions, 28 deletions
diff --git a/utils/TableGen/ClangAttrEmitter.cpp b/utils/TableGen/ClangAttrEmitter.cpp index c516b53101..990b860dea 100644 --- a/utils/TableGen/ClangAttrEmitter.cpp +++ b/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"; } |