new ReturnInst(BB) does not "do the right thing". Add an assert to catch it
authorChris Lattner <sabre@nondot.org>
Fri, 25 Jun 2004 23:06:57 +0000 (23:06 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 25 Jun 2004 23:06:57 +0000 (23:06 +0000)
sooner rather than later.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14421 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/iTerminators.h

index ddced52697e81d1a4121af91b5f375202f4dc00c..b1c69c28192d264f496895ff9b9c7087830701eb 100644 (file)
@@ -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));
     }