| 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 analyzer2dart.dart_backend; | 5 library analyzer2dart.dart_backend; |
| 6 | 6 |
| 7 import 'package:compiler/implementation/elements/elements.dart'; | 7 import 'package:compiler/implementation/elements/elements.dart'; |
| 8 import 'package:compiler/implementation/dart_backend/dart_backend.dart'; | 8 import 'package:compiler/implementation/dart_backend/dart_backend.dart'; |
| 9 import 'package:compiler/implementation/dart2jslib.dart'; | 9 import 'package:compiler/implementation/dart2jslib.dart'; |
| 10 | 10 |
| 11 import 'driver.dart'; | 11 import 'driver.dart'; |
| 12 import 'converted_world.dart'; | 12 import 'converted_world.dart'; |
| 13 | 13 |
| 14 void compileToDart(Driver driver, ConvertedWorld convertedWorld) { | 14 void compileToDart(Driver driver, ConvertedWorld convertedWorld) { |
| 15 DartOutputter outputter = | 15 DartOutputter outputter = |
| 16 new DartOutputter(new Listener(), driver.outputProvider); | 16 new DartOutputter(new Listener(), driver.outputProvider); |
| 17 outputter.assembleProgram( | 17 outputter.assembleProgram( |
| 18 libraries: convertedWorld.libraries, | 18 libraries: convertedWorld.libraries, |
| 19 instantiatedClasses: convertedWorld.instantiatedClasses, | 19 instantiatedClasses: convertedWorld.instantiatedClasses, |
| 20 resolvedElements: convertedWorld.resolvedElements, | 20 resolvedElements: convertedWorld.resolvedElements, |
| 21 mainFunction: convertedWorld.mainFunction, | 21 mainFunction: convertedWorld.mainFunction, |
| 22 computeElementAst: (Element element) { | 22 computeElementAst: (Element element) { |
| 23 return DartBackend.createElementAst( | 23 return DartBackend.createElementAst( |
| 24 null, null, null, null, convertedWorld.getIr(element)); | 24 null, // No compiler. |
| 25 null, // No tracer. |
| 26 DART_CONSTANT_SYSTEM, |
| 27 element, |
| 28 convertedWorld.getIr(element)); |
| 25 }, | 29 }, |
| 26 shouldOutput: (_) => true, | 30 shouldOutput: (_) => true, |
| 27 isSafeToRemoveTypeDeclarations: (_) => false); | 31 isSafeToRemoveTypeDeclarations: (_) => false); |
| 28 | 32 |
| 29 } | 33 } |
| 30 | 34 |
| 31 class Listener implements DiagnosticListener { | 35 class Listener implements DiagnosticListener { |
| 32 | 36 |
| 33 @override | 37 @override |
| 34 void internalError(Spannable spannable, message) { | 38 void internalError(Spannable spannable, message) { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 @override | 82 @override |
| 79 SourceSpan spanFromSpannable(Spannable node) { | 83 SourceSpan spanFromSpannable(Spannable node) { |
| 80 // TODO: implement spanFromSpannable | 84 // TODO: implement spanFromSpannable |
| 81 } | 85 } |
| 82 | 86 |
| 83 @override | 87 @override |
| 84 withCurrentElement(element, f()) { | 88 withCurrentElement(element, f()) { |
| 85 // TODO: implement withCurrentElement | 89 // TODO: implement withCurrentElement |
| 86 } | 90 } |
| 87 } | 91 } |
| OLD | NEW |