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

Unified Diff: pkg/front_end/lib/src/base/processed_options.dart

Issue 2964323002: Add support for multi-roots (Closed)
Patch Set: extra test 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
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/source/source_loader.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/base/processed_options.dart
diff --git a/pkg/front_end/lib/src/base/processed_options.dart b/pkg/front_end/lib/src/base/processed_options.dart
index b2e93ab6008cb4553aec0ad17fb6d3d515a3733e..d525d15ed294e48cb269033c4a57ef3ae2fa9fc4 100644
--- a/pkg/front_end/lib/src/base/processed_options.dart
+++ b/pkg/front_end/lib/src/base/processed_options.dart
@@ -11,6 +11,7 @@ import 'package:front_end/src/base/performace_logger.dart';
import 'package:front_end/src/fasta/ticker.dart';
import 'package:front_end/src/fasta/translate_uri.dart';
import 'package:front_end/src/incremental/byte_store.dart';
+import 'package:front_end/src/multi_root_file_system.dart';
import 'package:kernel/kernel.dart'
show Program, loadProgramFromBytes, CanonicalName;
import 'package:kernel/target/targets.dart';
@@ -283,10 +284,16 @@ class ProcessedOptions {
/// Create a [FileSystem] specific to the current options.
///
- /// If [chaseDependencies] is false, the resulting file system will be
- /// hermetic.
+ /// If `_raw.multiRoots` is not empty, the file-system will implement the
+ /// semantics of multiple roots. If [chaseDependencies] is false, the
+ /// resulting file system will be hermetic.
FileSystem _createFileSystem() {
var result = _raw.fileSystem;
+ // Note: hermetic checks are done before translating multi-root URIs, so
+ // the order in which we create the file systems below is relevant.
+ if (!_raw.multiRoots.isEmpty) {
+ result = new MultiRootFileSystem('multi-root', _raw.multiRoots, result);
+ }
if (!chaseDependencies) {
var allInputs = inputs.toSet();
allInputs.addAll(_raw.inputSummaries);
@@ -306,8 +313,6 @@ class ProcessedOptions {
if (_raw.packagesFileUri != null) allInputs.add(_raw.packagesFileUri);
result = new HermeticFileSystem(allInputs, result);
}
- // TODO(paulberry): support multiRoots.
- assert(_raw.multiRoots.isEmpty);
return result;
}
}
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/source/source_loader.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698