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

Unified Diff: pkg/dev_compiler/lib/src/compiler/side_effect_analysis.dart

Issue 2503803004: fix #27784 and fix #27785, fromEnvironment constants in DDC (Closed)
Patch Set: fix Created 4 years, 1 month 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/src/compiler/compiler.dart ('k') | pkg/dev_compiler/test/codegen_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/lib/src/compiler/side_effect_analysis.dart
diff --git a/pkg/dev_compiler/lib/src/compiler/side_effect_analysis.dart b/pkg/dev_compiler/lib/src/compiler/side_effect_analysis.dart
index 5da18eaa643858a9683ce347afda5baa991e1484..499cb862c7e9d1ea80284eff5d16631cf26851ba 100644
--- a/pkg/dev_compiler/lib/src/compiler/side_effect_analysis.dart
+++ b/pkg/dev_compiler/lib/src/compiler/side_effect_analysis.dart
@@ -8,7 +8,7 @@ import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/src/generated/constant.dart';
import 'package:analyzer/error/listener.dart'
show AnalysisErrorListener, ErrorReporter;
-import 'package:analyzer/src/generated/resolver.dart' show TypeProvider;
+import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/generated/source.dart' show Source;
import 'package:analyzer/src/dart/ast/ast.dart';
@@ -105,12 +105,12 @@ class _AssignmentFinder extends RecursiveAstVisitor {
}
class ConstFieldVisitor {
- final ConstantVisitor _constantVisitor;
+ final ConstantVisitor constantVisitor;
- ConstFieldVisitor(TypeProvider types, {Source dummySource})
- // TODO(jmesserly): support -D variables on the command line
- : _constantVisitor = new ConstantVisitor(
- new ConstantEvaluationEngine(types, new DeclaredVariables()),
+ ConstFieldVisitor(AnalysisContext context, {Source dummySource})
+ : constantVisitor = new ConstantVisitor(
+ new ConstantEvaluationEngine(
+ context.typeProvider, context.declaredVariables),
new ErrorReporter(
AnalysisErrorListener.NULL_LISTENER, dummySource));
@@ -134,6 +134,6 @@ class ConstFieldVisitor {
var initializer = field.initializer;
if (initializer == null) return null;
- return initializer.accept(_constantVisitor);
+ return initializer.accept(constantVisitor);
}
}
« no previous file with comments | « pkg/dev_compiler/lib/src/compiler/compiler.dart ('k') | pkg/dev_compiler/test/codegen_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698