Binder\Binder_Statements.cs (19)
150BoundBlock block;
153(block = (BoundBlock)result).Statements.Length == 1 &&
566BoundBlock blockBody = null;
567BoundBlock expressionBody = null;
610BoundBlock runAnalysis(BoundBlock block, BindingDiagnosticBag blockDiagnostics)
1873internal virtual BoundBlock BindEmbeddedBlock(BlockSyntax node, BindingDiagnosticBag diagnostics)
1878private BoundBlock BindBlock(BlockSyntax node, BindingDiagnosticBag diagnostics)
1891private BoundBlock BindBlockParts(BlockSyntax node, BindingDiagnosticBag diagnostics)
1907private BoundBlock FinishBindBlockParts(CSharpSyntaxNode node, ImmutableArray<BoundStatement> boundStatements)
3220var tryBlock = BindEmbeddedBlock(node.Block, diagnostics);
3363var block = BindEmbeddedBlock(node.Block, diagnostics);
3464internal BoundBlock CreateBlockFromExpression(CSharpSyntaxNode node, ImmutableArray<LocalSymbol> locals, RefKind refKind, BoundExpression expression, ExpressionSyntax expressionSyntax, BindingDiagnosticBag diagnostics)
3561internal virtual BoundBlock BindExpressionBodyAsBlock(
3589static BoundBlock bindExpressionBodyAsBlockInternal(ArrowExpressionClauseSyntax expressionBody, Binder bodyBinder, BindingDiagnosticBag diagnostics)
3602public BoundBlock BindLambdaExpressionAsBlock(ExpressionSyntax body, BindingDiagnosticBag diagnostics)
3614public BoundBlock CreateBlockFromExpression(ExpressionSyntax body, BoundExpression expression, BindingDiagnosticBag diagnostics)
3767constructor.Body == null ? null : (BoundBlock)bodyBinder.BindStatement(constructor.Body, diagnostics),
4046blockBody == 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)
588protected BoundBlock BindLambdaBody(LambdaSymbol lambdaSymbol, Binder lambdaBodyBinder, BindingDiagnosticBag diagnostics)
599protected abstract BoundBlock BindLambdaBodyCore(LambdaSymbol lambdaSymbol, Binder lambdaBodyBinder, BindingDiagnosticBag diagnostics);
605protected abstract BoundExpression? GetLambdaExpressionBody(BoundBlock body);
610protected abstract BoundBlock CreateBlockFromLambdaExpressionBody(Binder lambdaBodyBinder, BoundExpression expression, BindingDiagnosticBag diagnostics);
739var block = BindLambdaBody(lambdaSymbol, lambdaBodyBinder, BindingDiagnosticBag.Discarded);
804BoundBlock block;
957(var lambdaSymbol, var block, var lambdaBodyBinder, var diagnostics) = BindWithParameterAndReturnType(parameterTypes, parameterRefKinds, returnType, refKind);
1009private (LambdaSymbol lambdaSymbol, BoundBlock block, ExecutableCodeBinder lambdaBodyBinder, BindingDiagnosticBag diagnostics) BindWithParameterAndReturnType(
1022var block = BindLambdaBody(lambdaSymbol, lambdaBodyBinder, diagnostics);
1240(var lambdaSymbol, var block, var lambdaBodyBinder, var diagnostics) = BindWithParameterAndReturnType(parameterTypes, parameterRefKinds, returnType, refKind);
1585protected override BoundExpression? GetLambdaExpressionBody(BoundBlock body)
1600protected override BoundBlock CreateBlockFromLambdaExpressionBody(Binder lambdaBodyBinder, BoundExpression expression, BindingDiagnosticBag diagnostics)
1605protected 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)
3325public BoundBlock Update(ImmutableArray<LocalSymbol> locals, ImmutableArray<MethodSymbol> localFunctions, bool hasUnsafeModifier, BoundBlockInstrumentation? instrumentation, ImmutableArray<BoundStatement> statements)
3329var result = new BoundBlock(this.Syntax, locals, localFunctions, hasUnsafeModifier, instrumentation, statements, this.HasErrors);
3505public BoundLocalFunctionStatement(SyntaxNode syntax, MethodSymbol symbol, BoundBlock? blockBody, BoundBlock? expressionBody, bool hasErrors = false)
3517public BoundBlock? BlockBody { get; }
3518public BoundBlock? ExpressionBody { get; }
3523public BoundLocalFunctionStatement Update(MethodSymbol symbol, BoundBlock? blockBody, BoundBlock? expressionBody)
4221public BoundTryStatement(SyntaxNode syntax, BoundBlock tryBlock, ImmutableArray<BoundCatchBlock> catchBlocks, BoundBlock? finallyBlockOpt, LabelSymbol? finallyLabelOpt, bool preferFaultHandler, bool hasErrors = false)
4235public BoundBlock TryBlock { get; }
4237public BoundBlock? FinallyBlockOpt { get; }
4244public BoundTryStatement Update(BoundBlock tryBlock, ImmutableArray<BoundCatchBlock> catchBlocks, BoundBlock? finallyBlockOpt, LabelSymbol? finallyLabelOpt, bool preferFaultHandler)
4258public BoundCatchBlock(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundExpression? exceptionSourceOpt, TypeSymbol? exceptionTypeOpt, BoundStatementList? exceptionFilterPrologueOpt, BoundExpression? exceptionFilterOpt, BoundBlock body, bool isSynthesizedAsyncCatchAll, bool hasErrors = false)
4279public BoundBlock Body { get; }
4285public BoundCatchBlock Update(ImmutableArray<LocalSymbol> locals, BoundExpression? exceptionSourceOpt, TypeSymbol? exceptionTypeOpt, BoundStatementList? exceptionFilterPrologueOpt, BoundExpression? exceptionFilterOpt, BoundBlock body, bool isSynthesizedAsyncCatchAll)
7591public BoundLambda(SyntaxNode syntax, UnboundLambda unboundLambda, MethodSymbol symbol, BoundBlock body, ReadOnlyBindingDiagnostic<AssemblySymbol> diagnostics, Binder binder, TypeSymbol? type, bool hasErrors = false)
7610public BoundBlock Body { get; }
7617public BoundLambda Update(UnboundLambda unboundLambda, MethodSymbol symbol, BoundBlock body, ReadOnlyBindingDiagnostic<AssemblySymbol> diagnostics, Binder binder, TypeSymbol? type)
8729protected BoundMethodBodyBase(BoundKind kind, SyntaxNode syntax, BoundBlock? blockBody, BoundBlock? expressionBody, bool hasErrors = false)
8736public BoundBlock? BlockBody { get; }
8737public BoundBlock? ExpressionBody { get; }
8742public BoundNonConstructorMethodBody(SyntaxNode syntax, BoundBlock? blockBody, BoundBlock? expressionBody, bool hasErrors = false)
8751public BoundNonConstructorMethodBody Update(BoundBlock? blockBody, BoundBlock? expressionBody)
8765public BoundConstructorMethodBody(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundStatement? initializer, BoundBlock? blockBody, BoundBlock? expressionBody, bool hasErrors = false)
8781public BoundConstructorMethodBody Update(ImmutableArray<LocalSymbol> locals, BoundStatement? initializer, BoundBlock? blockBody, BoundBlock? expressionBody)
9034return VisitBlock((BoundBlock)node, arg);
9422public virtual R VisitBlock(BoundBlock node, A arg) => this.DefaultVisit(node, arg);
9658public virtual BoundNode? VisitBlock(BoundBlock node) => this.DefaultVisit(node);
10108public override BoundNode? VisitBlock(BoundBlock node)
10952BoundBlock finallyBlock = (BoundBlock)this.Visit(node.FinallyBlock);
11356public override BoundNode? VisitBlock(BoundBlock node)
11398BoundBlock? blockBody = (BoundBlock?)this.Visit(node.BlockBody);
11399BoundBlock? expressionBody = (BoundBlock?)this.Visit(node.ExpressionBody);
11534BoundBlock tryBlock = (BoundBlock)this.Visit(node.TryBlock);
11536BoundBlock? finallyBlockOpt = (BoundBlock?)this.Visit(node.FinallyBlockOpt);
11545BoundBlock body = (BoundBlock)this.Visit(node.Body);
12150BoundBlock body = (BoundBlock)this.Visit(node.Body);
12368BoundBlock? blockBody = (BoundBlock?)this.Visit(node.BlockBody);
12369BoundBlock? expressionBody = (BoundBlock?)this.Visit(node.ExpressionBody);
12376BoundBlock? blockBody = (BoundBlock?)this.Visit(node.BlockBody);
12377BoundBlock? expressionBody = (BoundBlock?)this.Visit(node.ExpressionBody);
13531public override BoundNode? VisitBlock(BoundBlock node)
13566BoundBlock? blockBody = (BoundBlock?)this.Visit(node.BlockBody);
13567BoundBlock? expressionBody = (BoundBlock?)this.Visit(node.ExpressionBody);
13648BoundBlock body = (BoundBlock)this.Visit(node.Body);
14724BoundBlock body = (BoundBlock)this.Visit(node.Body);
15096BoundBlock? blockBody = (BoundBlock?)this.Visit(node.BlockBody);
15097BoundBlock? expressionBody = (BoundBlock?)this.Visit(node.ExpressionBody);
15885public 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 (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)
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListEnumeratorConstructor.cs (1)
33var block = f.Block(