summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-02-20 00:04:41 +0000
committerBill Wendling <isanbard@gmail.com>2013-02-20 00:04:41 +0000
commit6da216f6f4cf23ad15bcd8c7c70a0a13331edfb2 (patch)
treea8b1adb1fb167eaee89e0fd51fc89354e8305fb4
parent45a52fa097edb9ae619116e68274c908aea66519 (diff)
downloadbcm5719-llvm-6da216f6f4cf23ad15bcd8c7c70a0a13331edfb2.tar.gz
bcm5719-llvm-6da216f6f4cf23ad15bcd8c7c70a0a13331edfb2.zip
Add the function attributes from an inline asm call. These don't have declarations that set the attribute groups, so we must do it on our own.
llvm-svn: 175577
-rw-r--r--llvm/lib/IR/AsmWriter.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp
index 17d49ac4101..d130a25b2ed 100644
--- a/llvm/lib/IR/AsmWriter.cpp
+++ b/llvm/lib/IR/AsmWriter.cpp
@@ -553,6 +553,14 @@ void SlotTracker::processFunction() {
for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i)
if (MDNode *N = dyn_cast_or_null<MDNode>(I->getOperand(i)))
CreateMetadataSlot(N);
+
+ // Add all the call attributes to the table. This is important for
+ // inline ASM, which may have attributes but no declaration.
+ if (CI->isInlineAsm()) {
+ AttributeSet Attrs = CI->getAttributes().getFnAttributes();
+ if (Attrs.hasAttributes(AttributeSet::FunctionIndex))
+ CreateAttributeSetSlot(Attrs);
+ }
}
// Process metadata attached with this instruction.
OpenPOWER on IntegriCloud