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
This commit is contained in:
John McCall 2011-03-02 04:00:52 +00:00
parent 3ccfbc2012
commit 9977e521a6

View File

@ -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";
}