6 types derived from LocalSymbol
Microsoft.CodeAnalysis.CSharp (6)
CodeGen\Optimizer.cs (1)
2337internal sealed class DummyLocal : LocalSymbol
FlowAnalysis\NullableWalker.PlaceholderLocal.cs (1)
22private sealed class PlaceholderLocal : LocalSymbol
Symbols\Source\SourceLocalSymbol.cs (1)
24internal class SourceLocalSymbol : LocalSymbol
Symbols\Synthesized\SynthesizedLocal.cs (1)
19internal sealed class SynthesizedLocal : LocalSymbol
Symbols\Synthesized\TypeSubstitutedLocalSymbol.cs (1)
14internal sealed class TypeSubstitutedLocalSymbol : LocalSymbol
Symbols\UpdatedContainingSymbolLocal.cs (1)
12internal sealed class UpdatedContainingSymbolAndNullableAnnotationLocal : LocalSymbol
819 references to LocalSymbol
Microsoft.CodeAnalysis.CSharp (819)
Binder\Binder.cs (2)
185internal virtual ImmutableArray<LocalSymbol> GetDeclaredLocalsForScope(SyntaxNode scopeDesignator) 479internal virtual LocalSymbol? LocalInProgress
Binder\Binder.ValueChecks.cs (4)
1027LocalSymbol localSymbol = local.LocalSymbol; 1066LocalSymbol localSymbol = local.LocalSymbol; 3064private static void ReportReadonlyLocalError(SyntaxNode node, LocalSymbol local, BindValueKind kind, bool checkingReceiver, BindingDiagnosticBag diagnostics) 4784var localSymbol = ((BoundLocal)expr).LocalSymbol;
Binder\Binder_Expressions.cs (3)
1962var localSymbol = (LocalSymbol)symbol; 2204bool isUsedBeforeDeclaration(SimpleNameSyntax node, LocalSymbol localSymbol)
Binder\Binder_Initializers.cs (1)
132boundInitializers.Add(new BoundFieldEqualsValue(parameterSyntax, fieldSymbol, ImmutableArray<LocalSymbol>.Empty,
Binder\Binder_Operators.cs (1)
2675LocalSymbol localSymbol = localAccess.LocalSymbol;
Binder\Binder_Query.cs (1)
696return lambdaBodyBinder.CreateBlockFromExpression(node, ImmutableArray<LocalSymbol>.Empty, RefKind.None, construction, null, d);
Binder\Binder_Statements.cs (9)
1897ImmutableArray<LocalSymbol> locals = GetDeclaredLocalsForScope(node); 3330ImmutableArray<LocalSymbol> locals = binder.GetDeclaredLocalsForScope(node); 3332LocalSymbol local = locals.FirstOrDefault(); 3446internal BoundBlock CreateBlockFromExpression(CSharpSyntaxNode node, ImmutableArray<LocalSymbol> locals, RefKind refKind, BoundExpression expression, ExpressionSyntax expressionSyntax, BindingDiagnosticBag diagnostics) 3683ImmutableArray<LocalSymbol> constructorLocals; 3694constructorLocals = ImmutableArray<LocalSymbol>.Empty; 3700blockBody: new BoundBlock(typeDecl, ImmutableArray<LocalSymbol>.Empty, ImmutableArray<BoundStatement>.Empty).MakeCompilerGenerated(), 4035internal virtual ImmutableArray<LocalSymbol> Locals 4039return ImmutableArray<LocalSymbol>.Empty;
Binder\BlockBinder.cs (2)
33protected override ImmutableArray<LocalSymbol> BuildLocals() 66internal override ImmutableArray<LocalSymbol> GetDeclaredLocalsForScope(SyntaxNode scopeDesignator)
Binder\BuckStopsHereBinder.cs (2)
89internal override LocalSymbol? LocalInProgress 176internal override ImmutableArray<LocalSymbol> GetDeclaredLocalsForScope(SyntaxNode scopeDesignator)
Binder\CatchClauseBinder.cs (3)
27protected override ImmutableArray<LocalSymbol> BuildLocals() 29var locals = ArrayBuilder<LocalSymbol>.GetInstance(); 45internal override ImmutableArray<LocalSymbol> GetDeclaredLocalsForScope(SyntaxNode scopeDesignator)
Binder\EmbeddedStatementBinder.cs (4)
31protected override ImmutableArray<LocalSymbol> BuildLocals() 33ArrayBuilder<LocalSymbol> locals = ArrayBuilder<LocalSymbol>.GetInstance(DefaultLocalSymbolArrayCapacity); 69internal override ImmutableArray<LocalSymbol> GetDeclaredLocalsForScope(SyntaxNode scopeDesignator)
Binder\ExpressionListVariableBinder.cs (3)
26protected override ImmutableArray<LocalSymbol> BuildLocals() 28var builder = ArrayBuilder<LocalSymbol>.GetInstance(); 41internal override ImmutableArray<LocalSymbol> GetDeclaredLocalsForScope(SyntaxNode scopeDesignator)
Binder\ExpressionVariableBinder.cs (3)
26protected override ImmutableArray<LocalSymbol> BuildLocals() 28var builder = ArrayBuilder<LocalSymbol>.GetInstance(); 34internal override ImmutableArray<LocalSymbol> GetDeclaredLocalsForScope(SyntaxNode scopeDesignator)
Binder\ExpressionVariableFinder.cs (6)
544internal class ExpressionVariableFinder : ExpressionVariableFinder<LocalSymbol> 551ArrayBuilder<LocalSymbol> builder, 573ArrayBuilder<LocalSymbol> builder, 592protected override LocalSymbol MakePatternVariable(TypeSyntax type, SingleVariableDesignationSyntax designation, SyntaxNode nodeToBind) 618protected override LocalSymbol MakeDeclarationExpressionVariable(DeclarationExpressionSyntax node, SingleVariableDesignationSyntax designation, BaseArgumentListSyntax argumentListSyntaxOpt, SyntaxNode nodeToBind) 640protected override LocalSymbol MakeDeconstructionVariable(
Binder\FixedStatementBinder.cs (4)
29protected override ImmutableArray<LocalSymbol> BuildLocals() 33var locals = new ArrayBuilder<LocalSymbol>(_syntax.Declaration.Variables.Count); 57return ImmutableArray<LocalSymbol>.Empty; 60internal override ImmutableArray<LocalSymbol> GetDeclaredLocalsForScope(SyntaxNode scopeDesignator)
Binder\ForEachLoopBinder.cs (7)
47internal override ImmutableArray<LocalSymbol> GetDeclaredLocalsForScope(SyntaxNode scopeDesignator) 70protected override ImmutableArray<LocalSymbol> BuildLocals() 77var locals = ArrayBuilder<LocalSymbol>.GetInstance(); 94return ImmutableArray.Create<LocalSymbol>(iterationVariable); 104ArrayBuilder<LocalSymbol> locals, 141ArrayBuilder<LocalSymbol> locals, 424ImmutableArray<LocalSymbol> iterationVariables = this.Locals;
Binder\ForLoopBinder.cs (4)
28protected override ImmutableArray<LocalSymbol> BuildLocals() 30var locals = ArrayBuilder<LocalSymbol>.GetInstance(); 92var innerLocals = ImmutableArray<LocalSymbol>.Empty; 140internal override ImmutableArray<LocalSymbol> GetDeclaredLocalsForScope(SyntaxNode scopeDesignator)
Binder\LocalInProgressBinder.cs (3)
22private LocalSymbol? _localSymbol; 30internal override LocalSymbol LocalInProgress 40internal void SetLocalSymbol(LocalSymbol local)
Binder\LocalScopeBinder.cs (17)
21private ImmutableArray<LocalSymbol> _locals; 35internal sealed override ImmutableArray<LocalSymbol> Locals 41ImmutableInterlocked.InterlockedCompareExchange(ref _locals, BuildLocals(), default(ImmutableArray<LocalSymbol>)); 48protected virtual ImmutableArray<LocalSymbol> BuildLocals() 50return ImmutableArray<LocalSymbol>.Empty; 89private SmallDictionary<string, LocalSymbol> _lazyLocalsMap; 90private SmallDictionary<string, LocalSymbol> LocalsMap 148protected ImmutableArray<LocalSymbol> BuildLocals(SyntaxList<StatementSyntax> statements, Binder enclosingBinder) 164ArrayBuilder<LocalSymbol> locals = ArrayBuilder<LocalSymbol>.GetInstance(DefaultLocalSymbolArrayCapacity); 173internal void BuildLocals(Binder enclosingBinder, StatementSyntax statement, ArrayBuilder<LocalSymbol> locals) 287static void findExpressionVariablesInRankSpecifier(ExpressionSyntax expression, (LocalScopeBinder localScopeBinder, ArrayBuilder<LocalSymbol> locals, Binder localDeclarationBinder) args) 383LocalSymbol result = null; 389foreach (var local in this.Locals) 444LocalSymbol localSymbol; 510declaredInThisScope |= newSymbolKind == SymbolKind.Local && this.Locals.Contains((LocalSymbol)newSymbol); 543LocalSymbol existingLocal = null;
Binder\RefSafetyAnalysis.cs (15)
63private Dictionary<LocalSymbol, (SafeContext RefEscapeScope, SafeContext ValEscapeScope)>? _localEscapeScopes; 92private readonly ImmutableArray<LocalSymbol> _locals; 94public LocalScope(RefSafetyAnalysis analysis, ImmutableArray<LocalSymbol> locals) 99foreach (var local in locals) 107foreach (var local in _locals) 176private (SafeContext RefEscapeScope, SafeContext ValEscapeScope) GetLocalScopes(LocalSymbol local) 185private void SetLocalScopes(LocalSymbol local, SafeContext refEscapeScope, SafeContext valEscapeScope) 435private void AddLocalScopes(LocalSymbol local, SafeContext refEscapeScope, SafeContext valEscapeScope) 462private void AddOrSetLocalScopes(LocalSymbol local, SafeContext refEscapeScope, SafeContext valEscapeScope) 464_localEscapeScopes ??= new Dictionary<LocalSymbol, (SafeContext RefEscapeScope, SafeContext ValEscapeScope)>(); 469private void RemoveLocalScopes(LocalSymbol local) 644if (pattern.Variable is LocalSymbol local) 1099using var _ = new LocalScope(this, ImmutableArray<LocalSymbol>.Empty); 1101foreach (var local in node.IterationVariables) 1124foreach (var local in node.IterationVariables)
Binder\ScriptLocalScopeBinder.cs (1)
42internal override ImmutableArray<LocalSymbol> GetDeclaredLocalsForScope(SyntaxNode scopeDesignator)
Binder\SimpleLocalScopeBinder.cs (4)
17private readonly ImmutableArray<LocalSymbol> _locals; 19public SimpleLocalScopeBinder(ImmutableArray<LocalSymbol> locals, Binder next) : 25protected override ImmutableArray<LocalSymbol> BuildLocals() 30internal override ImmutableArray<LocalSymbol> GetDeclaredLocalsForScope(SyntaxNode scopeDesignator)
Binder\SimpleProgramBinder.cs (4)
26protected override ImmutableArray<LocalSymbol> BuildLocals() 28ArrayBuilder<LocalSymbol> locals = ArrayBuilder<LocalSymbol>.GetInstance(DefaultLocalSymbolArrayCapacity); 87internal override ImmutableArray<LocalSymbol> GetDeclaredLocalsForScope(SyntaxNode scopeDesignator)
Binder\SimpleProgramUnitBinder.cs (2)
26protected override ImmutableArray<LocalSymbol> BuildLocals() 57internal override ImmutableArray<LocalSymbol> GetDeclaredLocalsForScope(SyntaxNode scopeDesignator)
Binder\SwitchBinder.cs (3)
134protected override ImmutableArray<LocalSymbol> BuildLocals() 136var builder = ArrayBuilder<LocalSymbol>.GetInstance(); 328internal override ImmutableArray<LocalSymbol> GetDeclaredLocalsForScope(SyntaxNode scopeDesignator)
Binder\SwitchBinder_Patterns.cs (1)
43ImmutableArray<LocalSymbol> locals = GetDeclaredLocalsForScope(node);
Binder\SwitchExpressionArmBinder.cs (1)
41ImmutableArray<LocalSymbol> locals = _armScopeBinder.Locals;
Binder\UsingStatementBinder.cs (4)
27protected override ImmutableArray<LocalSymbol> BuildLocals() 36var locals = ArrayBuilder<LocalSymbol>.GetInstance(); 42var locals = ArrayBuilder<LocalSymbol>.GetInstance(declarationSyntax.Variables.Count); 306internal override ImmutableArray<LocalSymbol> GetDeclaredLocalsForScope(SyntaxNode scopeDesignator)
Binder\WhileBinder.cs (3)
48protected override ImmutableArray<LocalSymbol> BuildLocals() 50var locals = ArrayBuilder<LocalSymbol>.GetInstance(); 69internal override ImmutableArray<LocalSymbol> GetDeclaredLocalsForScope(SyntaxNode scopeDesignator)
Binder\WithLambdaParametersBinder.cs (1)
170internal override ImmutableArray<LocalSymbol> GetDeclaredLocalsForScope(SyntaxNode scopeDesignator)
BoundTree\BoundExpression.cs (2)
303public BoundLocal(SyntaxNode syntax, LocalSymbol localSymbol, ConstantValue? constantValueOpt, TypeSymbol type, bool hasErrors = false) 308public BoundLocal Update(LocalSymbol localSymbol, ConstantValue? constantValueOpt, TypeSymbol type)
BoundTree\BoundNode.cs (7)
487public readonly PooledHashSet<LocalSymbol> DeclaredLocals = PooledHashSet<LocalSymbol>.GetInstance(); 500private void AddAll(ImmutableArray<LocalSymbol> locals) 502foreach (var local in locals) 511private void RemoveAll(ImmutableArray<LocalSymbol> locals) 513foreach (var local in locals) 522private void CheckDeclared(LocalSymbol local)
BoundTree\BoundNode_Source.cs (3)
94foreach (var local in block.Locals) 192var symbol = local.LocalSymbol; 428void appendLocal(LocalSymbol symbol)
BoundTree\BoundSpillSequence.cs (1)
17ImmutableArray<LocalSymbol> locals,
BoundTree\Constructors.cs (5)
75var localSymbol = ((BoundLocal)receiver).LocalSymbol; 655public BoundBlock(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundStatement> statements, bool hasErrors = false) 662return new BoundBlock(syntax, ImmutableArray<LocalSymbol>.Empty, ImmutableArray.Create(statement)) 668return new BoundBlock(syntax, ImmutableArray<LocalSymbol>.Empty, statements) { WasCompilerGenerated = true }; 673return new BoundBlock(syntax, ImmutableArray<LocalSymbol>.Empty, statements.AsImmutableOrNull()) { WasCompilerGenerated = true };
CodeGen\CodeGenerator.cs (4)
36private readonly HashSet<LocalSymbol> _stackLocals; 202internal static bool IsStackLocal(LocalSymbol local, HashSet<LocalSymbol> stackLocalsOpt) 205private bool IsStackLocal(LocalSymbol local) => IsStackLocal(local, _stackLocals);
CodeGen\CodeGenerator_HasHome.cs (3)
47HashSet<LocalSymbol> stackLocalsOpt) 93var local = ((BoundLocal)expression).LocalSymbol; 176HashSet<LocalSymbol> stackLocalsOpt)
CodeGen\EmitAddress.cs (3)
265var local = localAccess.LocalSymbol; 351private static LocalSymbol DigForValueLocal(BoundSequence topSequence, BoundExpression value) 357var symbol = local.LocalSymbol;
CodeGen\EmitExpression.cs (3)
878foreach (var local in sequence.Locals) 893foreach (var local in sequence.Locals) 912foreach (var local in sequence.Locals)
CodeGen\EmitStatement.cs (10)
747foreach (var local in block.Locals) 775foreach (var local in block.Locals) 798foreach (var local in block.Locals) 1114foreach (var local in catchBlock.Locals) 1282var local = ((BoundLocal)expression).LocalSymbol; 1747var symbol = localExpression.LocalSymbol; 1751private LocalDefinition GetLocal(LocalSymbol symbol) 1756private LocalDefinition DefineLocal(LocalSymbol local, SyntaxNode syntaxNode) 1880private bool IsSlotReusable(LocalSymbol local) 1888private void FreeLocal(LocalSymbol local)
CodeGen\Optimizer.cs (31)
61out HashSet<LocalSymbol> stackLocals) 66var locals = PooledDictionary<LocalSymbol, LocalDefUseInfo>.GetInstance(); 79stackLocals = new HashSet<LocalSymbol>(locals.Keys); 93private static void FilterValidStackLocals(Dictionary<LocalSymbol, LocalDefUseInfo> info) 98foreach (var local in info.Keys.ToArray()) 126private static void RemoveIntersectingLocals(Dictionary<LocalSymbol, LocalDefUseInfo> info, ArrayBuilder<LocalDefUseInfo> dummies) 404private readonly Dictionary<LocalSymbol, LocalDefUseInfo> _locals; 418private StackOptimizerPass1(Dictionary<LocalSymbol, LocalDefUseInfo> locals, 433Dictionary<LocalSymbol, LocalDefUseInfo> locals, 697foreach (var local in locals) 757private bool IsNestedLocalOfCompoundOperator(LocalSymbol local, BoundSequence node) 807private readonly LocalSymbol _local; 810internal LocalUsedWalker(LocalSymbol local, int recursionDepth) 981LocalSymbol localSymbol = assignmentLocal.LocalSymbol; 1427var localSym = ((BoundLocal)boundExpression).LocalSymbol; 1863private void ShouldNotSchedule(LocalSymbol localSymbol) 1872private void RecordVarRef(LocalSymbol local) 1885private void RecordVarRead(LocalSymbol local) 1931private bool EvalStackHasLocal(LocalSymbol local) 1940private void RecordDummyWrite(LocalSymbol local) 1953private void RecordVarWrite(LocalSymbol local) 1983private bool CanScheduleToStack(LocalSymbol local) 1989private void DeclareLocals(ImmutableArray<LocalSymbol> locals, int stack) 1991foreach (var local in locals) 1997private void DeclareLocal(LocalSymbol local, int stack) 2032private readonly Dictionary<LocalSymbol, LocalDefUseInfo> _info; 2034private StackOptimizerPass2(Dictionary<LocalSymbol, LocalDefUseInfo> info) 2039public static BoundStatement Rewrite(BoundStatement src, Dictionary<LocalSymbol, LocalDefUseInfo> info) 2301var sourceLocal = ((BoundLocal)exceptionSource).LocalSymbol; 2359internal override LocalSymbol WithSynthesizedLocalKindAndSyntax( 2406internal override ConstantValue GetConstantValue(SyntaxNode node, LocalSymbol inProgress, BindingDiagnosticBag diagnostics)
Compilation\CSharpSemanticModel.cs (4)
1782case LocalSymbol _: 3281LocalSymbol local = foreachBinder.GetDeclaredLocalsForScope(forEachStatement).FirstOrDefault(); 3294internal abstract LocalSymbol GetAdjustedLocalSymbol(SourceLocalSymbol originalSymbol); 3320LocalSymbol local = catchBinder.GetDeclaredLocalsForScope(catchClause).FirstOrDefault();
Compilation\MemberSemanticModel.cs (5)
692private LocalSymbol GetDeclaredLocal(CSharpSyntaxNode declarationSyntax, SyntaxToken declaredIdentifier) 696foreach (var local in binder.Locals) 709internal override LocalSymbol GetAdjustedLocalSymbol(SourceLocalSymbol local) 711return GetRemappedSymbol<LocalSymbol>(local); 2342Debug.Assert(symbol is LocalSymbol or ParameterSymbol or MethodSymbol { MethodKind: MethodKind.LambdaMethod });
Compilation\SpeculativeSemanticModelWithMemberModel.cs (1)
340internal override LocalSymbol GetAdjustedLocalSymbol(SourceLocalSymbol local)
Compilation\SyntaxTreeSemanticModel.cs (2)
1870internal override LocalSymbol GetAdjustedLocalSymbol(SourceLocalSymbol originalSymbol) 2386Debug.Assert(symbol is LocalSymbol or ParameterSymbol or MethodSymbol { MethodKind: MethodKind.LambdaMethod });
Compiler\AnonymousTypeMethodBodySynthesizer.cs (1)
149F.CloseMethod(F.Block(ImmutableArray.Create<LocalSymbol>(boundLocal.LocalSymbol), assignment, retStatement));
Compiler\MethodBodySynthesizer.cs (4)
429LocalSymbol[] tmps = new LocalSymbol[numTemps]; 565ImmutableArray<LocalSymbol>.Empty, 573ImmutableArray<LocalSymbol>.Empty,
Compiler\MethodBodySynthesizer.Lowered.cs (6)
55LocalSymbol i = F.SynthesizedLocal(F.SpecialType(SpecialType.System_Int32)); 56LocalSymbol hashCode = F.SynthesizedLocal(F.SpecialType(SpecialType.System_UInt32)); 83ImmutableArray.Create<LocalSymbol>(hashCode, i), 153LocalSymbol i = F.SynthesizedLocal(F.SpecialType(SpecialType.System_Int32)); 154LocalSymbol hashCode = F.SynthesizedLocal(F.SpecialType(SpecialType.System_UInt32)); 175ImmutableArray.Create<LocalSymbol>(hashCode, i),
Compiler\MethodCompiler.cs (2)
961body = new BoundBlock(methodSymbol.GetNonNullSyntaxNode(), ImmutableArray<LocalSymbol>.Empty, ImmutableArray<BoundStatement>.Empty) { WasCompilerGenerated = true }; 1004new BoundBlock(analyzedInitializers.Syntax, ImmutableArray<LocalSymbol>.Empty, analyzedInitializers.Statements), // The block is necessary to establish the right local scope for the analysis
FlowAnalysis\ControlFlowPass.cs (3)
23private readonly ArrayBuilder<(LocalSymbol symbol, BoundBlock block)> _usingDeclarations = ArrayBuilder<(LocalSymbol, BoundBlock)>.GetInstance(); 403foreach (var local in node.Locals)
FlowAnalysis\DataFlowsOutWalker.cs (2)
124return ((BoundObjectPattern)node).Variable as LocalSymbol; 161var local = ((BoundCatchBlock)node).Locals.FirstOrDefault();
FlowAnalysis\DefiniteAssignment.cs (23)
65private readonly PooledHashSet<LocalSymbol> _usedVariables = PooledHashSet<LocalSymbol>.GetInstance(); 756var local = variable as LocalSymbol; 862var local = variable as LocalSymbol; 1205if (symbol is LocalSymbol local && local.IsConst) 1497var result = ((BoundLocal)expression).LocalSymbol; 1544var symbol = pattern.Variable as LocalSymbol; 1561LocalSymbol symbol = local.LocalSymbol; 2141foreach (var local in node.Locals) 2259foreach (LocalSymbol local in localsOpt) 2287private void DeclareVariables(ImmutableArray<LocalSymbol> locals) 2289foreach (var symbol in locals) 2295private void DeclareVariables(OneOrMany<LocalSymbol> locals) 2303private void DeclareVariable(LocalSymbol symbol) 2313private void ReportUnusedVariables(ImmutableArray<LocalSymbol> locals) 2315foreach (var symbol in locals) 2321private void ReportIfUnused(LocalSymbol symbol, bool assigned) 2353LocalSymbol localSymbol = node.LocalSymbol; 2689foreach (var local in catchBlock.Locals) 2765foreach (var iterationVariable in node.IterationVariables)
FlowAnalysis\FlowAnalysisPass.cs (1)
86block = new BoundBlock(block.Syntax, ImmutableArray<LocalSymbol>.Empty, newStatements) { WasCompilerGenerated = true };
FlowAnalysis\LocalDataFlowPass.cs (1)
81if (symbol is LocalSymbol { SynthesizedKind: SynthesizedLocalKind.LocalStoreTracker })
FlowAnalysis\NullableWalker.cs (10)
1973var local = (LocalSymbol)symbol; 3076var local = node.LocalSymbol; 3504private void DeclareLocal(LocalSymbol local) 3517private void DeclareLocals(ImmutableArray<LocalSymbol> locals) 3519foreach (var local in locals) 3527var local = node.LocalSymbol; 10696private TypeWithAnnotations GetDeclaredLocalResult(LocalSymbol local) 11153foreach (var iterationVariable in node.IterationVariables) 12069LocalSymbol local = node.Locals[0];
FlowAnalysis\NullableWalker.PlaceholderLocal.cs (2)
61internal override ConstantValue GetConstantValue(SyntaxNode node, LocalSymbol inProgress, BindingDiagnosticBag diagnostics = null) => null; 65internal override LocalSymbol WithSynthesizedLocalKindAndSyntax(
FlowAnalysis\NullableWalker.Variables.cs (1)
357case LocalSymbol:
FlowAnalysis\VariablesDeclaredWalker.cs (1)
148var local = catchBlock.Locals.FirstOrDefault();
Generated\BoundNodes.xml.Generated.cs (97)
292protected BoundEqualsValue(BoundKind kind, SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundExpression value, bool hasErrors = false) 303public ImmutableArray<LocalSymbol> Locals { get; } 309public BoundFieldEqualsValue(SyntaxNode syntax, FieldSymbol field, ImmutableArray<LocalSymbol> locals, BoundExpression value, bool hasErrors = false) 325public BoundFieldEqualsValue Update(FieldSymbol field, ImmutableArray<LocalSymbol> locals, BoundExpression value) 339public BoundPropertyEqualsValue(SyntaxNode syntax, PropertySymbol property, ImmutableArray<LocalSymbol> locals, BoundExpression value, bool hasErrors = false) 355public BoundPropertyEqualsValue Update(PropertySymbol property, ImmutableArray<LocalSymbol> locals, BoundExpression value) 369public BoundParameterEqualsValue(SyntaxNode syntax, ParameterSymbol parameter, ImmutableArray<LocalSymbol> locals, BoundExpression value, bool hasErrors = false) 385public BoundParameterEqualsValue Update(ParameterSymbol parameter, ImmutableArray<LocalSymbol> locals, BoundExpression value) 2262public BoundBlockInstrumentation(SyntaxNode syntax, OneOrMany<LocalSymbol> locals, BoundStatement? prologue, BoundStatement? epilogue, bool hasErrors = false) 2273public OneOrMany<LocalSymbol> Locals { get; } 2280public BoundBlockInstrumentation Update(OneOrMany<LocalSymbol> locals, BoundStatement? prologue, BoundStatement? epilogue) 2334public BoundLocalId(SyntaxNode syntax, LocalSymbol local, FieldSymbol? hoistedField, TypeSymbol type, bool hasErrors) 2345public BoundLocalId(SyntaxNode syntax, LocalSymbol local, FieldSymbol? hoistedField, TypeSymbol type) 2357public LocalSymbol Local { get; } 2363public BoundLocalId Update(LocalSymbol local, FieldSymbol? hoistedField, TypeSymbol type) 3305public BoundBlock(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, ImmutableArray<LocalFunctionSymbol> localFunctions, bool hasUnsafeModifier, BoundBlockInstrumentation? instrumentation, ImmutableArray<BoundStatement> statements, bool hasErrors = false) 3319public ImmutableArray<LocalSymbol> Locals { get; } 3327public BoundBlock Update(ImmutableArray<LocalSymbol> locals, ImmutableArray<LocalFunctionSymbol> localFunctions, bool hasUnsafeModifier, BoundBlockInstrumentation? instrumentation, ImmutableArray<BoundStatement> statements) 3341public BoundScope(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundStatement> statements, bool hasErrors = false) 3351public ImmutableArray<LocalSymbol> Locals { get; } 3356public BoundScope Update(ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundStatement> statements) 3401public BoundLocalDeclaration(SyntaxNode syntax, LocalSymbol localSymbol, BoundTypeExpression? declaredTypeOpt, BoundExpression? initializerOpt, ImmutableArray<BoundExpression> argumentsOpt, bool inferredType, bool hasErrors = false) 3414public LocalSymbol LocalSymbol { get; } 3423public BoundLocalDeclaration Update(LocalSymbol localSymbol, BoundTypeExpression? declaredTypeOpt, BoundExpression? initializerOpt, ImmutableArray<BoundExpression> argumentsOpt, bool inferredType) 3771public BoundSwitchStatement(SyntaxNode syntax, BoundExpression expression, ImmutableArray<LocalSymbol> innerLocals, ImmutableArray<LocalFunctionSymbol> innerLocalFunctions, ImmutableArray<BoundSwitchSection> switchSections, BoundDecisionDag reachabilityDecisionDag, BoundSwitchLabel? defaultLabel, GeneratedLabelSymbol breakLabel, bool hasErrors = false) 3792public ImmutableArray<LocalSymbol> InnerLocals { get; } 3802public BoundSwitchStatement Update(BoundExpression expression, ImmutableArray<LocalSymbol> innerLocals, ImmutableArray<LocalFunctionSymbol> innerLocalFunctions, ImmutableArray<BoundSwitchSection> switchSections, BoundDecisionDag reachabilityDecisionDag, BoundSwitchLabel? defaultLabel, GeneratedLabelSymbol breakLabel) 3913protected BoundConditionalLoopStatement(BoundKind kind, SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundExpression condition, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel, bool hasErrors = false) 3928public ImmutableArray<LocalSymbol> Locals { get; } 3935public BoundDoStatement(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundExpression condition, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel, bool hasErrors = false) 3951public BoundDoStatement Update(ImmutableArray<LocalSymbol> locals, BoundExpression condition, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel) 3965public BoundWhileStatement(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundExpression condition, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel, bool hasErrors = false) 3981public BoundWhileStatement Update(ImmutableArray<LocalSymbol> locals, BoundExpression condition, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel) 3995public BoundForStatement(SyntaxNode syntax, ImmutableArray<LocalSymbol> outerLocals, BoundStatement? initializer, ImmutableArray<LocalSymbol> innerLocals, BoundExpression? condition, BoundStatement? increment, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel, bool hasErrors = false) 4013public ImmutableArray<LocalSymbol> OuterLocals { get; } 4015public ImmutableArray<LocalSymbol> InnerLocals { get; } 4023public BoundForStatement Update(ImmutableArray<LocalSymbol> outerLocals, BoundStatement? initializer, ImmutableArray<LocalSymbol> innerLocals, BoundExpression? condition, BoundStatement? increment, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel) 4037public BoundForEachStatement(SyntaxNode syntax, ForEachEnumeratorInfo? enumeratorInfoOpt, BoundValuePlaceholder? elementPlaceholder, BoundExpression? elementConversion, BoundTypeExpression iterationVariableType, ImmutableArray<LocalSymbol> iterationVariables, BoundExpression? iterationErrorExpressionOpt, BoundExpression expression, BoundForEachDeconstructStep? deconstructionOpt, BoundAwaitableInfo? awaitOpt, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel, bool hasErrors = false) 4064public ImmutableArray<LocalSymbol> IterationVariables { get; } 4074public BoundForEachStatement Update(ForEachEnumeratorInfo? enumeratorInfoOpt, BoundValuePlaceholder? elementPlaceholder, BoundExpression? elementConversion, BoundTypeExpression iterationVariableType, ImmutableArray<LocalSymbol> iterationVariables, BoundExpression? iterationErrorExpressionOpt, BoundExpression expression, BoundForEachDeconstructStep? deconstructionOpt, BoundAwaitableInfo? awaitOpt, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel) 4119public BoundUsingStatement(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundMultipleLocalDeclarations? declarationsOpt, BoundExpression? expressionOpt, BoundStatement body, BoundAwaitableInfo? awaitOpt, MethodArgumentInfo? patternDisposeInfoOpt, bool hasErrors = false) 4134public ImmutableArray<LocalSymbol> Locals { get; } 4144public BoundUsingStatement Update(ImmutableArray<LocalSymbol> locals, BoundMultipleLocalDeclarations? declarationsOpt, BoundExpression? expressionOpt, BoundStatement body, BoundAwaitableInfo? awaitOpt, MethodArgumentInfo? patternDisposeInfoOpt) 4158public BoundFixedStatement(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundMultipleLocalDeclarations declarations, BoundStatement body, bool hasErrors = false) 4171public ImmutableArray<LocalSymbol> Locals { get; } 4178public BoundFixedStatement Update(ImmutableArray<LocalSymbol> locals, BoundMultipleLocalDeclarations declarations, BoundStatement body) 4260public BoundCatchBlock(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundExpression? exceptionSourceOpt, TypeSymbol? exceptionTypeOpt, BoundStatementList? exceptionFilterPrologueOpt, BoundExpression? exceptionFilterOpt, BoundBlock body, bool isSynthesizedAsyncCatchAll, bool hasErrors = false) 4276public ImmutableArray<LocalSymbol> Locals { get; } 4287public BoundCatchBlock Update(ImmutableArray<LocalSymbol> locals, BoundExpression? exceptionSourceOpt, TypeSymbol? exceptionTypeOpt, BoundStatementList? exceptionFilterPrologueOpt, BoundExpression? exceptionFilterOpt, BoundBlock body, bool isSynthesizedAsyncCatchAll) 4506public BoundLocal(SyntaxNode syntax, LocalSymbol localSymbol, BoundLocalDeclarationKind declarationKind, ConstantValue? constantValueOpt, bool isNullableUnknown, TypeSymbol type, bool hasErrors) 4519public BoundLocal(SyntaxNode syntax, LocalSymbol localSymbol, BoundLocalDeclarationKind declarationKind, ConstantValue? constantValueOpt, bool isNullableUnknown, TypeSymbol type) 4533public LocalSymbol LocalSymbol { get; } 4541public BoundLocal Update(LocalSymbol localSymbol, BoundLocalDeclarationKind declarationKind, ConstantValue? constantValueOpt, bool isNullableUnknown, TypeSymbol type) 4555public BoundPseudoVariable(SyntaxNode syntax, LocalSymbol localSymbol, PseudoVariableExpressions emitExpressions, TypeSymbol type, bool hasErrors) 4567public BoundPseudoVariable(SyntaxNode syntax, LocalSymbol localSymbol, PseudoVariableExpressions emitExpressions, TypeSymbol type) 4580public LocalSymbol LocalSymbol { get; } 4586public BoundPseudoVariable Update(LocalSymbol localSymbol, PseudoVariableExpressions emitExpressions, TypeSymbol type) 4904public BoundSwitchExpressionArm(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundPattern pattern, BoundExpression? whenClause, BoundExpression value, LabelSymbol label, bool hasErrors = false) 4920public ImmutableArray<LocalSymbol> Locals { get; } 4929public BoundSwitchExpressionArm Update(ImmutableArray<LocalSymbol> locals, BoundPattern pattern, BoundExpression? whenClause, BoundExpression value, LabelSymbol label) 5659public BoundSwitchSection(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundSwitchLabel> switchLabels, ImmutableArray<BoundStatement> statements, bool hasErrors = false) 5671public ImmutableArray<LocalSymbol> Locals { get; } 5677public BoundSwitchSection Update(ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundSwitchLabel> switchLabels, ImmutableArray<BoundStatement> statements) 5766public BoundSequence(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundExpression> sideEffects, BoundExpression value, TypeSymbol type, bool hasErrors = false) 5781public ImmutableArray<LocalSymbol> Locals { get; } 5788public BoundSequence Update(ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundExpression> sideEffects, BoundExpression value, TypeSymbol type) 5802public BoundSpillSequence(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundStatement> sideEffects, BoundExpression value, TypeSymbol type, bool hasErrors = false) 5817public ImmutableArray<LocalSymbol> Locals { get; } 5824public BoundSpillSequence Update(ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundStatement> sideEffects, BoundExpression value, TypeSymbol type) 8767public BoundConstructorMethodBody(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundStatement? initializer, BoundBlock? blockBody, BoundBlock? expressionBody, bool hasErrors = false) 8777public ImmutableArray<LocalSymbol> Locals { get; } 8783public BoundConstructorMethodBody Update(ImmutableArray<LocalSymbol> locals, BoundStatement? initializer, BoundBlock? blockBody, BoundBlock? expressionBody) 12268ImmutableArray<LocalSymbol> locals = GetUpdatedArray(node, node.Locals); 12276ImmutableArray<LocalSymbol> locals = GetUpdatedArray(node, node.Locals); 12284ImmutableArray<LocalSymbol> locals = GetUpdatedArray(node, node.Locals); 13052LocalSymbol local = GetUpdatedSymbol(node, node.Local); 13390ImmutableArray<LocalSymbol> locals = GetUpdatedArray(node, node.Locals); 13399ImmutableArray<LocalSymbol> locals = GetUpdatedArray(node, node.Locals); 13413LocalSymbol localSymbol = GetUpdatedSymbol(node, node.LocalSymbol); 13430ImmutableArray<LocalSymbol> innerLocals = GetUpdatedArray(node, node.InnerLocals); 13441ImmutableArray<LocalSymbol> locals = GetUpdatedArray(node, node.Locals); 13449ImmutableArray<LocalSymbol> locals = GetUpdatedArray(node, node.Locals); 13457ImmutableArray<LocalSymbol> outerLocals = GetUpdatedArray(node, node.OuterLocals); 13458ImmutableArray<LocalSymbol> innerLocals = GetUpdatedArray(node, node.InnerLocals); 13468ImmutableArray<LocalSymbol> iterationVariables = GetUpdatedArray(node, node.IterationVariables); 13482ImmutableArray<LocalSymbol> locals = GetUpdatedArray(node, node.Locals); 13492ImmutableArray<LocalSymbol> locals = GetUpdatedArray(node, node.Locals); 13500ImmutableArray<LocalSymbol> locals = GetUpdatedArray(node, node.Locals); 13583LocalSymbol localSymbol = GetUpdatedSymbol(node, node.LocalSymbol); 13600LocalSymbol localSymbol = GetUpdatedSymbol(node, node.LocalSymbol); 13664ImmutableArray<LocalSymbol> locals = GetUpdatedArray(node, node.Locals); 13762ImmutableArray<LocalSymbol> locals = GetUpdatedArray(node, node.Locals); 13787ImmutableArray<LocalSymbol> locals = GetUpdatedArray(node, node.Locals); 13806ImmutableArray<LocalSymbol> locals = GetUpdatedArray(node, node.Locals); 14951ImmutableArray<LocalSymbol> locals = GetUpdatedArray(node, node.Locals);
Lowering\AsyncRewriter\AsyncExceptionHandlerRewriter.cs (26)
219var locals = ArrayBuilder<LocalSymbol>.GetInstance(); 229LocalSymbol returnLocal = frame.returnValue; 248LocalSymbol pendingBranchVar, 283LocalSymbol pendingBranchVar, 403private BoundStatement UnpendException(LocalSymbol pendingExceptionLocal) 407LocalSymbol obj = _F.SynthesizedLocal(_F.SpecialType(SpecialType.System_Object)); 414ImmutableArray.Create<LocalSymbol>(obj), 423private BoundStatement Rethrow(LocalSymbol obj) 435var ex = _F.SynthesizedLocal(_F.WellKnownType(WellKnownType.System_Exception)); 499ImmutableArray.Create<LocalSymbol>( 555var catchTemp = _F.SynthesizedLocal(catchType); 572ImmutableArray<LocalSymbol> handlerLocals; 598handlerLocals = ImmutableArray<LocalSymbol>.Empty; 602foreach (var local in node.Locals) 684LocalSymbol hoistedLocal; 1039private readonly Dictionary<LocalSymbol, LocalSymbol> _hoistedLocals; 1040private readonly List<LocalSymbol> _orderedHoistedLocals; 1049_hoistedLocals = new Dictionary<LocalSymbol, LocalSymbol>(); 1050_orderedHoistedLocals = new List<LocalSymbol>(); 1053public void HoistLocal(LocalSymbol local, SyntheticBoundNodeFactory F) 1068var newLocal = F.SynthesizedLocal(local.Type, pendingCatch.SyntaxOpt, kind: SynthesizedLocalKind.ExceptionFilterAwaitHoistedExceptionLocal); 1074public IEnumerable<LocalSymbol> GetHoistedLocals() 1079public bool TryGetHoistedLocal(LocalSymbol originalLocal, out LocalSymbol hoistedLocal)
Lowering\AsyncRewriter\AsyncIteratorMethodToStateMachineRewriter.cs (1)
180protected override BoundStatement GenerateSetExceptionCall(LocalSymbol exceptionLocal)
Lowering\AsyncRewriter\AsyncMethodToStateMachineRewriter.cs (18)
57private readonly LocalSymbol? _exprRetValue; 150var exceptionLocal = F.SynthesizedLocal(F.WellKnownType(WellKnownType.System_Exception)); 153F.Block(ImmutableArray<LocalSymbol>.Empty, 191var locals = ArrayBuilder<LocalSymbol>.GetInstance(); 213BoundCatchBlock generateExceptionHandling(LocalSymbol exceptionLocal, ImmutableArray<StateMachineFieldSymbol> rootHoistedLocals) 286protected virtual BoundStatement GenerateSetExceptionCall(LocalSymbol exceptionLocal) 373var awaiterTemp = F.SynthesizedLocal(getAwaiter.Type, syntax: node.Syntax, kind: SynthesizedLocalKind.Awaiter); 443private BoundExpression GenerateGetIsCompleted(LocalSymbol awaiterTemp, MethodSymbol getIsCompletedMethod) 461private BoundBlock GenerateAwaitForIncompleteTask(LocalSymbol awaiterTemp, BoundAwaitExpressionDebugInfo debugInfo) 532private BoundStatement GenerateAwaitOnCompletedDynamic(LocalSymbol awaiterTemp) 549var criticalNotifyCompletedTemp = F.SynthesizedLocal( 553var notifyCompletionTemp = F.SynthesizedLocal( 557LocalSymbol thisTemp = (F.CurrentType.TypeKind == TypeKind.Class) ? F.SynthesizedLocal(F.CurrentType) : null; 612private BoundStatement GenerateAwaitOnCompleted(TypeSymbol loweredAwaiterType, LocalSymbol awaiterTemp) 618LocalSymbol thisTemp = (F.CurrentType.TypeKind == TypeKind.Class) ? F.SynthesizedLocal(F.CurrentType) : null; 651private static ImmutableArray<LocalSymbol> SingletonOrPair(LocalSymbol first, LocalSymbol secondOpt)
Lowering\AsyncRewriter\AsyncRewriter.AsyncIteratorRewriter.cs (6)
200protected override void InitializeStateMachine(ArrayBuilder<BoundStatement> bodyBuilder, NamedTypeSymbol frameType, LocalSymbol stateMachineLocal) 262protected override BoundStatement GenerateStateMachineCreation(LocalSymbol stateMachineVariable, NamedTypeSymbol frameType, IReadOnlyDictionary<Symbol, CapturedSymbolReplacement> proxies) 324out LocalSymbol instSymbol, 336var versionSymbol = F.SynthesizedLocal(F.SpecialType(SpecialType.System_Int16)); 367private void GetPartsForStartingMachine(out BoundExpressionStatement callReset, out LocalSymbol instSymbol, out BoundStatement instAssignment, 434out LocalSymbol instSymbol,
Lowering\AsyncRewriter\AsyncRewriter.cs (2)
202protected override void InitializeStateMachine(ArrayBuilder<BoundStatement> bodyBuilder, NamedTypeSymbol frameType, LocalSymbol stateMachineLocal) 214protected override BoundStatement GenerateStateMachineCreation(LocalSymbol stateMachineVariable, NamedTypeSymbol frameType, IReadOnlyDictionary<Symbol, CapturedSymbolReplacement> proxies)
Lowering\ClosureConversion\ClosureConversion.Analysis.Tree.cs (2)
619if (symbol is LocalSymbol local && local.IsConst) 686type = ((LocalSymbol)capturedVariable).Type;
Lowering\ClosureConversion\ClosureConversion.cs (29)
97private readonly HashSet<LocalSymbol> _assignLocals; 133private ArrayBuilder<LocalSymbol> _addedLocals; 168HashSet<LocalSymbol> assignLocals) 202Debug.Assert(localOrParameter is LocalSymbol || localOrParameter is ParameterSymbol || 239HashSet<LocalSymbol> assignLocals) 631var localFrame = (LocalSymbol)framePointer; 659private BoundNode IntroduceFrame(BoundNode node, Analysis.ClosureEnvironment env, Func<ArrayBuilder<BoundExpression>, ArrayBuilder<LocalSymbol>, BoundNode> F) 666LocalSymbol framePointer = new SynthesizedLocal(_topLevelMethod, TypeWithAnnotations.Create(frameType), SynthesizedLocalKind.LambdaDisplayClass, frame.ScopeSyntaxOpt); 721var addedLocals = ArrayBuilder<LocalSymbol>.GetInstance(); 744private void InitVariableProxy(SyntaxNode syntax, Symbol symbol, LocalSymbol framePointer, ArrayBuilder<BoundExpression> prologue) 764var local = (LocalSymbol)symbol; 770LocalSymbol localToUse; 1123locals: ImmutableArray<LocalSymbol>.Empty, 1134private BoundSequence RewriteSequence(BoundSequence node, ArrayBuilder<BoundExpression> prologue, ArrayBuilder<LocalSymbol> newLocals) 1155return IntroduceFrame(node, frame, (ArrayBuilder<BoundExpression> prologue, ArrayBuilder<LocalSymbol> newLocals) => 1160return RewriteBlock(node, ArrayBuilder<BoundExpression>.GetInstance(), ArrayBuilder<LocalSymbol>.GetInstance()); 1164private BoundBlock RewriteBlock(BoundBlock node, ArrayBuilder<BoundExpression> prologue, ArrayBuilder<LocalSymbol> newLocals) 1201var newLocals = ArrayBuilder<LocalSymbol>.GetInstance(); 1219return IntroduceFrame(node, frame, (ArrayBuilder<BoundExpression> prologue, ArrayBuilder<LocalSymbol> newLocals) => 1226return RewriteCatch(node, ArrayBuilder<BoundExpression>.GetInstance(), ArrayBuilder<LocalSymbol>.GetInstance()); 1230private BoundNode RewriteCatch(BoundCatchBlock node, ArrayBuilder<BoundExpression> prologue, ArrayBuilder<LocalSymbol> newLocals) 1248ImmutableArray.Create<LocalSymbol>(), 1293return IntroduceFrame(node, frame, (ArrayBuilder<BoundExpression> prologue, ArrayBuilder<LocalSymbol> newLocals) => 1300return RewriteSequence(node, ArrayBuilder<BoundExpression>.GetInstance(), ArrayBuilder<LocalSymbol>.GetInstance()); 1310return IntroduceFrame(node, frame, (ArrayBuilder<BoundExpression> prologue, ArrayBuilder<LocalSymbol> newLocals) => 1719var cacheLocal = F.SynthesizedLocal(type, kind: SynthesizedLocalKind.CachedAnonymousMethodDelegate); 1720if (_addedLocals == null) _addedLocals = ArrayBuilder<LocalSymbol>.GetInstance();
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (3)
836var locals = ArrayBuilder<LocalSymbol>.GetInstance(); 841var param = _bound.SynthesizedLocal(ParameterExpressionType); 893var param = _bound.SynthesizedLocal(ParameterExpressionType);
Lowering\ClosureConversion\LambdaCapturedVariable.cs (4)
44Debug.Assert(captured is LocalSymbol || captured is ParameterSymbol); 64if (variable is LocalSymbol local) 99var local = variable as LocalSymbol;
Lowering\Instrumentation\CodeCoverageInstrumenter.cs (3)
34private readonly LocalSymbol _methodPayload; 168LocalSymbol methodPayload, 237public override void InstrumentBlock(BoundBlock original, LocalRewriter rewriter, ref TemporaryArray<LocalSymbol> additionalLocals, out BoundStatement? prologue, out BoundStatement? epilogue, out BoundBlockInstrumentation? instrumentation)
Lowering\Instrumentation\CompoundInstrumenter.cs (1)
89public override void InstrumentBlock(BoundBlock original, LocalRewriter rewriter, ref TemporaryArray<LocalSymbol> additionalLocals, out BoundStatement? prologue, out BoundStatement? epilogue, out BoundBlockInstrumentation? instrumentation)
Lowering\Instrumentation\DebugInfoInjector.cs (1)
186public override void InstrumentBlock(BoundBlock original, LocalRewriter rewriter, ref TemporaryArray<LocalSymbol> additionalLocals, out BoundStatement? prologue, out BoundStatement? epilogue, out BoundBlockInstrumentation? instrumentation)
Lowering\Instrumentation\DebugInfoInjector_SequencePoints.cs (1)
182var local = factory.SynthesizedLocal(condition.Type, synthesizedVariableSyntax, kind: SynthesizedLocalKind.ConditionalBranchDiscriminator);
Lowering\Instrumentation\Instrumenter.cs (1)
74public virtual void InstrumentBlock(BoundBlock original, LocalRewriter rewriter, ref TemporaryArray<LocalSymbol> additionalLocals, out BoundStatement? prologue, out BoundStatement? epilogue, out BoundBlockInstrumentation? instrumentation)
Lowering\Instrumentation\LocalStateTracingInstrumenter.cs (8)
90public LocalSymbol ContextVariable; 91private ArrayBuilder<LocalSymbol>? _lazyPreviousContextVariables; 93public Scope(LocalSymbol contextVariable) 98public void Open(LocalSymbol local) 100_lazyPreviousContextVariables ??= ArrayBuilder<LocalSymbol>.GetInstance(); 284public override void InstrumentBlock(BoundBlock original, LocalRewriter rewriter, ref TemporaryArray<LocalSymbol> additionalLocals, out BoundStatement? prologue, out BoundStatement? epilogue, out BoundBlockInstrumentation? instrumentation) 488LocalSymbol local => _factory.Local(local), 609return _factory.Sequence(ImmutableArray<LocalSymbol>.Empty, builder.ToImmutableAndFree(), lastExpression);
Lowering\Instrumentation\ModuleCancellationInstrumenter.cs (1)
67public override void InstrumentBlock(BoundBlock original, LocalRewriter rewriter, ref TemporaryArray<LocalSymbol> additionalLocals, out BoundStatement? prologue, out BoundStatement? epilogue, out BoundBlockInstrumentation? instrumentation)
Lowering\Instrumentation\StackOverflowProbingInstrumenter.cs (1)
57public override void InstrumentBlock(BoundBlock original, LocalRewriter rewriter, ref TemporaryArray<LocalSymbol> additionalLocals, out BoundStatement? prologue, out BoundStatement? epilogue, out BoundBlockInstrumentation? instrumentation)
Lowering\IteratorRewriter\IteratorMethodToStateMachineRewriter.cs (5)
35private LocalSymbol? _methodValue; 173var stateLocal = F.SynthesizedLocal(stateField.Type); 177ImmutableArray.Create<LocalSymbol>(stateLocal), 205ImmutableArray.Create<LocalSymbol>(_methodValue), 412ImmutableArray<LocalSymbol>.Empty,
Lowering\IteratorRewriter\IteratorRewriter.cs (2)
301protected override void InitializeStateMachine(ArrayBuilder<BoundStatement> bodyBuilder, NamedTypeSymbol frameType, LocalSymbol stateMachineLocal) 312protected override BoundStatement GenerateStateMachineCreation(LocalSymbol stateMachineVariable, NamedTypeSymbol frameType, IReadOnlyDictionary<Symbol, CapturedSymbolReplacement> proxies)
Lowering\LocalRewriter\LocalRewriter.cs (2)
40private ArrayBuilder<LocalSymbol>? _additionalLocals; 704_additionalLocals = ArrayBuilder<LocalSymbol>.GetInstance();
Lowering\LocalRewriter\LocalRewriter.DecisionDagRewriter.cs (1)
51internal LocalSymbol? _whenNodeIdentifierLocal;
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (4)
57private readonly ArrayBuilder<LocalSymbol> _temps = ArrayBuilder<LocalSymbol>.GetInstance(); 99LocalSymbol temp = _factory.SynthesizedLocal(dagTemp.Type, syntax: _node, kind: kind); 126public ImmutableArray<LocalSymbol> AllTemps()
Lowering\LocalRewriter\LocalRewriter_AsOperator.cs (1)
73locals: ImmutableArray<LocalSymbol>.Empty,
Lowering\LocalRewriter\LocalRewriter_AssignmentOperator.cs (2)
295ArrayBuilder<LocalSymbol>? argTempsBuilder = null; 325LocalSymbol rhsTemp = _factory.SynthesizedLocal(exprType);
Lowering\LocalRewriter\LocalRewriter_Await.cs (1)
52locals: ImmutableArray.Create<LocalSymbol>(tempAccess.LocalSymbol),
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (10)
852locals: ImmutableArray<LocalSymbol>.Empty, 1098locals: ImmutableArray.Create<LocalSymbol>(boundTempX.LocalSymbol, boundTempY.LocalSymbol), 1287locals: ImmutableArray.Create<LocalSymbol>(boundTempX.LocalSymbol, boundTempY.LocalSymbol), 1396locals: ImmutableArray<LocalSymbol>.Empty, 1440var locals = ArrayBuilder<LocalSymbol>.GetInstance(); 1489ArrayBuilder<LocalSymbol> locals, 1734locals: ImmutableArray.Create<LocalSymbol>(boundTemp.LocalSymbol), 1795locals: ImmutableArray.Create<LocalSymbol>(boundTempX.LocalSymbol, boundTempY.LocalSymbol), 1883locals: ImmutableArray.Create<LocalSymbol>(boundTempX.LocalSymbol, boundTempY.LocalSymbol), 1964locals: ImmutableArray<LocalSymbol>.Empty,
Lowering\LocalRewriter\LocalRewriter_Block.cs (3)
28_additionalLocals = ArrayBuilder<LocalSymbol>.GetInstance(); 35var additionalLocals = TemporaryArray<LocalSymbol>.Empty; 130? new BoundBlock(node.Syntax, ImmutableArray<LocalSymbol>.Empty, ImmutableArray<BoundStatement>.Empty)
Lowering\LocalRewriter\LocalRewriter_Call.cs (17)
140ref ArrayBuilder<LocalSymbol> temps, 398ArrayBuilder<LocalSymbol>? temps = null; 445ImmutableArray<LocalSymbol> temps) 661ref ArrayBuilder<LocalSymbol>? tempsOpt, 717tempsOpt ??= ArrayBuilder<LocalSymbol>.GetInstance(); 807ImmutableArray<LocalSymbol>.Empty, 815void ensureTempTrackingSetup([NotNull] ref ArrayBuilder<LocalSymbol>? tempsOpt, ref BitVector positionsAssignedToTemp) 817tempsOpt ??= ArrayBuilder<LocalSymbol>.GetInstance(); 830ref ArrayBuilder<LocalSymbol>? tempsOpt, 884visitedArgumentsBuilder[argIndex] = _factory.Sequence(ImmutableArray<LocalSymbol>.Empty, ImmutableArray.Create<BoundExpression>(store), local); 930private void ReferToTempIfReferenceTypeReceiver(BoundLocal receiverTemp, ref BoundAssignmentOperator assignmentToTemp, out BoundAssignmentOperator? extraRefInitialization, ArrayBuilder<LocalSymbol> temps) 1003[NotNull] ref ArrayBuilder<LocalSymbol>? temps, 1015temps ??= ArrayBuilder<LocalSymbol>.GetInstance(); 1455ArrayBuilder<LocalSymbol> temporariesBuilder) 1579ImmutableArray<LocalSymbol>.Empty, 1603ArrayBuilder<LocalSymbol> temporariesBuilder) 1643locals: ImmutableArray<LocalSymbol>.Empty,
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (4)
616locals: ImmutableArray<LocalSymbol>.Empty, 1262new BoundBlock(iteratorBody.Syntax, locals: ImmutableArray<LocalSymbol>.Empty, statements); 1341var iterationVariable = _factory.SynthesizedLocal(enumeratorInfo.ElementType, node.Syntax); 1420ImmutableArray<LocalSymbol>.Empty,
Lowering\LocalRewriter\LocalRewriter_CompoundAssignmentOperator.cs (12)
27var temps = ArrayBuilder<LocalSymbol>.GetInstance(); 58var eventTemps = ArrayBuilder<LocalSymbol>.GetInstance(); 161private BoundExpression? TransformPropertyOrEventReceiver(Symbol propertyOrEvent, BoundExpression? receiverOpt, bool isRegularCompoundAssignment, ArrayBuilder<BoundExpression> stores, ArrayBuilder<LocalSymbol> temps) 227private BoundDynamicMemberAccess TransformDynamicMemberAccess(BoundDynamicMemberAccess memberAccess, ArrayBuilder<BoundExpression> stores, ArrayBuilder<LocalSymbol> temps) 244private BoundIndexerAccess TransformIndexerAccess(BoundIndexerAccess indexerAccess, bool isRegularCompoundAssignment, ArrayBuilder<BoundExpression> stores, ArrayBuilder<LocalSymbol> temps) 320ArrayBuilder<LocalSymbol> temps) 409ArrayBuilder<LocalSymbol> temps, 423private BoundExpression TransformIndexPatternIndexerAccess(BoundImplicitIndexerAccess implicitIndexerAccess, bool isRegularCompoundAssignment, ArrayBuilder<BoundExpression> stores, ArrayBuilder<LocalSymbol> temps, bool isDynamicAssignment) 459private bool TransformCompoundAssignmentFieldOrEventAccessReceiver(Symbol fieldOrEvent, ref BoundExpression? receiver, ArrayBuilder<BoundExpression> stores, ArrayBuilder<LocalSymbol> temps) 502private BoundDynamicIndexerAccess TransformDynamicIndexerAccess(BoundDynamicIndexerAccess indexerAccess, ArrayBuilder<BoundExpression> stores, ArrayBuilder<LocalSymbol> temps) 561private BoundExpression TransformCompoundAssignmentLHS(BoundExpression originalLHS, bool isRegularCompoundAssignment, ArrayBuilder<BoundExpression> stores, ArrayBuilder<LocalSymbol> temps, bool isDynamicAssignment) 780ArrayBuilder<LocalSymbol> temps)
Lowering\LocalRewriter\LocalRewriter_ConditionalAccess.cs (1)
79LocalSymbol? temp = null;
Lowering\LocalRewriter\LocalRewriter_DeconstructionAssignmentOperator.cs (9)
39var lhsTemps = ArrayBuilder<LocalSymbol>.GetInstance(); 77var temps = ArrayBuilder<LocalSymbol>.GetInstance(); 214ArrayBuilder<LocalSymbol> temps, 278ArrayBuilder<LocalSymbol> temps, DeconstructionSideEffects effects, ref bool inInit) 334private ImmutableArray<BoundExpression> AccessTupleFields(BoundExpression expression, ArrayBuilder<LocalSymbol> temps, 371ArrayBuilder<LocalSymbol> temps, ArrayBuilder<BoundExpression> effects) 382ArrayBuilder<BoundExpression> effects, ArrayBuilder<LocalSymbol> temps) 421ArrayBuilder<LocalSymbol> temps) 443private ArrayBuilder<Binder.DeconstructionVariable> GetAssignmentTargetsAndSideEffects(BoundTupleExpression variables, ArrayBuilder<LocalSymbol> temps, ArrayBuilder<BoundExpression> effects)
Lowering\LocalRewriter\LocalRewriter_Event.cs (3)
179ImmutableArray<LocalSymbol> tempSymbols = boundTemp == null 180? ImmutableArray<LocalSymbol>.Empty 181: ImmutableArray.Create<LocalSymbol>(boundTemp.LocalSymbol);
Lowering\LocalRewriter\LocalRewriter_FixedStatement.cs (13)
22var localBuilder = ArrayBuilder<LocalSymbol>.GetInstance(node.Locals.Length); 31LocalSymbol pinnedTemp; 197out LocalSymbol pinnedTemp) 202LocalSymbol localSymbol = localDecl.LocalSymbol; 234LocalSymbol localSymbol, 237out LocalSymbol pinnedTemp) 301LocalSymbol localSymbol, 304out LocalSymbol pinnedTemp) 379locals: ImmutableArray<LocalSymbol>.Empty, 436LocalSymbol localSymbol, 439out LocalSymbol pinnedTemp) 505LocalSymbol localSymbol, 508out LocalSymbol pinnedTemp)
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (27)
141ImmutableArray<LocalSymbol> iterationVariables, 157LocalSymbol enumeratorVar = _factory.SynthesizedLocal(enumeratorType, syntax: forEachSyntax, kind: SynthesizedLocalKind.ForEachEnumerator); 260tryBlock: new BoundBlock(forEachSyntax, locals: ImmutableArray<LocalSymbol>.Empty, statements: ImmutableArray.Create(whileLoop)), 411locals: ImmutableArray<LocalSymbol>.Empty, 424LocalSymbol disposableVar = _factory.SynthesizedLocal(idisposableTypeSymbol); 603ImmutableArray<LocalSymbol> iterationVariables, 618LocalSymbol? preambleLocal = null; 623LocalSymbol collectionTemp = _factory.SynthesizedLocal(collectionType, forEachSyntax, kind: SynthesizedLocalKind.ForEachArray, refKind: collectionTempRefKind); 639LocalSymbol positionVar = _factory.SynthesizedLocal(intType, syntax: forEachSyntax, kind: SynthesizedLocalKind.ForEachArrayIndex); 693outerLocals: preambleLocal is null ? ImmutableArray.Create<LocalSymbol>(collectionTemp, positionVar) : ImmutableArray.Create<LocalSymbol>(preambleLocal, collectionTemp, positionVar), 707private delegate BoundStatement? GetForEachStatementAsForPreamble(LocalRewriter rewriter, SyntaxNode syntax, ForEachEnumeratorInfo enumeratorInfo, ref BoundExpression rewrittenExpression, out LocalSymbol? preambleLocal, out RefKind collectionTempRefKind); 746return static (LocalRewriter rewriter, SyntaxNode syntax, ForEachEnumeratorInfo enumeratorInfo, ref BoundExpression rewrittenExpression, out LocalSymbol? preambleLocal, out RefKind collectionTempRefKind) => 812ImmutableArray<LocalSymbol> iterationVariables, 838ImmutableArray<LocalSymbol> iterationVariables, 899ImmutableArray<LocalSymbol> iterationVariables, 917LocalSymbol arrayVar = _factory.SynthesizedLocal(arrayType, syntax: forEachSyntax, kind: SynthesizedLocalKind.ForEachArray); 928LocalSymbol positionVar = _factory.SynthesizedLocal(intType, syntax: forEachSyntax, kind: SynthesizedLocalKind.ForEachArrayIndex); 989outerLocals: ImmutableArray.Create<LocalSymbol>(arrayVar, positionVar), 1048ImmutableArray<LocalSymbol> iterationVariables, 1073LocalSymbol arrayVar = _factory.SynthesizedLocal(arrayType, syntax: forEachSyntax, kind: SynthesizedLocalKind.ForEachArray); 1087LocalSymbol[] upperVar = new LocalSymbol[rank]; 1109LocalSymbol[] positionVar = new LocalSymbol[rank]; 1232private static BoundLocal MakeBoundLocal(CSharpSyntaxNode syntax, LocalSymbol local, TypeSymbol type) 1240private BoundStatement MakeLocalDeclaration(CSharpSyntaxNode syntax, LocalSymbol local, BoundExpression rewrittenInitialValue)
Lowering\LocalRewriter\LocalRewriter_ForStatement.cs (1)
42ImmutableArray<LocalSymbol> outerLocals,
Lowering\LocalRewriter\LocalRewriter_FunctionPointerInvocation.cs (1)
25ArrayBuilder<LocalSymbol>? temps = null;
Lowering\LocalRewriter\LocalRewriter_Index.cs (2)
35ArrayBuilder<LocalSymbol> locals = ArrayBuilder<LocalSymbol>.GetInstance();
Lowering\LocalRewriter\LocalRewriter_IndexerAccess.cs (8)
159ArrayBuilder<LocalSymbol>? temps = null; 251var localsBuilder = ArrayBuilder<LocalSymbol>.GetInstance(); 456var locals = ArrayBuilder<LocalSymbol>.GetInstance(2); 477ArrayBuilder<LocalSymbol> locals) 758var localsBuilder = ArrayBuilder<LocalSymbol>.GetInstance(); 769private BoundExpression VisitRangePatternIndexerAccess(BoundImplicitIndexerAccess node, ArrayBuilder<LocalSymbol> localsBuilder, ArrayBuilder<BoundExpression> sideEffectsBuilder, bool cacheAllArgumentsOnly) 996private BoundExpression MakeRangeSize(ref BoundExpression startExpr, BoundExpression endExpr, ArrayBuilder<LocalSymbol> localsBuilder, ArrayBuilder<BoundExpression> sideEffectsBuilder) 1027private void DeconstructRange(BoundExpression rewrittenRangeArg, BoundExpression lengthAccess, ArrayBuilder<LocalSymbol> localsBuilder, ArrayBuilder<BoundExpression> sideEffectsBuilder, out BoundExpression startExpr, out BoundExpression rangeSizeExpr)
Lowering\LocalRewriter\LocalRewriter_IsOperator.cs (1)
91locals: ImmutableArray<LocalSymbol>.Empty,
Lowering\LocalRewriter\LocalRewriter_IsPatternOperator.cs (2)
120LocalSymbol resultTemp = _factory.SynthesizedLocal(node.Type, node.Syntax, kind: SynthesizedLocalKind.LoweringTemp); 181test = _factory.Sequence(ImmutableArray<LocalSymbol>.Empty, _sideEffectBuilder.ToImmutable(), test);
Lowering\LocalRewriter\LocalRewriter_LocalDeclaration.cs (2)
19private BoundStatement? RewriteLocalDeclaration(BoundLocalDeclaration? originalOpt, SyntaxNode syntax, LocalSymbol localSymbol, BoundExpression? rewrittenInitializer, bool hasErrors = false) 72private BoundStatement InstrumentLocalDeclarationIfNecessary(BoundLocalDeclaration? originalOpt, LocalSymbol localSymbol, BoundStatement rewrittenLocalDeclaration)
Lowering\LocalRewriter\LocalRewriter_NullCoalescingAssignmentOperator.cs (2)
18var temps = ArrayBuilder<LocalSymbol>.GetInstance(); 129var alternative = _factory.Sequence(ImmutableArray<LocalSymbol>.Empty, ImmutableArray.Create(tmpAssignment, transformedLhsAssignment), tmp);
Lowering\LocalRewriter\LocalRewriter_ObjectCreationExpression.cs (5)
44ArrayBuilder<LocalSymbol>? tempsBuilder = null; 166var temps = ArrayBuilder<LocalSymbol>.GetInstance(); 200ArrayBuilder<BoundExpression> sideEffects, ArrayBuilder<LocalSymbol> temps) 270ArrayBuilder<LocalSymbol>? temps = null; 288ImmutableArray<LocalSymbol> locals;
Lowering\LocalRewriter\LocalRewriter_ObjectOrCollectionInitializerExpression.cs (14)
33ref ArrayBuilder<LocalSymbol>? temps, 175ArrayBuilder<LocalSymbol>? temps = null; 212private BoundExpression VisitObjectInitializerMember(BoundObjectInitializerMember node, ref BoundExpression rewrittenReceiver, ArrayBuilder<BoundExpression> sideEffects, ref ArrayBuilder<LocalSymbol>? temps) 220ArrayBuilder<LocalSymbol>? constructionTemps = null; 251ref ArrayBuilder<LocalSymbol>? temps, 271ref ArrayBuilder<LocalSymbol>? temps, 424temps ??= ArrayBuilder<LocalSymbol>.GetInstance(); 460temps = ArrayBuilder<LocalSymbol>.GetInstance(); 482temps ??= ArrayBuilder<LocalSymbol>.GetInstance(); 591ref ArrayBuilder<LocalSymbol>? temps) 605(LocalRewriter rewriter, ArrayBuilder<BoundExpression> sideeffects, ArrayBuilder<LocalSymbol>? temps) elementArg = (rewriter: this, sideeffects, temps); 608static (BoundExpression element, ref (LocalRewriter rewriter, ArrayBuilder<BoundExpression> sideeffects, ArrayBuilder<LocalSymbol>? temps) elementArg) => 637private BoundExpression EvaluateSideEffects(BoundExpression arg, RefKind refKind, ArrayBuilder<BoundExpression> sideeffects, ref ArrayBuilder<LocalSymbol>? temps) 646temps = ArrayBuilder<LocalSymbol>.GetInstance();
Lowering\LocalRewriter\LocalRewriter_PatternSwitchStatement.cs (1)
75var outerVariables = ArrayBuilder<LocalSymbol>.GetInstance();
Lowering\LocalRewriter\LocalRewriter_Range.cs (1)
85var locals = ArrayBuilder<LocalSymbol>.GetInstance();
Lowering\LocalRewriter\LocalRewriter_StackAlloc.cs (1)
54var locals = ArrayBuilder<LocalSymbol>.GetInstance();
Lowering\LocalRewriter\LocalRewriter_StringConcat.cs (2)
227var locals = PooledHashSet<LocalSymbol>.GetInstance(); 533var localsBuilder = ArrayBuilder<LocalSymbol>.GetInstance();
Lowering\LocalRewriter\LocalRewriter_StringInterpolation.cs (5)
34var builderTempSymbol = _factory.InterpolatedStringHandlerLocal(data.BuilderType, syntax); 59var outLocal = _factory.SynthesizedLocal(localType); 260private readonly LocalSymbol? _outTemp; 264public InterpolationHandlerResult(ImmutableArray<BoundStatement> statements, BoundLocal handlerTemp, LocalSymbol outTemp, LocalRewriter rewriter) 273public InterpolationHandlerResult(ImmutableArray<BoundExpression> expressions, BoundLocal handlerTemp, LocalSymbol? outTemp, LocalRewriter rewriter)
Lowering\LocalRewriter\LocalRewriter_SwitchExpression.cs (2)
50var outerVariables = ArrayBuilder<LocalSymbol>.GetInstance(); 89LocalSymbol resultTemp = _factory.SynthesizedLocal(node.Type, node.Syntax, kind: SynthesizedLocalKind.LoweringTemp);
Lowering\LocalRewriter\LocalRewriter_TupleBinaryOperator.cs (14)
32var temps = ArrayBuilder<LocalSymbol>.GetInstance(); 101ArrayBuilder<LocalSymbol> temps) 142ArrayBuilder<LocalSymbol> temps) 183ArrayBuilder<LocalSymbol> temps, 247ArrayBuilder<LocalSymbol> temps, BinaryOperatorKind operatorKind) 267TypeSymbol boolType, ArrayBuilder<LocalSymbol> temps, BinaryOperatorKind operatorKind) 308BoundExpression innerSequence = _factory.Sequence(locals: ImmutableArray<LocalSymbol>.Empty, innerEffects.ToImmutableAndFree(), logicalExpression); 322return _factory.Sequence(ImmutableArray<LocalSymbol>.Empty, outerEffects.ToImmutableAndFree(), 330return _factory.Sequence(ImmutableArray<LocalSymbol>.Empty, outerEffects.ToImmutableAndFree(), 339_factory.Sequence(ImmutableArray<LocalSymbol>.Empty, outerEffects.ToImmutableAndFree(), 353private void MakeNullableParts(BoundExpression expr, ArrayBuilder<LocalSymbol> temps, ArrayBuilder<BoundExpression> innerEffects, 416private BoundLocal MakeTemp(BoundExpression loweredExpression, ArrayBuilder<LocalSymbol> temps, ArrayBuilder<BoundExpression> effects) 429ArrayBuilder<LocalSymbol> temps, 486ArrayBuilder<LocalSymbol> temps, BinaryOperatorKind operatorKind)
Lowering\LocalRewriter\LocalRewriter_UnaryOperator.cs (8)
236locals: ImmutableArray.Create<LocalSymbol>(boundTemp.LocalSymbol), 431ArrayBuilder<LocalSymbol> tempSymbols = ArrayBuilder<LocalSymbol>.GetInstance(); 443LocalSymbol tempSymbol = _factory.SynthesizedLocal(operandType); 505ArrayBuilder<LocalSymbol> tempSymbols, 533ArrayBuilder<LocalSymbol> tempSymbols, 549ImmutableArray<LocalSymbol>.Empty, 712locals: ImmutableArray.Create<LocalSymbol>(boundTemp.LocalSymbol),
Lowering\LocalRewriter\LocalRewriter_UsingStatement.cs (6)
64ImmutableArray<LocalSymbol> locals, 92BoundBlock body = new BoundBlock(syntax, ImmutableArray<LocalSymbol>.Empty, statements); 96ImmutableArray<LocalSymbol>.Empty, 217LocalSymbol localSymbol = localDeclaration.LocalSymbol; 258locals: ImmutableArray.Create<LocalSymbol>(boundTemp.LocalSymbol), //localSymbol will be declared by an enclosing block 511ArrayBuilder<LocalSymbol>? temps = null;
Lowering\LocalRewriter\LocalRewriter_WhileStatement.cs (1)
108ImmutableArray<LocalSymbol> locals,
Lowering\LocalRewriter\LoweredDynamicOperation.cs (3)
25private readonly ImmutableArray<LocalSymbol> _temps; 29public LoweredDynamicOperation(SyntheticBoundNodeFactory? factory, BoundExpression? siteInitialization, BoundExpression siteInvocation, TypeSymbol resultType, ImmutableArray<LocalSymbol> temps) 56return new LoweredDynamicOperation(null, null, bad, resultType, default(ImmutableArray<LocalSymbol>));
Lowering\LocalRewriter\LoweredDynamicOperationFactory.cs (5)
640ImmutableArray<LocalSymbol> temps = MakeTempsForDiscardArguments(ref loweredArguments); 670private ImmutableArray<LocalSymbol> MakeTempsForDiscardArguments(ref ImmutableArray<BoundExpression> loweredArguments) 676return ImmutableArray<LocalSymbol>.Empty; 679ArrayBuilder<LocalSymbol> temporariesBuilder = ArrayBuilder<LocalSymbol>.GetInstance(discardCount);
Lowering\MethodToClassRewriter.cs (15)
33protected readonly Dictionary<LocalSymbol, LocalSymbol> localMap = new Dictionary<LocalSymbol, LocalSymbol>(); 80protected void RewriteLocals(ImmutableArray<LocalSymbol> locals, ArrayBuilder<LocalSymbol> newLocals) 82foreach (var local in locals) 84if (TryRewriteLocal(local, out LocalSymbol? newLocal)) 91protected bool TryRewriteLocal(LocalSymbol local, [NotNullWhen(true)] out LocalSymbol? newLocal) 119private ImmutableArray<LocalSymbol> RewriteLocals(ImmutableArray<LocalSymbol> locals) 122var newLocals = ArrayBuilder<LocalSymbol>.GetInstance(); 447if (this.localMap.TryGetValue(node.LocalSymbol, out LocalSymbol? replacementLocal)) 536ImmutableArray.Create<LocalSymbol>(tempLocal.LocalSymbol),
Lowering\SpillSequenceSpiller.cs (37)
22private readonly PooledDictionary<LocalSymbol, LocalSymbol> _tempSubstitution; 23private readonly PooledDictionary<LocalSymbol, BoundComplexConditionalReceiver> _receiverSubstitution; 27PooledDictionary<LocalSymbol, LocalSymbol> tempSubstitution, 28PooledDictionary<LocalSymbol, BoundComplexConditionalReceiver> receiverSubstitution, 41private ArrayBuilder<LocalSymbol> _locals; 67public ImmutableArray<LocalSymbol> GetLocals() 69return (_locals == null) ? ImmutableArray<LocalSymbol>.Empty : _locals.ToImmutable(); 122public void AddLocal(LocalSymbol local) 126_locals = ArrayBuilder<LocalSymbol>.GetInstance(); 132public void AddLocals(ImmutableArray<LocalSymbol> locals) 134foreach (var local in locals) 183private readonly PooledDictionary<LocalSymbol, LocalSymbol> _tempSubstitution; 184private readonly PooledDictionary<LocalSymbol, BoundComplexConditionalReceiver> _receiverSubstitution; 187PooledDictionary<LocalSymbol, LocalSymbol> tempSubstitution, 188PooledDictionary<LocalSymbol, BoundComplexConditionalReceiver> receiverSubstitution, 197PooledDictionary<LocalSymbol, LocalSymbol> tempSubstitution, 198PooledDictionary<LocalSymbol, BoundComplexConditionalReceiver> receiverSubstitution, 214LocalSymbol longLived; 234var tempSubstitution = PooledDictionary<LocalSymbol, LocalSymbol>.GetInstance(); 235var receiverSubstitution = PooledDictionary<LocalSymbol, BoundComplexConditionalReceiver>.GetInstance(); 357out LocalSymbol receiverRefLocal, 530out LocalSymbol outReceiverRefLocal, 996var tmp = _F.SynthesizedLocal(node.Type, kind: SynthesizedLocalKind.Spill, syntax: _F.Syntax); 1135var tmp = _F.SynthesizedLocal(node.Type, kind: SynthesizedLocalKind.Spill, syntax: _F.Syntax); 1150var tmp = _F.SynthesizedLocal(condition.Type, kind: SynthesizedLocalKind.Spill, syntax: _F.Syntax); 1250var tmp = _F.SynthesizedLocal(node.Type, kind: SynthesizedLocalKind.Spill, syntax: _F.Syntax); 1306var clone = _F.SynthesizedLocal(receiver.Type, _F.Syntax, refKind: RefKind.None, kind: SynthesizedLocalKind.Spill); 1336var tmp = _F.SynthesizedLocal(node.Type, kind: SynthesizedLocalKind.Spill, syntax: _F.Syntax); 1487private void PromoteAndAddLocals(BoundSpillSequenceBuilder builder, ImmutableArray<LocalSymbol> locals) 1489foreach (var local in locals) 1497LocalSymbol longLived = local.WithSynthesizedLocalKindAndSyntax(SynthesizedLocalKind.Spill, _F.Syntax);
Lowering\StateMachineRewriter\IteratorAndAsyncCaptureWalker.cs (12)
40private readonly Dictionary<LocalSymbol, BoundExpression> _boundRefLocalInitializers = new Dictionary<LocalSymbol, BoundExpression>(); 80if (variable is LocalSymbol local) 143LocalSymbol { IsConst: false, IsPinned: false, IsRef: false } local => 162if (!((LocalSymbol)symbol).IsConst) 211var type = (variable.Kind == SymbolKind.Local) ? ((LocalSymbol)variable).Type : ((ParameterSymbol)variable).Type; 213(variable is LocalSymbol { RefKind: not RefKind.None } refLocal && !canRefLocalBeHoisted(refLocal))) 219if (_variablesToHoist.Add(variable) && variable is LocalSymbol local && _boundRefLocalInitializers.TryGetValue(local, out var variableInitializer)) 223static bool canRefLocalBeHoisted(LocalSymbol refLocal) 341if (node is { IsRef: true, Left: BoundLocal { LocalSymbol: LocalSymbol { IsCompilerGenerated: true } local } }) 373private void AddVariables(ImmutableArray<LocalSymbol> locals) 375foreach (var local in locals)
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (14)
36protected readonly LocalSymbol cachedState; 50protected readonly LocalSymbol? cachedThis; 282foreach (var local in node.Locals) 297private BoundStatement PossibleIteratorScope(ImmutableArray<LocalSymbol> locals, Func<BoundStatement> wrapped) 305foreach (var local in locals) 348foreach (var local in locals) 462private StateMachineFieldSymbol GetOrAllocateReusableHoistedField(TypeSymbol type, out bool reused, LocalSymbol? local = null) 558var sacrificialTemp = F.SynthesizedLocal(type, refKind: RefKind.Ref); 571return F.Sequence(ImmutableArray<LocalSymbol>.Empty, sideEffects.ToImmutableAndFree(), last); 750var newLocalsBuilder = ArrayBuilder<LocalSymbol>.GetInstance(); 753foreach (var local in node.Locals) 760LocalSymbol localToUse; 793ImmutableArray<LocalSymbol> newLocals; 834var leftLocal = ((BoundLocal)node.Left).LocalSymbol;
Lowering\StateMachineRewriter\StateMachineRewriter.cs (8)
81protected abstract void InitializeStateMachine(ArrayBuilder<BoundStatement> bodyBuilder, NamedTypeSymbol frameType, LocalSymbol stateMachineLocal); 86protected abstract BoundStatement GenerateStateMachineCreation(LocalSymbol stateMachineVariable, NamedTypeSymbol frameType, IReadOnlyDictionary<Symbol, CapturedSymbolReplacement> proxies); 157var local = (LocalSymbol)variable; 271private bool ShouldPreallocateNonReusableProxy(LocalSymbol local) 293LocalSymbol stateMachineVariable = F.SynthesizedLocal(frameType, null); 306protected BoundStatement GenerateParameterStorage(LocalSymbol stateMachineVariable, IReadOnlyDictionary<Symbol, CapturedSymbolReplacement> proxies) 427var resultVariable = F.SynthesizedLocal(stateMachineType, null);
Lowering\SyntheticBoundNodeFactory.cs (27)
220public BoundExpression This(LocalSymbol thisTempOpt) 450return Block(ImmutableArray<LocalSymbol>.Empty, 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) 502public BoundBlockInstrumentation CombineInstrumentation(BoundBlockInstrumentation? innerInstrumentation = null, LocalSymbol? local = null, BoundStatement? prologue = null, BoundStatement? epilogue = null) 581public LocalSymbol SynthesizedLocal( 603public LocalSymbol InterpolatedStringHandlerLocal( 916return If(condition, ImmutableArray<LocalSymbol>.Empty, thenClause, elseClauseOpt); 924public BoundStatement If(BoundExpression condition, ImmutableArray<LocalSymbol> locals, BoundStatement thenClause, BoundStatement? elseClauseOpt = null) 980public BoundLocal Local(LocalSymbol local) 985public BoundExpression MakeSequence(LocalSymbol temp, params BoundExpression[] parts) 987return MakeSequence(ImmutableArray.Create<LocalSymbol>(temp), parts); 992return MakeSequence(ImmutableArray<LocalSymbol>.Empty, parts); 995public BoundExpression MakeSequence(ImmutableArray<LocalSymbol> locals, params BoundExpression[] parts) 1021return new BoundSequence(Syntax, ImmutableArray<LocalSymbol>.Empty, sideEffects.AsImmutableOrNull(), result, resultType) { WasCompilerGenerated = true }; 1024public BoundExpression Sequence(ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundExpression> sideEffects, BoundExpression result) 1033public BoundSpillSequence SpillSequence(ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundStatement> sideEffects, BoundExpression result) 1322public BoundExpression LocalId(LocalSymbol symbol) 1591LocalSymbol local, 1602return new BoundCatchBlock(Syntax, ImmutableArray<LocalSymbol>.Empty, source, source.Type, exceptionFilterPrologueOpt: null, exceptionFilterOpt: null, body: block, isSynthesizedAsyncCatchAll: false); 1710internal BoundLocal MakeTempForDiscard(BoundDiscardExpression node, ArrayBuilder<LocalSymbol> temps) 1712LocalSymbol temp; 1718internal BoundLocal MakeTempForDiscard(BoundDiscardExpression node, out LocalSymbol temp) 1726internal ImmutableArray<BoundExpression> MakeTempsForDiscardArguments(ImmutableArray<BoundExpression> arguments, ArrayBuilder<LocalSymbol> builder) 1844locals: ImmutableArray<LocalSymbol>.Empty,
Operations\CSharpOperationFactory.cs (1)
1966var local = boundForEachStatement.IterationVariables[0];
Symbols\LocalDeclarationKind.cs (1)
18/// Check the value of <see cref="LocalSymbol.SynthesizedKind"/> for the kind of synthesized variable.
Symbols\LocalSymbol.cs (2)
41internal abstract LocalSymbol WithSynthesizedLocalKindAndSyntax( 361internal abstract ConstantValue GetConstantValue(SyntaxNode node, LocalSymbol inProgress, BindingDiagnosticBag diagnostics = null);
Symbols\PublicModel\LocalSymbol.cs (2)
14private readonly Symbols.LocalSymbol _underlying; 17public LocalSymbol(Symbols.LocalSymbol underlying)
Symbols\Source\SourceComplexParameterSymbol.cs (1)
346ImmutableArray<LocalSymbol>.Empty,
Symbols\Source\SourceLocalSymbol.cs (5)
155internal static LocalSymbol MakeLocalSymbolWithEnclosingContext( 232internal override LocalSymbol WithSynthesizedLocalKindAndSyntax( 470internal override ConstantValue GetConstantValue(SyntaxNode node, LocalSymbol inProgress, BindingDiagnosticBag diagnostics) 575private void MakeConstantTuple(LocalSymbol inProgress, BoundExpression boundInitValue) 593internal override ConstantValue GetConstantValue(SyntaxNode node, LocalSymbol inProgress, BindingDiagnosticBag diagnostics = null)
Symbols\Symbol.cs (1)
1716if (((LocalSymbol)variable).IsConst)
Symbols\SymbolExtensions.cs (6)
517LocalSymbol local = (LocalSymbol)symbol; 599internal static ILocalSymbol? GetPublicSymbol(this LocalSymbol? symbol) 724internal static ImmutableArray<ILocalSymbol> GetPublicSymbols(this ImmutableArray<LocalSymbol> symbols) 796internal static LocalSymbol? GetSymbol(this ILocalSymbol? symbol) 798return symbol.GetSymbol<LocalSymbol>();
Symbols\SymbolVisitor.cs (1)
65public virtual void VisitLocal(LocalSymbol symbol)
Symbols\SymbolVisitor`1.cs (1)
65public virtual TResult VisitLocal(LocalSymbol symbol)
Symbols\SymbolVisitor`2.cs (2)
245/// Called when visiting a <see cref="LocalSymbol" />; Override this with specific 251public virtual TResult VisitLocal(LocalSymbol symbol, TArgument argument)
Symbols\Synthesized\Records\SynthesizedRecordToString.cs (1)
59var builderLocalSymbol = F.SynthesizedLocal(stringBuilder);
Symbols\Synthesized\SynthesizedEntryPointSymbol.cs (5)
402locals: ImmutableArray<LocalSymbol>.Empty, 425locals: ImmutableArray<LocalSymbol>.Empty, 496locals: ImmutableArray<LocalSymbol>.Empty, 502ImmutableArray.Create<LocalSymbol>(scriptLocal.LocalSymbol), 619ImmutableArray.Create<LocalSymbol>(submissionLocal.LocalSymbol),
Symbols\Synthesized\SynthesizedLocal.cs (2)
73internal sealed override LocalSymbol WithSynthesizedLocalKindAndSyntax( 190internal sealed override ConstantValue GetConstantValue(SyntaxNode node, LocalSymbol inProgress, BindingDiagnosticBag diagnostics)
Symbols\Synthesized\TypeSubstitutedLocalSymbol.cs (4)
16private readonly LocalSymbol _originalVariable; 20public TypeSubstitutedLocalSymbol(LocalSymbol originalVariable, TypeWithAnnotations type, Symbol containingSymbol) 116internal override ConstantValue GetConstantValue(SyntaxNode node, LocalSymbol inProgress, BindingDiagnosticBag diagnostics) 126internal override LocalSymbol WithSynthesizedLocalKindAndSyntax(
Symbols\UpdatedContainingSymbolLocal.cs (3)
50if (!(other is LocalSymbol otherLocal)) 93internal override ConstantValue GetConstantValue(SyntaxNode node, LocalSymbol inProgress, BindingDiagnosticBag? diagnostics = null) => 101internal override LocalSymbol WithSynthesizedLocalKindAndSyntax(