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/ConstantFold.cpp | |
parent | ede603057ebaa4db7bf034f78e96a8bb4b7fe8a5 (diff) | |
download | llvm-e3dcce9700c6f7045774f46f66faa610081495a5.zip llvm-e3dcce9700c6f7045774f46f66faa610081495a5.tar.gz llvm-e3dcce9700c6f7045774f46f66faa610081495a5.tar.bz2 |
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/ConstantFold.cpp')
-rw-r--r-- | llvm/lib/IR/ConstantFold.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/IR/ConstantFold.cpp b/llvm/lib/IR/ConstantFold.cpp index 46bb20e..5dd075a 100644 --- a/llvm/lib/IR/ConstantFold.cpp +++ b/llvm/lib/IR/ConstantFold.cpp @@ -1997,17 +1997,17 @@ static bool isInBoundsIndices(ArrayRef<IndexTy> Idxs) { } /// \brief Test whether a given ConstantInt is in-range for a SequentialType. -static bool isIndexInRangeOfSequentialType(const SequentialType *STy, +static bool isIndexInRangeOfSequentialType(SequentialType *STy, const ConstantInt *CI) { - if (const PointerType *PTy = dyn_cast<PointerType>(STy)) + if (auto *PTy = dyn_cast<PointerType>(STy)) // Only handle pointers to sized types, not pointers to functions. return PTy->getElementType()->isSized(); uint64_t NumElements = 0; // Determine the number of elements in our sequential type. - if (const ArrayType *ATy = dyn_cast<ArrayType>(STy)) + if (auto *ATy = dyn_cast<ArrayType>(STy)) NumElements = ATy->getNumElements(); - else if (const VectorType *VTy = dyn_cast<VectorType>(STy)) + else if (auto *VTy = dyn_cast<VectorType>(STy)) NumElements = VTy->getNumElements(); assert((isa<ArrayType>(STy) || NumElements > 0) && @@ -2178,7 +2178,7 @@ static Constant *ConstantFoldGetElementPtrImpl(Type *PointeeTy, Constant *C, // dimension. NewIdxs.resize(Idxs.size()); uint64_t NumElements = 0; - if (const ArrayType *ATy = dyn_cast<ArrayType>(Ty)) + if (auto *ATy = dyn_cast<ArrayType>(Ty)) NumElements = ATy->getNumElements(); else NumElements = cast<VectorType>(Ty)->getNumElements(); |