comparison gen/toir.cpp @ 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
comparison
equal deleted inserted replaced
281:f5f97ca47b33 282:74348f162225
2236 // call the new (?) trap intrinsic 2236 // call the new (?) trap intrinsic
2237 p->ir->CreateCall(GET_INTRINSIC_DECL(trap),""); 2237 p->ir->CreateCall(GET_INTRINSIC_DECL(trap),"");
2238 #endif 2238 #endif
2239 2239
2240 new llvm::UnreachableInst(p->scopebb()); 2240 new llvm::UnreachableInst(p->scopebb());
2241
2242 // this terminated the basicblock, start a new one
2243 // this is sensible, since someone might goto behind the assert
2244 // and prevents compiler errors if a terminator follows the assert
2245 llvm::BasicBlock* oldend = gIR->scopeend();
2246 llvm::BasicBlock* bb = llvm::BasicBlock::Create("afterhalt", p->topfunc(), oldend);
2247 p->scope() = IRScope(bb,oldend);
2248
2241 return 0; 2249 return 0;
2242 } 2250 }
2243 2251
2244 ////////////////////////////////////////////////////////////////////////////////////////// 2252 //////////////////////////////////////////////////////////////////////////////////////////
2245 2253