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

Side by Side Diff: lib/src/codegen/side_effect_analysis.dart

Issue 1644823002: Remove library tags, they aren't needed (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library dev_compiler.src.codegen.side_effect_analysis;
6
7 import 'package:analyzer/src/generated/ast.dart'; 5 import 'package:analyzer/src/generated/ast.dart';
8 import 'package:analyzer/src/generated/constant.dart'; 6 import 'package:analyzer/src/generated/constant.dart';
9 import 'package:analyzer/src/generated/element.dart'; 7 import 'package:analyzer/src/generated/element.dart';
10 import 'package:analyzer/src/generated/error.dart' show ErrorReporter; 8 import 'package:analyzer/src/generated/error.dart' show ErrorReporter;
11 import 'package:analyzer/src/generated/engine.dart' show RecordingErrorListener; 9 import 'package:analyzer/src/generated/engine.dart' show RecordingErrorListener;
12 import 'package:analyzer/src/generated/resolver.dart' show TypeProvider; 10 import 'package:analyzer/src/generated/resolver.dart' show TypeProvider;
13 11
14 /// True is the expression can be evaluated multiple times without causing 12 /// True is the expression can be evaluated multiple times without causing
15 /// code execution. This is true for final fields. This can be true for local 13 /// code execution. This is true for final fields. This can be true for local
16 /// variables, if: 14 /// variables, if:
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 // ConstantEvaluator will not compute constants for non-const fields, 120 // ConstantEvaluator will not compute constants for non-const fields,
123 // so run ConstantVisitor for those to figure out if the initializer is 121 // so run ConstantVisitor for those to figure out if the initializer is
124 // actually a constant (and therefore side effect free to evaluate). 122 // actually a constant (and therefore side effect free to evaluate).
125 assert(!field.isConst); 123 assert(!field.isConst);
126 124
127 var initializer = field.initializer; 125 var initializer = field.initializer;
128 if (initializer == null) return null; 126 if (initializer == null) return null;
129 return initializer.accept(_constantVisitor); 127 return initializer.accept(_constantVisitor);
130 } 128 }
131 } 129 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698