diff options
author | Nicolas Geoffray <nicolas.geoffray@lip6.fr> | 2012-10-26 09:14:38 +0000 |
---|---|---|
committer | Nicolas Geoffray <nicolas.geoffray@lip6.fr> | 2012-10-26 09:14:38 +0000 |
commit | 4027f238eb0181178c668213c65276729f20873f (patch) | |
tree | a0937851744590db823b7fc885a093502d2cc709 /llvm/lib/Target/CppBackend/CPPBackend.cpp | |
parent | 2b4f64a30e8a4ccb29528ab70162a7879735485a (diff) | |
download | bcm5719-llvm-4027f238eb0181178c668213c65276729f20873f.tar.gz bcm5719-llvm-4027f238eb0181178c668213c65276729f20873f.zip |
Fix CPP backend for method attributes by creating a block where a new AttrBuilder is defined for each attribute.
llvm-svn: 166762
Diffstat (limited to 'llvm/lib/Target/CppBackend/CPPBackend.cpp')
-rw-r--r-- | llvm/lib/Target/CppBackend/CPPBackend.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Target/CppBackend/CPPBackend.cpp b/llvm/lib/Target/CppBackend/CPPBackend.cpp index 61fb4e98ecd..dd00b7d48bd 100644 --- a/llvm/lib/Target/CppBackend/CPPBackend.cpp +++ b/llvm/lib/Target/CppBackend/CPPBackend.cpp @@ -476,11 +476,11 @@ void CppWriter::printAttributes(const AttrListPtr &PAL, unsigned index = PAL.getSlot(i).Index; AttrBuilder attrs(PAL.getSlot(i).Attrs); Out << "PAWI.Index = " << index << "U;\n"; - Out << " AttrBuilder B;\n"; + Out << " {\n AttrBuilder B;\n"; #define HANDLE_ATTR(X) \ if (attrs.hasAttribute(Attributes::X)) \ - Out << " B.addAttribute(Attributes::" #X ");\n"; \ + Out << " B.addAttribute(Attributes::" #X ");\n"; \ attrs.removeAttribute(Attributes::X); HANDLE_ATTR(SExt); @@ -509,11 +509,10 @@ void CppWriter::printAttributes(const AttrListPtr &PAL, HANDLE_ATTR(NonLazyBind); #undef HANDLE_ATTR if (attrs.hasAttribute(Attributes::StackAlignment)) - Out << "B.addStackAlignmentAttr(" << attrs.getStackAlignment() << ")"; - nl(Out); + Out << " B.addStackAlignmentAttr(" << attrs.getStackAlignment() << ")\n"; attrs.removeAttribute(Attributes::StackAlignment); assert(!attrs.hasAttributes() && "Unhandled attribute!"); - Out << "PAWI.Attrs = Attributes::get(mod->getContext(), B);"; + Out << " PAWI.Attrs = Attributes::get(mod->getContext(), B);\n }"; nl(Out); Out << "Attrs.push_back(PAWI);"; nl(Out); |