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.

llvm-svn: 28163
This commit is contained in:
Chris Lattner 2006-05-08 05:59:36 +00:00
parent dc996b3f6c
commit ea10657c08
2 changed files with 10 additions and 4 deletions

View 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;
};

View 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