llvm.org GIT mirror llvm / 8b1b413
Fix CPP backend for method attributes by creating a block where a new AttrBuilder is defined for each attribute. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166762 91177308-0d34-0410-b5e6-96231b3b80d8 Nicolas Geoffray 8 years ago
1 changed file(s) with 4 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
475475 unsigned index = PAL.getSlot(i).Index;
476476 AttrBuilder attrs(PAL.getSlot(i).Attrs);
477477 Out << "PAWI.Index = " << index << "U;\n";
478 Out << " AttrBuilder B;\n";
478 Out << " {\n AttrBuilder B;\n";
479479
480480 #define HANDLE_ATTR(X) \
481481 if (attrs.hasAttribute(Attributes::X)) \
482 Out << " B.addAttribute(Attributes::" #X ");\n"; \
482 Out << " B.addAttribute(Attributes::" #X ");\n"; \
483483 attrs.removeAttribute(Attributes::X);
484484
485485 HANDLE_ATTR(SExt);
508508 HANDLE_ATTR(NonLazyBind);
509509 #undef HANDLE_ATTR
510510 if (attrs.hasAttribute(Attributes::StackAlignment))
511 Out << "B.addStackAlignmentAttr(" << attrs.getStackAlignment() << ")";
512 nl(Out);
511 Out << " B.addStackAlignmentAttr(" << attrs.getStackAlignment() << ")\n";
513512 attrs.removeAttribute(Attributes::StackAlignment);
514513 assert(!attrs.hasAttributes() && "Unhandled attribute!");
515 Out << "PAWI.Attrs = Attributes::get(mod->getContext(), B);";
514 Out << " PAWI.Attrs = Attributes::get(mod->getContext(), B);\n }";
516515 nl(Out);
517516 Out << "Attrs.push_back(PAWI);";
518517 nl(Out);