summaryrefslogtreecommitdiffstats
path: root/clang/utils/TableGen
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2018-01-03 22:22:48 +0000
committerAaron Ballman <aaron@aaronballman.com>2018-01-03 22:22:48 +0000
commit10007815ac9f85960b36d5e9cd832d22e80c024b (patch)
treea54b75c623f3de4f5a1994204da652615d3a5eba /clang/utils/TableGen
parent3b8c8e999c7c37698f92006de622bc4d7d2cab85 (diff)
downloadbcm5719-llvm-10007815ac9f85960b36d5e9cd832d22e80c024b.tar.gz
bcm5719-llvm-10007815ac9f85960b36d5e9cd832d22e80c024b.zip
Introduce some infrastructure for adding C attributes with [[]] syntax.
This patch adds support to the attribute tablegen for specifying a [[]] attribute is allowed in C mode. This patch also adds the annotate attribute to the list of double square bracket attributes we support in C mode. Eventually, I anticipate that this logic will be reversed (you have to opt out of allowing an attribute in C rather than opting in), but I want to see how the design plays out as more attributes are considered. llvm-svn: 321763
Diffstat (limited to 'clang/utils/TableGen')
-rw-r--r--clang/utils/TableGen/ClangAttrEmitter.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/utils/TableGen/ClangAttrEmitter.cpp b/clang/utils/TableGen/ClangAttrEmitter.cpp
index b0e2ddd9136..2a8b891e64b 100644
--- a/clang/utils/TableGen/ClangAttrEmitter.cpp
+++ b/clang/utils/TableGen/ClangAttrEmitter.cpp
@@ -87,6 +87,8 @@ GetFlattenedSpellings(const Record &Attr) {
} else if (Variety == "Clang") {
Ret.emplace_back("GNU", Name, "", false);
Ret.emplace_back("CXX11", Name, "clang", false);
+ if (Spelling->getValueAsBit("AllowInC"))
+ Ret.emplace_back("C2x", Name, "clang", false);
} else
Ret.push_back(FlattenedSpelling(*Spelling));
}
OpenPOWER on IntegriCloud