diff options
author | Chris Lattner <sabre@nondot.org> | 2011-07-18 04:54:35 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-07-18 04:54:35 +0000 |
commit | 229907cd11658776a6c7451de74b9e16ba637d9c (patch) | |
tree | 56a83033fb7b2337bf90a7b23ca87e9a0e8b62f7 /llvm/lib/VMCore/Value.cpp | |
parent | 805d09459df33da12c3dc3cf6ab7806baebbe4c8 (diff) | |
download | bcm5719-llvm-229907cd11658776a6c7451de74b9e16ba637d9c.tar.gz bcm5719-llvm-229907cd11658776a6c7451de74b9e16ba637d9c.zip |
land David Blaikie's patch to de-constify Type, with a few tweaks.
llvm-svn: 135375
Diffstat (limited to 'llvm/lib/VMCore/Value.cpp')
-rw-r--r-- | llvm/lib/VMCore/Value.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/VMCore/Value.cpp b/llvm/lib/VMCore/Value.cpp index f1815e377ed..2fa5f08a3e7 100644 --- a/llvm/lib/VMCore/Value.cpp +++ b/llvm/lib/VMCore/Value.cpp @@ -35,12 +35,12 @@ using namespace llvm; // Value Class //===----------------------------------------------------------------------===// -static inline Type *checkType(const Type *Ty) { +static inline Type *checkType(Type *Ty) { assert(Ty && "Value defined with a null type: Error!"); return const_cast<Type*>(Ty); } -Value::Value(const Type *ty, unsigned scid) +Value::Value(Type *ty, unsigned scid) : SubclassID(scid), HasValueHandle(0), SubclassOptionalData(0), SubclassData(0), VTy((Type*)checkType(ty)), UseList(0), Name(0) { @@ -369,7 +369,7 @@ bool Value::isDereferenceablePointer() const { for (User::const_op_iterator I = GEP->op_begin()+1, E = GEP->op_end(); I != E; ++I) { Value *Index = *I; - const Type *Ty = *GTI++; + Type *Ty = *GTI++; // Struct indices can't be out of bounds. if (isa<StructType>(Ty)) continue; @@ -380,7 +380,7 @@ bool Value::isDereferenceablePointer() const { if (CI->isZero()) continue; // Check to see that it's within the bounds of an array. - const ArrayType *ATy = dyn_cast<ArrayType>(Ty); + ArrayType *ATy = dyn_cast<ArrayType>(Ty); if (!ATy) return false; if (CI->getValue().getActiveBits() > 64) |