diff options
| author | Hans Wennborg <hans@hanshq.net> | 2014-05-31 01:30:30 +0000 |
|---|---|---|
| committer | Hans Wennborg <hans@hanshq.net> | 2014-05-31 01:30:30 +0000 |
| commit | ffc3500bc9d543821fb35aa8dec0232e52d8e6c1 (patch) | |
| tree | c9e9db304ebe50c324e701e53ad297234751c131 /utils | |
| parent | fbb96d49ad234382a87e259c160379615e55dc86 (diff) | |
| download | clang-ffc3500bc9d543821fb35aa8dec0232e52d8e6c1.tar.gz clang-ffc3500bc9d543821fb35aa8dec0232e52d8e6c1.tar.bz2 clang-ffc3500bc9d543821fb35aa8dec0232e52d8e6c1.tar.xz | |
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209950 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
| -rw-r--r-- | utils/TableGen/ClangAttrEmitter.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/utils/TableGen/ClangAttrEmitter.cpp b/utils/TableGen/ClangAttrEmitter.cpp index 2f58099e5c..c03ff901d1 100644 --- a/utils/TableGen/ClangAttrEmitter.cpp +++ b/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); |
