diff options
author | Derek Schuff <dschuff@chromium.org> | 2012-10-12 16:24:16 -0700 |
---|---|---|
committer | Derek Schuff <dschuff@chromium.org> | 2012-10-12 16:24:16 -0700 |
commit | 5eceb0e04023bffa93f5683f356c09e35f9f4f43 (patch) | |
tree | 07d52d1eaf89a4b4544b48322dcdbc4f65b102d4 /lib/Target/CppBackend/CPPBackend.cpp | |
parent | 4db6bb7837c58641c4416e87643833bca4945841 (diff) | |
parent | 40573998821fde7ffeabe8507f4c9e8c7cf762f6 (diff) |
Merge commit '40573998821fde7ffeabe8507f4c9e8c7cf762f6'
Conflicts:
include/llvm/MC/MCAssembler.h
lib/Target/ARM/ARMISelLowering.cpp
lib/Target/X86/X86TargetMachine.h
tools/llc/llc.cpp
Diffstat (limited to 'lib/Target/CppBackend/CPPBackend.cpp')
-rw-r--r-- | lib/Target/CppBackend/CPPBackend.cpp | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/lib/Target/CppBackend/CPPBackend.cpp b/lib/Target/CppBackend/CPPBackend.cpp index 444da2bb21..096e2bc13b 100644 --- a/lib/Target/CppBackend/CPPBackend.cpp +++ b/lib/Target/CppBackend/CPPBackend.cpp @@ -474,13 +474,15 @@ void CppWriter::printAttributes(const AttrListPtr &PAL, Out << "AttributeWithIndex PAWI;"; nl(Out); for (unsigned i = 0; i < PAL.getNumSlots(); ++i) { unsigned index = PAL.getSlot(i).Index; - Attributes attrs = PAL.getSlot(i).Attrs; - Out << "PAWI.Index = " << index << "U; PAWI.Attrs = Attribute::None "; -#define HANDLE_ATTR(X) \ - if (attrs & Attribute::X) \ - Out << " | Attribute::" #X; \ - attrs &= ~Attribute::X; - + Attributes::Builder attrs(PAL.getSlot(i).Attrs); + Out << "PAWI.Index = " << index << "U;\n"; + Out << " Attributes::Builder B;\n"; + +#define HANDLE_ATTR(X) \ + if (attrs.hasAttribute(Attributes::X)) \ + Out << " B.addAttribute(Attributes::" #X ");\n"; \ + attrs.removeAttribute(Attributes::X); + HANDLE_ATTR(SExt); HANDLE_ATTR(ZExt); HANDLE_ATTR(NoReturn); @@ -506,13 +508,14 @@ void CppWriter::printAttributes(const AttrListPtr &PAL, HANDLE_ATTR(UWTable); HANDLE_ATTR(NonLazyBind); #undef HANDLE_ATTR - if (attrs & Attribute::StackAlignment) - Out << " | Attribute::constructStackAlignmentFromInt(" + if (attrs.hasAttribute(Attributes::StackAlignment)) + Out << "B.addStackAlignmentAttr(Attribute::constructStackAlignmentFromInt(" << attrs.getStackAlignment() - << ")"; - attrs &= ~Attribute::StackAlignment; - assert(attrs == 0 && "Unhandled attribute!"); - Out << ";"; + << "))"; + nl(Out); + attrs.removeAttribute(Attributes::StackAlignment); + assert(!attrs.hasAttributes() && "Unhandled attribute!"); + Out << "PAWI.Attrs = Attributes::get(B);"; nl(Out); Out << "Attrs.push_back(PAWI);"; nl(Out); |