Create a new class, MemOperand, for describing memory references
[oota-llvm.git] / include / llvm / Use.h
index e817601f80cdda62bf433fe9fe30a65dff769bce..c5a3212ed83e5f6e98c82edf00bb1092e2c6efa1 100644 (file)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file was developed by the LLVM research group and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //
@@ -120,6 +120,9 @@ public:
   bool operator!=(const _Self &x) const {
     return !operator==(x);
   }
+  
+  /// atEnd - return true if this iterator is equal to use_end() on the value.
+  bool atEnd() const { return U == 0; }
 
   // Iterator traversal: forward iteration only
   _Self &operator++() {          // Preincrement
@@ -141,11 +144,10 @@ public:
 
   Use &getUse() const { return *U; }
   
-  /// getOperandNo - Return the operand # of this use in its User.
+  /// getOperandNo - Return the operand # of this use in its User.  Defined in
+  /// User.h
   ///
-  unsigned getOperandNo() const {
-    return U - U->getUser()->op_begin();
-  }
+  unsigned getOperandNo() const;
 };