diff options
| author | David Blaikie <dblaikie@gmail.com> | 2015-04-24 19:32:54 +0000 |
|---|---|---|
| committer | David Blaikie <dblaikie@gmail.com> | 2015-04-24 19:32:54 +0000 |
| commit | 445e3fbc549257aefa741fec9f008453ae7f8863 (patch) | |
| tree | de79f3e31a721ddad81e87c91e4b61fda6cfe828 /llvm/lib/IR | |
| parent | 5d41a6992d6cef2f8bfc45847345937bc1d17ad7 (diff) | |
| download | bcm5719-llvm-445e3fbc549257aefa741fec9f008453ae7f8863.tar.gz bcm5719-llvm-445e3fbc549257aefa741fec9f008453ae7f8863.zip | |
[opaque pointer type] Add textual IR support for explicit type parameter to the invoke instruction
Same as r235145 for the call instruction - the justification, tradeoffs,
etc are all the same. The conversion script worked the same without any
false negatives (after replacing 'call' with 'invoke').
llvm-svn: 235755
Diffstat (limited to 'llvm/lib/IR')
| -rw-r--r-- | llvm/lib/IR/AsmWriter.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp index 48737b5796e..fe6770ea5c6 100644 --- a/llvm/lib/IR/AsmWriter.cpp +++ b/llvm/lib/IR/AsmWriter.cpp @@ -2815,8 +2815,7 @@ void AssemblyWriter::printInstruction(const Instruction &I) { Out << " #" << Machine.getAttributeGroupSlot(PAL.getFnAttributes()); } else if (const InvokeInst *II = dyn_cast<InvokeInst>(&I)) { Operand = II->getCalledValue(); - PointerType *PTy = cast<PointerType>(Operand->getType()); - FunctionType *FTy = cast<FunctionType>(PTy->getElementType()); + FunctionType *FTy = cast<FunctionType>(II->getFunctionType()); Type *RetTy = FTy->getReturnType(); const AttributeSet &PAL = II->getAttributes(); @@ -2834,15 +2833,9 @@ void AssemblyWriter::printInstruction(const Instruction &I) { // and if the return type is not a pointer to a function. // Out << ' '; - if (!FTy->isVarArg() && - (!RetTy->isPointerTy() || - !cast<PointerType>(RetTy)->getElementType()->isFunctionTy())) { - TypePrinter.print(RetTy, Out); - Out << ' '; - writeOperand(Operand, false); - } else { - writeOperand(Operand, true); - } + TypePrinter.print(FTy->isVarArg() ? FTy : RetTy, Out); + Out << ' '; + writeOperand(Operand, false); Out << '('; for (unsigned op = 0, Eop = II->getNumArgOperands(); op < Eop; ++op) { if (op) |

