diff options
author | David Blaikie <dblaikie@gmail.com> | 2015-04-24 21:16:07 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2015-04-24 21:16:07 +0000 |
commit | 5bacf3722c018476b8712440c08dbcaf8df2a960 (patch) | |
tree | 31eb8d3fb9693987f3b8e9b9b76c8ffcac1faaaa /llvm/lib/IR/Verifier.cpp | |
parent | 6759319c3c6b01bb25e8ceedd15b7fb5d6242675 (diff) | |
download | bcm5719-llvm-5bacf3722c018476b8712440c08dbcaf8df2a960.tar.gz bcm5719-llvm-5bacf3722c018476b8712440c08dbcaf8df2a960.zip |
[opaque pointer type] Verifier/AutoUpgrade: Remove a few uses of PointerType::getElementType
llvm-svn: 235777
Diffstat (limited to 'llvm/lib/IR/Verifier.cpp')
-rw-r--r-- | llvm/lib/IR/Verifier.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp index 7001c556d20..099cbd9e0fe 100644 --- a/llvm/lib/IR/Verifier.cpp +++ b/llvm/lib/IR/Verifier.cpp @@ -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); |