OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library tree_ir.optimization.statement_rewriter; | 5 library tree_ir.optimization.statement_rewriter; |
6 | 6 |
7 import 'optimization.dart' show Pass; | 7 import 'optimization.dart' show Pass; |
8 import '../tree_ir_nodes.dart'; | 8 import '../tree_ir_nodes.dart'; |
9 | 9 |
10 /** | 10 /** |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 _rewriteList(node.arguments); | 381 _rewriteList(node.arguments); |
382 node.receiver = visitExpression(node.receiver); | 382 node.receiver = visitExpression(node.receiver); |
383 return node; | 383 return node; |
384 } | 384 } |
385 | 385 |
386 Expression visitInvokeConstructor(InvokeConstructor node) { | 386 Expression visitInvokeConstructor(InvokeConstructor node) { |
387 _rewriteList(node.arguments); | 387 _rewriteList(node.arguments); |
388 return node; | 388 return node; |
389 } | 389 } |
390 | 390 |
| 391 Expression visitConcatenateStrings(ConcatenateStrings node) { |
| 392 _rewriteList(node.arguments); |
| 393 return node; |
| 394 } |
| 395 |
391 Expression visitConditional(Conditional node) { | 396 Expression visitConditional(Conditional node) { |
392 // Conditional expressions do not exist in the input, but they are | 397 // Conditional expressions do not exist in the input, but they are |
393 // introduced by if-to-conditional conversion. | 398 // introduced by if-to-conditional conversion. |
394 // Their subexpressions have already been processed; do not reprocess them. | 399 // Their subexpressions have already been processed; do not reprocess them. |
395 // | 400 // |
396 // Note that this can only happen for conditional expressions. It is an | 401 // Note that this can only happen for conditional expressions. It is an |
397 // error for any other type of expression to be visited twice or to be | 402 // error for any other type of expression to be visited twice or to be |
398 // created and then visited. We use this special treatment of conditionals | 403 // created and then visited. We use this special treatment of conditionals |
399 // to allow for assignment inlining after if-to-conditional conversion. | 404 // to allow for assignment inlining after if-to-conditional conversion. |
400 // | 405 // |
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1033 IsVariableUsedVisitor(this.variable); | 1038 IsVariableUsedVisitor(this.variable); |
1034 | 1039 |
1035 visitVariableUse(VariableUse node) { | 1040 visitVariableUse(VariableUse node) { |
1036 if (node.variable == variable) { | 1041 if (node.variable == variable) { |
1037 wasFound = true; | 1042 wasFound = true; |
1038 } | 1043 } |
1039 } | 1044 } |
1040 | 1045 |
1041 visitInnerFunction(FunctionDefinition node) {} | 1046 visitInnerFunction(FunctionDefinition node) {} |
1042 } | 1047 } |
OLD | NEW |