private BoundForStatement BindForParts(ForStatementSyntax node, Binder originalBinder, DiagnosticBag diagnostics) { BoundStatement initializer; // Deconstruction, Declaration, and Initializers are mutually exclusive. if (_syntax.Deconstruction != null) { var assignment = originalBinder.BindDeconstructionDeclaration(node.Deconstruction, node.Deconstruction.VariableComponent, node.Deconstruction.Value, diagnostics); initializer = new BoundLocalDeconstructionDeclaration(node, assignment); } else if (_syntax.Declaration != null) { ImmutableArray<BoundLocalDeclaration> unused; initializer = originalBinder.BindForOrUsingOrFixedDeclarations(node.Declaration, LocalDeclarationKind.ForInitializerVariable, diagnostics, out unused); } else { initializer = originalBinder.BindStatementExpressionList(node.Initializers, diagnostics); } var condition = (node.Condition != null) ? originalBinder.BindBooleanExpression(node.Condition, diagnostics) : null; var increment = originalBinder.BindStatementExpressionList(node.Incrementors, diagnostics); var body = originalBinder.BindPossibleEmbeddedStatement(node.Statement, diagnostics); Debug.Assert(this.Locals == this.GetDeclaredLocalsForScope(node)); return new BoundForStatement(node, this.Locals, initializer, condition, increment, body, this.BreakLabel, this.ContinueLabel); }
private BoundForStatement BindForParts(ForStatementSyntax node, Binder originalBinder, DiagnosticBag diagnostics) { BoundStatement initializer; // Deconstruction, Declaration, and Initializers are mutually exclusive. if (_syntax.Deconstruction != null) { var assignment = originalBinder.BindDeconstructionDeclaration(node.Deconstruction, node.Deconstruction.VariableComponent, node.Deconstruction.Value, diagnostics); initializer = new BoundLocalDeconstructionDeclaration(node, assignment); } else if (_syntax.Declaration != null) { ImmutableArray <BoundLocalDeclaration> unused; initializer = originalBinder.BindForOrUsingOrFixedDeclarations(node.Declaration, LocalDeclarationKind.ForInitializerVariable, diagnostics, out unused); } else { initializer = originalBinder.BindStatementExpressionList(node.Initializers, diagnostics); } var condition = (node.Condition != null) ? originalBinder.BindBooleanExpression(node.Condition, diagnostics) : null; var increment = originalBinder.BindStatementExpressionList(node.Incrementors, diagnostics); var body = originalBinder.BindPossibleEmbeddedStatement(node.Statement, diagnostics); Debug.Assert(this.Locals == this.GetDeclaredLocalsForScope(node)); return(new BoundForStatement(node, this.Locals, initializer, condition, increment, body, this.BreakLabel, this.ContinueLabel)); }
public override BoundNode VisitLocalDeconstructionDeclaration(BoundLocalDeconstructionDeclaration node) { var syntax = node.Syntax; var loweredExpression = VisitUnusedExpression(node.Assignment); if (loweredExpression == null) { // NOTE: not using a BoundNoOpStatement, since we don't want a nop to be emitted. // CONSIDER: could use a BoundNoOpStatement (DevDiv #12943). return BoundStatementList.Synthesized(syntax); } else { return AddSequencePoint(new BoundExpressionStatement(node.Syntax, loweredExpression)); } }
public override BoundNode VisitLocalDeconstructionDeclaration(BoundLocalDeconstructionDeclaration node) { var syntax = node.Syntax; var loweredExpression = VisitUnusedExpression(node.Assignment); if (loweredExpression == null) { // NOTE: not using a BoundNoOpStatement, since we don't want a nop to be emitted. // CONSIDER: could use a BoundNoOpStatement (DevDiv #12943). return BoundStatementList.Synthesized(syntax); } else { BoundStatement result = new BoundExpressionStatement(loweredExpression.Syntax, loweredExpression, node.HasErrors); result.WasCompilerGenerated = node.WasCompilerGenerated; if (this.Instrument && !node.WasCompilerGenerated) { result = _instrumenter.InstrumentLocalDeconstructionDeclaration(node, result); } return result; } }
public override BoundNode VisitLocalDeconstructionDeclaration(BoundLocalDeconstructionDeclaration node) { var syntax = node.Syntax; var loweredExpression = VisitUnusedExpression(node.Assignment); if (loweredExpression == null) { // NOTE: not using a BoundNoOpStatement, since we don't want a nop to be emitted. // CONSIDER: could use a BoundNoOpStatement (DevDiv #12943). return(BoundStatementList.Synthesized(syntax)); } else { BoundStatement result = new BoundExpressionStatement(loweredExpression.Syntax, loweredExpression, node.HasErrors); result.WasCompilerGenerated = node.WasCompilerGenerated; if (this.Instrument && !node.WasCompilerGenerated) { result = _instrumenter.InstrumentLocalDeconstructionDeclaration(node, result); } return(result); } }
public override BoundStatement InstrumentLocalDeconstructionDeclaration(BoundLocalDeconstructionDeclaration original, BoundStatement rewritten) { return(AddSequencePoint(base.InstrumentLocalDeconstructionDeclaration(original, rewritten))); }
public override BoundStatement InstrumentLocalDeconstructionDeclaration(BoundLocalDeconstructionDeclaration original, BoundStatement rewritten) { return AddSequencePoint(base.InstrumentLocalDeconstructionDeclaration(original, rewritten)); }
public override BoundStatement InstrumentLocalDeconstructionDeclaration(BoundLocalDeconstructionDeclaration original, BoundStatement rewritten) { return Previous.InstrumentLocalDeconstructionDeclaration(original, rewritten); }
public virtual BoundStatement InstrumentLocalDeconstructionDeclaration(BoundLocalDeconstructionDeclaration original, BoundStatement rewritten) { return InstrumentStatement(original, rewritten); }
public virtual BoundStatement InstrumentLocalDeconstructionDeclaration(BoundLocalDeconstructionDeclaration original, BoundStatement rewritten) { return(InstrumentStatement(original, rewritten)); }
public override BoundStatement InstrumentLocalDeconstructionDeclaration(BoundLocalDeconstructionDeclaration original, BoundStatement rewritten) { return AddDynamicAnalysis(original, base.InstrumentLocalDeconstructionDeclaration(original, rewritten)); }
public override BoundStatement InstrumentLocalDeconstructionDeclaration(BoundLocalDeconstructionDeclaration original, BoundStatement rewritten) { return(AddDynamicAnalysis(original, base.InstrumentLocalDeconstructionDeclaration(original, rewritten))); }
public override BoundStatement InstrumentLocalDeconstructionDeclaration(BoundLocalDeconstructionDeclaration original, BoundStatement rewritten) { return(Previous.InstrumentLocalDeconstructionDeclaration(original, rewritten)); }