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

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

Issue 2757753002: Migrate DDC to the new analysis driver.
Patch Set: Rebase Created 3 years, 6 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
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 c273228dfe937ad42622abbe8e3e5f6a62cf3570..5b2ea3cd41140a5cff5f03a7f04a64e42b5a3e42 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/engine.dart';
+import 'package:analyzer/src/generated/resolver.dart';
import 'package:analyzer/src/generated/source.dart' show Source;
import 'package:analyzer/src/dart/ast/ast.dart';
@@ -107,10 +107,11 @@ class _AssignmentFinder extends RecursiveAstVisitor {
class ConstFieldVisitor {
final ConstantVisitor constantVisitor;
- ConstFieldVisitor(AnalysisContext context, {Source dummySource})
+ ConstFieldVisitor(
+ TypeProvider typeProvider, DeclaredVariables declaredVariables,
+ {Source dummySource})
: constantVisitor = new ConstantVisitor(
- new ConstantEvaluationEngine(
- context.typeProvider, context.declaredVariables),
+ new ConstantEvaluationEngine(typeProvider, declaredVariables),
new ErrorReporter(
AnalysisErrorListener.NULL_LISTENER, dummySource));
@@ -124,7 +125,7 @@ class ConstFieldVisitor {
DartObject computeConstant(VariableDeclaration field) {
// If the constant is already computed by ConstantEvaluator, just return it.
VariableElement element = field.element;
- var result = element.computeConstantValue();
+ var result = element.constantValue;
if (result != null) return result;
// ConstantEvaluator will not compute constants for non-const fields,
« no previous file with comments | « pkg/dev_compiler/lib/src/compiler/nullable_type_inference.dart ('k') | pkg/dev_compiler/test/codegen_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698