summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Value.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/VMCore/Value.cpp')
-rw-r--r--llvm/lib/VMCore/Value.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/llvm/lib/VMCore/Value.cpp b/llvm/lib/VMCore/Value.cpp
index 40b2d95e3d0..41cc38c90af 100644
--- a/llvm/lib/VMCore/Value.cpp
+++ b/llvm/lib/VMCore/Value.cpp
@@ -321,9 +321,8 @@ namespace {
// Various metrics for how much to strip off of pointers.
enum PointerStripKind {
PSK_ZeroIndices,
- PSK_ConstantIndices,
- PSK_InBounds,
- PSK_All
+ PSK_InBoundsConstantIndices,
+ PSK_InBounds
};
template <PointerStripKind StripKind>
@@ -343,16 +342,14 @@ static Value *stripPointerCastsAndOffsets(Value *V) {
if (!GEP->hasAllZeroIndices())
return V;
break;
- case PSK_ConstantIndices:
+ case PSK_InBoundsConstantIndices:
if (!GEP->hasAllConstantIndices())
return V;
- break;
+ // fallthrough
case PSK_InBounds:
if (!GEP->isInBounds())
return V;
break;
- case PSK_All:
- break;
}
V = GEP->getPointerOperand();
} else if (Operator::getOpcode(V) == Instruction::BitCast) {
@@ -375,8 +372,8 @@ Value *Value::stripPointerCasts() {
return stripPointerCastsAndOffsets<PSK_ZeroIndices>(this);
}
-Value *Value::stripConstantOffsets() {
- return stripPointerCastsAndOffsets<PSK_ConstantIndices>(this);
+Value *Value::stripInBoundsConstantOffsets() {
+ return stripPointerCastsAndOffsets<PSK_InBoundsConstantIndices>(this);
}
Value *Value::stripInBoundsOffsets() {
OpenPOWER on IntegriCloud