aboutsummaryrefslogtreecommitdiff
path: root/lib
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
commit2bb471f2fa3709f5861f20016ff9d24f0098abe4 (patch)
treee52ae01ce8432c5c476fd15b462a41deb348dc3a /lib
parentb86f1e5e557f8a00209eef1c6ecb4532b33d7738 (diff)
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
Diffstat (limited to 'lib')
-rw-r--r--lib/IR/AsmWriter.cpp8
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.