Change UsedPhysRegs from array bool to BitVector to save some space. Setting / gettin...
[oota-llvm.git] / include / llvm / User.h
index b38c516d147811a7b37cdb955534a5d777d41af8..1ea5e189ba8263351d4e1ce99fd468b2855657ce 100644 (file)
@@ -20,7 +20,6 @@
 #define LLVM_USER_H
 
 #include "llvm/Value.h"
-#include <vector>
 
 namespace llvm {
 
@@ -39,9 +38,8 @@ protected:
   unsigned NumOperands;
 
 public:
-  User(const Type *Ty, unsigned vty, Use *OpList, unsigned NumOps,
-       const std::string &name = "")
-    : Value(Ty, vty, name), OperandList(OpList), NumOperands(NumOps) {}
+  User(const Type *Ty, unsigned vty, Use *OpList, unsigned NumOps)
+    : Value(Ty, vty), OperandList(OpList), NumOperands(NumOps) {}
 
   Value *getOperand(unsigned i) const {
     assert(i < NumOperands && "getOperand() out of range!");
@@ -112,6 +110,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