diff options
author | Gabor Greif <ggreif@gmail.com> | 2009-03-13 18:27:29 +0000 |
---|---|---|
committer | Gabor Greif <ggreif@gmail.com> | 2009-03-13 18:27:29 +0000 |
commit | 258232fb805c9357a0fdf352e38bc7ab05ae3eaa (patch) | |
tree | 2984864ed92071f793b6d831dacbd5833da176b5 /llvm/lib/VMCore/AsmWriter.cpp | |
parent | a18c768e6de6e952ce47996c3a63bedbc771b8db (diff) | |
download | bcm5719-llvm-258232fb805c9357a0fdf352e38bc7ab05ae3eaa.tar.gz bcm5719-llvm-258232fb805c9357a0fdf352e38bc7ab05ae3eaa.zip |
Second installment of "BasicBlock operands to the back"
changes.
For InvokeInst now all arguments begin at op_begin().
The Callee, Cont and Fail are now faster to get by
access relative to op_end().
This patch introduces some temporary uglyness in CallSite.
Next I'll bring CallInst up to a similar scheme and then
the uglyness will magically vanish.
This patch also exposes all the reliance of the libraries
on InvokeInst's operand ordering. I am thinking of taking
care of that too.
llvm-svn: 66920
Diffstat (limited to 'llvm/lib/VMCore/AsmWriter.cpp')
-rw-r--r-- | llvm/lib/VMCore/AsmWriter.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/VMCore/AsmWriter.cpp b/llvm/lib/VMCore/AsmWriter.cpp index c1cc7bacf08..0bc7b248424 100644 --- a/llvm/lib/VMCore/AsmWriter.cpp +++ b/llvm/lib/VMCore/AsmWriter.cpp @@ -1625,6 +1625,7 @@ void AssemblyWriter::printInstruction(const Instruction &I) { if (PAL.getFnAttributes() != Attribute::None) Out << ' ' << Attribute::getAsString(PAL.getFnAttributes()); } else if (const InvokeInst *II = dyn_cast<InvokeInst>(&I)) { + Operand = II->getCalledValue(); const PointerType *PTy = cast<PointerType>(Operand->getType()); const FunctionType *FTy = cast<FunctionType>(PTy->getElementType()); const Type *RetTy = FTy->getReturnType(); @@ -1658,10 +1659,10 @@ void AssemblyWriter::printInstruction(const Instruction &I) { writeOperand(Operand, true); } Out << '('; - for (unsigned op = 3, Eop = I.getNumOperands(); op < Eop; ++op) { - if (op > 3) + for (unsigned op = 0, Eop = I.getNumOperands() - 3; op < Eop; ++op) { + if (op) Out << ", "; - writeParamOperand(I.getOperand(op), PAL.getParamAttributes(op-2)); + writeParamOperand(I.getOperand(op), PAL.getParamAttributes(op + 1)); } Out << ')'; |