diff options
author | Dan Gohman <gohman@apple.com> | 2010-12-15 20:02:24 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-12-15 20:02:24 +0000 |
commit | a4fcd2418dc7f0b425a3c1b4fb873fbe4e2e7f72 (patch) | |
tree | 962968e998866ffb0bf159c77c4f85e4bc509f3a /llvm/lib/VMCore/Value.cpp | |
parent | a51174af72e0ff8ccff9e5fc04b11a4c44f4d99c (diff) | |
download | bcm5719-llvm-a4fcd2418dc7f0b425a3c1b4fb873fbe4e2e7f72.tar.gz bcm5719-llvm-a4fcd2418dc7f0b425a3c1b4fb873fbe4e2e7f72.zip |
Move Value::getUnderlyingObject to be a standalone
function so that it can live in Analysis instead of
VMCore.
llvm-svn: 121885
Diffstat (limited to 'llvm/lib/VMCore/Value.cpp')
-rw-r--r-- | llvm/lib/VMCore/Value.cpp | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/llvm/lib/VMCore/Value.cpp b/llvm/lib/VMCore/Value.cpp index 9d0c2c5ae2a..76cfb9082a5 100644 --- a/llvm/lib/VMCore/Value.cpp +++ b/llvm/lib/VMCore/Value.cpp @@ -346,27 +346,6 @@ Value *Value::stripPointerCasts() { return V; } -Value *Value::getUnderlyingObject(unsigned MaxLookup) { - if (!getType()->isPointerTy()) - return this; - Value *V = this; - for (unsigned Count = 0; MaxLookup == 0 || Count < MaxLookup; ++Count) { - if (GEPOperator *GEP = dyn_cast<GEPOperator>(V)) { - V = GEP->getPointerOperand(); - } else if (Operator::getOpcode(V) == Instruction::BitCast) { - V = cast<Operator>(V)->getOperand(0); - } else if (GlobalAlias *GA = dyn_cast<GlobalAlias>(V)) { - if (GA->mayBeOverridden()) - return V; - V = GA->getAliasee(); - } else { - return V; - } - assert(V->getType()->isPointerTy() && "Unexpected operand type!"); - } - return V; -} - /// isDereferenceablePointer - Test if this value is always a pointer to /// allocated and suitably aligned memory for a simple load or store. bool Value::isDereferenceablePointer() const { |