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

Unified Diff: pkg/compiler/lib/src/ssa/codegen.dart

Issue 1678043003: Add Dart code to diff_view (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Update status. Created 4 years, 10 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 | « pkg/compiler/lib/src/ssa/builder.dart ('k') | pkg/compiler/lib/src/ssa/nodes.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/codegen.dart
diff --git a/pkg/compiler/lib/src/ssa/codegen.dart b/pkg/compiler/lib/src/ssa/codegen.dart
index 688030a2ccbaad531bc876bc6249400b3cff4d6f..fd2050c314bd17335723ac29b46d74ddf3372d15 100644
--- a/pkg/compiler/lib/src/ssa/codegen.dart
+++ b/pkg/compiler/lib/src/ssa/codegen.dart
@@ -247,7 +247,7 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
shouldGroupVarDeclarations = allocator.names.numberOfVariables > 1;
}
- void handleDelayedVariableDeclarations() {
+ void handleDelayedVariableDeclarations(SourceInformation sourceInformation) {
// If we have only one variable declaration and the first statement is an
// assignment to that variable then we can merge the two. We count the
// number of variables in the variable allocator to try to avoid this issue,
@@ -269,7 +269,8 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
js.VariableInitialization initialization =
new js.VariableInitialization(decl, assignment.value);
currentContainer.statements[0] = new js.ExpressionStatement(
- new js.VariableDeclarationList([initialization]));
+ new js.VariableDeclarationList([initialization]))
+ .withSourceInformation(sourceInformation);
return;
}
}
@@ -283,7 +284,8 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
declarations.add(new js.VariableInitialization(
new js.VariableDeclaration(name), null));
});
- var declarationList = new js.VariableDeclarationList(declarations);
+ var declarationList = new js.VariableDeclarationList(declarations)
+ .withSourceInformation(sourceInformation);;
insertStatementAtStart(new js.ExpressionStatement(declarationList));
}
}
@@ -293,7 +295,7 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
currentGraph = graph;
subGraph = new SubGraph(graph.entry, graph.exit);
visitBasicBlock(graph.entry);
- handleDelayedVariableDeclarations();
+ handleDelayedVariableDeclarations(graph.sourceInformation);
}
void visitSubGraph(SubGraph newSubGraph) {
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | pkg/compiler/lib/src/ssa/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698