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) 270var receiverTemp = EmitAddress(expression.ReferenceTypeReceiver, addressKind, used: true); 287private LocalDefinition EmitLocalAddress(BoundLocal localAccess, AddressKind addressKind, bool used) 321private LocalDefinition EmitDupAddress(BoundDup dup, AddressKind addressKind, bool used) 363private LocalDefinition EmitAddressOfTempClone(BoundExpression expression, bool used) 369var value = this.AllocateTemp(expression.Type, expression.Syntax); 382private LocalDefinition EmitSequenceAddress(BoundSequence sequence, AddressKind addressKind, bool used) 386var result = EmitAddress(sequence.Value, addressKind, used); 489private LocalDefinition EmitFieldAddress(BoundFieldAccess fieldAccess, AddressKind addressKind, bool used) 523private LocalDefinition EmitParameterAddress(BoundParameter parameter, AddressKind addressKind, bool used) 559private LocalDefinition EmitReceiverRef(BoundExpression receiver, AddressKind addressKind, bool used) 600private LocalDefinition EmitInstanceFieldAddress(BoundFieldAccess fieldAccess, AddressKind addressKind, bool used) 632var tempOpt = EmitReceiverRef(
CodeGen\EmitExpression.cs (28)
418LocalDefinition receiverTemp = null; 440LocalDefinition cloneTemp = null; 684var temp = EmitAddress(expression.Operand, AddressKind.Writeable, used: true); 733var temp = EmitAddress(argument, getArgumentAddressKind(refKind), used: true); 768var temp = EmitAddress(expression.Operand, AddressKind.ReadOnlyStrict, used); 948var seqLocal = DefineLocal(local, sequence.Syntax); 1257var temp = EmitFieldLoadReceiver(receiver); 1274private LocalDefinition EmitFieldLoadReceiver(BoundExpression receiver) 1479LocalDefinition definition = GetLocal(local); 1739LocalDefinition tempOpt = EmitReceiverRef(receiver, AddressKind.Writeable, used: true); 1788LocalDefinition tempOpt; 2025void emitReceiver(BoundCall call, CallKind callKind, AddressKind? addressKind, bool box, out LocalDefinition tempOpt) 2137void emitGenericReceiverCloneIfNecessary(BoundCall call, CallKind callKind, ref LocalDefinition tempOpt) 2699LocalDefinition temp = EmitAssignmentDuplication(assignmentOperator, useKind, lhsUsesStack); 2815var temp = EmitAddress(target, AddressKind.Writeable, used: true); 2844var temp = EmitAddress(target, AddressKind.Writeable, used: true); 2938var temp = EmitReceiverRef(left.ReceiverOpt, AddressKind.Writeable, used: true); 2984LocalDefinition localDefinition = GetLocal(left); 3022var temp = EmitAddress(left, AddressKind.Writeable, used: true); 3038var temp = EmitAddress(left, AddressKind.Writeable, used: true); 3050var temp = EmitAddress(left, AddressKind.Writeable, used: true); 3172LocalDefinition temp = EmitAddress(right, RefAssignmentValueAddressKind(refKind), used); 3185private LocalDefinition EmitAssignmentDuplication(BoundAssignmentOperator assignmentOperator, UseKind useKind, bool lhsUsesStack) 3187LocalDefinition temp = null; 3335private void EmitAssignmentPostfix(BoundAssignmentOperator assignment, LocalDefinition temp, UseKind useKind) 3667var temp = this.AllocateTemp(type, syntaxNode); 4168var temp = AllocateTemp(to, syntax); 4185LocalDefinition 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)