-Value::Value(const Type *ty, ValueTy vty, const string &name = "")
- : Name(name), Ty(ty, this) {
+static inline const Type *checkType(const Type *Ty) {
+ assert(Ty && "Value defined with a null type: Error!");
+ return Ty;
+}
+
+Value::Value(const Type *ty, ValueTy vty, const std::string &name = "")
+ : Name(name), Ty(checkType(ty), this) {