summaryrefslogtreecommitdiff
path: root/utils/TableGen/ClangAttrEmitter.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-03-02 04:00:52 +0000
committerJohn McCall <rjmccall@apple.com>2011-03-02 04:00:52 +0000
commit9977e521a634b85764562efd910a221f15ea3109 (patch)
tree6eb2f27a2e8eebe53bc855a049484182b8065bd5 /utils/TableGen/ClangAttrEmitter.cpp
parent3ccfbc201205a1a9765515dc8928ed8995daf9f4 (diff)
downloadllvm-9977e521a634b85764562efd910a221f15ea3109.tar.gz
llvm-9977e521a634b85764562efd910a221f15ea3109.tar.bz2
llvm-9977e521a634b85764562efd910a221f15ea3109.tar.xz
Teach the clang attribute emitter about InheritableParamAttr.
Intended to be atomic with clang r126828. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126827 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/ClangAttrEmitter.cpp')
-rw-r--r--utils/TableGen/ClangAttrEmitter.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/utils/TableGen/ClangAttrEmitter.cpp b/utils/TableGen/ClangAttrEmitter.cpp
index 27e1e027d0..f8bc07ee15 100644
--- a/utils/TableGen/ClangAttrEmitter.cpp
+++ b/utils/TableGen/ClangAttrEmitter.cpp
@@ -589,23 +589,37 @@ void ClangAttrListEmitter::run(raw_ostream &OS) {
OS << "#define LAST_INHERITABLE_ATTR(NAME) INHERITABLE_ATTR(NAME)\n";
OS << "#endif\n\n";
+ OS << "#ifndef INHERITABLE_PARAM_ATTR\n";
+ OS << "#define INHERITABLE_PARAM_ATTR(NAME) ATTR(NAME)\n";
+ OS << "#endif\n\n";
+
+ OS << "#ifndef LAST_INHERITABLE_PARAM_ATTR\n";
+ OS << "#define LAST_INHERITABLE_PARAM_ATTR(NAME)"
+ " INHERITABLE_PARAM_ATTR(NAME)\n";
+ OS << "#endif\n\n";
+
Record *InhClass = Records.getClass("InheritableAttr");
+ Record *InhParamClass = Records.getClass("InheritableParamAttr");
std::vector<Record*> Attrs = Records.getAllDerivedDefinitions("Attr"),
- NonInhAttrs, InhAttrs;
+ NonInhAttrs, InhAttrs, InhParamAttrs;
for (std::vector<Record*>::iterator i = Attrs.begin(), e = Attrs.end();
i != e; ++i) {
- if ((*i)->isSubClassOf(InhClass))
+ if ((*i)->isSubClassOf(InhParamClass))
+ InhParamAttrs.push_back(*i);
+ else if ((*i)->isSubClassOf(InhClass))
InhAttrs.push_back(*i);
else
NonInhAttrs.push_back(*i);
}
+ EmitAttrList(OS, "INHERITABLE_PARAM_ATTR", InhParamAttrs);
EmitAttrList(OS, "INHERITABLE_ATTR", InhAttrs);
EmitAttrList(OS, "ATTR", NonInhAttrs);
OS << "#undef LAST_ATTR\n";
OS << "#undef INHERITABLE_ATTR\n";
OS << "#undef LAST_INHERITABLE_ATTR\n";
+ OS << "#undef LAST_INHERITABLE_PARAM_ATTR\n";
OS << "#undef ATTR\n";
}