| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import 'package:kernel/ast.dart' as ir; | 5 import 'package:kernel/ast.dart' as ir; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import 'builder_kernel.dart'; | 8 import 'builder_kernel.dart'; |
| 9 import 'kernel_ast_adapter.dart'; | 9 import 'kernel_ast_adapter.dart'; |
| 10 import 'nodes.dart'; | 10 import 'nodes.dart'; |
| 11 | 11 |
| 12 /// Visits and concatenates the expressions in a string concatenation. | 12 /// Visits and concatenates the expressions in a string concatenation. |
| 13 class KernelStringBuilder extends ir.Visitor { | 13 class KernelStringBuilder extends ir.Visitor { |
| 14 final KernelSsaBuilder builder; | 14 final KernelSsaGraphBuilder builder; |
| 15 KernelAstAdapter get astAdapter => builder.astAdapter; | 15 KernelAstAdapter get astAdapter => builder.astAdapter; |
| 16 | 16 |
| 17 /// The string value generated so far. | 17 /// The string value generated so far. |
| 18 HInstruction result = null; | 18 HInstruction result = null; |
| 19 | 19 |
| 20 KernelStringBuilder(this.builder); | 20 KernelStringBuilder(this.builder); |
| 21 | 21 |
| 22 @override | 22 @override |
| 23 void defaultNode(ir.Node node) { | 23 void defaultNode(ir.Node node) { |
| 24 throw new SpannableAssertionFailure( | 24 throw new SpannableAssertionFailure( |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 return instruction; | 65 return instruction; |
| 66 } | 66 } |
| 67 | 67 |
| 68 HInstruction stringify(HInstruction expression) { | 68 HInstruction stringify(HInstruction expression) { |
| 69 HInstruction instruction = | 69 HInstruction instruction = |
| 70 new HStringify(expression, builder.commonMasks.stringType); | 70 new HStringify(expression, builder.commonMasks.stringType); |
| 71 builder.add(instruction); | 71 builder.add(instruction); |
| 72 return instruction; | 72 return instruction; |
| 73 } | 73 } |
| 74 } | 74 } |
| OLD | NEW |