aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-11-26 17:12:50 +0000
committerChris Lattner <sabre@nondot.org>2009-11-26 17:12:50 +0000
commite405c64f6b91635c8884411447ff5756c2e6b4c3 (patch)
tree6ae53a8b6d00bc2ee50cac8c19982d9166f0e7f5 /include
parentfa3966881f7f0317803b09161602c9c7eeb2d3a3 (diff)
downloadexternal_llvm-e405c64f6b91635c8884411447ff5756c2e6b4c3.zip
external_llvm-e405c64f6b91635c8884411447ff5756c2e6b4c3.tar.gz
external_llvm-e405c64f6b91635c8884411447ff5756c2e6b4c3.tar.bz2
move DecomposeGEPExpression out into ValueTracking.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89956 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Analysis/ValueTracking.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/llvm/Analysis/ValueTracking.h b/include/llvm/Analysis/ValueTracking.h
index 121da79..0596891 100644
--- a/include/llvm/Analysis/ValueTracking.h
+++ b/include/llvm/Analysis/ValueTracking.h
@@ -19,6 +19,7 @@
#include <string>
namespace llvm {
+ template <typename T> class SmallVectorImpl;
class Value;
class Instruction;
class APInt;
@@ -77,6 +78,20 @@ namespace llvm {
///
bool CannotBeNegativeZero(const Value *V, unsigned Depth = 0);
+ /// DecomposeGEPExpression - If V is a symbolic pointer expression, decompose
+ /// it into a base pointer with a constant offset and a number of scaled
+ /// symbolic offsets.
+ ///
+ /// When TargetData is around, this function is capable of analyzing
+ /// everything that Value::getUnderlyingObject() can look through. When not,
+ /// it just looks through pointer casts.
+ ///
+ const Value *DecomposeGEPExpression(const Value *V, int64_t &BaseOffs,
+ SmallVectorImpl<std::pair<const Value*, int64_t> > &VarIndices,
+ const TargetData *TD);
+
+
+
/// FindScalarValue - Given an aggregrate and an sequence of indices, see if
/// the scalar value indexed is already around as a register, for example if
/// it were inserted directly into the aggregrate.