CodeGen\PrivateImplementationDetails.cs (33)
42private readonly Cci.ITypeReference _systemObject; //base type
43private readonly Cci.ITypeReference _systemValueType; //base for nested structs
45private readonly Cci.ITypeReference _systemInt8Type; //for metadata init of byte arrays
46private readonly Cci.ITypeReference _systemInt16Type; //for metadata init of short arrays
47private readonly Cci.ITypeReference _systemInt32Type; //for metadata init of int arrays
48private readonly Cci.ITypeReference _systemInt64Type; //for metadata init of long arrays
77private ImmutableArray<Cci.ITypeReference> _orderedProxyTypes;
78private readonly ConcurrentDictionary<(uint Size, ushort Alignment), Cci.ITypeReference> _proxyTypes = new ConcurrentDictionary<(uint Size, ushort Alignment), Cci.ITypeReference>();
84Cci.ITypeReference systemObject,
85Cci.ITypeReference systemValueType,
86Cci.ITypeReference systemInt8Type,
87Cci.ITypeReference systemInt16Type,
88Cci.ITypeReference systemInt32Type,
89Cci.ITypeReference systemInt64Type,
209Cci.ITypeReference type = _proxyTypes.GetOrAdd(
253internal Cci.IFieldReference GetModuleVersionId(Cci.ITypeReference mvidType)
265internal Cci.IFieldReference GetOrAddInstrumentationPayloadRoot(int analysisKind, Cci.ITypeReference payloadRootType)
322public override Cci.ITypeReference GetBaseClass(EmitContext context) => _systemObject;
421private readonly Cci.ITypeReference _sysValueType;
423internal ExplicitSizeStruct(uint size, ushort alignment, PrivateImplementationDetails containingType, Cci.ITypeReference sysValueType)
438public override Cci.ITypeReference GetBaseClass(EmitContext context) => _sysValueType;
459public Cci.ITypeReference GetContainingType(EmitContext context) => _containingType;
469private readonly Cci.ITypeReference _type;
472internal SynthesizedStaticField(string name, Cci.INamedTypeDefinition containingType, Cci.ITypeReference type)
516public Cci.ITypeReference GetContainingType(EmitContext context) => _containingType;
537public Cci.ITypeReference GetType(EmitContext context) => _type;
543internal Cci.ITypeReference Type => _type;
569internal ModuleVersionIdField(Cci.INamedTypeDefinition containingType, Cci.ITypeReference type)
579internal InstrumentationPayloadRootField(Cci.INamedTypeDefinition containingType, int analysisIndex, Cci.ITypeReference payloadType)
594internal MappedField(string name, Cci.INamedTypeDefinition containingType, Cci.ITypeReference type, ImmutableArray<byte> block)
609internal CachedArrayField(string name, Cci.INamedTypeDefinition containingType, Cci.ITypeReference type)
719public virtual Cci.ITypeReference GetBaseClass(EmitContext context)
Emit\CommonPEModuleBuilder.cs (11)
105internal abstract Cci.ITypeReference Translate(ITypeSymbolInternal symbol, SyntaxNode syntaxOpt, DiagnosticBag diagnostics);
115internal abstract Cci.ITypeReference EncTranslateType(ITypeSymbolInternal type, DiagnosticBag diagnostics);
159public abstract Cci.ITypeReference GetPlatformType(Cci.PlatformType platformType, EmitContext context);
160public abstract bool IsPlatformType(Cci.ITypeReference typeRef, Cci.PlatformType platformType);
592internal sealed override Cci.ITypeReference EncTranslateType(ITypeSymbolInternal type, DiagnosticBag diagnostics)
597internal virtual Cci.ITypeReference EncTranslateLocalVariableType(TTypeSymbol type, DiagnosticBag diagnostics)
696internal abstract Cci.ITypeReference Translate(TTypeSymbol symbol, TSyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics);
704internal sealed override Cci.ITypeReference Translate(ITypeSymbolInternal symbol, SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics)
733internal Cci.IFieldReference GetModuleVersionId(Cci.ITypeReference mvidType, TSyntaxNode syntaxOpt, DiagnosticBag diagnostics)
741internal Cci.IFieldReference GetInstrumentationPayloadRoot(int analysisKind, Cci.ITypeReference payloadType, TSyntaxNode syntaxOpt, DiagnosticBag diagnostics)
1064public sealed override Cci.ITypeReference GetPlatformType(Cci.PlatformType platformType, EmitContext context)
PEWriter\MetadataWriter.cs (44)
346protected abstract bool TryGetTypeReferenceHandle(ITypeReference reference, out TypeReferenceHandle handle);
353protected abstract TypeReferenceHandle GetOrAddTypeReferenceHandle(ITypeReference reference);
359protected abstract IReadOnlyList<ITypeReference> GetTypeRefs();
366protected abstract TypeSpecificationHandle GetOrAddTypeSpecificationHandle(ITypeReference reference);
372protected abstract IReadOnlyList<ITypeReference> GetTypeSpecs();
435private readonly Dictionary<ITypeReference, BlobHandle> _typeSpecSignatureIndex = new Dictionary<ITypeReference, BlobHandle>(ReferenceEqualityComparer.Instance);
636public static IUnitReference GetDefiningUnitReference(ITypeReference typeReference, EmitContext context)
968var containingType = memberRef.GetContainingType(Context);
1065foreach (ITypeReference typeReference in methodInstanceReference.GetGenericArguments(Context))
1067var typeRef = typeReference;
1595private TypeReferenceHandle GetTypeReferenceHandle(ITypeReference typeReference)
1618private TypeSpecificationHandle GetTypeSpecificationHandle(ITypeReference typeReference)
1643internal BlobHandle GetTypeSpecSignatureIndex(ITypeReference typeReference)
1660internal EntityHandle GetTypeHandle(ITypeReference typeReference, bool treatRefAsPotentialTypeSpec = true)
2724ITypeReference baseType = typeDef.GetBaseClass(Context);
2773foreach (ITypeReference typeRef in typeRefs)
2782ITypeReference scopeTypeRef;
2833foreach (ITypeReference typeSpec in typeSpecs)
3060ITypeReference typeReference => GetTypeHandle(typeReference),
3328var exceptionType = region.ExceptionType;
3362var type = parameterTypeInformation.GetType(Context);
3391foreach (ITypeReference genericArgument in genericMethodInstanceReference.GetGenericArguments(Context))
3393ITypeReference typeRef = genericArgument;
3448private void SerializeNamedArgumentType(in EmitContext context, NamedArgumentTypeEncoder encoder, ITypeReference type)
3464private void SerializeMetadataExpression(in EmitContext context, LiteralEncoder encoder, IMetadataExpression expression, ITypeReference targetType)
3468ITypeReference targetElementType;
3564case ITypeReference marshallerTypeRef:
3612var elementType = marshallingInformation.GetSafeArrayElementUserDefinedSubtype(Context);
3637private void SerializeTypeName(ITypeReference typeReference, BlobBuilder writer)
3724var returnType = signature.GetType(Context);
3765private void SerializeTypeReference(SignatureTypeEncoder encoder, ITypeReference typeReference)
3856ITypeReference uninstantiatedTypeReference = typeReference.GetUninstantiatedGenericType(Context);
3861var consolidatedTypeArguments = ArrayBuilder<ITypeReference>.GetInstance();
3869foreach (ITypeReference typeArgument in consolidatedTypeArguments)
3967var elementType = arrayTypeReference.GetElementType(Context);
3980private void SerializeCustomAttributeElementType(in EmitContext context, CustomAttributeElementTypeEncoder encoder, ITypeReference typeReference)
4073private int GetNumberOfInheritedTypeParameters(ITypeReference type)
4219protected sealed class TypeReferenceIndex : HeapOrReferenceIndexBase<ITypeReference>
4221private readonly Dictionary<ITypeReference, int> _index;
4224: this(writer, new Dictionary<ITypeReference, int>(ReferenceEqualityComparer.Instance), lastRowId)
4228private TypeReferenceIndex(MetadataWriter writer, Dictionary<ITypeReference, int> index, int lastRowId)
4235public override bool TryGetValue(ITypeReference item, out int index)
4240protected 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)