[IR] Avoid use of PointerType::getElementType() in one of the CallBrInst constructors.

We already have the FunctionType we can call getReturnType on.
I think this was due to a bad rebase of the CallBr patch while
it was in development when CallInst and InvokeInst were updated.
This commit is contained in:
Craig Topper 2019-11-02 00:11:48 -07:00
parent d5fc36bbda
commit 462a67fadd
1 changed files with 3 additions and 7 deletions

View File

@ -4142,13 +4142,9 @@ CallBrInst::CallBrInst(FunctionType *Ty, Value *Func, BasicBlock *DefaultDest,
ArrayRef<Value *> Args,
ArrayRef<OperandBundleDef> Bundles, int NumOperands,
const Twine &NameStr, BasicBlock *InsertAtEnd)
: CallBase(
cast<FunctionType>(
cast<PointerType>(Func->getType())->getElementType())
->getReturnType(),
Instruction::CallBr,
OperandTraits<CallBase>::op_end(this) - NumOperands, NumOperands,
InsertAtEnd) {
: CallBase(Ty->getReturnType(), Instruction::CallBr,
OperandTraits<CallBase>::op_end(this) - NumOperands, NumOperands,
InsertAtEnd) {
init(Ty, Func, DefaultDest, IndirectDests, Args, Bundles, NameStr);
}