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

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

Issue 2297853003: implement kernel -> ssa for simple binary expression (Closed)
Patch Set: add TODO, rename adapter method Created 4 years, 4 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') | no next file with comments »
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 8c81f19bf82c10f2b0fed39b331254ec5e6b4ea9..900c0cc042b2c884414dcbaae22b38941cefd0b1 100644
--- a/pkg/compiler/lib/src/kernel/kernel_visitor.dart
+++ b/pkg/compiler/lib/src/kernel/kernel_visitor.dart
@@ -199,13 +199,17 @@ class KernelVisitor extends Object
<CascadeReceiver, ir.VariableGet>{};
final Map<ir.Node, Element> nodeToElement = <ir.Node, Element>{};
+ final Map<ir.Node, Node> nodeToAst = <ir.Node, Node>{};
- ir.Node associate(ir.Node node, Element element) {
+ ir.Node associateElement(ir.Node node, Element element) {
nodeToElement[node] = element;
return node;
}
- final Map<ir.Node, Node> nodeToAst = <ir.Node, Node>{};
+ ir.Node associateNode(ir.Node node, Node ast) {
+ nodeToAst[node] = ast;
+ return node;
+ }
bool isVoidContext = false;
@@ -1130,7 +1134,8 @@ class KernelVisitor extends Object
@override
ir.MethodInvocation visitBinary(
Send node, Node left, BinaryOperator operator, Node right, _) {
- return buildBinaryOperator(left, operator.selectorName, right);
+ return associateNode(
+ buildBinaryOperator(left, operator.selectorName, right), node);
}
ir.Expression buildConstructorInvoke(NewExpression node, {bool isConst}) {
@@ -1922,7 +1927,7 @@ class KernelVisitor extends Object
ir.VariableDeclaration getLocal(LocalElement local) {
return locals.putIfAbsent(local, () {
- return associate(
+ return associateElement(
new ir.VariableDeclaration(local.name,
initializer: null,
type: typeToIrHack(local.type),
@@ -1998,7 +2003,7 @@ class KernelVisitor extends Object
}
ir.Statement body =
(bodyNode == null) ? null : buildStatementInBlock(bodyNode);
- return associate(
+ return associateElement(
new ir.FunctionNode(body,
asyncMarker: asyncMarker,
returnType: returnType,
« no previous file with comments | « no previous file | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698