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/Constants.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/Constants.cpp')
-rw-r--r-- | llvm/lib/IR/Constants.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/IR/Constants.cpp b/llvm/lib/IR/Constants.cpp index 308e6bde3d1..9365653516e 100644 --- a/llvm/lib/IR/Constants.cpp +++ b/llvm/lib/IR/Constants.cpp @@ -797,10 +797,10 @@ Constant *ConstantAggregateZero::getElementValue(unsigned Idx) const { } unsigned ConstantAggregateZero::getNumElements() const { - const Type *Ty = getType(); - if (const auto *AT = dyn_cast<ArrayType>(Ty)) + Type *Ty = getType(); + if (auto *AT = dyn_cast<ArrayType>(Ty)) return AT->getNumElements(); - if (const auto *VT = dyn_cast<VectorType>(Ty)) + if (auto *VT = dyn_cast<VectorType>(Ty)) return VT->getNumElements(); return Ty->getStructNumElements(); } @@ -838,10 +838,10 @@ UndefValue *UndefValue::getElementValue(unsigned Idx) const { } unsigned UndefValue::getNumElements() const { - const Type *Ty = getType(); - if (const auto *AT = dyn_cast<ArrayType>(Ty)) + Type *Ty = getType(); + if (auto *AT = dyn_cast<ArrayType>(Ty)) return AT->getNumElements(); - if (const auto *VT = dyn_cast<VectorType>(Ty)) + if (auto *VT = dyn_cast<VectorType>(Ty)) return VT->getNumElements(); return Ty->getStructNumElements(); } @@ -2430,9 +2430,9 @@ StringRef ConstantDataSequential::getRawDataValues() const { /// formed with a vector or array of the specified element type. /// ConstantDataArray only works with normal float and int types that are /// stored densely in memory, not with things like i42 or x86_f80. -bool ConstantDataSequential::isElementTypeCompatible(const Type *Ty) { +bool ConstantDataSequential::isElementTypeCompatible(Type *Ty) { if (Ty->isFloatTy() || Ty->isDoubleTy()) return true; - if (const IntegerType *IT = dyn_cast<IntegerType>(Ty)) { + if (auto *IT = dyn_cast<IntegerType>(Ty)) { switch (IT->getBitWidth()) { case 8: case 16: |