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

Unified Diff: pkg/compiler/lib/src/kernel/kernel_visitor.dart

Issue 2637483002: Implement switch statement, without the "complex switch statement" (aka switch statement with conti… (Closed)
Patch Set: . Created 3 years, 11 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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/ssa/builder.dart » ('j') | pkg/compiler/lib/src/ssa/builder_kernel.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/kernel/kernel_visitor.dart
diff --git a/pkg/compiler/lib/src/kernel/kernel_visitor.dart b/pkg/compiler/lib/src/kernel/kernel_visitor.dart
index 6a663b01c4cc12299b6c335c7879e15d7f3c73ce..17594db6ed27c63ae5ed909922bd8bc7102b2393 100644
--- a/pkg/compiler/lib/src/kernel/kernel_visitor.dart
+++ b/pkg/compiler/lib/src/kernel/kernel_visitor.dart
@@ -850,17 +850,17 @@ class KernelVisitor extends Object
@override
ir.BoolLiteral visitLiteralBool(LiteralBool node) {
- return new ir.BoolLiteral(node.value);
+ return associateNode(new ir.BoolLiteral(node.value), node);
}
@override
ir.DoubleLiteral visitLiteralDouble(LiteralDouble node) {
- return new ir.DoubleLiteral(node.value);
+ return associateNode(new ir.DoubleLiteral(node.value), node);
}
@override
ir.IntLiteral visitLiteralInt(LiteralInt node) {
- return new ir.IntLiteral(node.value);
+ return associateNode(new ir.IntLiteral(node.value), node);
}
@override
@@ -911,7 +911,8 @@ class KernelVisitor extends Object
@override
ir.Expression visitLiteralString(LiteralString node) {
if (node.dartString == null) return new ir.InvalidExpression();
- return new ir.StringLiteral(node.dartString.slowToString());
+ return associateNode(new ir.StringLiteral(node.dartString.slowToString()),
+ node);
}
@override
@@ -1040,10 +1041,7 @@ class KernelVisitor extends Object
}
}
if (statements.isEmpty || fallsThrough(statements.last)) {
- if (isLastCase) {
- statements.add(new ir.BreakStatement(
- getBreakTarget(elements.getTargetDefinition(node))));
- } else {
+ if (!isLastCase) {
statements.add(new ir.ExpressionStatement(new ir.Throw(
new ir.ConstructorInvocation(
kernel.getFallThroughErrorConstructor(),
@@ -1259,7 +1257,7 @@ class KernelVisitor extends Object
@override
ir.InvocationExpression visitConstConstructorInvoke(
NewExpression node, ConstructedConstantExpression constant, _) {
- return buildConstructorInvoke(node, isConst: true);
+ return associateNode(buildConstructorInvoke(node, isConst: true), node);
}
@override
« no previous file with comments | « no previous file | pkg/compiler/lib/src/ssa/builder.dart » ('j') | pkg/compiler/lib/src/ssa/builder_kernel.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698