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
This commit is contained in:
Chris Lattner 2004-06-25 23:06:57 +00:00
parent b8356b3ce2
commit e056f5c8e2

View 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));
}