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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235533 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie
2015-04-22 18:16:49 +00:00
parent c61f7144eb
commit cfe6126e17
8 changed files with 46 additions and 116 deletions

View File

@ -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));