summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2014-05-31 01:30:30 +0000
committerHans Wennborg <hans@hanshq.net>2014-05-31 01:30:30 +0000
commit613807b4d0c19b5ebd3fd3a5bc106d4a34324cc5 (patch)
tree5571132faaa1c0f87e7f05b2cbf50fc2be11bb40
parentcb82dfb11c95e671dbacd66a066114e7e88678ac (diff)
downloadbcm5719-llvm-613807b4d0c19b5ebd3fd3a5bc106d4a34324cc5.tar.gz
bcm5719-llvm-613807b4d0c19b5ebd3fd3a5bc106d4a34324cc5.zip
Make Attr::Clone() also clone the Inherited, IsPackExpansion and Implicit flags
I was bitten by this when working with the dll attributes: when a dll attribute was cloned from a class template declaration to its specialization, the Inherited flag didn't get cloned. Differential Revision: http://reviews.llvm.org/D3972 llvm-svn: 209950
-rw-r--r--clang/utils/TableGen/ClangAttrEmitter.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/utils/TableGen/ClangAttrEmitter.cpp b/clang/utils/TableGen/ClangAttrEmitter.cpp
index 2f58099e5ce..c03ff901d1b 100644
--- a/clang/utils/TableGen/ClangAttrEmitter.cpp
+++ b/clang/utils/TableGen/ClangAttrEmitter.cpp
@@ -1553,12 +1553,16 @@ void EmitClangAttrImpl(RecordKeeper &Records, raw_ostream &OS) {
OS << R.getName() << "Attr *" << R.getName()
<< "Attr::clone(ASTContext &C) const {\n";
- OS << " return new (C) " << R.getName() << "Attr(getLocation(), C";
+ OS << " auto *A = new (C) " << R.getName() << "Attr(getLocation(), C";
for (auto const &ai : Args) {
OS << ", ";
ai->writeCloneArgs(OS);
}
- OS << ", getSpellingListIndex());\n}\n\n";
+ OS << ", getSpellingListIndex());\n";
+ OS << " A->Inherited = Inherited;\n";
+ OS << " A->IsPackExpansion = IsPackExpansion;\n";
+ OS << " A->Implicit = Implicit;\n";
+ OS << " return A;\n}\n\n";
writePrettyPrintFunction(R, Args, OS);
writeGetSpellingFunction(R, OS);
OpenPOWER on IntegriCloud