protected override LocalDefinition DeclareLocalInternal( Microsoft.Cci.ITypeReference type, object identity, string name, bool isCompilerGenerated, LocalSlotConstraints constraints, bool isDynamic, ImmutableArray<TypedConstant> dynamicTransformFlags) { if (allLocals == null) { allLocals = ImmutableArray.CreateBuilder<LocalDefinition>(1); } var local = new LocalDefinition( identity: identity, name: name, type: type, slot: this.allLocals.Count, isCompilerGenerated: isCompilerGenerated, constraints: constraints, isDynamic: isDynamic, dynamicTransformFlags: dynamicTransformFlags); this.allLocals.Add(local); return local; }
/// <summary> /// Gets a local slot. /// </summary> internal LocalDefinition AllocateSlot( Cci.ITypeReference type, LocalSlotConstraints constraints, ImmutableArray <bool> dynamicTransformFlags = default, ImmutableArray <string> tupleElementNames = default ) { if ( !FreeSlots.TryPop(new LocalSignature(type, constraints), out LocalDefinition? local) ) { local = DeclareLocalImpl( type: type, symbol: null, name: null, kind: SynthesizedLocalKind.EmitterTemp, id: LocalDebugId.None, pdbAttributes: LocalVariableAttributes.DebuggerHidden, constraints: constraints, dynamicTransformFlags: dynamicTransformFlags, tupleElementNames: tupleElementNames ); } return(local); }
protected override LocalDefinition DeclareLocalInternal( Microsoft.Cci.ITypeReference type, object identity, string name, bool isCompilerGenerated, LocalSlotConstraints constraints, bool isDynamic, ImmutableArray <TypedConstant> dynamicTransformFlags) { if (allLocals == null) { allLocals = ImmutableArray.CreateBuilder <LocalDefinition>(1); } var local = new LocalDefinition( identity: identity, name: name, type: type, slot: this.allLocals.Count, isCompilerGenerated: isCompilerGenerated, constraints: constraints, isDynamic: isDynamic, dynamicTransformFlags: dynamicTransformFlags); this.allLocals.Add(local); return(local); }
public EncLocalInfo(LocalSlotDebugInfo slotInfo, Cci.ITypeReference type, LocalSlotConstraints constraints, byte[]? signature) { SlotInfo = slotInfo; Type = type; Constraints = constraints; Signature = signature; IsUnused = false; }
protected abstract LocalDefinition DeclareLocalInternal( ITypeReference type, object identity, string name, bool isCompilerGenerated, LocalSlotConstraints constraints, bool isDynamic, ImmutableArray <TypedConstant> dynamicTransformFlags);
public EncLocalInfo(int offset, ITypeReference type, LocalSlotConstraints constraints, int tempKind) { Debug.Assert(type != null); this.Offset = offset; this.Type = type; this.Constraints = constraints; this.TempKind = tempKind; }
public abstract LocalDefinition GetPreviousLocal( Cci.ITypeReference type, ILocalSymbol symbol, string nameOpt, CommonSynthesizedLocalKind synthesizedKind, uint pdbAttributes, LocalSlotConstraints constraints, bool isDynamic, ImmutableArray <TypedConstant> dynamicTransformFlags);
private LocalDefinition DeclareLocalImpl( Cci.ITypeReference type, ILocalSymbolInternal?symbol, string?name, SynthesizedLocalKind kind, LocalDebugId id, LocalVariableAttributes pdbAttributes, LocalSlotConstraints constraints, ImmutableArray <bool> dynamicTransformFlags, ImmutableArray <string> tupleElementNames ) { if (_lazyAllLocals == null) { _lazyAllLocals = new ArrayBuilder <Cci.ILocalDefinition>(1); } LocalDefinition?local; if (symbol != null && _slotAllocator != null) { local = _slotAllocator.GetPreviousLocal( type, symbol, name, kind, id, pdbAttributes, constraints, dynamicTransformFlags: dynamicTransformFlags, tupleElementNames: tupleElementNames ); if (local != null) { int slot = local.SlotIndex; _lazyAllLocals[slot] = local; return(local); } } local = new LocalDefinition( symbolOpt: symbol, nameOpt: name, type: type, slot: _lazyAllLocals.Count, synthesizedKind: kind, id: id, pdbAttributes: pdbAttributes, constraints: constraints, dynamicTransformFlags: dynamicTransformFlags, tupleElementNames: tupleElementNames ); _lazyAllLocals.Add(local); return(local); }
public abstract LocalDefinition GetPreviousLocal( Cci.ITypeReference type, ILocalSymbolInternal symbol, string nameOpt, SynthesizedLocalKind kind, LocalDebugId id, LocalVariableAttributes pdbAttributes, LocalSlotConstraints constraints, ImmutableArray <string> tupleElementNames);
public EncLocalInfo(byte[] signature) { Debug.Assert(signature.Length > 0); SlotInfo = new LocalSlotDebugInfo(SynthesizedLocalKind.EmitterTemp, LocalDebugId.None); Type = null; Constraints = LocalSlotConstraints.None; Signature = signature; IsUnused = true; }
public abstract LocalDefinition GetPreviousLocal( Cci.ITypeReference type, ILocalSymbolInternal symbol, string nameOpt, SynthesizedLocalKind kind, LocalDebugId id, LocalVariableAttributes pdbAttributes, LocalSlotConstraints constraints, bool isDynamic, ImmutableArray <TypedConstant> dynamicTransformFlags);
public EncLocalInfo(LocalSlotDebugInfo slotInfo, Cci.ITypeReference type, LocalSlotConstraints constraints, byte[] signature) { Debug.Assert(type != null); this.SlotInfo = slotInfo; this.Type = type; this.Constraints = constraints; this.Signature = signature; this.isUnused = false; }
public EncLocalInfo(int offset, ITypeReference type, LocalSlotConstraints constraints, CommonSynthesizedLocalKind synthesizedKind, byte[] signature) { Debug.Assert(type != null); this.Offset = offset; this.Type = type; this.Constraints = constraints; this.SynthesizedKind = synthesizedKind; this.Signature = signature; }
public abstract LocalDefinition GetPreviousLocal( Cci.ITypeReference type, ILocalSymbolInternal symbol, string nameOpt, SynthesizedLocalKind kind, LocalDebugId id, LocalVariableAttributes pdbAttributes, LocalSlotConstraints constraints, bool isDynamic, ImmutableArray<TypedConstant> dynamicTransformFlags);
public EncLocalInfo(byte[] signature) { Debug.Assert(signature != null); Debug.Assert(signature.Length > 0); this.SlotInfo = new LocalSlotDebugInfo(SynthesizedLocalKind.EmitterTemp, LocalDebugId.None); this.Type = null; this.Constraints = default(LocalSlotConstraints); this.Signature = signature; this.isUnused = true; }
public EncLocalInfo(byte[] signature) { Debug.Assert(signature != null); Debug.Assert(signature.Length > 0); this.Offset = -1; this.Type = null; this.Constraints = default(LocalSlotConstraints); this.SynthesizedKind = 0; this.Signature = signature; }
public override LocalDefinition GetPreviousLocal( Cci.ITypeReference currentType, ILocalSymbolInternal currentLocalSymbol, string nameOpt, SynthesizedLocalKind kind, LocalDebugId id, uint pdbAttributes, LocalSlotConstraints constraints, bool isDynamic, ImmutableArray <TypedConstant> dynamicTransformFlags) { if (id.IsNone) { return(null); } LocalDebugId previousId; if (!TryGetPreviousLocalId(currentLocalSymbol.GetDeclaratorSyntax(), id, out previousId)) { return(null); } var previousType = _symbolMap.MapReference(currentType); if (previousType == null) { return(null); } // TODO (bug #781309): Should report a warning if the type of the local has changed // and the previous value will be dropped. var localKey = new EncLocalInfo(new LocalSlotDebugInfo(kind, previousId), previousType, constraints, signature: null); int slot; if (!_previousLocalSlots.TryGetValue(localKey, out slot)) { return(null); } return(new LocalDefinition( currentLocalSymbol, nameOpt, currentType, slot, kind, id, pdbAttributes, constraints, isDynamic, dynamicTransformFlags)); }
public override LocalDefinition GetPreviousLocal( Cci.ITypeReference type, ILocalSymbol symbol, string nameOpt, CommonSynthesizedLocalKind synthesizedKind, uint pdbAttributes, LocalSlotConstraints constraints, bool isDynamic, ImmutableArray <TypedConstant> dynamicTransformFlags) { var syntaxRefs = symbol.DeclaringSyntaxReferences; Debug.Assert(!syntaxRefs.IsDefault); if (!syntaxRefs.IsDefaultOrEmpty) { var currentSyntax = syntaxRefs[0].GetSyntax(); var previousSyntax = syntaxMap(currentSyntax); if (previousSyntax != null) { int offset; if (previousDeclaratorToOffset.TryGetValue(previousSyntax, out offset)) { var previousType = symbolMap.MapReference(type); if (previousType != null) { var localKey = new EncLocalInfo(offset, previousType, constraints, synthesizedKind, signature: null); int slot; // Should report a warning if the type of the local has changed // and the previous value will be dropped. (Bug #781309.) if (previousLocalInfoToSlot.TryGetValue(localKey, out slot)) { return(new LocalDefinition( symbol, nameOpt, type, slot, synthesizedKind, pdbAttributes, constraints, isDynamic, dynamicTransformFlags)); } } } } } return(null); }
private LocalDefinition DeclareLocalImpl( Cci.ITypeReference type, ILocalSymbolInternal symbolOpt, string nameOpt, SynthesizedLocalKind kind, LocalDebugId id, uint pdbAttributes, LocalSlotConstraints constraints, bool isDynamic, ImmutableArray <TypedConstant> dynamicTransformFlags) { if (_lazyAllLocals == null) { _lazyAllLocals = new ArrayBuilder <Cci.ILocalDefinition>(1); } LocalDefinition local; if (symbolOpt != null && _slotAllocatorOpt != null) { local = _slotAllocatorOpt.GetPreviousLocal(type, symbolOpt, nameOpt, kind, id, pdbAttributes, constraints, isDynamic, dynamicTransformFlags); if (local != null) { int slot = local.SlotIndex; _lazyAllLocals[slot] = local; return(local); } } local = new LocalDefinition( symbolOpt: symbolOpt, nameOpt: nameOpt, type: type, slot: _lazyAllLocals.Count, synthesizedKind: kind, id: id, pdbAttributes: pdbAttributes, constraints: constraints, isDynamic: isDynamic, dynamicTransformFlags: dynamicTransformFlags); _lazyAllLocals.Add(local); return(local); }
protected override LocalDefinition DeclareLocalInternal( Microsoft.Cci.ITypeReference type, object identity, string name, bool isCompilerGenerated, LocalSlotConstraints constraints, bool isDynamic, ImmutableArray <TypedConstant> dynamicTransformFlags) { LocalDefinition local; if (identity != null) { int slot = this.getPreviousLocalSlot(identity, type, constraints); if (slot >= 0) { Debug.Assert(this.allLocals[slot].Identity == null); local = new LocalDefinition( identity: identity, name: name, type: type, slot: slot, isCompilerGenerated: isCompilerGenerated, constraints: constraints, isDynamic: isDynamic, dynamicTransformFlags: dynamicTransformFlags); this.allLocals[slot] = local; return(local); } } local = new LocalDefinition( identity: identity, name: name, type: type, slot: this.allLocals.Count, isCompilerGenerated: isCompilerGenerated, constraints: constraints, isDynamic: isDynamic, dynamicTransformFlags: dynamicTransformFlags); this.allLocals.Add(local); return(local); }
protected override LocalDefinition DeclareLocalInternal( Microsoft.Cci.ITypeReference type, object identity, string name, bool isCompilerGenerated, LocalSlotConstraints constraints, bool isDynamic, ImmutableArray<TypedConstant> dynamicTransformFlags) { LocalDefinition local; if (identity != null) { int slot = this.getPreviousLocalSlot(identity, type, constraints); if (slot >= 0) { Debug.Assert(this.allLocals[slot].Identity == null); local = new LocalDefinition( identity: identity, name: name, type: type, slot: slot, isCompilerGenerated: isCompilerGenerated, constraints: constraints, isDynamic: isDynamic, dynamicTransformFlags: dynamicTransformFlags); this.allLocals[slot] = local; return local; } } local = new LocalDefinition( identity: identity, name: name, type: type, slot: this.allLocals.Count, isCompilerGenerated: isCompilerGenerated, constraints: constraints, isDynamic: isDynamic, dynamicTransformFlags: dynamicTransformFlags); this.allLocals.Add(local); return local; }
internal LocalDefinition DeclareLocal( ITypeReference type, object identity, string name, bool isCompilerGenerated, LocalSlotConstraints constraints, bool isDynamic, ImmutableArray <TypedConstant> dynamicTransformFlags) { LocalDefinition local; if ((name != null) || !FreeSlots.TryPop(new LocalSignature(type, constraints), out local)) { local = this.DeclareLocalInternal(type, identity, name, isCompilerGenerated, constraints, isDynamic, dynamicTransformFlags); } LocalMap.Add(identity, local); return(local); }
/// <summary> /// Creates a new LocalDefinition. /// </summary> /// <param name="identity">Local symbol, used by edit and continue only, null otherwise.</param> /// <param name="name">Name associated with the slot.</param> /// <param name="type">Type associated with the slot.</param> /// <param name="slot">Slot position in the signature.</param> /// <param name="dynamicTransformFlags">Contains the synthesized dynamic attributes of the local</param> /// <param name="isCompilerGenerated">True if the local was not declared in source.</param> /// <param name="constraints">Specifies whether slot type should have pinned modifier and whether slot should have byref constraint.</param> /// <param name="isDynamic">Specifies if the type is Dynamic.</param> public LocalDefinition( object identity, string name, Microsoft.Cci.ITypeReference type, int slot, bool isCompilerGenerated, LocalSlotConstraints constraints, bool isDynamic, ImmutableArray<TypedConstant> dynamicTransformFlags) { this.identity = identity; this.name = name; this.type = type; this.slot = slot; this.isCompilerGenerated = isCompilerGenerated; this.dynamicTransformFlags = dynamicTransformFlags; this.constraints = constraints; this.isDynamic = isDynamic; }
/// <summary> /// Creates a new LocalDefinition. /// </summary> /// <param name="identity">Local symbol, used by edit and continue only, null otherwise.</param> /// <param name="name">Name associated with the slot.</param> /// <param name="type">Type associated with the slot.</param> /// <param name="slot">Slot position in the signature.</param> /// <param name="dynamicTransformFlags">Contains the synthesized dynamic attributes of the local</param> /// <param name="isCompilerGenerated">True if the local was not declared in source.</param> /// <param name="constraints">Specifies whether slot type should have pinned modifier and whether slot should have byref constraint.</param> /// <param name="isDynamic">Specifies if the type is Dynamic.</param> public LocalDefinition( object identity, string name, Cci.ITypeReference type, int slot, bool isCompilerGenerated, LocalSlotConstraints constraints, bool isDynamic, ImmutableArray <TypedConstant> dynamicTransformFlags) { this.identity = identity; this.name = name; this.type = type; this.slot = slot; this.isCompilerGenerated = isCompilerGenerated; this.dynamicTransformFlags = dynamicTransformFlags; this.constraints = constraints; this.isDynamic = isDynamic; }
/// <summary> /// Creates a new LocalDefinition. /// </summary> /// <param name="symbolOpt">Local symbol, used by edit and continue only, null otherwise.</param> /// <param name="nameOpt">Name associated with the slot.</param> /// <param name="type">Type associated with the slot.</param> /// <param name="slot">Slot position in the signature.</param> /// <param name="synthesizedKind">Local kind.</param> /// <param name="id">Local id.</param> /// <param name="pdbAttributes">Value to emit in the attributes field in the PDB.</param> /// <param name="constraints">Specifies whether slot type should have pinned modifier and whether slot should have byref constraint.</param> /// <param name="dynamicTransformFlags">The synthesized dynamic attributes of the local.</param> /// <param name="tupleElementNames">Tuple element names of the local.</param> public LocalDefinition( ILocalSymbol symbolOpt, string nameOpt, Cci.ITypeReference type, int slot, SynthesizedLocalKind synthesizedKind, LocalDebugId id, LocalVariableAttributes pdbAttributes, LocalSlotConstraints constraints, ImmutableArray <string> tupleElementNames) { _symbolOpt = symbolOpt; _nameOpt = nameOpt; _type = type; _slot = slot; _slotInfo = new LocalSlotDebugInfo(synthesizedKind, id); _pdbAttributes = pdbAttributes; _tupleElementNames = tupleElementNames.NullToEmpty(); _constraints = constraints; }
public override LocalDefinition GetPreviousLocal( Cci.ITypeReference type, ILocalSymbolInternal symbol, string nameOpt, SynthesizedLocalKind synthesizedKind, LocalDebugId id, uint pdbAttributes, LocalSlotConstraints constraints, bool isDynamic, ImmutableArray <TypedConstant> dynamicTransformFlags) { var local = symbol as EELocalSymbol; if ((object)local == null) { return(null); } return(_locals[local.Ordinal]); }
internal LocalDefinition DeclareLocal( Cci.ITypeReference type, ILocalSymbolInternal symbol, string name, SynthesizedLocalKind kind, LocalDebugId id, LocalVariableAttributes pdbAttributes, LocalSlotConstraints constraints, ImmutableArray <TypedConstant> dynamicTransformFlags, ImmutableArray <TypedConstant> tupleElementNames, bool isSlotReusable) { if (!isSlotReusable || !FreeSlots.TryPop(new LocalSignature(type, constraints), out LocalDefinition local)) { local = this.DeclareLocalImpl(type, symbol, name, kind, id, pdbAttributes, constraints, dynamicTransformFlags, tupleElementNames); } LocalMap.Add(symbol, local); return(local); }
internal LocalDefinition DeclareLocal( Cci.ITypeReference type, ILocalSymbol symbol, string name, CommonSynthesizedLocalKind synthesizedKind, uint pdbAttributes, LocalSlotConstraints constraints, bool isDynamic, ImmutableArray <TypedConstant> dynamicTransformFlags) { LocalDefinition local; if ((name != null) || !FreeSlots.TryPop(new LocalSignature(type, constraints), out local)) { local = this.DeclareLocalImpl(type, symbol, name, synthesizedKind, pdbAttributes, constraints, isDynamic, dynamicTransformFlags); } LocalMap.Add(symbol, local); return(local); }
/// <summary> /// Gets a local slot. /// </summary> internal LocalDefinition AllocateSlot( ITypeReference type, LocalSlotConstraints constraints, ImmutableArray <TypedConstant> dynamicTransformFlags = default(ImmutableArray <TypedConstant>)) { LocalDefinition local; if (!FreeSlots.TryPop(new LocalSignature(type, constraints), out local)) { local = this.DeclareLocalInternal( type: type, identity: null, name: null, isCompilerGenerated: true, constraints: constraints, isDynamic: false, dynamicTransformFlags: dynamicTransformFlags); } return(local); }
/// <summary> /// Creates a new LocalDefinition. /// </summary> /// <param name="symbolOpt">Local symbol, used by edit and continue only, null otherwise.</param> /// <param name="nameOpt">Name associated with the slot.</param> /// <param name="type">Type associated with the slot.</param> /// <param name="slot">Slot position in the signature.</param> /// <param name="dynamicTransformFlags">Contains the synthesized dynamic attributes of the local</param> /// <param name="synthesizedKind">Synthesized local kind.</param> /// <param name="pdbAttributes">Value to emit in the attributes field in the PDB.</param> /// <param name="constraints">Specifies whether slot type should have pinned modifier and whether slot should have byref constraint.</param> /// <param name="isDynamic">Specifies if the type is Dynamic.</param> public LocalDefinition( ILocalSymbol symbolOpt, string nameOpt, Cci.ITypeReference type, int slot, CommonSynthesizedLocalKind synthesizedKind, uint pdbAttributes, LocalSlotConstraints constraints, bool isDynamic, ImmutableArray <TypedConstant> dynamicTransformFlags) { this.symbolOpt = symbolOpt; this.nameOpt = nameOpt; this.type = type; this.slot = slot; this.synthesizedKind = synthesizedKind; this.pdbAttributes = pdbAttributes; this.dynamicTransformFlags = dynamicTransformFlags; this.constraints = constraints; this.isDynamic = isDynamic; }
/// <summary> /// Creates a new LocalDefinition. /// </summary> /// <param name="symbolOpt">Local symbol, used by edit and continue only, null otherwise.</param> /// <param name="nameOpt">Name associated with the slot.</param> /// <param name="type">Type associated with the slot.</param> /// <param name="slot">Slot position in the signature.</param> /// <param name="dynamicTransformFlags">Contains the synthesized dynamic attributes of the local</param> /// <param name="synthesizedKind">Local kind.</param> /// <param name="id">Local id.</param> /// <param name="pdbAttributes">Value to emit in the attributes field in the PDB.</param> /// <param name="constraints">Specifies whether slot type should have pinned modifier and whether slot should have byref constraint.</param> /// <param name="isDynamic">Specifies if the type is Dynamic.</param> public LocalDefinition( ILocalSymbol symbolOpt, string nameOpt, Cci.ITypeReference type, int slot, SynthesizedLocalKind synthesizedKind, LocalDebugId id, LocalVariableAttributes pdbAttributes, LocalSlotConstraints constraints, bool isDynamic, ImmutableArray <TypedConstant> dynamicTransformFlags) { _symbolOpt = symbolOpt; _nameOpt = nameOpt; _type = type; _slot = slot; _slotInfo = new LocalSlotDebugInfo(synthesizedKind, id); _pdbAttributes = pdbAttributes; _dynamicTransformFlags = dynamicTransformFlags; _constraints = constraints; _isDynamic = isDynamic; }
/// <summary> /// Gets a local slot. /// </summary> internal LocalDefinition AllocateSlot( Cci.ITypeReference type, LocalSlotConstraints constraints, ImmutableArray <TypedConstant> dynamicTransformFlags = default(ImmutableArray <TypedConstant>)) { LocalDefinition local; if (!FreeSlots.TryPop(new LocalSignature(type, constraints), out local)) { local = this.DeclareLocalImpl( type: type, symbolOpt: null, nameOpt: null, synthesizedKind: CommonSynthesizedLocalKind.EmitterTemp, pdbAttributes: Cci.PdbWriter.HiddenLocalAttributesValue, constraints: constraints, isDynamic: false, dynamicTransformFlags: dynamicTransformFlags); } return(local); }
/// <summary> /// Creates a new LocalDefinition. /// </summary> /// <param name="symbolOpt">Local symbol, used by edit and continue only, null otherwise.</param> /// <param name="nameOpt">Name associated with the slot.</param> /// <param name="type">Type associated with the slot.</param> /// <param name="slot">Slot position in the signature.</param> /// <param name="synthesizedKind">Local kind.</param> /// <param name="id">Local id.</param> /// <param name="pdbAttributes">Value to emit in the attributes field in the PDB.</param> /// <param name="constraints">Specifies whether slot type should have pinned modifier and whether slot should have byref constraint.</param> /// <param name="dynamicTransformFlags">The synthesized dynamic attributes of the local.</param> /// <param name="tupleElementNames">Tuple element names of the local.</param> public LocalDefinition( ILocalSymbol symbolOpt, string nameOpt, Cci.ITypeReference type, int slot, SynthesizedLocalKind synthesizedKind, LocalDebugId id, LocalVariableAttributes pdbAttributes, LocalSlotConstraints constraints, ImmutableArray<TypedConstant> dynamicTransformFlags, ImmutableArray<TypedConstant> tupleElementNames) { _symbolOpt = symbolOpt; _nameOpt = nameOpt; _type = type; _slot = slot; _slotInfo = new LocalSlotDebugInfo(synthesizedKind, id); _pdbAttributes = pdbAttributes; _dynamicTransformFlags = dynamicTransformFlags.NullToEmpty(); _tupleElementNames = tupleElementNames.NullToEmpty(); _constraints = constraints; }
/// <summary> /// Creates a new LocalDefinition. /// </summary> /// <param name="symbolOpt">Local symbol, used by edit and continue only, null otherwise.</param> /// <param name="nameOpt">Name associated with the slot.</param> /// <param name="type">Type associated with the slot.</param> /// <param name="slot">Slot position in the signature.</param> /// <param name="dynamicTransformFlags">Contains the synthesized dynamic attributes of the local</param> /// <param name="synthesizedKind">Local kind.</param> /// <param name="id">Local id.</param> /// <param name="pdbAttributes">Value to emit in the attributes field in the PDB.</param> /// <param name="constraints">Specifies whether slot type should have pinned modifier and whether slot should have byref constraint.</param> /// <param name="isDynamic">Specifies if the type is Dynamic.</param> public LocalDefinition( ILocalSymbol symbolOpt, string nameOpt, Cci.ITypeReference type, int slot, SynthesizedLocalKind synthesizedKind, LocalDebugId id, uint pdbAttributes, LocalSlotConstraints constraints, bool isDynamic, ImmutableArray<TypedConstant> dynamicTransformFlags) { _symbolOpt = symbolOpt; _nameOpt = nameOpt; _type = type; _slot = slot; _slotInfo = new LocalSlotDebugInfo(synthesizedKind, id); _pdbAttributes = pdbAttributes; _dynamicTransformFlags = dynamicTransformFlags; _constraints = constraints; _isDynamic = isDynamic; }
internal LocalSignature(ITypeReference valType, LocalSlotConstraints constraints) { this.Constraints = constraints; this.Type = valType; }
/// <summary> /// Allocates a temp without identity. /// </summary> private LocalDefinition AllocateTemp(TypeSymbol type, SyntaxNode syntaxNode, LocalSlotConstraints slotConstraints = LocalSlotConstraints.None) { return _builder.LocalSlotManager.AllocateSlot( _module.Translate(type, syntaxNode, _diagnostics), slotConstraints); }
internal LocalSignature(Cci.ITypeReference valType, LocalSlotConstraints constraints) { _constraints = constraints; _type = valType; }
public override LocalDefinition GetPreviousLocal( Cci.ITypeReference currentType, ILocalSymbolInternal currentLocalSymbol, string nameOpt, SynthesizedLocalKind kind, LocalDebugId id, uint pdbAttributes, LocalSlotConstraints constraints, bool isDynamic, ImmutableArray<TypedConstant> dynamicTransformFlags) { if (id.IsNone) { return null; } LocalDebugId previousId; if (!TryGetPreviousLocalId(currentLocalSymbol.GetDeclaratorSyntax(), id, out previousId)) { return null; } var previousType = _symbolMap.MapReference(currentType); if (previousType == null) { return null; } // TODO (bug #781309): Should report a warning if the type of the local has changed // and the previous value will be dropped. var localKey = new EncLocalInfo(new LocalSlotDebugInfo(kind, previousId), previousType, constraints, signature: null); int slot; if (!_previousLocalSlots.TryGetValue(localKey, out slot)) { return null; } return new LocalDefinition( currentLocalSymbol, nameOpt, currentType, slot, kind, id, pdbAttributes, constraints, isDynamic, dynamicTransformFlags); }
public override LocalDefinition GetPreviousLocal( Cci.ITypeReference type, ILocalSymbolInternal symbol, string nameOpt, SynthesizedLocalKind synthesizedKind, LocalDebugId id, uint pdbAttributes, LocalSlotConstraints constraints, bool isDynamic, ImmutableArray<TypedConstant> dynamicTransformFlags) { var local = symbol as EELocalSymbol; if ((object)local == null) { return null; } return _locals[local.Ordinal]; }