Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(697)

Unified Diff: pkg/front_end/lib/src/fasta/kernel/kernel_library_builder.dart

Issue 2987553002: Add import dependencies to Kernel libraries and use them to resynthesize ImportElement(s) in Analyz… (Closed)
Patch Set: Fixes for review comments. Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/front_end/lib/src/fasta/kernel/kernel_library_builder.dart
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_library_builder.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_library_builder.dart
index ab474f7342e1a2886686f9ac71d668136dea0961..02496896c6ca1c23f7fccba711691671a080e8dc 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_library_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_library_builder.dart
@@ -4,6 +4,8 @@
library fasta.kernel_library_builder;
+import 'package:front_end/src/fasta/dill/dill_library_builder.dart';
+import 'package:front_end/src/fasta/import.dart';
import 'package:kernel/ast.dart';
import 'package:kernel/clone.dart' show CloneVisitor;
@@ -704,6 +706,19 @@ class KernelLibraryBuilder
@override
Library build(LibraryBuilder coreLibrary) {
super.build(coreLibrary);
+ for (Import import in imports) {
+ var importedBuilder = import.imported;
+ Library importedLibrary;
+ if (importedBuilder is DillLibraryBuilder) {
+ importedLibrary = importedBuilder.library;
+ } else if (importedBuilder is KernelLibraryBuilder) {
+ importedLibrary = importedBuilder.library;
+ }
+ if (importedLibrary != null) {
+ library.addDependency(
+ new LibraryDependency.import(importedLibrary, name: import.prefix));
+ }
+ }
library.name = name;
library.procedures.sort(compareProcedures);
return library;
« no previous file with comments | « pkg/analyzer/test/src/summary/resynthesize_kernel_test.dart ('k') | pkg/front_end/lib/src/kernel_generator_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698