Chromium Code Reviews| Index: frog/leg/ssa/builder.dart |
| =================================================================== |
| --- frog/leg/ssa/builder.dart (revision 5192) |
| +++ frog/leg/ssa/builder.dart (working copy) |
| @@ -1053,9 +1053,9 @@ |
| // <updates> |
| // goto loop-entry; |
| // loop-exit: |
| - if (condition === null || body === null) { |
| + if (body === null) { |
| compiler.unimplemented( |
| - 'SsaBuilder.visitLoop with empty condition or body', |
| + 'SsaBuilder.visitLoop with empty body', |
| node: loop); |
| } |
| @@ -1072,9 +1072,13 @@ |
| BreakHandler breakHandler = beginLoopHeader(loop); |
| HBasicBlock conditionBlock = current; |
| - // The condition. |
| - visit(condition); |
| - HBasicBlock conditionExitBlock = close(new HLoopBranch(popBoolified())); |
| + HBasicBlock conditionExitBlock; |
| + if (condition != null) { |
| + visit(condition); |
| + conditionExitBlock = close(new HLoopBranch(popBoolified())); |
| + } else { |
| + conditionExitBlock = close(new HLoopBranch(graph.addConstantBool(true))); |
|
Lasse Reichstein Nielsen
2012/03/09 07:16:46
This could be one line with a conditional expressi
ngeoffray
2012/03/09 09:16:45
Done.
|
| + } |
| LocalsHandler savedLocals = new LocalsHandler.from(localsHandler); |
| @@ -1119,9 +1123,6 @@ |
| } |
| visitFor(For node) { |
| - if (node.condition === null) { |
| - compiler.unimplemented("SsaBuilder for loop without condition"); |
| - } |
| assert(node.body !== null); |
| visitLoop(node, node.initializer, node.condition, node.update, node.body); |
| } |