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

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

Issue 1772703002: Add source information to variable declarations 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
« no previous file with comments | « pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 647
648 accept(StatementVisitor visitor) => visitor.visitUnreachable(this); 648 accept(StatementVisitor visitor) => visitor.visitUnreachable(this);
649 accept1(StatementVisitor1 visitor, arg) { 649 accept1(StatementVisitor1 visitor, arg) {
650 return visitor.visitUnreachable(this, arg); 650 return visitor.visitUnreachable(this, arg);
651 } 651 }
652 } 652 }
653 653
654 class FunctionDefinition extends Node { 654 class FunctionDefinition extends Node {
655 final ExecutableElement element; 655 final ExecutableElement element;
656 final List<Variable> parameters; 656 final List<Variable> parameters;
657 final SourceInformation sourceInformation;
657 Statement body; 658 Statement body;
658 659
659 /// Creates a function definition and updates `writeCount` for [parameters]. 660 /// Creates a function definition and updates `writeCount` for [parameters].
660 FunctionDefinition(this.element, this.parameters, this.body) { 661 FunctionDefinition(
662 this.element,
663 this.parameters,
664 this.body,
665 {this.sourceInformation}) {
661 for (Variable param in parameters) { 666 for (Variable param in parameters) {
662 param.writeCount++; // Being a parameter counts as a write. 667 param.writeCount++; // Being a parameter counts as a write.
663 } 668 }
664 } 669 }
665 } 670 }
666 671
667 class CreateBox extends Expression { 672 class CreateBox extends Expression {
668 accept(ExpressionVisitor visitor) => visitor.visitCreateBox(this); 673 accept(ExpressionVisitor visitor) => visitor.visitCreateBox(this);
669 accept1(ExpressionVisitor1 visitor, arg) => visitor.visitCreateBox(this, arg); 674 accept1(ExpressionVisitor1 visitor, arg) => visitor.visitCreateBox(this, arg);
670 } 675 }
(...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after
1585 1590
1586 /// Number of uses of the current fallthrough target. 1591 /// Number of uses of the current fallthrough target.
1587 int get useCount => _stack.last.useCount; 1592 int get useCount => _stack.last.useCount;
1588 1593
1589 /// Indicate that a statement will fall through to the current fallthrough 1594 /// Indicate that a statement will fall through to the current fallthrough
1590 /// target. 1595 /// target.
1591 void use() { 1596 void use() {
1592 ++_stack.last.useCount; 1597 ++_stack.last.useCount;
1593 } 1598 }
1594 } 1599 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698