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

Unified Diff: pkg/analyzer/lib/src/dart/analysis/driver.dart

Issue 2806353005: Drop the 'analyzeWithoutTasks' flag for AnalysisDriver. (Closed)
Patch Set: Created 3 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/dart/analysis/driver.dart
diff --git a/pkg/analyzer/lib/src/dart/analysis/driver.dart b/pkg/analyzer/lib/src/dart/analysis/driver.dart
index 871be4cfb0407f41a110328e54ddabf2f5db7c85..2d3bb1d917eaa37f435dfa8696e143278aac4c10 100644
--- a/pkg/analyzer/lib/src/dart/analysis/driver.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/driver.dart
@@ -132,11 +132,6 @@ class AnalysisDriver implements AnalysisDriverGeneric {
final DeclaredVariables declaredVariables = new DeclaredVariables();
/**
- * If `true`, then analysis should be done without using tasks model.
- */
- final bool analyzeWithoutTasks;
-
- /**
* Information about the context root being analyzed by this driver.
*/
final ContextRoot contextRoot;
@@ -257,8 +252,7 @@ class AnalysisDriver implements AnalysisDriverGeneric {
this.contextRoot,
SourceFactory sourceFactory,
this._analysisOptions,
- {PackageBundle sdkBundle,
- this.analyzeWithoutTasks: true})
+ {PackageBundle sdkBundle})
: _logger = logger,
_sourceFactory = sourceFactory.clone(),
_sdkBundle = sdkBundle {
@@ -953,39 +947,28 @@ class AnalysisDriver implements AnalysisDriverGeneric {
try {
LibraryContext libraryContext = _createLibraryContext(library);
try {
- CompilationUnit resolvedUnit;
+ LibraryAnalyzer analyzer = new LibraryAnalyzer(
+ analysisOptions,
+ declaredVariables,
+ sourceFactory,
+ _fileTracker.fsState,
+ libraryContext.store,
+ library);
+ Map<FileState, UnitAnalysisResult> results = analyzer.analyze();
+
List<int> bytes;
- if (analyzeWithoutTasks) {
- LibraryAnalyzer analyzer = new LibraryAnalyzer(
- analysisOptions,
- declaredVariables,
- sourceFactory,
- _fileTracker.fsState,
- libraryContext.store,
- library);
- Map<FileState, UnitAnalysisResult> results = analyzer.analyze();
- for (FileState unitFile in results.keys) {
- UnitAnalysisResult unitResult = results[unitFile];
- List<int> unitBytes =
- _serializeResolvedUnit(unitResult.unit, unitResult.errors);
- String unitSignature =
- _getResolvedUnitSignature(library, unitFile);
- String unitKey = _getResolvedUnitKey(unitSignature);
- _byteStore.put(unitKey, unitBytes);
- if (unitFile == file) {
- bytes = unitBytes;
- resolvedUnit = unitResult.unit;
- }
+ CompilationUnit resolvedUnit;
+ for (FileState unitFile in results.keys) {
+ UnitAnalysisResult unitResult = results[unitFile];
+ List<int> unitBytes =
+ _serializeResolvedUnit(unitResult.unit, unitResult.errors);
+ String unitSignature = _getResolvedUnitSignature(library, unitFile);
+ String unitKey = _getResolvedUnitKey(unitSignature);
+ _byteStore.put(unitKey, unitBytes);
+ if (unitFile == file) {
+ bytes = unitBytes;
+ resolvedUnit = unitResult.unit;
}
- } else {
- ResolutionResult resolutionResult =
- libraryContext.resolveUnit(library.source, file.source);
- resolvedUnit = resolutionResult.resolvedUnit;
- List<AnalysisError> errors = resolutionResult.errors;
-
- // Store the result into the cache.
- bytes = _serializeResolvedUnit(resolvedUnit, errors);
- _byteStore.put(key, bytes);
}
// Return the result, full or partial.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698