Binder\Binder_Statements.cs (19)
150BoundBlock block;
153(block = (BoundBlock)result).Statements.Length == 1 &&
564BoundBlock blockBody = null;
565BoundBlock expressionBody = null;
608BoundBlock runAnalysis(BoundBlock block, BindingDiagnosticBag blockDiagnostics)
1858internal virtual BoundBlock BindEmbeddedBlock(BlockSyntax node, BindingDiagnosticBag diagnostics)
1863private BoundBlock BindBlock(BlockSyntax node, BindingDiagnosticBag diagnostics)
1876private BoundBlock BindBlockParts(BlockSyntax node, BindingDiagnosticBag diagnostics)
1892private BoundBlock FinishBindBlockParts(CSharpSyntaxNode node, ImmutableArray<BoundStatement> boundStatements)
3201var tryBlock = BindEmbeddedBlock(node.Block, diagnostics);
3342var block = BindEmbeddedBlock(node.Block, diagnostics);
3443internal BoundBlock CreateBlockFromExpression(CSharpSyntaxNode node, ImmutableArray<LocalSymbol> locals, RefKind refKind, BoundExpression expression, ExpressionSyntax expressionSyntax, BindingDiagnosticBag diagnostics)
3540internal virtual BoundBlock BindExpressionBodyAsBlock(
3568static BoundBlock bindExpressionBodyAsBlockInternal(ArrowExpressionClauseSyntax expressionBody, Binder bodyBinder, BindingDiagnosticBag diagnostics)
3581public BoundBlock BindLambdaExpressionAsBlock(ExpressionSyntax body, BindingDiagnosticBag diagnostics)
3593public BoundBlock CreateBlockFromExpression(ExpressionSyntax body, BoundExpression expression, BindingDiagnosticBag diagnostics)
3746constructor.Body == null ? null : (BoundBlock)bodyBinder.BindStatement(constructor.Body, diagnostics),
4028blockBody == null ? null : (BoundBlock)BindStatement(blockBody, diagnostics),
BoundTree\UnboundLambda.cs (17)
25BoundBlock? Body { get; }
35BoundBlock? IBoundLambdaOrFunction.Body { get => this.Body; }
82public BoundLambda(SyntaxNode syntax, UnboundLambda unboundLambda, BoundBlock body, ReadOnlyBindingDiagnostic<AssemblySymbol> diagnostics, Binder binder, TypeSymbol? delegateType, InferredLambdaReturnType inferredReturnType)
347public static void GetReturnTypes(ArrayBuilder<(BoundReturnStatement, TypeWithAnnotations)> builder, BoundBlock block)
567protected BoundBlock BindLambdaBody(LambdaSymbol lambdaSymbol, Binder lambdaBodyBinder, BindingDiagnosticBag diagnostics)
578protected abstract BoundBlock BindLambdaBodyCore(LambdaSymbol lambdaSymbol, Binder lambdaBodyBinder, BindingDiagnosticBag diagnostics);
584protected abstract BoundExpression? GetLambdaExpressionBody(BoundBlock body);
589protected abstract BoundBlock CreateBlockFromLambdaExpressionBody(Binder lambdaBodyBinder, BoundExpression expression, BindingDiagnosticBag diagnostics);
718var block = BindLambdaBody(lambdaSymbol, lambdaBodyBinder, BindingDiagnosticBag.Discarded);
783BoundBlock block;
936(var lambdaSymbol, var block, var lambdaBodyBinder, var diagnostics) = BindWithParameterAndReturnType(parameterTypes, parameterRefKinds, returnType, refKind);
988private (LambdaSymbol lambdaSymbol, BoundBlock block, ExecutableCodeBinder lambdaBodyBinder, BindingDiagnosticBag diagnostics) BindWithParameterAndReturnType(
1001var block = BindLambdaBody(lambdaSymbol, lambdaBodyBinder, diagnostics);
1219(var lambdaSymbol, var block, var lambdaBodyBinder, var diagnostics) = BindWithParameterAndReturnType(parameterTypes, parameterRefKinds, returnType, refKind);
1564protected override BoundExpression? GetLambdaExpressionBody(BoundBlock body)
1579protected override BoundBlock CreateBlockFromLambdaExpressionBody(Binder lambdaBodyBinder, BoundExpression expression, BindingDiagnosticBag diagnostics)
1584protected override BoundBlock BindLambdaBodyCore(LambdaSymbol lambdaSymbol, Binder lambdaBodyBinder, BindingDiagnosticBag diagnostics)
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)
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)
165private static BoundBlock AppendImplicitReturn(BoundBlock body, MethodSymbol method, bool originalBodyNested)
174builder.Add(AppendImplicitReturn((BoundBlock)statements[n - 1], method));
187internal static BoundBlock AppendImplicitReturn(BoundBlock body, MethodSymbol method)
210BoundBlock block,
Generated\BoundNodes.xml.Generated.cs (76)
1040public BoundExtractedFinallyBlock(SyntaxNode syntax, BoundBlock finallyBlock, bool hasErrors = false)
1049public BoundBlock FinallyBlock { get; }
1054public BoundExtractedFinallyBlock Update(BoundBlock finallyBlock)
3326public BoundBlock Update(ImmutableArray<LocalSymbol> locals, ImmutableArray<LocalFunctionSymbol> localFunctions, bool hasUnsafeModifier, BoundBlockInstrumentation? instrumentation, ImmutableArray<BoundStatement> statements)
3330var result = new BoundBlock(this.Syntax, locals, localFunctions, hasUnsafeModifier, instrumentation, statements, this.HasErrors);
3506public BoundLocalFunctionStatement(SyntaxNode syntax, LocalFunctionSymbol symbol, BoundBlock? blockBody, BoundBlock? expressionBody, bool hasErrors = false)
3518public BoundBlock? BlockBody { get; }
3519public BoundBlock? ExpressionBody { get; }
3524public BoundLocalFunctionStatement Update(LocalFunctionSymbol symbol, BoundBlock? blockBody, BoundBlock? expressionBody)
4222public BoundTryStatement(SyntaxNode syntax, BoundBlock tryBlock, ImmutableArray<BoundCatchBlock> catchBlocks, BoundBlock? finallyBlockOpt, LabelSymbol? finallyLabelOpt, bool preferFaultHandler, bool hasErrors = false)
4236public BoundBlock TryBlock { get; }
4238public BoundBlock? FinallyBlockOpt { get; }
4245public BoundTryStatement Update(BoundBlock tryBlock, ImmutableArray<BoundCatchBlock> catchBlocks, BoundBlock? finallyBlockOpt, LabelSymbol? finallyLabelOpt, bool preferFaultHandler)
4259public BoundCatchBlock(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundExpression? exceptionSourceOpt, TypeSymbol? exceptionTypeOpt, BoundStatementList? exceptionFilterPrologueOpt, BoundExpression? exceptionFilterOpt, BoundBlock body, bool isSynthesizedAsyncCatchAll, bool hasErrors = false)
4280public BoundBlock Body { get; }
4286public BoundCatchBlock Update(ImmutableArray<LocalSymbol> locals, BoundExpression? exceptionSourceOpt, TypeSymbol? exceptionTypeOpt, BoundStatementList? exceptionFilterPrologueOpt, BoundExpression? exceptionFilterOpt, BoundBlock body, bool isSynthesizedAsyncCatchAll)
7592public BoundLambda(SyntaxNode syntax, UnboundLambda unboundLambda, LambdaSymbol symbol, BoundBlock body, ReadOnlyBindingDiagnostic<AssemblySymbol> diagnostics, Binder binder, TypeSymbol? type, bool hasErrors = false)
7611public BoundBlock Body { get; }
7618public BoundLambda Update(UnboundLambda unboundLambda, LambdaSymbol symbol, BoundBlock body, ReadOnlyBindingDiagnostic<AssemblySymbol> diagnostics, Binder binder, TypeSymbol? type)
8694protected BoundMethodBodyBase(BoundKind kind, SyntaxNode syntax, BoundBlock? blockBody, BoundBlock? expressionBody, bool hasErrors = false)
8701public BoundBlock? BlockBody { get; }
8702public BoundBlock? ExpressionBody { get; }
8707public BoundNonConstructorMethodBody(SyntaxNode syntax, BoundBlock? blockBody, BoundBlock? expressionBody, bool hasErrors = false)
8716public BoundNonConstructorMethodBody Update(BoundBlock? blockBody, BoundBlock? expressionBody)
8730public BoundConstructorMethodBody(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundStatement? initializer, BoundBlock? blockBody, BoundBlock? expressionBody, bool hasErrors = false)
8746public BoundConstructorMethodBody Update(ImmutableArray<LocalSymbol> locals, BoundStatement? initializer, BoundBlock? blockBody, BoundBlock? expressionBody)
8999return VisitBlock((BoundBlock)node, arg);
9387public virtual R VisitBlock(BoundBlock node, A arg) => this.DefaultVisit(node, arg);
9623public virtual BoundNode? VisitBlock(BoundBlock node) => this.DefaultVisit(node);
10073public override BoundNode? VisitBlock(BoundBlock node)
10909BoundBlock finallyBlock = (BoundBlock)this.Visit(node.FinallyBlock);
11283public override BoundNode? VisitBlock(BoundBlock node)
11319BoundBlock? blockBody = (BoundBlock?)this.Visit(node.BlockBody);
11320BoundBlock? expressionBody = (BoundBlock?)this.Visit(node.ExpressionBody);
11427BoundBlock tryBlock = (BoundBlock)this.Visit(node.TryBlock);
11429BoundBlock? finallyBlockOpt = (BoundBlock?)this.Visit(node.FinallyBlockOpt);
11437BoundBlock body = (BoundBlock)this.Visit(node.Body);
11986BoundBlock body = (BoundBlock)this.Visit(node.Body);
12189BoundBlock? blockBody = (BoundBlock?)this.Visit(node.BlockBody);
12190BoundBlock? expressionBody = (BoundBlock?)this.Visit(node.ExpressionBody);
12196BoundBlock? blockBody = (BoundBlock?)this.Visit(node.BlockBody);
12197BoundBlock? expressionBody = (BoundBlock?)this.Visit(node.ExpressionBody);
13351public override BoundNode? VisitBlock(BoundBlock node)
13386BoundBlock? blockBody = (BoundBlock?)this.Visit(node.BlockBody);
13387BoundBlock? expressionBody = (BoundBlock?)this.Visit(node.ExpressionBody);
13468BoundBlock body = (BoundBlock)this.Visit(node.Body);
14544BoundBlock body = (BoundBlock)this.Visit(node.Body);
14916BoundBlock? blockBody = (BoundBlock?)this.Visit(node.BlockBody);
14917BoundBlock? expressionBody = (BoundBlock?)this.Visit(node.ExpressionBody);
15706public override TreeDumperNode VisitBlock(BoundBlock node, object? arg) => new TreeDumperNode("block", null, new TreeDumperNode[]
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\SyntheticBoundNodeFactory.cs (16)
443public BoundBlock Block()
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)
478public BoundExtractedFinallyBlock ExtractedFinallyBlock(BoundBlock finallyBlock)
951var firstPart = this.Block(locals, statements.ToImmutable());
965var firstPart = this.Block(locals, statements.ToImmutable());
1576BoundBlock tryBlock,
1578BoundBlock? finallyBlock = null,
1592BoundBlock block)
1600BoundBlock block)
1605internal BoundTryStatement Fault(BoundBlock tryBlock, BoundBlock faultBlock)
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListEnumeratorConstructor.cs (1)
33var block = f.Block(