From 2bb471f2fa3709f5861f20016ff9d24f0098abe4 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Wed, 20 Feb 2013 00:04:41 +0000 Subject: [PATCH] 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175577 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/IR/AsmWriter.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/IR/AsmWriter.cpp b/lib/IR/AsmWriter.cpp index 17d49ac4101..d130a25b2ed 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(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. -- 2.34.1