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

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

Issue 2750013002: [kernel] Debugging of switch statement (Closed)
Patch Set: Addressed comments Created 3 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: 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 30d1ead5f547bc9a3eb1f6e1838cf4d53c214a95..b889af3c53f77481eb3fa1f1badf50f868307146 100644
--- a/pkg/compiler/lib/src/kernel/kernel_visitor.dart
+++ b/pkg/compiler/lib/src/kernel/kernel_visitor.dart
@@ -1011,10 +1011,13 @@ class KernelVisitor extends Object
@override
ir.SwitchCase visitSwitchCase(SwitchCase node) {
List<ir.Expression> expressions = <ir.Expression>[];
+ List<int> expressionOffsets = <int>[];
for (var labelOrCase in node.labelsAndCases.nodes) {
CaseMatch match = labelOrCase.asCaseMatch();
if (match != null) {
- expressions.add(visitForValue(match.expression));
+ ir.TreeNode expression = visitForValue(match.expression);
+ expressions.add(expression);
+ expressionOffsets.add(expression.fileOffset);
} else {
// Assert that labelOrCase is one of two known types: [CaseMatch] or
// [Label]. We ignore cases, as any users have been resolved to use the
@@ -1025,7 +1028,8 @@ class KernelVisitor extends Object
// We ignore the node's statements here, they're generated below in
// [visitSwitchStatement] once we've set up all the jump targets.
return associateNode(
- new ir.SwitchCase(expressions, null, isDefault: node.isDefaultCase),
+ new ir.SwitchCase(expressions, expressionOffsets, null,
+ isDefault: node.isDefaultCase),
node);
}
« no previous file with comments | « pkg/analyzer/lib/src/kernel/ast_from_analyzer.dart ('k') | pkg/front_end/lib/src/fasta/kernel/body_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698