2 writes to Statements
Microsoft.CodeAnalysis.CSharp (2)
Generated\BoundNodes.xml.Generated.cs (2)
4815this.Statements = statements; 4824this.Statements = statements;
110 references to Statements
Microsoft.CodeAnalysis.CSharp (80)
Binder\Binder_Query.cs (1)
682var r1 = l1 != null ? l1.Body.Statements[0] as BoundReturnStatement : null;
Binder\Binder_Statements.cs (2)
153(block = (BoundBlock)result).Statements.Length == 1 && 154block.Statements.Single().WasCompilerGenerated == false), "Synthetic node would not get cached");
Binder\ForLoopBinder.cs (2)
108Debug.Assert(increment.Kind != BoundKind.StatementList || ((BoundStatementList)increment).Statements.Length > 1); 115increment = new BoundBlock(scopeDesignator, locals, ((BoundStatementList)increment).Statements)
Binder\Semantics\OverloadResolution\OverloadResolution.cs (3)
3305switch (lambda.Body.Statements.Length) 3311if (lambda.Body.Statements[0].Kind == BoundKind.ReturnStatement) 3313var returnStmt = (BoundReturnStatement)lambda.Body.Statements[0];
Binder\SwitchBinder_Patterns.cs (1)
131sectionBuilder.Add(oldSection.Update(oldSection.Locals, labelBuilder.ToImmutableAndFree(), oldSection.Statements));
BoundTree\BoundNode_Source.cs (3)
86var statements = block.Statements; 297foreach (var statement in section.Statements) 328foreach (var statement in list.Statements)
BoundTree\Expression.cs (1)
170(this.Kind == BoundKind.StatementList || this.Kind == BoundKind.Scope) ? StaticCast<BoundNode?>.From(this.Statements) : ImmutableArray<BoundNode?>.Empty;
BoundTree\UnboundLambda.cs (1)
1589var statements = body.Statements;
CodeGen\EmitStatement.cs (6)
127for (int i = 0, n = list.Statements.Length; i < n; i++) 129EmitStatement(list.Statements[i]); 658if (list != null && list.Statements.LastOrDefault() == block) 757EmitStatements(block.Statements); 809EmitStatements(block.Statements); 1193EmitStatements(catchBlock.ExceptionFilterPrologueOpt.Statements);
Compiler\MethodCompiler.cs (4)
1016body = BoundBlock.SynthesizedNoLocals(initializerStatements.Syntax, initializerStatements.Statements); 1049new BoundBlock(analyzedInitializers.Syntax, ImmutableArray<LocalSymbol>.Empty, analyzedInitializers.Statements), // The block is necessary to establish the right local scope for the analysis 1103body = body.Update(body.Locals, body.LocalFunctions, body.HasUnsafeModifier, body.Instrumentation, body.Statements.Insert(insertAt, analyzedInitializers)); 1343boundStatements = boundStatements.Concat(lowered.Statements);
FlowAnalysis\AbstractFlowPass.cs (3)
1306VisitStatements(node.Statements); 1320VisitStatements(node.Statements); 3236foreach (var statement in node.Statements)
FlowAnalysis\DefiniteAssignment.cs (3)
2192foreach (var stmt in block.Statements) 2204foreach (var stmt in block.Statements) 2214foreach (var stmt in block.Statements)
FlowAnalysis\FlowAnalysisPass.cs (4)
85var newStatements = block.Statements.Add(new BoundReturnStatement(trailingExpression.Syntax, RefKind.None, trailingExpression, @checked: false)); 162return body.Update(body.Locals, body.LocalFunctions, body.HasUnsafeModifier, body.Instrumentation, body.Statements.Insert(index: 0, initializations)); 169var statements = body.Statements; 204return body.Update(body.Locals, body.LocalFunctions, body.HasUnsafeModifier, body.Instrumentation, body.Statements.Add(ret));
FlowAnalysis\NullableWalker.cs (2)
3235foreach (var stmt in block.Statements) 3306foreach (var stmt in block.Statements)
Generated\BoundNodes.xml.Generated.cs (23)
3328if (locals != this.Locals || localFunctions != this.LocalFunctions || hasUnsafeModifier != this.HasUnsafeModifier || instrumentation != this.Instrumentation || statements != this.Statements) 3357if (locals != this.Locals || statements != this.Statements) 4834if (statements != this.Statements) 5678if (locals != this.Locals || switchLabels != this.SwitchLabels || statements != this.Statements) 7731if (statements != this.Statements) 10114this.VisitList(node.Statements); 10119this.VisitList(node.Statements); 10294this.VisitList(node.Statements); 10429this.VisitList(node.Statements); 10686this.VisitList(node.Statements); 11369ImmutableArray<BoundStatement> statements = this.VisitList(node.Statements); 11375ImmutableArray<BoundStatement> statements = this.VisitList(node.Statements); 11638ImmutableArray<BoundStatement> statements = this.VisitList(node.Statements); 11797ImmutableArray<BoundStatement> statements = this.VisitList(node.Statements); 12180ImmutableArray<BoundStatement> statements = this.VisitList(node.Statements); 13531ImmutableArray<BoundStatement> statements = this.VisitList(node.Statements); 13538ImmutableArray<BoundStatement> statements = this.VisitList(node.Statements); 13902ImmutableArray<BoundStatement> statements = this.VisitList(node.Statements); 15890new TreeDumperNode("statements", null, from x in node.Statements select Visit(x, null)), 15897new TreeDumperNode("statements", null, from x in node.Statements select Visit(x, null)), 16232new TreeDumperNode("statements", null, from x in node.Statements select Visit(x, null)), 16432new TreeDumperNode("statements", null, from x in node.Statements select Visit(x, null)), 17014new TreeDumperNode("statements", null, from x in node.Statements select Visit(x, null)),
Lowering\BoundTreeToDifferentEnclosingContextRewriter.cs (1)
109var newStatements = VisitList(node.Statements);
Lowering\ClosureConversion\ClosureConversion.cs (4)
1182foreach (var statement in node.Statements) 1208var statements = VisitList(node.Statements); 1267prologueBuilder.AddRange(rewrittenFilterPrologue.Statements); 1318foreach (var s in node.Statements)
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (1)
134foreach (var s in block.Statements)
Lowering\Instrumentation\DebugInfoInjector.cs (1)
126return block.Update(block.Locals, block.LocalFunctions, block.HasUnsafeModifier, block.Instrumentation, ImmutableArray.Create(InstrumentFieldOrPropertyInitializer(block.Statements.Single(), syntax)));
Lowering\LocalRewriter\LocalRewriter.cs (5)
713var statement = RewriteExpressionStatement((BoundExpressionStatement)block.Statements.Single(), suppressInstrumentation: true); 747ImmutableArray<BoundStatement> originalStatements = node.Statements; 748var statements = ArrayBuilder<BoundStatement?>.GetInstance(node.Statements.Length); 883if (block.Statements.Length == 1) 885initializer = (BoundStatement)block.Statements.First();
Lowering\LocalRewriter\LocalRewriter_Block.cs (1)
33VisitStatementSubList(builder, node.Statements);
Lowering\LocalRewriter\LocalRewriter_PatternSwitchStatement.cs (1)
141sectionBuilder.AddRange(_localRewriter.VisitList(section.Statements));
Lowering\LocalRewriter\LocalRewriter_TryStatement.cs (1)
57foreach (var stmt in block.Statements)
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (2)
416var rewrittenStatements = rewrittenBlock.Statements; 778var statements = VisitList(node.Statements);
Operations\CSharpOperationFactory.cs (3)
1071((boundOperand as BoundLambda)?.Body.Statements.SingleOrDefault() as BoundReturnStatement)?. 1753ImmutableArray<IOperation> operations = CreateFromArray<BoundStatement, IOperation>(boundBlock.Statements); 2698ImmutableArray<IOperation> body = CreateFromArray<BoundStatement, IOperation>(boundSwitchSection.Statements);
Operations\CSharpOperationFactory_Methods.cs (1)
27return ((BoundStatementList)statement).Statements;
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (30)
Semantics\ImplicitlyTypeArraysTests.cs (1)
41var locDecl = (BoundLocalDeclaration)block.Statements.Single();
Semantics\OperatorTests.cs (1)
7336var exprs = block.Statements.SelectAsArray(stmt => ((BoundExpressionStatement)stmt).Expression);
Semantics\SemanticAnalyzerTests.cs (28)
1330Assert.Equal(1, block.Statements.Length); 1331Assert.NotNull(block.Statements[0]); 1332Assert.Equal(BoundKind.LocalDeclaration, block.Statements[0].Kind); 1333var decl = (BoundLocalDeclaration)block.Statements[0]; 1358Assert.Equal(1, block.Statements.Length); 1359Assert.NotNull(block.Statements[0]); 1360Assert.Equal(BoundKind.LocalDeclaration, block.Statements[0].Kind); 1361var decl = (BoundLocalDeclaration)block.Statements[0]; 1386Assert.Equal(1, block.Statements.Length); 1387Assert.NotNull(block.Statements[0]); 1388Assert.Equal(BoundKind.LocalDeclaration, block.Statements[0].Kind); 1389var decl = (BoundLocalDeclaration)block.Statements[0]; 1423Assert.Equal(1, block.Statements.Length); 1424Assert.NotNull(block.Statements[0]); 1425Assert.Equal(BoundKind.LocalDeclaration, block.Statements[0].Kind); 1426var decl = (BoundLocalDeclaration)block.Statements[0]; 1457Assert.Equal(1, block.Statements.Length); 1458Assert.NotNull(block.Statements[0]); 1459Assert.Equal(BoundKind.LocalDeclaration, block.Statements[0].Kind); 1460var decl = (BoundLocalDeclaration)block.Statements[0]; 1492Assert.Equal(1, block.Statements.Length); 1493Assert.NotNull(block.Statements[0]); 1494Assert.Equal(BoundKind.LocalDeclaration, block.Statements[0].Kind); 1495var decl = (BoundLocalDeclaration)block.Statements[0]; 1527Assert.Equal(1, block.Statements.Length); 1528Assert.NotNull(block.Statements[0]); 1529Assert.Equal(BoundKind.LocalDeclaration, block.Statements[0].Kind); 1530var decl = (BoundLocalDeclaration)block.Statements[0];