Index: pkg/front_end/lib/src/fasta/kernel/kernel_target.dart |
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart |
index fbb3a9abfbda5ef5f0d55414f527837d4a10b32f..661731cd8951216a02511cb07febb6ee2822d8ca 100644 |
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart |
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart |
@@ -13,6 +13,7 @@ import 'package:kernel/ast.dart' |
show |
Arguments, |
AsyncMarker, |
+ CanonicalName, |
Class, |
Constructor, |
DartType, |
@@ -230,7 +231,7 @@ class KernelTarget extends TargetImplementation { |
: writeLinkedProgram(uri, program, isFullProgram: isFullProgram); |
} |
- Future<Program> writeOutline(Uri uri) async { |
+ Future<Program> writeOutline(Uri uri, {CanonicalName nameRoot}) async { |
if (loader.first == null) return null; |
try { |
loader.createTypeInferenceEngine(); |
@@ -248,7 +249,8 @@ class KernelTarget extends TargetImplementation { |
installDefaultConstructors(sourceClasses); |
loader.resolveConstructors(); |
loader.finishTypeVariables(objectClassBuilder); |
- program = link(new List<Library>.from(loader.libraries)); |
+ program = |
+ link(new List<Library>.from(loader.libraries), nameRoot: nameRoot); |
loader.computeHierarchy(program); |
loader.checkOverrides(sourceClasses); |
loader.prepareInitializerInference(); |
@@ -368,21 +370,18 @@ class KernelTarget extends TargetImplementation { |
/// Creates a program by combining [libraries] with the libraries of |
/// `dillTarget.loader.program`. |
- Program link(List<Library> libraries) { |
+ Program link(List<Library> libraries, {CanonicalName nameRoot}) { |
Map<String, Source> uriToSource = |
new Map<String, Source>.from(this.uriToSource); |
- final Program binary = dillTarget.loader.program; |
- if (binary != null) { |
- libraries.addAll(binary.libraries); |
- uriToSource.addAll(binary.uriToSource); |
Siggi Cherem (dart-lang)
2017/05/12 17:29:25
do we need to preserve this somehow? (when linking
scheglov
2017/05/12 17:44:21
I will add TODO for now.
|
- } |
+ libraries.addAll(dillTarget.loader.libraries); |
// TODO(ahe): Remove this line. Kernel seems to generate a default line map |
// that used when there's no fileUri on an element. Instead, ensure all |
// elements have a fileUri. |
uriToSource[""] = new Source(<int>[0], const <int>[]); |
- Program program = new Program(libraries, uriToSource); |
+ Program program = new Program( |
+ nameRoot: nameRoot, libraries: libraries, uriToSource: uriToSource); |
if (loader.first != null) { |
Builder builder = loader.first.lookup("main", -1, null); |
if (builder is KernelProcedureBuilder) { |