summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Writer
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2015-04-24 18:06:06 +0000
committerDavid Blaikie <dblaikie@gmail.com>2015-04-24 18:06:06 +0000
commit5ea1f7b7440b7050abb912ce360c7cabcd8c2881 (patch)
tree885d2dedc2fa53f5a428d7f522fe8a2e705de731 /llvm/lib/Bitcode/Writer
parent08c5f1efc1c6d5c065eb9e66fc57ca681b8cf19e (diff)
downloadbcm5719-llvm-5ea1f7b7440b7050abb912ce360c7cabcd8c2881.tar.gz
bcm5719-llvm-5ea1f7b7440b7050abb912ce360c7cabcd8c2881.zip
[opaque pointer type] bitcode: add explicit callee type to invoke instructions
llvm-svn: 235735
Diffstat (limited to 'llvm/lib/Bitcode/Writer')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index c4b31ff7275..52a5d480fdd 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -1790,15 +1790,15 @@ static void WriteInstruction(const Instruction &I, unsigned InstID,
case Instruction::Invoke: {
const InvokeInst *II = cast<InvokeInst>(&I);
- const Value *Callee(II->getCalledValue());
- PointerType *PTy = cast<PointerType>(Callee->getType());
- FunctionType *FTy = cast<FunctionType>(PTy->getElementType());
+ const Value *Callee = II->getCalledValue();
+ FunctionType *FTy = II->getFunctionType();
Code = bitc::FUNC_CODE_INST_INVOKE;
Vals.push_back(VE.getAttributeID(II->getAttributes()));
- Vals.push_back(II->getCallingConv());
+ Vals.push_back(II->getCallingConv() | 1 << 13);
Vals.push_back(VE.getValueID(II->getNormalDest()));
Vals.push_back(VE.getValueID(II->getUnwindDest()));
+ Vals.push_back(VE.getTypeID(FTy));
PushValueAndType(Callee, InstID, Vals, VE);
// Emit value #'s for the fixed parameters.
OpenPOWER on IntegriCloud