summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2015-04-22 18:16:49 +0000
committerDavid Blaikie <dblaikie@gmail.com>2015-04-22 18:16:49 +0000
commitd2db881e8552ec3e5a1b20f91e8d07d6424d6855 (patch)
tree58adcc7630cf4f69e534702e06a532f15d32e227 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parent037b700b7f0caecabc745217fd421c8bca06f6eb (diff)
downloadbcm5719-llvm-d2db881e8552ec3e5a1b20f91e8d07d6424d6855.tar.gz
bcm5719-llvm-d2db881e8552ec3e5a1b20f91e8d07d6424d6855.zip
Revert "[opaque pointer type] Avoid using PointerType::getElementType for a few cases of CallInst"
This reverts commit r235458. It looks like this might be breaking something LTO-ish. Looking into it & will recommit with a fix/test case/etc once I've got more to go on. llvm-svn: 235533
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index a16be24a5b5..162dd2c4c74 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -4207,11 +4207,12 @@ std::error_code BitcodeReader::ParseFunctionBody(Function *F) {
PointerType *OpTy = dyn_cast<PointerType>(Callee->getType());
if (!OpTy)
return Error("Callee is not a pointer type");
- if (!FTy) {
- FTy = dyn_cast<FunctionType>(OpTy->getElementType());
- if (!FTy)
- return Error("Callee is not of pointer to function type");
- } else if (OpTy->getElementType() != FTy)
+ FunctionType *PFTy = dyn_cast<FunctionType>(OpTy->getElementType());
+ if (!PFTy)
+ return Error("Callee is not of pointer to function type");
+ if (!FTy)
+ FTy = PFTy;
+ if (PFTy != FTy)
return Error("Explicit call type does not match pointee type of "
"callee operand");
if (Record.size() < FTy->getNumParams() + OpNum)
@@ -4242,7 +4243,7 @@ std::error_code BitcodeReader::ParseFunctionBody(Function *F) {
}
}
- I = CallInst::Create(FTy, Callee, Args);
+ I = CallInst::Create(Callee, Args);
InstructionList.push_back(I);
cast<CallInst>(I)->setCallingConv(
static_cast<CallingConv::ID>((~(1U << 14) & CCInfo) >> 1));
OpenPOWER on IntegriCloud