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>();
112Cci.ITypeReference systemObject,
113Cci.ITypeReference systemValueType,
114Cci.ITypeReference systemInt8Type,
115Cci.ITypeReference systemInt16Type,
116Cci.ITypeReference systemInt32Type,
117Cci.ITypeReference systemInt64Type,
247private Cci.ITypeReference GetOrAddDataFieldType(int length, ushort alignment)
301Cci.ITypeReference type = @this.GetOrAddDataFieldType(data.Length, alignment);
407internal Cci.IFieldReference GetModuleVersionId(Cci.ITypeReference mvidType)
419internal Cci.IFieldReference GetModuleCancellationToken(Cci.ITypeReference cancellationTokenType)
431internal Cci.IFieldReference GetOrAddInstrumentationPayloadRoot(int analysisKind, Cci.ITypeReference payloadRootType)
527public override Cci.ITypeReference GetBaseClass(EmitContext context) => SystemObject;
691private readonly Cci.ITypeReference _sysValueType;
693internal ExplicitSizeStruct(uint size, ushort alignment, PrivateImplementationDetails containingType, Cci.ITypeReference sysValueType)
705public override Cci.ITypeReference GetBaseClass(EmitContext context) => _sysValueType;
791public override Cci.ITypeReference GetBaseClass(EmitContext context) => _containingType.SystemObject;
803public override Cci.ITypeReference GetType(EmitContext context)
Emit\CommonPEModuleBuilder.cs (12)
121internal abstract Cci.ITypeReference Translate(ITypeSymbolInternal symbol, SyntaxNode syntaxOpt, DiagnosticBag diagnostics);
130internal abstract Cci.ITypeReference EncTranslateType(ITypeSymbolInternal type, DiagnosticBag diagnostics);
174public abstract Cci.ITypeReference GetPlatformType(Cci.PlatformType platformType, EmitContext context);
175public abstract bool IsPlatformType(Cci.ITypeReference typeRef, Cci.PlatformType platformType);
634internal sealed override Cci.ITypeReference EncTranslateType(ITypeSymbolInternal type, DiagnosticBag diagnostics)
639internal virtual Cci.ITypeReference EncTranslateLocalVariableType(TTypeSymbol type, DiagnosticBag diagnostics)
723internal abstract Cci.ITypeReference Translate(TTypeSymbol symbol, TSyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics);
731internal sealed override Cci.ITypeReference Translate(ITypeSymbolInternal symbol, SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics)
760internal Cci.IFieldReference GetModuleVersionId(Cci.ITypeReference mvidType, TSyntaxNode syntaxOpt, DiagnosticBag diagnostics)
768internal Cci.IFieldReference GetModuleCancellationToken(Cci.ITypeReference cancellationTokenType, TSyntaxNode syntaxOpt, DiagnosticBag diagnostics)
771internal Cci.IFieldReference GetInstrumentationPayloadRoot(int analysisKind, Cci.ITypeReference payloadType, TSyntaxNode syntaxOpt, DiagnosticBag diagnostics)
1132public sealed override Cci.ITypeReference GetPlatformType(Cci.PlatformType platformType, EmitContext context)
PEWriter\MetadataWriter.cs (44)
350protected abstract bool TryGetTypeReferenceHandle(ITypeReference reference, out TypeReferenceHandle handle);
357protected abstract TypeReferenceHandle GetOrAddTypeReferenceHandle(ITypeReference reference);
363protected abstract IReadOnlyList<ITypeReference> GetTypeRefs();
370protected abstract TypeSpecificationHandle GetOrAddTypeSpecificationHandle(ITypeReference reference);
376protected abstract IReadOnlyList<ITypeReference> GetTypeSpecs();
439private readonly Dictionary<ITypeReference, BlobHandle> _typeSpecSignatureIndex = new Dictionary<ITypeReference, BlobHandle>(ReferenceEqualityComparer.Instance);
641public static IUnitReference GetDefiningUnitReference(ITypeReference typeReference, EmitContext context)
957var containingType = memberRef.GetContainingType(Context);
1054foreach (ITypeReference typeReference in methodInstanceReference.GetGenericArguments(Context))
1056var typeRef = typeReference;
1594private TypeReferenceHandle GetTypeReferenceHandle(ITypeReference typeReference)
1617private TypeSpecificationHandle GetTypeSpecificationHandle(ITypeReference typeReference)
1642internal BlobHandle GetTypeSpecSignatureIndex(ITypeReference typeReference)
1659internal EntityHandle GetTypeHandle(ITypeReference typeReference, bool treatRefAsPotentialTypeSpec = true)
2778ITypeReference baseType = typeDef.GetBaseClass(Context);
2827foreach (ITypeReference typeRef in typeRefs)
2836ITypeReference scopeTypeRef;
2887foreach (ITypeReference typeSpec in typeSpecs)
3109ITypeReference typeReference => GetTypeHandle(typeReference),
3377var exceptionType = region.ExceptionType;
3411var type = parameterTypeInformation.GetType(Context);
3440foreach (ITypeReference genericArgument in genericMethodInstanceReference.GetGenericArguments(Context))
3442ITypeReference typeRef = genericArgument;
3497private void SerializeNamedArgumentType(in EmitContext context, NamedArgumentTypeEncoder encoder, ITypeReference type)
3513private void SerializeMetadataExpression(in EmitContext context, LiteralEncoder encoder, IMetadataExpression expression, ITypeReference targetType)
3517ITypeReference targetElementType;
3613case ITypeReference marshallerTypeRef:
3661var elementType = marshallingInformation.GetSafeArrayElementUserDefinedSubtype(Context);
3686private void SerializeTypeName(ITypeReference typeReference, BlobBuilder writer)
3773var returnType = signature.GetType(Context);
3814private void SerializeTypeReference(SignatureTypeEncoder encoder, ITypeReference typeReference)
3905ITypeReference uninstantiatedTypeReference = typeReference.GetUninstantiatedGenericType(Context);
3910var consolidatedTypeArguments = ArrayBuilder<ITypeReference>.GetInstance();
3918foreach (ITypeReference typeArgument in consolidatedTypeArguments)
4016var elementType = arrayTypeReference.GetElementType(Context);
4029private void SerializeCustomAttributeElementType(in EmitContext context, CustomAttributeElementTypeEncoder encoder, ITypeReference typeReference)
4122private int GetNumberOfInheritedTypeParameters(ITypeReference type)
4268protected sealed class TypeReferenceIndex : HeapOrReferenceIndexBase<ITypeReference>
4270private readonly Dictionary<ITypeReference, int> _index;
4273: this(writer, new Dictionary<ITypeReference, int>(ReferenceEqualityComparer.Instance), lastRowId)
4277private TypeReferenceIndex(MetadataWriter writer, Dictionary<ITypeReference, int> index, int lastRowId)
4284public override bool TryGetValue(ITypeReference item, out int index)
4289protected 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)