diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2018-10-24 12:26:23 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2018-10-24 12:26:23 +0000 |
commit | ad672ffb643c646ca7680c765342bd58252ecdbe (patch) | |
tree | 983949541e2d1345350ca5f6f01833b6db7a09da /clang/utils/TableGen/ClangAttrEmitter.cpp | |
parent | c4a995c8e05bd63932677ee30e4f4cfd6623eaff (diff) | |
download | bcm5719-llvm-ad672ffb643c646ca7680c765342bd58252ecdbe.tar.gz bcm5719-llvm-ad672ffb643c646ca7680c765342bd58252ecdbe.zip |
Support accepting __gnu__ as a scoped attribute namespace that aliases to gnu.
This is useful in libstdc++ to avoid clashes with identifiers in the user's namespace.
llvm-svn: 345132
Diffstat (limited to 'clang/utils/TableGen/ClangAttrEmitter.cpp')
-rw-r--r-- | clang/utils/TableGen/ClangAttrEmitter.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/clang/utils/TableGen/ClangAttrEmitter.cpp b/clang/utils/TableGen/ClangAttrEmitter.cpp index 59eab397733..43e6638f7f4 100644 --- a/clang/utils/TableGen/ClangAttrEmitter.cpp +++ b/clang/utils/TableGen/ClangAttrEmitter.cpp @@ -2932,15 +2932,15 @@ void EmitClangAttrHasAttrImpl(RecordKeeper &Records, raw_ostream &OS) { OS << "case AttrSyntax::" << Variety << ": {\n"; // C++11-style attributes are further split out based on the Scope. for (auto I = List.cbegin(), E = List.cend(); I != E; ++I) { - if (I != List.cbegin()) - OS << " else "; - if (I->first.empty()) - OS << "if (!Scope || Scope->getName() == \"\") {\n"; - else - OS << "if (Scope->getName() == \"" << I->first << "\") {\n"; - OS << " return llvm::StringSwitch<int>(Name)\n"; - GenerateHasAttrSpellingStringSwitch(I->second, OS, Spelling, I->first); - OS << "}"; + if (I != List.cbegin())
+ OS << " else ";
+ if (I->first.empty())
+ OS << "if (ScopeName == \"\") {\n";
+ else
+ OS << "if (ScopeName == \"" << I->first << "\") {\n";
+ OS << " return llvm::StringSwitch<int>(Name)\n";
+ GenerateHasAttrSpellingStringSwitch(I->second, OS, Spelling, I->first);
+ OS << "}";
} OS << "\n} break;\n"; }; |