mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-07 19:36:06 +03:00
[svn r303] Start a new basicblock behind a HaltExp to prevent compiler errors.
This commit is contained in:
parent
a99d70f7bc
commit
02caaff23e
1 changed files with 8 additions and 0 deletions
|
@ -2238,6 +2238,14 @@ DValue* HaltExp::toElem(IRState* p)
|
|||
#endif
|
||||
|
||||
new llvm::UnreachableInst(p->scopebb());
|
||||
|
||||
// this terminated the basicblock, start a new one
|
||||
// this is sensible, since someone might goto behind the assert
|
||||
// and prevents compiler errors if a terminator follows the assert
|
||||
llvm::BasicBlock* oldend = gIR->scopeend();
|
||||
llvm::BasicBlock* bb = llvm::BasicBlock::Create("afterhalt", p->topfunc(), oldend);
|
||||
p->scope() = IRScope(bb,oldend);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue