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

Side by Side Diff: pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart

Issue 1148343004: Remove ConstantExpression.value (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Update comments. Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 tree_ir_nodes; 5 library tree_ir_nodes;
6 6
7 import '../constants/expressions.dart'; 7 import '../constants/expressions.dart';
8 import '../constants/values.dart' as values; 8 import '../constants/values.dart' as values;
9 import '../dart_types.dart' show DartType, InterfaceType, TypeVariableType; 9 import '../dart_types.dart' show DartType, InterfaceType, TypeVariableType;
10 import '../elements/elements.dart'; 10 import '../elements/elements.dart';
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 accept1(ExpressionVisitor1 visitor, arg) { 262 accept1(ExpressionVisitor1 visitor, arg) {
263 return visitor.visitConcatenateStrings(this, arg); 263 return visitor.visitConcatenateStrings(this, arg);
264 } 264 }
265 } 265 }
266 266
267 /** 267 /**
268 * A constant. 268 * A constant.
269 */ 269 */
270 class Constant extends Expression { 270 class Constant extends Expression {
271 final ConstantExpression expression; 271 final ConstantExpression expression;
272 final values.ConstantValue value;
272 273
273 Constant(this.expression); 274 Constant(this.expression, this.value);
274 275
275 Constant.bool(values.BoolConstantValue constantValue) 276 Constant.bool(values.BoolConstantValue constantValue)
276 : expression = new BoolConstantExpression( 277 : expression = new BoolConstantExpression(
277 constantValue.primitiveValue, constantValue); 278 constantValue.primitiveValue),
279 value = constantValue;
278 280
279 accept(ExpressionVisitor visitor) => visitor.visitConstant(this); 281 accept(ExpressionVisitor visitor) => visitor.visitConstant(this);
280 accept1(ExpressionVisitor1 visitor, arg) => visitor.visitConstant(this, arg); 282 accept1(ExpressionVisitor1 visitor, arg) => visitor.visitConstant(this, arg);
281
282 values.ConstantValue get value => expression.value;
283 } 283 }
284 284
285 class This extends Expression { 285 class This extends Expression {
286 accept(ExpressionVisitor visitor) => visitor.visitThis(this); 286 accept(ExpressionVisitor visitor) => visitor.visitThis(this);
287 accept1(ExpressionVisitor1 visitor, arg) => visitor.visitThis(this, arg); 287 accept1(ExpressionVisitor1 visitor, arg) => visitor.visitThis(this, arg);
288 } 288 }
289 289
290 class LiteralList extends Expression { 290 class LiteralList extends Expression {
291 final InterfaceType type; 291 final InterfaceType type;
292 final List<Expression> values; 292 final List<Expression> values;
(...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after
1191 visitTypeExpression(TypeExpression node) { 1191 visitTypeExpression(TypeExpression node) {
1192 _replaceExpressions(node.arguments); 1192 _replaceExpressions(node.arguments);
1193 return node; 1193 return node;
1194 } 1194 }
1195 1195
1196 visitCreateInvocationMirror(CreateInvocationMirror node) { 1196 visitCreateInvocationMirror(CreateInvocationMirror node) {
1197 _replaceExpressions(node.arguments); 1197 _replaceExpressions(node.arguments);
1198 return node; 1198 return node;
1199 } 1199 }
1200 } 1200 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart ('k') | pkg/compiler/lib/src/typechecker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698