Move the definition of value_use_iterator::getOperandNo to User.h where the
authorChris Lattner <sabre@nondot.org>
Mon, 8 May 2006 05:59:36 +0000 (05:59 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 8 May 2006 05:59:36 +0000 (05:59 +0000)
definition of the User class is available, this fixes the  build with some
compiler versions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28163 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Use.h
include/llvm/User.h

index e817601f80cdda62bf433fe9fe30a65dff769bce..c88d41f700544007ad8dd1cbf0778c58f3efb66d 100644 (file)
@@ -141,11 +141,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;
 };
 
 
index b38c516d147811a7b37cdb955534a5d777d41af8..b0ecf75d8606aba93e69146cb3212cbd362a550b 100644 (file)
@@ -112,6 +112,13 @@ template<> struct simplify_type<User::const_op_iterator> {
 template<> struct simplify_type<const User::const_op_iterator>
   : public simplify_type<User::const_op_iterator> {};
 
+
+// value_use_iterator::getOperandNo - Requires the definition of the User class.
+template<typename UserTy>
+unsigned value_use_iterator<UserTy>::getOperandNo() const {
+  return U - U->getUser()->op_begin();
+}
+
 } // End llvm namespace
 
 #endif