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)
1861internal virtual BoundBlock BindEmbeddedBlock(BlockSyntax node, BindingDiagnosticBag diagnostics)
1866private BoundBlock BindBlock(BlockSyntax node, BindingDiagnosticBag diagnostics)
1879private BoundBlock BindBlockParts(BlockSyntax node, BindingDiagnosticBag diagnostics)
1895private BoundBlock FinishBindBlockParts(CSharpSyntaxNode node, ImmutableArray<BoundStatement> boundStatements)
3204var tryBlock = BindEmbeddedBlock(node.Block, diagnostics);
3345var block = BindEmbeddedBlock(node.Block, diagnostics);
3446internal BoundBlock CreateBlockFromExpression(CSharpSyntaxNode node, ImmutableArray<LocalSymbol> locals, RefKind refKind, BoundExpression expression, ExpressionSyntax expressionSyntax, BindingDiagnosticBag diagnostics)
3543internal virtual BoundBlock BindExpressionBodyAsBlock(
3571static BoundBlock bindExpressionBodyAsBlockInternal(ArrowExpressionClauseSyntax expressionBody, Binder bodyBinder, BindingDiagnosticBag diagnostics)
3584public BoundBlock BindLambdaExpressionAsBlock(ExpressionSyntax body, BindingDiagnosticBag diagnostics)
3596public BoundBlock CreateBlockFromExpression(ExpressionSyntax body, BoundExpression expression, BindingDiagnosticBag diagnostics)
3749constructor.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)
1041public BoundExtractedFinallyBlock(SyntaxNode syntax, BoundBlock finallyBlock, bool hasErrors = false)
1050public BoundBlock FinallyBlock { get; }
1055public BoundExtractedFinallyBlock Update(BoundBlock finallyBlock)
3327public BoundBlock Update(ImmutableArray<LocalSymbol> locals, ImmutableArray<LocalFunctionSymbol> localFunctions, bool hasUnsafeModifier, BoundBlockInstrumentation? instrumentation, ImmutableArray<BoundStatement> statements)
3331var result = new BoundBlock(this.Syntax, locals, localFunctions, hasUnsafeModifier, instrumentation, statements, this.HasErrors);
3507public BoundLocalFunctionStatement(SyntaxNode syntax, LocalFunctionSymbol symbol, BoundBlock? blockBody, BoundBlock? expressionBody, bool hasErrors = false)
3519public BoundBlock? BlockBody { get; }
3520public BoundBlock? ExpressionBody { get; }
3525public BoundLocalFunctionStatement Update(LocalFunctionSymbol symbol, BoundBlock? blockBody, BoundBlock? expressionBody)
4223public BoundTryStatement(SyntaxNode syntax, BoundBlock tryBlock, ImmutableArray<BoundCatchBlock> catchBlocks, BoundBlock? finallyBlockOpt, LabelSymbol? finallyLabelOpt, bool preferFaultHandler, bool hasErrors = false)
4237public BoundBlock TryBlock { get; }
4239public BoundBlock? FinallyBlockOpt { get; }
4246public BoundTryStatement Update(BoundBlock tryBlock, ImmutableArray<BoundCatchBlock> catchBlocks, BoundBlock? finallyBlockOpt, LabelSymbol? finallyLabelOpt, bool preferFaultHandler)
4260public BoundCatchBlock(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundExpression? exceptionSourceOpt, TypeSymbol? exceptionTypeOpt, BoundStatementList? exceptionFilterPrologueOpt, BoundExpression? exceptionFilterOpt, BoundBlock body, bool isSynthesizedAsyncCatchAll, bool hasErrors = false)
4281public BoundBlock Body { get; }
4287public BoundCatchBlock Update(ImmutableArray<LocalSymbol> locals, BoundExpression? exceptionSourceOpt, TypeSymbol? exceptionTypeOpt, BoundStatementList? exceptionFilterPrologueOpt, BoundExpression? exceptionFilterOpt, BoundBlock body, bool isSynthesizedAsyncCatchAll)
7593public BoundLambda(SyntaxNode syntax, UnboundLambda unboundLambda, LambdaSymbol symbol, BoundBlock body, ReadOnlyBindingDiagnostic<AssemblySymbol> diagnostics, Binder binder, TypeSymbol? type, bool hasErrors = false)
7612public BoundBlock Body { get; }
7619public BoundLambda Update(UnboundLambda unboundLambda, LambdaSymbol symbol, BoundBlock body, ReadOnlyBindingDiagnostic<AssemblySymbol> diagnostics, Binder binder, TypeSymbol? type)
8731protected BoundMethodBodyBase(BoundKind kind, SyntaxNode syntax, BoundBlock? blockBody, BoundBlock? expressionBody, bool hasErrors = false)
8738public BoundBlock? BlockBody { get; }
8739public BoundBlock? ExpressionBody { get; }
8744public BoundNonConstructorMethodBody(SyntaxNode syntax, BoundBlock? blockBody, BoundBlock? expressionBody, bool hasErrors = false)
8753public BoundNonConstructorMethodBody Update(BoundBlock? blockBody, BoundBlock? expressionBody)
8767public BoundConstructorMethodBody(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundStatement? initializer, BoundBlock? blockBody, BoundBlock? expressionBody, bool hasErrors = false)
8783public BoundConstructorMethodBody Update(ImmutableArray<LocalSymbol> locals, BoundStatement? initializer, BoundBlock? blockBody, BoundBlock? expressionBody)
9036return VisitBlock((BoundBlock)node, arg);
9424public virtual R VisitBlock(BoundBlock node, A arg) => this.DefaultVisit(node, arg);
9660public virtual BoundNode? VisitBlock(BoundBlock node) => this.DefaultVisit(node);
10110public override BoundNode? VisitBlock(BoundBlock node)
10946BoundBlock finallyBlock = (BoundBlock)this.Visit(node.FinallyBlock);
11320public override BoundNode? VisitBlock(BoundBlock node)
11356BoundBlock? blockBody = (BoundBlock?)this.Visit(node.BlockBody);
11357BoundBlock? expressionBody = (BoundBlock?)this.Visit(node.ExpressionBody);
11464BoundBlock tryBlock = (BoundBlock)this.Visit(node.TryBlock);
11466BoundBlock? finallyBlockOpt = (BoundBlock?)this.Visit(node.FinallyBlockOpt);
11474BoundBlock body = (BoundBlock)this.Visit(node.Body);
12023BoundBlock body = (BoundBlock)this.Visit(node.Body);
12226BoundBlock? blockBody = (BoundBlock?)this.Visit(node.BlockBody);
12227BoundBlock? expressionBody = (BoundBlock?)this.Visit(node.ExpressionBody);
12233BoundBlock? blockBody = (BoundBlock?)this.Visit(node.BlockBody);
12234BoundBlock? expressionBody = (BoundBlock?)this.Visit(node.ExpressionBody);
13388public override BoundNode? VisitBlock(BoundBlock node)
13423BoundBlock? blockBody = (BoundBlock?)this.Visit(node.BlockBody);
13424BoundBlock? expressionBody = (BoundBlock?)this.Visit(node.ExpressionBody);
13505BoundBlock body = (BoundBlock)this.Visit(node.Body);
14581BoundBlock body = (BoundBlock)this.Visit(node.Body);
14953BoundBlock? blockBody = (BoundBlock?)this.Visit(node.BlockBody);
14954BoundBlock? expressionBody = (BoundBlock?)this.Visit(node.ExpressionBody);
15743public 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(