# HG changeset patch # User Christian Kamm # Date 1218878374 -7200 # Node ID 9534dbc70a56719a7bc3772a4c10901325b90109 # Parent eada571dc8ff4b79a634a22c7ddc60e2504b1908 Fix continue inside dowhile statements. Fixes: run/do_while_02 diff -r eada571dc8ff -r 9534dbc70a56 gen/statements.cpp --- a/gen/statements.cpp Sat Aug 16 10:48:25 2008 +0200 +++ b/gen/statements.cpp Sat Aug 16 11:19:34 2008 +0200 @@ -282,6 +282,7 @@ // create while blocks llvm::BasicBlock* oldend = gIR->scopeend(); llvm::BasicBlock* dowhilebb = llvm::BasicBlock::Create("dowhile", gIR->topfunc(), oldend); + llvm::BasicBlock* condbb = llvm::BasicBlock::Create("dowhilecond", gIR->topfunc(), oldend); llvm::BasicBlock* endbb = llvm::BasicBlock::Create("enddowhile", gIR->topfunc(), oldend); // move into the while block @@ -289,13 +290,17 @@ llvm::BranchInst::Create(dowhilebb, gIR->scopebb()); // replace current scope - gIR->scope() = IRScope(dowhilebb,endbb); + gIR->scope() = IRScope(dowhilebb,condbb); // do-while body code - p->loopbbs.push_back(IRLoopScope(this,enclosinghandler,dowhilebb,endbb)); + p->loopbbs.push_back(IRLoopScope(this,enclosinghandler,condbb,endbb)); body->toIR(p); p->loopbbs.pop_back(); + // branch to condition block + llvm::BranchInst::Create(condbb, gIR->scopebb()); + gIR->scope() = IRScope(condbb,endbb); + // create the condition DValue* cond_e = condition->toElem(p); LLValue* cond_val = DtoBoolean(loc, cond_e);