From 3dc6c1b93cb230908c749a6f04f5353807f896df Mon Sep 17 00:00:00 2001 From: Yong He Date: Mon, 13 Nov 2017 18:37:30 -0500 Subject: fix merge bug --- source/slang/emit.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'source/slang/emit.cpp') diff --git a/source/slang/emit.cpp b/source/slang/emit.cpp index d41af9ef5..a8cd11af4 100644 --- a/source/slang/emit.cpp +++ b/source/slang/emit.cpp @@ -5567,9 +5567,10 @@ emitDeclImpl(decl, nullptr); emit("for(;;)\n{\n"); // Register information so that `continue` sites - // can do the right thing: + // can do the right thing: ctx->shared->irMapContinueTargetToLoopHead.Add(continueBlock, targetBlock); + emitIRStmtsForBlocks( ctx, targetBlock, @@ -5589,18 +5590,18 @@ emitDeclImpl(decl, nullptr); return; case kIROp_continue: - // With out current strategy for outputting loops, - // just outputting an AST-level `continue` here won't - // actually execute the statements in the continue block. - // - // Instead, we have to manually output those statements - // directly here, and *then* do an AST-level `continue`. - // - // This leads to code duplication when we have multiple - // `continue` sites in the original program, but it avoids - // introducing additional temporaries for control flow. + // With out current strategy for outputting loops, + // just outputting an AST-level `continue` here won't + // actually execute the statements in the continue block. + // + // Instead, we have to manually output those statements + // directly here, and *then* do an AST-level `continue`. + // + // This leads to code duplication when we have multiple + // `continue` sites in the original program, but it avoids + // introducing additional temporaries for control flow. { - auto continueInst = (IRContinue*)terminator; + auto continueInst = (IRContinue*) terminator; auto targetBlock = continueInst->getTargetBlock(); IRBlock* loopHead = nullptr; ctx->shared->irMapContinueTargetToLoopHead.TryGetValue(targetBlock, loopHead); -- cgit v1.2.3