aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/CppBackend/CPPBackend.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-01-13 07:22:22 +0000
committerChris Lattner <sabre@nondot.org>2009-01-13 07:22:22 +0000
commitacca9559f4fdf99de62537592d7d63409229857b (patch)
tree315b73fbc35b4c89293e6e1c1b5e601fcafa2bd3 /lib/Target/CppBackend/CPPBackend.cpp
parent167650d41136ed738e364517be8a1412c4955423 (diff)
make -march=cpp handle the nocapture attribute, make it assert if it
sees attributes it doesn't know. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62155 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/CppBackend/CPPBackend.cpp')
-rw-r--r--lib/Target/CppBackend/CPPBackend.cpp41
1 files changed, 19 insertions, 22 deletions
diff --git a/lib/Target/CppBackend/CPPBackend.cpp b/lib/Target/CppBackend/CPPBackend.cpp
index 6bf463846f..fff6ef034f 100644
--- a/lib/Target/CppBackend/CPPBackend.cpp
+++ b/lib/Target/CppBackend/CPPBackend.cpp
@@ -450,28 +450,25 @@ namespace {
unsigned index = PAL.getSlot(i).Index;
Attributes attrs = PAL.getSlot(i).Attrs;
Out << "PAWI.Index = " << index << "U; PAWI.Attrs = 0 ";
- if (attrs & Attribute::SExt)
- Out << " | Attribute::SExt";
- if (attrs & Attribute::ZExt)
- Out << " | Attribute::ZExt";
- if (attrs & Attribute::StructRet)
- Out << " | Attribute::StructRet";
- if (attrs & Attribute::InReg)
- Out << " | Attribute::InReg";
- if (attrs & Attribute::NoReturn)
- Out << " | Attribute::NoReturn";
- if (attrs & Attribute::NoUnwind)
- Out << " | Attribute::NoUnwind";
- if (attrs & Attribute::ByVal)
- Out << " | Attribute::ByVal";
- if (attrs & Attribute::NoAlias)
- Out << " | Attribute::NoAlias";
- if (attrs & Attribute::Nest)
- Out << " | Attribute::Nest";
- if (attrs & Attribute::ReadNone)
- Out << " | Attribute::ReadNone";
- if (attrs & Attribute::ReadOnly)
- Out << " | Attribute::ReadOnly";
+#define HANDLE_ATTR(X) \
+ if (attrs & Attribute::X) \
+ Out << " | Attribute::" #X; \
+ attrs &= ~Attribute::X;
+
+ HANDLE_ATTR(SExt);
+ HANDLE_ATTR(ZExt);
+ HANDLE_ATTR(StructRet);
+ HANDLE_ATTR(InReg);
+ HANDLE_ATTR(NoReturn);
+ HANDLE_ATTR(NoUnwind);
+ HANDLE_ATTR(ByVal);
+ HANDLE_ATTR(NoAlias);
+ HANDLE_ATTR(Nest);
+ HANDLE_ATTR(ReadNone);
+ HANDLE_ATTR(ReadOnly);
+ HANDLE_ATTR(NoCapture);
+#undef HANDLE_ATTR
+ assert(attrs == 0 && "Unhandled attribute!");
Out << ";";
nl(Out);
Out << "Attrs.push_back(PAWI);";