Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Unified Diff: frog/leg/ssa/codegen.dart

Issue 9810006: Make continue work in do-while. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: frog/leg/ssa/codegen.dart
diff --git a/frog/leg/ssa/codegen.dart b/frog/leg/ssa/codegen.dart
index 0f58f29cd7a6ee9c84bf7f883acd856c5dddfdca..02bc40afe5d04a1a95bd641e552f865892d8d67d 100644
--- a/frog/leg/ssa/codegen.dart
+++ b/frog/leg/ssa/codegen.dart
@@ -249,16 +249,21 @@ class SsaCodeGenerator implements HVisitor {
addIndentation();
for (LabelElement label in labeledBlockInfo.labels) {
if (labeledBlockInfo.isContinue) {
- addContinueLabel(label);
+ if (label.isContinueTarget) {
+ addContinueLabel(label);
+ buffer.add(':');
+ }
} else {
- addBreakLabel(label);
+ if (label.isBreakTarget) {
+ addBreakLabel(label);
+ buffer.add(':');
+ }
}
- buffer.add(':');
}
TargetElement target = labeledBlockInfo.target;
if (target.isSwitch) {
addImplicitBreakLabel(target);
- buffer.add(@':');
+ buffer.add(':');
}
if (labeledBlockInfo.isContinue) {
addImplicitContinueLabel(target);
@@ -296,12 +301,13 @@ class SsaCodeGenerator implements HVisitor {
return;
}
- currentBlock = node;
if (node.isLoopHeader()) {
// While loop will be closed by the conditional loop-branch.
// TODO(floitsch): HACK HACK HACK.
beginLoop(node);
}
+
+ currentBlock = node;
ngeoffray 2012/03/21 12:23:23 Why this change? I actually think we should get ri
Lasse Reichstein Nielsen 2012/03/21 12:33:26 Hmm, is it even safe? I hadn't noticed that curren
HInstruction instruction = node.first;
while (instruction != null) {
if (instruction is HGoto || instruction is HExit || instruction is HTry) {

Powered by Google App Engine
This is Rietveld 408576698