diff options
-rw-r--r-- | lib/IR/AsmWriter.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/IR/AsmWriter.cpp b/lib/IR/AsmWriter.cpp index 17d49ac410..d130a25b2e 100644 --- a/lib/IR/AsmWriter.cpp +++ b/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. |