diff options
author | Craig Topper <craig.topper@gmail.com> | 2015-08-01 22:20:21 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2015-08-01 22:20:21 +0000 |
commit | e3dcce9700c6f7045774f46f66faa610081495a5 (patch) | |
tree | 10ddb2f805ad5ca46dc4279b77d6f34ef98c1564 /llvm/lib/IR/Verifier.cpp | |
parent | ede603057ebaa4db7bf034f78e96a8bb4b7fe8a5 (diff) | |
download | bcm5719-llvm-e3dcce9700c6f7045774f46f66faa610081495a5.tar.gz bcm5719-llvm-e3dcce9700c6f7045774f46f66faa610081495a5.zip |
De-constify pointers to Type since they can't be modified. NFC
This was already done in most places a while ago. This just fixes the ones that crept in over time.
llvm-svn: 243842
Diffstat (limited to 'llvm/lib/IR/Verifier.cpp')
-rw-r--r-- | llvm/lib/IR/Verifier.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp index 7d791acf838..05b7b607023 100644 --- a/llvm/lib/IR/Verifier.cpp +++ b/llvm/lib/IR/Verifier.cpp @@ -1365,7 +1365,7 @@ void Verifier::VerifyParameterAttrs(AttributeSet Attrs, unsigned Idx, Type *Ty, V); if (PointerType *PTy = dyn_cast<PointerType>(Ty)) { - SmallPtrSet<const Type*, 4> Visited; + SmallPtrSet<Type*, 4> Visited; if (!PTy->getElementType()->isSized(&Visited)) { Assert(!Attrs.hasAttribute(Idx, Attribute::ByVal) && !Attrs.hasAttribute(Idx, Attribute::InAlloca), @@ -1554,7 +1554,7 @@ void Verifier::VerifyStatepoint(ImmutableCallSite CS) { &CI); const Value *Target = CS.getArgument(2); - const PointerType *PT = dyn_cast<PointerType>(Target->getType()); + auto *PT = dyn_cast<PointerType>(Target->getType()); Assert(PT && PT->getElementType()->isFunctionTy(), "gc.statepoint callee must be of function pointer type", &CI, Target); FunctionType *TargetFuncType = cast<FunctionType>(PT->getElementType()); @@ -2674,7 +2674,7 @@ void Verifier::visitStoreInst(StoreInst &SI) { } void Verifier::visitAllocaInst(AllocaInst &AI) { - SmallPtrSet<const Type*, 4> Visited; + SmallPtrSet<Type*, 4> Visited; PointerType *PTy = AI.getType(); Assert(PTy->getAddressSpace() == 0, "Allocation instruction pointer not in the generic address space!", @@ -3469,9 +3469,8 @@ void Verifier::visitIntrinsicCallSite(Intrinsic::ID ID, CallSite CS) { // Assert that result type matches wrapped callee. const Value *Target = StatepointCS.getArgument(2); - const PointerType *PT = cast<PointerType>(Target->getType()); - const FunctionType *TargetFuncType = - cast<FunctionType>(PT->getElementType()); + auto *PT = cast<PointerType>(Target->getType()); + auto *TargetFuncType = cast<FunctionType>(PT->getElementType()); Assert(CS.getType() == TargetFuncType->getReturnType(), "gc.result result type does not match wrapped callee", CS); break; |