CodeGen\PrivateImplementationDetails.cs (31)
49private readonly Cci.ITypeReference _systemObject; //base type
50private readonly Cci.ITypeReference _systemValueType; //base for nested structs
52private readonly Cci.ITypeReference _systemInt8Type; //for metadata init of byte arrays
53private readonly Cci.ITypeReference _systemInt16Type; //for metadata init of short arrays
54private readonly Cci.ITypeReference _systemInt32Type; //for metadata init of int arrays
55private readonly Cci.ITypeReference _systemInt64Type; //for metadata init of long arrays
94private ImmutableArray<Cci.ITypeReference> _orderedProxyTypes;
95private readonly ConcurrentDictionary<(uint Size, ushort Alignment), Cci.ITypeReference> _proxyTypes = new ConcurrentDictionary<(uint Size, ushort Alignment), Cci.ITypeReference>();
101Cci.ITypeReference systemObject,
102Cci.ITypeReference systemValueType,
103Cci.ITypeReference systemInt8Type,
104Cci.ITypeReference systemInt16Type,
105Cci.ITypeReference systemInt32Type,
106Cci.ITypeReference systemInt64Type,
255Cci.ITypeReference type = _proxyTypes.GetOrAdd(
299internal Cci.IFieldReference GetModuleVersionId(Cci.ITypeReference mvidType)
311internal Cci.IFieldReference GetModuleCancellationToken(Cci.ITypeReference cancellationTokenType)
323internal Cci.IFieldReference GetOrAddInstrumentationPayloadRoot(int analysisKind, Cci.ITypeReference payloadRootType)
419public override Cci.ITypeReference GetBaseClass(EmitContext context) => _systemObject;
570private readonly Cci.ITypeReference _sysValueType;
572internal ExplicitSizeStruct(uint size, ushort alignment, PrivateImplementationDetails containingType, Cci.ITypeReference sysValueType)
587public override Cci.ITypeReference GetBaseClass(EmitContext context) => _sysValueType;
608public Cci.ITypeReference GetContainingType(EmitContext context) => _containingType;
618private readonly Cci.ITypeReference _type;
621internal SynthesizedStaticField(string name, Cci.INamedTypeDefinition containingType, Cci.ITypeReference type)
667public Cci.ITypeReference GetContainingType(EmitContext context) => _containingType;
688public Cci.ITypeReference GetType(EmitContext context) => _type;
694internal Cci.ITypeReference Type => _type;
720internal ModuleVersionIdField(Cci.INamedTypeDefinition containingType, Cci.ITypeReference type)
732internal sealed class ModuleCancellationTokenField(Cci.INamedTypeDefinition containingType, Cci.ITypeReference type)
Emit\CommonPEModuleBuilder.cs (12)
105internal abstract Cci.ITypeReference Translate(ITypeSymbolInternal symbol, SyntaxNode syntaxOpt, DiagnosticBag diagnostics);
114internal abstract Cci.ITypeReference EncTranslateType(ITypeSymbolInternal type, DiagnosticBag diagnostics);
158public abstract Cci.ITypeReference GetPlatformType(Cci.PlatformType platformType, EmitContext context);
159public abstract bool IsPlatformType(Cci.ITypeReference typeRef, Cci.PlatformType platformType);
616internal sealed override Cci.ITypeReference EncTranslateType(ITypeSymbolInternal type, DiagnosticBag diagnostics)
621internal virtual Cci.ITypeReference EncTranslateLocalVariableType(TTypeSymbol type, DiagnosticBag diagnostics)
705internal abstract Cci.ITypeReference Translate(TTypeSymbol symbol, TSyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics);
713internal sealed override Cci.ITypeReference Translate(ITypeSymbolInternal symbol, SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics)
742internal Cci.IFieldReference GetModuleVersionId(Cci.ITypeReference mvidType, TSyntaxNode syntaxOpt, DiagnosticBag diagnostics)
750internal Cci.IFieldReference GetModuleCancellationToken(Cci.ITypeReference cancellationTokenType, TSyntaxNode syntaxOpt, DiagnosticBag diagnostics)
753internal Cci.IFieldReference GetInstrumentationPayloadRoot(int analysisKind, Cci.ITypeReference payloadType, TSyntaxNode syntaxOpt, DiagnosticBag diagnostics)
1089public sealed override Cci.ITypeReference GetPlatformType(Cci.PlatformType platformType, EmitContext context)
PEWriter\MetadataWriter.cs (44)
351protected abstract bool TryGetTypeReferenceHandle(ITypeReference reference, out TypeReferenceHandle handle);
358protected abstract TypeReferenceHandle GetOrAddTypeReferenceHandle(ITypeReference reference);
364protected abstract IReadOnlyList<ITypeReference> GetTypeRefs();
371protected abstract TypeSpecificationHandle GetOrAddTypeSpecificationHandle(ITypeReference reference);
377protected abstract IReadOnlyList<ITypeReference> GetTypeSpecs();
440private readonly Dictionary<ITypeReference, BlobHandle> _typeSpecSignatureIndex = new Dictionary<ITypeReference, BlobHandle>(ReferenceEqualityComparer.Instance);
638public static IUnitReference GetDefiningUnitReference(ITypeReference typeReference, EmitContext context)
954var containingType = memberRef.GetContainingType(Context);
1051foreach (ITypeReference typeReference in methodInstanceReference.GetGenericArguments(Context))
1053var typeRef = typeReference;
1591private TypeReferenceHandle GetTypeReferenceHandle(ITypeReference typeReference)
1614private TypeSpecificationHandle GetTypeSpecificationHandle(ITypeReference typeReference)
1639internal BlobHandle GetTypeSpecSignatureIndex(ITypeReference typeReference)
1656internal EntityHandle GetTypeHandle(ITypeReference typeReference, bool treatRefAsPotentialTypeSpec = true)
2775ITypeReference baseType = typeDef.GetBaseClass(Context);
2824foreach (ITypeReference typeRef in typeRefs)
2833ITypeReference scopeTypeRef;
2884foreach (ITypeReference typeSpec in typeSpecs)
3106ITypeReference typeReference => GetTypeHandle(typeReference),
3374var exceptionType = region.ExceptionType;
3408var type = parameterTypeInformation.GetType(Context);
3437foreach (ITypeReference genericArgument in genericMethodInstanceReference.GetGenericArguments(Context))
3439ITypeReference typeRef = genericArgument;
3494private void SerializeNamedArgumentType(in EmitContext context, NamedArgumentTypeEncoder encoder, ITypeReference type)
3510private void SerializeMetadataExpression(in EmitContext context, LiteralEncoder encoder, IMetadataExpression expression, ITypeReference targetType)
3514ITypeReference targetElementType;
3610case ITypeReference marshallerTypeRef:
3658var elementType = marshallingInformation.GetSafeArrayElementUserDefinedSubtype(Context);
3683private void SerializeTypeName(ITypeReference typeReference, BlobBuilder writer)
3770var returnType = signature.GetType(Context);
3811private void SerializeTypeReference(SignatureTypeEncoder encoder, ITypeReference typeReference)
3902ITypeReference uninstantiatedTypeReference = typeReference.GetUninstantiatedGenericType(Context);
3907var consolidatedTypeArguments = ArrayBuilder<ITypeReference>.GetInstance();
3915foreach (ITypeReference typeArgument in consolidatedTypeArguments)
4013var elementType = arrayTypeReference.GetElementType(Context);
4026private void SerializeCustomAttributeElementType(in EmitContext context, CustomAttributeElementTypeEncoder encoder, ITypeReference typeReference)
4119private int GetNumberOfInheritedTypeParameters(ITypeReference type)
4265protected sealed class TypeReferenceIndex : HeapOrReferenceIndexBase<ITypeReference>
4267private readonly Dictionary<ITypeReference, int> _index;
4270: this(writer, new Dictionary<ITypeReference, int>(ReferenceEqualityComparer.Instance), lastRowId)
4274private TypeReferenceIndex(MetadataWriter writer, Dictionary<ITypeReference, int> index, int lastRowId)
4281public override bool TryGetValue(ITypeReference item, out int index)
4286protected override void AddItem(ITypeReference item, int index)
PEWriter\TypeNameSerializer.cs (10)
19internal static string GetSerializedTypeName(this ITypeReference typeReference, EmitContext context)
25internal static string GetSerializedTypeName(this ITypeReference typeReference, EmitContext context, ref bool isAssemblyQualified)
91ITypeReference uninstantiatedTypeReference = typeReference.GetUninstantiatedGenericType(context);
94ArrayBuilder<ITypeReference> consolidatedTypeArguments = ArrayBuilder<ITypeReference>.GetInstance();
101foreach (ITypeReference argument in consolidatedTypeArguments)
141private static void AppendSerializedTypeName(StringBuilder sb, ITypeReference type, ref bool isAssemQualified, EmitContext context)
156private static void AppendAssemblyQualifierIfNecessary(StringBuilder sb, ITypeReference typeReference, out bool isAssemQualified, EmitContext context)
240private static ITypeReference UnwrapTypeReference(ITypeReference typeReference, EmitContext context)