53 instantiations of BoundBlock
Microsoft.CodeAnalysis.CSharp (53)
Binder\Binder.cs (2)
893return new BoundBlock(statement.Syntax, locals, ImmutableArray.Create(statement)) 909return new BoundBlock(statement.Syntax, locals, ImmutableArray<MethodSymbol>.CastUp(localFunctions), hasUnsafeModifier: false, instrumentation: null,
Binder\Binder_Statements.cs (3)
1940return new BoundBlock( 3580return new BoundBlock(node, locals, ImmutableArray.Create(statement)) { WasCompilerGenerated = node.Kind() != SyntaxKind.ArrowExpressionClause }; 3748blockBody: new BoundBlock(typeDecl, ImmutableArray<LocalSymbol>.Empty, ImmutableArray<BoundStatement>.Empty).MakeCompilerGenerated(),
Binder\ForLoopBinder.cs (2)
115increment = new BoundBlock(scopeDesignator, locals, ((BoundStatementList)increment).Statements) 120increment = new BoundBlock(increment.Syntax, locals, ImmutableArray.Create(increment))
BoundTree\Constructors.cs (3)
598return new BoundBlock(syntax, ImmutableArray<LocalSymbol>.Empty, ImmutableArray.Create(statement)) 604return new BoundBlock(syntax, ImmutableArray<LocalSymbol>.Empty, statements) { WasCompilerGenerated = true }; 609return new BoundBlock(syntax, ImmutableArray<LocalSymbol>.Empty, statements.AsImmutableOrNull()) { WasCompilerGenerated = true };
Compiler\MethodBodySynthesizer.cs (3)
515return new BoundBlock(syntax, 563return new BoundBlock( 571new BoundBlock(
Compiler\MethodCompiler.cs (4)
1008body = new BoundBlock(methodSymbol.GetNonNullSyntaxNode(), ImmutableArray<LocalSymbol>.Empty, ImmutableArray<BoundStatement>.Empty) { WasCompilerGenerated = true }; 1051new BoundBlock(analyzedInitializers.Syntax, ImmutableArray<LocalSymbol>.Empty, analyzedInitializers.Statements), // The block is necessary to establish the right local scope for the analysis 2003body = new BoundBlock(constructor.Syntax, constructor.Locals, ImmutableArray.Create<BoundStatement>(constructor.Initializer)); 2007body = new BoundBlock(constructor.Syntax, constructor.Locals, ImmutableArray.Create<BoundStatement>(constructor.Initializer, body));
FlowAnalysis\FlowAnalysisPass.cs (1)
86block = new BoundBlock(block.Syntax, ImmutableArray<LocalSymbol>.Empty, newStatements) { WasCompilerGenerated = true };
Generated\BoundNodes.xml.Generated.cs (1)
3332var result = new BoundBlock(this.Syntax, locals, localFunctions, hasUnsafeModifier, instrumentation, statements, this.HasErrors);
Lowering\ClosureConversion\ClosureConversion.cs (2)
306body = new BoundBlock(body.Syntax, _addedLocals.ToImmutableAndFree(), _addedStatements.ToImmutableAndFree()) { WasCompilerGenerated = true }; 1323return new BoundBlock(node.Syntax, newLocals.ToImmutableAndFree(), newStatements.ToImmutableAndFree(), node.HasErrors);
Lowering\InitializerRewriter.cs (1)
112boundStatement = new BoundBlock(syntax, fieldInit.Locals, ImmutableArray.Create(boundStatement)) { WasCompilerGenerated = fieldInit.WasCompilerGenerated };
Lowering\LocalRewriter\LocalRewriter.cs (1)
729return new BoundBlock(
Lowering\LocalRewriter\LocalRewriter_Block.cs (2)
58return new BoundBlock(node.Syntax, locals, node.LocalFunctions, node.HasUnsafeModifier, instrumentation, builder.ToImmutableAndFree(), node.HasErrors); 130? new BoundBlock(node.Syntax, ImmutableArray<LocalSymbol>.Empty, ImmutableArray<BoundStatement>.Empty)
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (1)
1382new BoundBlock(iteratorBody.Syntax, locals: ImmutableArray<LocalSymbol>.Empty, statements);
Lowering\LocalRewriter\LocalRewriter_DoStatement.cs (1)
67new BoundBlock(syntax,
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (7)
264tryBlock: new BoundBlock(forEachSyntax, locals: ImmutableArray<LocalSymbol>.Empty, statements: ImmutableArray.Create(whileLoop)), 271result = new BoundBlock( 283result = new BoundBlock( 414return new BoundBlock(forEachSyntax, 469return new BoundBlock(forEachSyntax, 843return new BoundBlock( 1200BoundStatement result = new BoundBlock(
Lowering\LocalRewriter\LocalRewriter_ForStatement.cs (3)
169return new BoundBlock(syntax, outerLocals, statements, hasErrors); 265statementBuilder.Add(new BoundBlock(syntax, node.InnerLocals, blockBuilder.ToImmutableAndFree())); 271return new BoundBlock(syntax, node.OuterLocals, statements, node.HasErrors);
Lowering\LocalRewriter\LocalRewriter_LockStatement.cs (3)
78return new BoundBlock( 168return new BoundBlock( 219return new BoundBlock(
Lowering\LocalRewriter\LocalRewriter_UsingStatement.cs (4)
80return new BoundBlock( 92BoundBlock body = new BoundBlock(syntax, ImmutableArray<LocalSymbol>.Empty, statements); 193return new BoundBlock( 256return new BoundBlock(
Lowering\LocalRewriter\LocalRewriter_WhileStatement.cs (1)
148new BoundBlock(syntax,
Lowering\SpillSequenceSpiller.cs (1)
296var result = new BoundBlock(statement.Syntax, builder.GetLocals(), builder.GetStatements()) { WasCompilerGenerated = true };
Lowering\SyntheticBoundNodeFactory.cs (2)
473return new BoundBlock(Syntax, locals, statements) { WasCompilerGenerated = true }; 488return new BoundBlock(Syntax, locals, localFunctions, hasUnsafeModifier: false, instrumentation: null, statements) { WasCompilerGenerated = true };
Symbols\Synthesized\SynthesizedEntryPointSymbol.cs (5)
436return new BoundBlock( 459return new BoundBlock( 531return new BoundBlock( 538return new BoundBlock(syntax, 655return new BoundBlock(syntax,
378 references to BoundBlock
Microsoft.CodeAnalysis.CSharp (358)
Binder\Binder.QueryUnboundLambdaState.cs (4)
17private delegate BoundBlock LambdaBodyFactory(LambdaSymbol lambdaSymbol, Binder lambdaBodyBinder, BindingDiagnosticBag diagnostics); 74protected override BoundExpression GetLambdaExpressionBody(BoundBlock body) 79protected override BoundBlock CreateBlockFromLambdaExpressionBody(Binder lambdaBodyBinder, BoundExpression expression, BindingDiagnosticBag diagnostics) 84protected override BoundBlock BindLambdaBodyCore(LambdaSymbol lambdaSymbol, Binder lambdaBodyBinder, BindingDiagnosticBag diagnostics)
Binder\Binder_Query.cs (1)
779private BoundBlock CreateLambdaBlockForQueryClause(ExpressionSyntax expression, BoundExpression result, BindingDiagnosticBag diagnostics)
Binder\Binder_Statements.cs (20)
150BoundBlock block; 153(block = (BoundBlock)result).Statements.Length == 1 && 566BoundBlock blockBody = null; 567BoundBlock expressionBody = null; 610BoundBlock runAnalysis(BoundBlock block, BindingDiagnosticBag blockDiagnostics) 1902internal virtual BoundBlock BindEmbeddedBlock(BlockSyntax node, BindingDiagnosticBag diagnostics) 1907private BoundBlock BindBlock(BlockSyntax node, BindingDiagnosticBag diagnostics) 1920private BoundBlock BindBlockParts(BlockSyntax node, BindingDiagnosticBag diagnostics) 1936private BoundBlock FinishBindBlockParts(CSharpSyntaxNode node, ImmutableArray<BoundStatement> boundStatements) 3250var tryBlock = BindEmbeddedBlock(node.Block, diagnostics); 3252var finallyBlockOpt = (node.Finally != null) ? BindEmbeddedBlock(node.Finally.Block, diagnostics) : null; 3393var block = BindEmbeddedBlock(node.Block, diagnostics); 3494internal BoundBlock CreateBlockFromExpression(CSharpSyntaxNode node, ImmutableArray<LocalSymbol> locals, RefKind refKind, BoundExpression expression, ExpressionSyntax expressionSyntax, BindingDiagnosticBag diagnostics) 3591internal virtual BoundBlock BindExpressionBodyAsBlock( 3619static BoundBlock bindExpressionBodyAsBlockInternal(ArrowExpressionClauseSyntax expressionBody, Binder bodyBinder, BindingDiagnosticBag diagnostics) 3632public BoundBlock BindLambdaExpressionAsBlock(ExpressionSyntax body, BindingDiagnosticBag diagnostics) 3644public BoundBlock CreateBlockFromExpression(ExpressionSyntax body, BoundExpression expression, BindingDiagnosticBag diagnostics) 3797constructor.Body == null ? null : (BoundBlock)bodyBinder.BindStatement(constructor.Body, diagnostics), 4076blockBody == null ? null : (BoundBlock)BindStatement(blockBody, diagnostics),
Binder\RefSafetyAnalysis.cs (1)
298public override BoundNode? VisitBlock(BoundBlock node)
BoundTree\BoundLocalFunctionStatement.cs (1)
13public BoundBlock? Body { get => BlockBody ?? ExpressionBody; }
BoundTree\BoundNode.cs (1)
554public override BoundNode? VisitBlock(BoundBlock node)
BoundTree\BoundNode_Source.cs (2)
67var finallyBlock = tryStatement.FinallyBlockOpt; 85case BoundBlock block:
BoundTree\BoundTreeVisitors.cs (1)
72return VisitBlock(node as BoundBlock, arg);
BoundTree\Constructors.cs (5)
596public static BoundBlock SynthesizedNoLocals(SyntaxNode syntax, BoundStatement statement) 602public static BoundBlock SynthesizedNoLocals(SyntaxNode syntax, ImmutableArray<BoundStatement> statements) 607public static BoundBlock SynthesizedNoLocals(SyntaxNode syntax, params BoundStatement[] statements) 623public BoundTryStatement(SyntaxNode syntax, BoundBlock tryBlock, ImmutableArray<BoundCatchBlock> catchBlocks, BoundBlock? finallyBlockOpt, LabelSymbol? finallyLabelOpt = null)
BoundTree\UnboundLambda.cs (17)
25BoundBlock? Body { get; } 35BoundBlock? IBoundLambdaOrFunction.Body { get => this.Body; } 85public BoundLambda(SyntaxNode syntax, UnboundLambda unboundLambda, BoundBlock body, ReadOnlyBindingDiagnostic<AssemblySymbol> diagnostics, Binder binder, TypeSymbol? delegateType, InferredLambdaReturnType inferredReturnType) 362public static void GetReturnTypes(ArrayBuilder<(BoundReturnStatement, TypeWithAnnotations)> builder, BoundBlock block) 606protected BoundBlock BindLambdaBody(LambdaSymbol lambdaSymbol, Binder lambdaBodyBinder, BindingDiagnosticBag diagnostics) 617protected abstract BoundBlock BindLambdaBodyCore(LambdaSymbol lambdaSymbol, Binder lambdaBodyBinder, BindingDiagnosticBag diagnostics); 623protected abstract BoundExpression? GetLambdaExpressionBody(BoundBlock body); 628protected abstract BoundBlock CreateBlockFromLambdaExpressionBody(Binder lambdaBodyBinder, BoundExpression expression, BindingDiagnosticBag diagnostics); 760var block = BindLambdaBody(lambdaSymbol, lambdaBodyBinder, BindingDiagnosticBag.Discarded); 825BoundBlock block; 981(var lambdaSymbol, var block, var lambdaBodyBinder, var diagnostics) = BindWithParameterAndReturnType(parameterTypes, parameterRefKinds, returnType, refKind, refCustomModifiers); 1042private (LambdaSymbol lambdaSymbol, BoundBlock block, ExecutableCodeBinder lambdaBodyBinder, BindingDiagnosticBag diagnostics) BindWithParameterAndReturnType( 1058var block = BindLambdaBody(lambdaSymbol, lambdaBodyBinder, diagnostics); 1278(var lambdaSymbol, var block, var lambdaBodyBinder, var diagnostics) = BindWithParameterAndReturnType(parameterTypes, parameterRefKinds, returnType, refKind, refCustomModifiers); 1628protected override BoundExpression? GetLambdaExpressionBody(BoundBlock body) 1643protected override BoundBlock CreateBlockFromLambdaExpressionBody(Binder lambdaBodyBinder, BoundExpression expression, BindingDiagnosticBag diagnostics) 1648protected override BoundBlock BindLambdaBodyCore(LambdaSymbol lambdaSymbol, Binder lambdaBodyBinder, BindingDiagnosticBag diagnostics)
CodeGen\EmitStatement.cs (8)
32EmitBlock((BoundBlock)statement); 648private bool IsLastBlockInMethod(BoundBlock block) 666private void EmitBlock(BoundBlock block) 678private void EmitInstrumentedBlock(BoundBlockInstrumentation instrumentation, BoundBlock block) 749private void EmitUninstrumentedBlock(BoundBlock block) 1007var finallyClone = FinallyCloner.MakeFinallyClone(statement); 1975public static BoundBlock MakeFinallyClone(BoundTryStatement node) 1978return (BoundBlock)cloner.Visit(node.FinallyBlockOpt);
CodeGen\Optimizer.cs (9)
612public override BoundNode VisitBlock(BoundBlock node) 1682var tryBlock = (BoundBlock)this.Visit(node.TryBlock); 1687var finallyBlock = (BoundBlock)this.Visit(node.FinallyBlockOpt); 1752var boundBlock = (BoundBlock)this.Visit(node.Body); 2304var body = node.Body; 2342body = (BoundBlock)this.Visit(body);
Compilation\MemberSemanticModel.cs (6)
2496internal override BoundBlock BindEmbeddedBlock(BlockSyntax node, BindingDiagnosticBag diagnostics) 2498BoundBlock block = (BoundBlock)TryGetBoundNodeFromMap(node); 2551internal override BoundBlock BindExpressionBodyAsBlock(ArrowExpressionClauseSyntax node, BindingDiagnosticBag diagnostics) 2553BoundBlock block = (BoundBlock)TryGetBoundNodeFromMap(node);
Compiler\MethodBodySynthesizer.cs (11)
174internal static BoundBlock ConstructAutoPropertyAccessorBody(SourceMemberMethodSymbol accessor) 209return BoundBlock.SynthesizedNoLocals(syntax, statement); 215internal static BoundBlock ConstructFieldLikeEventAccessorBody(SourceEventSymbol eventSymbol, bool isAddMethod, CSharpCompilation compilation, BindingDiagnosticBag diagnostics) 232internal static BoundBlock ConstructFieldLikeEventAccessorBody_WinRT(SourceEventSymbol eventSymbol, bool isAddMethod, CSharpCompilation compilation, BindingDiagnosticBag diagnostics) 312return BoundBlock.SynthesizedNoLocals(syntax, returnStatement); 322return BoundBlock.SynthesizedNoLocals(syntax, callStatement, returnStatement); 344internal static BoundBlock ConstructFieldLikeEventAccessorBody_Regular(SourceEventSymbol eventSymbol, bool isAddMethod, CSharpCompilation compilation, BindingDiagnosticBag diagnostics) 371return BoundBlock.SynthesizedNoLocals(syntax, @return); 415return BoundBlock.SynthesizedNoLocals(syntax, 528internal static BoundBlock ConstructDestructorBody(MethodSymbol method, BoundBlock block)
Compiler\MethodBodySynthesizer.Lowered.cs (4)
82var body = F.Block( 174var body = F.Block( 332BoundBlock body = MethodBodySynthesizer.ConstructSingleInvocationMethodBody(F, methodBeingWrapped, useBaseReference: true); 455internal static BoundBlock ConstructSingleInvocationMethodBody(SyntheticBoundNodeFactory F, MethodSymbol methodToInvoke, bool useBaseReference)
Compiler\MethodCompiler.cs (12)
995BoundBlock body; 1018body = BoundBlock.SynthesizedNoLocals(initializerStatements.Syntax, initializerStatements.Statements); 1072body = (BoundBlock)body.WithHasErrors(); 1143BoundBlock flowAnalyzedBody = null; 1860internal static BoundBlock? BindSynthesizedMethodBody(MethodSymbol method, TypeCompilationState compilationState, BindingDiagnosticBag diagnostics) 1876private static BoundBlock? BindMethodBody( 1893BoundBlock? body; 2030body = (BoundBlock)methodBody; 2054body = BoundBlock.SynthesizedNoLocals(node, stmts.ToImmutableAndFree()); 2106return BoundBlock.SynthesizedNoLocals(method.GetNonNullSyntaxNode(), statements); 2471private static BoundBlock GetSynthesizedEmptyBody(Symbol symbol) 2473return BoundBlock.SynthesizedNoLocals(symbol.GetNonNullSyntaxNode());
FlowAnalysis\AbstractFlowPass.cs (3)
1304public override BoundNode VisitBlock(BoundBlock node) 3835private void VisitMethodBodies(BoundBlock blockBody, BoundBlock expressionBody)
FlowAnalysis\ControlFlowPass.cs (6)
22private readonly ArrayBuilder<(LocalSymbol symbol, BoundBlock block)> _usingDeclarations = ArrayBuilder<(LocalSymbol, BoundBlock)>.GetInstance(); 23private BoundBlock _currentBlock = null; 153public static bool Analyze(CSharpCompilation compilation, Symbol member, BoundBlock block, DiagnosticBag diagnostics) 398public override BoundNode VisitBlock(BoundBlock node) 400var parentBlock = _currentBlock;
FlowAnalysis\DefiniteAssignment.cs (2)
2087public override BoundNode? VisitBlock(BoundBlock node) 2124private void VisitStatementsWithLocalFunctions(BoundBlock block)
FlowAnalysis\FlowAnalysisPass.cs (10)
31public static BoundBlock Rewrite( 33BoundBlock block, 113private static BoundBlock PrependImplicitInitializations(BoundBlock body, MethodSymbol method, ImmutableArray<FieldSymbol> implicitlyInitializedFields, TypeCompilationState compilationState, BindingDiagnosticBag diagnostics) 168private static BoundBlock AppendImplicitReturn(BoundBlock body, MethodSymbol method, bool originalBodyNested) 177builder.Add(AppendImplicitReturn((BoundBlock)statements[n - 1], method)); 190internal static BoundBlock AppendImplicitReturn(BoundBlock body, MethodSymbol method) 213BoundBlock block,
FlowAnalysis\NullableWalker.cs (2)
3225public override BoundNode? VisitBlock(BoundBlock node) 3233private void VisitStatementsWithLocalFunctions(BoundBlock block)
Generated\BoundNodes.xml.Generated.cs (76)
1020public BoundExtractedFinallyBlock(SyntaxNode syntax, BoundBlock finallyBlock, bool hasErrors = false) 1029public BoundBlock FinallyBlock { get; } 1034public BoundExtractedFinallyBlock Update(BoundBlock finallyBlock) 3328public BoundBlock Update(ImmutableArray<LocalSymbol> locals, ImmutableArray<MethodSymbol> localFunctions, bool hasUnsafeModifier, BoundBlockInstrumentation? instrumentation, ImmutableArray<BoundStatement> statements) 3332var result = new BoundBlock(this.Syntax, locals, localFunctions, hasUnsafeModifier, instrumentation, statements, this.HasErrors); 3508public BoundLocalFunctionStatement(SyntaxNode syntax, MethodSymbol symbol, BoundBlock? blockBody, BoundBlock? expressionBody, bool hasErrors = false) 3520public BoundBlock? BlockBody { get; } 3521public BoundBlock? ExpressionBody { get; } 3526public BoundLocalFunctionStatement Update(MethodSymbol symbol, BoundBlock? blockBody, BoundBlock? expressionBody) 4226public BoundTryStatement(SyntaxNode syntax, BoundBlock tryBlock, ImmutableArray<BoundCatchBlock> catchBlocks, BoundBlock? finallyBlockOpt, LabelSymbol? finallyLabelOpt, bool preferFaultHandler, bool hasErrors = false) 4240public BoundBlock TryBlock { get; } 4242public BoundBlock? FinallyBlockOpt { get; } 4249public BoundTryStatement Update(BoundBlock tryBlock, ImmutableArray<BoundCatchBlock> catchBlocks, BoundBlock? finallyBlockOpt, LabelSymbol? finallyLabelOpt, bool preferFaultHandler) 4263public BoundCatchBlock(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundExpression? exceptionSourceOpt, TypeSymbol? exceptionTypeOpt, BoundStatementList? exceptionFilterPrologueOpt, BoundExpression? exceptionFilterOpt, BoundBlock body, bool isSynthesizedAsyncCatchAll, bool hasErrors = false) 4284public BoundBlock Body { get; } 4290public BoundCatchBlock Update(ImmutableArray<LocalSymbol> locals, BoundExpression? exceptionSourceOpt, TypeSymbol? exceptionTypeOpt, BoundStatementList? exceptionFilterPrologueOpt, BoundExpression? exceptionFilterOpt, BoundBlock body, bool isSynthesizedAsyncCatchAll) 7600public BoundLambda(SyntaxNode syntax, UnboundLambda unboundLambda, MethodSymbol symbol, BoundBlock body, ReadOnlyBindingDiagnostic<AssemblySymbol> diagnostics, Binder binder, TypeSymbol? type, bool hasErrors = false) 7619public BoundBlock Body { get; } 7626public BoundLambda Update(UnboundLambda unboundLambda, MethodSymbol symbol, BoundBlock body, ReadOnlyBindingDiagnostic<AssemblySymbol> diagnostics, Binder binder, TypeSymbol? type) 8738protected BoundMethodBodyBase(BoundKind kind, SyntaxNode syntax, BoundBlock? blockBody, BoundBlock? expressionBody, bool hasErrors = false) 8745public BoundBlock? BlockBody { get; } 8746public BoundBlock? ExpressionBody { get; } 8751public BoundNonConstructorMethodBody(SyntaxNode syntax, BoundBlock? blockBody, BoundBlock? expressionBody, bool hasErrors = false) 8760public BoundNonConstructorMethodBody Update(BoundBlock? blockBody, BoundBlock? expressionBody) 8774public BoundConstructorMethodBody(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundStatement? initializer, BoundBlock? blockBody, BoundBlock? expressionBody, bool hasErrors = false) 8790public BoundConstructorMethodBody Update(ImmutableArray<LocalSymbol> locals, BoundStatement? initializer, BoundBlock? blockBody, BoundBlock? expressionBody) 9043return VisitBlock((BoundBlock)node, arg); 9431public virtual R VisitBlock(BoundBlock node, A arg) => this.DefaultVisit(node, arg); 9667public virtual BoundNode? VisitBlock(BoundBlock node) => this.DefaultVisit(node); 10119public override BoundNode? VisitBlock(BoundBlock node) 10962BoundBlock finallyBlock = (BoundBlock)this.Visit(node.FinallyBlock); 11371public override BoundNode? VisitBlock(BoundBlock node) 11413BoundBlock? blockBody = (BoundBlock?)this.Visit(node.BlockBody); 11414BoundBlock? expressionBody = (BoundBlock?)this.Visit(node.ExpressionBody); 11548BoundBlock tryBlock = (BoundBlock)this.Visit(node.TryBlock); 11550BoundBlock? finallyBlockOpt = (BoundBlock?)this.Visit(node.FinallyBlockOpt); 11559BoundBlock body = (BoundBlock)this.Visit(node.Body); 12164BoundBlock body = (BoundBlock)this.Visit(node.Body); 12382BoundBlock? blockBody = (BoundBlock?)this.Visit(node.BlockBody); 12383BoundBlock? expressionBody = (BoundBlock?)this.Visit(node.ExpressionBody); 12390BoundBlock? blockBody = (BoundBlock?)this.Visit(node.BlockBody); 12391BoundBlock? expressionBody = (BoundBlock?)this.Visit(node.ExpressionBody); 13532public override BoundNode? VisitBlock(BoundBlock node) 13567BoundBlock? blockBody = (BoundBlock?)this.Visit(node.BlockBody); 13568BoundBlock? expressionBody = (BoundBlock?)this.Visit(node.ExpressionBody); 13648BoundBlock body = (BoundBlock)this.Visit(node.Body); 14724BoundBlock body = (BoundBlock)this.Visit(node.Body); 15087BoundBlock? blockBody = (BoundBlock?)this.Visit(node.BlockBody); 15088BoundBlock? expressionBody = (BoundBlock?)this.Visit(node.ExpressionBody); 15879public override TreeDumperNode VisitBlock(BoundBlock node, object? arg) => new TreeDumperNode("block", null, new TreeDumperNode[]
Lowering\AsyncRewriter\AsyncExceptionHandlerRewriter.cs (15)
190BoundBlock rewrittenFinally; 196rewrittenFinally = (BoundBlock)this.Visit(node.FinallyBlockOpt); 213return _F.Try((BoundBlock)finalizedRegion, ImmutableArray<BoundCatchBlock>.Empty, rewrittenFinally); 220rewrittenFinally = (BoundBlock)this.VisitBlock(node.FinallyBlockOpt); 239BoundBlock syntheticFinallyBlock = _F.Block( 275var completeTry = _F.Block( 283private BoundBlock PendBranches( 516var rewrittenTry = (BoundBlock)this.VisitBlock(node.TryBlock); 715var handler = _F.Block( 779(BoundBlock)FinalizeMethodBody(result.Body), 802result = result.Update(node.Symbol, (BoundBlock)FinalizeMethodBody(result.Body), (BoundBlock)FinalizeMethodBody(result.ExpressionBody)); 1103public readonly List<BoundBlock> handlers; 1121this.handlers = new List<BoundBlock>();
Lowering\AsyncRewriter\AsyncIteratorMethodToStateMachineRewriter.cs (3)
405protected override BoundBlock VisitFinally(BoundBlock finallyBlock) 410var result = base.VisitFinally(finallyBlock);
Lowering\AsyncRewriter\AsyncMethodToStateMachineRewriter.cs (4)
254protected virtual BoundStatement GenerateTopLevelTry(BoundBlock tryBlock, ImmutableArray<BoundCatchBlock> catchBlocks) 348private BoundBlock VisitAwaitExpression(BoundAwaitExpression node, BoundExpression resultPlace) 380var awaitIfIncomplete = F.Block( 467private BoundBlock GenerateAwaitForIncompleteTask(LocalSymbol awaiterTemp, BoundAwaitExpressionDebugInfo debugInfo)
Lowering\BoundTreeToDifferentEnclosingContextRewriter.cs (3)
100public override BoundNode VisitBlock(BoundBlock node) 103protected BoundBlock VisitBlock(BoundBlock node, bool removeInstrumentation)
Lowering\ClosureConversion\ClosureConversion.Analysis.Tree.cs (2)
416public override BoundNode VisitBlock(BoundBlock node) 569private BoundNode? VisitNestedFunction(MethodSymbol functionSymbol, BoundBlock? body)
Lowering\ClosureConversion\ClosureConversion.cs (9)
563var body = F.Block( 1155public override BoundNode VisitBlock(BoundBlock node) 1169private BoundBlock RewriteBlock(BoundBlock node, ArrayBuilder<BoundExpression> prologue, ArrayBuilder<LocalSymbol> newLocals) 1279var rewrittenBlock = (BoundBlock)this.Visit(node.Body); 1587if (node.Body is BoundBlock block) 1629var newBody = (BoundBlock)Visit(node.Body);
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (1)
131private BoundExpression TranslateLambdaBody(BoundBlock block)
Lowering\ExtensionMethodBodyRewriter.cs (7)
101BoundBlock body = (BoundBlock)this.Visit(node.Body); 113BoundBlock? blockBody = (BoundBlock?)this.Visit(node.BlockBody); 114BoundBlock? expressionBody = (BoundBlock?)this.Visit(node.ExpressionBody); 121public override BoundNode VisitBlock(BoundBlock node)
Lowering\Instrumentation\CodeCoverageInstrumenter.cs (1)
237public override void InstrumentBlock(BoundBlock original, LocalRewriter rewriter, ref TemporaryArray<LocalSymbol> additionalLocals, out BoundStatement? prologue, out BoundStatement? epilogue, out BoundBlockInstrumentation? instrumentation)
Lowering\Instrumentation\CompoundInstrumenter.cs (3)
84public override void PreInstrumentBlock(BoundBlock original, LocalRewriter rewriter) 89public override void InstrumentBlock(BoundBlock original, LocalRewriter rewriter, ref TemporaryArray<LocalSymbol> additionalLocals, out BoundStatement? prologue, out BoundStatement? epilogue, out BoundBlockInstrumentation? instrumentation) 223ref BoundBlock rewrittenBody,
Lowering\Instrumentation\DebugInfoInjector.cs (4)
125var block = (BoundBlock)rewritten; 186public override void InstrumentBlock(BoundBlock original, LocalRewriter rewriter, ref TemporaryArray<LocalSymbol> additionalLocals, out BoundStatement? prologue, out BoundStatement? epilogue, out BoundBlockInstrumentation? instrumentation) 459ref BoundBlock rewrittenBody,
Lowering\Instrumentation\Instrumenter.cs (4)
62public virtual void PreInstrumentBlock(BoundBlock original, LocalRewriter rewriter) 71/// <param name="additionalLocals">Local symbols to be added to <see cref="BoundBlock.Locals"/> of the resulting block.</param> 74public virtual void InstrumentBlock(BoundBlock original, LocalRewriter rewriter, ref TemporaryArray<LocalSymbol> additionalLocals, out BoundStatement? prologue, out BoundStatement? epilogue, out BoundBlockInstrumentation? instrumentation) 298ref BoundBlock rewrittenBody,
Lowering\Instrumentation\LocalStateTracingInstrumenter.cs (5)
30/// This node is attached to a <see cref="BoundBlock"/> that represents the lowered body of an instrumented method, lambda or local function. 33/// <see cref="BoundBlock"/> with block instrumentation is eventually lowered to: 274public override void PreInstrumentBlock(BoundBlock original, LocalRewriter rewriter) 284public override void InstrumentBlock(BoundBlock original, LocalRewriter rewriter, ref TemporaryArray<LocalSymbol> additionalLocals, out BoundStatement? prologue, out BoundStatement? epilogue, out BoundBlockInstrumentation? instrumentation) 503ref BoundBlock rewrittenBody,
Lowering\Instrumentation\ModuleCancellationInstrumenter.cs (1)
67public override void InstrumentBlock(BoundBlock original, LocalRewriter rewriter, ref TemporaryArray<LocalSymbol> additionalLocals, out BoundStatement? prologue, out BoundStatement? epilogue, out BoundBlockInstrumentation? instrumentation)
Lowering\Instrumentation\StackOverflowProbingInstrumenter.cs (1)
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 (8)
152var faultBlock = F.Block(F.ExpressionStatement(F.Call(F.This(), disposeMethod))); 153newBody = F.Fault((BoundBlock)newBody, faultBlock); 169var disposeBody = F.Block( 181var disposeBody = F.Block( 193private BoundBlock HandleReturn(BoundStatement newBody) 284var tryBlock = body != null ? F.Block(body) : F.Block(); 378(BoundBlock)Visit(node.TryBlock), 380(BoundBlock)Visit(node.FinallyBlockOpt),
Lowering\LocalRewriter\LocalRewriter.cs (8)
45private BoundBlock? _currentLambdaBody; 180internal BoundBlock? CurrentLambdaBody 356var oldLambdaBody = _currentLambdaBody; 422var oldLambdaBody = _currentLambdaBody; 711var block = (BoundBlock)initializer; 882var block = (BoundBlock)initializer;
Lowering\LocalRewriter\LocalRewriter_Block.cs (1)
14public override BoundNode VisitBlock(BoundBlock node)
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (4)
220var rewrittenBodyBlock = CreateBlockDeclaringIterationVariables(iterationVariables, iterationVarDecl, rewrittenBody, forEachSyntax); 227var disposalFinallyBlock = GetDisposalFinallyBlock(forEachSyntax, enumeratorInfo, enumeratorType, boundEnumeratorVar, out var hasAsyncDisposal); 312private BoundBlock? GetDisposalFinallyBlock( 828private static BoundBlock CreateBlockDeclaringIterationVariables(
Lowering\LocalRewriter\LocalRewriter_LockStatement.cs (7)
53var tryBlock = rewrittenBody is BoundBlock block ? block : BoundBlock.SynthesizedNoLocals(lockSyntax, rewrittenBody); 176BoundBlock.SynthesizedNoLocals(lockSyntax, ImmutableArray.Create<BoundStatement>( 180BoundBlock.SynthesizedNoLocals(lockSyntax, 227BoundBlock.SynthesizedNoLocals(lockSyntax, rewrittenBody), 229BoundBlock.SynthesizedNoLocals(lockSyntax, exitCall))));
Lowering\LocalRewriter\LocalRewriter_TryStatement.cs (8)
16BoundBlock? tryBlock = (BoundBlock?)this.Visit(node.TryBlock); 27BoundBlock? finallyBlockOpt = (BoundBlock?)this.Visit(node.FinallyBlockOpt); 56var block = (BoundBlock)statement; 88BoundBlock? rewrittenBody = (BoundBlock?)this.Visit(node.Body);
Lowering\LocalRewriter\LocalRewriter_UsingStatement.cs (14)
40BoundBlock tryBlock = rewrittenBody.Kind == BoundKind.Block 41? (BoundBlock)rewrittenBody 42: BoundBlock.SynthesizedNoLocals(node.Syntax, rewrittenBody); 63BoundBlock body, 72BoundBlock result = body; 92BoundBlock body = new BoundBlock(syntax, ImmutableArray<LocalSymbol>.Empty, statements); 108private BoundBlock MakeExpressionUsingStatement(BoundUsingStatement node, BoundBlock tryBlock) 206private BoundBlock RewriteDeclarationUsingStatement( 209BoundBlock tryBlock, 233return BoundBlock.SynthesizedNoLocals(declarationSyntax, rewrittenDeclaration, tryBlock); 269return BoundBlock.SynthesizedNoLocals(declarationSyntax, rewrittenDeclaration, tryFinally); 282BoundBlock tryBlock, 423finallyBlockOpt: BoundBlock.SynthesizedNoLocals(resourceSyntax, finallyStatement));
Lowering\SpillSequenceSpiller.cs (3)
296var result = new BoundBlock(statement.Syntax, builder.GetLocals(), builder.GetStatements()) { WasCompilerGenerated = true }; 733BoundBlock body = (BoundBlock)this.Visit(node.Body);
Lowering\StateMachineRewriter\IteratorAndAsyncCaptureWalker.cs (1)
388public override BoundNode VisitBlock(BoundBlock node)
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (11)
407internal BoundBlock MakeStateMachineScope(ImmutableArray<StateMachineFieldSymbol> hoistedLocals, BoundStatement statement) 419var rewrittenBlock = (BoundBlock)statement; 450protected BoundBlock GenerateAllHoistedLocalsCleanup() 459var result = F.Block(variableCleanup.SelectAsArray((e, f) => (BoundStatement)f.ExpressionStatement(e), F)); 524public override BoundNode VisitBlock(BoundBlock node) 735BoundBlock tryBlock = F.Block((BoundStatement)this.Visit(node.TryBlock)); 754BoundBlock finallyBlockOpt = node.FinallyBlockOpt == null ? null : F.Block( 775protected virtual BoundBlock VisitFinally(BoundBlock finallyBlock) 777return (BoundBlock)this.Visit(finallyBlock);
Lowering\SyntheticBoundNodeFactory.cs (17)
451public BoundBlock Block() 456public BoundBlock Block(ImmutableArray<BoundStatement> statements) 461public BoundBlock Block(params BoundStatement[] statements) 466public BoundBlock Block(ImmutableArray<LocalSymbol> locals, params BoundStatement[] statements) 471public BoundBlock Block(ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundStatement> statements) 476public BoundBlock Block(ImmutableArray<LocalSymbol> locals, ImmutableArray<LocalFunctionSymbol> localFunctions, params BoundStatement[] statements) 481public BoundBlock Block(ImmutableArray<LocalSymbol> locals, ImmutableArray<LocalFunctionSymbol> localFunctions, ImmutableArray<BoundStatement> statements) 486public BoundBlock Block(ImmutableArray<LocalSymbol> locals, ImmutableArray<MethodSymbol> localFunctions, ImmutableArray<BoundStatement> statements) 491public BoundExtractedFinallyBlock ExtractedFinallyBlock(BoundBlock finallyBlock) 969var firstPart = this.Block(locals, statements.ToImmutable()); 983var firstPart = this.Block(locals, statements.ToImmutable()); 1594BoundBlock tryBlock, 1596BoundBlock? finallyBlock = null, 1610BoundBlock block) 1618BoundBlock block) 1623internal BoundTryStatement Fault(BoundBlock tryBlock, BoundBlock faultBlock)
Operations\CSharpOperationFactory.cs (2)
163return CreateBoundBlockOperation((BoundBlock)boundNode); 1742private IBlockOperation CreateBoundBlockOperation(BoundBlock boundBlock)
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListConstructor.cs (1)
33var block = f.Block(
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListEnumeratorConstructor.cs (1)
33var block = f.Block(
Symbols\Synthesized\SynthesizedEntryPointSymbol.cs (4)
60internal abstract BoundBlock CreateBody(BindingDiagnosticBag diagnostics); 430internal override BoundBlock CreateBody(BindingDiagnosticBag diagnostics) 501internal override BoundBlock CreateBody(BindingDiagnosticBag diagnostics) 600internal override BoundBlock CreateBody(BindingDiagnosticBag diagnostics)
Symbols\Synthesized\SynthesizedEventAccessorSymbol.cs (1)
147BoundBlock body = CSharp.MethodBodySynthesizer.ConstructFieldLikeEventAccessorBody(fieldLikeEvent, isAddMethod: MethodKind == MethodKind.EventAdd, compilationState.Compilation, diagnostics);
Symbols\Synthesized\SynthesizedHotReloadExceptionConstructorSymbol.cs (1)
74var block = factory.Block(
Symbols\Synthesized\SynthesizedInstanceConstructor.cs (1)
310var block = factory.Block(statements.ToImmutableAndFree());
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
FlowAnalysis\FlowTestBase.cs (1)
35var boundBody = MethodCompiler.BindSynthesizedMethodBody(sourceSymbol, compilationState, diagnostics);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (15)
Semantics\ConstantTests.cs (1)
1453var block = ParseAndBindMethodBody(source);
Semantics\ImplicitlyTypeArraysTests.cs (1)
38var block = MethodCompiler.BindSynthesizedMethodBody(method, new TypeCompilationState(method.ContainingType, compilation, null), diagnostics);
Semantics\OperatorTests.cs (3)
3204var block = MethodCompiler.BindSynthesizedMethodBody(method, new TypeCompilationState(method.ContainingType, compilation, null), diagnostics); 7334var block = binder.BindEmbeddedBlock(methodBody, diagnostics); 8818var block = binder.BindEmbeddedBlock(methodBody, diagnostics);
Semantics\OverloadResolutionTestBase.cs (1)
37var block = MethodCompiler.BindSynthesizedMethodBody(method, new TypeCompilationState(method.ContainingType, compilation, null), diagnostics);
Semantics\SemanticAnalyzerTests.cs (7)
1318var block = ParseAndBindMethodBody(@" 1346var block = ParseAndBindMethodBody(@" 1374var block = ParseAndBindMethodBody(@" 1405var block = ParseAndBindMethodBody(@" 1439var block = ParseAndBindMethodBody(@" 1474var block = ParseAndBindMethodBody(@" 1509var block = ParseAndBindMethodBody(@"
Semantics\UnsafeTests.cs (2)
5206var block = binder.BindEmbeddedBlock(methodBody, unusedDiagnostics); 5231public static void Process(BoundBlock block, Binder binder, ArrayBuilder<string> builder)
Microsoft.CodeAnalysis.CSharp.Test.Utilities (4)
CompilingTestBase.cs (2)
23internal static BoundBlock ParseAndBindMethodBody(string program, string typeName = DefaultTypeName, string methodName = DefaultMethodName) 39var block = MethodCompiler.BindSynthesizedMethodBody(method, compilationState, diagnostics);
Extensions.cs (2)
943public static BoundBlock BindEmbeddedBlock(this Microsoft.CodeAnalysis.CSharp.Binder binder, BlockSyntax node, DiagnosticBag diagnostics) 946var result = binder.BindEmbeddedBlock(node, bindingDiagnostics);