From ea10657c08a321529b75b6499e469617b0addd8f Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 8 May 2006 05:59:36 +0000 Subject: [PATCH] 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 --- llvm/include/llvm/Use.h | 7 +++---- llvm/include/llvm/User.h | 7 +++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/llvm/include/llvm/Use.h b/llvm/include/llvm/Use.h index e817601f80cd..c88d41f70054 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 b38c516d1478..b0ecf75d8606 100644 --- a/llvm/include/llvm/User.h +++ b/llvm/include/llvm/User.h @@ -112,6 +112,13 @@ template<> struct simplify_type { template<> struct simplify_type : public simplify_type {}; + +// value_use_iterator::getOperandNo - Requires the definition of the User class. +template +unsigned value_use_iterator::getOperandNo() const { + return U - U->getUser()->op_begin(); +} + } // End llvm namespace #endif