aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore/Value.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-12-13 00:41:27 +0000
committerChris Lattner <sabre@nondot.org>2001-12-13 00:41:27 +0000
commit82d18aa0e42a4858c2cb7c15934cc3e567432490 (patch)
tree3f6fab3170af051327f4bb93ed8339ccee92b968 /lib/VMCore/Value.cpp
parent4adc20b41c066a1c91abe335eebd6a1abed59b53 (diff)
downloadexternal_llvm-82d18aa0e42a4858c2cb7c15934cc3e567432490.zip
external_llvm-82d18aa0e42a4858c2cb7c15934cc3e567432490.tar.gz
external_llvm-82d18aa0e42a4858c2cb7c15934cc3e567432490.tar.bz2
Add debugging to make a more useful message if a value gets constructed with a null type
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1443 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Value.cpp')
-rw-r--r--lib/VMCore/Value.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/VMCore/Value.cpp b/lib/VMCore/Value.cpp
index 3429d7c..0ac7205 100644
--- a/lib/VMCore/Value.cpp
+++ b/lib/VMCore/Value.cpp
@@ -18,8 +18,13 @@
// Value Class
//===----------------------------------------------------------------------===//
+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 string &name = "")
- : Name(name), Ty(ty, this) {
+ : Name(name), Ty(checkType(ty), this) {
VTy = vty;
}