summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-05-08 05:59:36 +0000
committerChris Lattner <sabre@nondot.org>2006-05-08 05:59:36 +0000
commitea10657c08a321529b75b6499e469617b0addd8f (patch)
tree3e505eebb46cce2b3fd21ab108b1f6483e0ac69e
parentdc996b3f6c9b05231e412dca5499b87f178fd513 (diff)
downloadbcm5719-llvm-ea10657c08a321529b75b6499e469617b0addd8f.tar.gz
bcm5719-llvm-ea10657c08a321529b75b6499e469617b0addd8f.zip
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
-rw-r--r--llvm/include/llvm/Use.h7
-rw-r--r--llvm/include/llvm/User.h7
2 files changed, 10 insertions, 4 deletions
diff --git a/llvm/include/llvm/Use.h b/llvm/include/llvm/Use.h
index e817601f80c..c88d41f7005 100644
--- a/llvm/include/llvm/Use.h
+++ b/llvm/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/llvm/include/llvm/User.h b/llvm/include/llvm/User.h
index b38c516d147..b0ecf75d860 100644
--- a/llvm/include/llvm/User.h
+++ b/llvm/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
OpenPOWER on IntegriCloud