diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-02-22 09:09:42 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-02-22 09:09:42 +0000 |
commit | a032374ea0d069bff44045eee72ebdaa100ccc7a (patch) | |
tree | 15d310cc9553439cca1d1503b091719d49efaecf /llvm/lib/IR/AsmWriter.cpp | |
parent | 2386c8b2211f3708cb475ffbcfb38df127559bb1 (diff) | |
download | bcm5719-llvm-a032374ea0d069bff44045eee72ebdaa100ccc7a.tar.gz bcm5719-llvm-a032374ea0d069bff44045eee72ebdaa100ccc7a.zip |
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.
llvm-svn: 175877
Diffstat (limited to 'llvm/lib/IR/AsmWriter.cpp')
-rw-r--r-- | llvm/lib/IR/AsmWriter.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp index 3f32ac18e87..9954a29b3f7 100644 --- a/llvm/lib/IR/AsmWriter.cpp +++ b/llvm/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); |