add an assertion
[oota-llvm.git] / include / llvm / User.h
index e45afdca68f7fad170340cb937398cb585813970..47f300cd534aafe9888cc43ff8feec4903f5a8f7 100644 (file)
@@ -29,7 +29,8 @@ class User : public Value {
 protected:
   std::vector<Use> Operands;
 public:
-  User(const Type *Ty, ValueTy vty, const std::string &name = "");
+  User(const Type *Ty, unsigned vty, const std::string &name = "")
+    : Value(Ty, vty, name) {}
 
   inline Value *getOperand(unsigned i) { 
     assert(i < Operands.size() && "getOperand() out of range!");
@@ -43,7 +44,7 @@ public:
     assert(i < Operands.size() && "setOperand() out of range!");
     Operands[i] = Val;
   }
-  inline unsigned getNumOperands() const { return Operands.size(); }
+  inline unsigned getNumOperands() const { return (unsigned)Operands.size(); }
 
   // ---------------------------------------------------------------------------
   // Operand Iterator interface...
@@ -86,8 +87,7 @@ public:
   // Methods for support type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const User *) { return true; }
   static inline bool classof(const Value *V) {
-    return isa<Instruction>(V) || isa<GlobalVariable>(V) ||
-           isa<Constant>(V);
+    return isa<Instruction>(V) || isa<Constant>(V);
   }
 };