Changes in directory llvm/lib/VMCore:
Instructions.cpp updated: 1.90 -> 1.91 --- Log message: add a GEP helper function --- Diffs of the changes: (+11 -0) Instructions.cpp | 11 +++++++++++ 1 files changed, 11 insertions(+) Index: llvm/lib/VMCore/Instructions.cpp diff -u llvm/lib/VMCore/Instructions.cpp:1.90 llvm/lib/VMCore/Instructions.cpp:1.91 --- llvm/lib/VMCore/Instructions.cpp:1.90 Sun Apr 22 14:24:39 2007 +++ llvm/lib/VMCore/Instructions.cpp Fri Apr 27 15:35:56 2007 @@ -1043,6 +1043,17 @@ 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 GetElementPtrInst::hasAllConstantIndices() const { + for (unsigned i = 1, e = getNumOperands(); i != e; ++i) { + if (!isa<ConstantInt>(getOperand(i))) + return false; + } + return true; +} + //===----------------------------------------------------------------------===// // ExtractElementInst Implementation _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits