diff options
author | Chris Lattner <sabre@nondot.org> | 2004-06-25 23:06:57 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-06-25 23:06:57 +0000 |
commit | e056f5c8e20b2a44e71e8303c5fa183857e9b476 (patch) | |
tree | 0594bd5db076efd846905f575d1c5cd353e74d2b | |
parent | b8356b3ce2d1913d466ac4dc1812d7e2520527dd (diff) |
new ReturnInst(BB) does not "do the right thing". Add an assert to catch it
sooner rather than later.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14421 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/iTerminators.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/llvm/iTerminators.h b/include/llvm/iTerminators.h index ddced52697..b1c69c2819 100644 --- a/include/llvm/iTerminators.h +++ b/include/llvm/iTerminators.h @@ -35,6 +35,8 @@ class ReturnInst : public TerminatorInst { void init(Value *RetVal) { if (RetVal) { + assert(!isa<BasicBlock>(RetVal) && + "Cannot return basic block. Probably using the incorrect ctor"); Operands.reserve(1); Operands.push_back(Use(RetVal, this)); } |