2 writes to Statements
Microsoft.CodeAnalysis.CSharp (2)
Generated\BoundNodes.xml.Generated.cs (2)
4704this.Statements = statements; 4713this.Statements = statements;
112 references to Statements
Microsoft.CodeAnalysis.CSharp (80)
Binder\Binder_Query.cs (1)
681var r1 = l1 != null ? l1.Body.Statements[0] as BoundReturnStatement : null;
Binder\Binder_Statements.cs (2)
152(block = (BoundBlock)result).Statements.Length == 1 && 153block.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)
2574switch (lambda.Body.Statements.Length) 2580if (lambda.Body.Statements[0].Kind == BoundKind.ReturnStatement) 2582var 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)
71var statements = block.Statements; 282foreach (var statement in section.Statements) 307foreach (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)
1533var 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) 732EmitStatements(block.Statements); 784EmitStatements(block.Statements); 1168EmitStatements(catchBlock.ExceptionFilterPrologueOpt.Statements);
Compiler\MethodCompiler.cs (3)
1022body = BoundBlock.SynthesizedNoLocals(initializerStatements.Syntax, initializerStatements.Statements); 1105body = body.Update(body.Locals, body.LocalFunctions, body.HasUnsafeModifier, body.Instrumentation, body.Statements.Insert(insertAt, analyzedInitializers)); 1338boundStatements = boundStatements.Concat(lowered.Statements);
FlowAnalysis\AbstractFlowPass.cs (3)
1251VisitStatements(node.Statements); 1265VisitStatements(node.Statements); 3007foreach (var statement in node.Statements)
FlowAnalysis\DefiniteAssignment.cs (3)
2023foreach (var stmt in block.Statements) 2035foreach (var stmt in block.Statements) 2045foreach (var stmt in block.Statements)
FlowAnalysis\FlowAnalysisPass.cs (4)
85var newStatements = block.Statements.Add(new BoundReturnStatement(trailingExpression.Syntax, RefKind.None, trailingExpression, @checked: false)); 142return body.Update(body.Locals, body.LocalFunctions, body.HasUnsafeModifier, body.Instrumentation, body.Statements.Insert(index: 0, initializations)); 149var statements = body.Statements; 184return body.Update(body.Locals, body.LocalFunctions, body.HasUnsafeModifier, body.Instrumentation, body.Statements.Add(ret));
FlowAnalysis\NullableWalker.cs (3)
2990foreach (var stmt in block.Statements) 2999foreach (var stmt in block.Statements) 3010foreach (var stmt in block.Statements)
Generated\BoundNodes.xml.Generated.cs (23)
3217if (locals != this.Locals || localFunctions != this.LocalFunctions || hasUnsafeModifier != this.HasUnsafeModifier || instrumentation != this.Instrumentation || statements != this.Statements) 3246if (locals != this.Locals || statements != this.Statements) 4723if (statements != this.Statements) 5567if (locals != this.Locals || switchLabels != this.SwitchLabels || statements != this.Statements) 7413if (statements != this.Statements) 9719this.VisitList(node.Statements); 9724this.VisitList(node.Statements); 9899this.VisitList(node.Statements); 10034this.VisitList(node.Statements); 10269this.VisitList(node.Statements); 10891ImmutableArray<BoundStatement> statements = this.VisitList(node.Statements); 10896ImmutableArray<BoundStatement> statements = this.VisitList(node.Statements); 11116ImmutableArray<BoundStatement> statements = this.VisitList(node.Statements); 11261ImmutableArray<BoundStatement> statements = this.VisitList(node.Statements); 11572ImmutableArray<BoundStatement> statements = this.VisitList(node.Statements); 12889ImmutableArray<BoundStatement> statements = this.VisitList(node.Statements); 12896ImmutableArray<BoundStatement> statements = this.VisitList(node.Statements); 13260ImmutableArray<BoundStatement> statements = this.VisitList(node.Statements); 15152new TreeDumperNode("statements", null, from x in node.Statements select Visit(x, null)), 15159new TreeDumperNode("statements", null, from x in node.Statements select Visit(x, null)), 15494new TreeDumperNode("statements", null, from x in node.Statements select Visit(x, null)), 15694new TreeDumperNode("statements", null, from x in node.Statements select Visit(x, null)), 16216new TreeDumperNode("statements", null, from x in node.Statements select Visit(x, null)),
Lowering\ClosureConversion\ClosureConversion.cs (4)
1161foreach (var statement in node.Statements) 1188var statements = VisitList(node.Statements); 1248prologueBuilder.AddRange(rewrittenFilterPrologue.Statements); 1299foreach (var s in node.Statements)
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (1)
136foreach (var s in block.Statements)
Lowering\Instrumentation\DebugInfoInjector.cs (1)
86return block.Update(block.Locals, block.LocalFunctions, block.HasUnsafeModifier, block.Instrumentation, ImmutableArray.Create(InstrumentFieldOrPropertyInitializer(block.Statements.Single(), syntax)));
Lowering\LocalRewriter\LocalRewriter.cs (5)
613ImmutableArray<BoundStatement> originalStatements = node.Statements; 614var statements = ArrayBuilder<BoundStatement?>.GetInstance(node.Statements.Length); 623var statement = RewriteExpressionStatement((BoundExpressionStatement)block.Statements.Single(), suppressInstrumentation: true); 760if (block.Statements.Length == 1) 762initializer = (BoundStatement)block.Statements.First();
Lowering\LocalRewriter\LocalRewriter_Block.cs (1)
23VisitStatementSubList(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\MethodToClassRewriter.cs (1)
157var newStatements = VisitList(node.Statements);
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (2)
410var rewrittenStatements = rewrittenBlock.Statements; 735var statements = VisitList(node.Statements);
Operations\CSharpOperationFactory.cs (3)
1065((boundOperand as BoundLambda)?.Body.Statements.SingleOrDefault() as BoundReturnStatement)?. 1675ImmutableArray<IOperation> operations = CreateFromArray<BoundStatement, IOperation>(boundBlock.Statements); 2553ImmutableArray<IOperation> body = CreateFromArray<BoundStatement, IOperation>(boundSwitchSection.Statements);
Operations\CSharpOperationFactory_Methods.cs (1)
27return ((BoundStatementList)statement).Statements;
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler (2)
Rewriters\CapturedVariableRewriter.cs (1)
50var rewrittenStatements = VisitList(node.Statements);
Symbols\EEMethodSymbol.cs (1)
697body = block.Update(localBuilder.ToImmutableAndFree(), block.LocalFunctions, block.HasUnsafeModifier, instrumentation: null, block.Statements);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (30)
Semantics\ImplicitlyTypeArraysTests.cs (1)
42var locDecl = (BoundLocalDeclaration)block.Statements.Single();
Semantics\OperatorTests.cs (1)
7335var 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];