summaryrefslogtreecommitdiffstats
path: root/clang/utils/TableGen
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2018-08-30 01:01:07 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2018-08-30 01:01:07 +0000
commit1bb64534e7ec303c8e14f7410e8f35858a09a1c3 (patch)
tree79fc638ad305accef4fa915cc73eabc000fefe2e /clang/utils/TableGen
parent2f4106592dfb1842f0fc48426bb7395f299a8c5d (diff)
downloadbcm5719-llvm-1bb64534e7ec303c8e14f7410e8f35858a09a1c3.tar.gz
bcm5719-llvm-1bb64534e7ec303c8e14f7410e8f35858a09a1c3.zip
Adjust Attr representation so that changes to documentation don't affect
how we parse source code. Instead of implicitly opting all undocumented attributes out of '#pragma clang attribute' support, explicitly opt them all out and remove the documentation check from TableGen. (No new attributes should be added without documentation, so this has little chance of backsliding. We already support the pragma on one undocumented attribute, so we don't even want to enforce our old "rule".) No functionality change intended. llvm-svn: 341009
Diffstat (limited to 'clang/utils/TableGen')
-rw-r--r--clang/utils/TableGen/ClangAttrEmitter.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/clang/utils/TableGen/ClangAttrEmitter.cpp b/clang/utils/TableGen/ClangAttrEmitter.cpp
index 5c6c7c3d01d..706cb4f246c 100644
--- a/clang/utils/TableGen/ClangAttrEmitter.cpp
+++ b/clang/utils/TableGen/ClangAttrEmitter.cpp
@@ -1885,19 +1885,15 @@ void PragmaClangAttributeSupport::emitMatchRuleList(raw_ostream &OS) {
bool PragmaClangAttributeSupport::isAttributedSupported(
const Record &Attribute) {
- if (Attribute.getValueAsBit("ForcePragmaAttributeSupport"))
- return true;
+ // If the attribute explicitly specified whether to support #pragma clang
+ // attribute, use that setting.
+ bool Unset;
+ bool SpecifiedResult =
+ Attribute.getValueAsBitOrUnset("PragmaAttributeSupport", Unset);
+ if (!Unset)
+ return SpecifiedResult;
+
// Opt-out rules:
- // FIXME: The documentation check should be moved before
- // the ForcePragmaAttributeSupport check after annotate is documented.
- // No documentation present.
- if (Attribute.isValueUnset("Documentation"))
- return false;
- std::vector<Record *> Docs = Attribute.getValueAsListOfDefs("Documentation");
- if (Docs.empty())
- return false;
- if (Docs.size() == 1 && Docs[0]->getName() == "Undocumented")
- return false;
// An attribute requires delayed parsing (LateParsed is on)
if (Attribute.getValueAsBit("LateParsed"))
return false;
OpenPOWER on IntegriCloud