mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-05 09:31:03 +03:00
[svn r288] Let return statements start a new basic block after terminating the current one.
This fixes problems such as void main() { return; return; }
This commit is contained in:
parent
039664b249
commit
03888f4b07
1 changed files with 5 additions and 0 deletions
|
@ -140,6 +140,11 @@ void ReturnStatement::toIR(IRState* p)
|
|||
if (global.params.symdebug) DtoDwarfFuncEnd(p->func()->decl);
|
||||
llvm::ReturnInst::Create(p->scopebb());
|
||||
}
|
||||
|
||||
// the return terminated this basicblock, start a new one
|
||||
llvm::BasicBlock* oldend = gIR->scopeend();
|
||||
llvm::BasicBlock* bb = llvm::BasicBlock::Create("afterreturn", p->topfunc(), oldend);
|
||||
p->scope() = IRScope(bb,oldend);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue