2 instantiations of LocalDefinition
Microsoft.CodeAnalysis (2)
CodeGen\LocalSlotManager.cs (1)
234local = new LocalDefinition(
Emit\EditAndContinue\EncVariableSlotAllocator.cs (1)
179return new LocalDefinition(
106 references to LocalDefinition
Microsoft.CodeAnalysis (40)
CodeGen\ILBuilder.cs (2)
1169internal bool PossiblyDefinedOutsideOfTry(LocalDefinition local) 1203internal void AddLocalToScope(LocalDefinition local)
CodeGen\ILBuilderEmit.cs (4)
227LocalDefinition? keyHash, 438internal void EmitLocalLoad(LocalDefinition local) 463internal void EmitLocalStore(LocalDefinition local) 487internal void EmitLocalAddress(LocalDefinition local)
CodeGen\LocalOrParameter.cs (3)
12public readonly LocalDefinition? Local; 15private LocalOrParameter(LocalDefinition? local, int parameterIndex) 21public static implicit operator LocalOrParameter(LocalDefinition? local)
CodeGen\LocalScopeManager.cs (7)
105internal void AddLocal(LocalDefinition variable) 174internal bool PossiblyDefinedOutsideOfTry(LocalDefinition local) 305internal virtual bool ContainsLocal(LocalDefinition local) => false; 314private ImmutableArray<LocalDefinition>.Builder _localVariables; 339internal void AddLocal(LocalDefinition variable) 343_localVariables = ImmutableArray.CreateBuilder<LocalDefinition>(1); 374internal override bool ContainsLocal(LocalDefinition local)
CodeGen\LocalSlotManager.cs (20)
64private Dictionary<ILocalSymbolInternal, LocalDefinition>? _localMap; 67private KeyedStack<LocalSignature, LocalDefinition>? _freeSlots; 70private HashSet<LocalDefinition>? _nonReusableLocals; 73private ArrayBuilder<LocalDefinition>? _addressedLocals; 96private Dictionary<ILocalSymbolInternal, LocalDefinition> LocalMap 103map = new Dictionary<ILocalSymbolInternal, LocalDefinition>(ReferenceEqualityComparer.Instance); 111private KeyedStack<LocalSignature, LocalDefinition> FreeSlots 118slots = new KeyedStack<LocalSignature, LocalDefinition>(); 126internal LocalDefinition DeclareLocal( 138LocalDefinition? local; 152internal LocalDefinition GetLocal(ILocalSymbolInternal symbol) 163var slot = GetLocal(symbol); 172internal LocalDefinition AllocateSlot( 178if (!FreeSlots.TryPop(new LocalSignature(type, constraints), out LocalDefinition? local)) 195private LocalDefinition DeclareLocalImpl( 211LocalDefinition? local; 253internal void FreeSlot(LocalDefinition slot) 266_addressedLocals ??= ArrayBuilder<LocalDefinition>.GetInstance(); 271internal void AddAddressedLocal(LocalDefinition localDef, OptimizationLevel optimizations) 287_nonReusableLocals ??= new HashSet<LocalDefinition>(ReferenceEqualityComparer.Instance);
CodeGen\SwitchStringJumpTableEmitter.cs (2)
69private readonly LocalDefinition? _keyHash; 77LocalDefinition? keyHash,
CodeGen\VariableSlotAllocator.cs (1)
18public abstract LocalDefinition? GetPreviousLocal(
Emit\EditAndContinue\EncVariableSlotAllocator.cs (1)
143public override LocalDefinition? GetPreviousLocal(
Microsoft.CodeAnalysis.CSharp (66)
CodeGen\CodeGenerator.cs (8)
41private ArrayBuilder<LocalDefinition> _expressionTemps; 77private LocalDefinition _returnTemp; 164private LocalDefinition LazyReturnTemp 168var result = _returnTemp; 526private void AddExpressionTemp(LocalDefinition temp) 534ArrayBuilder<LocalDefinition> exprTemps = _expressionTemps; 537exprTemps = ArrayBuilder<LocalDefinition>.GetInstance(); 552var temp = _expressionTemps[i];
CodeGen\EmitAddress.cs (15)
24private LocalDefinition EmitAddress(BoundExpression expression, AddressKind addressKind, bool used) 145var temp = this.AllocateTemp(type, expression.Syntax); 202private LocalDefinition EmitPassByCopyAddress(BoundPassByCopy passByCopyExpr, AddressKind addressKind, bool used) 271var receiverTemp = EmitAddress(expression.ReferenceTypeReceiver, addressKind, used: true); 288private LocalDefinition EmitLocalAddress(BoundLocal localAccess, AddressKind addressKind, bool used) 322private LocalDefinition EmitDupAddress(BoundDup dup, AddressKind addressKind, bool used) 364private LocalDefinition EmitAddressOfTempClone(BoundExpression expression, bool used) 371var value = this.AllocateTemp(expression.Type, expression.Syntax); 384private LocalDefinition EmitSequenceAddress(BoundSequence sequence, AddressKind addressKind, bool used) 388var result = EmitAddress(sequence.Value, addressKind, used); 491private LocalDefinition EmitFieldAddress(BoundFieldAccess fieldAccess, AddressKind addressKind, bool used) 525private LocalDefinition EmitParameterAddress(BoundParameter parameter, AddressKind addressKind, bool used) 561private LocalDefinition EmitReceiverRef(BoundExpression receiver, AddressKind addressKind, bool used) 602private LocalDefinition EmitInstanceFieldAddress(BoundFieldAccess fieldAccess, AddressKind addressKind, bool used) 625var tempOpt = EmitReceiverRef(
CodeGen\EmitExpression.cs (28)
421LocalDefinition receiverTemp = null; 443LocalDefinition cloneTemp = null; 687var temp = EmitAddress(expression.Operand, AddressKind.Writeable, used: true); 736var temp = EmitAddress(argument, getArgumentAddressKind(refKind), used: true); 771var temp = EmitAddress(expression.Operand, AddressKind.ReadOnlyStrict, used); 940var seqLocal = DefineLocal(local, sequence.Syntax); 1248var temp = EmitFieldLoadReceiver(receiver); 1265private LocalDefinition EmitFieldLoadReceiver(BoundExpression receiver) 1470LocalDefinition definition = GetLocal(local); 1730LocalDefinition tempOpt = EmitReceiverRef(receiver, AddressKind.Writeable, used: true); 1779LocalDefinition tempOpt; 2016void emitReceiver(BoundCall call, CallKind callKind, AddressKind? addressKind, bool box, out LocalDefinition tempOpt) 2128void emitGenericReceiverCloneIfNecessary(BoundCall call, CallKind callKind, ref LocalDefinition tempOpt) 2687LocalDefinition temp = EmitAssignmentDuplication(assignmentOperator, useKind, lhsUsesStack); 2803var temp = EmitAddress(target, AddressKind.Writeable, used: true); 2832var temp = EmitAddress(target, AddressKind.Writeable, used: true); 2926var temp = EmitReceiverRef(left.ReceiverOpt, AddressKind.Writeable, used: true); 2972LocalDefinition localDefinition = GetLocal(left); 3010var temp = EmitAddress(left, AddressKind.Writeable, used: true); 3026var temp = EmitAddress(left, AddressKind.Writeable, used: true); 3038var temp = EmitAddress(left, AddressKind.Writeable, used: true); 3160LocalDefinition temp = EmitAddress(right, RefAssignmentValueAddressKind(refKind), used); 3173private LocalDefinition EmitAssignmentDuplication(BoundAssignmentOperator assignmentOperator, UseKind useKind, bool lhsUsesStack) 3175LocalDefinition temp = null; 3323private void EmitAssignmentPostfix(BoundAssignmentOperator assignment, LocalDefinition temp, UseKind useKind) 3655var temp = this.AllocateTemp(type, syntaxNode); 4156var temp = AllocateTemp(to, syntax); 4173LocalDefinition temp = null;
CodeGen\EmitStackAllocInitializer.cs (1)
89var temp = AllocateTemp(readOnlySpan, syntaxNode);
CodeGen\EmitStatement.cs (14)
883var unexpectedTemp = this.EmitAddress(expressionOpt, this._method.RefKind == RefKind.RefReadOnly ? AddressKind.ReadOnlyStrict : AddressKind.Writeable, used: true); 1192var temp = AllocateTemp(exceptionSource.Type, exceptionSource.Syntax); 1195var receiverTemp = EmitReceiverRef(left.ReceiverOpt, AddressKind.Writeable, used: true); 1287LocalDefinition temp = null; 1421var stringLength = AllocateTemp(int32Type, syntaxNode); 1449var charTemp = AllocateTemp(charType, syntaxNode); 1523LocalDefinition keyHash = null; 1779private LocalDefinition GetLocal(BoundLocal localExpression) 1785private LocalDefinition GetLocal(LocalSymbol symbol) 1790private LocalDefinition DefineLocal(LocalSymbol local, SyntaxNode syntaxNode) 1850var localDef = _builder.LocalSlotManager.DeclareLocal( 1934private LocalDefinition AllocateTemp(TypeSymbol type, SyntaxNode syntaxNode, LocalSlotConstraints slotConstraints = LocalSlotConstraints.None) 1944private void FreeTemp(LocalDefinition temp) 1952private void FreeOptTemp(LocalDefinition temp)