diff options
author | Chris Lattner <sabre@nondot.org> | 2001-10-13 06:12:38 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2001-10-13 06:12:38 +0000 |
commit | 16ddd025451aff4573adad3e1a1fc2a5f9aa59a3 (patch) | |
tree | 5f113b99012c68c1843ee6125be97c68ac40ad67 | |
parent | 30bdaaa3fc6818f7df59652b3ae2d95f305ea3b4 (diff) |
Add assertions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@734 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/GlobalVariable.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/llvm/GlobalVariable.h b/include/llvm/GlobalVariable.h index 2e298058f5..66ab21c42a 100644 --- a/include/llvm/GlobalVariable.h +++ b/include/llvm/GlobalVariable.h @@ -36,9 +36,11 @@ public: // inline bool hasInitializer() const { return !Operands.empty(); } inline const ConstPoolVal *getInitializer() const { + assert(hasInitializer() && "GV doesn't have initializer!"); return (const ConstPoolVal*)Operands[0].get(); } inline ConstPoolVal *getInitializer() { + assert(hasInitializer() && "GV doesn't have initializer!"); return (ConstPoolVal*)Operands[0].get(); } inline void setInitializer(ConstPoolVal *CPV) { |