aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/CppBackend
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2012-10-10 07:36:45 +0000
committerBill Wendling <isanbard@gmail.com>2012-10-10 07:36:45 +0000
commit7d2f2496c1d263eecdc104fd72e847a31d8695b9 (patch)
tree0856e94cc2c0479da200b426cf81c14abf96e650 /lib/Target/CppBackend
parent8a8cf9617cdc735f0425e828bb7a6f401c0cf0f6 (diff)
downloadexternal_llvm-7d2f2496c1d263eecdc104fd72e847a31d8695b9.zip
external_llvm-7d2f2496c1d263eecdc104fd72e847a31d8695b9.tar.gz
external_llvm-7d2f2496c1d263eecdc104fd72e847a31d8695b9.tar.bz2
Remove the final bits of Attributes being declared in the Attribute
namespace. Use the attribute's enum value instead. No functionality change intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165610 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/CppBackend')
-rw-r--r--lib/Target/CppBackend/CPPBackend.cpp29
1 files changed, 16 insertions, 13 deletions
diff --git a/lib/Target/CppBackend/CPPBackend.cpp b/lib/Target/CppBackend/CPPBackend.cpp
index 444da2b..096e2bc 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);