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)
122internal abstract Cci.ITypeReference Translate(ITypeSymbolInternal symbol, SyntaxNode syntaxOpt, DiagnosticBag diagnostics);
131internal abstract Cci.ITypeReference EncTranslateType(ITypeSymbolInternal type, DiagnosticBag diagnostics);
175public abstract Cci.ITypeReference GetPlatformType(Cci.PlatformType platformType, EmitContext context);
176public abstract bool IsPlatformType(Cci.ITypeReference typeRef, Cci.PlatformType platformType);
633internal sealed override Cci.ITypeReference EncTranslateType(ITypeSymbolInternal type, DiagnosticBag diagnostics)
638internal virtual Cci.ITypeReference EncTranslateLocalVariableType(TTypeSymbol type, DiagnosticBag diagnostics)
722internal abstract Cci.ITypeReference Translate(TTypeSymbol symbol, TSyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics);
730internal sealed override Cci.ITypeReference Translate(ITypeSymbolInternal symbol, SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics)
759internal Cci.IFieldReference GetModuleVersionId(Cci.ITypeReference mvidType, TSyntaxNode syntaxOpt, DiagnosticBag diagnostics)
767internal Cci.IFieldReference GetModuleCancellationToken(Cci.ITypeReference cancellationTokenType, TSyntaxNode syntaxOpt, DiagnosticBag diagnostics)
770internal Cci.IFieldReference GetInstrumentationPayloadRoot(int analysisKind, Cci.ITypeReference payloadType, TSyntaxNode syntaxOpt, DiagnosticBag diagnostics)
1118public 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);
642public static IUnitReference GetDefiningUnitReference(ITypeReference typeReference, EmitContext context)
958var containingType = memberRef.GetContainingType(Context);
1055foreach (ITypeReference typeReference in methodInstanceReference.GetGenericArguments(Context))
1057var 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)
2779ITypeReference baseType = typeDef.GetBaseClass(Context);
2828foreach (ITypeReference typeRef in typeRefs)
2837ITypeReference scopeTypeRef;
2888foreach (ITypeReference typeSpec in typeSpecs)
3110ITypeReference typeReference => GetTypeHandle(typeReference),
3378var exceptionType = region.ExceptionType;
3412var type = parameterTypeInformation.GetType(Context);
3441foreach (ITypeReference genericArgument in genericMethodInstanceReference.GetGenericArguments(Context))
3443ITypeReference typeRef = genericArgument;
3498private void SerializeNamedArgumentType(in EmitContext context, NamedArgumentTypeEncoder encoder, ITypeReference type)
3514private void SerializeMetadataExpression(in EmitContext context, LiteralEncoder encoder, IMetadataExpression expression, ITypeReference targetType)
3518ITypeReference targetElementType;
3614case ITypeReference marshallerTypeRef:
3662var elementType = marshallingInformation.GetSafeArrayElementUserDefinedSubtype(Context);
3687private void SerializeTypeName(ITypeReference typeReference, BlobBuilder writer)
3774var returnType = signature.GetType(Context);
3815private void SerializeTypeReference(SignatureTypeEncoder encoder, ITypeReference typeReference)
3906ITypeReference uninstantiatedTypeReference = typeReference.GetUninstantiatedGenericType(Context);
3911var consolidatedTypeArguments = ArrayBuilder<ITypeReference>.GetInstance();
3919foreach (ITypeReference typeArgument in consolidatedTypeArguments)
4017var elementType = arrayTypeReference.GetElementType(Context);
4030private void SerializeCustomAttributeElementType(in EmitContext context, CustomAttributeElementTypeEncoder encoder, ITypeReference typeReference)
4123private int GetNumberOfInheritedTypeParameters(ITypeReference type)
4269protected sealed class TypeReferenceIndex : HeapOrReferenceIndexBase<ITypeReference>
4271private readonly Dictionary<ITypeReference, int> _index;
4274: this(writer, new Dictionary<ITypeReference, int>(ReferenceEqualityComparer.Instance), lastRowId)
4278private TypeReferenceIndex(MetadataWriter writer, Dictionary<ITypeReference, int> index, int lastRowId)
4285public override bool TryGetValue(ITypeReference item, out int index)
4290protected 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)