[llvm] r175577 - 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.
Bill Wendling
isanbard at gmail.com
Tue Feb 19 16:04:41 PST 2013
Author: void
Date: Tue Feb 19 18:04:41 2013
New Revision: 175577
URL: http://llvm.org/viewvc/llvm-project?rev=175577&view=rev
Log:
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.
Modified:
llvm/trunk/lib/IR/AsmWriter.cpp
Modified: llvm/trunk/lib/IR/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/AsmWriter.cpp?rev=175577&r1=175576&r2=175577&view=diff
==============================================================================
--- llvm/trunk/lib/IR/AsmWriter.cpp (original)
+++ llvm/trunk/lib/IR/AsmWriter.cpp Tue Feb 19 18:04:41 2013
@@ -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.
More information about the llvm-commits
mailing list