1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

add a helper method.

llvm-svn: 82438
This commit is contained in:
Chris Lattner 2009-09-21 05:52:45 +00:00
parent 3edb8b18a5
commit 0cd0c5c98f

View File

@ -274,6 +274,18 @@ public:
return true;
}
/// hasAllConstantIndices - Return true if all of the indices of this GEP are
/// constant integers. If so, the result pointer and the first operand have
/// a constant offset between them.
bool hasAllConstantIndices() const {
for (const_op_iterator I = idx_begin(), E = idx_end(); I != E; ++I) {
if (!isa<ConstantInt>(I))
return false;
}
return true;
}
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const GEPOperator *) { return true; }
static inline bool classof(const GetElementPtrInst *) { return true; }