From: Chris Lattner Date: Fri, 25 Jun 2004 23:06:57 +0000 (+0000) Subject: new ReturnInst(BB) does not "do the right thing". Add an assert to catch it X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e056f5c8e20b2a44e71e8303c5fa183857e9b476;p=oota-llvm.git 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 --- diff --git a/include/llvm/iTerminators.h b/include/llvm/iTerminators.h index ddced52697e..b1c69c28192 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(RetVal) && + "Cannot return basic block. Probably using the incorrect ctor"); Operands.reserve(1); Operands.push_back(Use(RetVal, this)); }