Index: pkg/compiler/lib/src/compiler.dart |
diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart |
index 94666231d090e22269a6dd7eb8e7849f6b55808c..c9ebbf1755d0208bd51aeed5c36b304a34c2508f 100644 |
--- a/pkg/compiler/lib/src/compiler.dart |
+++ b/pkg/compiler/lib/src/compiler.dart |
@@ -44,6 +44,7 @@ import 'environment.dart'; |
import 'id_generator.dart'; |
import 'io/source_information.dart' show SourceInformation; |
import 'js_backend/backend.dart' show JavaScriptBackend; |
+import 'kernel/world_builder.dart' show KernelWorldBuilder; |
import 'library_loader.dart' |
show |
ElementScanner, |
@@ -114,6 +115,11 @@ abstract class Compiler { |
List<Uri> librariesToAnalyzeWhenRun; |
+ /// Object holding the correspondence between Kernel IR and their |
+ /// corresponding K/JElements. Only (currently) used when used in conjunction |
+ /// with --use-kernel and --read-dill flags. |
+ KernelWorldBuilder kernelWorldBuilder; |
+ |
ResolvedUriTranslator get resolvedUriTranslator; |
LibraryElement mainApp; |
@@ -212,6 +218,7 @@ abstract class Compiler { |
serialization = new SerializationTask(this), |
patchParser = new PatchParserTask(this), |
libraryLoader = new LibraryLoaderTask( |
+ options.loadFromDill, |
resolvedUriTranslator, |
options.compileOnly |
? new _NoScriptLoader(this) |
@@ -348,8 +355,8 @@ abstract class Compiler { |
} |
} |
String importChain = compactImportChain.map((CodeLocation codeLocation) { |
- return codeLocation |
- .relativize(loadedLibraries.rootLibrary.canonicalUri); |
+ return codeLocation.relativize( |
+ (loadedLibraries.rootLibrary as LibraryElement).canonicalUri); |
}).join(' => '); |
if (!importChains.contains(importChain)) { |
@@ -381,7 +388,8 @@ abstract class Compiler { |
/// The method returns a [Future] allowing for the loading of additional |
/// libraries. |
LoadedLibraries processLoadedLibraries(LoadedLibraries loadedLibraries) { |
- loadedLibraries.forEachLibrary((LibraryElement library) { |
+ kernelWorldBuilder = libraryLoader.worldBuilder; |
+ loadedLibraries.forEachLibrary((LibraryEntity library) { |
backend.setAnnotations(library); |
}); |