| 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_builder; | 5 library tree_ir_builder; |
| 6 | 6 |
| 7 import '../diagnostics/invariant.dart' show | 7 import '../common.dart'; |
| 8 InternalErrorFunction; | 8 import '../constants/values.dart'; |
| 9 import '../diagnostics/spannable.dart' show | 9 import '../cps_ir/cps_ir_nodes.dart' as cps_ir; |
| 10 CURRENT_ELEMENT_SPANNABLE; | |
| 11 import '../elements/elements.dart'; | 10 import '../elements/elements.dart'; |
| 12 import '../cps_ir/cps_ir_nodes.dart' as cps_ir; | 11 |
| 13 import 'tree_ir_nodes.dart'; | 12 import 'tree_ir_nodes.dart'; |
| 14 import '../constants/values.dart'; | |
| 15 | 13 |
| 16 typedef Statement NodeCallback(Statement next); | 14 typedef Statement NodeCallback(Statement next); |
| 17 | 15 |
| 18 /** | 16 /** |
| 19 * Builder translates from CPS-based IR to direct-style Tree. | 17 * Builder translates from CPS-based IR to direct-style Tree. |
| 20 * | 18 * |
| 21 * A call `Invoke(fun, cont, args)`, where cont is a singly-referenced | 19 * A call `Invoke(fun, cont, args)`, where cont is a singly-referenced |
| 22 * non-exit continuation `Cont(v, body)` is translated into a direct-style call | 20 * non-exit continuation `Cont(v, body)` is translated into a direct-style call |
| 23 * whose value is bound in the continuation body: | 21 * whose value is bound in the continuation body: |
| 24 * | 22 * |
| (...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 699 internalError(CURRENT_ELEMENT_SPANNABLE, 'Unexpected IR node: $node'); | 697 internalError(CURRENT_ELEMENT_SPANNABLE, 'Unexpected IR node: $node'); |
| 700 } | 698 } |
| 701 | 699 |
| 702 visitFunctionDefinition(cps_ir.FunctionDefinition node) { | 700 visitFunctionDefinition(cps_ir.FunctionDefinition node) { |
| 703 unexpectedNode(node); | 701 unexpectedNode(node); |
| 704 } | 702 } |
| 705 visitParameter(cps_ir.Parameter node) => unexpectedNode(node); | 703 visitParameter(cps_ir.Parameter node) => unexpectedNode(node); |
| 706 visitContinuation(cps_ir.Continuation node) => unexpectedNode(node); | 704 visitContinuation(cps_ir.Continuation node) => unexpectedNode(node); |
| 707 visitMutableVariable(cps_ir.MutableVariable node) => unexpectedNode(node); | 705 visitMutableVariable(cps_ir.MutableVariable node) => unexpectedNode(node); |
| 708 } | 706 } |
| OLD | NEW |