summaryrefslogtreecommitdiff
path: root/utils/TableGen/ClangAttrEmitter.cpp
diff options
context:
space:
mode:
authorCaitlin Sadowski <supertri@google.com>2011-09-08 17:40:49 +0000
committerCaitlin Sadowski <supertri@google.com>2011-09-08 17:40:49 +0000
commit5d97ee31bb6ba2b72e2bef862ec7c07729447cc0 (patch)
tree15d325190b912b987f4e7d1dcd26cad182cd517d /utils/TableGen/ClangAttrEmitter.cpp
parent9ea33b0c03e5c0a66b9d8385e164362b186513b1 (diff)
downloadllvm-5d97ee31bb6ba2b72e2bef862ec7c07729447cc0.tar.gz
llvm-5d97ee31bb6ba2b72e2bef862ec7c07729447cc0.tar.bz2
llvm-5d97ee31bb6ba2b72e2bef862ec7c07729447cc0.tar.xz
Added LateParsed property to TableGen attributes.
This patch was written by DeLesley Hutchins. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139300 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/ClangAttrEmitter.cpp')
-rw-r--r--utils/TableGen/ClangAttrEmitter.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/utils/TableGen/ClangAttrEmitter.cpp b/utils/TableGen/ClangAttrEmitter.cpp
index 6ef25d9a3a..e01f36442a 100644
--- a/utils/TableGen/ClangAttrEmitter.cpp
+++ b/utils/TableGen/ClangAttrEmitter.cpp
@@ -758,3 +758,26 @@ void ClangAttrSpellingListEmitter::run(raw_ostream &OS) {
}
}
+
+void ClangAttrLateParsedListEmitter::run(raw_ostream &OS) {
+ OS << "// This file is generated by TableGen. Do not edit.\n\n";
+
+ std::vector<Record*> Attrs = Records.getAllDerivedDefinitions("Attr");
+
+ for (std::vector<Record*>::iterator I = Attrs.begin(), E = Attrs.end();
+ I != E; ++I) {
+ Record &Attr = **I;
+
+ bool LateParsed = Attr.getValueAsBit("LateParsed");
+
+ if (LateParsed) {
+ std::vector<StringRef> Spellings =
+ getValueAsListOfStrings(Attr, "Spellings");
+
+ for (std::vector<StringRef>::const_iterator I = Spellings.begin(),
+ E = Spellings.end(); I != E; ++I) {
+ OS << ".Case(\"" << (*I) << "\", " << LateParsed << ")\n";
+ }
+ }
+ }
+}