summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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