diff options
author | Chris Lattner <sabre@nondot.org> | 2006-05-08 05:59:36 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-05-08 05:59:36 +0000 |
commit | 023cfb6871c3a302387ea3e228dc000e45639b5b (patch) | |
tree | 233c6a26ac85649159cd5c75037ae434db83ce6e | |
parent | 93376b083e11f6dfcc678fe68abbc801eaa0a348 (diff) |
Move the definition of value_use_iterator::getOperandNo to User.h where the
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
-rw-r--r-- | include/llvm/Use.h | 7 | ||||
-rw-r--r-- | include/llvm/User.h | 7 |
2 files changed, 10 insertions, 4 deletions
diff --git a/include/llvm/Use.h b/include/llvm/Use.h index e817601f80..c88d41f700 100644 --- a/include/llvm/Use.h +++ b/include/llvm/Use.h @@ -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; }; diff --git a/include/llvm/User.h b/include/llvm/User.h index b38c516d14..b0ecf75d86 100644 --- a/include/llvm/User.h +++ b/include/llvm/User.h @@ -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 |