public override BoundNode VisitIfStatement(BoundIfStatement node) { Debug.Assert(node != null); var rewrittenCondition = VisitExpression(node.Condition); var rewrittenConsequence = VisitStatement(node.Consequence); var rewrittenAlternative = VisitStatement(node.AlternativeOpt); var syntax = (IfStatementSyntax)node.Syntax; // EnC: We need to insert a hidden sequence point to handle function remapping in case // the containing method is edited while methods invoked in the condition are being executed. if (this.Instrument && !node.WasCompilerGenerated) { rewrittenCondition = _instrumenter.InstrumentIfStatementCondition(node, rewrittenCondition, _factory); } var result = RewriteIfStatement(syntax, rewrittenCondition, rewrittenConsequence, rewrittenAlternative, node.HasErrors); // add sequence point before the whole statement if (this.Instrument && !node.WasCompilerGenerated) { result = _instrumenter.InstrumentIfStatement(node, result); } return result; }
public override BoundNode VisitIfStatement(BoundIfStatement node) { Debug.Assert(node != null); var rewrittenCondition = VisitExpression(node.Condition); var rewrittenConsequence = VisitStatement(node.Consequence); var rewrittenAlternative = VisitStatement(node.AlternativeOpt); var syntax = (IfStatementSyntax)node.Syntax; // EnC: We need to insert a hidden sequence point to handle function remapping in case // the containing method is edited while methods invoked in the condition are being executed. var result = RewriteIfStatement(syntax, AddConditionSequencePoint(rewrittenCondition, node), rewrittenConsequence, rewrittenAlternative, node.HasErrors); // add sequence point before the whole statement if (this.GenerateDebugInfo && !node.WasCompilerGenerated) { result = new BoundSequencePointWithSpan( syntax, result, TextSpan.FromBounds( syntax.IfKeyword.SpanStart, syntax.CloseParenToken.Span.End), node.HasErrors); } return result; }
public override BoundNode VisitIfStatement(BoundIfStatement node) { Debug.Assert(node != null); var rewrittenCondition = VisitExpression(node.Condition); var rewrittenConsequence = VisitStatement(node.Consequence); var rewrittenAlternative = VisitStatement(node.AlternativeOpt); var syntax = (IfStatementSyntax)node.Syntax; var result = RewriteIfStatement(syntax, node.Locals, rewrittenCondition, rewrittenConsequence, rewrittenAlternative, node.HasErrors); // add sequence point before the whole statement if (this.generateDebugInfo && !node.WasCompilerGenerated) { result = new BoundSequencePointWithSpan( syntax, result, TextSpan.FromBounds( syntax.IfKeyword.SpanStart, syntax.CloseParenToken.Span.End), node.HasErrors); } return result; }
public override BoundExpression InstrumentIfStatementCondition(BoundIfStatement original, BoundExpression rewrittenCondition, SyntheticBoundNodeFactory factory) { // EnC: We need to insert a hidden sequence point to handle function remapping in case // the containing method is edited while methods invoked in the condition are being executed. return AddConditionSequencePoint(base.InstrumentIfStatementCondition(original, rewrittenCondition, factory), original.Syntax, factory); }
public virtual BoundStatement InstrumentIfStatement(BoundIfStatement original, BoundStatement rewritten) { Debug.Assert(original.Syntax.Kind() == SyntaxKind.IfStatement); return InstrumentStatement(original, rewritten); }
private BoundStatement BindIfStatement(IfStatementSyntax node, DiagnosticBag diagnostics) { Binder binder = this.GetBinder(node.Condition); Debug.Assert(binder != null); var condition = binder.BindBooleanExpression(node.Condition, diagnostics); var consequence = binder.BindPossibleEmbeddedStatement(node.Statement, diagnostics); // Note that the else clause does not use the pattern variable binder; // pattern variables from the condition are not in scope in the else statement. BoundStatement alternative = (node.Else == null) ? null : BindPossibleEmbeddedStatement(node.Else.Statement, diagnostics); BoundStatement result = new BoundIfStatement(node, binder.GetDeclaredLocalsForScope(node.Condition), condition, consequence, alternative); return result; }
public override BoundStatement InstrumentIfStatement(BoundIfStatement original, BoundStatement rewritten) { var syntax = (IfStatementSyntax)original.Syntax; return new BoundSequencePointWithSpan( syntax, base.InstrumentIfStatement(original, rewritten), TextSpan.FromBounds( syntax.IfKeyword.SpanStart, syntax.CloseParenToken.Span.End), original.HasErrors); }
public override BoundExpression InstrumentIfStatementCondition(BoundIfStatement original, BoundExpression rewrittenCondition, SyntheticBoundNodeFactory factory) { return Previous.InstrumentIfStatementCondition(original, rewrittenCondition, factory); }
private BoundStatement BindIfStatement(IfStatementSyntax node, DiagnosticBag diagnostics) { var condition = BindBooleanExpression(node.Condition, diagnostics); var consequence = BindPossibleEmbeddedStatement(node.Statement, diagnostics); BoundStatement alternative = (node.Else == null) ? null : BindPossibleEmbeddedStatement(node.Else.Statement, diagnostics); BoundStatement result = new BoundIfStatement(node, condition, consequence, alternative); return result; }
public virtual BoundExpression InstrumentIfStatementCondition(BoundIfStatement original, BoundExpression rewrittenCondition, SyntheticBoundNodeFactory factory) { Debug.Assert(!original.WasCompilerGenerated); Debug.Assert(original.Syntax.Kind() == SyntaxKind.IfStatement); Debug.Assert(factory != null); return rewrittenCondition; }
public override BoundStatement InstrumentIfStatement(BoundIfStatement original, BoundStatement rewritten) { return Previous.InstrumentIfStatement(original, rewritten); }
public override BoundNode VisitIfStatement(BoundIfStatement node) { Fail(node); return(null); }
public override BoundStatement InstrumentIfStatement(BoundIfStatement original, BoundStatement rewritten) { return(Previous.InstrumentIfStatement(original, rewritten)); }
public virtual BoundStatement InstrumentIfStatement(BoundIfStatement original, BoundStatement rewritten) { Debug.Assert(original.Syntax.Kind() == SyntaxKind.IfStatement); return(InstrumentStatement(original, rewritten)); }
public override BoundStatement InstrumentIfStatement(BoundIfStatement original, BoundStatement rewritten) { return(AddDynamicAnalysis(original, base.InstrumentIfStatement(original, rewritten))); }
public override BoundStatement InstrumentIfStatement(BoundIfStatement original, BoundStatement rewritten) { return AddDynamicAnalysis(original, base.InstrumentIfStatement(original, rewritten)); }
public override BoundExpression InstrumentIfStatementCondition(BoundIfStatement original, BoundExpression rewrittenCondition, SyntheticBoundNodeFactory factory) { // EnC: We need to insert a hidden sequence point to handle function remapping in case // the containing method is edited while methods invoked in the condition are being executed. return(AddConditionSequencePoint(base.InstrumentIfStatementCondition(original, rewrittenCondition, factory), original.Syntax, factory)); }
public override BoundExpression InstrumentIfStatementCondition(BoundIfStatement original, BoundExpression rewrittenCondition, SyntheticBoundNodeFactory factory) { return(Previous.InstrumentIfStatementCondition(original, rewrittenCondition, factory)); }