[opaque pointer type] Verifier/AutoUpgrade: Remove a few uses of PointerType::getElementType

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235777 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie
2015-04-24 21:16:07 +00:00
parent 3be414736a
commit 2bf0f6fdab
3 changed files with 17 additions and 17 deletions

View File

@@ -2243,12 +2243,8 @@ void Verifier::verifyMustTailCall(CallInst &CI) {
// parameters or return types may differ in pointee type, but not
// address space.
Function *F = CI.getParent()->getParent();
auto GetFnTy = [](Value *V) {
return cast<FunctionType>(
cast<PointerType>(V->getType())->getElementType());
};
FunctionType *CallerTy = GetFnTy(F);
FunctionType *CalleeTy = GetFnTy(CI.getCalledValue());
FunctionType *CallerTy = F->getFunctionType();
FunctionType *CalleeTy = CI.getFunctionType();
Assert(CallerTy->getNumParams() == CalleeTy->getNumParams(),
"cannot guarantee tail call due to mismatched parameter counts", &CI);
Assert(CallerTy->isVarArg() == CalleeTy->isVarArg(),
@@ -2600,7 +2596,7 @@ void Verifier::visitAllocaInst(AllocaInst &AI) {
Assert(PTy->getAddressSpace() == 0,
"Allocation instruction pointer not in the generic address space!",
&AI);
Assert(PTy->getElementType()->isSized(&Visited),
Assert(AI.getAllocatedType()->isSized(&Visited),
"Cannot allocate unsized type", &AI);
Assert(AI.getArraySize()->getType()->isIntegerTy(),
"Alloca array size must have integer type", &AI);