51 instantiations of BoundBlock
Microsoft.CodeAnalysis.CSharp (49)
Binder\Binder.cs (2)
869return new BoundBlock(statement.Syntax, locals, ImmutableArray.Create(statement)) 885return new BoundBlock(statement.Syntax, locals, localFunctions, hasUnsafeModifier: false, instrumentation: null,
Binder\Binder_Statements.cs (3)
1887return new BoundBlock( 3431return new BoundBlock(node, locals, ImmutableArray.Create(statement)) { WasCompilerGenerated = node.Kind() != SyntaxKind.ArrowExpressionClause }; 3599blockBody: 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)
605return new BoundBlock(syntax, ImmutableArray<LocalSymbol>.Empty, ImmutableArray.Create(statement)) 611return new BoundBlock(syntax, ImmutableArray<LocalSymbol>.Empty, statements) { WasCompilerGenerated = true }; 616return new BoundBlock(syntax, ImmutableArray<LocalSymbol>.Empty, statements.AsImmutableOrNull()) { WasCompilerGenerated = true };
Compiler\MethodBodySynthesizer.cs (3)
509return new BoundBlock(syntax, 556return new BoundBlock( 564new BoundBlock(
Compiler\MethodCompiler.cs (3)
1012body = new BoundBlock(methodSymbol.GetNonNullSyntaxNode(), ImmutableArray<LocalSymbol>.Empty, ImmutableArray<BoundStatement>.Empty) { WasCompilerGenerated = true }; 1895body = new BoundBlock(constructor.Syntax, constructor.Locals, ImmutableArray.Create<BoundStatement>(constructor.Initializer)); 1899body = 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)
3219var result = new BoundBlock(this.Syntax, locals, localFunctions, hasUnsafeModifier, instrumentation, statements, this.HasErrors);
Lowering\ClosureConversion\ClosureConversion.cs (2)
296body = new BoundBlock(body.Syntax, _addedLocals.ToImmutableAndFree(), _addedStatements.ToImmutableAndFree()) { WasCompilerGenerated = true }; 1304return 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_Block.cs (2)
42return new BoundBlock(node.Syntax, node.Locals.AddRange(additionalLocals), node.LocalFunctions, node.HasUnsafeModifier, instrumentation, builder.ToImmutableAndFree(), node.HasErrors); 105? new BoundBlock(node.Syntax, ImmutableArray<LocalSymbol>.Empty, ImmutableArray<BoundStatement>.Empty)
Lowering\LocalRewriter\LocalRewriter_DoStatement.cs (1)
67new BoundBlock(syntax,
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (7)
208result = new BoundBlock( 220result = new BoundBlock( 346finallyBlockOpt = new BoundBlock(forEachSyntax, 402finallyBlockOpt = new BoundBlock(forEachSyntax, 417tryBlock: new BoundBlock(forEachSyntax, 676return new BoundBlock( 984BoundStatement result = new BoundBlock(
Lowering\LocalRewriter\LocalRewriter_ForStatement.cs (3)
166return new BoundBlock(syntax, outerLocals, statements, hasErrors); 262statementBuilder.Add(new BoundBlock(syntax, node.InnerLocals, blockBuilder.ToImmutableAndFree())); 268return new BoundBlock(syntax, node.OuterLocals, statements, node.HasErrors);
Lowering\LocalRewriter\LocalRewriter_LockStatement.cs (2)
123return new BoundBlock( 173return new BoundBlock(
Lowering\LocalRewriter\LocalRewriter_UsingStatement.cs (4)
79return new BoundBlock( 91BoundBlock body = new BoundBlock(syntax, ImmutableArray<LocalSymbol>.Empty, statements); 192return new BoundBlock( 255return new BoundBlock(
Lowering\LocalRewriter\LocalRewriter_WhileStatement.cs (1)
143new BoundBlock(syntax,
Lowering\SpillSequenceSpiller.cs (1)
297var result = new BoundBlock(statement.Syntax, builder.GetLocals(), builder.GetStatements()) { WasCompilerGenerated = true };
Lowering\SyntheticBoundNodeFactory.cs (2)
478return 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)
387return new BoundBlock( 410return new BoundBlock( 481return new BoundBlock( 488return new BoundBlock(syntax, 604return new BoundBlock(syntax,
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler (2)
Symbols\EEConstructorSymbol.cs (1)
29new BoundBlock(
Symbols\EEMethodSymbol.cs (1)
574body = new BoundBlock(syntax, localsBuilder.ToImmutableAndFree(), statementsBuilder.ToImmutableAndFree()) { WasCompilerGenerated = true };
360 references to BoundBlock
Microsoft.CodeAnalysis.CSharp (337)
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 BindLambdaBody(LambdaSymbol lambdaSymbol, Binder lambdaBodyBinder, BindingDiagnosticBag diagnostics)
Binder\Binder_Query.cs (1)
767private BoundBlock CreateLambdaBlockForQueryClause(ExpressionSyntax expression, BoundExpression result, BindingDiagnosticBag diagnostics)
Binder\Binder_Statements.cs (20)
149BoundBlock block; 152(block = (BoundBlock)result).Statements.Length == 1 && 561BoundBlock blockBody = null; 562BoundBlock expressionBody = null; 605BoundBlock runAnalysis(BoundBlock block, BindingDiagnosticBag blockDiagnostics) 1849internal virtual BoundBlock BindEmbeddedBlock(BlockSyntax node, BindingDiagnosticBag diagnostics) 1854private BoundBlock BindBlock(BlockSyntax node, BindingDiagnosticBag diagnostics) 1867private BoundBlock BindBlockParts(BlockSyntax node, BindingDiagnosticBag diagnostics) 1883private BoundBlock FinishBindBlockParts(CSharpSyntaxNode node, ImmutableArray<BoundStatement> boundStatements) 3103var tryBlock = BindEmbeddedBlock(node.Block, diagnostics); 3105var finallyBlockOpt = (node.Finally != null) ? BindEmbeddedBlock(node.Finally.Block, diagnostics) : null; 3244var block = BindEmbeddedBlock(node.Block, diagnostics); 3345internal BoundBlock CreateBlockFromExpression(CSharpSyntaxNode node, ImmutableArray<LocalSymbol> locals, RefKind refKind, BoundExpression expression, ExpressionSyntax expressionSyntax, BindingDiagnosticBag diagnostics) 3442internal virtual BoundBlock BindExpressionBodyAsBlock( 3470static BoundBlock bindExpressionBodyAsBlockInternal(ArrowExpressionClauseSyntax expressionBody, Binder bodyBinder, BindingDiagnosticBag diagnostics) 3483public BoundBlock BindLambdaExpressionAsBlock(ExpressionSyntax body, BindingDiagnosticBag diagnostics) 3495public BoundBlock CreateBlockFromExpression(ExpressionSyntax body, BoundExpression expression, BindingDiagnosticBag diagnostics) 3648constructor.Body == null ? null : (BoundBlock)bodyBinder.BindStatement(constructor.Body, diagnostics), 3933blockBody == null ? null : (BoundBlock)BindStatement(blockBody, diagnostics),
Binder\RefSafetyAnalysis.cs (1)
227public override BoundNode? VisitBlock(BoundBlock node)
BoundTree\BoundLocalFunctionStatement.cs (1)
13public BoundBlock? Body { get => BlockBody ?? ExpressionBody; }
BoundTree\BoundNode.cs (1)
499public override BoundNode? VisitBlock(BoundBlock node)
BoundTree\BoundNode_Source.cs (2)
51var finallyBlock = tryStatement.FinallyBlockOpt; 69case BoundBlock block:
BoundTree\BoundTreeVisitors.cs (1)
72return VisitBlock(node as BoundBlock, arg);
BoundTree\Constructors.cs (5)
603public static BoundBlock SynthesizedNoLocals(SyntaxNode syntax, BoundStatement statement) 609public static BoundBlock SynthesizedNoLocals(SyntaxNode syntax, ImmutableArray<BoundStatement> statements) 614public static BoundBlock SynthesizedNoLocals(SyntaxNode syntax, params BoundStatement[] statements) 630public BoundTryStatement(SyntaxNode syntax, BoundBlock tryBlock, ImmutableArray<BoundCatchBlock> catchBlocks, BoundBlock? finallyBlockOpt, LabelSymbol? finallyLabelOpt = null)
BoundTree\UnboundLambda.cs (16)
25BoundBlock? Body { get; } 35BoundBlock? IBoundLambdaOrFunction.Body { get => this.Body; } 82public BoundLambda(SyntaxNode syntax, UnboundLambda unboundLambda, BoundBlock body, ImmutableBindingDiagnostic<AssemblySymbol> diagnostics, Binder binder, TypeSymbol? delegateType, InferredLambdaReturnType inferredReturnType) 347public static void GetReturnTypes(ArrayBuilder<(BoundReturnStatement, TypeWithAnnotations)> builder, BoundBlock block) 558protected abstract BoundBlock BindLambdaBody(LambdaSymbol lambdaSymbol, Binder lambdaBodyBinder, BindingDiagnosticBag diagnostics); 564protected abstract BoundExpression? GetLambdaExpressionBody(BoundBlock body); 569protected abstract BoundBlock CreateBlockFromLambdaExpressionBody(Binder lambdaBodyBinder, BoundExpression expression, BindingDiagnosticBag diagnostics); 682var block = BindLambdaBody(lambdaSymbol, lambdaBodyBinder, BindingDiagnosticBag.Discarded); 744BoundBlock block; 896(var lambdaSymbol, var block, var lambdaBodyBinder, var diagnostics) = BindWithParameterAndReturnType(parameterTypes, parameterRefKinds, returnType, refKind); 948private (LambdaSymbol lambdaSymbol, BoundBlock block, ExecutableCodeBinder lambdaBodyBinder, BindingDiagnosticBag diagnostics) BindWithParameterAndReturnType( 961var block = BindLambdaBody(lambdaSymbol, lambdaBodyBinder, diagnostics); 1179(var lambdaSymbol, var block, var lambdaBodyBinder, var diagnostics) = BindWithParameterAndReturnType(parameterTypes, parameterRefKinds, returnType, refKind); 1529protected override BoundExpression? GetLambdaExpressionBody(BoundBlock body) 1544protected override BoundBlock CreateBlockFromLambdaExpressionBody(Binder lambdaBodyBinder, BoundExpression expression, BindingDiagnosticBag diagnostics) 1549protected override BoundBlock BindLambdaBody(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) 714private void EmitUninstrumentedBlock(BoundBlock block) 963var finallyClone = FinallyCloner.MakeFinallyClone(statement); 1918public static BoundBlock MakeFinallyClone(BoundTryStatement node) 1921return (BoundBlock)cloner.Visit(node.FinallyBlockOpt);
CodeGen\Optimizer.cs (9)
613public override BoundNode VisitBlock(BoundBlock node) 1604var tryBlock = (BoundBlock)this.Visit(node.TryBlock); 1609var finallyBlock = (BoundBlock)this.Visit(node.FinallyBlockOpt); 1674var boundBlock = (BoundBlock)this.Visit(node.Body); 2169var body = node.Body; 2207body = (BoundBlock)this.Visit(body);
Compilation\MemberSemanticModel.cs (6)
2414internal override BoundBlock BindEmbeddedBlock(BlockSyntax node, BindingDiagnosticBag diagnostics) 2416BoundBlock block = (BoundBlock)TryGetBoundNodeFromMap(node); 2469internal override BoundBlock BindExpressionBodyAsBlock(ArrowExpressionClauseSyntax node, BindingDiagnosticBag diagnostics) 2471BoundBlock block = (BoundBlock)TryGetBoundNodeFromMap(node);
Compiler\MethodBodySynthesizer.cs (11)
173internal static BoundBlock ConstructAutoPropertyAccessorBody(SourceMemberMethodSymbol accessor) 208return BoundBlock.SynthesizedNoLocals(syntax, statement); 214internal static BoundBlock ConstructFieldLikeEventAccessorBody(SourceEventSymbol eventSymbol, bool isAddMethod, CSharpCompilation compilation, BindingDiagnosticBag diagnostics) 231internal static BoundBlock ConstructFieldLikeEventAccessorBody_WinRT(SourceEventSymbol eventSymbol, bool isAddMethod, CSharpCompilation compilation, BindingDiagnosticBag diagnostics) 309return BoundBlock.SynthesizedNoLocals(syntax, returnStatement); 319return BoundBlock.SynthesizedNoLocals(syntax, callStatement, returnStatement); 341internal static BoundBlock ConstructFieldLikeEventAccessorBody_Regular(SourceEventSymbol eventSymbol, bool isAddMethod, CSharpCompilation compilation, BindingDiagnosticBag diagnostics) 368return BoundBlock.SynthesizedNoLocals(syntax, @return); 411return BoundBlock.SynthesizedNoLocals(syntax, 522internal 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 (14)
875BoundBlock boundBody = MethodBodySynthesizer.ConstructFieldLikeEventAccessorBody(eventSymbol, isAddMethod, _compilation, diagnosticsThisMethod); 999BoundBlock body; 1022body = BoundBlock.SynthesizedNoLocals(initializerStatements.Syntax, initializerStatements.Statements); 1074body = (BoundBlock)body.WithHasErrors(); 1143BoundBlock flowAnalyzedBody = null; 1752internal static BoundBlock? BindSynthesizedMethodBody(MethodSymbol method, TypeCompilationState compilationState, BindingDiagnosticBag diagnostics) 1768private static BoundBlock? BindMethodBody( 1785BoundBlock? body; 1792body = BoundBlock.SynthesizedNoLocals(primaryCtor.GetSyntax()); 1922body = (BoundBlock)methodBody; 1948body = BoundBlock.SynthesizedNoLocals(node, stmts.ToImmutableAndFree()); 2000return BoundBlock.SynthesizedNoLocals(method.GetNonNullSyntaxNode(), statements); 2266private static BoundBlock GetSynthesizedEmptyBody(Symbol symbol) 2268return BoundBlock.SynthesizedNoLocals(symbol.GetNonNullSyntaxNode());
FlowAnalysis\AbstractFlowPass.cs (3)
1249public override BoundNode VisitBlock(BoundBlock node) 3605private void VisitMethodBodies(BoundBlock blockBody, BoundBlock expressionBody)
FlowAnalysis\ControlFlowPass.cs (6)
23private readonly ArrayBuilder<(LocalSymbol symbol, BoundBlock block)> _usingDeclarations = ArrayBuilder<(LocalSymbol, BoundBlock)>.GetInstance(); 24private BoundBlock _currentBlock = null; 154public static bool Analyze(CSharpCompilation compilation, Symbol member, BoundBlock block, DiagnosticBag diagnostics) 399public override BoundNode VisitBlock(BoundBlock node) 401var parentBlock = _currentBlock;
FlowAnalysis\DefiniteAssignment.cs (2)
1972public override BoundNode VisitBlock(BoundBlock node) 2004private void VisitStatementsWithLocalFunctions(BoundBlock block)
FlowAnalysis\FlowAnalysisPass.cs (10)
31public static BoundBlock Rewrite( 33BoundBlock block, 110private static BoundBlock PrependImplicitInitializations(BoundBlock body, MethodSymbol method, ImmutableArray<FieldSymbol> implicitlyInitializedFields, TypeCompilationState compilationState, BindingDiagnosticBag diagnostics) 145private static BoundBlock AppendImplicitReturn(BoundBlock body, MethodSymbol method, bool originalBodyNested) 154builder.Add(AppendImplicitReturn((BoundBlock)statements[n - 1], method)); 167internal static BoundBlock AppendImplicitReturn(BoundBlock body, MethodSymbol method) 190BoundBlock block,
FlowAnalysis\NullableWalker.cs (2)
2966public override BoundNode? VisitBlock(BoundBlock node) 2974private void VisitStatementsWithLocalFunctions(BoundBlock block)
Generated\BoundNodes.xml.Generated.cs (76)
1028public BoundExtractedFinallyBlock(SyntaxNode syntax, BoundBlock finallyBlock, bool hasErrors = false) 1037public BoundBlock FinallyBlock { get; } 1042public BoundExtractedFinallyBlock Update(BoundBlock finallyBlock) 3215public BoundBlock Update(ImmutableArray<LocalSymbol> locals, ImmutableArray<LocalFunctionSymbol> localFunctions, bool hasUnsafeModifier, BoundBlockInstrumentation? instrumentation, ImmutableArray<BoundStatement> statements) 3219var result = new BoundBlock(this.Syntax, locals, localFunctions, hasUnsafeModifier, instrumentation, statements, this.HasErrors); 3395public BoundLocalFunctionStatement(SyntaxNode syntax, LocalFunctionSymbol symbol, BoundBlock? blockBody, BoundBlock? expressionBody, bool hasErrors = false) 3407public BoundBlock? BlockBody { get; } 3408public BoundBlock? ExpressionBody { get; } 3413public BoundLocalFunctionStatement Update(LocalFunctionSymbol symbol, BoundBlock? blockBody, BoundBlock? expressionBody) 4111public BoundTryStatement(SyntaxNode syntax, BoundBlock tryBlock, ImmutableArray<BoundCatchBlock> catchBlocks, BoundBlock? finallyBlockOpt, LabelSymbol? finallyLabelOpt, bool preferFaultHandler, bool hasErrors = false) 4125public BoundBlock TryBlock { get; } 4127public BoundBlock? FinallyBlockOpt { get; } 4134public BoundTryStatement Update(BoundBlock tryBlock, ImmutableArray<BoundCatchBlock> catchBlocks, BoundBlock? finallyBlockOpt, LabelSymbol? finallyLabelOpt, bool preferFaultHandler) 4148public BoundCatchBlock(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundExpression? exceptionSourceOpt, TypeSymbol? exceptionTypeOpt, BoundStatementList? exceptionFilterPrologueOpt, BoundExpression? exceptionFilterOpt, BoundBlock body, bool isSynthesizedAsyncCatchAll, bool hasErrors = false) 4169public BoundBlock Body { get; } 4175public BoundCatchBlock Update(ImmutableArray<LocalSymbol> locals, BoundExpression? exceptionSourceOpt, TypeSymbol? exceptionTypeOpt, BoundStatementList? exceptionFilterPrologueOpt, BoundExpression? exceptionFilterOpt, BoundBlock body, bool isSynthesizedAsyncCatchAll) 7274public BoundLambda(SyntaxNode syntax, UnboundLambda unboundLambda, LambdaSymbol symbol, BoundBlock body, ImmutableBindingDiagnostic<AssemblySymbol> diagnostics, Binder binder, TypeSymbol? type, bool hasErrors = false) 7293public BoundBlock Body { get; } 7300public BoundLambda Update(UnboundLambda unboundLambda, LambdaSymbol symbol, BoundBlock body, ImmutableBindingDiagnostic<AssemblySymbol> diagnostics, Binder binder, TypeSymbol? type) 8376protected BoundMethodBodyBase(BoundKind kind, SyntaxNode syntax, BoundBlock? blockBody, BoundBlock? expressionBody, bool hasErrors = false) 8383public BoundBlock? BlockBody { get; } 8384public BoundBlock? ExpressionBody { get; } 8389public BoundNonConstructorMethodBody(SyntaxNode syntax, BoundBlock? blockBody, BoundBlock? expressionBody, bool hasErrors = false) 8398public BoundNonConstructorMethodBody Update(BoundBlock? blockBody, BoundBlock? expressionBody) 8412public BoundConstructorMethodBody(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundStatement? initializer, BoundBlock? blockBody, BoundBlock? expressionBody, bool hasErrors = false) 8428public BoundConstructorMethodBody Update(ImmutableArray<LocalSymbol> locals, BoundStatement? initializer, BoundBlock? blockBody, BoundBlock? expressionBody) 8675return VisitBlock((BoundBlock)node, arg); 9050public virtual R VisitBlock(BoundBlock node, A arg) => this.DefaultVisit(node, arg); 9278public virtual BoundNode? VisitBlock(BoundBlock node) => this.DefaultVisit(node); 9716public override BoundNode? VisitBlock(BoundBlock node) 10530BoundBlock finallyBlock = (BoundBlock)this.Visit(node.FinallyBlock); 10888public override BoundNode? VisitBlock(BoundBlock node) 10924BoundBlock? blockBody = (BoundBlock?)this.Visit(node.BlockBody); 10925BoundBlock? expressionBody = (BoundBlock?)this.Visit(node.ExpressionBody); 11032BoundBlock tryBlock = (BoundBlock)this.Visit(node.TryBlock); 11034BoundBlock? finallyBlockOpt = (BoundBlock?)this.Visit(node.FinallyBlockOpt); 11042BoundBlock body = (BoundBlock)this.Visit(node.Body); 11552BoundBlock body = (BoundBlock)this.Visit(node.Body); 11755BoundBlock? blockBody = (BoundBlock?)this.Visit(node.BlockBody); 11756BoundBlock? expressionBody = (BoundBlock?)this.Visit(node.ExpressionBody); 11762BoundBlock? blockBody = (BoundBlock?)this.Visit(node.BlockBody); 11763BoundBlock? expressionBody = (BoundBlock?)this.Visit(node.ExpressionBody); 12884public override BoundNode? VisitBlock(BoundBlock node) 12919BoundBlock? blockBody = (BoundBlock?)this.Visit(node.BlockBody); 12920BoundBlock? expressionBody = (BoundBlock?)this.Visit(node.ExpressionBody); 13001BoundBlock body = (BoundBlock)this.Visit(node.Body); 14007BoundBlock body = (BoundBlock)this.Visit(node.Body); 14379BoundBlock? blockBody = (BoundBlock?)this.Visit(node.BlockBody); 14380BoundBlock? expressionBody = (BoundBlock?)this.Visit(node.ExpressionBody); 15146public override TreeDumperNode VisitBlock(BoundBlock node, object? arg) => new TreeDumperNode("block", null, new TreeDumperNode[]
Lowering\AsyncRewriter\AsyncExceptionHandlerRewriter.cs (12)
141BoundBlock rewrittenFinally; 147rewrittenFinally = (BoundBlock)this.Visit(node.FinallyBlockOpt); 164return _F.Try((BoundBlock)finalizedRegion, ImmutableArray<BoundCatchBlock>.Empty, rewrittenFinally); 171rewrittenFinally = (BoundBlock)this.VisitBlock(node.FinallyBlockOpt); 190BoundBlock syntheticFinallyBlock = _F.Block( 226var completeTry = _F.Block( 233private BoundBlock PendBranches( 450var rewrittenTry = (BoundBlock)this.VisitBlock(node.TryBlock); 624var handler = _F.Block( 996public readonly List<BoundBlock> handlers; 1012this.handlers = new List<BoundBlock>();
Lowering\AsyncRewriter\AsyncIteratorMethodToStateMachineRewriter.cs (3)
378protected override BoundBlock VisitFinally(BoundBlock finallyBlock) 383var result = base.VisitFinally(finallyBlock);
Lowering\AsyncRewriter\AsyncMethodToStateMachineRewriter.cs (4)
217protected virtual BoundStatement GenerateTopLevelTry(BoundBlock tryBlock, ImmutableArray<BoundCatchBlock> catchBlocks) 342private BoundBlock VisitAwaitExpression(BoundAwaitExpression node, BoundExpression resultPlace) 371var awaitIfIncomplete = F.Block( 453private BoundBlock GenerateAwaitForIncompleteTask(LocalSymbol awaiterTemp)
Lowering\ClosureConversion\ClosureConversion.Analysis.Tree.cs (2)
398public override BoundNode VisitBlock(BoundBlock node) 550private BoundNode? VisitNestedFunction(MethodSymbol functionSymbol, BoundBlock? body)
Lowering\ClosureConversion\ClosureConversion.cs (9)
550var body = F.Block( 1134public override BoundNode VisitBlock(BoundBlock node) 1148private BoundBlock RewriteBlock(BoundBlock node, ArrayBuilder<BoundExpression> prologue, ArrayBuilder<LocalSymbol> newLocals) 1260var rewrittenBlock = (BoundBlock)this.Visit(node.Body); 1556if (node.Body is BoundBlock block) 1598var newBody = (BoundBlock)Visit(node.Body);
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (1)
133private BoundExpression TranslateLambdaBody(BoundBlock block)
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)
82public override void PreInstrumentBlock(BoundBlock original, LocalRewriter rewriter) 87public override void InstrumentBlock(BoundBlock original, LocalRewriter rewriter, ref TemporaryArray<LocalSymbol> additionalLocals, out BoundStatement? prologue, out BoundStatement? epilogue, out BoundBlockInstrumentation? instrumentation) 212ref BoundBlock rewrittenBody,
Lowering\Instrumentation\DebugInfoInjector.cs (4)
85var block = (BoundBlock)rewritten; 145public override void InstrumentBlock(BoundBlock original, LocalRewriter rewriter, ref TemporaryArray<LocalSymbol> additionalLocals, out BoundStatement? prologue, out BoundStatement? epilogue, out BoundBlockInstrumentation? instrumentation) 406ref BoundBlock rewrittenBody,
Lowering\Instrumentation\Instrumenter.cs (4)
61public virtual void PreInstrumentBlock(BoundBlock original, LocalRewriter rewriter) 70/// <param name="additionalLocals">Local symbols to be added to <see cref="BoundBlock.Locals"/> of the resulting block.</param> 73public virtual void InstrumentBlock(BoundBlock original, LocalRewriter rewriter, ref TemporaryArray<LocalSymbol> additionalLocals, out BoundStatement? prologue, out BoundStatement? epilogue, out BoundBlockInstrumentation? instrumentation) 283ref 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: 269public override void PreInstrumentBlock(BoundBlock original, LocalRewriter rewriter) 279public override void InstrumentBlock(BoundBlock original, LocalRewriter rewriter, ref TemporaryArray<LocalSymbol> additionalLocals, out BoundStatement? prologue, out BoundStatement? epilogue, out BoundBlockInstrumentation? instrumentation) 500ref BoundBlock rewrittenBody,
Lowering\IteratorRewriter\IteratorMethodToStateMachineRewriter.cs (7)
145var faultBlock = F.Block(F.ExpressionStatement(F.Call(F.This(), disposeMethod))); 146newBody = F.Fault((BoundBlock)newBody, faultBlock); 177var disposeBody = F.Block( 187private BoundBlock HandleReturn(BoundStatement newBody) 278var tryBlock = body != null ? F.Block(body) : F.Block(); 372(BoundBlock)Visit(node.TryBlock), 374(BoundBlock)Visit(node.FinallyBlockOpt),
Lowering\LocalRewriter\LocalRewriter.cs (8)
38private BoundBlock? _currentLambdaBody; 159internal BoundBlock? CurrentLambdaBody 297var oldLambdaBody = _currentLambdaBody; 360var oldLambdaBody = _currentLambdaBody; 621var block = (BoundBlock)initializer; 759var block = (BoundBlock)initializer;
Lowering\LocalRewriter\LocalRewriter_Block.cs (1)
15public override BoundNode VisitBlock(BoundBlock node)
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (3)
179var rewrittenBodyBlock = CreateBlockDeclaringIterationVariables(iterationVariables, iterationVarDecl, rewrittenBody, forEachSyntax); 286BoundBlock finallyBlockOpt; 661private static BoundBlock CreateBlockDeclaringIterationVariables(
Lowering\LocalRewriter\LocalRewriter_LockStatement.cs (4)
131BoundBlock.SynthesizedNoLocals(lockSyntax, ImmutableArray.Create<BoundStatement>( 135BoundBlock.SynthesizedNoLocals(lockSyntax, 181BoundBlock.SynthesizedNoLocals(lockSyntax, rewrittenBody), 183BoundBlock.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)
39BoundBlock tryBlock = rewrittenBody.Kind == BoundKind.Block 40? (BoundBlock)rewrittenBody 41: BoundBlock.SynthesizedNoLocals(node.Syntax, rewrittenBody); 62BoundBlock body, 71BoundBlock result = body; 91BoundBlock body = new BoundBlock(syntax, ImmutableArray<LocalSymbol>.Empty, statements); 107private BoundBlock MakeExpressionUsingStatement(BoundUsingStatement node, BoundBlock tryBlock) 205private BoundBlock RewriteDeclarationUsingStatement( 208BoundBlock tryBlock, 232return BoundBlock.SynthesizedNoLocals(declarationSyntax, rewrittenDeclaration, tryBlock); 268return BoundBlock.SynthesizedNoLocals(declarationSyntax, rewrittenDeclaration, tryFinally); 281BoundBlock tryBlock, 423finallyBlockOpt: BoundBlock.SynthesizedNoLocals(resourceSyntax, finallyStatement));
Lowering\MethodToClassRewriter.cs (4)
141(BoundBlock?)this.Visit(node.Body)!, 148public override BoundNode VisitBlock(BoundBlock node) 151protected BoundBlock VisitBlock(BoundBlock node, bool removeInstrumentation)
Lowering\SpillSequenceSpiller.cs (3)
297var result = new BoundBlock(statement.Syntax, builder.GetLocals(), builder.GetStatements()) { WasCompilerGenerated = true }; 652BoundBlock body = (BoundBlock)this.Visit(node.Body);
Lowering\StateMachineRewriter\IteratorAndAsyncCaptureWalker.cs (1)
341public override BoundNode VisitBlock(BoundBlock node)
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (9)
397internal BoundBlock MakeStateMachineScope(ImmutableArray<StateMachineFieldSymbol> hoistedLocals, BoundStatement statement) 409var rewrittenBlock = (BoundBlock)statement; 697public override BoundNode VisitBlock(BoundBlock node) 845BoundBlock tryBlock = F.Block((BoundStatement)this.Visit(node.TryBlock)); 864BoundBlock finallyBlockOpt = node.FinallyBlockOpt == null ? null : F.Block( 885protected virtual BoundBlock VisitFinally(BoundBlock finallyBlock) 887return (BoundBlock)this.Visit(finallyBlock);
Lowering\SyntheticBoundNodeFactory.cs (16)
456public BoundBlock Block() 461public BoundBlock Block(ImmutableArray<BoundStatement> statements) 466public BoundBlock Block(params BoundStatement[] statements) 471public BoundBlock Block(ImmutableArray<LocalSymbol> locals, params BoundStatement[] statements) 476public BoundBlock Block(ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundStatement> statements) 481public BoundBlock Block(ImmutableArray<LocalSymbol> locals, ImmutableArray<LocalFunctionSymbol> localFunctions, params BoundStatement[] statements) 486public BoundBlock Block(ImmutableArray<LocalSymbol> locals, ImmutableArray<LocalFunctionSymbol> localFunctions, ImmutableArray<BoundStatement> statements) 491public BoundExtractedFinallyBlock ExtractedFinallyBlock(BoundBlock finallyBlock) 888var firstPart = this.Block(locals, statements.ToImmutable()); 902var firstPart = this.Block(locals, statements.ToImmutable()); 1452BoundBlock tryBlock, 1454BoundBlock? finallyBlock = null, 1468BoundBlock block) 1476BoundBlock block) 1481internal BoundTryStatement Fault(BoundBlock tryBlock, BoundBlock faultBlock)
Operations\CSharpOperationFactory.cs (2)
159return CreateBoundBlockOperation((BoundBlock)boundNode); 1673private IBlockOperation CreateBoundBlockOperation(BoundBlock boundBlock)
Symbols\Synthesized\SynthesizedEntryPointSymbol.cs (4)
60internal abstract BoundBlock CreateBody(BindingDiagnosticBag diagnostics); 381internal override BoundBlock CreateBody(BindingDiagnosticBag diagnostics) 452internal override BoundBlock CreateBody(BindingDiagnosticBag diagnostics) 550internal override BoundBlock CreateBody(BindingDiagnosticBag diagnostics)
Symbols\Synthesized\SynthesizedInstanceConstructor.cs (1)
310var block = factory.Block(statements.ToImmutableAndFree());
Symbols\Synthesized\SynthesizedThrowIfNullMethod.cs (1)
41var body = F.Block(
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (1)
FlowAnalysis\FlowTestBase.cs (1)
32var boundBody = MethodCompiler.BindSynthesizedMethodBody(sourceSymbol, compilationState, new BindingDiagnosticBag(new DiagnosticBag()));
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler (4)
Rewriters\CapturedVariableRewriter.cs (1)
46public override BoundNode VisitBlock(BoundBlock node)
Rewriters\LocalDeclarationRewriter.cs (1)
60return BoundBlock.SynthesizedNoLocals(node.Syntax, builder.ToImmutableAndFree());
Symbols\EEMethodSymbol.cs (2)
680var block = (BoundBlock)body;
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (15)
Semantics\ConstantTests.cs (1)
1453var block = ParseAndBindMethodBody(source);
Semantics\ImplicitlyTypeArraysTests.cs (1)
40var block = MethodCompiler.BindSynthesizedMethodBody(method, new TypeCompilationState(method.ContainingType, compilation, null), new BindingDiagnosticBag(diagnostics));
Semantics\OperatorTests.cs (3)
3204var block = MethodCompiler.BindSynthesizedMethodBody(method, new TypeCompilationState(method.ContainingType, compilation, null), new BindingDiagnosticBag(diagnostics)); 7333var block = binder.BindEmbeddedBlock(methodBody, diagnostics); 8816var block = binder.BindEmbeddedBlock(methodBody, diagnostics);
Semantics\OverloadResolutionTestBase.cs (1)
36var block = MethodCompiler.BindSynthesizedMethodBody(method, new TypeCompilationState(method.ContainingType, compilation, null), new BindingDiagnosticBag(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)
2394var block = binder.BindEmbeddedBlock(methodBody, unusedDiagnostics); 2419public static void Process(BoundBlock block, Binder binder, ArrayBuilder<string> builder)
Microsoft.CodeAnalysis.CSharp.Test.Utilities (3)
CompilingTestBase.cs (2)
23internal static BoundBlock ParseAndBindMethodBody(string program, string typeName = DefaultTypeName, string methodName = DefaultMethodName) 39var block = MethodCompiler.BindSynthesizedMethodBody(method, compilationState, new BindingDiagnosticBag(diagnostics));
Extensions.cs (1)
899public static BoundBlock BindEmbeddedBlock(this Microsoft.CodeAnalysis.CSharp.Binder binder, BlockSyntax node, DiagnosticBag diagnostics)