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 '../common.dart'; | 7 import '../common.dart'; |
8 import '../constants/values.dart'; | 8 import '../constants/values.dart'; |
9 import '../cps_ir/cps_ir_nodes.dart' as cps_ir; | 9 import '../cps_ir/cps_ir_nodes.dart' as cps_ir; |
10 import '../elements/elements.dart'; | 10 import '../elements/elements.dart'; |
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 Expression visitConstant(cps_ir.Constant node) { | 536 Expression visitConstant(cps_ir.Constant node) { |
537 return new Constant(node.value, sourceInformation: node.sourceInformation); | 537 return new Constant(node.value, sourceInformation: node.sourceInformation); |
538 } | 538 } |
539 | 539 |
540 Expression visitLiteralList(cps_ir.LiteralList node) { | 540 Expression visitLiteralList(cps_ir.LiteralList node) { |
541 return new LiteralList( | 541 return new LiteralList( |
542 node.dartType, | 542 node.dartType, |
543 translateArguments(node.values)); | 543 translateArguments(node.values)); |
544 } | 544 } |
545 | 545 |
546 Expression visitLiteralMap(cps_ir.LiteralMap node) { | |
547 return new LiteralMap( | |
548 node.dartType, | |
549 new List<LiteralMapEntry>.generate(node.entries.length, (int index) { | |
550 return new LiteralMapEntry( | |
551 getVariableUse(node.entries[index].key), | |
552 getVariableUse(node.entries[index].value)); | |
553 }) | |
554 ); | |
555 } | |
556 | |
557 Expression visitReifyRuntimeType(cps_ir.ReifyRuntimeType node) { | 546 Expression visitReifyRuntimeType(cps_ir.ReifyRuntimeType node) { |
558 return new ReifyRuntimeType( | 547 return new ReifyRuntimeType( |
559 getVariableUse(node.value), node.sourceInformation); | 548 getVariableUse(node.value), node.sourceInformation); |
560 } | 549 } |
561 | 550 |
562 Expression visitReadTypeVariable(cps_ir.ReadTypeVariable node) { | 551 Expression visitReadTypeVariable(cps_ir.ReadTypeVariable node) { |
563 return new ReadTypeVariable( | 552 return new ReadTypeVariable( |
564 node.variable, | 553 node.variable, |
565 getVariableUse(node.target), | 554 getVariableUse(node.target), |
566 node.sourceInformation); | 555 node.sourceInformation); |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
748 | 737 |
749 visitFunctionDefinition(cps_ir.FunctionDefinition node) { | 738 visitFunctionDefinition(cps_ir.FunctionDefinition node) { |
750 unexpectedNode(node); | 739 unexpectedNode(node); |
751 } | 740 } |
752 visitParameter(cps_ir.Parameter node) => unexpectedNode(node); | 741 visitParameter(cps_ir.Parameter node) => unexpectedNode(node); |
753 visitContinuation(cps_ir.Continuation node) => unexpectedNode(node); | 742 visitContinuation(cps_ir.Continuation node) => unexpectedNode(node); |
754 visitMutableVariable(cps_ir.MutableVariable node) => unexpectedNode(node); | 743 visitMutableVariable(cps_ir.MutableVariable node) => unexpectedNode(node); |
755 visitRethrow(cps_ir.Rethrow node) => unexpectedNode(node); | 744 visitRethrow(cps_ir.Rethrow node) => unexpectedNode(node); |
756 visitBoundsCheck(cps_ir.BoundsCheck node) => unexpectedNode(node); | 745 visitBoundsCheck(cps_ir.BoundsCheck node) => unexpectedNode(node); |
757 } | 746 } |
OLD | NEW |