CodeGen\PrivateImplementationDetails.cs (25)
53internal readonly Cci.ITypeReference SystemObject; //base type
54private readonly Cci.ITypeReference _systemValueType; //base for nested structs
56private readonly Cci.ITypeReference _systemInt8Type; //for metadata init of byte arrays
57private readonly Cci.ITypeReference _systemInt16Type; //for metadata init of short arrays
58private readonly Cci.ITypeReference _systemInt32Type; //for metadata init of int arrays
59private readonly Cci.ITypeReference _systemInt64Type; //for metadata init of long arrays
98private readonly ConcurrentDictionary<(uint Size, ushort Alignment), Cci.ITypeReference> _dataFieldTypes = new ConcurrentDictionary<(uint Size, ushort Alignment), Cci.ITypeReference>();
109Cci.ITypeReference systemObject,
110Cci.ITypeReference systemValueType,
111Cci.ITypeReference systemInt8Type,
112Cci.ITypeReference systemInt16Type,
113Cci.ITypeReference systemInt32Type,
114Cci.ITypeReference systemInt64Type,
244private Cci.ITypeReference GetOrAddDataFieldType(int length, ushort alignment)
298Cci.ITypeReference type = @this.GetOrAddDataFieldType(data.Length, alignment);
392internal Cci.IFieldReference GetModuleVersionId(Cci.ITypeReference mvidType)
404internal Cci.IFieldReference GetModuleCancellationToken(Cci.ITypeReference cancellationTokenType)
416internal Cci.IFieldReference GetOrAddInstrumentationPayloadRoot(int analysisKind, Cci.ITypeReference payloadRootType)
512public override Cci.ITypeReference GetBaseClass(EmitContext context) => SystemObject;
671private readonly Cci.ITypeReference _sysValueType;
673internal ExplicitSizeStruct(uint size, ushort alignment, PrivateImplementationDetails containingType, Cci.ITypeReference sysValueType)
685public override Cci.ITypeReference GetBaseClass(EmitContext context) => _sysValueType;
771public override Cci.ITypeReference GetBaseClass(EmitContext context) => _containingType.SystemObject;
783public override Cci.ITypeReference GetType(EmitContext context)
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);
635internal sealed override Cci.ITypeReference EncTranslateType(ITypeSymbolInternal type, DiagnosticBag diagnostics)
640internal virtual Cci.ITypeReference EncTranslateLocalVariableType(TTypeSymbol type, DiagnosticBag diagnostics)
724internal abstract Cci.ITypeReference Translate(TTypeSymbol symbol, TSyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics);
732internal sealed override Cci.ITypeReference Translate(ITypeSymbolInternal symbol, SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics)
761internal Cci.IFieldReference GetModuleVersionId(Cci.ITypeReference mvidType, TSyntaxNode syntaxOpt, DiagnosticBag diagnostics)
769internal Cci.IFieldReference GetModuleCancellationToken(Cci.ITypeReference cancellationTokenType, TSyntaxNode syntaxOpt, DiagnosticBag diagnostics)
772internal Cci.IFieldReference GetInstrumentationPayloadRoot(int analysisKind, Cci.ITypeReference payloadType, TSyntaxNode syntaxOpt, DiagnosticBag diagnostics)
1133public 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)