summaryrefslogtreecommitdiff
path: root/lib/IR/AsmWriter.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-02-22 09:09:42 +0000
committerBill Wendling <isanbard@gmail.com>2013-02-22 09:09:42 +0000
commit351b7a10e2560a835759748c58da09e53207b39d (patch)
tree9e96a49def7e558db064f4bcbc0ff8e22dfb7dcf /lib/IR/AsmWriter.cpp
parent00ddc5a7274fb4131f1a724bc350fd756156a80f (diff)
downloadllvm-351b7a10e2560a835759748c58da09e53207b39d.tar.gz
llvm-351b7a10e2560a835759748c58da09e53207b39d.tar.bz2
llvm-351b7a10e2560a835759748c58da09e53207b39d.tar.xz
Use references to attribute groups on the call/invoke instructions.
Listing all of the attributes for the callee of a call/invoke instruction is way too much and makes the IR unreadable. Use references to attributes instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175877 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR/AsmWriter.cpp')
-rw-r--r--lib/IR/AsmWriter.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/IR/AsmWriter.cpp b/lib/IR/AsmWriter.cpp
index 3f32ac18e8..9954a29b3f 100644
--- a/lib/IR/AsmWriter.cpp
+++ b/lib/IR/AsmWriter.cpp
@@ -554,13 +554,15 @@ void SlotTracker::processFunction() {
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);
- }
+ // Add all the call attributes to the table.
+ AttributeSet Attrs = CI->getAttributes().getFnAttributes();
+ if (Attrs.hasAttributes(AttributeSet::FunctionIndex))
+ CreateAttributeSetSlot(Attrs);
+ } else if (const InvokeInst *II = dyn_cast<InvokeInst>(I)) {
+ // Add all the call attributes to the table.
+ AttributeSet Attrs = II->getAttributes().getFnAttributes();
+ if (Attrs.hasAttributes(AttributeSet::FunctionIndex))
+ CreateAttributeSetSlot(Attrs);
}
// Process metadata attached with this instruction.
@@ -1935,7 +1937,7 @@ void AssemblyWriter::printInstruction(const Instruction &I) {
}
Out << ')';
if (PAL.hasAttributes(AttributeSet::FunctionIndex))
- Out << ' ' << PAL.getAsString(AttributeSet::FunctionIndex);
+ Out << " #" << Machine.getAttributeGroupSlot(PAL.getFnAttributes());
} else if (const InvokeInst *II = dyn_cast<InvokeInst>(&I)) {
Operand = II->getCalledValue();
PointerType *PTy = cast<PointerType>(Operand->getType());
@@ -1975,7 +1977,7 @@ void AssemblyWriter::printInstruction(const Instruction &I) {
Out << ')';
if (PAL.hasAttributes(AttributeSet::FunctionIndex))
- Out << ' ' << PAL.getAsString(AttributeSet::FunctionIndex);
+ Out << " #" << Machine.getAttributeGroupSlot(PAL.getFnAttributes());
Out << "\n to ";
writeOperand(II->getNormalDest(), true);