diff --git a/src/coreclr/tools/Common/TypeSystem/Common/GenericParameterDesc.Diagnostic.cs b/src/coreclr/tools/Common/TypeSystem/Common/GenericParameterDesc.Diagnostic.cs
index 8af9193966818b..7e8df4304dfd5c 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/GenericParameterDesc.Diagnostic.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/GenericParameterDesc.Diagnostic.cs
@@ -11,6 +11,12 @@ public abstract partial class GenericParameterDesc
///
/// Gets the name of the generic parameter as defined in the metadata. This must not throw
///
- public abstract string DiagnosticName { get; }
+ public virtual string DiagnosticName
+ {
+ get
+ {
+ return string.Concat("T", Index.ToStringInvariant());
+ }
+ }
}
}
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/AssemblyGetExecutingAssemblyMethodThunk.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/AssemblyGetExecutingAssemblyMethodThunk.cs
index ab0e8eee978581..ce1d69716a7b97 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/AssemblyGetExecutingAssemblyMethodThunk.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/AssemblyGetExecutingAssemblyMethodThunk.cs
@@ -44,6 +44,14 @@ public override string Name
}
}
+ public override string DiagnosticName
+ {
+ get
+ {
+ return $"GetExecutingAssembly_{ExecutingAssembly.GetName().Name}";
+ }
+ }
+
public override TypeDesc OwningType
{
get;
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/CalliMarshallingMethodThunk.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/CalliMarshallingMethodThunk.cs
index 73b8645e855947..bdbd7b67998f48 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/CalliMarshallingMethodThunk.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/CalliMarshallingMethodThunk.cs
@@ -79,6 +79,14 @@ public override string Name
}
}
+ public override string DiagnosticName
+ {
+ get
+ {
+ return "CalliMarshallingMethodThunk";
+ }
+ }
+
public override PInvokeMetadata GetPInvokeMethodMetadata()
{
// Return PInvokeAttributes.PreserveSig to circumvent marshalling required checks
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DelegateMarshallingMethodThunk.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DelegateMarshallingMethodThunk.cs
index a81809c4193030..276f7dc4a42fcb 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DelegateMarshallingMethodThunk.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DelegateMarshallingMethodThunk.cs
@@ -237,6 +237,14 @@ public override string Name
}
}
+ public override string DiagnosticName
+ {
+ get
+ {
+ return NamePrefix + "__" + DelegateType.DiagnosticName;
+ }
+ }
+
public override MethodIL EmitIL()
{
return PInvokeILEmitter.EmitIL(this, default(PInvokeILEmitterConfiguration), _interopStateManager);
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DelegateThunks.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DelegateThunks.cs
index 5725a062a086e2..2d76523052ecd0 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DelegateThunks.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DelegateThunks.cs
@@ -90,6 +90,14 @@ protected FieldDesc FunctionPointerField
return SystemDelegateType.GetKnownField("m_functionPointer");
}
}
+
+ public sealed override string DiagnosticName
+ {
+ get
+ {
+ return Name;
+ }
+ }
}
///
@@ -779,5 +787,13 @@ public override string Name
return "GetThunk";
}
}
+
+ public override string DiagnosticName
+ {
+ get
+ {
+ return "GetThunk";
+ }
+ }
}
}
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DynamicInvokeMethodThunk.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DynamicInvokeMethodThunk.cs
index 90ce50f8425ca4..de076f3b8cbff8 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DynamicInvokeMethodThunk.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DynamicInvokeMethodThunk.cs
@@ -308,6 +308,14 @@ public override string Name
}
}
+ public override string DiagnosticName
+ {
+ get
+ {
+ return Name;
+ }
+ }
+
public override MethodIL EmitIL()
{
ILEmitter emitter = new ILEmitter();
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/EnumThunks.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/EnumThunks.cs
index a44161e6fa354b..dc8fba49876afc 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/EnumThunks.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/EnumThunks.cs
@@ -64,6 +64,14 @@ public override string Name
}
}
+ public override string DiagnosticName
+ {
+ get
+ {
+ return "GetHashCode";
+ }
+ }
+
public override bool IsVirtual
{
get
@@ -147,6 +155,14 @@ public override string Name
}
}
+ public override string DiagnosticName
+ {
+ get
+ {
+ return "Equals";
+ }
+ }
+
public override bool IsVirtual
{
get
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ForwardDelegateCreationThunk.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ForwardDelegateCreationThunk.cs
index e93d385a0ffcf6..fd1e907f844031 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ForwardDelegateCreationThunk.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ForwardDelegateCreationThunk.cs
@@ -75,6 +75,14 @@ public override string Name
}
}
+ public override string DiagnosticName
+ {
+ get
+ {
+ return "ForwardDelegateCreationStub__" + DelegateType.DiagnosticName;
+ }
+ }
+
///
/// This thunk creates a delegate from a native function pointer
/// by first creating a PInvokeDelegateWrapper from the function pointer
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/MethodBaseGetCurrentMethodThunk.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/MethodBaseGetCurrentMethodThunk.cs
index d75feac0fe9bdc..82a729dc3eb2db 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/MethodBaseGetCurrentMethodThunk.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/MethodBaseGetCurrentMethodThunk.cs
@@ -44,6 +44,14 @@ public override string Name
}
}
+ public override string DiagnosticName
+ {
+ get
+ {
+ return Method.DiagnosticName;
+ }
+ }
+
public override TypeDesc OwningType
{
get
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/StructMarshallingThunk.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/StructMarshallingThunk.cs
index cf346c06852173..2751290f0c91ef 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/StructMarshallingThunk.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/StructMarshallingThunk.cs
@@ -126,6 +126,14 @@ public override string Name
}
}
+ public override string DiagnosticName
+ {
+ get
+ {
+ return NamePrefix + "__" + ManagedType.DiagnosticName;
+ }
+ }
+
private Marshaller[] InitializeMarshallers()
{
Debug.Assert(_interopStateManager != null);
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/TypeGetTypeMethodThunk.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/TypeGetTypeMethodThunk.cs
index be09098c5dab6a..b1a32586bef3f5 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/TypeGetTypeMethodThunk.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/TypeGetTypeMethodThunk.cs
@@ -41,6 +41,14 @@ public override string Name
}
}
+ public override string DiagnosticName
+ {
+ get
+ {
+ return $"{_helperMethod.DiagnosticName}_{Signature.Length}_{DefaultAssemblyName}";
+ }
+ }
+
public override TypeDesc OwningType
{
get;
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ValueTypeGetFieldHelperMethodOverride.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ValueTypeGetFieldHelperMethodOverride.cs
index a324de7bb222be..a5cfa2db42e5ec 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ValueTypeGetFieldHelperMethodOverride.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ValueTypeGetFieldHelperMethodOverride.cs
@@ -149,5 +149,13 @@ public override string Name
return "__GetFieldHelper";
}
}
+
+ public override string DiagnosticName
+ {
+ get
+ {
+ return "__GetFieldHelper";
+ }
+ }
}
}
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/TypeSystemContext.GeneratedAssembly.cs b/src/coreclr/tools/Common/TypeSystem/IL/TypeSystemContext.GeneratedAssembly.cs
index a01beba3cea869..1a289f651f107e 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/TypeSystemContext.GeneratedAssembly.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/TypeSystemContext.GeneratedAssembly.cs
@@ -89,6 +89,14 @@ public override string Name
get;
}
+ public override string DiagnosticName
+ {
+ get
+ {
+ return Name;
+ }
+ }
+
public override string Namespace
{
get
@@ -97,6 +105,14 @@ public override string Namespace
}
}
+ public override string DiagnosticNamespace
+ {
+ get
+ {
+ return "Internal.CompilerGenerated";
+ }
+ }
+
public override int GetHashCode()
{
if (_hashcode != 0)
diff --git a/src/coreclr/tools/Common/TypeSystem/Interop/IL/InlineArrayType.cs b/src/coreclr/tools/Common/TypeSystem/Interop/IL/InlineArrayType.cs
index 6462c6ee2c59c7..4cf06e8b6bfb4f 100644
--- a/src/coreclr/tools/Common/TypeSystem/Interop/IL/InlineArrayType.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Interop/IL/InlineArrayType.cs
@@ -35,6 +35,14 @@ public override string Name
}
}
+ public override string DiagnosticName
+ {
+ get
+ {
+ return "_InlineArray__" + ElementType.DiagnosticName + "__" + Length;
+ }
+ }
+
public override string Namespace
{
get
@@ -43,6 +51,14 @@ public override string Namespace
}
}
+ public override string DiagnosticNamespace
+ {
+ get
+ {
+ return Namespace;
+ }
+ }
+
public override Instantiation Instantiation
{
get
@@ -320,6 +336,14 @@ public override string Name
}
}
+ public override string DiagnosticName
+ {
+ get
+ {
+ return Name;
+ }
+ }
+
public override MethodSignature Signature
{
get
diff --git a/src/coreclr/tools/Common/TypeSystem/Interop/IL/NativeStructType.cs b/src/coreclr/tools/Common/TypeSystem/Interop/IL/NativeStructType.cs
index d20d6fafcc0dc9..bf5e0c6ef3d7ba 100644
--- a/src/coreclr/tools/Common/TypeSystem/Interop/IL/NativeStructType.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Interop/IL/NativeStructType.cs
@@ -28,6 +28,14 @@ public override string Name
}
}
+ public override string DiagnosticName
+ {
+ get
+ {
+ return "__NativeType__" + ManagedStructType.DiagnosticName;
+ }
+ }
+
public override string Namespace
{
get
@@ -36,6 +44,14 @@ public override string Namespace
}
}
+ public override string DiagnosticNamespace
+ {
+ get
+ {
+ return "Internal.CompilerGenerated";
+ }
+ }
+
public override PInvokeStringFormat PInvokeStringFormat
{
get
diff --git a/src/coreclr/tools/Common/TypeSystem/Interop/IL/PInvokeDelegateWrapper.cs b/src/coreclr/tools/Common/TypeSystem/Interop/IL/PInvokeDelegateWrapper.cs
index 78cbe796e397f1..dcc2fbff41c065 100644
--- a/src/coreclr/tools/Common/TypeSystem/Interop/IL/PInvokeDelegateWrapper.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Interop/IL/PInvokeDelegateWrapper.cs
@@ -35,6 +35,14 @@ public override string Name
}
}
+ public override string DiagnosticName
+ {
+ get
+ {
+ return "PInvokeDelegateWrapper__" + DelegateType.DiagnosticName;
+ }
+ }
+
public override string Namespace
{
get
@@ -43,6 +51,14 @@ public override string Namespace
}
}
+ public override string DiagnosticNamespace
+ {
+ get
+ {
+ return "Internal.CompilerGenerated";
+ }
+ }
+
public override bool IsExplicitLayout
{
get
diff --git a/src/coreclr/tools/Common/TypeSystem/Interop/IL/PInvokeDelegateWrapperConstructor.cs b/src/coreclr/tools/Common/TypeSystem/Interop/IL/PInvokeDelegateWrapperConstructor.cs
index 6917c71f656e42..2e138f6098c7ff 100644
--- a/src/coreclr/tools/Common/TypeSystem/Interop/IL/PInvokeDelegateWrapperConstructor.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Interop/IL/PInvokeDelegateWrapperConstructor.cs
@@ -33,6 +33,14 @@ public override string Name
}
}
+ public override string DiagnosticName
+ {
+ get
+ {
+ return ".ctor";
+ }
+ }
+
private MethodSignature _signature;
public override MethodSignature Signature
{
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.BoxedTypes.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.BoxedTypes.cs
index 8be62c3d9950db..39a6bf3490beb0 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.BoxedTypes.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.BoxedTypes.cs
@@ -259,7 +259,8 @@ private partial class BoxedValueType : MetadataType, INonEmittableType
public override string Name => "Boxed_" + ValueTypeRepresented.Name;
public override string Namespace => ValueTypeRepresented.Namespace;
-
+ public override string DiagnosticName => "Boxed_" + ValueTypeRepresented.DiagnosticName;
+ public override string DiagnosticNamespace => ValueTypeRepresented.DiagnosticNamespace;
public override Instantiation Instantiation => ValueTypeRepresented.Instantiation;
public override PInvokeStringFormat PInvokeStringFormat => PInvokeStringFormat.AutoClass;
public override bool IsExplicitLayout => false;
@@ -411,6 +412,14 @@ public override string Name
}
}
+ public override string DiagnosticName
+ {
+ get
+ {
+ return _targetMethod.DiagnosticName + "_Unbox";
+ }
+ }
+
public override MethodIL EmitIL()
{
if (_owningType.ValueTypeRepresented.IsByRefLike)
@@ -487,6 +496,14 @@ public override string Name
}
}
+ public override string DiagnosticName
+ {
+ get
+ {
+ return _targetMethod.DiagnosticName + "_Unbox";
+ }
+ }
+
public override MethodIL EmitIL()
{
if (_owningType.ValueTypeRepresented.IsByRefLike)
@@ -574,6 +591,7 @@ public ValueTypeInstanceMethodWithHiddenParameter(MethodDesc methodRepresented)
public override TypeDesc OwningType => _methodRepresented.OwningType;
public override string Name => _methodRepresented.Name;
+ public override string DiagnosticName => _methodRepresented.DiagnosticName;
public override MethodSignature Signature
{
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.IntefaceThunks.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.IntefaceThunks.cs
index ad558ae43bf51b..06c13c51e6d8d1 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.IntefaceThunks.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.IntefaceThunks.cs
@@ -194,6 +194,14 @@ public override string Name
}
}
+ public override string DiagnosticName
+ {
+ get
+ {
+ return _targetMethod.DiagnosticName;
+ }
+ }
+
public MethodDesc BaseMethod => _targetMethod;
public string Prefix => $"__InstantiatingStub_{_interfaceIndex}_";
@@ -274,6 +282,7 @@ public DefaultInterfaceMethodImplementationWithHiddenParameter(MethodDesc method
public override TypeDesc OwningType => _owningType;
public override string Name => _methodRepresented.Name;
+ public override string DiagnosticName => _methodRepresented.DiagnosticName;
public override MethodSignature Signature
{
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/IL/Stubs/StartupCode/AppContextInitializerMethod.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/IL/Stubs/StartupCode/AppContextInitializerMethod.cs
index d4b53340b55301..ed40a5f6fcc75c 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/IL/Stubs/StartupCode/AppContextInitializerMethod.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/IL/Stubs/StartupCode/AppContextInitializerMethod.cs
@@ -54,6 +54,14 @@ public override string Name
}
}
+ public override string DiagnosticName
+ {
+ get
+ {
+ return "SetAppContextSwitches";
+ }
+ }
+
public override MethodIL EmitIL()
{
ILEmitter emitter = new ILEmitter();
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/IL/Stubs/StartupCode/NativeLibraryStartupMethod.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/IL/Stubs/StartupCode/NativeLibraryStartupMethod.cs
index 7138804bb23138..4240af2427d154 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/IL/Stubs/StartupCode/NativeLibraryStartupMethod.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/IL/Stubs/StartupCode/NativeLibraryStartupMethod.cs
@@ -48,6 +48,14 @@ public override string Name
}
}
+ public override string DiagnosticName
+ {
+ get
+ {
+ return "NativeLibraryStartup";
+ }
+ }
+
public override MethodIL EmitIL()
{
ILEmitter emitter = new ILEmitter();
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/IL/Stubs/StartupCode/StartupCodeMainMethod.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/IL/Stubs/StartupCode/StartupCodeMainMethod.cs
index b18b9435491343..2c91f888c4dc05 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/IL/Stubs/StartupCode/StartupCodeMainMethod.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/IL/Stubs/StartupCode/StartupCodeMainMethod.cs
@@ -53,6 +53,14 @@ public override string Name
}
}
+ public override string DiagnosticName
+ {
+ get
+ {
+ return "StartupCodeMain";
+ }
+ }
+
public override MethodIL EmitIL()
{
ILEmitter emitter = new ILEmitter();
@@ -229,6 +237,14 @@ public override string Name
}
}
+ public override string DiagnosticName
+ {
+ get
+ {
+ return "MainMethodWrapper";
+ }
+ }
+
public override MethodSignature Signature
{
get
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem/ILCompiler.TypeSystem.csproj b/src/coreclr/tools/aot/ILCompiler.TypeSystem/ILCompiler.TypeSystem.csproj
index 4aa53fd19c5e11..a638f7310d0523 100644
--- a/src/coreclr/tools/aot/ILCompiler.TypeSystem/ILCompiler.TypeSystem.csproj
+++ b/src/coreclr/tools/aot/ILCompiler.TypeSystem/ILCompiler.TypeSystem.csproj
@@ -9,6 +9,8 @@
x64;x86
AnyCPU
false
+ true
+ $(DefineConstants);DISABLE_UNMANAGED_PDB_SYMBOLS