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

Unified Diff: pkg/analyzer/lib/src/summary/package_bundle_reader.dart

Issue 1838883002: Add the '--build-summary-only-ast' flag for generating summaries using only ASTs. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « pkg/analyzer/lib/src/generated/sdk_io.dart ('k') | pkg/analyzer_cli/lib/src/build_mode.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/package_bundle_reader.dart
diff --git a/pkg/analyzer/lib/src/summary/package_bundle_reader.dart b/pkg/analyzer/lib/src/summary/package_bundle_reader.dart
index 878db38475fb12d6e2833a475be9943795c79877..59c195168f745c7c0dee7edf17f5bb45c5baa98b 100644
--- a/pkg/analyzer/lib/src/summary/package_bundle_reader.dart
+++ b/pkg/analyzer/lib/src/summary/package_bundle_reader.dart
@@ -192,10 +192,10 @@ class SummaryDataStore {
summaryPaths.forEach(_fillMaps);
}
- void _fillMaps(String path) {
- io.File file = new io.File(path);
- List<int> buffer = file.readAsBytesSync();
- PackageBundle bundle = new PackageBundle.fromBuffer(buffer);
+ /**
+ * Add the given [bundle] loaded from the file with the given [path].
+ */
+ void addBundle(String path, PackageBundle bundle) {
for (int i = 0; i < bundle.unlinkedUnitUris.length; i++) {
String uri = bundle.unlinkedUnitUris[i];
uriToSummaryPath[uri] = path;
@@ -206,6 +206,13 @@ class SummaryDataStore {
linkedMap[uri] = bundle.linkedLibraries[i];
}
}
+
+ void _fillMaps(String path) {
+ io.File file = new io.File(path);
+ List<int> buffer = file.readAsBytesSync();
+ PackageBundle bundle = new PackageBundle.fromBuffer(buffer);
+ addBundle(path, bundle);
+ }
}
/**
« no previous file with comments | « pkg/analyzer/lib/src/generated/sdk_io.dart ('k') | pkg/analyzer_cli/lib/src/build_mode.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698