Generalize MVT::ValueType and associated functions to be able to represent
[oota-llvm.git] / include / llvm / Instructions.h
index 236a1fdcced8cc6bc5a508afcfddc9929b9ff77d..dc29b9a8f8cdc6f89e8c015d586b37374a14740a 100644 (file)
@@ -441,6 +441,12 @@ public:
   /// zeros.  If so, the result pointer and the first operand have the same
   /// value, just potentially different types.
   bool hasAllZeroIndices() const;
+  
+  /// 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;
+  
 
   // Methods for support type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const GetElementPtrInst *) { return true; }
@@ -1317,8 +1323,7 @@ public:
 
   BasicBlock *getSuccessor(unsigned i) const {
     assert(i < getNumSuccessors() && "Successor # out of range for Branch!");
-    return (i == 0) ? cast<BasicBlock>(getOperand(0)) :
-                      cast<BasicBlock>(getOperand(1));
+    return cast<BasicBlock>(getOperand(i));
   }
 
   void setSuccessor(unsigned idx, BasicBlock *NewSucc) {