changeset 282:74348f162225 trunk

[svn r303] Start a new basicblock behind a HaltExp to prevent compiler errors.
author ChristianK
date Sat, 21 Jun 2008 00:00:56 +0200
parents f5f97ca47b33
children 9bb48fb57a7d
files gen/toir.cpp
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/gen/toir.cpp	Fri Jun 20 23:38:51 2008 +0200
+++ b/gen/toir.cpp	Sat Jun 21 00:00:56 2008 +0200
@@ -2238,6 +2238,14 @@
 #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;
 }