summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/CppBackend
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
commit1a579351d230b4027874d2e0f44b538eac7cfc80 (patch)
tree8052193d192860e72aa6b31ebdd6d844a45ddfdc /llvm/lib/Target/CppBackend
parenteb83389b30117b875ad55de524f6c0428ce57076 (diff)
downloadbcm5719-llvm-1a579351d230b4027874d2e0f44b538eac7cfc80.tar.gz
bcm5719-llvm-1a579351d230b4027874d2e0f44b538eac7cfc80.zip
make -march=cpp handle the nocapture attribute, make it assert if it
sees attributes it doesn't know. llvm-svn: 62155
Diffstat (limited to 'llvm/lib/Target/CppBackend')
-rw-r--r--llvm/lib/Target/CppBackend/CPPBackend.cpp41
1 files changed, 19 insertions, 22 deletions
diff --git a/llvm/lib/Target/CppBackend/CPPBackend.cpp b/llvm/lib/Target/CppBackend/CPPBackend.cpp
index 6bf463846f4..fff6ef034f1 100644
--- a/llvm/lib/Target/CppBackend/CPPBackend.cpp
+++ b/llvm/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);";
OpenPOWER on IntegriCloud