aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-12-15 20:02:24 +0000
committerDan Gohman <gohman@apple.com>2010-12-15 20:02:24 +0000
commit5034dd318a9dfa0dc45a3ac01e58e60f2aa2498d (patch)
tree85f466bd781bcb1865313cc739b252f02116c838 /lib/VMCore
parentd5f4bc2c339a88c331dd7ecaa36833358bc1d3b1 (diff)
downloadexternal_llvm-5034dd318a9dfa0dc45a3ac01e58e60f2aa2498d.zip
external_llvm-5034dd318a9dfa0dc45a3ac01e58e60f2aa2498d.tar.gz
external_llvm-5034dd318a9dfa0dc45a3ac01e58e60f2aa2498d.tar.bz2
Move Value::getUnderlyingObject to be a standalone
function so that it can live in Analysis instead of VMCore. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121885 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/Value.cpp21
1 files changed, 0 insertions, 21 deletions
diff --git a/lib/VMCore/Value.cpp b/lib/VMCore/Value.cpp
index 9d0c2c5..76cfb90 100644
--- a/lib/VMCore/Value.cpp
+++ b/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 {