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

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

Issue 1779153002: Make source information on conditions mandatory in CPS (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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/values.dart' as values; 7 import '../constants/values.dart' as values;
8 import '../dart_types.dart' show DartType, InterfaceType, TypeVariableType; 8 import '../dart_types.dart' show DartType, InterfaceType, TypeVariableType;
9 import '../elements/elements.dart'; 9 import '../elements/elements.dart';
10 import '../io/source_information.dart' show SourceInformation; 10 import '../io/source_information.dart' show SourceInformation;
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 342
343 /** 343 /**
344 * Apply a built-in operator. 344 * Apply a built-in operator.
345 * 345 *
346 * It must be known that the arguments have the proper types. 346 * It must be known that the arguments have the proper types.
347 * Null is not a valid argument to any of the built-in operators. 347 * Null is not a valid argument to any of the built-in operators.
348 */ 348 */
349 class ApplyBuiltinOperator extends Expression { 349 class ApplyBuiltinOperator extends Expression {
350 BuiltinOperator operator; 350 BuiltinOperator operator;
351 List<Expression> arguments; 351 List<Expression> arguments;
352 SourceInformation sourceInformation;
352 353
353 ApplyBuiltinOperator(this.operator, this.arguments); 354 ApplyBuiltinOperator(this.operator, this.arguments, this.sourceInformation);
354 355
355 accept(ExpressionVisitor visitor) { 356 accept(ExpressionVisitor visitor) {
356 return visitor.visitApplyBuiltinOperator(this); 357 return visitor.visitApplyBuiltinOperator(this);
357 } 358 }
358 accept1(ExpressionVisitor1 visitor, arg) { 359 accept1(ExpressionVisitor1 visitor, arg) {
359 return visitor.visitApplyBuiltinOperator(this, arg); 360 return visitor.visitApplyBuiltinOperator(this, arg);
360 } 361 }
361 } 362 }
362 363
363 class ApplyBuiltinMethod extends Expression { 364 class ApplyBuiltinMethod extends Expression {
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
595 accept1(StatementVisitor1 visitor, arg) => visitor.visitThrow(this, arg); 596 accept1(StatementVisitor1 visitor, arg) => visitor.visitThrow(this, arg);
596 } 597 }
597 598
598 /** 599 /**
599 * A conditional branch based on the true value of an [Expression]. 600 * A conditional branch based on the true value of an [Expression].
600 */ 601 */
601 class If extends Statement { 602 class If extends Statement {
602 Expression condition; 603 Expression condition;
603 Statement thenStatement; 604 Statement thenStatement;
604 Statement elseStatement; 605 Statement elseStatement;
606 SourceInformation sourceInformation;
605 607
606 Statement get next => null; 608 Statement get next => null;
607 void set next(Statement s) => throw 'UNREACHABLE'; 609 void set next(Statement s) => throw 'UNREACHABLE';
608 610
609 If(this.condition, this.thenStatement, this.elseStatement); 611 If(this.condition,
612 this.thenStatement,
613 this.elseStatement,
614 this.sourceInformation);
610 615
611 accept(StatementVisitor visitor) => visitor.visitIf(this); 616 accept(StatementVisitor visitor) => visitor.visitIf(this);
612 accept1(StatementVisitor1 visitor, arg) => visitor.visitIf(this, arg); 617 accept1(StatementVisitor1 visitor, arg) => visitor.visitIf(this, arg);
613 } 618 }
614 619
615 class ExpressionStatement extends Statement { 620 class ExpressionStatement extends Statement {
616 Statement next; 621 Statement next;
617 Expression expression; 622 Expression expression;
618 623
619 ExpressionStatement(this.expression, this.next); 624 ExpressionStatement(this.expression, this.next);
(...skipping 994 matching lines...) Expand 10 before | Expand all | Expand 10 after
1614 1619
1615 /// Number of uses of the current fallthrough target. 1620 /// Number of uses of the current fallthrough target.
1616 int get useCount => _stack.last.useCount; 1621 int get useCount => _stack.last.useCount;
1617 1622
1618 /// Indicate that a statement will fall through to the current fallthrough 1623 /// Indicate that a statement will fall through to the current fallthrough
1619 /// target. 1624 /// target.
1620 void use() { 1625 void use() {
1621 ++_stack.last.useCount; 1626 ++_stack.last.useCount;
1622 } 1627 }
1623 } 1628 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart ('k') | tests/compiler/dart2js/sourcemaps/source_mapping_invokes_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698