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

Unified Diff: pkg/dev_compiler/lib/src/analyzer/context.dart

Issue 2353133004: fix #27403, use AST summaries in DDC (Closed)
Patch Set: merge Created 4 years, 3 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/dev_compiler/lib/js/legacy/dart_sdk.js ('k') | pkg/dev_compiler/lib/src/compiler/code_generator.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/lib/src/analyzer/context.dart
diff --git a/pkg/dev_compiler/lib/src/analyzer/context.dart b/pkg/dev_compiler/lib/src/analyzer/context.dart
index 734731b1d13e899d53562d1570223e302cf3b96e..3545bca8a5c43ba27ed99876b548c6c314be7885 100644
--- a/pkg/dev_compiler/lib/src/analyzer/context.dart
+++ b/pkg/dev_compiler/lib/src/analyzer/context.dart
@@ -13,11 +13,11 @@ import 'package:analyzer/src/context/builder.dart';
import 'package:analyzer/src/context/context.dart' show AnalysisContextImpl;
import 'package:analyzer/src/dart/sdk/sdk.dart' show FolderBasedDartSdk;
import 'package:analyzer/src/generated/engine.dart'
- show AnalysisContext, AnalysisEngine, AnalysisOptionsImpl;
+ show AnalysisEngine, AnalysisOptionsImpl;
import 'package:analyzer/src/generated/source.dart'
show DartUriResolver, SourceFactory, UriResolver;
import 'package:analyzer/src/summary/package_bundle_reader.dart'
- show InSummaryUriResolver, InputPackagesResultProvider, SummaryDataStore;
+ show InSummaryUriResolver, SummaryDataStore;
import 'package:analyzer/src/summary/summary_sdk.dart' show SummaryBasedDartSdk;
import 'package:cli_util/cli_util.dart' show getSdkDir;
import 'package:path/path.dart' as path;
@@ -98,39 +98,6 @@ class AnalyzerOptions {
}
}
-/// Creates an [AnalysisContext] with dev_compiler type rules and inference,
-/// using [createSourceFactory] to set up its [SourceFactory].
-AnalysisContext createAnalysisContextWithSources(AnalyzerOptions options,
- {DartUriResolver sdkResolver,
- List<UriResolver> fileResolvers,
- ResourceProvider resourceProvider}) {
- AnalysisEngine.instance.processRequiredPlugins();
-
- sdkResolver ??=
- createSdkPathResolver(options.dartSdkSummaryPath, options.dartSdkPath);
-
- // Read the summaries.
- SummaryDataStore summaryData;
- if (options.summaryPaths.isNotEmpty) {
- summaryData = new SummaryDataStore(options.summaryPaths);
- }
-
- var srcFactory = _createSourceFactory(options,
- sdkResolver: sdkResolver,
- fileResolvers: fileResolvers,
- summaryData: summaryData,
- resourceProvider: resourceProvider);
-
- var context = createAnalysisContext();
- context.sourceFactory = srcFactory;
- if (summaryData != null) {
- context.typeProvider = sdkResolver.dartSdk.context.typeProvider;
- context.resultProvider =
- new InputPackagesResultProvider(context, summaryData);
- }
- return context;
-}
-
/// Creates an analysis context that contains our restricted typing rules.
AnalysisContextImpl createAnalysisContext() {
var res = AnalysisEngine.instance.createAnalysisContext();
@@ -147,7 +114,7 @@ AnalysisContextImpl createAnalysisContext() {
///
/// If supplied, [fileResolvers] will override the default `file:` and
/// `package:` URI resolvers.
-SourceFactory _createSourceFactory(AnalyzerOptions options,
+SourceFactory createSourceFactory(AnalyzerOptions options,
{DartUriResolver sdkResolver,
List<UriResolver> fileResolvers,
SummaryDataStore summaryData,
« no previous file with comments | « pkg/dev_compiler/lib/js/legacy/dart_sdk.js ('k') | pkg/dev_compiler/lib/src/compiler/code_generator.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698