32 types derived from BoundStatement
Microsoft.CodeAnalysis.CSharp (32)
Generated\BoundNodes.xml.Generated.cs (32)
1011internal sealed partial class BoundBadStatement : BoundStatement 1039internal sealed partial class BoundExtractedFinallyBlock : BoundStatement 3146internal sealed partial class BoundSequencePoint : BoundStatement 3171internal sealed partial class BoundSequencePointWithSpan : BoundStatement 3198internal sealed partial class BoundSavePreviousSequencePoint : BoundStatement 3235internal sealed partial class BoundRestorePreviousSequencePoint : BoundStatement 3272internal sealed partial class BoundStepThroughSequencePoint : BoundStatement 3368internal sealed partial class BoundStateMachineScope : BoundStatement 3399internal sealed partial class BoundLocalDeclaration : BoundStatement 3435internal abstract partial class BoundMultipleLocalDeclarationsBase : BoundStatement 3505internal sealed partial class BoundLocalFunctionStatement : BoundStatement 3537internal sealed partial class BoundNoOpStatement : BoundStatement 3568internal sealed partial class BoundReturnStatement : BoundStatement 3597internal sealed partial class BoundYieldReturnStatement : BoundStatement 3625internal sealed partial class BoundYieldBreakStatement : BoundStatement 3642internal sealed partial class BoundThrowStatement : BoundStatement 3667internal sealed partial class BoundExpressionStatement : BoundStatement 3695internal sealed partial class BoundBreakStatement : BoundStatement 3732internal sealed partial class BoundContinueStatement : BoundStatement 3769internal sealed partial class BoundSwitchStatement : BoundStatement 3814internal sealed partial class BoundSwitchDispatch : BoundStatement 3850internal sealed partial class BoundIfStatement : BoundStatement 3883internal abstract partial class BoundLoopStatement : BoundStatement 4117internal sealed partial class BoundUsingStatement : BoundStatement 4156internal sealed partial class BoundFixedStatement : BoundStatement 4190internal sealed partial class BoundLockStatement : BoundStatement 4221internal sealed partial class BoundTryStatement : BoundStatement 4671internal sealed partial class BoundLabelStatement : BoundStatement 4708internal sealed partial class BoundGotoStatement : BoundStatement 4740internal sealed partial class BoundLabeledStatement : BoundStatement 4808internal partial class BoundStatementList : BoundStatement 4845internal sealed partial class BoundConditionalGoto : BoundStatement
1223 references to BoundStatement
Microsoft.CodeAnalysis.CSharp (1223)
Binder\Binder.cs (4)
871internal BoundStatement WrapWithVariablesIfAny(CSharpSyntaxNode scopeDesignator, BoundStatement statement) 887internal BoundStatement WrapWithVariablesAndLocalFunctionsIfAny(CSharpSyntaxNode scopeDesignator, BoundStatement statement)
Binder\Binder_Initializers.cs (3)
20internal BoundStatement? LoweredInitializers { get; set; } 250var statement = binder.BindStatement(statementNode, diagnostics); 270var labeledStatementBody = ((BoundLabeledStatement)statement).Body;
Binder\Binder_Statements.cs (55)
40public virtual BoundStatement BindStatement(StatementSyntax node, BindingDiagnosticBag diagnostics) 60BoundStatement result; 165private BoundStatement BindCheckedStatement(CheckedStatementSyntax node, BindingDiagnosticBag diagnostics) 170private BoundStatement BindUnsafeStatement(UnsafeStatementSyntax node, BindingDiagnosticBag diagnostics) 186private BoundStatement BindFixedStatement(FixedStatementSyntax node, BindingDiagnosticBag diagnostics) 196private BoundStatement BindFixedStatementParts(FixedStatementSyntax node, BindingDiagnosticBag diagnostics) 207BoundStatement boundBody = BindPossibleEmbeddedStatement(node.Statement, diagnostics); 234private BoundStatement BindYieldReturnStatement(YieldStatementSyntax node, BindingDiagnosticBag diagnostics) 279private BoundStatement BindYieldBreakStatement(YieldStatementSyntax node, BindingDiagnosticBag diagnostics) 295private BoundStatement BindLockStatement(LockStatementSyntax node, BindingDiagnosticBag diagnostics) 302internal virtual BoundStatement BindLockStatementParts(BindingDiagnosticBag diagnostics, Binder originalBinder) 307private BoundStatement BindUsingStatement(UsingStatementSyntax node, BindingDiagnosticBag diagnostics) 314internal virtual BoundStatement BindUsingStatementParts(BindingDiagnosticBag diagnostics, Binder originalBinder) 319internal BoundStatement BindPossibleEmbeddedStatement(StatementSyntax node, BindingDiagnosticBag diagnostics) 434private BoundStatement BindThrow(ThrowStatementSyntax node, BindingDiagnosticBag diagnostics) 464private static BoundStatement BindEmpty(EmptyStatementSyntax node) 506var body = BindStatement(node.Statement, diagnostics); 510private BoundStatement BindGoto(GotoStatementSyntax node, BindingDiagnosticBag diagnostics) 554private BoundStatement BindLocalFunctionStatement(LocalFunctionStatementSyntax node, BindingDiagnosticBag diagnostics) 642public BoundStatement BindExpressionStatement(ExpressionStatementSyntax node, BindingDiagnosticBag diagnostics) 686internal BoundStatement BindLocalDeclarationStatement(LocalDeclarationStatementSyntax node, BindingDiagnosticBag diagnostics) 698private BoundStatement BindUsingDeclarationStatementParts(LocalDeclarationStatementSyntax node, BindingDiagnosticBag diagnostics) 700var usingDeclaration = UsingStatementBinder.BindUsingStatementOrDeclarationFromParts(node, node.UsingKeyword, node.AwaitKeyword, originalBinder: this, usingBinderOpt: null, diagnostics); 705private BoundStatement BindDeclarationStatementParts(LocalDeclarationStatementSyntax node, BindingDiagnosticBag diagnostics) 1884ArrayBuilder<BoundStatement> boundStatements = ArrayBuilder<BoundStatement>.GetInstance(nStatements); 1888var boundStatement = BindStatement(syntaxStatements[i], diagnostics); 1895private BoundBlock FinishBindBlockParts(CSharpSyntaxNode node, ImmutableArray<BoundStatement> boundStatements) 2533private BoundStatement BindIfStatement(IfStatementSyntax node, BindingDiagnosticBag diagnostics) 2537static BoundStatement bindIfStatement(Binder binder, IfStatementSyntax node, BindingDiagnosticBag diagnostics) 2539var stack = ArrayBuilder<(Binder, IfStatementSyntax IfStatementSyntax, BoundExpression Condition, BoundStatement Consequence)>.GetInstance(); 2541BoundStatement? alternative; 2545var consequence = binder.BindPossibleEmbeddedStatement(node.Statement, diagnostics); 2575BoundStatement result; 2579BoundStatement consequence; 2596protected virtual bool TryGetBoundElseIfStatement(IfStatementSyntax node, out BoundStatement? alternative) 2738private BoundStatement BindSwitchStatement(SwitchStatementSyntax node, BindingDiagnosticBag diagnostics) 2745internal virtual BoundStatement BindSwitchStatementCore(SwitchStatementSyntax node, Binder originalBinder, BindingDiagnosticBag diagnostics) 2755private BoundStatement BindWhile(WhileStatementSyntax node, BindingDiagnosticBag diagnostics) 2769private BoundStatement BindDo(DoStatementSyntax node, BindingDiagnosticBag diagnostics) 2794internal BoundStatement BindForOrUsingOrFixedDeclarations(VariableDeclarationSyntax nodeOpt, LocalDeclarationKind localKind, BindingDiagnosticBag diagnostics, out ImmutableArray<BoundLocalDeclaration> declarations) 2851(BoundStatement)declarations[0] : 2855internal BoundStatement BindStatementExpressionList(SeparatedSyntaxList<ExpressionSyntax> statements, BindingDiagnosticBag diagnostics) 2869var statementBuilder = ArrayBuilder<BoundStatement>.GetInstance(); 2880private BoundStatement BindForEach(CommonForEachStatementSyntax node, BindingDiagnosticBag diagnostics) 2886internal virtual BoundStatement BindForEachParts(BindingDiagnosticBag diagnostics, Binder originalBinder) 2894internal virtual BoundStatement BindForEachDeconstruction(BindingDiagnosticBag diagnostics, Binder originalBinder) 2899private BoundStatement BindBreak(BreakStatementSyntax node, BindingDiagnosticBag diagnostics) 2910private BoundStatement BindContinue(ContinueStatementSyntax node, BindingDiagnosticBag diagnostics) 2987private BoundStatement BindReturn(ReturnStatementSyntax syntax, BindingDiagnosticBag diagnostics) 3452BoundStatement statement; 3655ArrayBuilder<BoundStatement> boundStatements = ArrayBuilder<BoundStatement>.GetInstance(); 3667var boundStatement = BindStatement(topLevelStatement.Statement, diagnostics); 3700blockBody: new BoundBlock(typeDecl, ImmutableArray<LocalSymbol>.Empty, ImmutableArray<BoundStatement>.Empty).MakeCompilerGenerated(),
Binder\BuckStopsHereBinder.cs (5)
186internal override BoundStatement BindSwitchStatementCore(SwitchStatementSyntax node, Binder originalBinder, BindingDiagnosticBag diagnostics) 216internal override BoundStatement BindForEachParts(BindingDiagnosticBag diagnostics, Binder originalBinder) 222internal override BoundStatement BindForEachDeconstruction(BindingDiagnosticBag diagnostics, Binder originalBinder) 240internal override BoundStatement BindUsingStatementParts(BindingDiagnosticBag diagnostics, Binder originalBinder) 246internal override BoundStatement BindLockStatementParts(BindingDiagnosticBag diagnostics, Binder originalBinder)
Binder\ForEachLoopBinder.cs (3)
180internal override BoundStatement BindForEachParts(BindingDiagnosticBag diagnostics, Binder originalBinder) 189internal override BoundStatement BindForEachDeconstruction(BindingDiagnosticBag diagnostics, Binder originalBinder) 419BoundStatement body = originalBinder.BindPossibleEmbeddedStatement(_syntax.Statement, diagnostics);
Binder\ForLoopBinder.cs (3)
71BoundStatement initializer; 101BoundStatement increment = null; 126var body = originalBinder.BindPossibleEmbeddedStatement(node.Statement, diagnostics);
Binder\LockBinder.cs (2)
34internal override BoundStatement BindLockStatementParts(BindingDiagnosticBag diagnostics, Binder originalBinder) 69BoundStatement stmt = originalBinder.BindPossibleEmbeddedStatement(_syntax.Statement, diagnostics);
Binder\SwitchBinder.cs (1)
472internal BoundStatement BindGotoCaseOrDefault(GotoStatementSyntax node, Binder gotoBinder, BindingDiagnosticBag diagnostics)
Binder\SwitchBinder_Patterns.cs (4)
29internal override BoundStatement BindSwitchStatementCore(SwitchStatementSyntax node, Binder originalBinder, BindingDiagnosticBag diagnostics) 200var boundStatementsBuilder = ArrayBuilder<BoundStatement>.GetInstance(node.Statements.Count); 203var boundStatement = sectionBinder.BindStatement(statement, diagnostics); 214internal static bool ContainsUsingVariable(BoundStatement boundStatement)
Binder\UsingStatementBinder.cs (4)
76internal override BoundStatement BindUsingStatementParts(BindingDiagnosticBag diagnostics, Binder originalBinder) 84var boundUsingStatement = BindUsingStatementOrDeclarationFromParts((CSharpSyntaxNode)expressionSyntax ?? declarationSyntax, _syntax.UsingKeyword, _syntax.AwaitKeyword, originalBinder, this, diagnostics); 90internal static BoundStatement BindUsingStatementOrDeclarationFromParts(SyntaxNode syntax, SyntaxToken usingKeyword, SyntaxToken awaitKeyword, Binder originalBinder, UsingStatementBinder? usingBinderOpt, BindingDiagnosticBag diagnostics) 171BoundStatement boundBody = originalBinder.BindPossibleEmbeddedStatement(usingBinderOpt!._syntax.Statement, diagnostics);
Binder\WhileBinder.cs (2)
33var body = originalBinder.BindPossibleEmbeddedStatement(node.Statement, diagnostics); 43var body = originalBinder.BindPossibleEmbeddedStatement(node.Statement, diagnostics);
BoundTree\BoundNode_Source.cs (5)
105foreach (var statement in statements) 119var statement = seqPoint.StatementOpt; 134var statement = seqPoint.StatementOpt; 297foreach (var statement in section.Statements) 328foreach (var statement in list.Statements)
BoundTree\BoundNodeExtensions.cs (1)
39public static bool IsConstructorInitializer(this BoundStatement statement)
BoundTree\BoundSequencePoint.cs (6)
11public static BoundStatement Create(SyntaxNode? syntax, TextSpan? part, BoundStatement statement, bool hasErrors = false) 25public static BoundStatement Create(SyntaxNode? syntax, BoundStatement? statementOpt, bool hasErrors = false, bool wasCompilerGenerated = false) 31public static BoundStatement CreateHidden(BoundStatement? statementOpt = null, bool hasErrors = false)
BoundTree\BoundSpillSequence.cs (2)
26private static ImmutableArray<BoundStatement> MakeStatements(ImmutableArray<BoundExpression> expressions) 28return expressions.SelectAsArray<BoundExpression, BoundStatement>(
BoundTree\BoundStatementExtensions.cs (2)
14internal static void AssertIsLabeledStatement(this BoundStatement node) 28internal static void AssertIsLabeledStatementWithLabel(this BoundStatement node, LabelSymbol label)
BoundTree\BoundTreeRewriter.cs (4)
165BoundStatement? alternative; 179alternative = (BoundStatement?)this.Visit(alternative); 186BoundStatement consequence = (BoundStatement)this.Visit(ifStatement.Consequence);
BoundTree\BoundTreeWalker.cs (1)
239var alternative = node.AlternativeOpt;
BoundTree\Constructors.cs (8)
608public static BoundStatementList Synthesized(SyntaxNode syntax, params BoundStatement[] statements) 613public static BoundStatementList Synthesized(SyntaxNode syntax, bool hasErrors, params BoundStatement[] statements) 618public static BoundStatementList Synthesized(SyntaxNode syntax, ImmutableArray<BoundStatement> statements) 623public static BoundStatementList Synthesized(SyntaxNode syntax, bool hasErrors, ImmutableArray<BoundStatement> statements) 655public BoundBlock(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundStatement> statements, bool hasErrors = false) 660public static BoundBlock SynthesizedNoLocals(SyntaxNode syntax, BoundStatement statement) 666public static BoundBlock SynthesizedNoLocals(SyntaxNode syntax, ImmutableArray<BoundStatement> statements) 671public static BoundBlock SynthesizedNoLocals(SyntaxNode syntax, params BoundStatement[] statements)
BoundTree\NullabilityRewriter.cs (7)
32var stack = ArrayBuilder<(BoundIfStatement, BoundExpression, BoundStatement)>.GetInstance(); 34BoundStatement? rewrittenAlternative; 38var rewrittenConsequence = (BoundStatement)Visit(node.Consequence); 42var alternative = node.AlternativeOpt; 55rewrittenAlternative = (BoundStatement)Visit(alternative); 60BoundStatement result;
CodeGen\CodeGenerator.cs (4)
29private readonly BoundStatement _boundBody; 85BoundStatement boundBody, 381BoundStatement statement = node.StatementOpt; 404BoundStatement statement = node.StatementOpt;
CodeGen\EmitStatement.cs (4)
27private void EmitStatement(BoundStatement statement) 118private int EmitStatementAndCountInstructions(BoundStatement statement) 784private void EmitStatements(ImmutableArray<BoundStatement> statements) 786foreach (var statement in statements)
CodeGen\Optimizer.cs (7)
59public static BoundStatement Optimize( 60BoundStatement src, bool debugFriendly, 67src = (BoundStatement)StackOptimizerPass1.Analyze(src, locals, debugFriendly); 71BoundStatement result; 2039public static BoundStatement Rewrite(BoundStatement src, Dictionary<LocalSymbol, LocalDefUseInfo> info) 2042return (BoundStatement)scheduler.Visit(src);
Compilation\CSharpSemanticModel.cs (1)
2405BoundStatement bound = binder.BindStatement(globalStatement.Statement, diagnostics);
Compilation\MemberSemanticModel.cs (11)
34private Dictionary<SyntaxNode, BoundStatement> _lazyGuardedSynthesizedStatementsMap; 1411private void GuardedAddSynthesizedStatementToMap(StatementSyntax node, BoundStatement statement) 1415_lazyGuardedSynthesizedStatementsMap = new Dictionary<SyntaxNode, BoundStatement>(); 1421private BoundStatement GuardedGetSynthesizedStatementFromMap(StatementSyntax node) 1424_lazyGuardedSynthesizedStatementsMap.TryGetValue(node, out BoundStatement result)) 2418private BoundStatement TryGetBoundStatementFromMap(StatementSyntax node) 2422BoundStatement synthesizedStatement = _semanticModel.GuardedGetSynthesizedStatementFromMap(node); 2429return (BoundStatement)TryGetBoundNodeFromMap(node); 2435public override BoundStatement BindStatement(StatementSyntax node, BindingDiagnosticBag diagnostics) 2438BoundStatement statement = TryGetBoundStatementFromMap(node); 2526protected override bool TryGetBoundElseIfStatement(IfStatementSyntax node, out BoundStatement alternative)
Compilation\MemberSemanticModel.NodeMapBuilder.cs (1)
321var alternative = node.AlternativeOpt;
Compiler\AnonymousTypeMethodBodySynthesizer.cs (4)
34BoundStatement[] statements = new BoundStatement[paramCount + 2]; 121BoundStatement assignment = F.ExpressionStatement(assignmentToTemp); 146BoundStatement retStatement = F.Return(retExpression);
Compiler\MethodBodySynthesizer.cs (22)
22internal static ImmutableArray<BoundStatement> ConstructScriptConstructorBody( 23BoundStatement loweredBody, 42BoundStatement baseConstructorCall = 61var statements = ArrayBuilder<BoundStatement>.GetInstance(); 84ArrayBuilder<BoundStatement> statements, 189BoundStatement statement; 311BoundStatement returnStatement = BoundReturnStatement.Synthesized(syntax, RefKind.None, processHandlerCall); 320BoundStatement callStatement = new BoundExpressionStatement(syntax, processHandlerCall); 321BoundStatement returnStatement = new BoundReturnStatement(syntax, RefKind.None, expressionOpt: null, @checked: false); 357BoundStatement @return = new BoundReturnStatement(syntax, 407BoundStatement eventUpdate = new BoundExpressionStatement(syntax, 416statements: ImmutableArray.Create<BoundStatement>( 439BoundStatement tmp0Init = new BoundExpressionStatement(syntax, 448BoundStatement loopStart = new BoundLabelStatement(syntax, 453BoundStatement tmp1Update = new BoundExpressionStatement(syntax, 472BoundStatement tmp2Update = new BoundExpressionStatement(syntax, 488BoundStatement tmp0Update = new BoundExpressionStatement(syntax, 509BoundStatement loopEnd = new BoundConditionalGoto(syntax, 517statements: ImmutableArray.Create<BoundStatement>( 542BoundStatement baseFinalizeCall = new BoundExpressionStatement( 566ImmutableArray.Create<BoundStatement>( 574ImmutableArray.Create<BoundStatement>(
Compiler\MethodCompiler.cs (23)
257BoundStatement body = synthesizedEntryPoint.CreateBody(diagnostics); 271var loweredBody = LowerBodyOrInitializer( 744BoundStatement loweredBody = IteratorRewriter.Rewrite(methodWithBody.Body, method, methodOrdinal, stateMachineStateDebugInfoBuilder, variableSlotAllocatorOpt, compilationState, diagnosticsThisMethod, out iteratorStateMachine); 961body = new BoundBlock(methodSymbol.GetNonNullSyntaxNode(), ImmutableArray<LocalSymbol>.Empty, ImmutableArray<BoundStatement>.Empty) { WasCompilerGenerated = true }; 1170BoundStatement loweredBodyOpt = null; 1214ImmutableArray<BoundStatement> boundStatements; 1222boundStatements = ImmutableArray<BoundStatement>.Empty; 1232var initializers = ArrayBuilder<BoundStatement>.GetInstance(capturedParameters.Count); 1252BoundStatement lowered = LowerBodyOrInitializer( 1362internal static BoundStatement LowerBodyOrInitializer( 1365BoundStatement body, 1390var loweredBody = LocalRewriter.Rewrite( 1434BoundStatement bodyWithoutLambdas = loweredBody; 1458BoundStatement bodyWithoutIterators = IteratorRewriter.Rewrite(bodyWithoutLambdas, method, methodOrdinal, stateMachineStateDebugInfoBuilder, lazyVariableSlotAllocator, compilationState, diagnostics, 1466BoundStatement bodyWithoutAsync = AsyncRewriter.Rewrite(bodyWithoutIterators, method, methodOrdinal, stateMachineStateDebugInfoBuilder, lazyVariableSlotAllocator, compilationState, diagnostics, 1489BoundStatement block, 1860body = new BoundBlock(constructor.Syntax, constructor.Locals, ImmutableArray.Create<BoundStatement>(constructor.Initializer)); 1864body = new BoundBlock(constructor.Syntax, constructor.Locals, ImmutableArray.Create<BoundStatement>(constructor.Initializer, body)); 1909var stmts = ArrayBuilder<BoundStatement>.GetInstance(); 1941var constructorInitializer = BindImplicitConstructorInitializerIfAny(method, compilationState, diagnostics); 1942ImmutableArray<BoundStatement> statements; 1951statements = ImmutableArray<BoundStatement>.Empty; 2333private static BoundStatement BindImplicitConstructorInitializerIfAny(MethodSymbol method, TypeCompilationState compilationState, BindingDiagnosticBag diagnostics)
Compiler\TypeCompilationState.cs (4)
30public readonly BoundStatement Body; 33internal MethodWithBody(MethodSymbol method, BoundStatement body, ImportChain? importChain) 133public void AddSynthesizedMethod(MethodSymbol method, BoundStatement body) 150public void AddMethodWrapper(MethodSymbol method, MethodSymbol wrapper, BoundStatement body)
Emitter\Model\SynthesizedPrivateImplementationDetailsStaticConstructor.cs (4)
33ArrayBuilder<BoundStatement> body = ArrayBuilder<BoundStatement>.GetInstance(); 52BoundStatement payloadInitialization = 73BoundStatement returnStatement = factory.Return();
FlowAnalysis\AbstractFlowPass.cs (20)
93private PooledHashSet<BoundStatement> _labelsSeen; 210_labelsSeen = PooledHashSet<BoundStatement>.GetInstance(); 670protected virtual void VisitStatement(BoundStatement statement) 762protected virtual void NoteBranch(PendingBranch pending, BoundNode gotoStmt, BoundStatement target) 773private bool ResolveBranches(LabelSymbol label, BoundStatement? target) 792protected virtual void ResolveBranch(PendingBranch pending, LabelSymbol label, BoundStatement? target, ref bool labelStateChanged) 811public readonly PooledHashSet<BoundStatement> LabelsSeen; 813public SavedPending(PendingBranchesCollection pendingBranches, PooledHashSet<BoundStatement> labelsSeen) 831_labelsSeen = PooledHashSet<BoundStatement>.GetInstance(); 1311private void VisitStatements(ImmutableArray<BoundStatement> statements) 1313foreach (var statement in statements) 1589if (child is BoundStatement) 1591VisitStatement(child as BoundStatement); 1782var alternative = node.AlternativeOpt; 1908private void VisitTryBlockWithAnyTransferFunction(BoundStatement tryBlock, BoundTryStatement node, ref TLocalState tryState) 1932protected virtual void VisitTryBlock(BoundStatement tryBlock, BoundTryStatement node, ref TLocalState tryState) 1982private void VisitFinallyBlockWithAnyTransferFunction(BoundStatement finallyBlock, ref TLocalState stateMovedUp) 2006protected virtual void VisitFinallyBlock(BoundStatement finallyBlock, ref TLocalState stateMovedUp) 3203foreach (var statement in node.Statements) 3341protected void VisitLabel(LabelSymbol label, BoundStatement node)
FlowAnalysis\AlwaysAssignedWalker.cs (1)
81protected override void ResolveBranch(PendingBranch pending, LabelSymbol label, BoundStatement target, ref bool labelStateChanged)
FlowAnalysis\ControlFlowPass.cs (4)
240protected override void VisitStatement(BoundStatement statement) 261private void CheckReachable(BoundStatement statement) 274protected override void VisitTryBlock(BoundStatement tryBlock, BoundTryStatement node, ref LocalState tryState) 294protected override void VisitFinallyBlock(BoundStatement finallyBlock, ref LocalState endState)
FlowAnalysis\DataFlowsInWalker.cs (1)
82BoundStatement targetStmt)
FlowAnalysis\DefiniteAssignment.cs (3)
2179foreach (var stmt in block.Statements) 2191foreach (var stmt in block.Statements) 2201foreach (var stmt in block.Statements)
FlowAnalysis\EntryPointsWalker.cs (1)
58protected override void NoteBranch(PendingBranch pending, BoundNode gotoStmt, BoundStatement targetStmt)
FlowAnalysis\FlowAnalysisPass.cs (5)
119var builder = ArrayBuilder<BoundStatement>.GetInstance(implicitlyInitializedFields.Length); 160var initializations = F.HiddenSequencePoint(F.Block(builder.ToImmutableAndFree())); 172var builder = ArrayBuilder<BoundStatement>.GetInstance(n); 200BoundStatement ret = (method.IsIterator && !method.IsAsync) 201? (BoundStatement)BoundYieldBreakStatement.Synthesized(syntax)
FlowAnalysis\NullableWalker.cs (3)
3132foreach (var stmt in block.Statements) 3203foreach (var stmt in block.Statements) 3718protected override void VisitStatement(BoundStatement statement)
FlowAnalysis\NullableWalker.DebugVerifier.cs (1)
196var alternative = node.AlternativeOpt;
Generated\BoundNodes.xml.Generated.cs (144)
399public BoundGlobalStatementInitializer(SyntaxNode syntax, BoundStatement statement, bool hasErrors = false) 408public BoundStatement Statement { get; } 413public BoundGlobalStatementInitializer Update(BoundStatement statement) 2262public BoundBlockInstrumentation(SyntaxNode syntax, OneOrMany<LocalSymbol> locals, BoundStatement? prologue, BoundStatement? epilogue, bool hasErrors = false) 2274public BoundStatement? Prologue { get; } 2275public BoundStatement? Epilogue { get; } 2280public BoundBlockInstrumentation Update(OneOrMany<LocalSymbol> locals, BoundStatement? prologue, BoundStatement? epilogue) 3148public BoundSequencePoint(SyntaxNode syntax, BoundStatement? statementOpt, bool hasErrors = false) 3154public BoundStatement? StatementOpt { get; } 3159public BoundSequencePoint Update(BoundStatement? statementOpt) 3173public BoundSequencePointWithSpan(SyntaxNode syntax, BoundStatement? statementOpt, TextSpan span, bool hasErrors = false) 3180public BoundStatement? StatementOpt { get; } 3186public BoundSequencePointWithSpan Update(BoundStatement? statementOpt, TextSpan span) 3305public BoundBlock(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, ImmutableArray<LocalFunctionSymbol> localFunctions, bool hasUnsafeModifier, BoundBlockInstrumentation? instrumentation, ImmutableArray<BoundStatement> statements, bool hasErrors = false) 3327public BoundBlock Update(ImmutableArray<LocalSymbol> locals, ImmutableArray<LocalFunctionSymbol> localFunctions, bool hasUnsafeModifier, BoundBlockInstrumentation? instrumentation, ImmutableArray<BoundStatement> statements) 3341public BoundScope(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundStatement> statements, bool hasErrors = false) 3356public BoundScope Update(ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundStatement> statements) 3370public BoundStateMachineScope(SyntaxNode syntax, ImmutableArray<StateMachineFieldSymbol> fields, BoundStatement statement, bool hasErrors = false) 3382public BoundStatement Statement { get; } 3387public BoundStateMachineScope Update(ImmutableArray<StateMachineFieldSymbol> fields, BoundStatement statement) 3852public BoundIfStatement(SyntaxNode syntax, BoundExpression condition, BoundStatement consequence, BoundStatement? alternativeOpt, bool hasErrors = false) 3865public BoundStatement Consequence { get; } 3866public BoundStatement? AlternativeOpt { get; } 3871public BoundIfStatement Update(BoundExpression condition, BoundStatement consequence, BoundStatement? alternativeOpt) 3913protected BoundConditionalLoopStatement(BoundKind kind, SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundExpression condition, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel, bool hasErrors = false) 3930public BoundStatement Body { get; } 3935public BoundDoStatement(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundExpression condition, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel, bool hasErrors = false) 3951public BoundDoStatement Update(ImmutableArray<LocalSymbol> locals, BoundExpression condition, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel) 3965public BoundWhileStatement(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundExpression condition, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel, bool hasErrors = false) 3981public BoundWhileStatement Update(ImmutableArray<LocalSymbol> locals, BoundExpression condition, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel) 3995public BoundForStatement(SyntaxNode syntax, ImmutableArray<LocalSymbol> outerLocals, BoundStatement? initializer, ImmutableArray<LocalSymbol> innerLocals, BoundExpression? condition, BoundStatement? increment, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel, bool hasErrors = false) 4014public BoundStatement? Initializer { get; } 4017public BoundStatement? Increment { get; } 4018public BoundStatement Body { get; } 4023public BoundForStatement Update(ImmutableArray<LocalSymbol> outerLocals, BoundStatement? initializer, ImmutableArray<LocalSymbol> innerLocals, BoundExpression? condition, BoundStatement? increment, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel) 4037public BoundForEachStatement(SyntaxNode syntax, ForEachEnumeratorInfo? enumeratorInfoOpt, BoundValuePlaceholder? elementPlaceholder, BoundExpression? elementConversion, BoundTypeExpression iterationVariableType, ImmutableArray<LocalSymbol> iterationVariables, BoundExpression? iterationErrorExpressionOpt, BoundExpression expression, BoundForEachDeconstructStep? deconstructionOpt, BoundAwaitableInfo? awaitOpt, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel, bool hasErrors = false) 4069public BoundStatement Body { get; } 4074public BoundForEachStatement Update(ForEachEnumeratorInfo? enumeratorInfoOpt, BoundValuePlaceholder? elementPlaceholder, BoundExpression? elementConversion, BoundTypeExpression iterationVariableType, ImmutableArray<LocalSymbol> iterationVariables, BoundExpression? iterationErrorExpressionOpt, BoundExpression expression, BoundForEachDeconstructStep? deconstructionOpt, BoundAwaitableInfo? awaitOpt, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel) 4119public BoundUsingStatement(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundMultipleLocalDeclarations? declarationsOpt, BoundExpression? expressionOpt, BoundStatement body, BoundAwaitableInfo? awaitOpt, MethodArgumentInfo? patternDisposeInfoOpt, bool hasErrors = false) 4137public BoundStatement Body { get; } 4144public BoundUsingStatement Update(ImmutableArray<LocalSymbol> locals, BoundMultipleLocalDeclarations? declarationsOpt, BoundExpression? expressionOpt, BoundStatement body, BoundAwaitableInfo? awaitOpt, MethodArgumentInfo? patternDisposeInfoOpt) 4158public BoundFixedStatement(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundMultipleLocalDeclarations declarations, BoundStatement body, bool hasErrors = false) 4173public BoundStatement Body { get; } 4178public BoundFixedStatement Update(ImmutableArray<LocalSymbol> locals, BoundMultipleLocalDeclarations declarations, BoundStatement body) 4192public BoundLockStatement(SyntaxNode syntax, BoundExpression argument, BoundStatement body, bool hasErrors = false) 4204public BoundStatement Body { get; } 4209public BoundLockStatement Update(BoundExpression argument, BoundStatement body) 4742public BoundLabeledStatement(SyntaxNode syntax, LabelSymbol label, BoundStatement body, bool hasErrors = false) 4754public BoundStatement Body { get; } 4759public BoundLabeledStatement Update(LabelSymbol label, BoundStatement body) 4810protected BoundStatementList(BoundKind kind, SyntaxNode syntax, ImmutableArray<BoundStatement> statements, bool hasErrors = false) 4819public BoundStatementList(SyntaxNode syntax, ImmutableArray<BoundStatement> statements, bool hasErrors = false) 4828public ImmutableArray<BoundStatement> Statements { get; } 4833public BoundStatementList Update(ImmutableArray<BoundStatement> statements) 5659public BoundSwitchSection(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundSwitchLabel> switchLabels, ImmutableArray<BoundStatement> statements, bool hasErrors = false) 5677public BoundSwitchSection Update(ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundSwitchLabel> switchLabels, ImmutableArray<BoundStatement> statements) 5802public BoundSpillSequence(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundStatement> sideEffects, BoundExpression value, TypeSymbol type, bool hasErrors = false) 5818public ImmutableArray<BoundStatement> SideEffects { get; } 5824public BoundSpillSequence Update(ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundStatement> sideEffects, BoundExpression value, TypeSymbol type) 6507public BoundCollectionExpressionSpreadElement(SyntaxNode syntax, BoundExpression expression, BoundCollectionExpressionSpreadExpressionPlaceholder? expressionPlaceholder, BoundExpression? conversion, ForEachEnumeratorInfo? enumeratorInfoOpt, BoundExpression? lengthOrCount, BoundValuePlaceholder? elementPlaceholder, BoundStatement? iteratorBody, bool hasErrors = false) 6528public BoundStatement? IteratorBody { get; } 6533public BoundCollectionExpressionSpreadElement Update(BoundExpression expression, BoundCollectionExpressionSpreadExpressionPlaceholder? expressionPlaceholder, BoundExpression? conversion, ForEachEnumeratorInfo? enumeratorInfoOpt, BoundExpression? lengthOrCount, BoundValuePlaceholder? elementPlaceholder, BoundStatement? iteratorBody) 7718public BoundTypeOrInstanceInitializers(SyntaxNode syntax, ImmutableArray<BoundStatement> statements, bool hasErrors = false) 7730public new BoundTypeOrInstanceInitializers Update(ImmutableArray<BoundStatement> statements) 8767public BoundConstructorMethodBody(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundStatement? initializer, BoundBlock? blockBody, BoundBlock? expressionBody, bool hasErrors = false) 8778public BoundStatement? Initializer { get; } 8783public BoundConstructorMethodBody Update(ImmutableArray<LocalSymbol> locals, BoundStatement? initializer, BoundBlock? blockBody, BoundBlock? expressionBody) 10853BoundStatement statement = (BoundStatement)this.Visit(node.Statement); 11173BoundStatement? prologue = (BoundStatement?)this.Visit(node.Prologue); 11174BoundStatement? epilogue = (BoundStatement?)this.Visit(node.Epilogue); 11309BoundStatement? statementOpt = (BoundStatement?)this.Visit(node.StatementOpt); 11314BoundStatement? statementOpt = (BoundStatement?)this.Visit(node.StatementOpt); 11323ImmutableArray<BoundStatement> statements = this.VisitList(node.Statements); 11328ImmutableArray<BoundStatement> statements = this.VisitList(node.Statements); 11333BoundStatement statement = (BoundStatement)this.Visit(node.Statement); 11400BoundStatement consequence = (BoundStatement)this.Visit(node.Consequence); 11401BoundStatement? alternativeOpt = (BoundStatement?)this.Visit(node.AlternativeOpt); 11407BoundStatement body = (BoundStatement)this.Visit(node.Body); 11413BoundStatement body = (BoundStatement)this.Visit(node.Body); 11418BoundStatement? initializer = (BoundStatement?)this.Visit(node.Initializer); 11420BoundStatement? increment = (BoundStatement?)this.Visit(node.Increment); 11421BoundStatement body = (BoundStatement)this.Visit(node.Body); 11433BoundStatement body = (BoundStatement)this.Visit(node.Body); 11446BoundStatement body = (BoundStatement)this.Visit(node.Body); 11453BoundStatement body = (BoundStatement)this.Visit(node.Body); 11459BoundStatement body = (BoundStatement)this.Visit(node.Body); 11538BoundStatement body = (BoundStatement)this.Visit(node.Body); 11548ImmutableArray<BoundStatement> statements = this.VisitList(node.Statements); 11693ImmutableArray<BoundStatement> statements = this.VisitList(node.Statements); 11717ImmutableArray<BoundStatement> sideEffects = this.VisitList(node.SideEffects); 11837BoundStatement? iteratorBody = node.IteratorBody; 12043ImmutableArray<BoundStatement> statements = this.VisitList(node.Statements); 12232BoundStatement? initializer = (BoundStatement?)this.Visit(node.Initializer); 13393ImmutableArray<BoundStatement> statements = this.VisitList(node.Statements); 13400ImmutableArray<BoundStatement> statements = this.VisitList(node.Statements); 13407BoundStatement statement = (BoundStatement)this.Visit(node.Statement); 13443BoundStatement body = (BoundStatement)this.Visit(node.Body); 13451BoundStatement body = (BoundStatement)this.Visit(node.Body); 13459BoundStatement? initializer = (BoundStatement?)this.Visit(node.Initializer); 13461BoundStatement? increment = (BoundStatement?)this.Visit(node.Increment); 13462BoundStatement body = (BoundStatement)this.Visit(node.Body); 13476BoundStatement body = (BoundStatement)this.Visit(node.Body); 13485BoundStatement body = (BoundStatement)this.Visit(node.Body); 13494BoundStatement body = (BoundStatement)this.Visit(node.Body); 13764ImmutableArray<BoundStatement> statements = this.VisitList(node.Statements); 13807ImmutableArray<BoundStatement> sideEffects = this.VisitList(node.SideEffects); 14952BoundStatement? initializer = (BoundStatement?)this.Visit(node.Initializer);
Lowering\AsyncRewriter\AsyncExceptionHandlerRewriter.cs (22)
109public static BoundStatement Rewrite( 112BoundStatement statement, 130var loweredStatement = (BoundStatement)rewriter.Visit(statement); 152BoundStatement finalizedRegion; 193var catchAndPendException = _F.Try( 212BoundStatement syntheticFinally = syntheticFinallyBlock; 220var statements = ArrayBuilder<BoundStatement>.GetInstance(); 251var bodyStatements = ArrayBuilder<BoundStatement>.GetInstance(); 280ArrayBuilder<BoundStatement> bodyStatements, 296private BoundStatement UnpendBranches( 329BoundStatement unpendReturn; 403private BoundStatement UnpendException(LocalSymbol pendingExceptionLocal) 411BoundStatement rethrow = Rethrow(obj); 423private BoundStatement Rethrow(LocalSymbol obj) 426BoundStatement rethrow = _F.Throw(_F.Local(obj)); 461private BoundStatement RewriteFinalizedRegion(BoundTryStatement node) 481BoundStatement tryWithCatches = _F.Try(rewrittenTry, rewrittenCatches); 611var prologueBuilder = ArrayBuilder<BoundStatement>.GetInstance(); 639var handlerStatements = ArrayBuilder<BoundStatement>.GetInstance(); 653handlerStatements.Add((BoundStatement)this.Visit(node.Body)); 766public AwaitInFinallyAnalysis(BoundStatement body)
Lowering\AsyncRewriter\AsyncIteratorMethodToStateMachineRewriter.cs (21)
80protected override BoundStatement? GenerateMissingStateDispatch() 82var asyncDispatch = base.GenerateMissingStateDispatch(); 84var iteratorDispatch = _iteratorStateAllocator.GenerateThrowMissingStateDispatch(F, F.Local(cachedState), HotReloadExceptionCode.CannotResumeSuspendedIteratorMethod); 93protected override BoundStatement GenerateCleanupForExit(ImmutableArray<StateMachineFieldSymbol> rootHoistedLocals) 102protected override BoundStatement GenerateSetResultCall() 119var builder = ArrayBuilder<BoundStatement>.GetInstance(); 164private void AddDisposeCombinedTokensIfNeeded(ArrayBuilder<BoundStatement> builder) 180protected override BoundStatement GenerateSetExceptionCall(LocalSymbol exceptionLocal) 182var builder = ArrayBuilder<BoundStatement>.GetInstance(); 202private BoundStatement GenerateJumpToCurrentDisposalLabel() 212private BoundStatement AppendJumpToCurrentDisposalLabel(BoundStatement node) 242protected override BoundStatement VisitBody(BoundStatement body) 252var rewrittenBody = (BoundStatement)Visit(body); 280var blockBuilder = ArrayBuilder<BoundStatement>.GetInstance(); 331protected override BoundStatement MakeAwaitPreamble() 390var result = (BoundStatement)base.VisitTryStatement(node); 425BoundStatement result = VisitFinally(extractedFinally.FinallyBlock);
Lowering\AsyncRewriter\AsyncMethodToStateMachineRewriter.cs (24)
136internal void GenerateMoveNext(BoundStatement body, MethodSymbol moveNextMethod) 139BoundStatement rewrittenBody = VisitBody(body); 144var bodyBuilder = ArrayBuilder<BoundStatement>.GetInstance(); 196var newBody = 227BoundStatement assignFinishedState = 231BoundStatement callSetException = GenerateSetExceptionCall(exceptionLocal); 249protected virtual BoundStatement GenerateTopLevelTry(BoundBlock tryBlock, ImmutableArray<BoundCatchBlock> catchBlocks) 252protected virtual BoundStatement GenerateSetResultCall() 264protected virtual BoundStatement GenerateCleanupForExit(ImmutableArray<StateMachineFieldSymbol> rootHoistedLocals) 266var builder = ArrayBuilder<BoundStatement>.GetInstance(); 286protected virtual BoundStatement GenerateSetExceptionCall(LocalSymbol exceptionLocal) 298protected sealed override BoundStatement GenerateReturn(bool finished) 305protected virtual BoundStatement VisitBody(BoundStatement body) 306=> (BoundStatement)Visit(body); 324return (expr != null) ? node.Update(expr) : (BoundStatement)F.StatementList(); 340protected virtual BoundStatement? MakeAwaitPreamble() { return null; } 345BoundStatement preamble = MakeAwaitPreamble(); 394BoundStatement getResultStatement = resultPlace != null && !type.IsVoidType() ? 398var statementsBuilder = ArrayBuilder<BoundStatement>.GetInstance(preamble is null ? 2 : 3); 472var blockBuilder = ArrayBuilder<BoundStatement>.GetInstance(); 532private BoundStatement GenerateAwaitOnCompletedDynamic(LocalSymbol awaiterTemp) 559var blockBuilder = ArrayBuilder<BoundStatement>.GetInstance(); 612private BoundStatement GenerateAwaitOnCompleted(TypeSymbol loweredAwaiterType, LocalSymbol awaiterTemp)
Lowering\AsyncRewriter\AsyncRewriter.AsyncIteratorRewriter.cs (15)
35BoundStatement body, 163var bodyBuilder = ArrayBuilder<BoundStatement>.GetInstance(); 200protected override void InitializeStateMachine(ArrayBuilder<BoundStatement> bodyBuilder, NamedTypeSymbol frameType, LocalSymbol stateMachineLocal) 210protected override BoundStatement InitializeParameterField(MethodSymbol getEnumeratorMethod, ParameterSymbol parameter, BoundExpression resultParameter, BoundExpression parameterProxy) 212BoundStatement result; 262protected override BoundStatement GenerateStateMachineCreation(LocalSymbol stateMachineVariable, NamedTypeSymbol frameType, IReadOnlyDictionary<Symbol, CapturedSymbolReplacement> proxies) 264var bodyBuilder = ArrayBuilder<BoundStatement>.GetInstance(); 325out BoundStatement instAssignment, 329BoundStatement ifFinished = F.If( 340var ifPromiseReady = F.If( 367private void GetPartsForStartingMachine(out BoundExpressionStatement callReset, out LocalSymbol instSymbol, out BoundStatement instAssignment, 435out BoundStatement instAssignment, 439BoundStatement ifInvalidState = F.If( 445BoundStatement ifFinished = F.If( 662protected override void GenerateResetInstance(ArrayBuilder<BoundStatement> builder, StateMachineState initialState)
Lowering\AsyncRewriter\AsyncRewriter.cs (6)
24BoundStatement body, 41internal static BoundStatement Rewrite( 42BoundStatement bodyWithAwaitLifted, 202protected override void InitializeStateMachine(ArrayBuilder<BoundStatement> bodyBuilder, NamedTypeSymbol frameType, LocalSymbol stateMachineLocal) 214protected override BoundStatement GenerateStateMachineCreation(LocalSymbol stateMachineVariable, NamedTypeSymbol frameType, IReadOnlyDictionary<Symbol, CapturedSymbolReplacement> proxies) 226var bodyBuilder = ArrayBuilder<BoundStatement>.GetInstance();
Lowering\ClosureConversion\ClosureConversion.cs (27)
63/// a (<see cref="MethodSymbol"/>, <see cref="BoundStatement"/>) pair for each generated method. 67/// (<see cref="MethodSymbol"/>, <see cref="BoundStatement"/>) pairs for additional methods that the lambda rewriter produced. 137private ArrayBuilder<BoundStatement> _addedStatements; 226public static BoundStatement Rewrite( 227BoundStatement loweredBody, 272var body = rewriter.AddStatementsIfNeeded( 273(BoundStatement)rewriter.Visit(loweredBody)); 296private BoundStatement AddStatementsIfNeeded(BoundStatement body) 635private static void InsertAndFreePrologue<T>(ArrayBuilder<BoundStatement> result, ArrayBuilder<T> prologue) where T : BoundNode 639if (node is BoundStatement stmt) 1168var newStatements = ArrayBuilder<BoundStatement>.GetInstance(); 1177foreach (var statement in node.Statements) 1179var replacement = (BoundStatement)this.Visit(statement); 1189var newPrologue = (BoundStatement)Visit(newInstrumentation.Prologue); 1190var newEpilogue = (BoundStatement)Visit(newInstrumentation.Epilogue); 1257var prologueBuilder = ArrayBuilder<BoundStatement>.GetInstance(prologue.Count); 1312var newStatements = ArrayBuilder<BoundStatement>.GetInstance(); 1315foreach (var s in node.Statements) 1317newStatements.Add((BoundStatement)this.Visit(s)); 1586var body = AddStatementsIfNeeded((BoundStatement)VisitBlock(block)); 1604private void AddSynthesizedMethod(MethodSymbol method, BoundStatement body) 1722if (_addedStatements == null) _addedStatements = ArrayBuilder<BoundStatement>.GetInstance();
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (2)
134foreach (var s in block.Statements) 136for (var stmt = s; stmt != null;)
Lowering\DiagnosticsPass_ExpressionTrees.cs (1)
1078var alternative = node.AlternativeOpt;
Lowering\InitializerRewriter.cs (6)
33var boundStatements = ArrayBuilder<BoundStatement>.GetInstance(boundInitializers.Length); 36BoundStatement lastStatement = null; 82internal static BoundExpression GetTrailingScriptExpression(BoundStatement statement) 89private static BoundStatement RewriteFieldInitializer(BoundFieldEqualsValue fieldInit) 97BoundStatement boundStatement = 119private static BoundStatement RewriteInitializersAsStatements(BoundInitializer initializer)
Lowering\Instrumentation\CodeCoverageInstrumenter.cs (60)
27private readonly BoundStatement _methodBody; 32private readonly BoundStatement? _methodEntryInstrumentation; 41BoundStatement methodBody, 103BoundStatement methodBody, 237public override void InstrumentBlock(BoundBlock original, LocalRewriter rewriter, ref TemporaryArray<LocalSymbol> additionalLocals, out BoundStatement? prologue, out BoundStatement? epilogue, out BoundBlockInstrumentation? instrumentation) 239base.InstrumentBlock(original, rewriter, ref additionalLocals, out var previousPrologue, out epilogue, out instrumentation); 261BoundStatement payloadInitialization = 276BoundStatement createPayloadCall = 296BoundStatement payloadIf = _methodBodyFactory.If(payloadNullTest, createPayloadCall); 300var prologueStatements = ArrayBuilder<BoundStatement>.GetInstance(2 + (_methodEntryInstrumentation != null ? 1 : 0) + (previousPrologue != null ? 1 : 0)); 319public override BoundStatement InstrumentNoOpStatement(BoundNoOpStatement original, BoundStatement rewritten) 324public override BoundStatement InstrumentBreakStatement(BoundBreakStatement original, BoundStatement rewritten) 329public override BoundStatement InstrumentContinueStatement(BoundContinueStatement original, BoundStatement rewritten) 334public override BoundStatement InstrumentExpressionStatement(BoundExpressionStatement original, BoundStatement rewritten) 339public override BoundStatement InstrumentFieldOrPropertyInitializer(BoundStatement original, BoundStatement rewritten) 344public override BoundStatement InstrumentGotoStatement(BoundGotoStatement original, BoundStatement rewritten) 349public override BoundStatement InstrumentThrowStatement(BoundThrowStatement original, BoundStatement rewritten) 354public override BoundStatement InstrumentYieldBreakStatement(BoundYieldBreakStatement original, BoundStatement rewritten) 359public override BoundStatement InstrumentYieldReturnStatement(BoundYieldReturnStatement original, BoundStatement rewritten) 364public override BoundStatement InstrumentForEachStatementIterationVarDeclaration(BoundForEachStatement original, BoundStatement iterationVarDecl) 369public override BoundStatement InstrumentForEachStatementDeconstructionVariablesDeclaration(BoundForEachStatement original, BoundStatement iterationVarDecl) 374public override BoundStatement InstrumentIfStatementConditionalGoto(BoundIfStatement original, BoundStatement rewritten) 379public override BoundStatement InstrumentWhileStatementConditionalGotoStartOrBreak(BoundWhileStatement original, BoundStatement ifConditionGotoStart) 384public override BoundStatement InstrumentUserDefinedLocalInitialization(BoundLocalDeclaration original, BoundStatement rewritten) 389public override BoundStatement InstrumentLockTargetCapture(BoundLockStatement original, BoundStatement lockTargetCapture) 394public override BoundStatement InstrumentReturnStatement(BoundReturnStatement original, BoundStatement rewritten) 432public override BoundStatement InstrumentSwitchStatement(BoundSwitchStatement original, BoundStatement rewritten) 437public override BoundStatement InstrumentSwitchWhenClauseConditionalGotoBody(BoundExpression original, BoundStatement ifConditionGotoBody) 450public override BoundStatement InstrumentUsingTargetCapture(BoundUsingStatement original, BoundStatement usingTargetCapture) 455private BoundStatement AddDynamicAnalysis(BoundStatement original, BoundStatement rewritten) 469private BoundStatement CollectDynamicAnalysis(BoundStatement original, BoundStatement rewritten) 493private BoundStatement AddAnalysisPoint(SyntaxNode syntaxForSpan, Text.TextSpan alternateSpan, SyntheticBoundNodeFactory statementFactory) 498private BoundStatement AddAnalysisPoint(SyntaxNode syntaxForSpan, SyntheticBoundNodeFactory statementFactory) 503private BoundStatement AddAnalysisPoint(SyntaxNode syntaxForSpan, FileLinePositionSpan span, SyntheticBoundNodeFactory statementFactory) 523private static SyntaxNode SyntaxForSpan(BoundStatement statement)
Lowering\Instrumentation\CompoundInstrumenter.cs (56)
39public override BoundStatement InstrumentNoOpStatement(BoundNoOpStatement original, BoundStatement rewritten) 44public override BoundStatement InstrumentYieldBreakStatement(BoundYieldBreakStatement original, BoundStatement rewritten) 49public override BoundStatement InstrumentYieldReturnStatement(BoundYieldReturnStatement original, BoundStatement rewritten) 54public override BoundStatement InstrumentThrowStatement(BoundThrowStatement original, BoundStatement rewritten) 59public override BoundStatement InstrumentContinueStatement(BoundContinueStatement original, BoundStatement rewritten) 64public override BoundStatement InstrumentGotoStatement(BoundGotoStatement original, BoundStatement rewritten) 69public override BoundStatement InstrumentExpressionStatement(BoundExpressionStatement original, BoundStatement rewritten) 74public override BoundStatement InstrumentFieldOrPropertyInitializer(BoundStatement original, BoundStatement rewritten) 79public override BoundStatement InstrumentBreakStatement(BoundBreakStatement original, BoundStatement rewritten) 89public override void InstrumentBlock(BoundBlock original, LocalRewriter rewriter, ref TemporaryArray<LocalSymbol> additionalLocals, out BoundStatement? prologue, out BoundStatement? epilogue, out BoundBlockInstrumentation? instrumentation) 99public override BoundStatement InstrumentDoStatementConditionalGotoStart(BoundDoStatement original, BoundStatement ifConditionGotoStart) 104public override BoundStatement? InstrumentForEachStatementCollectionVarDeclaration(BoundForEachStatement original, BoundStatement? collectionVarDecl) 109public override BoundStatement InstrumentForEachStatement(BoundForEachStatement original, BoundStatement rewritten) 114public override BoundStatement InstrumentForEachStatementIterationVarDeclaration(BoundForEachStatement original, BoundStatement iterationVarDecl) 119public override BoundStatement InstrumentForStatementConditionalGotoStartOrBreak(BoundForStatement original, BoundStatement branchBack) 124public override BoundStatement InstrumentForEachStatementConditionalGotoStart(BoundForEachStatement original, BoundStatement branchBack) 134public override BoundStatement InstrumentIfStatementConditionalGoto(BoundIfStatement original, BoundStatement rewritten) 144public override BoundStatement InstrumentLabelStatement(BoundLabeledStatement original, BoundStatement rewritten) 149public override BoundStatement InstrumentUserDefinedLocalInitialization(BoundLocalDeclaration original, BoundStatement rewritten) 183public override BoundStatement InstrumentLockTargetCapture(BoundLockStatement original, BoundStatement lockTargetCapture) 188public override BoundStatement InstrumentReturnStatement(BoundReturnStatement original, BoundStatement rewritten) 193public override BoundStatement InstrumentSwitchStatement(BoundSwitchStatement original, BoundStatement rewritten) 198public override BoundStatement InstrumentSwitchWhenClauseConditionalGotoBody(BoundExpression original, BoundStatement ifConditionGotoBody) 203public override BoundStatement InstrumentUsingTargetCapture(BoundUsingStatement original, BoundStatement usingTargetCapture) 213public override BoundStatement InstrumentWhileStatementConditionalGotoStartOrBreak(BoundWhileStatement original, BoundStatement ifConditionGotoStart) 237public override BoundExpression InstrumentSwitchStatementExpression(BoundStatement original, BoundExpression rewrittenExpression, SyntheticBoundNodeFactory factory) 247public override BoundStatement InstrumentSwitchBindCasePatternVariables(BoundStatement bindings) 252public override BoundStatement InstrumentForEachStatementDeconstructionVariablesDeclaration(BoundForEachStatement original, BoundStatement iterationVarDecl)
Lowering\Instrumentation\DebugInfoInjector.cs (61)
40public override BoundStatement InstrumentNoOpStatement(BoundNoOpStatement original, BoundStatement rewritten) 45public override BoundStatement InstrumentBreakStatement(BoundBreakStatement original, BoundStatement rewritten) 50public override BoundStatement InstrumentContinueStatement(BoundContinueStatement original, BoundStatement rewritten) 55public override BoundStatement InstrumentExpressionStatement(BoundExpressionStatement original, BoundStatement rewritten) 118public override BoundStatement InstrumentFieldOrPropertyInitializer(BoundStatement original, BoundStatement rewritten) 132private static BoundStatement InstrumentFieldOrPropertyInitializer(BoundStatement rewritten, SyntaxNode syntax) 158public override BoundStatement InstrumentGotoStatement(BoundGotoStatement original, BoundStatement rewritten) 163public override BoundStatement InstrumentThrowStatement(BoundThrowStatement original, BoundStatement rewritten) 168public override BoundStatement InstrumentYieldBreakStatement(BoundYieldBreakStatement original, BoundStatement rewritten) 181public override BoundStatement InstrumentYieldReturnStatement(BoundYieldReturnStatement original, BoundStatement rewritten) 186public override void InstrumentBlock(BoundBlock original, LocalRewriter rewriter, ref TemporaryArray<LocalSymbol> additionalLocals, out BoundStatement? prologue, out BoundStatement? epilogue, out BoundBlockInstrumentation? instrumentation) 188base.InstrumentBlock(original, rewriter, ref additionalLocals, out var previousPrologue, out var previousEpilogue, out instrumentation); 241public override BoundStatement InstrumentDoStatementConditionalGotoStart(BoundDoStatement original, BoundStatement ifConditionGotoStart) 251public override BoundStatement InstrumentWhileStatementConditionalGotoStartOrBreak(BoundWhileStatement original, BoundStatement ifConditionGotoStart) 269public override BoundStatement InstrumentForEachStatementCollectionVarDeclaration(BoundForEachStatement original, BoundStatement? collectionVarDecl) 276public override BoundStatement InstrumentForEachStatementDeconstructionVariablesDeclaration(BoundForEachStatement original, BoundStatement iterationVarDecl) 290public override BoundStatement InstrumentForEachStatement(BoundForEachStatement original, BoundStatement rewritten) 299ImmutableArray.Create<BoundStatement>(foreachKeywordSequencePoint, 311public override BoundStatement InstrumentForEachStatementIterationVarDeclaration(BoundForEachStatement original, BoundStatement iterationVarDecl) 336public override BoundStatement InstrumentForStatementConditionalGotoStartOrBreak(BoundForStatement original, BoundStatement branchBack) 343public override BoundStatement InstrumentForEachStatementConditionalGotoStart(BoundForEachStatement original, BoundStatement branchBack) 358public override BoundStatement InstrumentIfStatementConditionalGoto(BoundIfStatement original, BoundStatement rewritten) 377public override BoundStatement InstrumentLabelStatement(BoundLabeledStatement original, BoundStatement rewritten) 386public override BoundStatement InstrumentUserDefinedLocalInitialization(BoundLocalDeclaration original, BoundStatement rewritten) 394public override BoundStatement InstrumentLockTargetCapture(BoundLockStatement original, BoundStatement lockTargetCapture) 402public override BoundStatement InstrumentReturnStatement(BoundReturnStatement original, BoundStatement rewritten) 423public override BoundStatement InstrumentSwitchStatement(BoundSwitchStatement original, BoundStatement rewritten) 437public override BoundStatement InstrumentSwitchWhenClauseConditionalGotoBody(BoundExpression original, BoundStatement ifConditionGotoBody) 448public override BoundStatement InstrumentUsingTargetCapture(BoundUsingStatement original, BoundStatement usingTargetCapture) 486public override BoundExpression InstrumentSwitchStatementExpression(BoundStatement original, BoundExpression rewrittenExpression, SyntheticBoundNodeFactory factory) 498public override BoundStatement InstrumentSwitchBindCasePatternVariables(BoundStatement bindings)
Lowering\Instrumentation\DebugInfoInjector_SequencePoints.cs (10)
15private static BoundStatement AddSequencePoint(BoundStatement node) 20internal static BoundStatement AddSequencePoint(VariableDeclaratorSyntax declaratorSyntax, BoundStatement rewrittenStatement) 23var result = BoundSequencePoint.Create(declaratorSyntax, part, rewrittenStatement); 28internal static BoundStatement AddSequencePoint(PropertyDeclarationSyntax declarationSyntax, BoundStatement rewrittenStatement) 35var result = BoundSequencePoint.Create(declarationSyntax, part, rewrittenStatement); 40internal static BoundStatement AddSequencePoint(UsingStatementSyntax usingSyntax, BoundStatement rewrittenStatement)
Lowering\Instrumentation\Instrumenter.cs (59)
37private static BoundStatement InstrumentStatement(BoundStatement original, BoundStatement rewritten) 43public virtual BoundStatement InstrumentNoOpStatement(BoundNoOpStatement original, BoundStatement rewritten) 48public virtual BoundStatement InstrumentYieldBreakStatement(BoundYieldBreakStatement original, BoundStatement rewritten) 54public virtual BoundStatement InstrumentYieldReturnStatement(BoundYieldReturnStatement original, BoundStatement rewritten) 74public virtual void InstrumentBlock(BoundBlock original, LocalRewriter rewriter, ref TemporaryArray<LocalSymbol> additionalLocals, out BoundStatement? prologue, out BoundStatement? epilogue, out BoundBlockInstrumentation? instrumentation) 81public virtual BoundStatement InstrumentThrowStatement(BoundThrowStatement original, BoundStatement rewritten) 86public virtual BoundStatement InstrumentContinueStatement(BoundContinueStatement original, BoundStatement rewritten) 91public virtual BoundStatement InstrumentGotoStatement(BoundGotoStatement original, BoundStatement rewritten) 96public virtual BoundStatement InstrumentExpressionStatement(BoundExpressionStatement original, BoundStatement rewritten) 101public virtual BoundStatement InstrumentFieldOrPropertyInitializer(BoundStatement original, BoundStatement rewritten) 107public virtual BoundStatement InstrumentBreakStatement(BoundBreakStatement original, BoundStatement rewritten) 128public virtual BoundStatement InstrumentDoStatementConditionalGotoStart(BoundDoStatement original, BoundStatement ifConditionGotoStart) 135public virtual BoundStatement InstrumentWhileStatementConditionalGotoStartOrBreak(BoundWhileStatement original, BoundStatement ifConditionGotoStart) 143public virtual BoundStatement? InstrumentForEachStatementCollectionVarDeclaration(BoundForEachStatement original, BoundStatement? collectionVarDecl) 150public virtual BoundStatement InstrumentForEachStatement(BoundForEachStatement original, BoundStatement rewritten) 156public virtual BoundStatement InstrumentForEachStatementIterationVarDeclaration(BoundForEachStatement original, BoundStatement iterationVarDecl) 163public virtual BoundStatement InstrumentForEachStatementDeconstructionVariablesDeclaration(BoundForEachStatement original, BoundStatement iterationVarDecl) 170public virtual BoundStatement InstrumentForEachStatementConditionalGotoStart(BoundForEachStatement original, BoundStatement branchBack) 177public virtual BoundStatement InstrumentForStatementConditionalGotoStartOrBreak(BoundForStatement original, BoundStatement branchBack) 192public virtual BoundStatement InstrumentIfStatementConditionalGoto(BoundIfStatement original, BoundStatement rewritten) 206public virtual BoundStatement InstrumentLabelStatement(BoundLabeledStatement original, BoundStatement rewritten) 212public virtual BoundStatement InstrumentUserDefinedLocalInitialization(BoundLocalDeclaration original, BoundStatement rewritten) 256public virtual BoundStatement InstrumentLockTargetCapture(BoundLockStatement original, BoundStatement lockTargetCapture) 263public virtual BoundStatement InstrumentReturnStatement(BoundReturnStatement original, BoundStatement rewritten) 268public virtual BoundStatement InstrumentSwitchStatement(BoundSwitchStatement original, BoundStatement rewritten) 279public virtual BoundStatement InstrumentSwitchWhenClauseConditionalGotoBody(BoundExpression original, BoundStatement ifConditionGotoBody) 286public virtual BoundStatement InstrumentUsingTargetCapture(BoundUsingStatement original, BoundStatement usingTargetCapture) 305public virtual BoundExpression InstrumentSwitchStatementExpression(BoundStatement original, BoundExpression rewrittenExpression, SyntheticBoundNodeFactory factory) 323public virtual BoundStatement InstrumentSwitchBindCasePatternVariables(BoundStatement bindings)
Lowering\Instrumentation\LocalStateTracingInstrumenter.cs (9)
154BoundStatement methodBody, 284public override void InstrumentBlock(BoundBlock original, LocalRewriter rewriter, ref TemporaryArray<LocalSymbol> additionalLocals, out BoundStatement? prologue, out BoundStatement? epilogue, out BoundBlockInstrumentation? instrumentation) 286base.InstrumentBlock(original, rewriter, ref additionalLocals, out var previousPrologue, out epilogue, out instrumentation); 303var prologueBuilder = ArrayBuilder<BoundStatement>.GetInstance(_factory.CurrentFunction.ParameterCount); 344var instrumentationPrologue = (entryLogger != null) ? 348var instrumentationEpilogue = (returnLogger != null) ? 539ImmutableArray.Create<BoundStatement>(logCallStatement, rewrittenFilterPrologue) : 540ImmutableArray.Create<BoundStatement>(logCallStatement));
Lowering\Instrumentation\ModuleCancellationInstrumenter.cs (10)
67public override void InstrumentBlock(BoundBlock original, LocalRewriter rewriter, ref TemporaryArray<LocalSymbol> additionalLocals, out BoundStatement? prologue, out BoundStatement? epilogue, out BoundBlockInstrumentation? instrumentation) 97private BoundStatement InstrumentStatement(BoundStatement statement) 109public override BoundStatement InstrumentForStatementConditionalGotoStartOrBreak(BoundForStatement original, BoundStatement branchBack) 112public override BoundStatement InstrumentForEachStatementConditionalGotoStart(BoundForEachStatement original, BoundStatement branchBack) 115public override BoundStatement InstrumentGotoStatement(BoundGotoStatement original, BoundStatement rewritten)
Lowering\Instrumentation\StackOverflowProbingInstrumenter.cs (2)
57public override void InstrumentBlock(BoundBlock original, LocalRewriter rewriter, ref TemporaryArray<LocalSymbol> additionalLocals, out BoundStatement? prologue, out BoundStatement? epilogue, out BoundBlockInstrumentation? instrumentation)
Lowering\IteratorRewriter\IteratorMethodToStateMachineRewriter.cs (12)
84internal void GenerateMoveNextAndDispose(BoundStatement body, SynthesizedImplementationMethod moveNextMethod, SynthesizedImplementationMethod disposeMethod) 100var newBody = (BoundStatement)Visit(body); 188private BoundBlock HandleReturn(BoundStatement newBody) 259private BoundStatement EmitFinallyFrame(IteratorFinallyFrame frame, BoundLocal state) 261BoundStatement body = null; 290protected override BoundStatement GenerateReturn(bool finished) 389var rewrittenBody = (BoundStatement)this.Visit(node.TryBlock); 399var rewrittenHandler = (BoundStatement)this.Visit(node.FinallyBlockOpt); 422var bodyStatements = ArrayBuilder<BoundStatement>.GetInstance();
Lowering\IteratorRewriter\IteratorMethodToStateMachineRewriter.YieldsInTryAnalysis.cs (1)
28public YieldsInTryAnalysis(BoundStatement body)
Lowering\IteratorRewriter\IteratorRewriter.cs (7)
30BoundStatement body, 49internal static BoundStatement Rewrite( 50BoundStatement body, 280var bodyBuilder = ArrayBuilder<BoundStatement>.GetInstance(); 301protected override void InitializeStateMachine(ArrayBuilder<BoundStatement> bodyBuilder, NamedTypeSymbol frameType, LocalSymbol stateMachineLocal) 312protected override BoundStatement GenerateStateMachineCreation(LocalSymbol stateMachineVariable, NamedTypeSymbol frameType, IReadOnlyDictionary<Symbol, CapturedSymbolReplacement> proxies) 314var bodyBuilder = ArrayBuilder<BoundStatement>.GetInstance();
Lowering\LocalRewriter\LocalRewriter.cs (25)
51private readonly BoundStatement _rootStatement; 59BoundStatement rootStatement, 84public static BoundStatement Rewrite( 89BoundStatement statement, 146var loweredStatement = localRewriter.VisitStatement(statement); 156var spilledStatement = SpillSequenceSpiller.Rewrite(loweredStatement, method, compilationState, diagnostics); 183internal BoundStatement CurrentMethodBody 233private BoundStatement? VisitStatement(BoundStatement? node) 241return (BoundStatement?)node.Accept(this); 696private BoundStatement? RewriteFieldOrPropertyInitializer(BoundStatement initializer) 713var statement = RewriteExpressionStatement((BoundExpressionStatement)block.Statements.Single(), suppressInstrumentation: true); 724var statement = RewriteExpressionStatement((BoundExpressionStatement)initializer, suppressInstrumentation: true); 747ImmutableArray<BoundStatement> originalStatements = node.Statements; 748var statements = ArrayBuilder<BoundStatement?>.GetInstance(node.Statements.Length); 749foreach (var initializer in originalStatements) 778ImmutableArray<BoundStatement> rewrittenStatements; 783rewrittenStatements = ImmutableArray<BoundStatement>.Empty; 792BoundStatement? rewritten = statements[i]; 798BoundStatement original = originalStatements[i]; 861internal static bool IsFieldOrPropertyInitializer(BoundStatement initializer) 885initializer = (BoundStatement)block.Statements.First(); 907private static bool ShouldOptimizeOutInitializer(BoundStatement initializer) 909BoundStatement statement = initializer;
Lowering\LocalRewriter\LocalRewriter.DecisionDagRewriter.cs (13)
32protected abstract ArrayBuilder<BoundStatement> BuilderForSection(SyntaxNode section); 38private ArrayBuilder<BoundStatement> _loweredDecisionDag; 340ArrayBuilder<BoundStatement> result, 369protected ImmutableArray<BoundStatement> LowerDecisionDagCore(BoundDecisionDag decisionDag) 371_loweredDecisionDag = ArrayBuilder<BoundStatement>.GetInstance(); 1063ArrayBuilder<BoundStatement> sectionBuilder = BuilderForSection(whenNode.Syntax); 1094ArrayBuilder<BoundStatement> sectionBuilder = BuilderForSection(whenClauseSyntax); 1113BoundStatement jumps = _factory.Switch(_factory.Local(_whenNodeIdentifierLocal), whenFalseSwitchSections.ToImmutableAndFree()); 1123void addConditionalGoto(BoundExpression whenExpression, SyntaxNode whenClauseSyntax, LabelSymbol whenTrueLabel, ArrayBuilder<BoundStatement> sectionBuilder) 1126BoundStatement conditionalGoto = _factory.ConditionalGoto(_localRewriter.VisitExpression(whenExpression), whenTrueLabel, jumpIfTrue: true); 1155ArrayBuilder<BoundStatement> sectionBuilder = BuilderForSection(whenClause.Syntax); 1167BoundStatement jump = _factory.Goto(GetDagNodeLabel(whenFalse)); 1177void lowerBindings(ImmutableArray<BoundPatternBinding> bindings, ArrayBuilder<BoundStatement> sectionBuilder)
Lowering\LocalRewriter\LocalRewriter_BasePatternSwitchLocalRewriter.cs (7)
25private readonly PooledDictionary<SyntaxNode, ArrayBuilder<BoundStatement>> _switchArms = PooledDictionary<SyntaxNode, ArrayBuilder<BoundStatement>>.GetInstance(); 27protected override ArrayBuilder<BoundStatement> BuilderForSection(SyntaxNode whenClauseSyntax) 32bool found = _switchArms.TryGetValue(sectionSyntax, out ArrayBuilder<BoundStatement>? result); 48var armBuilder = ArrayBuilder<BoundStatement>.GetInstance(); 68protected (ImmutableArray<BoundStatement> loweredDag, ImmutableDictionary<SyntaxNode, ImmutableArray<BoundStatement>> switchSections) LowerDecisionDag(BoundDecisionDag decisionDag)
Lowering\LocalRewriter\LocalRewriter_Block.cs (14)
21var builder = ArrayBuilder<BoundStatement>.GetInstance(); 40Instrumenter.InstrumentBlock(node, this, ref additionalLocals, out var prologue, out var epilogue, out instrumentation); 76/// <returns>An <see cref="ImmutableArray{T}"/> of <see cref="BoundStatement"/></returns> 77public void VisitStatementSubList(ArrayBuilder<BoundStatement> builder, ImmutableArray<BoundStatement> statements, int startIndex = 0) 81BoundStatement? statement = VisitPossibleUsingDeclaration(statements[i], statements, i, out var replacedUsingDeclarations); 101/// <returns>A <see cref="BoundStatement"/></returns> 107public BoundStatement? VisitPossibleUsingDeclaration(BoundStatement node, ImmutableArray<BoundStatement> statements, int statementIndex, out bool replacedLocalDeclarations) 116ArrayBuilder<BoundStatement> builder = ArrayBuilder<BoundStatement>.GetInstance(); 130? new BoundBlock(node.Syntax, ImmutableArray<LocalSymbol>.Empty, ImmutableArray<BoundStatement>.Empty)
Lowering\LocalRewriter\LocalRewriter_BreakStatement.cs (1)
15BoundStatement result = new BoundGotoStatement(node.Syntax, node.Label, node.HasErrors);
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (6)
1257var statements = builder.SelectAsArray(expr => (BoundStatement)new BoundExpressionStatement(expr.Syntax, expr)); 1325Func<BoundStatement, BoundStatement> rewriteBody) 1331var iteratorBody = node.IteratorBody; 1345var rewrittenBody = rewriteBody(iteratorBody); 1352BoundStatement statement;
Lowering\LocalRewriter\LocalRewriter_ContinueStatement.cs (1)
15BoundStatement result = new BoundGotoStatement(node.Syntax, node.Label, node.HasErrors);
Lowering\LocalRewriter\LocalRewriter_DoStatement.cs (3)
20var rewrittenBody = VisitStatement(node.Body); 33BoundStatement ifConditionGotoStart = new BoundConditionalGoto(syntax, rewrittenCondition, true, startLabel); 69ImmutableArray.Create<BoundStatement>(rewrittenBody,
Lowering\LocalRewriter\LocalRewriter_ExpressionStatement.cs (2)
21private BoundStatement? RewriteExpressionStatement(BoundExpressionStatement node, bool suppressInstrumentation = false) 31BoundStatement result = node.Update(loweredExpression);
Lowering\LocalRewriter\LocalRewriter_FixedStatement.cs (15)
25var statementBuilder = ArrayBuilder<BoundStatement>.GetInstance(numFixedLocals + 1 + 1); //+1 for body, +1 for hidden seq point 26var cleanup = new BoundStatement[numFixedLocals]; 48BoundStatement? rewrittenBody = VisitStatement(node.Body); 194private BoundStatement InitializeFixedStatementLocal( 232private BoundStatement InitializeFixedStatementRegularLocal( 272BoundStatement pinnedTempInit = factory.Assignment(factory.Local(pinnedTemp), initializerExpr, isRef: true); 284BoundStatement localInit = InstrumentLocalDeclarationIfNecessary(localDecl, localSymbol, 299private BoundStatement InitializeFixedStatementGetPinnable( 421BoundStatement localInit = InstrumentLocalDeclarationIfNecessary(localDecl, localSymbol, factory.Assignment(factory.Local(localSymbol), pinAndGetPtr)); 434private BoundStatement InitializeFixedStatementStringLocal( 460BoundStatement stringTempInit = factory.Assignment(factory.Local(pinnedTemp), initializerExpr); 470BoundStatement localInit = InstrumentLocalDeclarationIfNecessary(localDecl, localSymbol, 487BoundStatement conditionalAdd = factory.If(notNullCheck, factory.Assignment(factory.Local(localSymbol), addition)); 503private BoundStatement InitializeFixedStatementArrayLocal( 570BoundStatement localInit = factory.ExpressionStatement(
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (70)
113private BoundStatement RewriteEnumeratorForEachStatement(BoundForEachStatement node) 118BoundStatement? rewrittenBody = VisitStatement(node.Body); 135private BoundStatement RewriteForEachEnumerator( 146BoundStatement rewrittenBody) 187BoundStatement enumeratorVarDecl = MakeLocalDeclaration(forEachSyntax, enumeratorVar, enumeratorVarInitValue); 206BoundStatement iterationVarDecl = LocalOrDeconstructionDeclaration(forEachSyntax, deconstruction, iterationVariables, iterationVarAssignValue); 237BoundStatement whileLoop = RewriteWhileStatement( 245BoundStatement result; 258BoundStatement tryFinally = new BoundTryStatement( 270statements: ImmutableArray.Create<BoundStatement>(enumeratorVarDecl, tryFinally)); 282statements: ImmutableArray.Create<BoundStatement>(enumeratorVarDecl, whileLoop)); 374BoundStatement disposeCallStatement; 389BoundStatement alwaysOrMaybeDisposeStmt; 442BoundStatement disposableVarDecl = MakeLocalDeclaration(forEachSyntax, disposableVar, disposableVarInitValue); 446BoundStatement disposeCallStatement = new BoundExpressionStatement(forEachSyntax, expression: disposeCall); 449BoundStatement ifStmt = RewriteIfStatement( 475private BoundStatement WrapWithAwait(SyntaxNode forEachSyntax, BoundExpression disposeCall, BoundAwaitableInfo disposeAwaitableInfoOpt) 568private BoundStatement RewriteForEachStatementAsFor<TArg>(BoundForEachStatement node, GetForEachStatementAsForPreamble? getPreamble, GetForEachStatementAsForItem<TArg> getItem, GetForEachStatementAsForLength<TArg> getLength, TArg arg) 572BoundStatement? rewrittenBody = VisitStatement(node.Body); 593private BoundStatement RewriteForEachStatementAsFor<TArg>( 607BoundStatement rewrittenBody) 620BoundStatement? collectionVarInitializationPreamble = getPreamble?.Invoke(this, forEachSyntax, enumeratorInfo, ref rewrittenExpression, out preambleLocal, out collectionTempRefKind); 626BoundStatement arrayVarDecl = MakeLocalDeclaration(forEachSyntax, collectionTemp, rewrittenExpression); 645BoundStatement positionVarDecl = MakeLocalDeclaration(forEachSyntax, positionVar, 655BoundStatement iterationVariableDecl = LocalOrDeconstructionDeclaration(forEachSyntax, deconstructionOpt, iterationVariables, iterationVarInitValue); 659BoundStatement initializer = new BoundStatementList(forEachSyntax, 660statements: ImmutableArray.Create<BoundStatement>(arrayVarDecl, positionVarDecl)); 678BoundStatement positionIncrement = MakePositionIncrement(forEachSyntax, boundPositionVar, intType); 685BoundStatement loopBody = CreateBlockDeclaringIterationVariables(iterationVariables, iterationVariableDecl, rewrittenBody, forEachSyntax); 691BoundStatement result = RewriteForStatementWithoutInnerLocals( 707private delegate BoundStatement? GetForEachStatementAsForPreamble(LocalRewriter rewriter, SyntaxNode syntax, ForEachEnumeratorInfo enumeratorInfo, ref BoundExpression rewrittenExpression, out LocalSymbol? preambleLocal, out RefKind collectionTempRefKind); 711private BoundStatement RewriteForEachStatementAsFor(BoundForEachStatement node, MethodSymbol indexerGet, MethodSymbol lengthGet) 735private BoundStatement RewriteInlineArrayForEachStatementAsFor(BoundForEachStatement node) 750BoundStatement? collectionVarInitializationPreamble = null; 809private BoundStatement LocalOrDeconstructionDeclaration( 815BoundStatement iterationVarDecl; 839BoundStatement iteratorVariableInitialization, 840BoundStatement rewrittenBody, 874private BoundStatement RewriteSingleDimensionalArrayForEachStatement(BoundForEachStatement node) 879BoundStatement? rewrittenBody = VisitStatement(node.Body); 894private BoundStatement RewriteSingleDimensionalArrayForEachEnumerator( 903BoundStatement rewrittenBody) 920BoundStatement arrayVarDecl = MakeLocalDeclaration(forEachSyntax, arrayVar, rewrittenExpression); 934BoundStatement positionVarDecl = MakeLocalDeclaration(forEachSyntax, positionVar, 948BoundStatement iterationVariableDecl = LocalOrDeconstructionDeclaration(forEachSyntax, deconstruction, iterationVariables, iterationVarInitValue); 952BoundStatement initializer = new BoundStatementList(forEachSyntax, 953statements: ImmutableArray.Create<BoundStatement>(arrayVarDecl, positionVarDecl)); 974BoundStatement positionIncrement = MakePositionIncrement(forEachSyntax, boundPositionVar, intType); 981BoundStatement loopBody = CreateBlockDeclaringIterationVariables(iterationVariables, iterationVariableDecl, rewrittenBody, forEachSyntax); 987BoundStatement result = RewriteForStatementWithoutInnerLocals( 1023private BoundStatement RewriteMultiDimensionalArrayForEachStatement(BoundForEachStatement node) 1028BoundStatement? rewrittenBody = VisitStatement(node.Body); 1043private BoundStatement RewriteMultiDimensionalArrayForEachEnumerator( 1052BoundStatement rewrittenBody) 1077BoundStatement arrayVarDecl = MakeLocalDeclaration(forEachSyntax, arrayVar, rewrittenExpression); 1089BoundStatement[] upperVarDecl = new BoundStatement[rank]; 1128BoundStatement iterationVarDecl = LocalOrDeconstructionDeclaration(forEachSyntax, deconstruction, iterationVariables, iterationVarInitValue); 1137BoundStatement innermostLoopBody = CreateBlockDeclaringIterationVariables(iterationVariables, iterationVarDecl, rewrittenBody, forEachSyntax); 1147BoundStatement? forLoop = null; 1159BoundStatement positionVarDecl = MakeLocalDeclaration(forEachSyntax, positionVar[dimension], currentDimensionLowerBound); 1178BoundStatement positionIncrement = MakePositionIncrement(forEachSyntax, boundPositionVar[dimension], intType); 1180BoundStatement body; 1209BoundStatement result = new BoundBlock( 1240private BoundStatement MakeLocalDeclaration(CSharpSyntaxNode syntax, LocalSymbol local, BoundExpression rewrittenInitialValue) 1242var result = RewriteLocalDeclaration( 1252private BoundStatement MakePositionIncrement(CSharpSyntaxNode syntax, BoundLocal boundPositionVar, TypeSymbol intType) 1275private void InstrumentForEachStatementCollectionVarDeclaration(BoundNode node, [NotNullIfNotNull(nameof(collectionVarDecl))] ref BoundStatement? collectionVarDecl) 1283private void InstrumentForEachStatementIterationVarDeclaration(BoundNode node, ref BoundStatement iterationVarDecl) 1299private void InstrumentForEachStatement(BoundNode node, ref BoundStatement result)
Lowering\LocalRewriter\LocalRewriter_ForStatement.cs (18)
19var rewrittenInitializer = VisitStatement(node.Initializer); 21var rewrittenIncrement = VisitStatement(node.Increment); 22var rewrittenBody = VisitStatement(node.Body); 40private BoundStatement RewriteForStatementWithoutInnerLocals( 43BoundStatement? rewrittenInitializer, 45BoundStatement? rewrittenIncrement, 46BoundStatement rewrittenBody, 74var statementBuilder = ArrayBuilder<BoundStatement>.GetInstance(); 104BoundStatement gotoEnd = new BoundGotoStatement(syntax, endLabel); 134BoundStatement? branchBack = null; 172private BoundStatement RewriteForStatement( 174BoundStatement? rewrittenInitializer, 176BoundStatement? rewrittenIncrement, 177BoundStatement rewrittenBody) 216var statementBuilder = ArrayBuilder<BoundStatement>.GetInstance(); 227BoundStatement startLabelStatement = new BoundLabelStatement(syntax, startLabel); 236var blockBuilder = ArrayBuilder<BoundStatement>.GetInstance(); 241BoundStatement ifNotConditionGotoBreak = new BoundConditionalGoto(rewrittenCondition.Syntax, rewrittenCondition, false, node.BreakLabel);
Lowering\LocalRewriter\LocalRewriter_GotoStatement.cs (1)
24BoundStatement result = node.Update(node.Label, caseExpressionOpt, labelExpressionOpt);
Lowering\LocalRewriter\LocalRewriter_IfStatement.cs (6)
19var builder = ArrayBuilder<BoundStatement>.GetInstance(); 24var rewrittenConsequence = VisitStatement(node.Consequence); 35BoundStatement? rewrittenAlternative = null; 119private static BoundStatement RewriteIfStatement( 122BoundStatement rewrittenConsequence, 126var builder = ArrayBuilder<BoundStatement>.GetInstance();
Lowering\LocalRewriter\LocalRewriter_IsPatternOperator.cs (5)
93private readonly ArrayBuilder<BoundStatement> _statements = ArrayBuilder<BoundStatement>.GetInstance(); 101protected override ArrayBuilder<BoundStatement> BuilderForSection(SyntaxNode section) => _statements; 112var resultBuilder = ArrayBuilder<BoundStatement>.GetInstance(); 117ImmutableArray<BoundStatement> loweredDag = LowerDecisionDagCore(decisionDag);
Lowering\LocalRewriter\LocalRewriter_LabeledStatement.cs (4)
18var rewrittenBody = VisitStatement(node.Body); 22private BoundStatement MakeLabeledStatement(BoundLabeledStatement node, BoundStatement? rewrittenBody) 24BoundStatement labelStatement = new BoundLabelStatement(node.Syntax, node.Label);
Lowering\LocalRewriter\LocalRewriter_LocalDeclaration.cs (4)
19private BoundStatement? RewriteLocalDeclaration(BoundLocalDeclaration? originalOpt, SyntaxNode syntax, LocalSymbol localSymbol, BoundExpression? rewrittenInitializer, bool hasErrors = false) 55BoundStatement rewrittenLocalDeclaration = new BoundExpressionStatement( 72private BoundStatement InstrumentLocalDeclarationIfNecessary(BoundLocalDeclaration? originalOpt, LocalSymbol localSymbol, BoundStatement rewrittenLocalDeclaration)
Lowering\LocalRewriter\LocalRewriter_LockStatement.cs (10)
27BoundStatement? rewrittenBody = VisitStatement(node.Body); 69BoundStatement tryFinally = RewriteUsingStatementTryFinally( 102BoundStatement boundLockTempInit = new BoundExpressionStatement(lockSyntax, assignmentToLockTemp); 120BoundStatement exitCall = new BoundExpressionStatement(lockSyntax, exitCallExpr); 150BoundStatement boundLockTakenTempInit = new BoundExpressionStatement(lockSyntax, assignmentToLockTakenTemp); 152BoundStatement enterCall = new BoundExpressionStatement( 176BoundBlock.SynthesizedNoLocals(lockSyntax, ImmutableArray.Create<BoundStatement>( 215BoundStatement enterCall = new BoundExpressionStatement( 233private BoundStatement InstrumentLockTargetCapture(BoundLockStatement original, BoundStatement lockTargetCapture)
Lowering\LocalRewriter\LocalRewriter_MultipleLocalDeclarations.cs (3)
26ArrayBuilder<BoundStatement>? inits = null; 36inits = ArrayBuilder<BoundStatement>.GetInstance(); 39inits.Add((BoundStatement)init);
Lowering\LocalRewriter\LocalRewriter_PatternSwitchStatement.cs (9)
28public static BoundStatement Rewrite(LocalRewriter localRewriter, BoundSwitchStatement node) 31BoundStatement result = rewriter.LowerSwitchStatement(node); 71private BoundStatement LowerSwitchStatement(BoundSwitchStatement node) 74var result = ArrayBuilder<BoundStatement>.GetInstance(); 115(ImmutableArray<BoundStatement> loweredDag, ImmutableDictionary<SyntaxNode, ImmutableArray<BoundStatement>> switchSections) = 133var sectionBuilder = ArrayBuilder<BoundStatement>.GetInstance(); 145ImmutableArray<BoundStatement> statements = sectionBuilder.ToImmutableAndFree(); 174BoundStatement translatedSwitch = _factory.Block(outerVariables.ToImmutableAndFree(), node.InnerLocalFunctions, result.ToImmutableAndFree());
Lowering\LocalRewriter\LocalRewriter_ReturnStatement.cs (2)
15BoundStatement rewritten = (BoundStatement)base.VisitReturnStatement(node)!;
Lowering\LocalRewriter\LocalRewriter_StringInterpolation.cs (4)
127var appendCallsStatements = resultExpressions.SelectAsArray(static (appendCall, @this) => (BoundStatement)@this._factory.ExpressionStatement(appendCall), this); 131var resultIf = _factory.If(appendShouldProceedLocal, _factory.StatementList(appendCallsStatements)); 257private readonly ImmutableArray<BoundStatement> _statements; 264public InterpolationHandlerResult(ImmutableArray<BoundStatement> statements, BoundLocal handlerTemp, LocalSymbol outTemp, LocalRewriter rewriter)
Lowering\LocalRewriter\LocalRewriter_SwitchExpression.cs (7)
49var result = ArrayBuilder<BoundStatement>.GetInstance(); 63(ImmutableArray<BoundStatement> loweredDag, ImmutableDictionary<SyntaxNode, ImmutableArray<BoundStatement>> switchSections) = 94var sectionBuilder = ArrayBuilder<BoundStatement>.GetInstance(); 156private static BoundStatement ConstructThrowSwitchExpressionExceptionHelperCall(SyntheticBoundNodeFactory factory, BoundExpression unmatchedValue) 171private static BoundStatement ConstructThrowSwitchExpressionExceptionParameterlessHelperCall(SyntheticBoundNodeFactory factory) 185private static BoundStatement ConstructThrowInvalidOperationExceptionHelperCall(SyntheticBoundNodeFactory factory)
Lowering\LocalRewriter\LocalRewriter_ThrowStatement.cs (2)
11var result = (BoundStatement)base.VisitThrowStatement(node)!;
Lowering\LocalRewriter\LocalRewriter_TryStatement.cs (2)
47private static bool HasSideEffects([NotNullWhen(true)] BoundStatement? statement) 57foreach (var stmt in block.Statements)
Lowering\LocalRewriter\LocalRewriter_UsingStatement.cs (17)
37BoundStatement? rewrittenBody = VisitStatement(node.Body); 62private BoundStatement MakeDeclarationUsingStatement(SyntaxNode syntax, 83ImmutableArray.Create<BoundStatement>(result)); 89private BoundStatement MakeLocalUsingDeclarationStatement(BoundUsingLocalDeclarations usingDeclarations, ImmutableArray<BoundStatement> statements) 94var usingStatement = MakeDeclarationUsingStatement(syntax, 184BoundStatement expressionStatement = new BoundExpressionStatement(expressionSyntax, tempAssignment); 190BoundStatement tryFinally = RewriteUsingStatementTryFinally(usingSyntax, usingSyntax, tryBlock, boundTemp, usingSyntax.AwaitKeyword, node.AwaitOpt, node.PatternDisposeInfoOpt); 196statements: ImmutableArray.Create<BoundStatement>(expressionStatement, tryFinally)); 223BoundStatement? rewrittenDeclaration = VisitStatement(localDeclaration); 254BoundStatement tryFinally = RewriteUsingStatementTryFinally(usingSyntax, declarationSyntax, tryBlock, boundTemp, awaitKeywordOpt, awaitOpt, patternDisposeInfo); 259statements: ImmutableArray.Create<BoundStatement>( 266BoundStatement tryFinally = RewriteUsingStatementTryFinally(usingSyntax, declarationSyntax, tryBlock, boundLocal, awaitKeywordOpt, awaitOpt, patternDisposeInfo); 279private BoundStatement RewriteUsingStatementTryFinally( 376BoundStatement disposeStatement = new BoundExpressionStatement(resourceSyntax, disposeCall); 395BoundStatement finallyStatement; 419BoundStatement tryFinally = new BoundTryStatement(
Lowering\LocalRewriter\LocalRewriter_WhileStatement.cs (9)
21var rewrittenBody = VisitStatement(node.Body); 41private BoundStatement RewriteWhileStatement( 44BoundStatement rewrittenBody, 67BoundStatement ifConditionGotoStart = new BoundConditionalGoto(rewrittenCondition.Syntax, rewrittenCondition, true, startLabel); 68BoundStatement gotoContinue = new BoundGotoStatement(syntax, continueLabel); 106private BoundStatement RewriteWhileStatement( 110BoundStatement rewrittenBody, 137BoundStatement continueLabelStatement = new BoundLabelStatement(syntax, continueLabel); 138BoundStatement ifNotConditionGotoBreak = new BoundConditionalGoto(rewrittenCondition.Syntax, rewrittenCondition, false, breakLabel);
Lowering\LocalRewriter\LocalRewriter_Yield.cs (4)
15var result = (BoundStatement)base.VisitYieldBreakStatement(node)!; 31var result = (BoundStatement)base.VisitYieldReturnStatement(node)!;
Lowering\MethodToClassRewriter.cs (12)
176var initializer = (BoundStatement?)this.Visit(node.Initializer); 179var increment = (BoundStatement?)this.Visit(node.Increment); 180var body = (BoundStatement)this.Visit(node.Body); 188BoundStatement body = (BoundStatement)this.Visit(node.Body); 196BoundStatement body = (BoundStatement)this.Visit(node.Body); 205var body = (BoundStatement)this.Visit(node.Body);
Lowering\SpillSequenceSpiller.cs (18)
42private ArrayBuilder<BoundStatement> _statements; 72public ImmutableArray<BoundStatement> GetStatements() 76return ImmutableArray<BoundStatement>.Empty; 140public void AddStatement(BoundStatement statement) 144_statements = ArrayBuilder<BoundStatement>.GetInstance(); 150public void AddStatements(ImmutableArray<BoundStatement> statements) 152foreach (var statement in statements) 232internal static BoundStatement Rewrite(BoundStatement body, MethodSymbol method, TypeCompilationState compilationState, BindingDiagnosticBag diagnostics) 241return (BoundStatement)result; 282private BoundStatement UpdateStatement(BoundSpillSequenceBuilder builder, BoundStatement statement) 731Debug.Assert(!(node is BoundStatement)); 1325var whenNotNullStatement = UpdateStatement(whenNotNullBuilder, _F.ExpressionStatement(whenNotNull)); 1337var whenNotNullStatement = UpdateStatement(whenNotNullBuilder, _F.Assignment(_F.Local(tmp), whenNotNull)); 1369public static BoundStatement Replace(BoundNode node, BoundExpression receiver, int receiverID, int recursionDepth) 1372var result = (BoundStatement)replacer.Visit(node);
Lowering\StateMachineRewriter\IteratorAndAsyncCaptureWalker.cs (1)
325protected override void VisitFinallyBlock(BoundStatement finallyBlock, ref LocalState unsetInFinally)
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (16)
173protected abstract BoundStatement GenerateReturn(bool finished); 246protected BoundStatement Dispatch(bool isOutermost) 252var result = F.Switch(F.Local(cachedState), sections.ToImmutableArray()); 262var missingStateDispatch = GenerateMissingStateDispatch(); 272protected virtual BoundStatement? GenerateMissingStateDispatch() 297private BoundStatement PossibleIteratorScope(ImmutableArray<LocalSymbol> locals, Func<BoundStatement> wrapped) 343var translatedStatement = wrapped(); 384F.Block(variableCleanup.SelectAsArray((e, f) => (BoundStatement)f.ExpressionStatement(e), F))); 403internal BoundBlock MakeStateMachineScope(ImmutableArray<StateMachineFieldSymbol> hoistedLocals, BoundStatement statement) 411internal static bool TryUnwrapBoundStateMachineScope(ref BoundStatement statement, out ImmutableArray<StateMachineFieldSymbol> hoistedLocals) 455var result = F.Block(variableCleanup.SelectAsArray((e, f) => (BoundStatement)f.ExpressionStatement(e), F)); 776BoundStatement translated; 882BoundBlock tryBlock = F.Block((BoundStatement)this.Visit(node.TryBlock)); 909BoundStatement result = node.Update(tryBlock, catchBlocks, finallyBlockOpt, node.FinallyLabelOpt, node.PreferFaultHandler); 941protected BoundStatement CacheThisIfNeeded()
Lowering\StateMachineRewriter\ResumableStateMachineStateAllocator.cs (1)
80public BoundStatement? GenerateThrowMissingStateDispatch(SyntheticBoundNodeFactory f, BoundExpression cachedState, HotReloadExceptionCode errorCode)
Lowering\StateMachineRewriter\StateMachineRewriter.cs (15)
19protected readonly BoundStatement body; 38BoundStatement body, 81protected abstract void InitializeStateMachine(ArrayBuilder<BoundStatement> bodyBuilder, NamedTypeSymbol frameType, LocalSymbol stateMachineLocal); 86protected abstract BoundStatement GenerateStateMachineCreation(LocalSymbol stateMachineVariable, NamedTypeSymbol frameType, IReadOnlyDictionary<Symbol, CapturedSymbolReplacement> proxies); 93protected BoundStatement Rewrite() 287private BoundStatement GenerateKickoffMethodBody() 290var bodyBuilder = ArrayBuilder<BoundStatement>.GetInstance(); 306protected BoundStatement GenerateParameterStorage(LocalSymbol stateMachineVariable, IReadOnlyDictionary<Symbol, CapturedSymbolReplacement> proxies) 308var bodyBuilder = ArrayBuilder<BoundStatement>.GetInstance(); 425var bodyBuilder = ArrayBuilder<BoundStatement>.GetInstance(); 429BoundStatement makeIterator = F.Assignment(F.Local(resultVariable), F.New(stateMachineType.Constructor, F.Literal(initialState))); 437var thenBuilder = ArrayBuilder<BoundStatement>.GetInstance(4); 498BoundStatement copy = InitializeParameterField(getEnumeratorMethod, parameter, resultParameter, parameterProxy); 512protected virtual void GenerateResetInstance(ArrayBuilder<BoundStatement> builder, StateMachineState initialState) 519protected virtual BoundStatement InitializeParameterField(MethodSymbol getEnumeratorMethod, ParameterSymbol parameter, BoundExpression resultParameter, BoundExpression parameterProxy)
Lowering\SyntheticBoundNodeFactory.cs (45)
445return Block(ImmutableArray<BoundStatement>.Empty); 448public BoundBlock Block(ImmutableArray<BoundStatement> statements) 453public BoundBlock Block(params BoundStatement[] statements) 458public BoundBlock Block(ImmutableArray<LocalSymbol> locals, params BoundStatement[] statements) 463public BoundBlock Block(ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundStatement> statements) 468public BoundBlock Block(ImmutableArray<LocalSymbol> locals, ImmutableArray<LocalFunctionSymbol> localFunctions, params BoundStatement[] statements) 473public BoundBlock Block(ImmutableArray<LocalSymbol> locals, ImmutableArray<LocalFunctionSymbol> localFunctions, ImmutableArray<BoundStatement> statements) 485return StatementList(ImmutableArray<BoundStatement>.Empty); 488public BoundStatementList StatementList(ImmutableArray<BoundStatement> statements) 493public BoundStatementList StatementList(BoundStatement first, BoundStatement second) 499public BoundStatement? Concat(BoundStatement? first, BoundStatement? second) 502public BoundBlockInstrumentation CombineInstrumentation(BoundBlockInstrumentation? innerInstrumentation = null, LocalSymbol? local = null, BoundStatement? prologue = null, BoundStatement? epilogue = null) 517public BoundStatement Instrument(BoundStatement statement, BoundBlockInstrumentation? instrumentation) 524var statements = new TemporaryArray<BoundStatement>(); 569public void CloseMethod(BoundStatement body) 914public BoundStatement If(BoundExpression condition, BoundStatement thenClause, BoundStatement? elseClauseOpt = null) 919public BoundStatement ConditionalGoto(BoundExpression condition, LabelSymbol label, bool jumpIfTrue) 924public BoundStatement If(BoundExpression condition, ImmutableArray<LocalSymbol> locals, BoundStatement thenClause, BoundStatement? elseClauseOpt = null) 939var statements = ArrayBuilder<BoundStatement>.GetInstance(); 1033public BoundSpillSequence SpillSequence(ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundStatement> sideEffects, BoundExpression result) 1045public readonly ImmutableArray<BoundStatement> Statements; 1047public SyntheticSwitchSection(ImmutableArray<int> values, ImmutableArray<BoundStatement> statements) 1054public SyntheticSwitchSection SwitchSection(int value, params BoundStatement[] statements) 1057public SyntheticSwitchSection SwitchSection(ImmutableArray<int> values, params BoundStatement[] statements) 1063public BoundStatement Switch(BoundExpression ex, ImmutableArray<SyntheticSwitchSection> sections) 1077var statements = ArrayBuilder<BoundStatement>.GetInstance(); 1183public BoundStatement BaseInitialization() 1192public BoundStatement SequencePoint(SyntaxNode syntax, BoundStatement statement) 1197public BoundStatement SequencePointWithSpan(CSharpSyntaxNode syntax, TextSpan span, BoundStatement statement) 1202public BoundStatement HiddenSequencePoint(BoundStatement? statementOpt = null) 1207public BoundStatement ThrowNull() 1575internal BoundStatement Try( 1705internal BoundStatement NoOp(NoOpStatementFlavor noOpStatementFlavor)
Operations\CSharpOperationFactory.cs (5)
1753ImmutableArray<IOperation> operations = CreateFromArray<BoundStatement, IOperation>(boundBlock.Statements); 1811var alternative = boundIfStatement.AlternativeOpt; 1874ImmutableArray<IOperation> before = CreateFromArray<BoundStatement, IOperation>(ToStatements(boundForStatement.Initializer)); 1876ImmutableArray<IOperation> atLoopBottom = CreateFromArray<BoundStatement, IOperation>(ToStatements(boundForStatement.Increment)); 2698ImmutableArray<IOperation> body = CreateFromArray<BoundStatement, IOperation>(boundSwitchSection.Statements);
Operations\CSharpOperationFactory_Methods.cs (3)
18internal ImmutableArray<BoundStatement> ToStatements(BoundStatement? statement) 22return ImmutableArray<BoundStatement>.Empty;
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListMethod.cs (2)
7internal delegate BoundStatement GenerateMethodBodyDelegate(SyntheticBoundNodeFactory factory, MethodSymbol method, MethodSymbol interfaceMethod); 28var body = _generateMethodBody(f, this, _interfaceMethod);
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListTypeSymbol.cs (12)
471static BoundStatement generateGetEnumerator(SyntheticBoundNodeFactory f, MethodSymbol method, MethodSymbol interfaceMethod) 496static BoundStatement generateCount(SyntheticBoundNodeFactory f, MethodSymbol method, MethodSymbol interfaceMethod) 524static BoundStatement generateIsSynchronized(SyntheticBoundNodeFactory f, MethodSymbol method, MethodSymbol interfaceMethod) 531static BoundStatement generateSyncRoot(SyntheticBoundNodeFactory f, MethodSymbol method, MethodSymbol interfaceMethod) 541static BoundStatement generateIsFixedSize(SyntheticBoundNodeFactory f, MethodSymbol method, MethodSymbol interfaceMethod) 548static BoundStatement generateIsReadOnly(SyntheticBoundNodeFactory f, MethodSymbol method, MethodSymbol interfaceMethod) 555static BoundStatement generateContains(SyntheticBoundNodeFactory f, MethodSymbol method, MethodSymbol interfaceMethod) 591static BoundStatement generateCopyTo(SyntheticBoundNodeFactory f, MethodSymbol method, MethodSymbol interfaceMethod) 598BoundStatement statement; 648static BoundStatement generateIndexer(SyntheticBoundNodeFactory f, MethodSymbol method, MethodSymbol interfaceMethod) 682static BoundStatement generateIndexOf(SyntheticBoundNodeFactory f, MethodSymbol method, MethodSymbol interfaceMethod) 721static BoundStatement generateNotSupportedException(SyntheticBoundNodeFactory f, MethodSymbol method, MethodSymbol interfaceMethod)
Symbols\Synthesized\Records\SynthesizedRecordCopyCtor.cs (1)
40internal override void GenerateMethodBodyStatements(SyntheticBoundNodeFactory F, ArrayBuilder<BoundStatement> statements, BindingDiagnosticBag diagnostics)
Symbols\Synthesized\Records\SynthesizedRecordDeconstruct.cs (1)
60var statementsBuilder = ArrayBuilder<BoundStatement>.GetInstance(_positionalMembers.Length + 1);
Symbols\Synthesized\Records\SynthesizedRecordObjEquals.cs (1)
72F.CloseMethod(F.Block(ImmutableArray.Create<BoundStatement>(F.Return(expression))));
Symbols\Synthesized\Records\SynthesizedRecordPrintMembers.cs (4)
130ArrayBuilder<BoundStatement> block; 140block = ArrayBuilder<BoundStatement>.GetInstance(); 173block = ArrayBuilder<BoundStatement>.GetInstance(); 236static BoundStatement makeAppendString(SyntheticBoundNodeFactory F, BoundParameter builder, string value)
Symbols\Synthesized\Records\SynthesizedRecordToString.cs (3)
61var block = ArrayBuilder<BoundStatement>.GetInstance(); 88static BoundStatement makeAppendString(SyntheticBoundNodeFactory F, BoundLocal builder, string value) 93static BoundStatement makeAppendChar(SyntheticBoundNodeFactory F, BoundLocal builder, char value)
Symbols\Synthesized\SynthesizedEmbeddedNativeIntegerAttributeSymbol.cs (2)
72private void GenerateParameterlessConstructorBody(SyntheticBoundNodeFactory factory, ArrayBuilder<BoundStatement> statements) 89private void GenerateBoolArrayConstructorBody(SyntheticBoundNodeFactory factory, ArrayBuilder<BoundStatement> statements, ImmutableArray<ParameterSymbol> parameters)
Symbols\Synthesized\SynthesizedEmbeddedNullableAttributeSymbol.cs (5)
76private void GenerateByteArrayConstructorBody(SyntheticBoundNodeFactory factory, ArrayBuilder<BoundStatement> statements, ImmutableArray<ParameterSymbol> parameters) 90private void GenerateSingleByteConstructorBody(SyntheticBoundNodeFactory factory, ArrayBuilder<BoundStatement> statements, ImmutableArray<ParameterSymbol> parameters) 114private readonly Action<SyntheticBoundNodeFactory, ArrayBuilder<BoundStatement>, ImmutableArray<ParameterSymbol>> _getConstructorBody; 119Action<SyntheticBoundNodeFactory, ArrayBuilder<BoundStatement>, ImmutableArray<ParameterSymbol>> getConstructorBody) : 133internal override void GenerateMethodBodyStatements(SyntheticBoundNodeFactory factory, ArrayBuilder<BoundStatement> statements, BindingDiagnosticBag diagnostics) => _getConstructorBody(factory, statements, _parameters);
Symbols\Synthesized\SynthesizedEmbeddedNullableContextAttributeSymbol.cs (1)
60private void GenerateConstructorBody(SyntheticBoundNodeFactory factory, ArrayBuilder<BoundStatement> statements, ImmutableArray<ParameterSymbol> parameters)
Symbols\Synthesized\SynthesizedEmbeddedNullablePublicOnlyAttributeSymbol.cs (1)
57private void GenerateConstructorBody(SyntheticBoundNodeFactory factory, ArrayBuilder<BoundStatement> statements, ImmutableArray<ParameterSymbol> parameters)
Symbols\Synthesized\SynthesizedEmbeddedRefSafetyRulesAttributeSymbol.cs (1)
52private void GenerateConstructorBody(SyntheticBoundNodeFactory factory, ArrayBuilder<BoundStatement> statements, ImmutableArray<ParameterSymbol> parameters)
Symbols\Synthesized\SynthesizedEntryPointSymbol.cs (5)
403statements: ImmutableArray.Create<BoundStatement>( 426statements: ImmutableArray.Create<BoundStatement>( 497statements: ImmutableArray<BoundStatement>.Empty, 503ImmutableArray.Create<BoundStatement>( 620ImmutableArray.Create<BoundStatement>(submissionAssignment, returnStatement))
Symbols\Synthesized\SynthesizedHotReloadExceptionConstructorSymbol.cs (1)
56ImmutableArray.Create<BoundStatement>(
Symbols\Synthesized\SynthesizedInstanceConstructor.cs (2)
305var statements = ArrayBuilder<BoundStatement>.GetInstance(); 315internal virtual void GenerateMethodBodyStatements(SyntheticBoundNodeFactory factory, ArrayBuilder<BoundStatement> statements, BindingDiagnosticBag diagnostics)