Remove the second copy of ILLink.Shared project and source code (#83263)
authorVitek Karas <10670590+vitek-karas@users.noreply.github.com>
Sat, 11 Mar 2023 08:53:40 +0000 (00:53 -0800)
committerGitHub <noreply@github.com>
Sat, 11 Mar 2023 08:53:40 +0000 (00:53 -0800)
I compared the two, the one in illink had a couple of small fixes on top of NativeAOT. The only change exclusive to NativeAOT was making the FlowAnnotations public, so I ported that over.

I chose to keep the one in illink. We can discuss moving it around in additional PR.

The rest of this change is solution and project file cleanup.

Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
71 files changed:
src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj
src/coreclr/tools/aot/ILCompiler.ReadyToRun/ILCompiler.ReadyToRun.csproj
src/coreclr/tools/aot/ILLink.Shared/.editorconfig [deleted file]
src/coreclr/tools/aot/ILLink.Shared/Annotations.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/ClosedAttribute.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/DataFlow/DefaultValueDictionary.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/DataFlow/DictionaryLattice.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/DataFlow/ForwardDataFlowAnalysis.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/DataFlow/IControlFlowGraph.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/DataFlow/IDataFlowState.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/DataFlow/IDeepCopyValue.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/DataFlow/ILattice.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/DataFlow/ITransfer.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/DataFlow/MaybeLattice.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/DataFlow/SingleValue.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/DataFlow/ValueSet.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/DataFlow/ValueSetLattice.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/DiagnosticCategory.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/DiagnosticId.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/DiagnosticString.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/Directory.Build.props [deleted file]
src/coreclr/tools/aot/ILLink.Shared/HashUtils.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/ILLink.LinkAttributes.xsd [deleted file]
src/coreclr/tools/aot/ILLink.Shared/ILLink.Shared.projitems [deleted file]
src/coreclr/tools/aot/ILLink.Shared/ILLink.Shared.shproj [deleted file]
src/coreclr/tools/aot/ILLink.Shared/IsExternalInit.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/MessageFormat.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/MessageSubCategory.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/ParameterIndex.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/README.md [deleted file]
src/coreclr/tools/aot/ILLink.Shared/SharedStrings.resx [deleted file]
src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/ArrayValue.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/ConstIntValue.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/DiagnosticContext.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/FieldValue.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/FlowAnnotations.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/GenericParameterValue.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/HandleCallAction.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/IntrinsicId.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/Intrinsics.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/KnownStringValue.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/MethodParameterValue.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/MethodReturnValue.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/NullValue.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/NullableSystemTypeValue.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/NullableValueWithDynamicallyAccessedMembers.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/ReferenceKind.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/RequireDynamicallyAccessedMembersAction.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/RuntimeMethodHandleValue.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/RuntimeTypeHandleForGenericParameterValue.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/RuntimeTypeHandleForNullableSystemTypeValue.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/RuntimeTypeHandleForNullableValueWithDynamicallyAccessedMembers.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/RuntimeTypeHandleValue.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/SystemReflectionMethodBaseValue.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/SystemTypeValue.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/UnknownValue.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/ValueExtensions.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/ValueWithDynamicallyAccessedMembers.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/TypeSystemProxy/GenericParameterProxy.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/TypeSystemProxy/IMemberProxy.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/TypeSystemProxy/MethodProxy.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/TypeSystemProxy/ParameterCollection.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/TypeSystemProxy/ParameterProxy.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/TypeSystemProxy/TypeProxy.cs [deleted file]
src/coreclr/tools/aot/ILLink.Shared/TypeSystemProxy/WellKnownType.cs [deleted file]
src/coreclr/tools/aot/ilc.sln
src/tools/illink/src/ILLink.RoslynAnalyzer/TrimAnalysis/FlowAnnotations.cs
src/tools/illink/src/ILLink.Shared/ILLink.Shared.shproj
src/tools/illink/src/ILLink.Shared/TrimAnalysis/FlowAnnotations.cs
src/tools/illink/src/linker/Mono.Linker.csproj
src/tools/illink/trimming.sln

index 2c782c2..7981ec5 100644 (file)
     </EmbeddedResource>
   </ItemGroup>
 
-  <Import Project="..\ILLink.Shared\ILLink.Shared.projitems" Label="Shared" />
+  <Import Project="..\..\..\..\tools\illink\src\ILLink.Shared\ILLink.Shared.projitems" Label="Shared" />
 </Project>
index 6096d47..a380939 100644 (file)
     <Compile Include="..\..\Common\TypeSystem\Interop\InteropTypes.cs" Link="Interop\InteropTypes.cs" />
     <Compile Include="..\..\Common\TypeSystem\Interop\UnmanagedCallingConventions.cs" Link="Interop\UnmanagedCallingConventions.cs" />
     <Compile Include="..\ILCompiler.Reflection.ReadyToRun\PEReaderExtensions.cs" Link="Reflection\PEReaderExtensions.cs" />
-    <Compile Include="..\ILLink.Shared\ClosedAttribute.cs" Link="ILLink.Shared\ClosedAttribute.cs" />
-    <Compile Include="..\ILLink.Shared\ParameterIndex.cs" Link="ILLink.Shared\ParameterIndex.cs" />
-    <Compile Include="..\ILLink.Shared\TrimAnalysis\ReferenceKind.cs" Link="ILLink.Shared\TrimAnalysis\ReferenceKind.cs" />
-    <Compile Include="..\ILLink.Shared\TypeSystemProxy\GenericParameterProxy.cs" Link="ILLink.Shared\TypeSystemProxy\GenericParameterProxy.cs" />
-    <Compile Include="..\ILLink.Shared\TypeSystemProxy\IMemberProxy.cs" Link="ILLink.Shared\TypeSystemProxy\IMemberProxy.cs" />
-    <Compile Include="..\ILLink.Shared\TypeSystemProxy\MethodProxy.cs" Link="ILLink.Shared\TypeSystemProxy\MethodProxy.cs" />
-    <Compile Include="..\ILLink.Shared\TypeSystemProxy\ParameterCollection.cs" Link="ILLink.Shared\TypeSystemProxy\ParameterCollection.cs" />
-    <Compile Include="..\ILLink.Shared\TypeSystemProxy\ParameterProxy.cs" Link="ILLink.Shared\TypeSystemProxy\ParameterProxy.cs" />
-    <Compile Include="..\ILLink.Shared\TypeSystemProxy\TypeProxy.cs" Link="ILLink.Shared\TypeSystemProxy\TypeProxy.cs" />
-    <Compile Include="..\ILLink.Shared\TypeSystemProxy\WellKnownType.cs" Link="ILLink.Shared\TypeSystemProxy\WellKnownType.cs" />
+    <Compile Include="$(ToolsProjectRoot)illink\src\ILLink.Shared\ClosedAttribute.cs" Link="ILLink.Shared\ClosedAttribute.cs" />
+    <Compile Include="$(ToolsProjectRoot)illink\src\ILLink.Shared\ParameterIndex.cs" Link="ILLink.Shared\ParameterIndex.cs" />
+    <Compile Include="$(ToolsProjectRoot)illink\src\ILLink.Shared\TrimAnalysis\ReferenceKind.cs" Link="ILLink.Shared\TrimAnalysis\ReferenceKind.cs" />
+    <Compile Include="$(ToolsProjectRoot)illink\src\ILLink.Shared\TypeSystemProxy\GenericParameterProxy.cs" Link="ILLink.Shared\TypeSystemProxy\GenericParameterProxy.cs" />
+    <Compile Include="$(ToolsProjectRoot)illink\src\ILLink.Shared\TypeSystemProxy\IMemberProxy.cs" Link="ILLink.Shared\TypeSystemProxy\IMemberProxy.cs" />
+    <Compile Include="$(ToolsProjectRoot)illink\src\ILLink.Shared\TypeSystemProxy\MethodProxy.cs" Link="ILLink.Shared\TypeSystemProxy\MethodProxy.cs" />
+    <Compile Include="$(ToolsProjectRoot)illink\src\ILLink.Shared\TypeSystemProxy\ParameterCollection.cs" Link="ILLink.Shared\TypeSystemProxy\ParameterCollection.cs" />
+    <Compile Include="$(ToolsProjectRoot)illink\src\ILLink.Shared\TypeSystemProxy\ParameterProxy.cs" Link="ILLink.Shared\TypeSystemProxy\ParameterProxy.cs" />
+    <Compile Include="$(ToolsProjectRoot)illink\src\ILLink.Shared\TypeSystemProxy\TypeProxy.cs" Link="ILLink.Shared\TypeSystemProxy\TypeProxy.cs" />
+    <Compile Include="$(ToolsProjectRoot)illink\src\ILLink.Shared\TypeSystemProxy\WellKnownType.cs" Link="ILLink.Shared\TypeSystemProxy\WellKnownType.cs" />
     <Compile Include="Compiler\AssemblyExtensions.cs" />
     <Compile Include="Compiler\DependencyAnalysis\ReadyToRun\DeferredTillPhaseNode.cs" />
     <Compile Include="Compiler\DependencyAnalysis\ReadyToRun\ILBodyFixupSignature.cs" />
diff --git a/src/coreclr/tools/aot/ILLink.Shared/.editorconfig b/src/coreclr/tools/aot/ILLink.Shared/.editorconfig
deleted file mode 100644 (file)
index c676015..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-# IDE0060: Remove unused parameter
-dotnet_diagnostic.IDE0060.severity = silent
diff --git a/src/coreclr/tools/aot/ILLink.Shared/Annotations.cs b/src/coreclr/tools/aot/ILLink.Shared/Annotations.cs
deleted file mode 100644 (file)
index 78bbf44..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Diagnostics.CodeAnalysis;
-using System.Linq;
-using ILLink.Shared.TrimAnalysis;
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared
-{
-       internal static class Annotations
-       {
-               public static bool SourceHasRequiredAnnotations (
-                       DynamicallyAccessedMemberTypes sourceMemberTypes,
-                       DynamicallyAccessedMemberTypes targetMemberTypes,
-                       out string missingMemberTypesString)
-               {
-                       missingMemberTypesString = string.Empty;
-
-                       var missingMemberTypes = GetMissingMemberTypes (targetMemberTypes, sourceMemberTypes);
-                       if (missingMemberTypes == DynamicallyAccessedMemberTypes.None)
-                               return true;
-
-                       missingMemberTypesString = GetMemberTypesString (missingMemberTypes);
-                       return false;
-               }
-
-               public static DynamicallyAccessedMemberTypes GetMissingMemberTypes (DynamicallyAccessedMemberTypes requiredMemberTypes, DynamicallyAccessedMemberTypes availableMemberTypes)
-               {
-                       if (availableMemberTypes.HasFlag (requiredMemberTypes))
-                               return DynamicallyAccessedMemberTypes.None;
-
-                       if (requiredMemberTypes == DynamicallyAccessedMemberTypes.All)
-                               return DynamicallyAccessedMemberTypes.All;
-
-                       var missingMemberTypes = requiredMemberTypes & ~availableMemberTypes;
-
-                       // PublicConstructors is a special case since its value is 3 - so PublicParameterlessConstructor (1) | _PublicConstructor_WithMoreThanOneParameter_ (2)
-                       // The above bit logic only works for value with single bit set.
-                       if (requiredMemberTypes.HasFlag (DynamicallyAccessedMemberTypes.PublicConstructors) &&
-                               !availableMemberTypes.HasFlag (DynamicallyAccessedMemberTypes.PublicConstructors))
-                               missingMemberTypes |= DynamicallyAccessedMemberTypes.PublicConstructors;
-
-                       return missingMemberTypes;
-               }
-
-               public static string GetMemberTypesString (DynamicallyAccessedMemberTypes memberTypes)
-               {
-                       Debug.Assert (memberTypes != DynamicallyAccessedMemberTypes.None);
-
-                       if (memberTypes == DynamicallyAccessedMemberTypes.All)
-                               return $"'{nameof (DynamicallyAccessedMemberTypes)}.{nameof (DynamicallyAccessedMemberTypes.All)}'";
-
-                       var memberTypesList = AllDynamicallyAccessedMemberTypes
-                               .Where (damt => (memberTypes & damt) == damt && damt != DynamicallyAccessedMemberTypes.None)
-                               .ToList ();
-
-                       if (memberTypes.HasFlag (DynamicallyAccessedMemberTypes.PublicConstructors))
-                               memberTypesList.Remove (DynamicallyAccessedMemberTypes.PublicParameterlessConstructor);
-
-                       return string.Join (", ", memberTypesList.Select (mt => {
-                               string mtName = mt == DynamicallyAccessedMemberTypes.Interfaces
-                                       ? nameof (DynamicallyAccessedMemberTypes.Interfaces)
-                                       : mt.ToString ();
-
-                               return $"'{nameof (DynamicallyAccessedMemberTypes)}.{mtName}'";
-                       }));
-               }
-
-               private static readonly DynamicallyAccessedMemberTypes[] AllDynamicallyAccessedMemberTypes = GetAllDynamicallyAccessedMemberTypes ();
-
-               private static DynamicallyAccessedMemberTypes[] GetAllDynamicallyAccessedMemberTypes ()
-               {
-                       var values = new HashSet<DynamicallyAccessedMemberTypes> (
-                                                               Enum.GetValues (typeof (DynamicallyAccessedMemberTypes))
-                                                               .Cast<DynamicallyAccessedMemberTypes> ());
-                       if (!values.Contains (DynamicallyAccessedMemberTypes.Interfaces))
-                               values.Add (DynamicallyAccessedMemberTypes.Interfaces);
-                       return values.ToArray ();
-               }
-
-               public static (DiagnosticId Id, string[] Arguments) GetDiagnosticForAnnotationMismatch (ValueWithDynamicallyAccessedMembers source, ValueWithDynamicallyAccessedMembers target, string missingAnnotations)
-               {
-                       DiagnosticId diagnosticId = (source, target) switch {
-                               (MethodParameterValue maybeThisSource, MethodParameterValue maybeThisTarget) when maybeThisSource.IsThisParameter () && maybeThisTarget.IsThisParameter () => DiagnosticId.DynamicallyAccessedMembersMismatchThisParameterTargetsThisParameter,
-                               (MethodParameterValue maybeThis, MethodParameterValue) when maybeThis.IsThisParameter () => DiagnosticId.DynamicallyAccessedMembersMismatchThisParameterTargetsParameter,
-                               (MethodParameterValue maybeThis, MethodReturnValue) when maybeThis.IsThisParameter () => DiagnosticId.DynamicallyAccessedMembersMismatchThisParameterTargetsMethodReturnType,
-                               (MethodParameterValue maybeThis, FieldValue) when maybeThis.IsThisParameter () => DiagnosticId.DynamicallyAccessedMembersMismatchThisParameterTargetsField,
-                               (MethodParameterValue maybeThis, GenericParameterValue) when maybeThis.IsThisParameter () => DiagnosticId.DynamicallyAccessedMembersMismatchThisParameterTargetsGenericParameter,
-                               (MethodParameterValue, MethodParameterValue maybeThis) when maybeThis.IsThisParameter () => DiagnosticId.DynamicallyAccessedMembersMismatchParameterTargetsThisParameter,
-                               (MethodParameterValue, MethodParameterValue) => DiagnosticId.DynamicallyAccessedMembersMismatchParameterTargetsParameter,
-                               (MethodParameterValue, MethodReturnValue) => DiagnosticId.DynamicallyAccessedMembersMismatchParameterTargetsMethodReturnType,
-                               (MethodParameterValue, FieldValue) => DiagnosticId.DynamicallyAccessedMembersMismatchParameterTargetsField,
-                               (MethodParameterValue, GenericParameterValue) => DiagnosticId.DynamicallyAccessedMembersMismatchParameterTargetsGenericParameter,
-                               (MethodReturnValue, MethodParameterValue maybeThis) when maybeThis.IsThisParameter () => DiagnosticId.DynamicallyAccessedMembersMismatchMethodReturnTypeTargetsThisParameter,
-                               (MethodReturnValue, MethodParameterValue) => DiagnosticId.DynamicallyAccessedMembersMismatchMethodReturnTypeTargetsParameter,
-                               (MethodReturnValue, MethodReturnValue) => DiagnosticId.DynamicallyAccessedMembersMismatchMethodReturnTypeTargetsMethodReturnType,
-                               (MethodReturnValue, FieldValue) => DiagnosticId.DynamicallyAccessedMembersMismatchMethodReturnTypeTargetsField,
-                               (MethodReturnValue, GenericParameterValue) => DiagnosticId.DynamicallyAccessedMembersMismatchMethodReturnTypeTargetsGenericParameter,
-                               (FieldValue, MethodParameterValue maybeThis) when maybeThis.IsThisParameter () => DiagnosticId.DynamicallyAccessedMembersMismatchFieldTargetsThisParameter,
-                               (FieldValue, MethodParameterValue) => DiagnosticId.DynamicallyAccessedMembersMismatchFieldTargetsParameter,
-                               (FieldValue, MethodReturnValue) => DiagnosticId.DynamicallyAccessedMembersMismatchFieldTargetsMethodReturnType,
-                               (FieldValue, FieldValue) => DiagnosticId.DynamicallyAccessedMembersMismatchFieldTargetsField,
-                               (FieldValue, GenericParameterValue) => DiagnosticId.DynamicallyAccessedMembersMismatchFieldTargetsGenericParameter,
-                               (GenericParameterValue, MethodParameterValue maybeThis) when maybeThis.IsThisParameter () => DiagnosticId.DynamicallyAccessedMembersMismatchTypeArgumentTargetsThisParameter,
-                               (GenericParameterValue, MethodParameterValue) => DiagnosticId.DynamicallyAccessedMembersMismatchTypeArgumentTargetsParameter,
-                               (GenericParameterValue, MethodReturnValue) => DiagnosticId.DynamicallyAccessedMembersMismatchTypeArgumentTargetsMethodReturnType,
-                               (GenericParameterValue, FieldValue) => DiagnosticId.DynamicallyAccessedMembersMismatchTypeArgumentTargetsField,
-                               (GenericParameterValue, GenericParameterValue) => DiagnosticId.DynamicallyAccessedMembersMismatchTypeArgumentTargetsGenericParameter,
-                               (NullableValueWithDynamicallyAccessedMembers, MethodParameterValue maybeThis) when maybeThis.IsThisParameter () => DiagnosticId.DynamicallyAccessedMembersMismatchTypeArgumentTargetsThisParameter,
-                               (NullableValueWithDynamicallyAccessedMembers, MethodParameterValue) => DiagnosticId.DynamicallyAccessedMembersMismatchTypeArgumentTargetsParameter,
-                               (NullableValueWithDynamicallyAccessedMembers, MethodReturnValue) => DiagnosticId.DynamicallyAccessedMembersMismatchTypeArgumentTargetsMethodReturnType,
-                               (NullableValueWithDynamicallyAccessedMembers, FieldValue) => DiagnosticId.DynamicallyAccessedMembersMismatchTypeArgumentTargetsField,
-                               (NullableValueWithDynamicallyAccessedMembers, GenericParameterValue) => DiagnosticId.DynamicallyAccessedMembersMismatchTypeArgumentTargetsGenericParameter,
-
-                               _ => throw new NotImplementedException ($"Unsupported source context {source} or target context {target}.")
-                       };
-
-                       var args = new List<string> ();
-                       args.AddRange (target.GetDiagnosticArgumentsForAnnotationMismatch ());
-                       args.AddRange (source.GetDiagnosticArgumentsForAnnotationMismatch ());
-                       args.Add (missingAnnotations);
-                       return (diagnosticId, args.ToArray ());
-               }
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/ClosedAttribute.cs b/src/coreclr/tools/aot/ILLink.Shared/ClosedAttribute.cs
deleted file mode 100644 (file)
index feea932..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-using System.Diagnostics;
-
-namespace StaticCs
-{
-       [AttributeUsage (AttributeTargets.Enum)]
-       [Conditional ("EMIT_STATICCS_CLOSEDATTRIBUTE")]
-       internal sealed class ClosedAttribute : Attribute
-       {
-               public ClosedAttribute () { }
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/DataFlow/DefaultValueDictionary.cs b/src/coreclr/tools/aot/ILLink.Shared/DataFlow/DefaultValueDictionary.cs
deleted file mode 100644 (file)
index 599e7d3..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.DataFlow
-{
-       // This is a dictionary along with a default value, where every possible key either maps to
-       // the default value, or another value. The default value is never explicitly stored in the dictionary,
-       // and the empty dictionary (where all possible keys have the default value) is represented without
-       // actually allocating a dictionary.
-       public struct DefaultValueDictionary<TKey, TValue> : IEquatable<DefaultValueDictionary<TKey, TValue>>,
-               IEnumerable<KeyValuePair<TKey, TValue>>
-               where TKey : IEquatable<TKey>
-               where TValue : IEquatable<TValue>
-       {
-               private Dictionary<TKey, TValue>? Dictionary;
-               private readonly TValue DefaultValue;
-
-               public DefaultValueDictionary (TValue defaultValue) => (Dictionary, DefaultValue) = (null, defaultValue);
-
-               private DefaultValueDictionary (TValue defaultValue, Dictionary<TKey, TValue> dictionary) => (Dictionary, DefaultValue) = (dictionary, defaultValue);
-
-               public DefaultValueDictionary (DefaultValueDictionary<TKey, TValue> other)
-               {
-                       Dictionary = other.Dictionary == null ? null : new Dictionary<TKey, TValue> (other.Dictionary);
-                       DefaultValue = other.DefaultValue;
-               }
-
-               public TValue Get (TKey key) => Dictionary?.TryGetValue (key, out var value) == true ? value : DefaultValue;
-
-               public void Set (TKey key, TValue value)
-               {
-                       if (value.Equals (DefaultValue))
-                               Dictionary?.Remove (key);
-                       else
-                               (Dictionary ??= new Dictionary<TKey, TValue> ())[key] = value;
-               }
-
-               public bool Equals (DefaultValueDictionary<TKey, TValue> other)
-               {
-                       if (!DefaultValue.Equals (other.DefaultValue))
-                               return false;
-
-                       if (Dictionary == null)
-                               return other.Dictionary == null;
-
-                       if (other.Dictionary == null)
-                               return false;
-
-                       if (Dictionary.Count != other.Dictionary.Count)
-                               return false;
-
-                       foreach (var kvp in other.Dictionary) {
-                               if (!Get (kvp.Key).Equals (kvp.Value))
-                                       return false;
-                       }
-
-                       return true;
-               }
-
-               public override bool Equals (object? obj) => obj is DefaultValueDictionary<TKey, TValue> other && Equals (other);
-
-               public int Count => Dictionary?.Count ?? 0;
-
-               public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator ()
-               {
-                       return Dictionary?.GetEnumerator () ?? Enumerable.Empty<KeyValuePair<TKey, TValue>> ().GetEnumerator ();
-               }
-
-               IEnumerator IEnumerable.GetEnumerator () => GetEnumerator ();
-
-               public override string ToString ()
-               {
-                       StringBuilder sb = new ();
-                       sb.Append ('{');
-                       if (Dictionary != null) {
-                               foreach (var kvp in Dictionary)
-                                       sb.Append (Environment.NewLine).Append ('\t').Append (kvp.Key.ToString ()).Append (" -> ").Append (kvp.Value.ToString ());
-                       }
-                       sb.Append (Environment.NewLine).Append ("\t_ -> ").Append (DefaultValue.ToString ());
-                       sb.Append (Environment.NewLine).Append ('}');
-                       return sb.ToString ();
-               }
-
-               public DefaultValueDictionary<TKey, TValue> Clone ()
-               {
-                       var defaultValue = DefaultValue is IDeepCopyValue<TValue> copyDefaultValue ? copyDefaultValue.DeepCopy () : DefaultValue;
-                       if (Dictionary == null)
-                               return new DefaultValueDictionary<TKey, TValue> (defaultValue);
-
-                       var dict = new Dictionary<TKey, TValue> ();
-                       foreach (var kvp in Dictionary) {
-                               var key = kvp.Key;
-                               var value = kvp.Value;
-                               dict.Add (key, value is IDeepCopyValue<TValue> copyValue ? copyValue.DeepCopy () : value);
-                       }
-                       return new DefaultValueDictionary<TKey, TValue> (defaultValue, dict);
-               }
-
-               // Prevent warning CS0659 https://docs.microsoft.com/en-us/dotnet/csharp/misc/cs0659.
-               // This type should never be used as a dictionary key.
-               public override int GetHashCode () => throw new NotImplementedException ();
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/DataFlow/DictionaryLattice.cs b/src/coreclr/tools/aot/ILLink.Shared/DataFlow/DictionaryLattice.cs
deleted file mode 100644 (file)
index 77732b2..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.DataFlow
-{
-       // A lattice over dictionaries where the stored values are also from a lattice.
-       public readonly struct DictionaryLattice<TKey, TValue, TValueLattice> : ILattice<DefaultValueDictionary<TKey, TValue>>
-               where TKey : IEquatable<TKey>
-               where TValue : IEquatable<TValue>
-               where TValueLattice : ILattice<TValue>
-       {
-               public readonly TValueLattice ValueLattice;
-
-               public DefaultValueDictionary<TKey, TValue> Top { get; }
-
-               public DictionaryLattice (TValueLattice valueLattice)
-               {
-                       ValueLattice = valueLattice;
-                       Top = new DefaultValueDictionary<TKey, TValue> (valueLattice.Top);
-               }
-
-               public DefaultValueDictionary<TKey, TValue> Meet (DefaultValueDictionary<TKey, TValue> left, DefaultValueDictionary<TKey, TValue> right)
-               {
-                       var met = new DefaultValueDictionary<TKey, TValue> (left);
-                       foreach (var kvp in right) {
-                               TKey key = kvp.Key;
-                               TValue rightValue = kvp.Value;
-                               met.Set (key, ValueLattice.Meet (left.Get (key), rightValue));
-                       }
-                       return met;
-               }
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/DataFlow/ForwardDataFlowAnalysis.cs b/src/coreclr/tools/aot/ILLink.Shared/DataFlow/ForwardDataFlowAnalysis.cs
deleted file mode 100644 (file)
index cd65c55..0000000
+++ /dev/null
@@ -1,355 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.DataFlow
-{
-       // A generic implementation of a forward dataflow analysis. Forward means that it flows facts
-       // across code in the order of execution, starting from the beginning of a method,
-       // and merging values from predecessors.
-       public abstract class ForwardDataFlowAnalysis<TValue, TState, TLattice, TBlock, TRegion, TControlFlowGraph, TTransfer>
-               where TValue : struct, IEquatable<TValue>
-               where TState : class, IDataFlowState<TValue, TLattice>, new()
-               where TLattice : ILattice<TValue>
-               where TTransfer : ITransfer<TBlock, TValue, TState, TLattice>
-               where TBlock : IEquatable<TBlock>
-               where TRegion : IRegion<TRegion>
-               where TControlFlowGraph : IControlFlowGraph<TBlock, TRegion>
-       {
-
-               // Data structure to store dataflow states for every basic block in the control flow graph,
-               // keeping the exception states shared across different basic blocks owned by the same try or catch region.
-               private struct ControlFlowGraphState
-               {
-                       // Dataflow states for each basic block
-                       private readonly Dictionary<TBlock, TState> blockOutput;
-
-                       // The control flow graph doesn't contain edges for exceptional control flow:
-                       // - From any point in a try region to the start of any catch or finally
-                       // - From any point in a catch region to the start of a finally or the end of a try-catch block
-                       // These implicit edges are handled by tracking an auxiliary state for each try and catch region,
-                       // which the transfer functions are expected to update (in addition to the normal state updates)
-                       // when visiting operations inside of a try or catch region.
-
-                       // Dataflow states for exceptions propagating out of try or catch regions
-                       private readonly Dictionary<TRegion, Box<TValue>> exceptionState;
-
-                       // Control may flow through a finally region when an exception is thrown from anywhere in the corresponding
-                       // try or catch regions, or as part of non-exceptional control flow out of a try or catch.
-                       // We track a separate finally state for the exceptional case. Only the normal (non-exceptional) state is
-                       // propagated out of the finally.
-
-                       // Dataflow states for finally blocks when exception propagate through the finally region
-                       private readonly Dictionary<TBlock, TValue> exceptionFinallyState;
-
-                       // Finally regions may be reached (along non-exceptional paths)
-                       // from multiple branches. This gets updated to track the normal finally input
-                       // states from all of these branches (which aren't represented explicitly in the CFG).
-                       private readonly Dictionary<TRegion, TValue> finallyInputState;
-                       private readonly TControlFlowGraph cfg;
-                       private readonly TLattice lattice;
-
-                       public ControlFlowGraphState (TControlFlowGraph cfg, TLattice lattice)
-                       {
-                               blockOutput = new ();
-                               exceptionState = new ();
-                               exceptionFinallyState = new ();
-                               finallyInputState = new ();
-                               this.cfg = cfg;
-                               this.lattice = lattice;
-                       }
-
-                       public Box<TValue> GetExceptionState (TRegion tryOrCatchOrFilterRegion)
-                       {
-                               if (tryOrCatchOrFilterRegion.Kind is not (RegionKind.Try or RegionKind.Catch or RegionKind.Filter))
-                                       throw new ArgumentException (null, nameof (tryOrCatchOrFilterRegion));
-
-                               if (!exceptionState.TryGetValue (tryOrCatchOrFilterRegion, out Box<TValue>? state)) {
-                                       state = new Box<TValue> (lattice.Top);
-                                       exceptionState.Add (tryOrCatchOrFilterRegion, state);
-                               }
-                               return state;
-                       }
-
-                       public bool TryGetExceptionState (TBlock block, out Box<TValue>? state)
-                       {
-                               state = null;
-                               if (!cfg.TryGetEnclosingTryOrCatchOrFilter (block, out TRegion? tryOrCatchOrFilterRegion))
-                                       return false;
-
-                               state = GetExceptionState (tryOrCatchOrFilterRegion);
-                               return true;
-                       }
-
-                       public TValue GetFinallyInputState (TRegion finallyRegion)
-                       {
-                               if (finallyRegion.Kind is not RegionKind.Finally)
-                                       throw new ArgumentException (null, nameof (finallyRegion));
-
-                               if (!finallyInputState.TryGetValue (finallyRegion, out TValue state)) {
-                                       state = lattice.Top;
-                                       finallyInputState.Add (finallyRegion, state);
-                               }
-                               return state;
-                       }
-
-                       public void SetFinallyInputState (TRegion finallyRegion, TValue state)
-                       {
-                               if (finallyRegion.Kind is not RegionKind.Finally)
-                                       throw new ArgumentException (null, nameof (finallyRegion));
-
-                               finallyInputState[finallyRegion] = state;
-                       }
-
-                       public bool TryGetExceptionFinallyState (TBlock block, out TValue state)
-                       {
-                               state = default;
-                               if (!cfg.TryGetEnclosingFinally (block, out _))
-                                       return false;
-
-                               if (!exceptionFinallyState.TryGetValue (block, out state)) {
-                                       state = lattice.Top;
-                                       exceptionFinallyState.Add (block, state);
-                               }
-                               return true;
-                       }
-
-                       public void SetExceptionFinallyState (TBlock block, TValue state)
-                       {
-                               if (!cfg.TryGetEnclosingFinally (block, out _))
-                                       throw new InvalidOperationException ();
-
-                               exceptionFinallyState[block] = state;
-                       }
-
-                       public TState Get (TBlock block)
-                       {
-                               if (!blockOutput.TryGetValue (block, out TState? state)) {
-                                       TryGetExceptionState (block, out Box<TValue>? exceptionState);
-                                       state = new TState () {
-                                               Lattice = lattice,
-                                               Current = lattice.Top,
-                                               Exception = exceptionState
-                                       };
-                                       blockOutput.Add (block, state);
-                               }
-                               return state;
-                       }
-               }
-
-               [Conditional ("DEBUG")]
-               public virtual void TraceStart (TControlFlowGraph cfg) { }
-
-               [Conditional ("DEBUG")]
-               public virtual void TraceVisitBlock (TBlock block) { }
-
-               [Conditional ("DEBUG")]
-               public virtual void TraceBlockInput (TValue normalState, TValue? exceptionState, TValue? exceptionFinallyState) { }
-
-               [Conditional ("DEBUG")]
-               public virtual void TraceBlockOutput (TValue normalState, TValue? exceptionState, TValue? exceptionFinallyState) { }
-
-               // This just runs a dataflow algorithm until convergence. It doesn't cache any results,
-               // allowing each particular kind of analysis to decide what is worth saving.
-               public void Fixpoint (TControlFlowGraph cfg, TLattice lattice, TTransfer transfer)
-               {
-                       TraceStart (cfg);
-
-                       // Initialize output of each block to the Top value of the lattice
-                       var cfgState = new ControlFlowGraphState (cfg, lattice);
-
-                       // For now, the actual dataflow algorithm is the simplest possible version.
-                       // It is written to be obviously correct, but has not been optimized for performance
-                       // at all. As written it will almost always perform unnecessary passes over the entire
-                       // control flow graph. The core abstractions shouldn't need to change even when we write
-                       // an optimized version of this algorithm - ideally any optimizations will be generic,
-                       // not specific to a particular analysis.
-
-                       // Allocate some objects which will be reused to hold the current dataflow state,
-                       // to avoid allocatons in the inner loop below.
-                       var state = new TState () {
-                               Lattice = lattice,
-                               Current = lattice.Top,
-                               Exception = null
-                       };
-                       var finallyState = new TState () {
-                               Lattice = lattice,
-                               Current = lattice.Top,
-                               Exception = null
-                       };
-
-                       bool changed = true;
-                       while (changed) {
-                               changed = false;
-                               foreach (var block in cfg.Blocks) {
-
-                                       TraceVisitBlock (block);
-
-                                       if (block.Equals (cfg.Entry))
-                                               continue;
-
-                                       bool isTryOrCatchOrFilterBlock = cfg.TryGetEnclosingTryOrCatchOrFilter (block, out TRegion? tryOrCatchOrFilterRegion);
-
-                                       bool isTryBlock = isTryOrCatchOrFilterBlock && tryOrCatchOrFilterRegion!.Kind == RegionKind.Try;
-                                       bool isTryStart = isTryBlock && block.Equals (cfg.FirstBlock (tryOrCatchOrFilterRegion!));
-                                       bool isCatchBlock = isTryOrCatchOrFilterBlock && tryOrCatchOrFilterRegion!.Kind == RegionKind.Catch;
-                                       bool isCatchStartWithoutFilter = isCatchBlock && block.Equals (cfg.FirstBlock (tryOrCatchOrFilterRegion!)) && !cfg.HasFilter (tryOrCatchOrFilterRegion!);
-                                       bool isFilterBlock = isTryOrCatchOrFilterBlock && tryOrCatchOrFilterRegion!.Kind == RegionKind.Filter;
-                                       bool isFilterStart = isFilterBlock && block.Equals (cfg.FirstBlock (tryOrCatchOrFilterRegion!));
-
-                                       bool isCatchOrFilterStart = isCatchStartWithoutFilter || isFilterStart;
-
-                                       bool isFinallyBlock = cfg.TryGetEnclosingFinally (block, out TRegion? finallyRegion);
-                                       bool isFinallyStart = isFinallyBlock && block.Equals (cfg.FirstBlock (finallyRegion!));
-
-
-                                       //
-                                       // Meet over predecessors to get the new value at the start of this block.
-                                       //
-
-                                       // Compute the dataflow state at the beginning of this block.
-                                       TValue currentState = lattice.Top;
-                                       foreach (var predecessor in cfg.GetPredecessors (block)) {
-                                               TValue predecessorState = cfgState.Get (predecessor.Block).Current;
-
-                                               // Propagate state through all finally blocks.
-                                               foreach (var exitedFinally in predecessor.FinallyRegions) {
-                                                       TValue oldFinallyInputState = cfgState.GetFinallyInputState (exitedFinally);
-                                                       TValue finallyInputState = lattice.Meet (oldFinallyInputState, predecessorState);
-
-                                                       cfgState.SetFinallyInputState (exitedFinally, finallyInputState);
-
-                                                       // Note: the current approach here is inefficient for long chains of finally regions because
-                                                       // the states will not converge until we have visited each block along the chain
-                                                       // and propagated the new states along this path.
-                                                       if (!changed && !finallyInputState.Equals (oldFinallyInputState))
-                                                               changed = true;
-
-                                                       TBlock lastFinallyBlock = cfg.LastBlock (exitedFinally);
-                                                       predecessorState = cfgState.Get (lastFinallyBlock).Current;
-                                               }
-
-                                               currentState = lattice.Meet (currentState, predecessorState);
-                                       }
-                                       // State at start of a catch also includes the exceptional state from
-                                       // try -> catch exceptional control flow.
-                                       if (isCatchOrFilterStart) {
-                                               TRegion correspondingTry = cfg.GetCorrespondingTry (tryOrCatchOrFilterRegion!);
-                                               Box<TValue> tryExceptionState = cfgState.GetExceptionState (correspondingTry);
-                                               currentState = lattice.Meet (currentState, tryExceptionState.Value);
-
-                                               // A catch or filter can also be reached from a previous filter.
-                                               foreach (TRegion previousFilter in cfg.GetPreviousFilters (tryOrCatchOrFilterRegion!)) {
-                                                       // Control may flow from the last block of a previous filter region to this catch or filter region.
-                                                       // Exceptions may also propagate from anywhere in a filter region to this catch or filter region.
-                                                       // This covers both cases since the exceptional state is a superset of the normal state.
-                                                       Box<TValue> previousFilterExceptionState = cfgState.GetExceptionState (previousFilter);
-                                                       currentState = lattice.Meet (currentState, previousFilterExceptionState.Value);
-                                               }
-                                       }
-                                       if (isFinallyStart) {
-                                               TValue finallyInputState = cfgState.GetFinallyInputState (finallyRegion!);
-                                               currentState = lattice.Meet (currentState, finallyInputState);
-                                       }
-
-                                       // Compute the independent exceptional finally state at beginning of a finally.
-                                       TValue? exceptionFinallyState = null;
-                                       if (isFinallyBlock) {
-                                               // Inside finally regions, must compute the parallel meet state for unhandled exceptions.
-                                               // Using predecessors in the finally. But not from outside the finally.
-                                               exceptionFinallyState = lattice.Top;
-                                               foreach (var predecessor in cfg.GetPredecessors (block)) {
-                                                       var isPredecessorInFinally = cfgState.TryGetExceptionFinallyState (predecessor.Block, out TValue predecessorFinallyState);
-                                                       Debug.Assert (isPredecessorInFinally);
-                                                       exceptionFinallyState = lattice.Meet (exceptionFinallyState.Value, predecessorFinallyState);
-                                               }
-
-                                               // For first block, also initialize it from the try or catch blocks.
-                                               if (isFinallyStart) {
-                                                       // Note that try+catch+finally is represented in the region hierarchy like a
-                                                       // try/finally where the try block contains a try/catch.
-                                                       // So including the corresponding try exception state will also take care of the
-                                                       // corresponding catch exception state.
-                                                       TRegion correspondingTry = cfg.GetCorrespondingTry (finallyRegion!);
-                                                       Box<TValue> tryExceptionState = cfgState.GetExceptionState (correspondingTry);
-                                                       exceptionFinallyState = lattice.Meet (exceptionFinallyState.Value, tryExceptionState.Value);
-                                               }
-                                       }
-
-                                       // Initialize the exception state at the start of try/catch regions. Control flow edges from predecessors
-                                       // within the same try or catch region don't need to be handled here because the transfer functions update
-                                       // the exception state to reflect every operation in the region.
-                                       TState currentBlockState = cfgState.Get (block);
-                                       Box<TValue>? exceptionState = currentBlockState.Exception;
-                                       TValue? oldExceptionState = exceptionState?.Value;
-                                       if (isTryStart || isCatchOrFilterStart) {
-                                               // Catch/filter regions get the initial state from the exception state of the corresponding try region.
-                                               // This is already accounted for in the non-exceptional control flow state of the catch block above,
-                                               // so we can just use the state we already computed, for both try and catch regions.
-                                               exceptionState!.Value = lattice.Meet (exceptionState!.Value, currentState);
-
-                                               if (isFinallyBlock) {
-                                                       // Exceptions could also be thrown from inside a finally that was entered due to a previous exception.
-                                                       // So the exception state must also include values from the exceptional finally state (computed above).
-                                                       exceptionState!.Value = lattice.Meet (exceptionState!.Value, exceptionFinallyState!.Value);
-                                               }
-                                       }
-
-                                       TraceBlockInput (currentState, exceptionState?.Value, exceptionFinallyState);
-
-                                       //
-                                       // Apply transfer functions to the met input to get an output value for this block.
-                                       //
-
-                                       state.Current = currentState;
-                                       state.Exception = exceptionState;
-                                       transfer.Transfer (block, state);
-
-                                       if (!changed && !cfgState.Get (block).Current.Equals (state.Current))
-                                               changed = true;
-
-                                       cfgState.Get (block).Current = state.Current;
-                                       Debug.Assert (cfgState.Get (block).Exception == state.Exception);
-
-                                       if (cfgState.TryGetExceptionFinallyState (block, out TValue oldFinallyState)) {
-                                               // Independently apply transfer functions for the exception finally state in finally regions.
-                                               finallyState.Current = exceptionFinallyState!.Value;
-                                               finallyState.Exception = exceptionState;
-                                               transfer.Transfer (block, finallyState);
-
-                                               if (!changed && !oldFinallyState.Equals (finallyState.Current))
-                                                       changed = true;
-
-                                               Debug.Assert (cfgState.Get (block).Exception == state.Exception);
-                                               cfgState.SetExceptionFinallyState (block, finallyState.Current);
-                                       }
-
-                                       // Either the normal transfer or the finally transfer might change
-                                       // the try/catch state, so this check should happen after both transfers.
-                                       if (exceptionState?.Value.Equals (oldExceptionState!.Value) == false) {
-                                               Debug.Assert (exceptionState != null);
-                                               Debug.Assert (oldExceptionState != null);
-                                               changed = true;
-
-                                               // Bubble up the changed exception state to the next enclosing try or catch exception state.
-                                               while (cfg.TryGetEnclosingTryOrCatchOrFilter (tryOrCatchOrFilterRegion!, out TRegion? enclosingTryOrCatch)) {
-                                                       // Filters can't contain try/catch/filters.
-                                                       Debug.Assert (enclosingTryOrCatch.Kind != RegionKind.Filter);
-                                                       Box<TValue> tryOrCatchExceptionState = cfgState.GetExceptionState (enclosingTryOrCatch);
-                                                       tryOrCatchExceptionState.Value = lattice.Meet (tryOrCatchExceptionState!.Value, exceptionState!.Value);
-                                                       tryOrCatchOrFilterRegion = enclosingTryOrCatch;
-                                               }
-                                       }
-
-                                       TraceBlockOutput (state.Current, exceptionState?.Value, exceptionFinallyState);
-                               }
-                       }
-               }
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/DataFlow/IControlFlowGraph.cs b/src/coreclr/tools/aot/ILLink.Shared/DataFlow/IControlFlowGraph.cs
deleted file mode 100644 (file)
index eb1b492..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-using System.Collections.Generic;
-using System.Collections.Immutable;
-using System.Diagnostics.CodeAnalysis;
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.DataFlow
-{
-       public enum RegionKind
-       {
-               Try,
-               Catch,
-               Filter,
-               Finally
-       }
-
-       public interface IRegion<TRegion> : IEquatable<TRegion>
-       {
-               RegionKind Kind { get; }
-       }
-
-       public interface IControlFlowGraph<TBlock, TRegion>
-               where TBlock : IEquatable<TBlock>
-               where TRegion : IRegion<TRegion>
-       {
-
-               public readonly struct Predecessor
-               {
-                       public readonly TBlock Block;
-                       public readonly ImmutableArray<TRegion> FinallyRegions;
-                       public Predecessor (TBlock block, ImmutableArray<TRegion> finallyRegions)
-                       {
-                               (Block, FinallyRegions) = (block, finallyRegions);
-                       }
-               }
-
-               IEnumerable<TBlock> Blocks { get; }
-
-               TBlock Entry { get; }
-
-               // This does not include predecessor edges for exceptional control flow into
-               // catch regions or finally regions. It also doesn't include edges for non-exceptional
-               // control flow from try -> finally or from catch -> finally.
-               IEnumerable<Predecessor> GetPredecessors (TBlock block);
-
-               bool TryGetEnclosingTryOrCatchOrFilter (TBlock block, [NotNullWhen (true)] out TRegion? tryOrCatchOrFilterRegion);
-
-               bool TryGetEnclosingTryOrCatchOrFilter (TRegion region, [NotNullWhen (true)] out TRegion? tryOrCatchOrFilterRegion);
-
-               bool TryGetEnclosingFinally (TBlock block, [NotNullWhen (true)] out TRegion? region);
-
-               TRegion GetCorrespondingTry (TRegion cathOrFilterOrFinallyRegion);
-
-               IEnumerable<TRegion> GetPreviousFilters (TRegion catchOrFilterRegion);
-
-               bool HasFilter (TRegion catchRegion);
-
-               TBlock FirstBlock (TRegion region);
-
-               TBlock LastBlock (TRegion region);
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/DataFlow/IDataFlowState.cs b/src/coreclr/tools/aot/ILLink.Shared/DataFlow/IDataFlowState.cs
deleted file mode 100644 (file)
index 26f056b..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.DataFlow
-{
-       public sealed class Box<T> where T : struct
-       {
-               public Box (T value) => Value = value;
-               public T Value { get; set; }
-
-       }
-
-       public interface IDataFlowState<TValue, TValueLattice>
-               where TValue : struct, IEquatable<TValue>
-               where TValueLattice : ILattice<TValue>
-       {
-               TValue Current { get; set; }
-               Box<TValue>? Exception { get; set; }
-               TValueLattice Lattice { get; init; }
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/DataFlow/IDeepCopyValue.cs b/src/coreclr/tools/aot/ILLink.Shared/DataFlow/IDeepCopyValue.cs
deleted file mode 100644 (file)
index da12780..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.DataFlow
-{
-       // Adds ability to deep copy a value
-       public interface IDeepCopyValue<TSingleValue>
-       {
-               public TSingleValue DeepCopy ();
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/DataFlow/ILattice.cs b/src/coreclr/tools/aot/ILLink.Shared/DataFlow/ILattice.cs
deleted file mode 100644 (file)
index 07f31c4..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.DataFlow
-{
-       // ILattice represents a lattice (technically a semilattice) of values.
-       // A semilattice is a set of values along with a meet operation (or greatest lower bound).
-       // The meet operation imposes a partial order on the values: a <= b iff Meet(a, b) == a.
-
-       // In a dataflow analysis, the Meet operation is used to combine the tracked facts when
-       // there are multiple control flow paths that reach the same program point (or in a backwards
-       // analysis, to combine the tracked facts from multiple control flow paths out of a program point).
-
-       // The interface constraint on TValue ensures that trying to instantiate
-       // ILattice over a nullable type will produce a warning or error.
-
-       // The lattice might be better represented as an interface describing individual lattice values
-       // (as opposed to describing the lattice structure as ILattice does), with Top being a static
-       // virtual interface method. This would avoid the need to pass around multiple generic arguments
-       // (TValue and TLattice). However, we can't use static virtual interface methods in the analyzer
-       // so the lattice instance provides the Top value.
-       public interface ILattice<TValue> where TValue : IEquatable<TValue>
-       {
-               // We require that the lattice has a "Top" or maximum element.
-               // Top is >= a for every element a of the lattice.
-               // Top is an identity for Meet: Meet(a, Top) = a.
-
-               // The typical use in a dataflow analysis is for Top to represent the "unknown" initial state
-               // with the least possible information about the analysis.
-               public TValue Top { get; }
-
-               // The Meet operation is associative, commutative, and idempotent.
-               // This is used in dataflow analysis to iteratively Meet the tracked facts from different control
-               // flow paths until the analysis converges to the most specific set of tracked facts.
-               public TValue Meet (TValue left, TValue right);
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/DataFlow/ITransfer.cs b/src/coreclr/tools/aot/ILLink.Shared/DataFlow/ITransfer.cs
deleted file mode 100644 (file)
index 74c35c8..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.DataFlow
-{
-       // ITransfer represents the transfer functions for a dataflow analysis.
-       // The transfer functions compute the effects of an operation on the set of facts
-       // tracked by a dataflow analysis. This simulates the execution of the operation
-       // on the domain of abstract values tracked in the dataflow analysis.
-
-       // TValue is the type of the information tracked in a dataflow analysis at each program point.
-       // TLattice is the type of the lattice formed by these values.
-
-       // TOperation is a type representing the operations that the transfer function
-       // "simulates". It isn't constrained by the interface, but is typically a basic block,
-       // where the transfer functions are defined in terms of transfer functions for individual
-       // operations in the block.
-
-       // TLattice isn't typically used in the implementation except to provide the "Top" value.
-       // This expresses the conceptual constraint that the transferred values are part of a lattice.
-       public interface ITransfer<TOperation, TValue, TState, TLattice>
-               where TValue : struct, IEquatable<TValue>
-               where TState : class, IDataFlowState<TValue, TLattice>
-               where TLattice : ILattice<TValue>
-       {
-               // Transfer should mutate the input value to reflect the effect of
-               // computing this operation. When using value types, ensure that
-               // any modifications to the values are observable by the caller (consider
-               // using readonly structs to prevent the implementation from making changes
-               // that won't be reflected in the caller).
-               void Transfer (TOperation operation, TState state);
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/DataFlow/MaybeLattice.cs b/src/coreclr/tools/aot/ILLink.Shared/DataFlow/MaybeLattice.cs
deleted file mode 100644 (file)
index 4e77f96..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-using System;
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.DataFlow
-{
-       // Wrapper for Nullable<T> which implements IEquatable so that this may
-       // be used as a lattice value. Nullable types can't satisfy interface constraints;
-       // see for example https://docs.microsoft.com/dotnet/csharp/misc/cs0313.
-       public struct Maybe<T> : IEquatable<Maybe<T>>
-               where T : struct, IEquatable<T>
-       {
-               public T? MaybeValue;
-               public Maybe (T value) => MaybeValue = value;
-               public bool Equals (Maybe<T> other) => MaybeValue?.Equals (other.MaybeValue) ?? other.MaybeValue == null;
-               public override bool Equals (object? obj) => obj is Maybe<T> other && Equals (other);
-               public override int GetHashCode () => MaybeValue?.GetHashCode () ?? 0;
-               public Maybe<T> Clone ()
-               {
-                       if (MaybeValue is not T value)
-                               return default;
-                       if (value is IDeepCopyValue<T> copyValue)
-                               return new (copyValue.DeepCopy ());
-                       return new (value);
-               }
-       }
-
-       public struct MaybeLattice<T, TValueLattice> : ILattice<Maybe<T>>
-               where T : struct, IEquatable<T>
-               where TValueLattice : ILattice<T>
-       {
-               public readonly TValueLattice ValueLattice;
-               public MaybeLattice (TValueLattice valueLattice)
-               {
-                       ValueLattice = valueLattice;
-                       Top = default;
-               }
-               public Maybe<T> Top { get; }
-               public Maybe<T> Meet (Maybe<T> left, Maybe<T> right)
-               {
-                       if (left.MaybeValue is not T leftValue)
-                               return right.Clone ();
-                       if (right.MaybeValue is not T rightValue)
-                               return left.Clone ();
-                       return new Maybe<T> (ValueLattice.Meet (leftValue, rightValue));
-               }
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/DataFlow/SingleValue.cs b/src/coreclr/tools/aot/ILLink.Shared/DataFlow/SingleValue.cs
deleted file mode 100644 (file)
index 7996375..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.DataFlow
-{
-       // This is a sum type over the various kinds of values we track:
-       // - dynamicallyaccessedmembertypes-annotated locations (types or strings)
-       // - known typeof values and similar
-       // - known strings
-       // - known integers
-
-       public abstract record SingleValue : IDeepCopyValue<SingleValue>
-       {
-               // All values must explicitely declare their ability to deep copy itself.
-               // If the value is immutable, it can "return this" as an optimization.
-               // Note: Since immutability is relatively tricky to determine, we require all values
-               //       to explicitly implement the DeepCopy, even though the expectation is that
-               //       most values will just "return this".
-               public abstract SingleValue DeepCopy ();
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/DataFlow/ValueSet.cs b/src/coreclr/tools/aot/ILLink.Shared/DataFlow/ValueSet.cs
deleted file mode 100644 (file)
index c47397d..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.DataFlow
-{
-       public readonly struct ValueSet<TValue> : IEquatable<ValueSet<TValue>>, IEnumerable<TValue>
-               where TValue : notnull
-       {
-               // Since we're going to do lot of type checks for this class a lot, it is much more efficient
-               // if the class is sealed (as then the runtime can do a simple method table pointer comparison)
-               private sealed class EnumerableValues : HashSet<TValue>
-               {
-                       public EnumerableValues (IEnumerable<TValue> values) : base (values) { }
-
-                       public override int GetHashCode ()
-                       {
-                               int hashCode = 0;
-                               foreach (var item in this)
-                                       hashCode = HashUtils.Combine (hashCode, item);
-                               return hashCode;
-                       }
-               }
-
-               public struct Enumerator : IEnumerator<TValue>, IDisposable, IEnumerator
-               {
-                       private readonly object? _value;
-                       private int _state;  // 0 before begining, 1 at item, 2 after end
-                       private readonly IEnumerator<TValue>? _enumerator;
-
-                       internal Enumerator (object? values)
-                       {
-                               _state = 0;
-                               if (values is EnumerableValues valuesSet) {
-                                       _enumerator = valuesSet.GetEnumerator ();
-                                       _value = null;
-                               } else {
-                                       _enumerator = null;
-                                       _value = values;
-                               }
-                       }
-
-                       public TValue Current => _enumerator is not null
-                               ? _enumerator.Current
-                               : (_state == 1 ? (TValue) _value! : default!);
-
-                       object? IEnumerator.Current => Current;
-
-                       public void Dispose ()
-                       {
-                       }
-
-                       public bool MoveNext ()
-                       {
-                               if (_enumerator is not null)
-                                       return _enumerator.MoveNext ();
-
-                               if (_value is null)
-                                       return false;
-
-                               if (_state > 1)
-                                       return false;
-
-                               _state++;
-                               return _state == 1;
-                       }
-
-                       public void Reset ()
-                       {
-                               if (_enumerator is not null)
-                                       _enumerator.Reset ();
-                               else
-                                       _state = 0;
-                       }
-               }
-
-               // This stores the values. By far the most common case will be either no values, or a single value.
-               // Cases where there are multiple values stored are relatively very rare.
-               //   null - no values (empty set)
-               //   TValue - single value itself
-               //   EnumerableValues typed object - multiple values, stored in the hashset
-               private readonly object? _values;
-
-               public ValueSet (TValue value) => _values = value;
-
-               public ValueSet (IEnumerable<TValue> values) => _values = new EnumerableValues (values);
-
-               private ValueSet (EnumerableValues values) => _values = values;
-
-               public static implicit operator ValueSet<TValue> (TValue value) => new (value);
-
-               public override bool Equals (object? obj) => obj is ValueSet<TValue> other && Equals (other);
-
-               public bool Equals (ValueSet<TValue> other)
-               {
-                       if (_values == null)
-                               return other._values == null;
-                       if (other._values == null)
-                               return false;
-
-                       if (_values is EnumerableValues enumerableValues) {
-                               if (other._values is EnumerableValues otherValuesSet) {
-                                       return enumerableValues.SetEquals (otherValuesSet);
-                               } else
-                                       return false;
-                       } else {
-                               if (other._values is EnumerableValues) {
-                                       return false;
-                               }
-
-                               return EqualityComparer<TValue>.Default.Equals ((TValue) _values, (TValue) other._values);
-                       }
-               }
-
-               public override int GetHashCode ()
-               {
-                       if (_values == null)
-                               return typeof (ValueSet<TValue>).GetHashCode ();
-
-                       if (_values is EnumerableValues enumerableValues)
-                               return enumerableValues.GetHashCode ();
-
-                       return _values.GetHashCode ();
-               }
-
-               public Enumerator GetEnumerator () => new (_values);
-
-               IEnumerator<TValue> IEnumerable<TValue>.GetEnumerator () => GetEnumerator ();
-
-               IEnumerator IEnumerable.GetEnumerator () => GetEnumerator ();
-
-               public bool Contains (TValue value) => _values is null
-                       ? false
-                       : _values is EnumerableValues valuesSet
-                               ? valuesSet.Contains (value)
-                               : EqualityComparer<TValue>.Default.Equals (value, (TValue) _values);
-
-               internal static ValueSet<TValue> Meet (ValueSet<TValue> left, ValueSet<TValue> right)
-               {
-                       if (left._values == null)
-                               return right.Clone ();
-                       if (right._values == null)
-                               return left.Clone ();
-
-                       if (left._values is not EnumerableValues && right.Contains ((TValue) left._values))
-                               return right.Clone ();
-
-                       if (right._values is not EnumerableValues && left.Contains ((TValue) right._values))
-                               return left.Clone ();
-
-                       var values = new EnumerableValues (left.Clone ());
-                       values.UnionWith (right.Clone ());
-                       return new ValueSet<TValue> (values);
-               }
-
-               public bool IsEmpty () => _values == null;
-
-               public override string ToString ()
-               {
-                       StringBuilder sb = new ();
-                       sb.Append ('{');
-                       sb.Append (string.Join (",", this.Select (v => v.ToString ())));
-                       sb.Append ('}');
-                       return sb.ToString ();
-               }
-
-               // Meet should copy the values, but most SingleValues are immutable.
-               // Clone returns `this` if there are no mutable SingleValues (SingleValues that implement IDeepCopyValue), otherwise creates a new ValueSet with copies of the copiable Values
-               public ValueSet<TValue> Clone ()
-               {
-                       if (_values is null)
-                               return this;
-
-                       // Optimize for the most common case with only a single value
-                       if (_values is not EnumerableValues) {
-                               if (_values is IDeepCopyValue<TValue> copyValue)
-                                       return new ValueSet<TValue> (copyValue.DeepCopy ());
-                               else
-                                       return this;
-                       }
-
-                       return new ValueSet<TValue> (this.Select (value => value is IDeepCopyValue<TValue> copyValue ? copyValue.DeepCopy () : value));
-               }
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/DataFlow/ValueSetLattice.cs b/src/coreclr/tools/aot/ILLink.Shared/DataFlow/ValueSetLattice.cs
deleted file mode 100644 (file)
index 1acca95..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.DataFlow
-{
-       // A lattice over ValueSets where the Meet operation is just set union.
-       public readonly struct ValueSetLattice<TValue> : ILattice<ValueSet<TValue>>
-               where TValue : IEquatable<TValue>
-       {
-               public ValueSet<TValue> Top => default;
-
-               public ValueSet<TValue> Meet (ValueSet<TValue> left, ValueSet<TValue> right) => ValueSet<TValue>.Meet (left, right);
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/DiagnosticCategory.cs b/src/coreclr/tools/aot/ILLink.Shared/DiagnosticCategory.cs
deleted file mode 100644 (file)
index a1d1e11..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared
-{
-       internal static class DiagnosticCategory
-       {
-               public const string SingleFile = nameof (SingleFile);
-               public const string Trimming = nameof (Trimming);
-               public const string AOT = nameof (AOT);
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/DiagnosticId.cs b/src/coreclr/tools/aot/ILLink.Shared/DiagnosticId.cs
deleted file mode 100644 (file)
index 28f04ec..0000000
+++ /dev/null
@@ -1,239 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-using System;
-
-namespace ILLink.Shared
-{
-       public enum DiagnosticId
-       {
-               // Trimming error ids.
-               XmlFeatureDoesNotSpecifyFeatureValue = 1001,
-               XmlUnsupportedNonBooleanValueForFeature = 1002,
-               XmlException = 1003,
-               _unused_FailedToProcessDescriptorFile = 1004,
-               CouldNotFindMethodInAssembly = 1005,
-               CannotStubConstructorWhenBaseTypeDoesNotHaveConstructor = 1006,
-               CouldNotFindType = 1007,
-               CouldNotFindConstructor = 1008,
-               CouldNotFindAssemblyReference = 1009,
-               CouldNotLoadAssembly = 1010,
-               FailedToWriteOutput = 1011,
-               LinkerUnexpectedError = 1012,
-               ErrorProcessingXmlLocation = 1013,
-               XmlDocumentLocationHasInvalidFeatureDefault = 1014,
-               UnrecognizedCommandLineOption = 1015,
-               InvalidWarningVersion = 1016,
-               InvalidGenerateWarningSuppressionsValue = 1017,
-               MissingArgumentForCommanLineOptionName = 1018,
-               CustomDataFormatIsInvalid = 1019,
-               NoFilesToLinkSpecified = 1020,
-               NewMvidAndDeterministicCannotBeUsedAtSameTime = 1021,
-               AssemblyInCustomStepOptionCouldNotBeFound = 1022,
-               AssemblyPathInCustomStepMustBeFullyQualified = 1023,
-               InvalidArgForCustomStep = 1024,
-               ExpectedSignToControlNewStepInsertion = 1025,
-               PipelineStepCouldNotBeFound = 1026,
-               CustomStepTypeCouldNotBeFound = 1027,
-               CustomStepTypeIsIncompatibleWithLinkerVersion = 1028,
-               InvalidOptimizationValue = 1029,
-               InvalidArgumentForTokenOption = 1030,
-               InvalidAssemblyAction = 1031,
-               RootAssemblyCouldNotBeFound = 1032,
-               XmlDescriptorCouldNotBeFound = 1033,
-               RootAssemblyDoesNotHaveEntryPoint = 1034,
-               RootAssemblyCannotUseAction = 1035,
-               InvalidAssemblyName = 1036,
-               InvalidAssemblyRootMode = 1037,
-               ExportedTypeCannotBeResolved = 1038,
-               ReferenceAssemblyCouldNotBeLoaded = 1039,
-               FailedToResolveMetadataElement = 1040,
-               TypeUsedWithAttributeValueCouldNotBeFound = 1041,
-               CannotConverValueToType = 1042,
-               CustomAttributeArgumentForTypeRequiresNestedNode = 1043,
-               CouldNotResolveCustomAttributeTypeValue = 1044,
-               UnexpectedAttributeArgumentType = 1045,
-               InvalidMetadataOption = 1046,
-               InvalidDependenciesFileFormat = 1047,
-
-               // Trimming diagnostic ids.
-               TypeHasNoFieldsToPreserve = 2001,
-               TypeHasNoMethodsToPreserve = 2002,
-               CouldNotResolveDependencyAssembly = 2003,
-               CouldNotResolveDependencyType = 2004,
-               CouldNotResolveDependencyMember = 2005,
-               _unused_UnrecognizedReflectionPattern = 2006,
-               XmlCouldNotResolveAssembly = 2007,
-               XmlCouldNotResolveType = 2008,
-               XmlCouldNotFindMethodOnType = 2009,
-               XmlInvalidValueForStub = 2010,
-               XmlUnkownBodyModification = 2011,
-               XmlCouldNotFindFieldOnType = 2012,
-               XmlSubstitutedFieldNeedsToBeStatic = 2013,
-               XmlMissingSubstitutionValueForField = 2014,
-               XmlInvalidSubstitutionValueForField = 2015,
-               XmlCouldNotFindEventOnType = 2016,
-               XmlCouldNotFindPropertyOnType = 2017,
-               XmlCouldNotFindGetAccesorOfPropertyOnType = 2018,
-               XmlCouldNotFindSetAccesorOfPropertyOnType = 2019,
-               _unused_RearrangedXmlWarning1 = 2020,
-               _unused_RearrangedXmlWarning2 = 2021,
-               XmlCouldNotFindMatchingConstructorForCustomAttribute = 2022,
-               XmlMoreThanOneReturnElementForMethod = 2023,
-               XmlMoreThanOneValyForParameterOfMethod = 2024,
-               _unused_XmlDuplicatePreserveMember = 2025,
-               RequiresUnreferencedCode = 2026,
-               AttributeShouldOnlyBeUsedOnceOnMember = 2027,
-               AttributeDoesntHaveTheRequiredNumberOfParameters = 2028,
-               XmlElementDoesNotContainRequiredAttributeFullname = 2029,
-               XmlCouldNotResolveAssemblyForAttribute = 2030,
-               XmlAttributeTypeCouldNotBeFound = 2031,
-               UnrecognizedParameterInMethodCreateInstance = 2032,
-               DeprecatedPreserveDependencyAttribute = 2033,
-               DynamicDependencyAttributeCouldNotBeAnalyzed = 2034,
-               UnresolvedAssemblyInDynamicDependencyAttribute = 2035,
-               UnresolvedTypeInDynamicDependencyAttribute = 2036,
-               NoMembersResolvedForMemberSignatureOrType = 2037,
-               XmlMissingNameAttributeInResource = 2038,
-               XmlInvalidValueForAttributeActionForResource = 2039,
-               XmlCouldNotFindResourceToRemoveInAssembly = 2040,
-               DynamicallyAccessedMembersIsNotAllowedOnMethods = 2041,
-               DynamicallyAccessedMembersCouldNotFindBackingField = 2042,
-               DynamicallyAccessedMembersConflictsBetweenPropertyAndAccessor = 2043,
-               XmlCouldNotFindAnyTypeInNamespace = 2044,
-               AttributeIsReferencedButTrimmerRemoveAllInstances = 2045,
-               RequiresUnreferencedCodeAttributeMismatch = 2046,
-               _unused_DynamicallyAccessedMembersMismatchBetweenOverrides = 2047,
-               XmlRemoveAttributeInstancesCanOnlyBeUsedOnType = 2048,
-               UnrecognizedInternalAttribute = 2049,
-               CorrectnessOfCOMCannotBeGuaranteed = 2050,
-               XmlPropertyDoesNotContainAttributeName = 2051,
-               XmlCouldNotFindProperty = 2052,
-               _unused_XmlInvalidPropertyValueForProperty = 2053,
-               _unused_XmlInvalidArgumentForParameterOfType = 2054,
-               MakeGenericType = 2055,
-               DynamicallyAccessedMembersOnPropertyConflictsWithBackingField = 2056,
-               UnrecognizedTypeNameInTypeGetType = 2057,
-               ParametersOfAssemblyCreateInstanceCannotBeAnalyzed = 2058,
-               UnrecognizedTypeInRuntimeHelpersRunClassConstructor = 2059,
-               MakeGenericMethod = 2060,
-               UnresolvedAssemblyInCreateInstance = 2061,
-
-               // Unknown value used in a place which requires annotation
-               MethodParameterCannotBeStaticallyDetermined = 2062,
-               MethodReturnValueCannotBeStaticallyDetermined = 2063,
-               FieldValueCannotBeStaticallyDetermined = 2064,
-               ImplicitThisCannotBeStaticallyDetermined = 2065,
-               TypePassedToGenericParameterCannotBeStaticallyDetermined = 2066,
-
-               // Dynamically Accessed Members attribute mismatch.
-               DynamicallyAccessedMembersMismatchParameterTargetsParameter = 2067,
-               DynamicallyAccessedMembersMismatchParameterTargetsMethodReturnType = 2068,
-               DynamicallyAccessedMembersMismatchParameterTargetsField = 2069,
-               DynamicallyAccessedMembersMismatchParameterTargetsThisParameter = 2070,
-               DynamicallyAccessedMembersMismatchParameterTargetsGenericParameter = 2071,
-               DynamicallyAccessedMembersMismatchMethodReturnTypeTargetsParameter = 2072,
-               DynamicallyAccessedMembersMismatchMethodReturnTypeTargetsMethodReturnType = 2073,
-               DynamicallyAccessedMembersMismatchMethodReturnTypeTargetsField = 2074,
-               DynamicallyAccessedMembersMismatchMethodReturnTypeTargetsThisParameter = 2075,
-               DynamicallyAccessedMembersMismatchMethodReturnTypeTargetsGenericParameter = 2076,
-               DynamicallyAccessedMembersMismatchFieldTargetsParameter = 2077,
-               DynamicallyAccessedMembersMismatchFieldTargetsMethodReturnType = 2078,
-               DynamicallyAccessedMembersMismatchFieldTargetsField = 2079,
-               DynamicallyAccessedMembersMismatchFieldTargetsThisParameter = 2080,
-               DynamicallyAccessedMembersMismatchFieldTargetsGenericParameter = 2081,
-               DynamicallyAccessedMembersMismatchThisParameterTargetsParameter = 2082,
-               DynamicallyAccessedMembersMismatchThisParameterTargetsMethodReturnType = 2083,
-               DynamicallyAccessedMembersMismatchThisParameterTargetsField = 2084,
-               DynamicallyAccessedMembersMismatchThisParameterTargetsThisParameter = 2085,
-               DynamicallyAccessedMembersMismatchThisParameterTargetsGenericParameter = 2086,
-               DynamicallyAccessedMembersMismatchTypeArgumentTargetsParameter = 2087,
-               DynamicallyAccessedMembersMismatchTypeArgumentTargetsMethodReturnType = 2088,
-               DynamicallyAccessedMembersMismatchTypeArgumentTargetsField = 2089,
-               DynamicallyAccessedMembersMismatchTypeArgumentTargetsThisParameter = 2090,
-               DynamicallyAccessedMembersMismatchTypeArgumentTargetsGenericParameter = 2091,
-               DynamicallyAccessedMembersMismatchOnMethodParameterBetweenOverrides = 2092,
-               DynamicallyAccessedMembersMismatchOnMethodReturnValueBetweenOverrides = 2093,
-               DynamicallyAccessedMembersMismatchOnImplicitThisBetweenOverrides = 2094,
-               DynamicallyAccessedMembersMismatchOnGenericParameterBetweenOverrides = 2095,
-
-               CaseInsensitiveTypeGetTypeCallIsNotSupported = 2096,
-               DynamicallyAccessedMembersOnFieldCanOnlyApplyToTypesOrStrings = 2097,
-               DynamicallyAccessedMembersOnMethodParameterCanOnlyApplyToTypesOrStrings = 2098,
-               DynamicallyAccessedMembersOnPropertyCanOnlyApplyToTypesOrStrings = 2099,
-               XmlUnsuportedWildcard = 2100,
-               AssemblyWithEmbeddedXmlApplyToAnotherAssembly = 2101,
-               InvalidIsTrimmableValue = 2102,
-               PropertyAccessorParameterInLinqExpressionsCannotBeStaticallyDetermined = 2103,
-               AssemblyProducedTrimWarnings = 2104,
-               TypeWasNotFoundInAssemblyNorBaseLibrary = 2105,
-               DynamicallyAccessedMembersOnMethodReturnValueCanOnlyApplyToTypesOrStrings = 2106,
-               MethodsAreAssociatedWithStateMachine = 2107,
-               InvalidScopeInUnconditionalSuppressMessage = 2108,
-               RequiresUnreferencedCodeOnBaseClass = 2109,
-               DynamicallyAccessedMembersFieldAccessedViaReflection = 2110,
-               DynamicallyAccessedMembersMethodAccessedViaReflection = 2111,
-               DynamicallyAccessedMembersOnTypeReferencesMemberWithRequiresUnreferencedCode = 2112,
-               DynamicallyAccessedMembersOnTypeReferencesMemberOnBaseWithRequiresUnreferencedCode = 2113,
-               DynamicallyAccessedMembersOnTypeReferencesMemberWithDynamicallyAccessedMembers = 2114,
-               DynamicallyAccessedMembersOnTypeReferencesMemberOnBaseWithDynamicallyAccessedMembers = 2115,
-               RequiresUnreferencedCodeOnStaticConstructor = 2116,
-               MethodsAreAssociatedWithUserMethod = 2117,
-               CompilerGeneratedMemberAccessedViaReflection = 2118,
-               DynamicallyAccessedMembersOnTypeReferencesCompilerGeneratedMember = 2119,
-               DynamicallyAccessedMembersOnTypeReferencesCompilerGeneratedMemberOnBase = 2120,
-               RedundantSuppression = 2121,
-
-               // Single-file diagnostic ids.
-               AvoidAssemblyLocationInSingleFile = 3000,
-               AvoidAssemblyGetFilesInSingleFile = 3001,
-               RequiresAssemblyFiles = 3002,
-               RequiresAssemblyFilesAttributeMismatch = 3003,
-               RequiresAssemblyFilesOnStaticConstructor = 3004,
-
-               // Dynamic code diagnostic ids.
-               RequiresDynamicCode = 3050,
-               RequiresDynamicCodeAttributeMismatch = 3051,
-               COMInteropNotSupportedInFullAOT = 3052,
-               AssemblyProducedAOTWarnings = 3053,
-               GenericRecursionCycle = 3054,
-               CorrectnessOfAbstractDelegatesCannotBeGuaranteed = 3055,
-               RequiresDynamicCodeOnStaticConstructor = 3056,
-       }
-
-       public static class DiagnosticIdExtensions
-       {
-               public static string AsString (this DiagnosticId diagnosticId) => $"IL{(int) diagnosticId}";
-
-               public static string GetDiagnosticSubcategory (this DiagnosticId diagnosticId) =>
-                       (int) diagnosticId switch {
-                               2026 => MessageSubCategory.TrimAnalysis,
-                               2032 => MessageSubCategory.TrimAnalysis,
-                               2041 => MessageSubCategory.TrimAnalysis,
-                               2042 => MessageSubCategory.TrimAnalysis,
-                               2043 => MessageSubCategory.TrimAnalysis,
-                               2045 => MessageSubCategory.TrimAnalysis,
-                               2046 => MessageSubCategory.TrimAnalysis,
-                               2050 => MessageSubCategory.TrimAnalysis,
-                               >= 2055 and <= 2099 => MessageSubCategory.TrimAnalysis,
-                               2103 => MessageSubCategory.TrimAnalysis,
-                               2106 => MessageSubCategory.TrimAnalysis,
-                               2107 => MessageSubCategory.TrimAnalysis,
-                               >= 2109 and <= 2121 => MessageSubCategory.TrimAnalysis,
-                               >= 3050 and <= 3052 => MessageSubCategory.AotAnalysis,
-                               >= 3054 and <= 3055 => MessageSubCategory.AotAnalysis,
-                               _ => MessageSubCategory.None,
-                       };
-
-               public static string GetDiagnosticCategory (this DiagnosticId diagnosticId) =>
-                       (int) diagnosticId switch {
-                               > 2000 and < 3000 => DiagnosticCategory.Trimming,
-                               >= 3000 and < 3050 => DiagnosticCategory.SingleFile,
-                               >= 3050 and <= 6000 => DiagnosticCategory.AOT,
-                               _ => throw new ArgumentException ($"The provided diagnostic id '{diagnosticId}' does not fall into the range of supported warning codes 2001 to 6000 (inclusive).")
-                       };
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/DiagnosticString.cs b/src/coreclr/tools/aot/ILLink.Shared/DiagnosticString.cs
deleted file mode 100644 (file)
index ce505e1..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared
-{
-       public readonly struct DiagnosticString
-       {
-               private readonly string _titleFormat;
-               private readonly string _messageFormat;
-
-               public DiagnosticString (DiagnosticId diagnosticId)
-               {
-                       var resourceManager = SharedStrings.ResourceManager;
-                       _titleFormat = resourceManager.GetString ($"{diagnosticId}Title") ?? throw new InvalidOperationException ($"{diagnosticId} does not have a matching resource called {diagnosticId}Title");
-                       _messageFormat = resourceManager.GetString ($"{diagnosticId}Message") ?? throw new InvalidOperationException ($"{diagnosticId} does not have a matching resource called {diagnosticId}Message");
-               }
-
-               public DiagnosticString (string diagnosticResourceStringName)
-               {
-                       var resourceManager = SharedStrings.ResourceManager;
-                       _titleFormat = resourceManager.GetString ($"{diagnosticResourceStringName}Title") ?? throw new InvalidOperationException ($"{diagnosticResourceStringName} does not have a matching resource called {diagnosticResourceStringName}Title");
-                       _messageFormat = resourceManager.GetString ($"{diagnosticResourceStringName}Message") ?? throw new InvalidOperationException ($"{diagnosticResourceStringName} does not have a matching resource called {diagnosticResourceStringName}Message");
-               }
-
-               public string GetMessage (params string[] args) =>
-                       string.Format (_messageFormat, args);
-
-               public string GetMessageFormat () => _messageFormat;
-
-               public string GetTitle (params string[] args) =>
-                       string.Format (_titleFormat, args);
-
-               public string GetTitleFormat () => _titleFormat;
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/Directory.Build.props b/src/coreclr/tools/aot/ILLink.Shared/Directory.Build.props
deleted file mode 100644 (file)
index ea6a629..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<Project>
-  <Import Project="..\Directory.Build.props" />
-  <ItemGroup>
-    <EditorConfigFiles Include=".editorconfig" />
-  </ItemGroup>
-</Project>
diff --git a/src/coreclr/tools/aot/ILLink.Shared/HashUtils.cs b/src/coreclr/tools/aot/ILLink.Shared/HashUtils.cs
deleted file mode 100644 (file)
index 9a265ed..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-#if !NETSTANDARD2_0
-using System;
-#endif
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared
-{
-       internal static class HashUtils
-       {
-#if NETSTANDARD2_0
-               // This constant is taken from code that Roslyn generates for GetHashCode of records.
-               const int Multiplier = -1521134295;
-#endif
-               public static int Combine<T1, T2> (T1 value1, T2 value2)
-                       where T1 : notnull
-                       where T2 : notnull
-               {
-#if NETSTANDARD2_0
-                       return value1.GetHashCode () * Multiplier + value2.GetHashCode ();
-#else
-                       return HashCode.Combine (value1, value2);
-#endif
-               }
-
-               public static int Combine<T1, T2, T3> (T1 value1, T2 value2, T3 value3)
-                       where T1 : notnull
-                       where T2 : notnull
-                       where T3 : notnull
-               {
-#if NETSTANDARD2_0
-                       return (value1.GetHashCode () * Multiplier + value2.GetHashCode ()) * Multiplier + value3.GetHashCode ();
-#else
-                       return HashCode.Combine (value1, value2, value3);
-#endif
-               }
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/ILLink.LinkAttributes.xsd b/src/coreclr/tools/aot/ILLink.Shared/ILLink.LinkAttributes.xsd
deleted file mode 100644 (file)
index e6c2185..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<xsd:schema attributeFormDefault="unqualified"
-               elementFormDefault="unqualified"
-               xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-
-       <xsd:complexType name="membertype">
-               <xsd:choice maxOccurs="unbounded" minOccurs="0">
-                       <xsd:element name="attribute" type="attribute" />
-               </xsd:choice>
-               <xsd:attribute name="feature" />
-               <xsd:attribute name="featurevalue" type="xsd:boolean" />
-               <xsd:attribute name="featuredefault" type="xsd:boolean" />
-               <xsd:attribute name="name" />
-               <xsd:attribute name="signature" />
-       </xsd:complexType>
-
-       <xsd:complexType name="method">
-               <xsd:complexContent>
-                       <xsd:extension base="membertype">
-                               <xsd:choice maxOccurs="unbounded" minOccurs="0">
-                                       <xsd:choice maxOccurs="unbounded" minOccurs="0">
-                                               <xsd:element name="parameter">
-                                                       <xsd:complexType>
-                                                               <xsd:choice maxOccurs="unbounded" minOccurs="0">
-                                                                       <xsd:element name="attribute" type="attribute" />
-                                                               </xsd:choice>
-                                                               <xsd:attribute name="name" use="required" />
-                                                       </xsd:complexType>
-                                               </xsd:element>
-                                       </xsd:choice>
-                                       <xsd:choice maxOccurs="1" minOccurs="0">
-                                               <xsd:element name="return">
-                                                       <xsd:complexType>
-                                                               <xsd:choice maxOccurs="unbounded" minOccurs="0">
-                                                                       <xsd:element name="attribute" type="attribute" />
-                                                               </xsd:choice>
-                                                       </xsd:complexType>
-                                               </xsd:element>
-                                       </xsd:choice>
-                               </xsd:choice>
-                       </xsd:extension>
-               </xsd:complexContent>
-       </xsd:complexType>
-
-       <xsd:complexType name="argument" mixed="true">
-               <xsd:choice minOccurs="0" maxOccurs="unbounded">
-                       <xsd:element name="argument" type="argument" />
-               </xsd:choice>
-               <xsd:attribute name="type" />
-       </xsd:complexType>
-
-       <xsd:complexType name="attribute">
-               <xsd:choice maxOccurs="unbounded" minOccurs="0">
-                       <xsd:element name="argument" type="argument" />
-                       <xsd:element name="property">
-                               <xsd:complexType mixed="true">
-                                       <xsd:attribute name="name" use="required" />
-                               </xsd:complexType>
-                       </xsd:element>
-               </xsd:choice>
-               <xsd:attribute name="internal" />
-               <xsd:attribute name="fullname" />
-               <xsd:attribute name="assembly" />
-       </xsd:complexType>
-
-       <xsd:complexType name="assembly">
-               <xsd:choice maxOccurs="unbounded" minOccurs="0">
-                       <xsd:element name="attribute" type="attribute" />
-                       <xsd:element name="type" type="type" />
-               </xsd:choice>
-               <xsd:attribute name="fullname" use="required" />
-               <xsd:attribute name="feature" />
-               <xsd:attribute name="featurevalue" type="xsd:boolean" />
-               <xsd:attribute name="featuredefault" type="xsd:boolean" />
-       </xsd:complexType>
-
-       <xsd:complexType name ="nestedtype">
-               <xsd:choice minOccurs="0" maxOccurs="unbounded">
-                       <xsd:element name="event" type="membertype" />
-                       <xsd:element name="method" type="method" />
-                       <xsd:element name="field" type="membertype" />
-                       <xsd:element name="property" type="membertype" />
-                       <xsd:element name="attribute" type="attribute" />
-                       <xsd:element name="type" type="nestedtype" />
-               </xsd:choice>
-               <xsd:attribute name="name" use="required"/>
-               <xsd:attribute name="feature" />
-               <xsd:attribute name="featurevalue" type="xsd:boolean" />
-               <xsd:attribute name="featuredefault" type="xsd:boolean" />
-       </xsd:complexType>
-
-       <xsd:complexType name="type">
-               <xsd:choice maxOccurs="unbounded" minOccurs="0">
-                       <xsd:element name="attribute" type="attribute" />
-                       <xsd:element name="event" type="membertype" />
-                       <xsd:element name="method" type="method" />
-                       <xsd:element name="field" type="membertype" />
-                       <xsd:element name="property" type="membertype" />
-                       <xsd:element name="type" type="nestedtype"/>
-               </xsd:choice>
-               <xsd:attribute name="feature" />
-               <xsd:attribute name="featurevalue" type="xsd:boolean" />
-               <xsd:attribute name="featuredefault" type="xsd:boolean" />
-               <xsd:attribute name="fullname" use="required"/>
-       </xsd:complexType>
-
-       <xsd:element name="linker">
-               <xsd:complexType>
-                       <xsd:choice maxOccurs="unbounded" minOccurs="0">
-                               <xsd:element name="assembly" type="assembly" />
-                               <xsd:element name="type" type="type" />
-                       </xsd:choice>
-               </xsd:complexType>
-       </xsd:element>
-
-</xsd:schema>
\ No newline at end of file
diff --git a/src/coreclr/tools/aot/ILLink.Shared/ILLink.Shared.projitems b/src/coreclr/tools/aot/ILLink.Shared/ILLink.Shared.projitems
deleted file mode 100644 (file)
index 8b16e37..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <MSBuildAllProjects Condition="'$(MSBuildVersion)' == '' Or '$(MSBuildVersion)' &lt; '16.0'">$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
-    <HasSharedItems>true</HasSharedItems>
-    <SharedGUID>92f5e753-2179-46dc-bdce-736858c18dc7</SharedGUID>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration">
-    <Import_RootNamespace>ILLink.Shared</Import_RootNamespace>
-  </PropertyGroup>
-  <ItemGroup>
-    <Compile Include="$(MSBuildThisFileDirectory)/**/*.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="$(MSBuildThisFileDirectory)SharedStrings.resx">
-      <GenerateSource>true</GenerateSource>
-      <Namespace>ILLink.Shared</Namespace>
-      <SubType>Designer</SubType>
-    </EmbeddedResource>
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="$(MSBuildThisFileDirectory)ILLink.LinkAttributes.xsd">
-      <SubType>Designer</SubType>
-    </None>
-  </ItemGroup>
-</Project>
diff --git a/src/coreclr/tools/aot/ILLink.Shared/ILLink.Shared.shproj b/src/coreclr/tools/aot/ILLink.Shared/ILLink.Shared.shproj
deleted file mode 100644 (file)
index a581f2f..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{FF598E93-8E9E-4091-9F50-61A7572663AE}</ProjectGuid>
-    <MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
-  </PropertyGroup>
-  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
-  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" />
-  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" />
-  <PropertyGroup />
-  <Import Project="ILLink.Shared.projitems" Label="Shared" />
-  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" />
-</Project>
\ No newline at end of file
diff --git a/src/coreclr/tools/aot/ILLink.Shared/IsExternalInit.cs b/src/coreclr/tools/aot/ILLink.Shared/IsExternalInit.cs
deleted file mode 100644 (file)
index c95d5f7..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-#if NETSTANDARD
-// Allow use of init setters on downlevel frameworks.
-namespace System.Runtime.CompilerServices
-{
-       public sealed class IsExternalInit
-       {
-       }
-}
-#endif
diff --git a/src/coreclr/tools/aot/ILLink.Shared/MessageFormat.cs b/src/coreclr/tools/aot/ILLink.Shared/MessageFormat.cs
deleted file mode 100644 (file)
index 0e67c71..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared
-{
-       internal static class MessageFormat
-       {
-               public static string FormatRequiresAttributeMessageArg (string? message)
-               {
-                       if (!string.IsNullOrEmpty (message))
-                               return $" {message}{(message!.TrimEnd ().EndsWith (".") ? "" : ".")}";
-
-                       return string.Empty;
-               }
-
-               public static string FormatRequiresAttributeUrlArg (string? url)
-               {
-                       if (!string.IsNullOrEmpty (url))
-                               return $" {url}";
-
-                       return string.Empty;
-               }
-
-               public static string FormatRequiresAttributeMismatch (bool memberHasAttribute, bool isInterface, params object[] args)
-               {
-                       string format = (memberHasAttribute, isInterface) switch {
-                               (false, true) => SharedStrings.InterfaceRequiresMismatchMessage,
-                               (true, true) => SharedStrings.ImplementationRequiresMismatchMessage,
-                               (false, false) => SharedStrings.BaseRequiresMismatchMessage,
-                               (true, false) => SharedStrings.DerivedRequiresMismatchMessage
-                       };
-
-                       return string.Format (format, args);
-               }
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/MessageSubCategory.cs b/src/coreclr/tools/aot/ILLink.Shared/MessageSubCategory.cs
deleted file mode 100644 (file)
index 4b47d26..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared
-{
-       public static class MessageSubCategory
-       {
-               public const string None = "";
-               public const string TrimAnalysis = "Trim analysis";
-               public const string UnresolvedAssembly = "Unresolved assembly";
-               public const string AotAnalysis = "AOT analysis";
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/ParameterIndex.cs b/src/coreclr/tools/aot/ILLink.Shared/ParameterIndex.cs
deleted file mode 100644 (file)
index 7a6ea68..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System.Diagnostics.CodeAnalysis;
-
-#nullable enable
-
-namespace ILLink.Shared.TypeSystemProxy
-{
-       /// <summary>
-       /// Used to indicate the index of the parameter in the Parameters metadata section (i.e. the first parameter that is not the implicit 'this' is 0)
-       /// It is very error prone to use an int to represent the index in parameters metadata section / source code parameter index as well as for indexing into argument lists.
-       /// Instead, use this struct whenever representing an index of a parameter.
-       /// </summary>
-       /// <example>
-       /// In a call to a non-static function Foo(int a, int b, int c)
-       /// 0 refers to 'this'
-       /// 1 refers to a,
-       /// 2 refers to b,
-       /// 3 refers to c.
-       /// In a call to a static extension function Foo(this Bar a, int b, int c)
-       /// 0 refers to "this Bar a"
-       /// 1 refers to b,
-       /// 2 refers to c.
-       /// In a call to a static function Foo(int a, int b, int c)
-       /// 0 refers to a,
-       /// 1 refers to b,
-       /// 2 refers to c.
-       /// </example>
-       public readonly struct ParameterIndex : System.IEquatable<ParameterIndex>
-       {
-               public readonly int Index;
-
-               public ParameterIndex (int x)
-                       => Index = x;
-
-               public static bool operator == (ParameterIndex left, ParameterIndex right) => left.Index == right.Index;
-
-               public static bool operator != (ParameterIndex left, ParameterIndex right) => left.Index != right.Index;
-
-               public static ParameterIndex operator ++ (ParameterIndex val) => new ParameterIndex (val.Index + 1);
-
-               public override bool Equals ([NotNullWhen (true)] object? obj)
-                       => obj is ParameterIndex other && Index == other.Index;
-
-               public bool Equals (ParameterIndex other)
-                       => Index == other.Index;
-
-               public override int GetHashCode () => Index.GetHashCode ();
-
-               public static explicit operator ParameterIndex (int x)
-                       => new ParameterIndex (x);
-
-               public static explicit operator int (ParameterIndex x)
-                       => x.Index;
-               public static ParameterIndex operator + (ParameterIndex left, ParameterIndex right)
-                       => new ParameterIndex (left.Index + right.Index);
-
-               public static ParameterIndex operator - (ParameterIndex left, ParameterIndex right)
-                       => new ParameterIndex (left.Index - right.Index);
-
-               public static ParameterIndex operator + (ParameterIndex left, int right)
-                       => new ParameterIndex (left.Index + right);
-
-               public static ParameterIndex operator - (ParameterIndex left, int right)
-                       => new ParameterIndex (left.Index - right);
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/README.md b/src/coreclr/tools/aot/ILLink.Shared/README.md
deleted file mode 100644 (file)
index ddd835b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Sources taken from https://github.com/dotnet/linker/tree/6aaa900a0b1268fe4a6ce3e8af4678e84ea154fd/src/ILLink.Shared.
diff --git a/src/coreclr/tools/aot/ILLink.Shared/SharedStrings.resx b/src/coreclr/tools/aot/ILLink.Shared/SharedStrings.resx
deleted file mode 100644 (file)
index fdb0491..0000000
+++ /dev/null
@@ -1,1200 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
-  <!--
-    Microsoft ResX Schema
-
-    Version 2.0
-
-    The primary goals of this format is to allow a simple XML format
-    that is mostly human readable. The generation and parsing of the
-    various data types are done through the TypeConverter classes
-    associated with the data types.
-
-    Example:
-
-    ... ado.net/XML headers & schema ...
-    <resheader name="resmimetype">text/microsoft-resx</resheader>
-    <resheader name="version">2.0</resheader>
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
-        <value>[base64 mime encoded serialized .NET Framework object]</value>
-    </data>
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
-        <comment>This is a comment</comment>
-    </data>
-
-    There are any number of "resheader" rows that contain simple
-    name/value pairs.
-
-    Each data row contains a name, and value. The row also contains a
-    type or mimetype. Type corresponds to a .NET class that support
-    text/value conversion through the TypeConverter architecture.
-    Classes that don't support this are serialized and stored with the
-    mimetype set.
-
-    The mimetype is used for serialized objects, and tells the
-    ResXResourceReader how to depersist the object. This is currently not
-    extensible. For a given mimetype the value must be set accordingly
-
-    Note - application/x-microsoft.net.object.binary.base64 is the format
-    that the ResXResourceWriter will generate, however the reader can
-    read any of the formats listed below.
-
-    mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with
-            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array
-            : using a System.ComponentModel.TypeConverter
-            : and then encoded with base64 encoding.
-    -->
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
-    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
-    <xsd:element name="root" msdata:IsDataSet="true">
-      <xsd:complexType>
-        <xsd:choice maxOccurs="unbounded">
-          <xsd:element name="metadata">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />
-              </xsd:sequence>
-              <xsd:attribute name="name" use="required" type="xsd:string" />
-              <xsd:attribute name="type" type="xsd:string" />
-              <xsd:attribute name="mimetype" type="xsd:string" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="assembly">
-            <xsd:complexType>
-              <xsd:attribute name="alias" type="xsd:string" />
-              <xsd:attribute name="name" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="data">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="resheader">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" />
-            </xsd:complexType>
-          </xsd:element>
-        </xsd:choice>
-      </xsd:complexType>
-    </xsd:element>
-  </xsd:schema>
-  <resheader name="resmimetype">
-    <value>text/microsoft-resx</value>
-  </resheader>
-  <resheader name="version">
-    <value>2.0</value>
-  </resheader>
-  <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <data name="XmlFeatureDoesNotSpecifyFeatureValueTitle" xml:space="preserve">
-    <value>An Xml Feature does not specify a 'featurevalue' attribute.</value>
-  </data>
-  <data name="XmlFeatureDoesNotSpecifyFeatureValueMessage" xml:space="preserve">
-    <value>Failed to process '{0}'. Feature '{1}' does not specify a 'featurevalue' attribute.</value>
-  </data>
-  <data name="XmlUnsupportedNonBooleanValueForFeatureTitle" xml:space="preserve">
-    <value>Feature definition has to be a boolean.</value>
-  </data>
-  <data name="XmlUnsupportedNonBooleanValueForFeatureMessage" xml:space="preserve">
-    <value>Failed to process '{0}'. Unsupported non-boolean feature definition '{1}'.</value>
-  </data>
-  <data name="XmlExceptionTitle" xml:space="preserve">
-    <value>An exception was thrown while processing the xml file.</value>
-  </data>
-  <data name="XmlExceptionMessage" xml:space="preserve">
-    <value>Error processing '{0}': {1}.</value>
-  </data>
-  <data name="CouldNotFindMethodInAssemblyTitle" xml:space="preserve">
-    <value>An error ocurred while processing a method in assembly.</value>
-  </data>
-  <data name="CouldNotFindMethodInAssemblyMessage" xml:space="preserve">
-    <value>Error processing method '{0}' in assembly '{1}'.</value>
-  </data>
-  <data name="CannotStubConstructorWhenBaseTypeDoesNotHaveConstructorTitle" xml:space="preserve">
-    <value>Cannot stub constructor of a type when base type does not have default constructor. Constructors of derived types marked for substitution require to have a default constructor in its base type.</value>
-  </data>
-  <data name="CannotStubConstructorWhenBaseTypeDoesNotHaveConstructorMessage" xml:space="preserve">
-    <value>Cannot stub constructor on '{0}' when base type does not have default constructor.</value>
-  </data>
-  <data name="CouldNotFindTypeTitle" xml:space="preserve">
-    <value>Could not find predefined type".</value>
-  </data>
-  <data name="CouldNotFindTypeMessage" xml:space="preserve">
-    <value>Missing predefined '{0}' type".</value>
-  </data>
-  <data name="CouldNotFindConstructorTitle" xml:space="preserve">
-    <value>Could not find constructor.</value>
-  </data>
-  <data name="CouldNotFindConstructorMessage" xml:space="preserve">
-    <value>Could not find constructor on '{0}'.</value>
-  </data>
-  <data name="CouldNotFindAssemblyReferenceTitle" xml:space="preserve">
-    <value>Assembly reference could not be resolved.</value>
-  </data>
-  <data name="CouldNotFindAssemblyReferenceMessage" xml:space="preserve">
-    <value>Assembly reference '{0}' could not be resolved.</value>
-  </data>
-  <data name="CouldNotLoadAssemblyTitle" xml:space="preserve">
-    <value>Assembly cannot be loaded due to failure in processing the reference assembly.</value>
-  </data>
-  <data name="CouldNotLoadAssemblyMessage" xml:space="preserve">
-    <value>Assembly '{0}' cannot be loaded due to failure in processing '{1}' reference</value>
-  </data>
-  <data name="FailedToWriteOutputTitle" xml:space="preserve">
-    <value>There was an error writing the linked assembly 'output'.</value>
-  </data>
-  <data name="FailedToWriteOutputMessage" xml:space="preserve">
-    <value>Failed to write '{0}'.</value>
-  </data>
-  <data name="LinkerUnexpectedErrorTitle" xml:space="preserve">
-    <value>There was an unexpected error while trimming. An exception with more details is printed to the MSBuild log. Please share this stack trace with the IL Linker team to further investigate the cause and possible solution.</value>
-  </data>
-  <data name="LinkerUnexpectedErrorMessage" xml:space="preserve">
-    <value>IL Trimmer has encountered an unexpected error. Please report the issue at https://aka.ms/report-illink</value>
-  </data>
-  <data name="ErrorProcessingXmlLocationTitle" xml:space="preserve">
-    <value>There was an error processing 'XML document location' xml file. The most likely reason for this is that the XML file has syntactical errors.</value>
-  </data>
-  <data name="ErrorProcessingXmlLocationMessage" xml:space="preserve">
-    <value>Error processing '{0}'.</value>
-  </data>
-  <data name="XmlDocumentLocationHasInvalidFeatureDefaultTitle" xml:space="preserve">
-    <value>Element in XML document contains a 'featuredefault' attribute with an invalid value.</value>
-  </data>
-  <data name="XmlDocumentLocationHasInvalidFeatureDefaultMessage" xml:space="preserve">
-    <value>Failed to process '{0}'. Unsupported value for featuredefault attribute.</value>
-  </data>
-  <data name="UnrecognizedCommandLineOptionTitle" xml:space="preserve">
-    <value>The string passed to the command-line does not correspond to a valid command-line option.</value>
-  </data>
-  <data name="UnrecognizedCommandLineOptionMessage" xml:space="preserve">
-    <value>Unrecognized command-line option: '{0}'.</value>
-  </data>
-  <data name="InvalidWarningVersionTitle" xml:space="preserve">
-    <value>The value given for the --warn argument was not a valid warning version.</value>
-  </data>
-  <data name="InvalidWarningVersionMessage" xml:space="preserve">
-    <value>Invalid warning version '{0}'.</value>
-  </data>
-  <data name="InvalidGenerateWarningSuppressionsValueTitle" xml:space="preserve">
-    <value>Invalid value 'value' was used for command-line option '--generate-warning-suppressions'; must be 'cs' or 'xml'.</value>
-  </data>
-  <data name="InvalidGenerateWarningSuppressionsValueMessage" xml:space="preserve">
-    <value>Invalid value '{0}' for '--generate-warning-suppressions' option.</value>
-  </data>
-  <data name="MissingArgumentForCommanLineOptionNameTitle" xml:space="preserve">
-    <value>The command-line option 'optionName' was specified but no argument was given.</value>
-  </data>
-  <data name="MissingArgumentForCommanLineOptionNameMessage" xml:space="preserve">
-    <value>Missing argument for '{0}' option.</value>
-  </data>
-  <data name="CustomDataFormatIsInvalidTitle" xml:space="preserve">
-    <value>The command-line option --custom-data receives a key-value pair using the format KEY=VALUE.</value>
-  </data>
-  <data name="CustomDataFormatIsInvalidMessage" xml:space="preserve">
-    <value>Value used with '--custom-data' has to be in the KEY=VALUE format.</value>
-  </data>
-  <data name="NoFilesToLinkSpecifiedTitle" xml:space="preserve">
-    <value>No input files were specified. Use one of the resolver options.</value>
-  </data>
-  <data name="NoFilesToLinkSpecifiedMessage" xml:space="preserve">
-    <value>No input files were specified. Use one of '{0}' options.</value>
-  </data>
-  <data name="NewMvidAndDeterministicCannotBeUsedAtSameTimeTitle" xml:space="preserve">
-    <value>Options '--new-mvid' and '--deterministic' cannot be used at the same time.</value>
-  </data>
-  <data name="NewMvidAndDeterministicCannotBeUsedAtSameTimeMessage" xml:space="preserve">
-    <value>Options '--new-mvid' and '--deterministic' cannot be used at the same time.</value>
-  </data>
-  <data name="AssemblyInCustomStepOptionCouldNotBeFoundTitle" xml:space="preserve">
-    <value>The assembly argument specified for '--custom-step' option could not be found.</value>
-  </data>
-  <data name="AssemblyInCustomStepOptionCouldNotBeFoundMessage" xml:space="preserve">
-    <value>The assembly '{0}' specified for '--custom-step' option could not be found.</value>
-  </data>
-  <data name="AssemblyPathInCustomStepMustBeFullyQualifiedTitle" xml:space="preserve">
-    <value>The path to the assembly specified for '--custom-step' must be fully qualified.</value>
-  </data>
-  <data name="AssemblyPathInCustomStepMustBeFullyQualifiedMessage" xml:space="preserve">
-    <value>The path to the assembly '{0}' specified for '--custom-step' must be fully qualified.</value>
-  </data>
-  <data name="InvalidArgForCustomStepTitle" xml:space="preserve">
-    <value>An invalid value was specified for '--custom-step' option.</value>
-  </data>
-  <data name="InvalidArgForCustomStepMessage" xml:space="preserve">
-    <value>Invalid value '{0}' specified for '--custom-step' option.</value>
-  </data>
-  <data name="ExpectedSignToControlNewStepInsertionTitle" xml:space="preserve">
-    <value>A custom step that is inserted relative to an existing step in the pipeline must specify whether to be added before (-) or after (+) the step it's relative to.</value>
-  </data>
-  <data name="ExpectedSignToControlNewStepInsertionMessage" xml:space="preserve">
-    <value>Expected '+' or '-' to control new step insertion.</value>
-  </data>
-  <data name="PipelineStepCouldNotBeFoundTitle" xml:space="preserve">
-    <value>A custom step was specified for insertion relative to a non existent step.</value>
-  </data>
-  <data name="PipelineStepCouldNotBeFoundMessage" xml:space="preserve">
-    <value>Pipeline step '{0}' could not be found.</value>
-  </data>
-  <data name="CustomStepTypeCouldNotBeFoundTitle" xml:space="preserve">
-    <value>The custom step could not be found in the given assembly.</value>
-  </data>
-  <data name="CustomStepTypeCouldNotBeFoundMessage" xml:space="preserve">
-    <value>Custom step '{0}' could not be found.</value>
-  </data>
-  <data name="CustomStepTypeIsIncompatibleWithLinkerVersionTitle" xml:space="preserve">
-    <value>Custom step is incompatible with this trimmer version.</value>
-  </data>
-  <data name="CustomStepTypeIsIncompatibleWithLinkerVersionMessage" xml:space="preserve">
-    <value>Custom step '{0}' is incompatible with this trimmer version.</value>
-  </data>
-  <data name="InvalidOptimizationValueTitle" xml:space="preserve">
-    <value>The optimization 'text' is invalid. Optimization values can either be 'beforefieldinit', 'overrideremoval', 'unreachablebodies', 'unusedinterfaces', 'ipconstprop', or 'sealer'.</value>
-  </data>
-  <data name="InvalidOptimizationValueMessage" xml:space="preserve">
-    <value>Invalid optimization value '{0}'.</value>
-  </data>
-  <data name="InvalidArgumentForTokenOptionTitle" xml:space="preserve">
-    <value>Invalid argument for 'token' option.</value>
-  </data>
-  <data name="InvalidArgumentForTokenOptionMessage" xml:space="preserve">
-    <value>Invalid argument for '{0}' option.</value>
-  </data>
-  <data name="InvalidAssemblyActionTitle" xml:space="preserve">
-    <value>Invalid assembly action.</value>
-  </data>
-  <data name="InvalidAssemblyActionMessage" xml:space="preserve">
-    <value>Invalid assembly action '{0}'.</value>
-  </data>
-  <data name="RootAssemblyCouldNotBeFoundTitle" xml:space="preserve">
-    <value>Root assembly could not be found.</value>
-  </data>
-  <data name="RootAssemblyCouldNotBeFoundMessage" xml:space="preserve">
-    <value>Root assembly '{0}' could not be found.</value>
-  </data>
-  <data name="XmlDescriptorCouldNotBeFoundTitle" xml:space="preserve">
-    <value>XML descriptor file could not be found'.</value>
-  </data>
-  <data name="XmlDescriptorCouldNotBeFoundMessage" xml:space="preserve">
-    <value>XML descriptor file '{0}' could not be found'.</value>
-  </data>
-  <data name="RootAssemblyDoesNotHaveEntryPointTitle" xml:space="preserve">
-    <value>Root assembly does not have entry point.</value>
-  </data>
-  <data name="RootAssemblyDoesNotHaveEntryPointMessage" xml:space="preserve">
-    <value>Root assembly '{0}' does not have entry point.</value>
-  </data>
-  <data name="RootAssemblyCannotUseActionTitle" xml:space="preserve">
-    <value>Referenced root assembly cannot use the specified action.</value>
-  </data>
-  <data name="RootAssemblyCannotUseActionMessage" xml:space="preserve">
-    <value>Root assembly '{0}' cannot use action '{1}'.</value>
-  </data>
-  <data name="InvalidAssemblyNameTitle" xml:space="preserve">
-    <value>Invalid assembly name.</value>
-  </data>
-  <data name="InvalidAssemblyNameMessage" xml:space="preserve">
-    <value>Invalid assembly name '{0}'.</value>
-  </data>
-  <data name="InvalidAssemblyRootModeTitle" xml:space="preserve">
-    <value>Invalid assembly root mode.</value>
-  </data>
-  <data name="InvalidAssemblyRootModeMessage" xml:space="preserve">
-    <value>Invalid assembly root mode '{0}'.</value>
-  </data>
-  <data name="ExportedTypeCannotBeResolvedTitle" xml:space="preserve">
-    <value>Exported type cannot be resolved.</value>
-  </data>
-  <data name="ExportedTypeCannotBeResolvedMessage" xml:space="preserve">
-    <value>Exported type '{0}' cannot be resolved.</value>
-  </data>
-  <data name="ReferenceAssemblyCouldNotBeLoadedTitle" xml:space="preserve">
-    <value>A reference assembly input passed via -reference could not be loaded.</value>
-  </data>
-  <data name="ReferenceAssemblyCouldNotBeLoadedMessage" xml:space="preserve">
-    <value>Reference assembly '{0}' could not be loaded.</value>
-  </data>
-  <data name="FailedToResolveMetadataElementTitle" xml:space="preserve">
-    <value>Metadata element cannot be resolved. This usually means there is a version mismatch between dependencies.</value>
-  </data>
-  <data name="FailedToResolveMetadataElementMessage" xml:space="preserve">
-    <value>{0}.</value>
-  </data>
-  <data name="FailedToResolveFieldElementTitle" xml:space="preserve">
-    <value>Field element cannot be resolved. This usually means there is a version mismatch between dependencies.</value>
-  </data>
-  <data name="FailedToResolveFieldElementMessage" xml:space="preserve">
-    <value>Field '{0}' reference could not be resolved.</value>
-  </data>
-  <data name="FailedToResolveMethodElementTitle" xml:space="preserve">
-    <value>Method element cannot be resolved. This usually means there is a version mismatch between dependencies.</value>
-  </data>
-  <data name="FailedToResolveMethodElementMessage" xml:space="preserve">
-    <value>Method '{0}' reference could not be resolved.</value>
-  </data>
-  <data name="FailedToResolveTypeElementTitle" xml:space="preserve">
-    <value>Type element cannot be resolved. This usually means there is a version mismatch between dependencies.</value>
-  </data>
-  <data name="FailedToResolveTypeElementMessage" xml:space="preserve">
-    <value>Type '{0}' reference could not be resolved.</value>
-  </data>
-  <data name="TypeUsedWithAttributeValueCouldNotBeFoundTitle" xml:space="preserve">
-    <value>The type name used to define custom attribute value could not be resolved.</value>
-  </data>
-  <data name="TypeUsedWithAttributeValueCouldNotBeFoundMessage" xml:space="preserve">
-    <value>The type '{0}' used with attribute value '{1}' could not be found.</value>
-  </data>
-  <data name="CannotConverValueToTypeTitle" xml:space="preserve">
-    <value>The 'value' specified for the custom attribute value cannot be converted to specified argument type 'typeName'.</value>
-  </data>
-  <data name="CannotConverValueToTypeMessage" xml:space="preserve">
-    <value>Cannot convert value '{0}' to type '{1}'.</value>
-  </data>
-  <data name="CustomAttributeArgumentForTypeRequiresNestedNodeTitle" xml:space="preserve">
-    <value>The syntax for custom attribute value for 'type' requires to also specify the underlying attribute type.</value>
-  </data>
-  <data name="CustomAttributeArgumentForTypeRequiresNestedNodeMessage" xml:space="preserve">
-    <value>Custom attribute argument for '{0}' requires nested '{1}' node.</value>
-  </data>
-  <data name="CouldNotResolveCustomAttributeTypeValueTitle" xml:space="preserve">
-    <value>The value specified for the custom attribute of System.Type type could not be resolved.</value>
-  </data>
-  <data name="CouldNotResolveCustomAttributeTypeValueMessage" xml:space="preserve">
-    <value>Could not resolve custom attribute type value '{0}'.</value>
-  </data>
-  <data name="UnexpectedAttributeArgumentTypeTitle" xml:space="preserve">
-    <value>The type name used with attribute type is not one of the supported types.</value>
-  </data>
-  <data name="UnexpectedAttributeArgumentTypeMessage" xml:space="preserve">
-    <value>Unexpected attribute argument type '{0}'.</value>
-  </data>
-  <data name="InvalidMetadataOptionTitle" xml:space="preserve">
-    <value>Invalid metadata value.</value>
-  </data>
-  <data name="InvalidMetadataOptionMessage" xml:space="preserve">
-    <value>Invalid metadata value '{0}'.</value>
-  </data>
-  <data name="TypeHasNoFieldsToPreserveTitle" xml:space="preserve">
-    <value>The XML descriptor preserves fields on type, but this type has no fields.</value>
-  </data>
-  <data name="TypeHasNoFieldsToPreserveMessage" xml:space="preserve">
-    <value>Type '{0}' has no fields to preserve.</value>
-  </data>
-  <data name="TypeHasNoMethodsToPreserveTitle" xml:space="preserve">
-    <value>The XML descriptor preserves methods on type, but this type has no methods.</value>
-  </data>
-  <data name="TypeHasNoMethodsToPreserveMessage" xml:space="preserve">
-    <value>Type '{0}' has no methods to preserve.</value>
-  </data>
-  <data name="CouldNotResolveDependencyAssemblyTitle" xml:space="preserve">
-    <value>The assembly in PreserveDependency attribute could not be resolved.</value>
-  </data>
-  <data name="CouldNotResolveDependencyAssemblyMessage" xml:space="preserve">
-    <value>Could not resolve dependency assembly '{0}' specified in a 'PreserveDependency' attribute.</value>
-  </data>
-  <data name="CouldNotResolveDependencyTypeTitle" xml:space="preserve">
-    <value>The type in PreserveDependency attribute could not be resolved.</value>
-  </data>
-  <data name="CouldNotResolveDependencyTypeMessage" xml:space="preserve">
-    <value>Could not resolve dependency type '{0}' specified in a 'PreserveDependency' attribute.</value>
-  </data>
-  <data name="CouldNotResolveDependencyMemberTitle" xml:space="preserve">
-    <value>The member in PreserveDependency attribute could not be resolved.</value>
-  </data>
-  <data name="CouldNotResolveDependencyMemberMessage" xml:space="preserve">
-    <value>Could not resolve dependency member '{0}' declared in type '{1}' specified in a 'PreserveDependency' attribute.</value>
-  </data>
-  <data name="XmlCouldNotResolveAssemblyTitle" xml:space="preserve">
-    <value>The assembly in the XML could not be resolved.</value>
-  </data>
-  <data name="XmlCouldNotResolveAssemblyMessage" xml:space="preserve">
-    <value>Could not resolve assembly '{0}'.</value>
-  </data>
-  <data name="XmlCouldNotResolveTypeTitle" xml:space="preserve">
-    <value>The type in the XML could not be resolved.</value>
-  </data>
-  <data name="XmlCouldNotResolveTypeMessage" xml:space="preserve">
-    <value>Could not resolve type '{0}'.</value>
-  </data>
-  <data name="XmlCouldNotFindMethodOnTypeTitle" xml:space="preserve">
-    <value>The XML defined a method on a type, but the method was not found.</value>
-  </data>
-  <data name="XmlCouldNotFindMethodOnTypeMessage" xml:space="preserve">
-    <value>Could not find method '{0}' on type '{1}'.</value>
-  </data>
-  <data name="XmlInvalidValueForStubTitle" xml:space="preserve">
-    <value>Invalid value for 'signature' stub in the substitution XML.</value>
-  </data>
-  <data name="XmlInvalidValueForStubMessage" xml:space="preserve">
-    <value>Invalid value for '{0}' stub.</value>
-  </data>
-  <data name="XmlUnkownBodyModificationTitle" xml:space="preserve">
-    <value>The value of the body attribute used in the substitution XML is invalid (the only supported options are remove and stub).</value>
-  </data>
-  <data name="XmlUnkownBodyModificationMessage" xml:space="preserve">
-    <value>Unknown body modification '{0}' for '{1}'.</value>
-  </data>
-  <data name="XmlCouldNotFindFieldOnTypeTitle" xml:space="preserve">
-    <value>The XML defined a field on a type, but the field was not found.</value>
-  </data>
-  <data name="XmlCouldNotFindFieldOnTypeMessage" xml:space="preserve">
-    <value>Could not find field '{0}' on type '{1}'.</value>
-  </data>
-  <data name="XmlSubstitutedFieldNeedsToBeStaticTitle" xml:space="preserve">
-    <value>The substituted field 'field' was non-static or constant. Only static non-constant fields are supported.</value>
-  </data>
-  <data name="XmlSubstitutedFieldNeedsToBeStaticMessage" xml:space="preserve">
-    <value>Substituted field '{0}' needs to be static field.</value>
-  </data>
-  <data name="XmlMissingSubstitutionValueForFieldTitle" xml:space="preserve">
-    <value>A field was specified for substitution but no value to be substituted was given.</value>
-  </data>
-  <data name="XmlMissingSubstitutionValueForFieldMessage" xml:space="preserve">
-    <value>Missing 'value' attribute for field '{0}'.</value>
-  </data>
-  <data name="XmlInvalidSubstitutionValueForFieldTitle" xml:space="preserve">
-    <value>The value used in the substitution XML for field is not a built-in type, or does not match the type of the field.</value>
-  </data>
-  <data name="XmlInvalidSubstitutionValueForFieldMessage" xml:space="preserve">
-    <value>Invalid value '{0}' for '{1}'.</value>
-  </data>
-  <data name="XmlCouldNotFindEventOnTypeTitle" xml:space="preserve">
-    <value>The XML defined a event on a type, but the event was not found.</value>
-  </data>
-  <data name="XmlCouldNotFindEventOnTypeMessage" xml:space="preserve">
-    <value>Could not find event '{0}' on type '{1}'.</value>
-  </data>
-  <data name="XmlCouldNotFindPropertyOnTypeTitle" xml:space="preserve">
-    <value>The XML defined a property on a type, but the property was not found.</value>
-  </data>
-  <data name="XmlCouldNotFindPropertyOnTypeMessage" xml:space="preserve">
-    <value>Could not find property '{0}' on type '{1}'.</value>
-  </data>
-  <data name="XmlCouldNotFindGetAccesorOfPropertyOnTypeTitle" xml:space="preserve">
-    <value>The XML defined the get accessor of property on a type, but the accessor was not found.</value>
-  </data>
-  <data name="XmlCouldNotFindGetAccesorOfPropertyOnTypeMessage" xml:space="preserve">
-    <value>Could not find the get accessor of property '{0}' on type '{1}'.</value>
-  </data>
-  <data name="XmlCouldNotFindSetAccesorOfPropertyOnTypeTitle" xml:space="preserve">
-    <value>The XML defined the set accessor of property on a type, but the accessor was not found.</value>
-  </data>
-  <data name="XmlCouldNotFindSetAccesorOfPropertyOnTypeMessage" xml:space="preserve">
-    <value>Could not find the set accessor of property '{0}' in type '{1}'.</value>
-  </data>
-  <data name="XmlCouldNotFindMatchingConstructorForCustomAttributeTitle" xml:space="preserve">
-    <value>The XML attribute arguments use values or types which don't match to any constructor</value>
-  </data>
-  <data name="XmlCouldNotFindMatchingConstructorForCustomAttributeMessage" xml:space="preserve">
-    <value>Could not find matching constructor for custom attribute '{0}' arguments.</value>
-  </data>
-  <data name="XmlMoreThanOneReturnElementForMethodTitle" xml:space="preserve">
-    <value>Method 'method' has more than one return element specified. There can only be one return element.</value>
-  </data>
-  <data name="XmlMoreThanOneReturnElementForMethodMessage" xml:space="preserve">
-    <value>There is more than one 'return' child element specified for method '{0}'.</value>
-  </data>
-  <data name="XmlMoreThanOneValyForParameterOfMethodTitle" xml:space="preserve">
-    <value>Method has more than one parameter for the XML element 'parameter'. There can only be one value specified for each parameter.</value>
-  </data>
-  <data name="XmlMoreThanOneValyForParameterOfMethodMessage" xml:space="preserve">
-    <value>More than one value specified for parameter '{0}' of method '{1}'.</value>
-  </data>
-  <data name="XmlDuplicatePreserveMemberTitle" xml:space="preserve">
-    <value>The XML descriptor marks for preservation the member more than once.</value>
-  </data>
-  <data name="XmlDuplicatePreserveMemberMessage" xml:space="preserve">
-    <value>Duplicate preserve of '{0}'.</value>
-  </data>
-  <data name="RequiresUnreferencedCodeTitle" xml:space="preserve">
-    <value>Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code</value>
-  </data>
-  <data name="RequiresUnreferencedCodeMessage" xml:space="preserve">
-    <value>Using member '{0}' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code.{1}{2}</value>
-  </data>
-  <data name="DynamicTypeInvocationTitle" xml:space="preserve">
-    <value>Using dynamic types might cause types or members to be removed by trimmer.</value>
-  </data>
-  <data name="DynamicTypeInvocationMessage" xml:space="preserve">
-    <value>Invoking members on dynamic types is not trimming-compatible. Types or members might have been removed by the trimmer.</value>
-  </data>
-  <data name="AttributeShouldOnlyBeUsedOnceOnMemberTitle" xml:space="preserve">
-    <value>ILLink found multiple instances of attribute on a member. This attribute is only allowed to have one instance.</value>
-  </data>
-  <data name="AttributeShouldOnlyBeUsedOnceOnMemberMessage" xml:space="preserve">
-    <value>Attribute '{0}' should only be used once on '{1}</value>
-  </data>
-  <data name="AttributeDoesntHaveTheRequiredNumberOfParametersTitle" xml:space="preserve">
-    <value>Attribute doesn't have the required number of parameters specified.</value>
-  </data>
-  <data name="AttributeDoesntHaveTheRequiredNumberOfParametersMessage" xml:space="preserve">
-    <value>Attribute '{0}' doesn't have the required number of parameters specified.</value>
-  </data>
-  <data name="XmlElementDoesNotContainRequiredAttributeFullnameTitle" xml:space="preserve">
-    <value>'attribute' element does not contain attribute 'fullname' or it's empty.</value>
-  </data>
-  <data name="XmlElementDoesNotContainRequiredAttributeFullnameMessage" xml:space="preserve">
-    <value>'attribute' element does not contain attribute 'fullname' or it's empty.</value>
-  </data>
-  <data name="XmlCouldNotResolveAssemblyForAttributeTitle" xml:space="preserve">
-    <value>The assembly name specified for attribute could not be resolved.</value>
-  </data>
-  <data name="XmlCouldNotResolveAssemblyForAttributeMessage" xml:space="preserve">
-    <value>Could not resolve assembly '{0}' for attribute '{1}'.</value>
-  </data>
-  <data name="XmlAttributeTypeCouldNotBeFoundTitle" xml:space="preserve">
-    <value>The described attribute type could not be found in the assemblies.</value>
-  </data>
-  <data name="XmlAttributeTypeCouldNotBeFoundMessage" xml:space="preserve">
-    <value>Attribute type '{0}' could not be found.</value>
-  </data>
-  <data name="UnrecognizedParameterInMethodCreateInstanceTitle" xml:space="preserve">
-    <value>The value passed as the assembly name or type name to the CreateInstance method can't be statically analyzed.</value>
-  </data>
-  <data name="UnrecognizedParameterInMethodCreateInstanceMessage" xml:space="preserve">
-    <value>Unrecognized value passed to the parameter '{0}' of method '{1}'. It's not possible to guarantee the availability of the target type.</value>
-  </data>
-  <data name="DeprecatedPreserveDependencyAttributeTitle" xml:space="preserve">
-    <value>'PreserveDependencyAttribute' is deprecated. Use 'DynamicDependencyAttribute' instead.</value>
-  </data>
-  <data name="DeprecatedPreserveDependencyAttributeMessage" xml:space="preserve">
-    <value>'PreserveDependencyAttribute' is deprecated. Use 'DynamicDependencyAttribute' instead.</value>
-  </data>
-  <data name="DynamicDependencyAttributeCouldNotBeAnalyzedTitle" xml:space="preserve">
-    <value>The input contains an invalid use of DynamicDependencyAttribute.</value>
-  </data>
-  <data name="DynamicDependencyAttributeCouldNotBeAnalyzedMessage" xml:space="preserve">
-    <value>The 'DynamicDependencyAttribute' could not be analyzed.</value>
-  </data>
-  <data name="UnresolvedAssemblyInDynamicDependencyAttributeTitle" xml:space="preserve">
-    <value>The assembly string given in a DynamicDependencyAttribute constructor could not be resolved.</value>
-  </data>
-  <data name="UnresolvedAssemblyInDynamicDependencyAttributeMessage" xml:space="preserve">
-    <value>Unresolved assembly '{0}' in 'DynamicDependencyAttribute'.</value>
-  </data>
-  <data name="UnresolvedTypeInDynamicDependencyAttributeTitle" xml:space="preserve">
-    <value>The type in a DynamicDependencyAttribute constructor could not be resolved.</value>
-  </data>
-  <data name="UnresolvedTypeInDynamicDependencyAttributeMessage" xml:space="preserve">
-    <value>Unresolved type '{0}' in 'DynamicDependencyAttribute'.</value>
-  </data>
-  <data name="NoMembersResolvedForMemberSignatureOrTypeTitle" xml:space="preserve">
-    <value>The member signature or DynamicallyAccessedMemberTypes in a DynamicDependencyAttribute constructor did not resolve to any members on the type.</value>
-  </data>
-  <data name="NoMembersResolvedForMemberSignatureOrTypeMessage" xml:space="preserve">
-    <value>No members were resolved for '{0}' on type '{1}'.</value>
-  </data>
-  <data name="XmlMissingNameAttributeInResourceTitle" xml:space="preserve">
-    <value>The resource element in a substitution file did not have a 'name' attribute.</value>
-  </data>
-  <data name="XmlMissingNameAttributeInResourceMessage" xml:space="preserve">
-    <value>Missing 'name' attribute for resource.</value>
-  </data>
-  <data name="XmlInvalidValueForAttributeActionForResourceTitle" xml:space="preserve">
-    <value>The resource element in a substitution file did not have a valid 'action' attribute.</value>
-  </data>
-  <data name="XmlInvalidValueForAttributeActionForResourceMessage" xml:space="preserve">
-    <value>Invalid value '{0}' for attribute 'action' for resource '{1}'.</value>
-  </data>
-  <data name="XmlCouldNotFindResourceToRemoveInAssemblyTitle" xml:space="preserve">
-    <value>The resource name in a substitution file could not be found in the specified assembly.</value>
-  </data>
-  <data name="XmlCouldNotFindResourceToRemoveInAssemblyMessage" xml:space="preserve">
-    <value>Could not find embedded resource '{0}' to remove in assembly '{1}'.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersIsNotAllowedOnMethodsTitle" xml:space="preserve">
-    <value>The 'DynamicallyAccessedMembersAttribute' is not allowed on methods. It is allowed on method return value or method parameters.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersIsNotAllowedOnMethodsMessage" xml:space="preserve">
-    <value>The 'DynamicallyAccessedMembersAttribute' is not allowed on methods. It is allowed on method return value or method parameters though.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersCouldNotFindBackingFieldTitle" xml:space="preserve">
-    <value>Could not find a unique backing field for property to propagate 'DynamicallyAccessedMembersAttribute'.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersCouldNotFindBackingFieldMessage" xml:space="preserve">
-    <value>Could not find a unique backing field for property '{0}' to propagate 'DynamicallyAccessedMembersAttribute'.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersConflictsBetweenPropertyAndAccessorTitle" xml:space="preserve">
-    <value>'DynamicallyAccessedMembersAttribute' on property conflicts with the same attribute on its accessor.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersConflictsBetweenPropertyAndAccessorMessage" xml:space="preserve">
-    <value>'DynamicallyAccessedMembersAttribute' on property '{0}' conflicts with the same attribute on its accessor '{1}'.</value>
-  </data>
-  <data name="XmlCouldNotFindAnyTypeInNamespaceTitle" xml:space="preserve">
-    <value>The XML descriptor specifies a namespace but there are no types found in such namespace.</value>
-  </data>
-  <data name="XmlCouldNotFindAnyTypeInNamespaceMessage" xml:space="preserve">
-    <value>Could not find any type in namespace '{0}'.</value>
-  </data>
-  <data name="AttributeIsReferencedButTrimmerRemoveAllInstancesTitle" xml:space="preserve">
-    <value>An attribute is being referenced in the code but the attribute instances have been removed using the 'RemoveAttributeInstances' internal attribute.</value>
-  </data>
-  <data name="AttributeIsReferencedButTrimmerRemoveAllInstancesMessage" xml:space="preserve">
-    <value>Attribute '{0}' is being referenced in code but the trimmer was instructed to remove all instances of this attribute. If the attribute instances are necessary make sure to either remove the trimmer attribute XML portion which removes the attribute instances, or override the removal by using the trimmer XML descriptor to keep the attribute type (which in turn keeps all of its instances).</value>
-  </data>
-  <data name="RequiresUnreferencedCodeAttributeMismatchTitle" xml:space="preserve">
-    <value>'RequiresUnreferencedCodeAttribute' annotations must match across all interface implementations or overrides.</value>
-  </data>
-  <data name="RequiresUnreferencedCodeAttributeMismatchMessage" xml:space="preserve">
-    <value>{0}. 'RequiresUnreferencedCodeAttribute' annotations must match across all interface implementations or overrides.</value>
-  </data>
-  <data name="XmlRemoveAttributeInstancesCanOnlyBeUsedOnTypeTitle" xml:space="preserve">
-    <value>Internal attribute 'RemoveAttributeInstances' can only be used on attribute types.</value>
-  </data>
-  <data name="XmlRemoveAttributeInstancesCanOnlyBeUsedOnTypeMessage" xml:space="preserve">
-    <value>Internal attribute '{0}' can only be used on attribute types.</value>
-  </data>
-  <data name="CorrectnessOfCOMCannotBeGuaranteedTitle" xml:space="preserve">
-    <value>Correctness of COM interop cannot be guaranteed after trimming. Interfaces and interface members might be removed.</value>
-  </data>
-  <data name="CorrectnessOfCOMCannotBeGuaranteedMessage" xml:space="preserve">
-    <value>P/invoke method '{0}' declares a parameter with COM marshalling. Correctness of COM interop cannot be guaranteed after trimming. Interfaces and interface members might be removed.</value>
-  </data>
-  <data name="XmlPropertyDoesNotContainAttributeNameTitle" xml:space="preserve">
-    <value>An attribute element has property but this could not be found.</value>
-  </data>
-  <data name="XmlPropertyDoesNotContainAttributeNameMessage" xml:space="preserve">
-    <value>Property element does not contain attribute 'name'.</value>
-  </data>
-  <data name="XmlCouldNotFindPropertyTitle" xml:space="preserve">
-    <value>An attribute element has property but this could not be found.</value>
-  </data>
-  <data name="XmlCouldNotFindPropertyMessage" xml:space="preserve">
-    <value>Property '{0}' could not be found.</value>
-  </data>
-  <data name="MakeGenericTypeTitle" xml:space="preserve">
-    <value>Either the type on which the MakeGenericType is called can't be statically determined, or the type parameters to be used for generic arguments can't be statically determined.</value>
-  </data>
-  <data name="MakeGenericTypeMessage" xml:space="preserve">
-    <value>Call to '{0}' can not be statically analyzed. It's not possible to guarantee the availability of requirements of the generic type.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersOnPropertyConflictsWithBackingFieldTitle" xml:space="preserve">
-    <value>'DynamicallyAccessedMemberAttribute' on property conflicts with the same attribute on its backing field.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersOnPropertyConflictsWithBackingFieldMessage" xml:space="preserve">
-    <value>'DynamicallyAccessedMemberAttribute' on property '{0}' conflicts with the same attribute on its backing field '{1}'.</value>
-  </data>
-  <data name="UnrecognizedTypeNameInTypeGetTypeTitle" xml:space="preserve">
-    <value>Unrecognized value passed to the parameter of method. It's not possible to guarantee the availability of the target type.</value>
-  </data>
-  <data name="UnrecognizedTypeNameInTypeGetTypeMessage" xml:space="preserve">
-    <value>Unrecognized value passed to the parameter 'typeName' of method '{0}'. It's not possible to guarantee the availability of the target type.</value>
-  </data>
-  <data name="ParametersOfAssemblyCreateInstanceCannotBeAnalyzedTitle" xml:space="preserve">
-    <value>Parameters passed to method cannot be analyzed. Consider using methods 'System.Type.GetType' and `System.Activator.CreateInstance` instead.</value>
-  </data>
-  <data name="ParametersOfAssemblyCreateInstanceCannotBeAnalyzedMessage" xml:space="preserve">
-    <value>Parameters passed to method '{0}' cannot be analyzed. Consider using methods 'System.Type.GetType' and `System.Activator.CreateInstance` instead.</value>
-  </data>
-  <data name="UnrecognizedTypeInRuntimeHelpersRunClassConstructorTitle" xml:space="preserve">
-    <value>The type passed to the RunClassConstructor is not statically known, Trimmer can't make sure that its static constructor is available.</value>
-  </data>
-  <data name="UnrecognizedTypeInRuntimeHelpersRunClassConstructorMessage" xml:space="preserve">
-    <value>Unrecognized value passed to the parameter 'type' of method '{0}'. It's not possible to guarantee the availability of the target static constructor.</value>
-  </data>
-  <data name="MakeGenericMethodTitle" xml:space="preserve">
-    <value>Call to 'System.Reflection.MethodInfo.MakeGenericMethod' can not be statically analyzed. It's not possible to guarantee the availability of requirements of the generic method.</value>
-  </data>
-  <data name="MakeGenericMethodMessage" xml:space="preserve">
-    <value>Call to '{0}' can not be statically analyzed. It's not possible to guarantee the availability of requirements of the generic method.</value>
-  </data>
-  <data name="UnresolvedAssemblyInCreateInstanceTitle" xml:space="preserve">
-    <value>Calling CreateInstance with assembly name which can't be resolved.</value>
-  </data>
-  <data name="UnresolvedAssemblyInCreateInstanceMessage" xml:space="preserve">
-    <value>The assembly name '{0}' passed to method '{1}' references assembly which is not available.</value>
-  </data>
-  <data name="MethodParameterCannotBeStaticallyDeterminedTitle" xml:space="preserve">
-    <value>The parameter of method has a DynamicallyAccessedMembersAttribute, but the value passed to it can not be statically analyzed.</value>
-  </data>
-  <data name="MethodParameterCannotBeStaticallyDeterminedMessage" xml:space="preserve">
-    <value>Value passed to parameter '{0}' of method '{1}' can not be statically determined and may not meet 'DynamicallyAccessedMembersAttribute' requirements.</value>
-  </data>
-  <data name="MethodReturnValueCannotBeStaticallyDeterminedTitle" xml:space="preserve">
-    <value>The return value of method has a DynamicallyAccessedMembersAttribute, but the value returned from the method can not be statically analyzed.</value>
-  </data>
-  <data name="MethodReturnValueCannotBeStaticallyDeterminedMessage" xml:space="preserve">
-    <value>Value returned from method '{0}' can not be statically determined and may not meet 'DynamicallyAccessedMembersAttribute' requirements.</value>
-  </data>
-  <data name="FieldValueCannotBeStaticallyDeterminedTitle" xml:space="preserve">
-    <value>The field has a DynamicallyAccessedMembersAttribute, but the value assigned to it can not be statically analyzed.</value>
-  </data>
-  <data name="FieldValueCannotBeStaticallyDeterminedMessage" xml:space="preserve">
-    <value>Value assigned to {0} can not be statically determined and may not meet 'DynamicallyAccessedMembersAttribute' requirements.</value>
-  </data>
-  <data name="ImplicitThisCannotBeStaticallyDeterminedTitle" xml:space="preserve">
-    <value>The method has a DynamicallyAccessedMembersAttribute (which applies to the implicit 'this' parameter), but the value used for the 'this' parameter can not be statically analyzed.</value>
-  </data>
-  <data name="ImplicitThisCannotBeStaticallyDeterminedMessage" xml:space="preserve">
-    <value>Value passed to implicit 'this' parameter of method '{0}' can not be statically determined and may not meet 'DynamicallyAccessedMembersAttribute' requirements.</value>
-  </data>
-  <data name="TypePassedToGenericParameterCannotBeStaticallyDeterminedTitle" xml:space="preserve">
-    <value>The generic parameter of type or method has a DynamicallyAccessedMembersAttribute, but the value used for it can not be statically analyzed.</value>
-  </data>
-  <data name="TypePassedToGenericParameterCannotBeStaticallyDeterminedMessage" xml:space="preserve">
-    <value>Type passed to generic parameter '{0}' of '{1}' can not be statically determined and may not meet 'DynamicallyAccessedMembersAttribute' requirements.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchParameterTargetsParameterTitle" xml:space="preserve">
-    <value>Target parameter argument does not satisfy 'DynamicallyAccessedMembersAttribute' in call to target method. The parameter of method does not have matching annotations.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchParameterTargetsParameterMessage" xml:space="preserve">
-    <value>'{0}' argument does not satisfy {4} in call to '{1}'. The parameter '{2}' of method '{3}' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchParameterTargetsMethodReturnTypeTitle" xml:space="preserve">
-    <value>Target method return value does not satisfy 'DynamicallyAccessedMembersAttribute' requirements. The parameter of method does not have matching annotations.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchParameterTargetsMethodReturnTypeMessage" xml:space="preserve">
-    <value>'{0}' method return value does not satisfy {3} requirements. The parameter '{1}' of method '{2}' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchParameterTargetsFieldTitle" xml:space="preserve">
-    <value>Value stored in field does not satisfy 'DynamicallyAccessedMembersAttribute' requirements. The parameter of method does not have matching annotations.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchParameterTargetsFieldMessage" xml:space="preserve">
-    <value>value stored in field '{0}' does not satisfy {3} requirements. The parameter '{1}' of method '{2}' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchParameterTargetsThisParameterTitle" xml:space="preserve">
-    <value>'this' argument does not satisfy 'DynamicallyAccessedMembersAttribute' in call to target method. The parameter of method does not have matching annotations.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchParameterTargetsThisParameterMessage" xml:space="preserve">
-    <value>'this' argument does not satisfy {3} in call to '{0}'. The parameter '{1}' of method '{2}' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchParameterTargetsGenericParameterTitle" xml:space="preserve">
-    <value>Generic argument does not satisfy 'DynamicallyAccessedMembersAttribute' in target method or type. The parameter of method does not have matching annotations.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchParameterTargetsGenericParameterMessage" xml:space="preserve">
-    <value>'{0}' generic argument does not satisfy {4} in '{1}'. The parameter '{2}' of method '{3}' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchMethodReturnTypeTargetsParameterTitle" xml:space="preserve">
-    <value>Target parameter argument does not satisfy 'DynamicallyAccessedMembersAttribute' in call to target method. The return value of the source method does not have matching annotations.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchMethodReturnTypeTargetsParameterMessage" xml:space="preserve">
-    <value>'{0}' argument does not satisfy {3} in call to '{1}'. The return value of method '{2}' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchMethodReturnTypeTargetsMethodReturnTypeTitle" xml:space="preserve">
-    <value>Target method return value does not satisfy 'DynamicallyAccessedMembersAttribute' requirements. The return value of the source method does not have matching annotations.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchMethodReturnTypeTargetsMethodReturnTypeMessage" xml:space="preserve">
-    <value>'{0}' method return value does not satisfy {2} requirements. The return value of method '{1}' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchMethodReturnTypeTargetsFieldTitle" xml:space="preserve">
-    <value>Value stored in field does not satisfy 'DynamicallyAccessedMembersAttribute' requirements. The return value of the source method does not have matching annotations.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchMethodReturnTypeTargetsFieldMessage" xml:space="preserve">
-    <value>value stored in field '{0}' does not satisfy {2} requirements. The return value of method '{1}' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchMethodReturnTypeTargetsThisParameterTitle" xml:space="preserve">
-    <value>'this' argument does not satisfy 'DynamicallyAccessedMembersAttribute' in call to target method. The return value of the source method does not have matching annotations.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchMethodReturnTypeTargetsThisParameterMessage" xml:space="preserve">
-    <value>'this' argument does not satisfy {2} in call to '{0}'. The return value of method '{1}' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchMethodReturnTypeTargetsGenericParameterTitle" xml:space="preserve">
-    <value>Target generic argument does not satisfy 'DynamicallyAccessedMembersAttribute' in target method or type. The return value of the source method does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchMethodReturnTypeTargetsGenericParameterMessage" xml:space="preserve">
-    <value>'{0}' generic argument does not satisfy {3} in '{1}'. The return value of method '{2}' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchFieldTargetsParameterTitle" xml:space="preserve">
-    <value>Target parameter argument does not satisfy 'DynamicallyAccessedMembersAttribute' in call to target method. The source field does not have matching annotations.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchFieldTargetsParameterMessage" xml:space="preserve">
-    <value>'{0}' argument does not satisfy {3} in call to '{1}'. The field '{2}' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchFieldTargetsMethodReturnTypeTitle" xml:space="preserve">
-    <value>Target method return value does not satisfy 'DynamicallyAccessedMembersAttribute' requirements. The source field does not have matching annotations.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchFieldTargetsMethodReturnTypeMessage" xml:space="preserve">
-    <value>'{0}' method return value does not satisfy {2} requirements. The field '{1}' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchFieldTargetsFieldTitle" xml:space="preserve">
-    <value>Value stored in target field does not satisfy 'DynamicallyAccessedMembersAttribute' requirements. The source field does not have matching annotations.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchFieldTargetsFieldMessage" xml:space="preserve">
-    <value>value stored in field '{0}' does not satisfy {2} requirements. The field '{1}' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchFieldTargetsThisParameterTitle" xml:space="preserve">
-    <value>'this' argument does not satisfy 'DynamicallyAccessedMembersAttribute' in call to target method. The source field does not have matching annotations.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchFieldTargetsThisParameterMessage" xml:space="preserve">
-    <value>'this' argument does not satisfy {2} in call to '{0}'. The field '{1}' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchFieldTargetsGenericParameterTitle" xml:space="preserve">
-    <value>Target generic argument does not satisfy 'DynamicallyAccessedMembersAttribute' in target method or type. The source field does not have matching annotations.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchFieldTargetsGenericParameterMessage" xml:space="preserve">
-    <value>'{0}' generic argument does not satisfy {3} in '{1}'. The field '{2}' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchThisParameterTargetsParameterTitle" xml:space="preserve">
-    <value>Target parameter argument does not satisfy 'DynamicallyAccessedMembersAttribute' in call to target method. The implicit 'this' argument of source method does not have matching annotations.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchThisParameterTargetsParameterMessage" xml:space="preserve">
-    <value>'{0}' argument does not satisfy {3} in call to '{1}'. The implicit 'this' argument of method '{2}' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchThisParameterTargetsMethodReturnTypeTitle" xml:space="preserve">
-    <value>Target method return value does not satisfy 'DynamicallyAccessedMembersAttribute' requirements. The implicit 'this' argument of source method does not have matching annotations.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchThisParameterTargetsMethodReturnTypeMessage" xml:space="preserve">
-    <value>'{0}' method return value does not satisfy {2} requirements. The implicit 'this' argument of method '{1}' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchThisParameterTargetsFieldTitle" xml:space="preserve">
-    <value>Value stored in target field does not satisfy 'DynamicallyAccessedMembersAttribute' requirements. The implicit 'this' argument of source method does not have matching annotations.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchThisParameterTargetsFieldMessage" xml:space="preserve">
-    <value>value stored in field '{0}' does not satisfy {2} requirements. The implicit 'this' argument of method '{1}' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchThisParameterTargetsThisParameterTitle" xml:space="preserve">
-    <value>'this' argument does not satisfy 'DynamicallyAccessedMembersAttribute' in call to target method. The implicit 'this' argument of source method does not have matching annotations.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchThisParameterTargetsThisParameterMessage" xml:space="preserve">
-    <value>'this' argument does not satisfy {2} in call to '{0}'. The implicit 'this' argument of method '{1}' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchThisParameterTargetsGenericParameterTitle" xml:space="preserve">
-    <value>Target generic argument does not satisfy 'DynamicallyAccessedMembersAttribute' in target method or type. The implicit 'this' argument of source method does not have matching annotations.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchThisParameterTargetsGenericParameterMessage" xml:space="preserve">
-    <value>'{0}' generic argument does not satisfy {3} in '{1}'. The implicit 'this' argument of method '{2}' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchTypeArgumentTargetsParameterTitle" xml:space="preserve">
-    <value>Target parameter argument does not satisfy 'DynamicallyAccessedMembersAttribute' in call to target method. The generic parameter of the source method or type does not have matching annotations.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchTypeArgumentTargetsParameterMessage" xml:space="preserve">
-    <value>'{0}' argument does not satisfy {4} in call to '{1}'. The generic parameter '{2}' of '{3}' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchTypeArgumentTargetsMethodReturnTypeTitle" xml:space="preserve">
-    <value>Target method return value does not satisfy 'DynamicallyAccessedMembersAttribute' requirements. The generic parameter of the source method or type does not have matching annotations.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchTypeArgumentTargetsMethodReturnTypeMessage" xml:space="preserve">
-    <value>'{0}' method return value does not satisfy {3} requirements. The generic parameter '{1}' of '{2}' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchTypeArgumentTargetsFieldTitle" xml:space="preserve">
-    <value>Value stored in target field does not satisfy 'DynamicallyAccessedMembersAttribute' requirements. The generic parameter of the source method or type does not have matching annotations.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchTypeArgumentTargetsFieldMessage" xml:space="preserve">
-    <value>value stored in field '{0}' does not satisfy {3} requirements. The generic parameter '{1}' of '{2}' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchTypeArgumentTargetsThisParameterTitle" xml:space="preserve">
-    <value>'this' argument does not satisfy 'DynamicallyAccessedMembersAttribute' in call to target method. The generic parameter of the source method or type does not have matching annotations.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchTypeArgumentTargetsThisParameterMessage" xml:space="preserve">
-    <value>'this' argument does not satisfy {3} in call to '{0}'. The generic parameter '{1}' of '{2}' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchTypeArgumentTargetsGenericParameterTitle" xml:space="preserve">
-    <value>Target generic argument does not satisfy 'DynamicallyAccessedMembersAttribute' in target method or type. The generic parameter of the source method or type does not have matching annotations.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchTypeArgumentTargetsGenericParameterMessage" xml:space="preserve">
-    <value>'{0}' generic argument does not satisfy {4} in '{1}'. The generic parameter '{2}' of '{3}' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchOnMethodParameterBetweenOverridesTitle" xml:space="preserve">
-    <value>'DynamicallyAccessedMemberTypes' on the parameter of method don't match overridden parameter of method. All overridden members must have the same 'DynamicallyAccessedMembersAttribute' usage.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchOnMethodParameterBetweenOverridesMessage" xml:space="preserve">
-    <value>'DynamicallyAccessedMemberTypes' in 'DynamicallyAccessedMembersAttribute' on the parameter '{0}' of method '{1}' don't match overridden parameter '{2}' of method '{3}'. All overridden members must have the same 'DynamicallyAccessedMembersAttribute' usage.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchOnMethodReturnValueBetweenOverridesTitle" xml:space="preserve">
-    <value>'DynamicallyAccessedMemberTypes' on the return value of method don't match overridden return value of method. All overridden members must have the same 'DynamicallyAccessedMembersAttribute' usage.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchOnMethodReturnValueBetweenOverridesMessage" xml:space="preserve">
-    <value>'DynamicallyAccessedMemberTypes' in 'DynamicallyAccessedMembersAttribute' on the return value of method '{0}' don't match overridden return value of method '{1}'. All overridden members must have the same 'DynamicallyAccessedMembersAttribute' usage.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchOnImplicitThisBetweenOverridesTitle" xml:space="preserve">
-    <value>'DynamicallyAccessedMemberTypes' on the implicit 'this' parameter of method don't match overridden implicit 'this' parameter of method. All overridden members must have the same 'DynamicallyAccessedMembersAttribute' usage.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchOnImplicitThisBetweenOverridesMessage" xml:space="preserve">
-    <value>'DynamicallyAccessedMemberTypes' in 'DynamicallyAccessedMembersAttribute' on the implicit 'this' parameter of method '{0}' don't match overridden implicit 'this' parameter of method '{1}'. All overridden members must have the same 'DynamicallyAccessedMembersAttribute' usage.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchOnGenericParameterBetweenOverridesTitle" xml:space="preserve">
-    <value>'DynamicallyAccessedMemberTypes' on the generic parameter of method or type don't match overridden generic parameter method or type. All overridden members must have the same 'DynamicallyAccessedMembersAttribute' usage.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMismatchOnGenericParameterBetweenOverridesMessage" xml:space="preserve">
-    <value>'DynamicallyAccessedMemberTypes' in 'DynamicallyAccessedMembersAttribute' on the generic parameter '{0}' of '{1}' don't match overridden generic parameter '{2}' of '{3}'. All overridden members must have the same 'DynamicallyAccessedMembersAttribute' usage.</value>
-  </data>
-  <data name="CaseInsensitiveTypeGetTypeCallIsNotSupportedTitle" xml:space="preserve">
-    <value>Call to 'Type.GetType' method can perform case insensitive lookup of the type, currently ILLink can not guarantee presence of all the matching types.</value>
-  </data>
-  <data name="CaseInsensitiveTypeGetTypeCallIsNotSupportedMessage" xml:space="preserve">
-    <value>Call to '{0}' can perform case insensitive lookup of the type, currently ILLink can not guarantee presence of all the matching types.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersOnFieldCanOnlyApplyToTypesOrStringsTitle" xml:space="preserve">
-    <value>Field has 'DynamicallyAccessedMembersAttribute', but that attribute can only be applied to fields of type 'System.Type' or 'System.String'.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersOnFieldCanOnlyApplyToTypesOrStringsMessage" xml:space="preserve">
-    <value>Field '{0}' has 'DynamicallyAccessedMembersAttribute', but that attribute can only be applied to fields of type 'System.Type' or 'System.String'.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersOnMethodParameterCanOnlyApplyToTypesOrStringsTitle" xml:space="preserve">
-    <value>Parameter of method has 'DynamicallyAccessedMembersAttribute', but that attribute can only be applied to parameters of type 'System.Type' or 'System.String'.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersOnMethodParameterCanOnlyApplyToTypesOrStringsMessage" xml:space="preserve">
-    <value>Parameter '{0}' of method '{1}' has 'DynamicallyAccessedMembersAttribute', but that attribute can only be applied to parameters of type 'System.Type' or 'System.String'.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersOnPropertyCanOnlyApplyToTypesOrStringsTitle" xml:space="preserve">
-    <value>Property has 'DynamicallyAccessedMembersAttribute', but that attribute can only be applied to properties of type 'System.Type' or 'System.String'.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersOnPropertyCanOnlyApplyToTypesOrStringsMessage" xml:space="preserve">
-    <value>Property '{0}' has 'DynamicallyAccessedMembersAttribute', but that attribute can only be applied to properties of type 'System.Type' or 'System.String'.</value>
-  </data>
-  <data name="XmlUnsuportedWildcardTitle" xml:space="preserve">
-    <value>XML contains unsupported wildcard for assembly 'fullname' attribute.</value>
-  </data>
-  <data name="XmlUnsuportedWildcardMessage" xml:space="preserve">
-    <value>XML contains unsupported wildcard for assembly 'fullname' attribute.</value>
-  </data>
-  <data name="AssemblyWithEmbeddedXmlApplyToAnotherAssemblyTitle" xml:space="preserve">
-    <value>Embedded XML in assembly contains assembly "fullname" attribute for another assembly</value>
-  </data>
-  <data name="AssemblyWithEmbeddedXmlApplyToAnotherAssemblyMessage" xml:space="preserve">
-    <value>Embedded XML in assembly '{0}' contains assembly "fullname" attribute for another assembly '{1}'</value>
-  </data>
-  <data name="InvalidIsTrimmableValueTitle" xml:space="preserve">
-    <value>Invalid AssemblyMetadata 'IsTrimmable' attribute in assembly. Value must be "True".</value>
-  </data>
-  <data name="InvalidIsTrimmableValueMessage" xml:space="preserve">
-    <value>Invalid AssemblyMetadata("IsTrimmable", "{0}") attribute in assembly '{1}'. Value must be "True".</value>
-  </data>
-  <data name="PropertyAccessorParameterInLinqExpressionsCannotBeStaticallyDeterminedTitle" xml:space="preserve">
-    <value>Value passed to the parameter of method cannot be statically determined as a property accessor.</value>
-  </data>
-  <data name="PropertyAccessorParameterInLinqExpressionsCannotBeStaticallyDeterminedMessage" xml:space="preserve">
-    <value>Value passed to the '{0}' parameter of method '{1}' cannot be statically determined as a property accessor.</value>
-  </data>
-  <data name="AssemblyProducedTrimWarningsTitle" xml:space="preserve">
-    <value>Assembly produced trim warnings.</value>
-  </data>
-  <data name="AssemblyProducedTrimWarningsMessage" xml:space="preserve">
-    <value>Assembly '{0}' produced trim warnings. For more information see https://aka.ms/dotnet-illink/libraries</value>
-  </data>
-  <data name="TypeWasNotFoundInAssemblyNorBaseLibraryTitle" xml:space="preserve">
-    <value>Type was not found in the caller assembly nor in the base library. Type name strings used for dynamically accessing a type should be assembly qualified.</value>
-  </data>
-  <data name="TypeWasNotFoundInAssemblyNorBaseLibraryMessage" xml:space="preserve">
-    <value>Type '{0}' was not found in the caller assembly nor in the base library. Type name strings used for dynamically accessing a type should be assembly qualified.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersOnMethodReturnValueCanOnlyApplyToTypesOrStringsTitle" xml:space="preserve">
-    <value>Return type of method has 'DynamicallyAccessedMembersAttribute', but that attribute can only be applied to properties of type 'System.Type' or 'System.String'.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersOnMethodReturnValueCanOnlyApplyToTypesOrStringsMessage" xml:space="preserve">
-    <value>Return type of method '{0}' has 'DynamicallyAccessedMembersAttribute', but that attribute can only be applied to properties of type 'System.Type' or 'System.String'.</value>
-  </data>
-  <data name="MethodsAreAssociatedWithStateMachineTitle" xml:space="preserve">
-    <value>Trimmer currently can't correctly handle if the same compiler generated state machine type is associated (via the state machine attributes) with two different methods.</value>
-  </data>
-  <data name="MethodsAreAssociatedWithStateMachineMessage" xml:space="preserve">
-    <value>Methods '{0}' and '{1}' are both associated with state machine type '{2}'. This is currently unsupported and may lead to incorrectly reported warnings.</value>
-  </data>
-  <data name="InvalidScopeInUnconditionalSuppressMessageTitle" xml:space="preserve">
-    <value>Invalid scope used in 'UnconditionalSuppressMessageAttribute'. The only scopes supported on global unconditional suppressions are 'module', 'type' and 'member'.</value>
-  </data>
-  <data name="InvalidScopeInUnconditionalSuppressMessageMessage" xml:space="preserve">
-    <value>Invalid scope '{0}' used in 'UnconditionalSuppressMessageAttribute' on module '{1}' with target '{2}'.</value>
-  </data>
-  <data name="RequiresUnreferencedCodeOnBaseClassTitle" xml:space="preserve">
-    <value>Types that derive from a base class with 'RequiresUnreferencedCodeAttribute' need to explicitly use the 'RequiresUnreferencedCodeAttribute' or suppress this warning</value>
-  </data>
-  <data name="RequiresUnreferencedCodeOnBaseClassMessage" xml:space="preserve">
-    <value>Type '{0}' derives from '{1}' which has 'RequiresUnreferencedCodeAttribute'. {2}{3}</value>
-  </data>
-  <data name="DynamicallyAccessedMembersFieldAccessedViaReflectionTitle" xml:space="preserve">
-    <value>Field with 'DynamicallyAccessedMembersAttribute' is accessed via reflection. Trimmer can't guarantee availability of the requirements of the field.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersFieldAccessedViaReflectionMessage" xml:space="preserve">
-    <value>Field '{0}' with 'DynamicallyAccessedMembersAttribute' is accessed via reflection. Trimmer can't guarantee availability of the requirements of the field.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMethodAccessedViaReflectionTitle" xml:space="preserve">
-    <value>Method with parameters or return value with `DynamicallyAccessedMembersAttribute` is accessed via reflection. Trimmer can't guarantee availability of the requirements of the method.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersMethodAccessedViaReflectionMessage" xml:space="preserve">
-    <value>Method '{0}' with parameters or return value with `DynamicallyAccessedMembersAttribute` is accessed via reflection. Trimmer can't guarantee availability of the requirements of the method.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersOnTypeReferencesMemberWithRequiresUnreferencedCodeTitle" xml:space="preserve">
-    <value>'DynamicallyAccessedMembersAttribute' on a type or one of its base types references a member which requires unreferenced code.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersOnTypeReferencesMemberWithRequiresUnreferencedCodeMessage" xml:space="preserve">
-    <value>'DynamicallyAccessedMembersAttribute' on '{0}' or one of its base types references '{1}' which requires unreferenced code.{2}{3}</value>
-  </data>
-  <data name="DynamicallyAccessedMembersOnTypeReferencesMemberOnBaseWithRequiresUnreferencedCodeTitle" xml:space="preserve">
-    <value>'DynamicallyAccessedMembersAttribute' on a type or one of its base types references a member which requires unreferenced code.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersOnTypeReferencesMemberOnBaseWithRequiresUnreferencedCodeMessage" xml:space="preserve">
-    <value>'DynamicallyAccessedMembersAttribute' on '{0}' or one of its base types references '{1}' which requires unreferenced code.{2}{3}</value>
-  </data>
-  <data name="DynamicallyAccessedMembersOnTypeReferencesMemberWithDynamicallyAccessedMembersTitle" xml:space="preserve">
-    <value>'DynamicallyAccessedMembersAttribute' on a type or one of its base types references a member which has 'DynamicallyAccessedMembersAttribute' requirements.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersOnTypeReferencesMemberWithDynamicallyAccessedMembersMessage" xml:space="preserve">
-    <value>'DynamicallyAccessedMembersAttribute' on '{0}' or one of its base types references '{1}' which has 'DynamicallyAccessedMembersAttribute' requirements.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersOnTypeReferencesMemberOnBaseWithDynamicallyAccessedMembersTitle" xml:space="preserve">
-    <value>'DynamicallyAccessedMembersAttribute' on a type or one of its base types references a member which has 'DynamicallyAccessedMembersAttribute' requirements.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersOnTypeReferencesMemberOnBaseWithDynamicallyAccessedMembersMessage" xml:space="preserve">
-    <value>'DynamicallyAccessedMembersAttribute' on '{0}' or one of its base types references '{1}' which has 'DynamicallyAccessedMembersAttribute' requirements.</value>
-  </data>
-  <data name="RequiresUnreferencedCodeOnStaticConstructorTitle" xml:space="preserve">
-    <value>The use of 'RequiresUnreferencedCodeAttribute' on static constructors is disallowed since is a method not callable by the user, is only called by the runtime. Placing the attribute directly on the static constructor will have no effect, instead use 'RequiresUnreferencedCodeAttribute' on the type which will handle warning and silencing from the static constructor.</value>
-  </data>
-  <data name="RequiresUnreferencedCodeOnStaticConstructorMessage" xml:space="preserve">
-    <value>'RequiresUnreferencedCodeAttribute' cannot be placed directly on static constructor '{0}', consider placing 'RequiresUnreferencedCodeAttribute' on the type declaration instead.</value>
-  </data>
-  <data name="MethodsAreAssociatedWithUserMethodTitle" xml:space="preserve">
-    <value>Trimmer currently can't correctly handle if the same compiler generated lambda or local function is associated with two different methods.</value>
-  </data>
-  <data name="MethodsAreAssociatedWithUserMethodMessage" xml:space="preserve">
-    <value>Methods '{0}' and '{1}' are both associated with lambda or local function '{2}'. This is currently unsupported and may lead to incorrectly reported warnings.</value>
-  </data>
-  <data name="CompilerGeneratedMemberAccessedViaReflectionTitle" xml:space="preserve">
-    <value>Compiler-generated member is accessed via reflection. Trimmer can't guarantee availability of the requirements of the member.</value>
-  </data>
-  <data name="CompilerGeneratedMemberAccessedViaReflectionMessage" xml:space="preserve">
-    <value>Compiler-generated member '{0}' is accessed via reflection. Trimmer can't guarantee availability of the requirements of the member.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersOnTypeReferencesCompilerGeneratedMemberTitle" xml:space="preserve">
-    <value>'DynamicallyAccessedMemberAttribute' on a type or one of its base types references a compiler-generated member.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersOnTypeReferencesCompilerGeneratedMemberMessage" xml:space="preserve">
-    <value>'DynamicallyAccessedMemberAttribute' on '{0}' or one of its base types references compiler-generated member '{1}'.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersOnTypeReferencesCompilerGeneratedMemberOnBaseTitle" xml:space="preserve">
-    <value>'DynamicallyAccessedMemberAttribute' on a type or one of its base types references a compiler-generated member.</value>
-  </data>
-  <data name="DynamicallyAccessedMembersOnTypeReferencesCompilerGeneratedMemberOnBaseMessage" xml:space="preserve">
-    <value>'DynamicallyAccessedMemberAttribute' on '{0}' or one of its base types references compiler-generated member '{1}'.</value>
-  </data>
-  <data name="AvoidAssemblyLocationInSingleFileTitle" xml:space="preserve">
-    <value>Avoid accessing Assembly file path when publishing as a single file</value>
-  </data>
-  <data name="AvoidAssemblyLocationInSingleFileMessage" xml:space="preserve">
-    <value>'{0}' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, consider calling 'System.AppContext.BaseDirectory'.</value>
-  </data>
-  <data name="AvoidAssemblyGetFilesInSingleFileTitle" xml:space="preserve">
-    <value>Avoid accessing Assembly file path when publishing as a single file</value>
-  </data>
-  <data name="AvoidAssemblyGetFilesInSingleFileMessage" xml:space="preserve">
-    <value>'{0}' will throw for assemblies embedded in a single-file app</value>
-  </data>
-  <data name="RequiresAssemblyFilesTitle" xml:space="preserve">
-    <value>Avoid calling members marked with 'RequiresAssemblyFilesAttribute' when publishing as a single-file</value>
-  </data>
-  <data name="RequiresAssemblyFilesMessage" xml:space="preserve">
-    <value>Using member '{0}' which has 'RequiresAssemblyFilesAttribute' can break functionality when embedded in a single-file app.{1}{2}</value>
-  </data>
-  <data name="RequiresAssemblyFilesAttributeMismatchTitle" xml:space="preserve">
-    <value>'RequiresAssemblyFilesAttribute' annotations must match across all interface implementations or overrides.</value>
-  </data>
-  <data name="RequiresAssemblyFilesAttributeMismatchMessage" xml:space="preserve">
-    <value>{0}. 'RequiresAssemblyFilesAttribute' annotations must match across all interface implementations or overrides.</value>
-  </data>
-  <data name="RequiresDynamicCodeTitle" xml:space="preserve">
-    <value>Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling.</value>
-  </data>
-  <data name="RequiresDynamicCodeMessage" xml:space="preserve">
-    <value>Using member '{0}' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling.{1}{2}</value>
-  </data>
-  <data name="RequiresDynamicCodeAttributeMismatchTitle" xml:space="preserve">
-    <value>'RequiresDynamicCodeAttribute' annotations must match across all interface implementations or overrides.</value>
-  </data>
-  <data name="RequiresDynamicCodeAttributeMismatchMessage" xml:space="preserve">
-    <value>{0}. 'RequiresDynamicCodeAttribute' annotations must match across all interface implementations or overrides.</value>
-  </data>
-  <data name="COMInteropNotSupportedInFullAOTTitle" xml:space="preserve">
-    <value>COM interop is not supported with full ahead of time compilation.</value>
-  </data>
-  <data name="COMInteropNotSupportedInFullAOTMessage" xml:space="preserve">
-    <value>COM interop is not supported with full ahead of time compilation.</value>
-  </data>
-  <data name="AssemblyProducedAOTWarningsTitle" xml:space="preserve">
-    <value>Assembly produced AOT analysis warnings.</value>
-  </data>
-  <data name="AssemblyProducedAOTWarningsMessage" xml:space="preserve">
-    <value>Assembly '{0}' produced AOT analysis warnings.</value>
-  </data>
-  <data name="GenericRecursionCycleTitle" xml:space="preserve">
-    <value>Generic expansion to was aborted due to generic recursion. An exception will be thrown at runtime if this codepath is ever reached.</value>
-  </data>
-  <data name="GenericRecursionCycleMessage" xml:space="preserve">
-    <value>Generic expansion to '{0}' was aborted due to generic recursion. An exception will be thrown at runtime if this codepath is ever reached. Generic recursion also negatively affects compilation speed and the size of the compilation output. It is advisable to remove the source of the generic recursion by restructuring the program around the source of recursion. The source of generic recursion might include: {1}</value>
-  </data>
-  <data name="CorrectnessOfAbstractDelegatesCannotBeGuaranteedTitle" xml:space="preserve">
-    <value>P/invoke method declares a parameter with an abstract delegate. Correctness of interop for abstract delegates cannot be guaranteed after native compilation.</value>
-  </data>
-  <data name="CorrectnessOfAbstractDelegatesCannotBeGuaranteedMessage" xml:space="preserve">
-    <value>P/invoke method '{0}' declares a parameter with an abstract delegate. Correctness of interop for abstract delegates cannot be guaranteed after native compilation: the marshalling code for the delegate might not be available. Use a non-abstract delegate type or ensure any delegate instance passed as parameter is marked with `UnmanagedFunctionPointerAttribute`.</value>
-  </data>
-  <data name="BaseRequiresMismatchMessage" xml:space="preserve">
-    <value>Base member '{2}' with '{0}' has a derived member '{1}' without '{0}'</value>
-  </data>
-  <data name="DerivedRequiresMismatchMessage" xml:space="preserve">
-    <value>Member '{1}' with '{0}' overrides base member '{2}' without '{0}'</value>
-  </data>
-  <data name="ImplementationRequiresMismatchMessage" xml:space="preserve">
-    <value>Member '{1}' with '{0}' implements interface member '{2}' without '{0}'</value>
-  </data>
-  <data name="InterfaceRequiresMismatchMessage" xml:space="preserve">
-    <value>Interface member '{2}' with '{0}' has an implementation member '{1}' without '{0}'</value>
-  </data>
-  <data name="RequiresOnBaseClassMessage" xml:space="preserve">
-    <value>Type '{0}' derives from '{1}' which has 'RequiresUnreferencedCodeAttribute'. {2}{3}</value>
-  </data>
-  <data name="RequiresOnBaseClassTitle" xml:space="preserve">
-    <value>Types that derive from a base class with 'RequiresUnreferencedCodeAttribute' need to explicitly use the 'RequiresUnreferencedCodeAttribute' or suppress this warning</value>
-  </data>
-  <data name="RequiresDynamicCodeOnStaticConstructorMessage" xml:space="preserve">
-    <value>'RequiresDynamicCodeAttribute' cannot be placed directly on static constructor '{0}'.</value>
-  </data>
-  <data name="RequiresDynamicCodeOnStaticConstructorTitle" xml:space="preserve">
-    <value>The use of 'RequiresDynamicCodeAttribute' on static constructors is disallowed since is a method not callable by the user, is only called by the runtime. Placing the attribute directly on the static constructor will have no effect, instead use 'RequiresUnreferencedCodeAttribute' on the type which will handle warning and silencing from the static constructor.</value>
-  </data>
-  <data name="RequiresAssemblyFilesOnStaticConstructorMessage" xml:space="preserve">
-    <value>'RequiresAssemblyFilesAttribute' cannot be placed directly on static constructor '{0}'.</value>
-  </data>
-  <data name="RequiresAssemblyFilesOnStaticConstructorTitle" xml:space="preserve">
-    <value>The use of 'RequiresAssemblyFilesAttribute' on static constructors is disallowed since is a method not callable by the user, is only called by the runtime. Placing the attribute directly on the static constructor will have no effect, instead use 'RequiresUnreferencedCodeAttribute' on the type which will handle warning and silencing from the static constructor.</value>
-  </data>
-  <data name="UnrecognizedInternalAttributeMessage" xml:space="preserve">
-    <value>The internal attribute name '{0}' being used in the xml is not supported by the ILLink, check the spelling and the supported internal attributes.</value>
-  </data>
-  <data name="UnrecognizedInternalAttributeTitle" xml:space="preserve">
-    <value>Unrecognized internal attribute '{0}'</value>
-  </data>
-  <data name="InvalidDependenciesFileFormatMessage" xml:space="preserve">
-    <value>The only allowed file types are Xml or Dgml.</value>
-  </data>
-  <data name="InvalidDependenciesFileFormatTitle" xml:space="preserve">
-    <value>Unrecognized dependencies file type.</value>
-  </data>
-  <data name="RedundantSuppressionMessage" xml:space="preserve">
-    <value>Unused 'UnconditionalSuppressMessageAttribute' for warning '{0}'. Consider removing the unused warning suppression.</value>
-  </data>
-  <data name="RedundantSuppressionTitle" xml:space="preserve">
-    <value>Unused 'UnconditionalSuppressMessageAttribute' found. Consider removing the unused warning suppression.</value>
-  </data>
-</root>
diff --git a/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/ArrayValue.cs b/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/ArrayValue.cs
deleted file mode 100644 (file)
index 258d38a..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System.Linq;
-using ILLink.Shared.DataFlow;
-using MultiValue = ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>;
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.TrimAnalysis
-{
-       internal sealed partial record ArrayValue : SingleValue
-       {
-               private static ValueSetLattice<SingleValue> MultiValueLattice => default;
-
-               public readonly SingleValue Size;
-
-               public partial bool TryGetValueByIndex (int index, out MultiValue value);
-
-               public static MultiValue SanitizeArrayElementValue (MultiValue input)
-               {
-                       // We need to be careful about self-referencing arrays. It's easy to have an array which has one of the elements as itself:
-                       // var arr = new object[1];
-                       // arr[0] = arr;
-                       //
-                       // We can't deep copy this, as it's an infinite recursion. And we can't easily guard against it with checks to self-referencing
-                       // arrays - as this could be two or more levels deep.
-                       //
-                       // We need to deep copy arrays because we don't have a good way to track references (we treat everything as a value type)
-                       // and thus we could get bad results if the array is involved in multiple branches for example.
-                       // That said, it only matters for us to track arrays to be able to get integers or Type values (and we really only need relatively simple cases)
-                       //
-                       // So we will simply treat array value as an element value as "too complex to analyze" and give up by storing Unknown instead
-
-                       bool needSanitization = false;
-                       foreach (var v in input) {
-                               if (v is ArrayValue)
-                                       needSanitization = true;
-                       }
-
-                       if (!needSanitization)
-                               return input;
-
-                       return new (input.Select (v => v is ArrayValue ? UnknownValue.Instance : v));
-               }
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/ConstIntValue.cs b/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/ConstIntValue.cs
deleted file mode 100644 (file)
index b881656..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using ILLink.Shared.DataFlow;
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.TrimAnalysis
-{
-       /// <summary>
-       /// Represents a ldc on an int32.
-       /// </summary>
-       internal sealed record ConstIntValue : SingleValue
-       {
-               public ConstIntValue (int value) => Value = value;
-
-               public readonly int Value;
-
-               public override SingleValue DeepCopy () => this; // This value is immutable
-
-               public override string ToString () => this.ValueToString (Value);
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/DiagnosticContext.cs b/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/DiagnosticContext.cs
deleted file mode 100644 (file)
index 42220a0..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.TrimAnalysis
-{
-       /// <summary>
-       /// The diagnostic context may be entirely disabled or some kinds of warnings may be suppressed.
-       /// The suppressions are determined based on the <paramref name="id"/>.
-       /// Typically the suppressions will be based on diagnostic category <see cref="DiagnosticCategory"/>:
-       ///  - Trimmer warnings (suppressed by RequiresUnreferencedCodeAttribute)
-       ///  - AOT warnings (suppressed by RequiresDynamicCodeAttribute)
-       ///  - Single-file warnings (suppressed by RequiresAssemblyFilesAttribute)
-       /// Note that not all categories are used/supported by all tools, for example the ILLink only handles trimmer warnings and ignores the rest.
-       /// </summary>
-       internal readonly partial struct DiagnosticContext
-       {
-               /// <param name="id">The diagnostic ID, this will be used to determine the category of diagnostic (trimmer, AOT, single-file)</param>
-               /// <param name="args">The arguments for diagnostic message.</param>
-               public partial void AddDiagnostic (DiagnosticId id, params string[] args);
-
-               /// <param name="id">The diagnostic ID, this will be used to determine the category of diagnostic (trimmer, AOT, single-file)</param>
-               /// <param name="actualValue">The value for the source of the diagnostic</param>
-               /// <param name="expectedAnnotationsValue">The value for the symbol causing the diagnostic</param>
-               /// <param name="args">The arguments for diagnostic message.</param>
-               public partial void AddDiagnostic (DiagnosticId id, ValueWithDynamicallyAccessedMembers actualValue, ValueWithDynamicallyAccessedMembers expectedAnnotationsValue, params string[] args);
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/FieldValue.cs b/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/FieldValue.cs
deleted file mode 100644 (file)
index 2c23547..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.TrimAnalysis
-{
-       internal sealed partial record FieldValue : ValueWithDynamicallyAccessedMembers;
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/FlowAnnotations.cs b/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/FlowAnnotations.cs
deleted file mode 100644 (file)
index 52006fe..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System.Diagnostics.CodeAnalysis;
-using ILLink.Shared.TypeSystemProxy;
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.TrimAnalysis
-{
-       // Shared helpers to go from MethodProxy to dataflow values.
-       public partial class FlowAnnotations
-       {
-               internal partial bool MethodRequiresDataFlowAnalysis (MethodProxy method);
-
-               internal partial MethodReturnValue GetMethodReturnValue (MethodProxy method, DynamicallyAccessedMemberTypes dynamicallyAccessedMemberTypes);
-
-               internal partial MethodReturnValue GetMethodReturnValue (MethodProxy method);
-
-               internal partial GenericParameterValue GetGenericParameterValue (GenericParameterProxy genericParameter);
-
-               internal partial MethodParameterValue GetMethodThisParameterValue (MethodProxy method, DynamicallyAccessedMemberTypes dynamicallyAccessedMemberTypes);
-
-               internal partial MethodParameterValue GetMethodThisParameterValue (MethodProxy method);
-
-               internal partial MethodParameterValue GetMethodParameterValue (ParameterProxy param, DynamicallyAccessedMemberTypes dynamicallyAccessedMemberTypes);
-
-               internal partial MethodParameterValue GetMethodParameterValue (ParameterProxy param);
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/GenericParameterValue.cs b/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/GenericParameterValue.cs
deleted file mode 100644 (file)
index 155ab10..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using ILLink.Shared.TypeSystemProxy;
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.TrimAnalysis
-{
-       /// <summary>
-       /// This is a System.Type value which represents generic parameter (basically result of typeof(T))
-       /// Its actual type is unknown, but it can have annotations.
-       /// </summary>
-       internal sealed partial record GenericParameterValue : ValueWithDynamicallyAccessedMembers
-       {
-               public readonly GenericParameterProxy GenericParameter;
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/HandleCallAction.cs b/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/HandleCallAction.cs
deleted file mode 100644 (file)
index 9d92255..0000000
+++ /dev/null
@@ -1,1456 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-using System.Collections.Generic;
-using System.Collections.Immutable;
-using System.Diagnostics;
-using System.Diagnostics.CodeAnalysis;
-using System.Linq;
-using System.Reflection;
-using System.Runtime.InteropServices;
-using ILLink.Shared.DataFlow;
-using ILLink.Shared.TypeSystemProxy;
-using MultiValue = ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>;
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.TrimAnalysis
-{
-       [StructLayout (LayoutKind.Auto)] // A good way to avoid CS0282, we don't really care about field order
-       internal partial struct HandleCallAction
-       {
-               private static ValueSetLattice<SingleValue> MultiValueLattice => default;
-
-               private readonly DiagnosticContext _diagnosticContext;
-               private readonly FlowAnnotations _annotations;
-               private readonly RequireDynamicallyAccessedMembersAction _requireDynamicallyAccessedMembersAction;
-
-               public bool Invoke (MethodProxy calledMethod, MultiValue instanceValue, IReadOnlyList<MultiValue> argumentValues, IntrinsicId intrinsicId, out MultiValue methodReturnValue)
-               {
-                       MultiValue? returnValue = null;
-
-                       bool requiresDataFlowAnalysis = _annotations.MethodRequiresDataFlowAnalysis (calledMethod);
-                       var annotatedMethodReturnValue = _annotations.GetMethodReturnValue (calledMethod);
-                       Debug.Assert (requiresDataFlowAnalysis || annotatedMethodReturnValue.DynamicallyAccessedMemberTypes == DynamicallyAccessedMemberTypes.None);
-
-                       switch (intrinsicId) {
-                       case IntrinsicId.IntrospectionExtensions_GetTypeInfo:
-                               Debug.Assert (instanceValue.IsEmpty ());
-                               Debug.Assert (argumentValues.Count == 1);
-
-                               // typeof(Foo).GetTypeInfo()... will be commonly present in code targeting
-                               // the dead-end reflection refactoring. The call doesn't do anything and we
-                               // don't want to lose the annotation.
-                               returnValue = argumentValues[0];
-                               break;
-
-                       case IntrinsicId.TypeInfo_AsType:
-                               // someType.AsType()... will be commonly present in code targeting
-                               // the dead-end reflection refactoring. The call doesn't do anything and we
-                               // don't want to lose the annotation.
-                               returnValue = instanceValue;
-                               break;
-
-                       //
-                       // UnderlyingSystemType
-                       //
-                       case IntrinsicId.Type_get_UnderlyingSystemType:
-                               // This is identity for the purposes of the analysis.
-                               returnValue = instanceValue;
-                               break;
-
-                       case IntrinsicId.Type_GetTypeFromHandle:
-                               // Infrastructure piece to support "typeof(Foo)" in IL and direct calls everywhere
-                               if (argumentValues[0].IsEmpty ()) {
-                                       returnValue = MultiValueLattice.Top;
-                                       break;
-                               }
-
-                               foreach (var value in argumentValues[0]) {
-                                       AddReturnValue (value switch {
-                                               RuntimeTypeHandleForNullableSystemTypeValue nullableSystemType
-                                                       => new NullableSystemTypeValue (nullableSystemType.NullableType, nullableSystemType.UnderlyingTypeValue),
-                                               // When generating type handles from IL, the GenericParameterValue with DAM annotations is not available.
-                                               // Once we convert it to a Value with annotations here, there is no need to convert it back in get_TypeHandle
-                                               RuntimeTypeHandleForNullableValueWithDynamicallyAccessedMembers nullableDamType when nullableDamType.UnderlyingTypeValue is RuntimeTypeHandleForGenericParameterValue underlyingGenericParameter
-                                                       => new NullableValueWithDynamicallyAccessedMembers (nullableDamType.NullableType, _annotations.GetGenericParameterValue (underlyingGenericParameter.GenericParameter)),
-                                               // This should only happen if the code does something like typeof(Nullable<>).MakeGenericType(methodParameter).TypeHandle
-                                               RuntimeTypeHandleForNullableValueWithDynamicallyAccessedMembers nullableDamType when nullableDamType.UnderlyingTypeValue is ValueWithDynamicallyAccessedMembers underlyingTypeValue
-                                                       => new NullableValueWithDynamicallyAccessedMembers (nullableDamType.NullableType, underlyingTypeValue),
-                                               RuntimeTypeHandleValue typeHandle
-                                                       => new SystemTypeValue (typeHandle.RepresentedType),
-                                               RuntimeTypeHandleForGenericParameterValue genericParam
-                                                       => _annotations.GetGenericParameterValue (genericParam.GenericParameter),
-                                               _ => annotatedMethodReturnValue
-                                       });
-                               }
-                               break;
-
-                       case IntrinsicId.Type_get_TypeHandle:
-                               if (instanceValue.IsEmpty ()) {
-                                       returnValue = MultiValueLattice.Top;
-                                       break;
-                               }
-
-                               foreach (var value in instanceValue) {
-                                       if (value != NullValue.Instance)
-                                               AddReturnValue (value switch {
-                                                       NullableSystemTypeValue nullableSystemType
-                                                               => new RuntimeTypeHandleForNullableSystemTypeValue (nullableSystemType.NullableType, nullableSystemType.UnderlyingTypeValue),
-                                                       NullableValueWithDynamicallyAccessedMembers nullableDamType when nullableDamType.UnderlyingTypeValue is GenericParameterValue genericParam
-                                                               => new RuntimeTypeHandleForNullableValueWithDynamicallyAccessedMembers (nullableDamType.NullableType, new RuntimeTypeHandleForGenericParameterValue (genericParam.GenericParameter)),
-                                                       NullableValueWithDynamicallyAccessedMembers nullableDamType
-                                                               => new RuntimeTypeHandleForNullableValueWithDynamicallyAccessedMembers (nullableDamType.NullableType, nullableDamType.UnderlyingTypeValue),
-                                                       SystemTypeValue typeHandle
-                                                               => new RuntimeTypeHandleValue (typeHandle.RepresentedType),
-                                                       GenericParameterValue genericParam
-                                                               => new RuntimeTypeHandleForGenericParameterValue (genericParam.GenericParameter),
-                                                       _ => annotatedMethodReturnValue
-                                               });
-                                       else
-                                               AddReturnValue (MultiValueLattice.Top);
-                               }
-                               break;
-
-                       // System.Reflection.MethodBase.GetMethodFromHandle (RuntimeMethodHandle handle)
-                       // System.Reflection.MethodBase.GetMethodFromHandle (RuntimeMethodHandle handle, RuntimeTypeHandle declaringType)
-                       case IntrinsicId.MethodBase_GetMethodFromHandle: {
-                                       if (argumentValues[0].IsEmpty ()) {
-                                               returnValue = MultiValueLattice.Top;
-                                               break;
-                                       }
-
-                                       // Infrastructure piece to support "ldtoken method -> GetMethodFromHandle"
-                                       foreach (var value in argumentValues[0]) {
-                                               if (value is RuntimeMethodHandleValue methodHandle)
-                                                       AddReturnValue (new SystemReflectionMethodBaseValue (methodHandle.RepresentedMethod));
-                                               else
-                                                       AddReturnValue (annotatedMethodReturnValue);
-                                       }
-                               }
-                               break;
-
-                       case IntrinsicId.MethodBase_get_MethodHandle: {
-                                       if (instanceValue.IsEmpty ()) {
-                                               returnValue = MultiValueLattice.Top;
-                                               break;
-                                       }
-
-                                       foreach (var value in instanceValue) {
-                                               if (value is SystemReflectionMethodBaseValue methodBaseValue)
-                                                       AddReturnValue (new RuntimeMethodHandleValue (methodBaseValue.RepresentedMethod));
-                                               else
-                                                       AddReturnValue (annotatedMethodReturnValue);
-                                       }
-                               }
-                               break;
-
-                       case IntrinsicId.TypeDelegator_Ctor:
-                       // This needs additional validation that the .ctor is called from a "newobj" instruction/operation
-                       // so it can't be done easily in shared code yet.
-                       case IntrinsicId.Array_Empty:
-                               // Array.Empty<T> must for now be handled by the specific implementation since it requires instantiated generic method handling
-                               methodReturnValue = MultiValueLattice.Top;
-                               return false;
-
-                       //
-                       // GetInterface (String)
-                       // GetInterface (String, bool)
-                       //
-                       case IntrinsicId.Type_GetInterface: {
-                                       if (instanceValue.IsEmpty () || argumentValues[0].IsEmpty ()) {
-                                               returnValue = MultiValueLattice.Top;
-                                               break;
-                                       }
-
-                                       var targetValue = _annotations.GetMethodThisParameterValue (calledMethod, DynamicallyAccessedMemberTypes.Interfaces);
-                                       foreach (var value in instanceValue) {
-                                               foreach (var interfaceName in argumentValues[0]) {
-                                                       if (interfaceName == NullValue.Instance) {
-                                                               // Throws on null string, so no return value.
-                                                               AddReturnValue (MultiValueLattice.Top);
-                                                       } else if (interfaceName is KnownStringValue stringValue && stringValue.Contents.Length == 0) {
-                                                               AddReturnValue (NullValue.Instance);
-                                                       } else {
-                                                               // For now no support for marking a single interface by name. We would have to correctly support
-                                                               // mangled names for generics to do that correctly. Simply mark all interfaces on the type for now.
-
-                                                               // Require Interfaces annotation
-                                                               _requireDynamicallyAccessedMembersAction.Invoke (value, targetValue);
-
-                                                               // Interfaces is transitive, so the return values will always have at least Interfaces annotation
-                                                               DynamicallyAccessedMemberTypes returnMemberTypes = DynamicallyAccessedMemberTypes.Interfaces;
-
-                                                               // Propagate All annotation across the call - All is a superset of Interfaces
-                                                               if (value is ValueWithDynamicallyAccessedMembers valueWithDynamicallyAccessedMembers
-                                                                       && valueWithDynamicallyAccessedMembers.DynamicallyAccessedMemberTypes == DynamicallyAccessedMemberTypes.All)
-                                                                       returnMemberTypes = DynamicallyAccessedMemberTypes.All;
-
-                                                               AddReturnValue (_annotations.GetMethodReturnValue (calledMethod, returnMemberTypes));
-                                                       }
-                                               }
-                                       }
-                               }
-                               break;
-
-                       //
-                       // AssemblyQualifiedName
-                       //
-                       case IntrinsicId.Type_get_AssemblyQualifiedName: {
-                                       if (instanceValue.IsEmpty ()) {
-                                               returnValue = MultiValueLattice.Top;
-                                               break;
-                                       }
-
-                                       foreach (var value in instanceValue) {
-                                               if (value is ValueWithDynamicallyAccessedMembers valueWithDynamicallyAccessedMembers) {
-                                                       // Currently we don't need to track the difference between Type and String annotated values
-                                                       // that only matters when we use them, so Type.GetType is the difference really.
-                                                       // For diagnostics we actually don't want to track the Type.AssemblyQualifiedName
-                                                       // as the annotation does not come from that call, but from its input.
-                                                       AddReturnValue (valueWithDynamicallyAccessedMembers);
-                                               } else if (value == NullValue.Instance) {
-                                                       // NullReferenceException, no return value.
-                                                       AddReturnValue (MultiValueLattice.Top);
-                                               } else {
-                                                       AddReturnValue (UnknownValue.Instance);
-                                               }
-                                       }
-                               }
-                               break;
-
-                       //
-                       // System.Runtime.CompilerServices.RuntimeHelpers
-                       //
-                       // RunClassConstructor (RuntimeTypeHandle type)
-                       //
-                       case IntrinsicId.RuntimeHelpers_RunClassConstructor:
-                               if (argumentValues[0].IsEmpty ()) {
-                                       returnValue = MultiValueLattice.Top;
-                                       break;
-                               }
-
-                               foreach (var typeHandleValue in argumentValues[0]) {
-                                       if (typeHandleValue is RuntimeTypeHandleValue runtimeTypeHandleValue) {
-                                               MarkStaticConstructor (runtimeTypeHandleValue.RepresentedType);
-                                       } else {
-                                               _diagnosticContext.AddDiagnostic (DiagnosticId.UnrecognizedTypeInRuntimeHelpersRunClassConstructor, calledMethod.GetDisplayName ());
-                                       }
-                               }
-                               break;
-
-                       //
-                       // GetConstructors (BindingFlags)
-                       // GetMethods (BindingFlags)
-                       // GetFields (BindingFlags)
-                       // GetEvents (BindingFlags)
-                       // GetProperties (BindingFlags)
-                       // GetNestedTypes (BindingFlags)
-                       // GetMembers (BindingFlags)
-                       //
-                       case IntrinsicId.Type_GetConstructors__BindingFlags:
-                       case IntrinsicId.Type_GetMethods__BindingFlags:
-                       case IntrinsicId.Type_GetFields__BindingFlags:
-                       case IntrinsicId.Type_GetProperties__BindingFlags:
-                       case IntrinsicId.Type_GetEvents__BindingFlags:
-                       case IntrinsicId.Type_GetNestedTypes__BindingFlags:
-                       case IntrinsicId.Type_GetMembers__BindingFlags: {
-                                       BindingFlags? bindingFlags;
-                                       bindingFlags = GetBindingFlagsFromValue (argumentValues[0]);
-                                       DynamicallyAccessedMemberTypes memberTypes;
-                                       if (BindingFlagsAreUnsupported (bindingFlags)) {
-                                               memberTypes = intrinsicId switch {
-                                                       IntrinsicId.Type_GetConstructors__BindingFlags => DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors,
-                                                       IntrinsicId.Type_GetMethods__BindingFlags => DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods,
-                                                       IntrinsicId.Type_GetEvents__BindingFlags => DynamicallyAccessedMemberTypes.PublicEvents | DynamicallyAccessedMemberTypes.NonPublicEvents,
-                                                       IntrinsicId.Type_GetFields__BindingFlags => DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields,
-                                                       IntrinsicId.Type_GetProperties__BindingFlags => DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties,
-                                                       IntrinsicId.Type_GetNestedTypes__BindingFlags => DynamicallyAccessedMemberTypes.PublicNestedTypes | DynamicallyAccessedMemberTypes.NonPublicNestedTypes,
-                                                       IntrinsicId.Type_GetMembers__BindingFlags => DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors |
-                                                               DynamicallyAccessedMemberTypes.PublicEvents | DynamicallyAccessedMemberTypes.NonPublicEvents |
-                                                               DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields |
-                                                               DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods |
-                                                               DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties |
-                                                               DynamicallyAccessedMemberTypes.PublicNestedTypes | DynamicallyAccessedMemberTypes.NonPublicNestedTypes,
-                                                       _ => throw new ArgumentException ($"Reflection call '{calledMethod.GetDisplayName ()}' inside '{GetContainingSymbolDisplayName ()}' is of unexpected member type."),
-                                               };
-                                       } else {
-                                               memberTypes = intrinsicId switch {
-                                                       IntrinsicId.Type_GetConstructors__BindingFlags => GetDynamicallyAccessedMemberTypesFromBindingFlagsForConstructors (bindingFlags),
-                                                       IntrinsicId.Type_GetMethods__BindingFlags => GetDynamicallyAccessedMemberTypesFromBindingFlagsForMethods (bindingFlags),
-                                                       IntrinsicId.Type_GetEvents__BindingFlags => GetDynamicallyAccessedMemberTypesFromBindingFlagsForEvents (bindingFlags),
-                                                       IntrinsicId.Type_GetFields__BindingFlags => GetDynamicallyAccessedMemberTypesFromBindingFlagsForFields (bindingFlags),
-                                                       IntrinsicId.Type_GetProperties__BindingFlags => GetDynamicallyAccessedMemberTypesFromBindingFlagsForProperties (bindingFlags),
-                                                       IntrinsicId.Type_GetNestedTypes__BindingFlags => GetDynamicallyAccessedMemberTypesFromBindingFlagsForNestedTypes (bindingFlags),
-                                                       IntrinsicId.Type_GetMembers__BindingFlags => GetDynamicallyAccessedMemberTypesFromBindingFlagsForMembers (bindingFlags),
-                                                       _ => throw new ArgumentException ($"Reflection call '{calledMethod.GetDisplayName ()}' inside '{GetContainingSymbolDisplayName ()}' is of unexpected member type."),
-                                               };
-                                       }
-
-                                       var targetValue = _annotations.GetMethodThisParameterValue (calledMethod, memberTypes);
-                                       _requireDynamicallyAccessedMembersAction.Invoke (instanceValue, targetValue);
-                               }
-                               break;
-
-                       //
-                       // GetField (string)
-                       // GetField (string, BindingFlags)
-                       // GetEvent (string)
-                       // GetEvent (string, BindingFlags)
-                       // GetProperty (string)
-                       // GetProperty (string, BindingFlags)
-                       // GetProperty (string, Type)
-                       // GetProperty (string, Type[])
-                       // GetProperty (string, Type, Type[])
-                       // GetProperty (string, Type, Type[], ParameterModifier[])
-                       // GetProperty (string, BindingFlags, Binder, Type, Type[], ParameterModifier[])
-                       //
-                       case IntrinsicId.Type_GetField:
-                       case IntrinsicId.Type_GetProperty:
-                       case IntrinsicId.Type_GetEvent: {
-                                       if (instanceValue.IsEmpty () || argumentValues[0].IsEmpty ()) {
-                                               returnValue = MultiValueLattice.Top;
-                                               break;
-                                       }
-
-                                       BindingFlags? bindingFlags;
-                                       if (calledMethod.HasParameterOfType ((ParameterIndex) 2, "System.Reflection.BindingFlags"))
-                                               bindingFlags = GetBindingFlagsFromValue (argumentValues[1]);
-                                       else
-                                               // Assume a default value for BindingFlags for methods that don't use BindingFlags as a parameter
-                                               bindingFlags = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public;
-
-                                       DynamicallyAccessedMemberTypes memberTypes = intrinsicId switch {
-                                               IntrinsicId.Type_GetEvent => GetDynamicallyAccessedMemberTypesFromBindingFlagsForEvents (bindingFlags),
-                                               IntrinsicId.Type_GetField => GetDynamicallyAccessedMemberTypesFromBindingFlagsForFields (bindingFlags),
-                                               IntrinsicId.Type_GetProperty => GetDynamicallyAccessedMemberTypesFromBindingFlagsForProperties (bindingFlags),
-                                               _ => throw new ArgumentException ($"Reflection call '{calledMethod.GetDisplayName ()}' inside '{GetContainingSymbolDisplayName ()}' is of unexpected member type."),
-                                       };
-
-                                       var targetValue = _annotations.GetMethodThisParameterValue (calledMethod, memberTypes);
-                                       foreach (var value in instanceValue) {
-                                               if (value is SystemTypeValue systemTypeValue) {
-                                                       foreach (var stringParam in argumentValues[0]) {
-                                                               if (stringParam is KnownStringValue stringValue && !BindingFlagsAreUnsupported (bindingFlags)) {
-                                                                       switch (intrinsicId) {
-                                                                       case IntrinsicId.Type_GetEvent:
-                                                                               MarkEventsOnTypeHierarchy (systemTypeValue.RepresentedType, stringValue.Contents, bindingFlags);
-                                                                               break;
-                                                                       case IntrinsicId.Type_GetField:
-                                                                               MarkFieldsOnTypeHierarchy (systemTypeValue.RepresentedType, stringValue.Contents, bindingFlags);
-                                                                               break;
-                                                                       case IntrinsicId.Type_GetProperty:
-                                                                               MarkPropertiesOnTypeHierarchy (systemTypeValue.RepresentedType, stringValue.Contents, bindingFlags);
-                                                                               break;
-                                                                       default:
-                                                                               Debug.Fail ("Unreachable.");
-                                                                               break;
-                                                                       }
-                                                               } else {
-                                                                       _requireDynamicallyAccessedMembersAction.Invoke (value, targetValue);
-                                                               }
-                                                       }
-                                               } else {
-                                                       _requireDynamicallyAccessedMembersAction.Invoke (value, targetValue);
-                                               }
-                                       }
-                               }
-                               break;
-
-                       //
-                       // GetMember (String)
-                       // GetMember (String, BindingFlags)
-                       // GetMember (String, MemberTypes, BindingFlags)
-                       //
-                       case IntrinsicId.Type_GetMember: {
-                                       if (instanceValue.IsEmpty ()) {
-                                               returnValue = MultiValueLattice.Top;
-                                               break;
-                                       }
-
-                                       BindingFlags? bindingFlags;
-                                       if (calledMethod.HasMetadataParametersCount (1)) {
-                                               // Assume a default value for BindingFlags for methods that don't use BindingFlags as a parameter
-                                               bindingFlags = BindingFlags.Public | BindingFlags.Instance;
-                                       } else if (calledMethod.HasMetadataParametersCount (2) && calledMethod.HasParameterOfType ((ParameterIndex) 2, "System.Reflection.BindingFlags"))
-                                               bindingFlags = GetBindingFlagsFromValue (argumentValues[1]);
-                                       else if (calledMethod.HasMetadataParametersCount (3) && calledMethod.HasParameterOfType ((ParameterIndex) 3, "System.Reflection.BindingFlags")) {
-                                               bindingFlags = GetBindingFlagsFromValue (argumentValues[2]);
-                                       } else // Non recognized intrinsic
-                                               throw new ArgumentException ($"Reflection call '{calledMethod.GetDisplayName ()}' inside '{GetContainingSymbolDisplayName ()}' is an unexpected intrinsic.");
-
-                                       DynamicallyAccessedMemberTypes requiredMemberTypes;
-                                       if (BindingFlagsAreUnsupported (bindingFlags)) {
-                                               requiredMemberTypes = DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors |
-                                                       DynamicallyAccessedMemberTypes.PublicEvents | DynamicallyAccessedMemberTypes.NonPublicEvents |
-                                                       DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields |
-                                                       DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods |
-                                                       DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties |
-                                                       DynamicallyAccessedMemberTypes.PublicNestedTypes | DynamicallyAccessedMemberTypes.NonPublicNestedTypes;
-                                       } else {
-                                               requiredMemberTypes = GetDynamicallyAccessedMemberTypesFromBindingFlagsForMembers (bindingFlags);
-                                       }
-
-                                       var targetValue = _annotations.GetMethodThisParameterValue (calledMethod, requiredMemberTypes);
-
-                                       // Go over all types we've seen
-                                       foreach (var value in instanceValue) {
-                                               // Mark based on bitfield requirements
-                                               _requireDynamicallyAccessedMembersAction.Invoke (value, targetValue);
-                                       }
-                               }
-                               break;
-
-                       //
-                       // GetMethod (string)
-                       // GetMethod (string, BindingFlags)
-                       // GetMethod (string, Type[])
-                       // GetMethod (string, Type[], ParameterModifier[])
-                       // GetMethod (string, BindingFlags, Type[])
-                       // GetMethod (string, BindingFlags, Binder, Type[], ParameterModifier[])
-                       // GetMethod (string, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[])
-                       // GetMethod (string, int, Type[])
-                       // GetMethod (string, int, Type[], ParameterModifier[]?)
-                       // GetMethod (string, int, BindingFlags, Binder?, Type[], ParameterModifier[]?)
-                       // GetMethod (string, int, BindingFlags, Binder?, CallingConventions, Type[], ParameterModifier[]?)
-                       //
-                       case IntrinsicId.Type_GetMethod: {
-                                       if (instanceValue.IsEmpty () || argumentValues[0].IsEmpty ()) {
-                                               returnValue = MultiValueLattice.Top;
-                                               break;
-                                       }
-
-                                       BindingFlags? bindingFlags;
-                                       if (calledMethod.HasParameterOfType ((ParameterIndex) 2, "System.Reflection.BindingFlags"))
-                                               bindingFlags = GetBindingFlagsFromValue (argumentValues[1]);
-                                       else if (calledMethod.HasParameterOfType ((ParameterIndex) 3, "System.Reflection.BindingFlags"))
-                                               bindingFlags = GetBindingFlagsFromValue (argumentValues[2]);
-                                       else
-                                               // Assume a default value for BindingFlags for methods that don't use BindingFlags as a parameter
-                                               bindingFlags = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public;
-
-                                       var targetValue = _annotations.GetMethodThisParameterValue (calledMethod, GetDynamicallyAccessedMemberTypesFromBindingFlagsForMethods (bindingFlags));
-                                       foreach (var value in instanceValue) {
-                                               if (value is SystemTypeValue systemTypeValue) {
-                                                       foreach (var stringParam in argumentValues[0]) {
-                                                               if (stringParam is KnownStringValue stringValue && !BindingFlagsAreUnsupported (bindingFlags)) {
-                                                                       AddReturnValue (MultiValueLattice.Top); ; // Initialize return value (so that it's not autofilled if there are no matching methods)
-                                                                       foreach (var methodValue in ProcessGetMethodByName (systemTypeValue.RepresentedType, stringValue.Contents, bindingFlags))
-                                                                               AddReturnValue (methodValue);
-                                                               } else if (stringParam is NullValue) {
-                                                                       // GetMethod(null) throws - so track empty value set as its result
-                                                                       AddReturnValue (MultiValueLattice.Top);
-                                                               } else {
-                                                                       // Otherwise fall back to the bitfield requirements
-                                                                       _requireDynamicallyAccessedMembersAction.Invoke (value, targetValue);
-                                                                       AddReturnValue (annotatedMethodReturnValue);
-                                                               }
-                                                       }
-                                               } else if (value is NullValue) {
-                                                       // null.GetMethod(...) throws - so track empty value set as its result
-                                                       AddReturnValue (MultiValueLattice.Top);
-                                               } else {
-                                                       // Otherwise fall back to the bitfield requirements
-                                                       _requireDynamicallyAccessedMembersAction.Invoke (value, targetValue);
-                                                       AddReturnValue (annotatedMethodReturnValue);
-                                               }
-                                       }
-                               }
-                               break;
-
-                       //
-                       // GetNestedType (string)
-                       // GetNestedType (string, BindingFlags)
-                       //
-                       case IntrinsicId.Type_GetNestedType: {
-                                       if (instanceValue.IsEmpty () || argumentValues[0].IsEmpty ()) {
-                                               returnValue = MultiValueLattice.Top;
-                                               break;
-                                       }
-
-                                       BindingFlags? bindingFlags;
-                                       if (calledMethod.HasParameterOfType ((ParameterIndex) 2, "System.Reflection.BindingFlags"))
-                                               bindingFlags = GetBindingFlagsFromValue (argumentValues[1]);
-                                       else
-                                               // Assume a default value for BindingFlags for methods that don't use BindingFlags as a parameter
-                                               bindingFlags = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public;
-
-                                       var targetValue = _annotations.GetMethodThisParameterValue (calledMethod, GetDynamicallyAccessedMemberTypesFromBindingFlagsForNestedTypes (bindingFlags));
-                                       foreach (var value in instanceValue) {
-                                               if (value is SystemTypeValue systemTypeValue) {
-                                                       foreach (var stringParam in argumentValues[0]) {
-                                                               if (stringParam is KnownStringValue stringValue && !BindingFlagsAreUnsupported (bindingFlags)) {
-                                                                       AddReturnValue (MultiValueLattice.Top);
-                                                                       foreach (var nestedTypeValue in GetNestedTypesOnType (systemTypeValue.RepresentedType, stringValue.Contents, bindingFlags)) {
-                                                                               MarkType (nestedTypeValue.RepresentedType);
-                                                                               AddReturnValue (nestedTypeValue);
-                                                                       }
-                                                               } else if (stringParam is NullValue) {
-                                                                       AddReturnValue (MultiValueLattice.Top);
-                                                               } else {
-                                                                       // Otherwise fall back to the bitfield requirements
-                                                                       _requireDynamicallyAccessedMembersAction.Invoke (value, targetValue);
-
-                                                                       // We only applied the annotation based on binding flags, so we will keep the necessary types
-                                                                       // but we will not keep anything on them. So the return value has no known annotations on it
-                                                                       AddReturnValue (_annotations.GetMethodReturnValue (calledMethod, DynamicallyAccessedMemberTypes.None));
-                                                               }
-                                                       }
-                                               } else if (value is NullValue) {
-                                                       // null.GetNestedType(..) throws - so track empty value set
-                                                       AddReturnValue (MultiValueLattice.Top);
-                                               } else {
-                                                       // Otherwise fall back to the bitfield requirements
-                                                       _requireDynamicallyAccessedMembersAction.Invoke (value, targetValue);
-
-                                                       // If the input is an annotated value which has All - we can propagate that to the return value
-                                                       // since All applies recursively to all nested type (see MarkStep.MarkEntireType).
-                                                       // Otherwise we only mark the nested type itself, nothing on it, so the return value has no annotation on it.
-                                                       if (value is ValueWithDynamicallyAccessedMembers { DynamicallyAccessedMemberTypes: DynamicallyAccessedMemberTypes.All })
-                                                               AddReturnValue (_annotations.GetMethodReturnValue (calledMethod, DynamicallyAccessedMemberTypes.All));
-                                                       else
-                                                               AddReturnValue (_annotations.GetMethodReturnValue (calledMethod, DynamicallyAccessedMemberTypes.None));
-                                               }
-                                       }
-                               }
-                               break;
-
-                       //
-                       // System.Reflection.RuntimeReflectionExtensions
-                       //
-                       // static GetRuntimeEvent (this Type type, string name)
-                       // static GetRuntimeField (this Type type, string name)
-                       // static GetRuntimeMethod (this Type type, string name, Type[] parameters)
-                       // static GetRuntimeProperty (this Type type, string name)
-                       //
-                       case IntrinsicId.RuntimeReflectionExtensions_GetRuntimeEvent:
-                       case IntrinsicId.RuntimeReflectionExtensions_GetRuntimeField:
-                       case IntrinsicId.RuntimeReflectionExtensions_GetRuntimeMethod:
-                       case IntrinsicId.RuntimeReflectionExtensions_GetRuntimeProperty: {
-
-                                       if (argumentValues[0].IsEmpty () || argumentValues[1].IsEmpty ()) {
-                                               returnValue = MultiValueLattice.Top;
-                                               break;
-                                       }
-
-                                       BindingFlags bindingFlags = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public;
-                                       DynamicallyAccessedMemberTypes requiredMemberTypes = intrinsicId switch {
-                                               IntrinsicId.RuntimeReflectionExtensions_GetRuntimeEvent => DynamicallyAccessedMemberTypes.PublicEvents,
-                                               IntrinsicId.RuntimeReflectionExtensions_GetRuntimeField => DynamicallyAccessedMemberTypes.PublicFields,
-                                               IntrinsicId.RuntimeReflectionExtensions_GetRuntimeMethod => DynamicallyAccessedMemberTypes.PublicMethods,
-                                               IntrinsicId.RuntimeReflectionExtensions_GetRuntimeProperty => DynamicallyAccessedMemberTypes.PublicProperties,
-                                               _ => throw new ArgumentException ($"Reflection call '{calledMethod.GetDisplayName ()}' inside '{GetContainingSymbolDisplayName ()}' is of unexpected member type."),
-                                       };
-
-                                       var targetValue = _annotations.GetMethodParameterValue (new (calledMethod, (ParameterIndex) 1), requiredMemberTypes);
-
-                                       foreach (var value in argumentValues[0]) {
-                                               if (value is SystemTypeValue systemTypeValue) {
-                                                       foreach (var stringParam in argumentValues[1]) {
-                                                               if (stringParam is KnownStringValue stringValue) {
-                                                                       switch (intrinsicId) {
-                                                                       case IntrinsicId.RuntimeReflectionExtensions_GetRuntimeEvent:
-                                                                               MarkEventsOnTypeHierarchy (systemTypeValue.RepresentedType, stringValue.Contents, bindingFlags);
-                                                                               break;
-                                                                       case IntrinsicId.RuntimeReflectionExtensions_GetRuntimeField:
-                                                                               MarkFieldsOnTypeHierarchy (systemTypeValue.RepresentedType, stringValue.Contents, bindingFlags);
-                                                                               break;
-                                                                       case IntrinsicId.RuntimeReflectionExtensions_GetRuntimeMethod:
-                                                                               AddReturnValue (MultiValueLattice.Top); // Initialize return value (so that it's not autofilled if there are no matching methods)
-                                                                               foreach (var methodValue in ProcessGetMethodByName (systemTypeValue.RepresentedType, stringValue.Contents, bindingFlags))
-                                                                                       AddReturnValue (methodValue);
-                                                                               break;
-                                                                       case IntrinsicId.RuntimeReflectionExtensions_GetRuntimeProperty:
-                                                                               MarkPropertiesOnTypeHierarchy (systemTypeValue.RepresentedType, stringValue.Contents, bindingFlags);
-                                                                               break;
-                                                                       default:
-                                                                               throw new ArgumentException ($"Error processing reflection call '{calledMethod.GetDisplayName ()}' inside {GetContainingSymbolDisplayName ()}. Unexpected member kind.");
-                                                                       }
-                                                               } else if (stringParam is NullValue) {
-                                                                       // GetRuntimeMethod(type, null) throws - so track empty value set as its result
-                                                                       AddReturnValue (MultiValueLattice.Top);
-                                                               } else {
-                                                                       _requireDynamicallyAccessedMembersAction.Invoke (value, targetValue);
-                                                                       AddReturnValue (annotatedMethodReturnValue);
-                                                               }
-                                                       }
-                                               } else if (value is NullValue) {
-                                                       // GetRuntimeMethod(null, ...) throws - so track empty value set as its result
-                                                       AddReturnValue (MultiValueLattice.Top);
-                                               } else {
-                                                       _requireDynamicallyAccessedMembersAction.Invoke (value, targetValue);
-                                                       AddReturnValue (annotatedMethodReturnValue);
-                                               }
-                                       }
-                               }
-                               break;
-
-                       //
-                       // System.Linq.Expressions.Expression
-                       //
-                       // static New (Type)
-                       //
-                       case IntrinsicId.Expression_New: {
-                                       var targetValue = _annotations.GetMethodParameterValue (new (calledMethod, (ParameterIndex) 0), DynamicallyAccessedMemberTypes.PublicParameterlessConstructor);
-                                       foreach (var value in argumentValues[0]) {
-                                               if (value is SystemTypeValue systemTypeValue) {
-                                                       MarkConstructorsOnType (systemTypeValue.RepresentedType, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, parameterCount: null);
-                                               } else {
-                                                       _requireDynamicallyAccessedMembersAction.Invoke (value, targetValue);
-                                               }
-                                       }
-                               }
-                               break;
-
-                       //
-                       // System.Linq.Expressions.Expression
-                       //
-                       // static Property (Expression, MethodInfo)
-                       //
-                       case IntrinsicId.Expression_Property when calledMethod.HasParameterOfType ((ParameterIndex) 1, "System.Reflection.MethodInfo"): {
-                                       if (argumentValues[1].IsEmpty ()) {
-                                               returnValue = MultiValueLattice.Top;
-                                               break;
-                                       }
-
-                                       foreach (var value in argumentValues[1]) {
-                                               if (value is SystemReflectionMethodBaseValue methodBaseValue) {
-                                                       // We have one of the accessors for the property. The Expression.Property will in this case search
-                                                       // for the matching PropertyInfo and store that. So to be perfectly correct we need to mark the
-                                                       // respective PropertyInfo as "accessed via reflection".
-                                                       if (MarkAssociatedProperty (methodBaseValue.RepresentedMethod))
-                                                               continue;
-                                               } else if (value == NullValue.Instance) {
-                                                       continue;
-                                               }
-
-                                               // In all other cases we may not even know which type this is about, so there's nothing we can do
-                                               // report it as a warning.
-                                               _diagnosticContext.AddDiagnostic (DiagnosticId.PropertyAccessorParameterInLinqExpressionsCannotBeStaticallyDetermined,
-                                                       _annotations.GetMethodParameterValue (new (calledMethod, (ParameterIndex) 1), DynamicallyAccessedMemberTypes.None).GetDiagnosticArgumentsForAnnotationMismatch ().ToArray ());
-                                       }
-                               }
-                               break;
-
-                       //
-                       // System.Linq.Expressions.Expression
-                       //
-                       // static Field (Expression, Type, String)
-                       // static Property (Expression, Type, String)
-                       //
-                       case IntrinsicId.Expression_Field:
-                       case IntrinsicId.Expression_Property: {
-                                       DynamicallyAccessedMemberTypes memberTypes = intrinsicId == IntrinsicId.Expression_Property
-                                               ? DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties
-                                               : DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields;
-
-                                       if (argumentValues[1].IsEmpty () || argumentValues[2].IsEmpty ()) {
-                                               returnValue = MultiValueLattice.Top;
-                                               break;
-                                       }
-
-                                       var targetValue = _annotations.GetMethodParameterValue (new (calledMethod, (ParameterIndex) 1), memberTypes);
-                                       foreach (var value in argumentValues[1]) {
-                                               if (value is SystemTypeValue systemTypeValue) {
-                                                       foreach (var stringParam in argumentValues[2]) {
-                                                               if (stringParam is KnownStringValue stringValue) {
-                                                                       BindingFlags bindingFlags = argumentValues[0].AsSingleValue () is NullValue ? BindingFlags.Static : BindingFlags.Default;
-                                                                       if (intrinsicId == IntrinsicId.Expression_Property) {
-                                                                               MarkPropertiesOnTypeHierarchy (systemTypeValue.RepresentedType, stringValue.Contents, bindingFlags);
-                                                                       } else {
-                                                                               MarkFieldsOnTypeHierarchy (systemTypeValue.RepresentedType, stringValue.Contents, bindingFlags);
-                                                                       }
-                                                               } else if (stringParam is NullValue) {
-                                                                       // Null name will always throw, so there's nothing to do
-                                                               } else {
-                                                                       _requireDynamicallyAccessedMembersAction.Invoke (value, targetValue);
-                                                               }
-                                                       }
-                                               } else {
-                                                       _requireDynamicallyAccessedMembersAction.Invoke (value, targetValue);
-                                               }
-                                       }
-                               }
-                               break;
-
-                       //
-                       // System.Linq.Expressions.Expression
-                       //
-                       // static Call (Type, String, Type[], Expression[])
-                       //
-                       case IntrinsicId.Expression_Call: {
-                                       BindingFlags bindingFlags = BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy;
-
-                                       var targetValue = _annotations.GetMethodParameterValue (
-                                               new ParameterProxy (calledMethod, (ParameterIndex) 0),
-                                               GetDynamicallyAccessedMemberTypesFromBindingFlagsForMethods (bindingFlags));
-
-                                       // This is true even if we "don't know" - so it's only false if we're sure that there are no type arguments
-                                       bool hasTypeArguments = (argumentValues[2].AsSingleValue () as ArrayValue)?.Size.AsConstInt () != 0;
-                                       foreach (var value in argumentValues[0]) {
-                                               if (value is SystemTypeValue systemTypeValue) {
-                                                       foreach (var stringParam in argumentValues[1]) {
-                                                               if (stringParam is KnownStringValue stringValue) {
-                                                                       foreach (var method in GetMethodsOnTypeHierarchy (systemTypeValue.RepresentedType, stringValue.Contents, bindingFlags)) {
-                                                                               ValidateGenericMethodInstantiation (method.RepresentedMethod, argumentValues[2], calledMethod);
-                                                                               MarkMethod (method.RepresentedMethod);
-                                                                       }
-                                                               } else {
-                                                                       if (hasTypeArguments) {
-                                                                               // We don't know what method the `MakeGenericMethod` was called on, so we have to assume
-                                                                               // that the method may have requirements which we can't fullfil -> warn.
-                                                                               _diagnosticContext.AddDiagnostic (DiagnosticId.MakeGenericMethod, calledMethod.GetDisplayName ());
-                                                                       }
-
-                                                                       _requireDynamicallyAccessedMembersAction.Invoke (value, targetValue);
-                                                               }
-                                                       }
-                                               } else {
-                                                       if (hasTypeArguments) {
-                                                               // We don't know what method the `MakeGenericMethod` was called on, so we have to assume
-                                                               // that the method may have requirements which we can't fullfil -> warn.
-                                                               _diagnosticContext.AddDiagnostic (DiagnosticId.MakeGenericMethod, calledMethod.GetDisplayName ());
-                                                       }
-
-                                                       _requireDynamicallyAccessedMembersAction.Invoke (value, targetValue);
-                                               }
-                                       }
-                               }
-                               break;
-
-                       //
-                       // Nullable.GetUnderlyingType(Type)
-                       //
-                       case IntrinsicId.Nullable_GetUnderlyingType:
-                               if (argumentValues[0].IsEmpty ()) {
-                                       returnValue = MultiValueLattice.Top;
-                                       break;
-                               }
-
-                               foreach (var singlevalue in argumentValues[0].AsEnumerable ()) {
-                                       AddReturnValue (singlevalue switch {
-                                               SystemTypeValue systemType =>
-                                                       systemType.RepresentedType.IsTypeOf ("System", "Nullable`1")
-                                                               // This will happen if there's typeof(Nullable<>).MakeGenericType(unknown) - we know the return value is Nullable<>
-                                                               // but we don't know of what. So we represent it as known type, but not as known nullable type.
-                                                               // Has to be special cased here, since we need to return "unknown" type.
-                                                               ? annotatedMethodReturnValue
-                                                               : MultiValueLattice.Top, // This returns null at runtime, so return empty value
-                                               NullableSystemTypeValue nullableSystemType => nullableSystemType.UnderlyingTypeValue,
-                                               NullableValueWithDynamicallyAccessedMembers nullableDamValue => nullableDamValue.UnderlyingTypeValue,
-                                               ValueWithDynamicallyAccessedMembers damValue => damValue,
-                                               _ => annotatedMethodReturnValue
-                                       });
-                               }
-                               break;
-
-                       //
-                       // System.Type
-                       //
-                       // GetType (string)
-                       // GetType (string, Boolean)
-                       // GetType (string, Boolean, Boolean)
-                       // GetType (string, Func<AssemblyName, Assembly>, Func<Assembly, String, Boolean, Type>)
-                       // GetType (string, Func<AssemblyName, Assembly>, Func<Assembly, String, Boolean, Type>, Boolean)
-                       // GetType (string, Func<AssemblyName, Assembly>, Func<Assembly, String, Boolean, Type>, Boolean, Boolean)
-                       //
-                       case IntrinsicId.Type_GetType: {
-                                       if (argumentValues[0].IsEmpty ()) {
-                                               returnValue = MultiValueLattice.Top;
-                                               break;
-                                       }
-
-                                       if ((calledMethod.HasMetadataParametersCount (3) && calledMethod.HasParameterOfType ((ParameterIndex) 2, "System.Boolean") && argumentValues[2].AsConstInt () != 0) ||
-                                               (calledMethod.HasMetadataParametersCount (5) && argumentValues[4].AsConstInt () != 0)) {
-                                               _diagnosticContext.AddDiagnostic (DiagnosticId.CaseInsensitiveTypeGetTypeCallIsNotSupported, calledMethod.GetDisplayName ());
-                                               returnValue = MultiValueLattice.Top; // This effectively disables analysis of anything which uses the return value
-                                               break;
-                                       }
-
-                                       foreach (var typeNameValue in argumentValues[0]) {
-                                               if (typeNameValue is KnownStringValue knownStringValue) {
-                                                       if (!_requireDynamicallyAccessedMembersAction.TryResolveTypeNameAndMark (knownStringValue.Contents, false, out TypeProxy foundType)) {
-                                                               // Intentionally ignore - it's not wrong for code to call Type.GetType on non-existing name, the code might expect null/exception back.
-                                                               AddReturnValue (MultiValueLattice.Top);
-                                                       } else {
-                                                               AddReturnValue (new SystemTypeValue (foundType));
-                                                       }
-                                               } else if (typeNameValue == NullValue.Instance) {
-                                                       // Nothing to do - this throws at runtime
-                                                       AddReturnValue (MultiValueLattice.Top);
-                                               } else if (typeNameValue is ValueWithDynamicallyAccessedMembers valueWithDynamicallyAccessedMembers && valueWithDynamicallyAccessedMembers.DynamicallyAccessedMemberTypes != 0) {
-                                                       // Propagate the annotation from the type name to the return value. Annotation on a string value will be fulfilled whenever a value is assigned to the string with annotation.
-                                                       // So while we don't know which type it is, we can guarantee that it will fulfill the annotation.
-                                                       AddReturnValue (_annotations.GetMethodReturnValue (calledMethod, valueWithDynamicallyAccessedMembers.DynamicallyAccessedMemberTypes));
-                                               } else {
-                                                       _diagnosticContext.AddDiagnostic (DiagnosticId.UnrecognizedTypeNameInTypeGetType, calledMethod.GetDisplayName ());
-                                                       AddReturnValue (MultiValueLattice.Top);
-                                               }
-                                       }
-
-                               }
-                               break;
-
-                       //
-                       // System.Type
-                       //
-                       // Type MakeGenericType (params Type[] typeArguments)
-                       //
-                       case IntrinsicId.Type_MakeGenericType:
-                               if (instanceValue.IsEmpty () || argumentValues[0].IsEmpty ()) {
-                                       returnValue = MultiValueLattice.Top;
-                                       break;
-                               }
-
-                               foreach (var value in instanceValue) {
-                                       if (value is SystemTypeValue typeValue) {
-                                               // Special case Nullable<T>
-                                               // Nullables without a type argument are considered SystemTypeValues
-                                               if (typeValue.RepresentedType.IsTypeOf ("System", "Nullable`1")) {
-                                                       // Note that we're not performing any generic parameter validation
-                                                       // Special case: Nullable<T> where T : struct
-                                                       //  The struct constraint in C# implies new() constraint, but Nullable doesn't make a use of that part.
-                                                       //  There are several places even in the framework where typeof(Nullable<>).MakeGenericType would warn
-                                                       //  without any good reason to do so.
-
-                                                       foreach (var argumentValue in argumentValues[0]) {
-                                                               if ((argumentValue as ArrayValue)?.TryGetValueByIndex (0, out var underlyingMultiValue) == true) {
-                                                                       foreach (var underlyingValue in underlyingMultiValue) {
-                                                                               switch (underlyingValue) {
-                                                                               // Don't warn on these types - it will throw instead
-                                                                               case NullableValueWithDynamicallyAccessedMembers:
-                                                                               case NullableSystemTypeValue:
-                                                                               case SystemTypeValue maybeArrayValue when maybeArrayValue.RepresentedType.IsTypeOf ("System", "Array"):
-                                                                                       AddReturnValue (MultiValueLattice.Top);
-                                                                                       break;
-                                                                               case SystemTypeValue systemTypeValue:
-                                                                                       AddReturnValue (new NullableSystemTypeValue (typeValue.RepresentedType, new SystemTypeValue (systemTypeValue.RepresentedType)));
-                                                                                       break;
-                                                                               // Generic Parameters and method parameters with annotations
-                                                                               case ValueWithDynamicallyAccessedMembers damValue:
-                                                                                       AddReturnValue (new NullableValueWithDynamicallyAccessedMembers (typeValue.RepresentedType, damValue));
-                                                                                       break;
-                                                                               // Everything else assume it has no annotations
-                                                                               default:
-                                                                                       // This returns just Nullable<> SystemTypeValue - so some things will work, but GetUnderlyingType won't propagate anything
-                                                                                       // It's special cased to do that.
-                                                                                       AddReturnValue (value);
-                                                                                       break;
-                                                                               }
-                                                                       }
-                                                               } else {
-                                                                       // This returns just Nullable<> SystemTypeValue - so some things will work, but GetUnderlyingType won't propagate anything
-                                                                       // It's special cased to do that.
-                                                                       AddReturnValue (value);
-                                                               }
-                                                       }
-                                                       // We want to skip adding the `value` to the return Value because we have already added Nullable<value>
-                                                       continue;
-                                               } else {
-                                                       // Any other type - perform generic parameter validation
-                                                       var genericParameterValues = GetGenericParameterValues (typeValue.RepresentedType.GetGenericParameters ());
-                                                       if (!AnalyzeGenericInstantiationTypeArray (argumentValues[0], calledMethod, genericParameterValues)) {
-                                                               _diagnosticContext.AddDiagnostic (DiagnosticId.MakeGenericType, calledMethod.GetDisplayName ());
-                                                       }
-                                               }
-                                       } else if (value == NullValue.Instance) {
-                                               // At runtime this would throw - so it has no effect on analysis
-                                               AddReturnValue (MultiValueLattice.Top);
-                                       } else {
-                                               // We have no way to "include more" to fix this if we don't know, so we have to warn
-                                               _diagnosticContext.AddDiagnostic (DiagnosticId.MakeGenericType, calledMethod.GetDisplayName ());
-                                       }
-
-                                       // We don't want to lose track of the type
-                                       // in case this is e.g. Activator.CreateInstance(typeof(Foo<>).MakeGenericType(...));
-                                       // Note this is not called in the Nullable case - we skipt this via the 'continue'.
-                                       AddReturnValue (value);
-                               }
-                               break;
-
-                       //
-                       // Type.BaseType
-                       //
-                       case IntrinsicId.Type_get_BaseType: {
-                                       if (instanceValue.IsEmpty ()) {
-                                               returnValue = MultiValueLattice.Top;
-                                               break;
-                                       }
-
-                                       foreach (var value in instanceValue) {
-                                               if (value is ValueWithDynamicallyAccessedMembers valueWithDynamicallyAccessedMembers) {
-                                                       DynamicallyAccessedMemberTypes propagatedMemberTypes = DynamicallyAccessedMemberTypes.None;
-                                                       if (valueWithDynamicallyAccessedMembers.DynamicallyAccessedMemberTypes == DynamicallyAccessedMemberTypes.All)
-                                                               propagatedMemberTypes = DynamicallyAccessedMemberTypes.All;
-                                                       else {
-                                                               // PublicConstructors are not propagated to base type
-
-                                                               if (valueWithDynamicallyAccessedMembers.DynamicallyAccessedMemberTypes.HasFlag (DynamicallyAccessedMemberTypes.PublicEvents))
-                                                                       propagatedMemberTypes |= DynamicallyAccessedMemberTypes.PublicEvents;
-
-                                                               if (valueWithDynamicallyAccessedMembers.DynamicallyAccessedMemberTypes.HasFlag (DynamicallyAccessedMemberTypes.PublicFields))
-                                                                       propagatedMemberTypes |= DynamicallyAccessedMemberTypes.PublicFields;
-
-                                                               if (valueWithDynamicallyAccessedMembers.DynamicallyAccessedMemberTypes.HasFlag (DynamicallyAccessedMemberTypes.PublicMethods))
-                                                                       propagatedMemberTypes |= DynamicallyAccessedMemberTypes.PublicMethods;
-
-                                                               // PublicNestedTypes are not propagated to base type
-
-                                                               // PublicParameterlessConstructor is not propagated to base type
-
-                                                               if (valueWithDynamicallyAccessedMembers.DynamicallyAccessedMemberTypes.HasFlag (DynamicallyAccessedMemberTypes.PublicProperties))
-                                                                       propagatedMemberTypes |= DynamicallyAccessedMemberTypes.PublicProperties;
-
-                                                               if (valueWithDynamicallyAccessedMembers.DynamicallyAccessedMemberTypes.HasFlag (DynamicallyAccessedMemberTypes.Interfaces))
-                                                                       propagatedMemberTypes |= DynamicallyAccessedMemberTypes.Interfaces;
-                                                       }
-
-                                                       AddReturnValue (_annotations.GetMethodReturnValue (calledMethod, propagatedMemberTypes));
-                                               } else if (value is SystemTypeValue systemTypeValue) {
-                                                       if (TryGetBaseType (systemTypeValue.RepresentedType, out var baseType))
-                                                               AddReturnValue (new SystemTypeValue (baseType.Value));
-                                                       else
-                                                               AddReturnValue (annotatedMethodReturnValue);
-                                               } else if (value == NullValue.Instance) {
-                                                       // Ignore nulls - null.BaseType will fail at runtime, but it has no effect on static analysis
-                                                       AddReturnValue (MultiValueLattice.Top);
-                                                       continue;
-                                               } else {
-                                                       // Unknown input - propagate a return value without any annotation - we know it's a Type but we know nothing about it
-                                                       AddReturnValue (annotatedMethodReturnValue);
-                                               }
-                                       }
-                               }
-                               break;
-
-                       //
-                       // GetConstructor (Type[])
-                       // GetConstructor (BindingFlags, Type[])
-                       // GetConstructor (BindingFlags, Binder, Type[], ParameterModifier [])
-                       // GetConstructor (BindingFlags, Binder, CallingConventions, Type[], ParameterModifier [])
-                       //
-                       case IntrinsicId.Type_GetConstructor: {
-                                       if (instanceValue.IsEmpty ()) {
-                                               returnValue = MultiValueLattice.Top;
-                                               break;
-                                       }
-
-                                       BindingFlags? bindingFlags;
-                                       if (calledMethod.HasParameterOfType ((ParameterIndex) 1, "System.Reflection.BindingFlags"))
-                                               bindingFlags = GetBindingFlagsFromValue (argumentValues[0]);
-                                       else
-                                               // Assume a default value for BindingFlags for methods that don't use BindingFlags as a parameter
-                                               bindingFlags = BindingFlags.Public | BindingFlags.Instance;
-
-                                       int? ctorParameterCount = calledMethod.GetMetadataParametersCount () switch {
-                                               1 => (argumentValues[0].AsSingleValue () as ArrayValue)?.Size.AsConstInt (),
-                                               2 => (argumentValues[1].AsSingleValue () as ArrayValue)?.Size.AsConstInt (),
-                                               4 => (argumentValues[2].AsSingleValue () as ArrayValue)?.Size.AsConstInt (),
-                                               5 => (argumentValues[3].AsSingleValue () as ArrayValue)?.Size.AsConstInt (),
-                                               _ => null,
-                                       };
-
-                                       // Go over all types we've seen
-                                       foreach (var value in instanceValue) {
-                                               if (value is SystemTypeValue systemTypeValue && !BindingFlagsAreUnsupported (bindingFlags)) {
-                                                       if (HasBindingFlag (bindingFlags, BindingFlags.Public) && !HasBindingFlag (bindingFlags, BindingFlags.NonPublic)
-                                                               && ctorParameterCount == 0) {
-                                                               MarkPublicParameterlessConstructorOnType (systemTypeValue.RepresentedType);
-                                                       } else {
-                                                               MarkConstructorsOnType (systemTypeValue.RepresentedType, bindingFlags, parameterCount: null);
-                                                       }
-                                               } else {
-                                                       // Otherwise fall back to the bitfield requirements
-                                                       var requiredMemberTypes = GetDynamicallyAccessedMemberTypesFromBindingFlagsForConstructors (bindingFlags);
-                                                       // We can scope down the public constructors requirement if we know the number of parameters is 0
-                                                       if (requiredMemberTypes == DynamicallyAccessedMemberTypes.PublicConstructors && ctorParameterCount == 0)
-                                                               requiredMemberTypes = DynamicallyAccessedMemberTypes.PublicParameterlessConstructor;
-
-                                                       var targetValue = _annotations.GetMethodThisParameterValue (calledMethod, requiredMemberTypes);
-                                                       _requireDynamicallyAccessedMembersAction.Invoke (value, targetValue);
-                                               }
-                                       }
-                               }
-                               break;
-
-                       //
-                       // System.Reflection.MethodInfo
-                       //
-                       // MakeGenericMethod (Type[] typeArguments)
-                       //
-                       case IntrinsicId.MethodInfo_MakeGenericMethod: {
-                                       if (instanceValue.IsEmpty ()) {
-                                               returnValue = MultiValueLattice.Top;
-                                               break;
-                                       }
-
-                                       foreach (var methodValue in instanceValue) {
-                                               if (methodValue is SystemReflectionMethodBaseValue methodBaseValue) {
-                                                       ValidateGenericMethodInstantiation (methodBaseValue.RepresentedMethod, argumentValues[0], calledMethod);
-                                               } else if (methodValue == NullValue.Instance) {
-                                                       // Nothing to do
-                                               } else {
-                                                       // We don't know what method the `MakeGenericMethod` was called on, so we have to assume
-                                                       // that the method may have requirements which we can't fullfil -> warn.
-                                                       _diagnosticContext.AddDiagnostic (DiagnosticId.MakeGenericMethod, calledMethod.GetDisplayName ());
-                                               }
-                                       }
-
-                                       // MakeGenericMethod doesn't change the identity of the MethodBase we're tracking so propagate to the return value
-                                       AddReturnValue (instanceValue);
-                               }
-                               break;
-
-                       //
-                       // System.Activator
-                       //
-                       // static CreateInstance (System.Type type)
-                       // static CreateInstance (System.Type type, bool nonPublic)
-                       // static CreateInstance (System.Type type, params object?[]? args)
-                       // static CreateInstance (System.Type type, object?[]? args, object?[]? activationAttributes)
-                       // static CreateInstance (System.Type type, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, object?[]? args, System.Globalization.CultureInfo? culture)
-                       // static CreateInstance (System.Type type, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, object?[]? args, System.Globalization.CultureInfo? culture, object?[]? activationAttributes) { throw null; }
-                       //
-                       case IntrinsicId.Activator_CreateInstance__Type: {
-                                       int? ctorParameterCount = null;
-                                       BindingFlags bindingFlags = BindingFlags.Instance;
-                                       if (calledMethod.GetMetadataParametersCount () > 1) {
-                                               if (calledMethod.HasParameterOfType ((ParameterIndex) 1, "System.Boolean")) {
-                                                       // The overload that takes a "nonPublic" bool
-                                                       bool nonPublic = argumentValues[1].AsConstInt () != 0;
-
-                                                       if (nonPublic)
-                                                               bindingFlags |= BindingFlags.NonPublic | BindingFlags.Public;
-                                                       else
-                                                               bindingFlags |= BindingFlags.Public;
-                                                       ctorParameterCount = 0;
-                                               } else {
-                                                       // Overload that has the parameters as the second or fourth argument
-                                                       int argsParam = calledMethod.HasMetadataParametersCount (2) || calledMethod.HasMetadataParametersCount (3) ? 1 : 3;
-
-                                                       if (argumentValues.Count > argsParam) {
-                                                               if (argumentValues[argsParam].AsSingleValue () is ArrayValue arrayValue &&
-                                                                       arrayValue.Size.AsConstInt () != null)
-                                                                       ctorParameterCount = arrayValue.Size.AsConstInt ();
-                                                               else if (argumentValues[argsParam].AsSingleValue () is NullValue)
-                                                                       ctorParameterCount = 0;
-                                                       }
-
-                                                       if (calledMethod.GetMetadataParametersCount () > 3) {
-                                                               if (argumentValues[1].AsConstInt () is int constInt)
-                                                                       bindingFlags |= (BindingFlags) constInt;
-                                                               else
-                                                                       bindingFlags |= BindingFlags.NonPublic | BindingFlags.Public;
-                                                       } else {
-                                                               bindingFlags |= BindingFlags.Public;
-                                                       }
-                                               }
-                                       } else {
-                                               // The overload with a single System.Type argument
-                                               ctorParameterCount = 0;
-                                               bindingFlags |= BindingFlags.Public;
-                                       }
-
-                                       // Go over all types we've seen
-                                       foreach (var value in argumentValues[0]) {
-                                               if (value is SystemTypeValue systemTypeValue) {
-                                                       // Special case known type values as we can do better by applying exact binding flags and parameter count.
-                                                       MarkConstructorsOnType (systemTypeValue.RepresentedType, bindingFlags, ctorParameterCount);
-                                               } else {
-                                                       // Otherwise fall back to the bitfield requirements
-                                                       var requiredMemberTypes = GetDynamicallyAccessedMemberTypesFromBindingFlagsForConstructors (bindingFlags);
-
-                                                       // Special case the public parameterless constructor if we know that there are 0 args passed in
-                                                       if (ctorParameterCount == 0 && requiredMemberTypes.HasFlag (DynamicallyAccessedMemberTypes.PublicConstructors)) {
-                                                               requiredMemberTypes &= ~DynamicallyAccessedMemberTypes.PublicConstructors;
-                                                               requiredMemberTypes |= DynamicallyAccessedMemberTypes.PublicParameterlessConstructor;
-                                                       }
-
-                                                       var targetValue = _annotations.GetMethodParameterValue (new (calledMethod, (ParameterIndex) 0), requiredMemberTypes);
-
-                                                       _requireDynamicallyAccessedMembersAction.Invoke (value, targetValue);
-                                               }
-                                       }
-                               }
-                               break;
-
-                       //
-                       // System.Activator
-                       //
-                       // static CreateInstance (string assemblyName, string typeName)
-                       // static CreateInstance (string assemblyName, string typeName, bool ignoreCase, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, object?[]? args, System.Globalization.CultureInfo? culture, object?[]? activationAttributes)
-                       // static CreateInstance (string assemblyName, string typeName, object?[]? activationAttributes)
-                       //
-                       case IntrinsicId.Activator_CreateInstance__AssemblyName_TypeName:
-                               ProcessCreateInstanceByName (calledMethod, argumentValues);
-                               break;
-
-                       //
-                       // System.Activator
-                       //
-                       // static CreateInstanceFrom (string assemblyFile, string typeName)
-                       // static CreateInstanceFrom (string assemblyFile, string typeName, bool ignoreCase, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, object? []? args, System.Globalization.CultureInfo? culture, object? []? activationAttributes)
-                       // static CreateInstanceFrom (string assemblyFile, string typeName, object? []? activationAttributes)
-                       //
-                       case IntrinsicId.Activator_CreateInstanceFrom:
-                               ProcessCreateInstanceByName (calledMethod, argumentValues);
-                               break;
-
-                       //
-                       // System.AppDomain
-                       //
-                       // CreateInstance (string assemblyName, string typeName)
-                       // CreateInstance (string assemblyName, string typeName, bool ignoreCase, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, object? []? args, System.Globalization.CultureInfo? culture, object? []? activationAttributes)
-                       // CreateInstance (string assemblyName, string typeName, object? []? activationAttributes)
-                       //
-                       // CreateInstanceAndUnwrap (string assemblyName, string typeName)
-                       // CreateInstanceAndUnwrap (string assemblyName, string typeName, bool ignoreCase, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, object? []? args, System.Globalization.CultureInfo? culture, object? []? activationAttributes)
-                       // CreateInstanceAndUnwrap (string assemblyName, string typeName, object? []? activationAttributes)
-                       //
-                       // CreateInstanceFrom (string assemblyFile, string typeName)
-                       // CreateInstanceFrom (string assemblyFile, string typeName, bool ignoreCase, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, object? []? args, System.Globalization.CultureInfo? culture, object? []? activationAttributes)
-                       // CreateInstanceFrom (string assemblyFile, string typeName, object? []? activationAttributes)
-                       //
-                       // CreateInstanceFromAndUnwrap (string assemblyFile, string typeName)
-                       // CreateInstanceFromAndUnwrap (string assemblyFile, string typeName, bool ignoreCase, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, object? []? args, System.Globalization.CultureInfo? culture, object? []? activationAttributes)
-                       // CreateInstanceFromAndUnwrap (string assemblyFile, string typeName, object? []? activationAttributes)
-                       //
-                       case IntrinsicId.AppDomain_CreateInstance:
-                       case IntrinsicId.AppDomain_CreateInstanceAndUnwrap:
-                       case IntrinsicId.AppDomain_CreateInstanceFrom:
-                       case IntrinsicId.AppDomain_CreateInstanceFromAndUnwrap:
-                               ProcessCreateInstanceByName (calledMethod, argumentValues);
-                               break;
-
-                       //
-                       // System.Reflection.Assembly
-                       //
-                       // CreateInstance (string typeName)
-                       // CreateInstance (string typeName, bool ignoreCase)
-                       // CreateInstance (string typeName, bool ignoreCase, BindingFlags bindingAttr, Binder? binder, object []? args, CultureInfo? culture, object []? activationAttributes)
-                       //
-                       case IntrinsicId.Assembly_CreateInstance:
-                               // For now always fail since we don't track assemblies (dotnet/linker/issues/1947)
-                               _diagnosticContext.AddDiagnostic (DiagnosticId.ParametersOfAssemblyCreateInstanceCannotBeAnalyzed, calledMethod.GetDisplayName ());
-                               break;
-
-                       case IntrinsicId.None:
-                               // Verify the argument values match the annotations on the parameter definition
-                               if (requiresDataFlowAnalysis) {
-                                       foreach (var parameter in calledMethod.GetParameters ()) {
-                                               if (parameter.GetReferenceKind () is ReferenceKind.Out)
-                                                       continue;
-                                               if (parameter.IsImplicitThis) {
-                                                       _requireDynamicallyAccessedMembersAction.Invoke (instanceValue, _annotations.GetMethodThisParameterValue (calledMethod));
-                                                       continue;
-                                               }
-                                               _requireDynamicallyAccessedMembersAction.Invoke (argumentValues[parameter.MetadataIndex], _annotations.GetMethodParameterValue (parameter));
-                                       }
-                               }
-                               break;
-
-                       // Disable warnings for all unimplemented intrinsics. Some intrinsic methods have annotations, but analyzing them
-                       // would produce unnecessary warnings even for cases that are intrinsically handled. So we disable handling these calls
-                       // until a proper intrinsic handling is made
-                       // NOTE: Currently this is done "for the analyzer" and it relies on ILLink/NativeAOT to not call HandleCallAction
-                       // for intrinsics which ILLink/NativeAOT need special handling for or those which are not implemented here and only there.
-                       // Ideally we would run everything through HandleCallAction and it would return "false" for intrinsics it doesn't handle
-                       // like it already does for Activator.CreateInstance<T> for example.
-                       default:
-                               methodReturnValue = MultiValueLattice.Top;
-                               return true;
-                       }
-
-                       // For now, if the intrinsic doesn't set a return value, fall back on the annotations.
-                       // Note that this will be DynamicallyAccessedMembers.None for the intrinsics which don't return types.
-                       returnValue ??= calledMethod.ReturnsVoid () ? MultiValueLattice.Top : annotatedMethodReturnValue;
-
-                       if (MethodIsTypeConstructor (calledMethod))
-                               returnValue = UnknownValue.Instance;
-
-                       // Validate that the return value has the correct annotations as per the method return value annotations
-                       if (annotatedMethodReturnValue.DynamicallyAccessedMemberTypes != DynamicallyAccessedMemberTypes.None) {
-                               foreach (var uniqueValue in returnValue.Value) {
-                                       if (uniqueValue is ValueWithDynamicallyAccessedMembers methodReturnValueWithMemberTypes) {
-                                               if (!methodReturnValueWithMemberTypes.DynamicallyAccessedMemberTypes.HasFlag (annotatedMethodReturnValue.DynamicallyAccessedMemberTypes))
-                                                       throw new InvalidOperationException ($"Internal ILLink error: in {GetContainingSymbolDisplayName ()} processing call to {calledMethod.GetDisplayName ()} returned value which is not correctly annotated with the expected dynamic member access kinds.");
-                                       } else if (uniqueValue is SystemTypeValue) {
-                                               // SystemTypeValue can fulfill any requirement, so it's always valid
-                                               // The requirements will be applied at the point where it's consumed (passed as a method parameter, set as field value, returned from the method)
-                                       } else if (uniqueValue == NullValue.Instance) {
-                                               // NullValue can fulfill any requirements because reflection access to it will typically throw.
-                                       } else {
-                                               throw new InvalidOperationException ($"Internal ILLink error: in {GetContainingSymbolDisplayName ()} processing call to {calledMethod.GetDisplayName ()} returned value which is not correctly annotated with the expected dynamic member access kinds.");
-                                       }
-                               }
-                       }
-
-                       methodReturnValue = returnValue.Value;
-
-                       return true;
-
-                       void AddReturnValue (MultiValue value)
-                       {
-                               returnValue = (returnValue == null) ? value : MultiValueLattice.Meet (returnValue.Value, value);
-                       }
-               }
-
-               private IEnumerable<MultiValue> ProcessGetMethodByName (TypeProxy type, string methodName, BindingFlags? bindingFlags)
-               {
-                       bool foundAny = false;
-                       foreach (var method in GetMethodsOnTypeHierarchy (type, methodName, bindingFlags)) {
-                               MarkMethod (method.RepresentedMethod);
-                               yield return method;
-                               foundAny = true;
-                       }
-
-                       // If there were no methods found the API will return null at runtime, so we should
-                       // track the null as a return value as well.
-                       // This also prevents warnings in such case, since if we don't set the return value it will be
-                       // "unknown" and consumers may warn.
-                       if (!foundAny)
-                               yield return NullValue.Instance;
-               }
-
-               private bool AnalyzeGenericInstantiationTypeArray (in MultiValue arrayParam, in MethodProxy calledMethod, ImmutableArray<GenericParameterValue> genericParameters)
-               {
-                       bool hasRequirements = false;
-                       foreach (var genericParameter in genericParameters) {
-                               if (GetGenericParameterEffectiveMemberTypes (genericParameter) != DynamicallyAccessedMemberTypes.None) {
-                                       hasRequirements = true;
-                                       break;
-                               }
-                       }
-
-                       // If there are no requirements, then there's no point in warning
-                       if (!hasRequirements)
-                               return true;
-
-                       foreach (var typesValue in arrayParam) {
-                               if (typesValue is not ArrayValue array) {
-                                       return false;
-                               }
-
-                               int? size = array.Size.AsConstInt ();
-                               if (size == null || size != genericParameters.Length) {
-                                       return false;
-                               }
-
-                               bool allIndicesKnown = true;
-                               for (int i = 0; i < size.Value; i++) {
-                                       if (!array.TryGetValueByIndex (i, out MultiValue value) || value.AsSingleValue () is UnknownValue) {
-                                               allIndicesKnown = false;
-                                               break;
-                                       }
-                               }
-
-                               if (!allIndicesKnown) {
-                                       return false;
-                               }
-
-                               for (int i = 0; i < size.Value; i++) {
-                                       if (array.TryGetValueByIndex (i, out MultiValue value)) {
-                                               // https://github.com/dotnet/linker/issues/2428
-                                               // We need to report the target as "this" - as that was the previous behavior
-                                               // but with the annotation from the generic parameter.
-                                               var targetValue = _annotations.GetMethodThisParameterValue (calledMethod, GetGenericParameterEffectiveMemberTypes (genericParameters[i]), overrideIsThis: true);
-                                               _requireDynamicallyAccessedMembersAction.Invoke (value, targetValue);
-                                       }
-                               }
-                       }
-                       return true;
-
-                       // Returns effective annotation of a generic parameter where it incorporates the constraint into the annotation.
-                       // There are basically three cases where the constraint matters:
-                       // - NeedsNew<SpecificType> - MarkStep will simply mark the default .ctor of SpecificType in this case, it has nothing to do with reflection
-                       // - NeedsNew<TOuter> - this should be validated by the compiler/IL - TOuter must have matching constraints by definition, so nothing to validate
-                       // - typeof(NeedsNew<>).MakeGenericType(typeOuter) - for this case we have to do it by hand as it's reflection. This is where this method helps.
-                       static DynamicallyAccessedMemberTypes GetGenericParameterEffectiveMemberTypes (GenericParameterValue genericParameter)
-                       {
-                               DynamicallyAccessedMemberTypes result = genericParameter.DynamicallyAccessedMemberTypes;
-                               if (genericParameter.GenericParameter.HasDefaultConstructorConstraint ())
-                                       result |= DynamicallyAccessedMemberTypes.PublicParameterlessConstructor;
-
-                               return result;
-                       }
-               }
-
-               private void ValidateGenericMethodInstantiation (
-                       MethodProxy genericMethod,
-                       in MultiValue genericParametersArray,
-                       MethodProxy reflectionMethod)
-               {
-                       if (!genericMethod.HasGenericParameters ()) {
-                               return;
-                       }
-
-                       var genericParameterValues = GetGenericParameterValues (genericMethod.GetGenericParameters ());
-                       if (!AnalyzeGenericInstantiationTypeArray (genericParametersArray, reflectionMethod, genericParameterValues)) {
-                               _diagnosticContext.AddDiagnostic (DiagnosticId.MakeGenericMethod, reflectionMethod.GetDisplayName ());
-                       }
-               }
-
-               private ImmutableArray<GenericParameterValue> GetGenericParameterValues (ImmutableArray<GenericParameterProxy> genericParameters)
-               {
-                       if (genericParameters.IsEmpty)
-                               return ImmutableArray<GenericParameterValue>.Empty;
-
-                       var builder = ImmutableArray.CreateBuilder<GenericParameterValue> (genericParameters.Length);
-                       foreach (var genericParameter in genericParameters) {
-                               builder.Add (_annotations.GetGenericParameterValue (genericParameter));
-                       }
-                       return builder.ToImmutableArray ();
-               }
-
-               private void ProcessCreateInstanceByName (MethodProxy calledMethod, IReadOnlyList<MultiValue> argumentValues)
-               {
-                       BindingFlags bindingFlags = BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public;
-                       bool parameterlessConstructor = true;
-                       int offset = calledMethod.HasImplicitThis () ? 1 : 0;
-                       if (calledMethod.HasMetadataParametersCount (8) && calledMethod.HasParameterOfType ((ParameterIndex) 2 + offset, "System.Boolean")) {
-                               parameterlessConstructor = false;
-                               bindingFlags = BindingFlags.Instance;
-                               if (argumentValues[3].AsConstInt () is int bindingFlagsInt)
-                                       bindingFlags |= (BindingFlags) bindingFlagsInt;
-                               else
-                                       bindingFlags |= BindingFlags.Public | BindingFlags.NonPublic;
-                       }
-
-                       foreach (var assemblyNameValue in argumentValues[0]) {
-                               if (assemblyNameValue is KnownStringValue assemblyNameStringValue) {
-                                       if (assemblyNameStringValue.Contents is string assemblyName && assemblyName.Length == 0) {
-                                               // Throws exception for zero-length assembly name.
-                                               continue;
-                                       }
-                                       foreach (var typeNameValue in argumentValues[1]) {
-                                               if (typeNameValue is NullValue) {
-                                                       // Throws exception for null type name.
-                                                       continue;
-                                               }
-                                               if (typeNameValue is KnownStringValue typeNameStringValue) {
-                                                       if (!TryResolveTypeNameForCreateInstanceAndMark (calledMethod, assemblyNameStringValue.Contents, typeNameStringValue.Contents, out TypeProxy resolvedType)) {
-                                                               // It's not wrong to have a reference to non-existing type - the code may well expect to get an exception in this case
-                                                               // Note that we did find the assembly, so it's not a ILLink config problem, it's either intentional, or wrong versions of assemblies
-                                                               // but ILLink can't know that. In case a user tries to create an array using System.Activator we should simply ignore it, the user
-                                                               // might expect an exception to be thrown.
-                                                               continue;
-                                                       }
-
-                                                       MarkConstructorsOnType (resolvedType, bindingFlags, parameterlessConstructor ? 0 : null);
-                                               } else {
-                                                       _diagnosticContext.AddDiagnostic (DiagnosticId.UnrecognizedParameterInMethodCreateInstance, new ParameterProxy (calledMethod, (ParameterIndex) 1 + offset).GetDisplayName (), calledMethod.GetDisplayName ());
-                                               }
-                                       }
-                               } else {
-                                       _diagnosticContext.AddDiagnostic (DiagnosticId.UnrecognizedParameterInMethodCreateInstance, new ParameterProxy (calledMethod, (ParameterIndex) 0 + offset).GetDisplayName (), calledMethod.GetDisplayName ());
-                               }
-                       }
-               }
-
-               internal static BindingFlags? GetBindingFlagsFromValue (in MultiValue parameter) => (BindingFlags?) parameter.AsConstInt ();
-
-               internal static bool BindingFlagsAreUnsupported (BindingFlags? bindingFlags)
-               {
-                       if (bindingFlags == null)
-                               return true;
-
-                       // Binding flags we understand
-                       const BindingFlags UnderstoodBindingFlags =
-                               BindingFlags.DeclaredOnly |
-                               BindingFlags.Instance |
-                               BindingFlags.Static |
-                               BindingFlags.Public |
-                               BindingFlags.NonPublic |
-                               BindingFlags.FlattenHierarchy |
-                               BindingFlags.ExactBinding;
-
-                       // Binding flags that don't affect binding outside InvokeMember (that we don't analyze).
-                       const BindingFlags IgnorableBindingFlags =
-                               BindingFlags.InvokeMethod |
-                               BindingFlags.CreateInstance |
-                               BindingFlags.GetField |
-                               BindingFlags.SetField |
-                               BindingFlags.GetProperty |
-                               BindingFlags.SetProperty;
-
-                       BindingFlags flags = bindingFlags.Value;
-                       return (flags & ~(UnderstoodBindingFlags | IgnorableBindingFlags)) != 0;
-               }
-
-               internal static bool HasBindingFlag (BindingFlags? bindingFlags, BindingFlags? search) => bindingFlags != null && (bindingFlags & search) == search;
-
-               internal static DynamicallyAccessedMemberTypes GetDynamicallyAccessedMemberTypesFromBindingFlagsForNestedTypes (BindingFlags? bindingFlags) =>
-                       (HasBindingFlag (bindingFlags, BindingFlags.Public) ? DynamicallyAccessedMemberTypes.PublicNestedTypes : DynamicallyAccessedMemberTypes.None) |
-                       (HasBindingFlag (bindingFlags, BindingFlags.NonPublic) ? DynamicallyAccessedMemberTypes.NonPublicNestedTypes : DynamicallyAccessedMemberTypes.None) |
-                       (BindingFlagsAreUnsupported (bindingFlags) ? DynamicallyAccessedMemberTypes.PublicNestedTypes | DynamicallyAccessedMemberTypes.NonPublicNestedTypes : DynamicallyAccessedMemberTypes.None);
-
-               internal static DynamicallyAccessedMemberTypes GetDynamicallyAccessedMemberTypesFromBindingFlagsForConstructors (BindingFlags? bindingFlags) =>
-                       (HasBindingFlag (bindingFlags, BindingFlags.Public) ? DynamicallyAccessedMemberTypes.PublicConstructors : DynamicallyAccessedMemberTypes.None) |
-                       (HasBindingFlag (bindingFlags, BindingFlags.NonPublic) ? DynamicallyAccessedMemberTypes.NonPublicConstructors : DynamicallyAccessedMemberTypes.None) |
-                       (BindingFlagsAreUnsupported (bindingFlags) ? DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors : DynamicallyAccessedMemberTypes.None);
-
-               internal static DynamicallyAccessedMemberTypes GetDynamicallyAccessedMemberTypesFromBindingFlagsForMethods (BindingFlags? bindingFlags) =>
-                       (HasBindingFlag (bindingFlags, BindingFlags.Public) ? DynamicallyAccessedMemberTypes.PublicMethods : DynamicallyAccessedMemberTypes.None) |
-                       (HasBindingFlag (bindingFlags, BindingFlags.NonPublic) ? DynamicallyAccessedMemberTypes.NonPublicMethods : DynamicallyAccessedMemberTypes.None) |
-                       (BindingFlagsAreUnsupported (bindingFlags) ? DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods : DynamicallyAccessedMemberTypes.None);
-
-               internal static DynamicallyAccessedMemberTypes GetDynamicallyAccessedMemberTypesFromBindingFlagsForFields (BindingFlags? bindingFlags) =>
-                       (HasBindingFlag (bindingFlags, BindingFlags.Public) ? DynamicallyAccessedMemberTypes.PublicFields : DynamicallyAccessedMemberTypes.None) |
-                       (HasBindingFlag (bindingFlags, BindingFlags.NonPublic) ? DynamicallyAccessedMemberTypes.NonPublicFields : DynamicallyAccessedMemberTypes.None) |
-                       (BindingFlagsAreUnsupported (bindingFlags) ? DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields : DynamicallyAccessedMemberTypes.None);
-
-               internal static DynamicallyAccessedMemberTypes GetDynamicallyAccessedMemberTypesFromBindingFlagsForProperties (BindingFlags? bindingFlags) =>
-                       (HasBindingFlag (bindingFlags, BindingFlags.Public) ? DynamicallyAccessedMemberTypes.PublicProperties : DynamicallyAccessedMemberTypes.None) |
-                       (HasBindingFlag (bindingFlags, BindingFlags.NonPublic) ? DynamicallyAccessedMemberTypes.NonPublicProperties : DynamicallyAccessedMemberTypes.None) |
-                       (BindingFlagsAreUnsupported (bindingFlags) ? DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties : DynamicallyAccessedMemberTypes.None);
-
-               internal static DynamicallyAccessedMemberTypes GetDynamicallyAccessedMemberTypesFromBindingFlagsForEvents (BindingFlags? bindingFlags) =>
-                       (HasBindingFlag (bindingFlags, BindingFlags.Public) ? DynamicallyAccessedMemberTypes.PublicEvents : DynamicallyAccessedMemberTypes.None) |
-                       (HasBindingFlag (bindingFlags, BindingFlags.NonPublic) ? DynamicallyAccessedMemberTypes.NonPublicEvents : DynamicallyAccessedMemberTypes.None) |
-                       (BindingFlagsAreUnsupported (bindingFlags) ? DynamicallyAccessedMemberTypes.PublicEvents | DynamicallyAccessedMemberTypes.NonPublicEvents : DynamicallyAccessedMemberTypes.None);
-
-               internal static DynamicallyAccessedMemberTypes GetDynamicallyAccessedMemberTypesFromBindingFlagsForMembers (BindingFlags? bindingFlags) =>
-                       GetDynamicallyAccessedMemberTypesFromBindingFlagsForConstructors (bindingFlags) |
-                       GetDynamicallyAccessedMemberTypesFromBindingFlagsForEvents (bindingFlags) |
-                       GetDynamicallyAccessedMemberTypesFromBindingFlagsForFields (bindingFlags) |
-                       GetDynamicallyAccessedMemberTypesFromBindingFlagsForMethods (bindingFlags) |
-                       GetDynamicallyAccessedMemberTypesFromBindingFlagsForProperties (bindingFlags) |
-                       GetDynamicallyAccessedMemberTypesFromBindingFlagsForNestedTypes (bindingFlags);
-
-               /// <Summary>
-               /// Returns true if the method is a .ctor for System.Type or a type that derives from System.Type (i.e. fields and params of this type can have DynamicallyAccessedMembers annotations)
-               /// </Summary>
-               private partial bool MethodIsTypeConstructor (MethodProxy method);
-
-               private partial IEnumerable<SystemReflectionMethodBaseValue> GetMethodsOnTypeHierarchy (TypeProxy type, string name, BindingFlags? bindingFlags);
-
-               private partial IEnumerable<SystemTypeValue> GetNestedTypesOnType (TypeProxy type, string name, BindingFlags? bindingFlags);
-
-               private partial bool TryGetBaseType (TypeProxy type, [NotNullWhen (true)] out TypeProxy? baseType);
-
-               private partial bool TryResolveTypeNameForCreateInstanceAndMark (in MethodProxy calledMethod, string assemblyName, string typeName, out TypeProxy resolvedType);
-
-               private partial void MarkStaticConstructor (TypeProxy type);
-
-               private partial void MarkEventsOnTypeHierarchy (TypeProxy type, string name, BindingFlags? bindingFlags);
-
-               private partial void MarkFieldsOnTypeHierarchy (TypeProxy type, string name, BindingFlags? bindingFlags);
-
-               private partial void MarkPropertiesOnTypeHierarchy (TypeProxy type, string name, BindingFlags? bindingFlags);
-
-               private partial void MarkPublicParameterlessConstructorOnType (TypeProxy type);
-
-               private partial void MarkConstructorsOnType (TypeProxy type, BindingFlags? bindingFlags, int? parameterCount);
-
-               private partial void MarkMethod (MethodProxy method);
-
-               private partial void MarkType (TypeProxy type);
-
-               private partial bool MarkAssociatedProperty (MethodProxy method);
-
-               // Only used for internal diagnostic purposes (not even for warning messages)
-               private partial string GetContainingSymbolDisplayName ();
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/IntrinsicId.cs b/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/IntrinsicId.cs
deleted file mode 100644 (file)
index 700ed6a..0000000
+++ /dev/null
@@ -1,319 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.TrimAnalysis
-{
-       [StaticCs.Closed]
-       internal enum IntrinsicId
-       {
-               None = 0,
-               /// <summary>
-               /// <see cref="System.Reflection.IntrospectionExtensions.GetTypeInfo(System.Type)"/>
-               /// </summary>
-               IntrospectionExtensions_GetTypeInfo,
-               /// <summary>
-               /// <see cref="System.Type.GetTypeFromHandle(System.RuntimeTypeHandle)"/>
-               /// </summary>
-               Type_GetTypeFromHandle,
-               /// <summary>
-               /// <see cref="System.Type.TypeHandle"/>
-               /// </summary>
-               Type_get_TypeHandle,
-               /// <summary>
-               /// <see cref="object.GetType()"/>
-               /// </summary>
-               Object_GetType,
-               /// <summary>
-               /// <see cref="System.Reflection.TypeDelegator()"/>
-               /// </summary>
-               TypeDelegator_Ctor,
-               /// <summary>
-               /// <see cref="System.Array.Empty{T}"/>
-               /// </summary>
-               Array_Empty,
-               /// <summary>
-               /// <see cref="System.Reflection.TypeInfo.AsType()"/>
-               /// </summary>
-               TypeInfo_AsType,
-               /// <summary>
-               /// <list type="table">
-               /// <item><see cref="System.Reflection.MethodBase.GetMethodFromHandle(System.RuntimeMethodHandle)"/></item>
-               /// <item><see cref="System.Reflection.MethodBase.GetMethodFromHandle(System.RuntimeMethodHandle, System.RuntimeTypeHandle)"/></item>
-               /// </list>
-               /// </summary>
-               MethodBase_GetMethodFromHandle,
-               /// <summary>
-               /// <see cref="System.Reflection.MethodBase.MethodHandle"/>
-               /// </summary>
-               MethodBase_get_MethodHandle,
-
-               // Anything above this marker will require the method to be run through
-               // the reflection body scanner.
-               RequiresReflectionBodyScanner_Sentinel = 1000,
-               /// <summary>
-               /// <see cref="System.Type.MakeGenericType(System.Type[])"/>
-               /// </summary>
-               Type_MakeGenericType,
-               /// <summary>
-               /// <list type="table">
-               /// <item><see cref="System.Type.GetType(string)"/></item>
-               /// <item><see cref= "System.Type.GetType(string, bool)" /></item>
-               /// <item><see cref="System.Type.GetType(string, bool, bool)"/></item>
-               /// <item><see cref="System.Type.GetType(string, System.Func{System.Reflection.AssemblyName, System.Reflection.Assembly?}?, System.Func{System.Reflection.Assembly?, string, bool, System.Type?}?)"/></item>
-               /// <item><see cref="System.Type.GetType(string, System.Func{System.Reflection.AssemblyName, System.Reflection.Assembly?}?, System.Func{System.Reflection.Assembly?, string, bool, System.Type?}?, bool)"/></item>
-               /// <item><see cref="System.Type.GetType(string, System.Func{System.Reflection.AssemblyName, System.Reflection.Assembly?}?, System.Func{System.Reflection.Assembly?, string, bool, System.Type?}?, bool, bool)"/></item>
-               /// </list>
-               /// </summary>
-               Type_GetType,
-               /// <summary>
-               /// <item><see cref="System.Type.GetConstructor(System.Type[])"/></item>
-               /// <item><see cref="System.Type.GetConstructor(System.Reflection.BindingFlags, System.Type[])"/></item>
-               /// <item><see cref="System.Type.GetConstructor(System.Reflection.BindingFlags, System.Reflection.Binder?, System.Type[], System.Reflection.ParameterModifier[]?)"/></item>
-               /// <item><see cref="System.Type.GetConstructor(System.Reflection.BindingFlags, System.Reflection.Binder?, System.Reflection.CallingConventions, System.Type[], System.Reflection.ParameterModifier[]?)"/></item>
-               /// </list>
-               /// </summary>
-               Type_GetConstructor,
-               /// <summary>
-               /// <see cref="System.Type.GetConstructors(System.Reflection.BindingFlags)"/>
-               /// </summary>
-               Type_GetConstructors__BindingFlags,
-               /// <summary>
-               /// <item><see cref="System.Type.GetMethod(string)"/></item>
-               /// <item><see cref="System.Type.GetMethod(string, System.Reflection.BindingFlags)"/></item>
-               /// <item><see cref="System.Type.GetMethod(string, System.Type[])"/></item>
-               /// <item><see cref="System.Type.GetMethod(string, System.Type[], System.Reflection.ParameterModifier[]?)"/></item>
-               /// <item><see cref="System.Type.GetMethod(string, System.Reflection.BindingFlags, System.Type[])"/></item>
-               /// <item><see cref="System.Type.GetMethod(string, System.Reflection.BindingFlags, System.Reflection.Binder, System.Type[], System.Reflection.ParameterModifier[]?)"/></item>
-               /// <item><see cref="System.Type.GetMethod(string, System.Reflection.BindingFlags, System.Reflection.Binder, System.Reflection.CallingConventions, System.Type[], System.Reflection.ParameterModifier[]?)"/></item>
-               /// <item><see cref="System.Type.GetMethod(string, int, System.Type[])"/></item>
-               /// <item><see cref="System.Type.GetMethod(string, int, System.Type[], System.Reflection.ParameterModifier[]?)"/></item>
-               /// <item><see cref="System.Type.GetMethod(string, int, System.Reflection.BindingFlags, System.Reflection.Binder?, System.Type[], System.Reflection.ParameterModifier[]?)"/></item>
-               /// <item><see cref="System.Type.GetMethod(string, int, System.Reflection.BindingFlags, System.Reflection.Binder?, System.Reflection.CallingConventions, System.Type[], System.Reflection.ParameterModifier[]?)"/></item>
-               /// </list>
-               /// </summary>
-               Type_GetMethod,
-               /// <summary>
-               /// <see cref="System.Type.GetMethod(System.Reflection.BindingFlags)"/>
-               /// </summary>
-               Type_GetMethods__BindingFlags,
-               /// <summary>
-               /// <list type="table">
-               /// <item><see cref="System.Type.GetField(string)"/></item>
-               /// <item><see cref="System.Type.GetField(string, System.Reflection.BindingFlags)"/></item>
-               /// </list>
-               /// </summary>
-               Type_GetField,
-               /// <summary>
-               /// <see cref="System.Type.GetFields(System.Reflection.BindingFlags)"/>
-               /// </summary>
-               Type_GetFields__BindingFlags,
-               /// <summary>
-               /// <list type="table">
-               /// <item><see cref="System.Type.GetProperty(string)"/></item>
-               /// <item><see cref="System.Type.GetProperty(string, System.Reflection.BindingFlags)"/></item>
-               /// <item><see cref="System.Type.GetProperty(string, System.Type?)"/></item>
-               /// <item><see cref="System.Type.GetProperty(string, System.Type[])"/></item>
-               /// <item><see cref="System.Type.GetProperty(string, System.Type?, System.Type[])"/></item>
-               /// <item><see cref="System.Type.GetProperty(string, System.Type?, System.Type[], System.Reflection.ParameterModifier[])"/></item>
-               /// <item><see cref="System.Type.GetProperty(string, System.Reflection.BindingFlags, System.Reflection.Binder?, System.Type?, System.Type[], System.Reflection.ParameterModifier[]?)"/></item>
-               /// </list>
-               /// </summary>
-               Type_GetProperty,
-               /// <summary>
-               /// <see cref="System.Type.GetProperties(System.Reflection.BindingFlags)"/>
-               /// </summary>
-               Type_GetProperties__BindingFlags,
-               /// <summary>
-               /// <list type="table">
-               /// <item><see cref="System.Type.GetEvent(string)"/></item>
-               /// <item><see cref="System.Type.GetEvent(string, System.Reflection.BindingFlags)"/></item>
-               /// </list>
-               /// </summary>
-               Type_GetEvent,
-               /// <summary>
-               /// <see cref="System.Type.GetEvents(System.Reflection.BindingFlags)"/>
-               /// </summary>
-               Type_GetEvents__BindingFlags,
-               /// <summary>
-               /// <list type="table">
-               /// <item><see cref="System.Type.GetNestedType(string)"/></item>
-               /// <item><see cref="System.Type.GetNestedType(string, System.Reflection.BindingFlags)"/></item>
-               /// </list>
-               /// </summary>
-               Type_GetNestedType,
-               /// <summary>
-               /// <see cref="System.Type.GetNestedTypes(System.Reflection.BindingFlags)"/>
-               /// </summary>
-               Type_GetNestedTypes__BindingFlags,
-               /// <summary>
-               /// <list type="table">
-               /// <item><see cref="System.Type.GetMember(string)"/></item>
-               /// <item><see cref="System.Type.GetMember(string, System.Reflection.BindingFlags)"/></item>
-               /// <item><see cref="System.Type.GetMember(string, System.Reflection.MemberTypes, System.Reflection.BindingFlags)"/></item>
-               /// </list>
-               /// </summary>
-               Type_GetMember,
-               /// <summary>
-               /// <see cref="System.Type.GetMembers(System.Reflection.BindingFlags)"/>
-               /// </summary>
-               Type_GetMembers__BindingFlags,
-               /// <summary>
-               /// <list type="table">
-               /// <item><see cref="System.Type.GetInterface(string)"/></item>
-               /// <item><see cref="System.Type.GetInterface(string, bool)"/></item>
-               /// </list>
-               /// </summary>
-               Type_GetInterface,
-               /// <summary>
-               /// <see cref="System.Type.AssemblyQualifiedName"/>
-               /// </summary>
-               Type_get_AssemblyQualifiedName,
-               /// <summary>
-               /// <see cref="System.Type.UnderlyingSystemType"/>
-               /// </summary>
-               Type_get_UnderlyingSystemType,
-               /// <summary>
-               /// <see cref="System.Type.BaseType"/>
-               /// </summary>
-               Type_get_BaseType,
-               /// <summary>
-               /// <see cref="System.Linq.Expressions.Expression.Call(System.Type, string, System.Type[]?, System.Linq.Expressions.Expression[]?))"/>
-               /// </summary>
-               Expression_Call,
-               /// <summary>
-               /// <see cref="System.Linq.Expressions.Expression.Field(System.Linq.Expressions.Expression?, System.Type, string)"/>
-               /// </summary>
-               Expression_Field,
-               /// <summary>
-               /// <list type="table">
-               /// <item><see cref="System.Linq.Expressions.Expression.Property(System.Linq.Expressions.Expression?, System.Reflection.MethodInfo)"/></item>
-               /// <item><see cref="System.Linq.Expressions.Expression.Property(System.Linq.Expressions.Expression?, System.Type, string)"/></item>
-               /// </list>
-               /// </summary>
-               Expression_Property,
-               /// <summary>
-               /// <see cref="System.Linq.Expressions.Expression.New(System.Type)"/>
-               /// </summary>
-               Expression_New,
-               /// <summary>
-               /// <see cref="System.Enum.GetValues(System.Type)"/>
-               /// </summary>
-               Enum_GetValues,
-               /// <summary>
-               /// <see cref="System.Runtime.InteropServices.Marshal.SizeOf(System.Type)"/>
-               /// </summary>
-               Marshal_SizeOf,
-               /// <summary>
-               /// <see cref="System.Runtime.InteropServices.Marshal.OffsetOf(System.Type, string)"/>
-               /// </summary>
-               Marshal_OffsetOf,
-               /// <summary>
-               /// <see cref="System.Runtime.InteropServices.Marshal.PtrToStructure(nint, System.Type)"/>
-               /// </summary>
-               Marshal_PtrToStructure,
-               /// <summary>
-               /// <see cref="System.Runtime.InteropServices.Marshal.DestroyStructure(nint, System.Type)"/>
-               /// </summary>
-               Marshal_DestroyStructure,
-               /// <summary>
-               /// <see cref="System.Runtime.InteropServices.Marshal.GetDelegateForFunctionPointer(nint, System.Type)"/>
-               /// </summary>
-               Marshal_GetDelegateForFunctionPointer,
-               /// <list type="table">
-               /// <item><see cref="System.Activator.CreateInstance(System.Type)"/></item>
-               /// <item><see cref="System.Activator.CreateInstance(System.Type, bool)"/></item>
-               /// <item><see cref="System.Activator.CreateInstance(System.Type, object[])"/></item>
-               /// <item><see cref="System.Activator.CreateInstance(System.Type, object[], object[])"/></item>
-               /// <item><see cref="System.Activator.CreateInstance(System.Type, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo)"/></item>
-               /// <item><see cref="System.Activator.CreateInstance(System.Type, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo, object[])"/></item>
-               /// </list>
-               Activator_CreateInstance__Type,
-               /// <summary>
-               /// <list type="table">
-               /// <item><see cref="System.Activator.CreateInstance(string, string)"/></item>
-               /// <item><see cref="System.Activator.CreateInstance(string, string, bool, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo, object[])"/></item>
-               /// <item><see cref="System.Activator.CreateInstance(string, string, object[])"/></item>
-               /// </list>
-               /// </summary>
-               Activator_CreateInstance__AssemblyName_TypeName,
-               /// <summary>
-               /// <list type="table">
-               /// <item><see cref="System.Activator.CreateInstanceFrom(string, string)"/></item>
-               /// <item><see cref="System.Activator.CreateInstanceFrom(string, string, bool, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo, object[])"/></item>
-               /// <item><see cref="System.Activator.CreateInstanceFrom(string, string, object[])"/></item>
-               /// </list>
-               /// </summary>
-               Activator_CreateInstanceFrom,
-               /// <summary>
-               /// <list type="table">
-               /// <item><see cref="System.AppDomain.CreateInstance(string, string)"/></item>
-               /// <item><see cref="System.AppDomain.CreateInstance(string, string, bool, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo, object[])"/></item>
-               /// <item><see cref="System.AppDomain.CreateInstance(string, string, object[])"/></item>
-               /// </list>
-               /// </summary>
-               AppDomain_CreateInstance,
-               /// <summary>
-               /// <list type="table">
-               /// <item><see cref="System.AppDomain.CreateInstanceAndUnwrap(string, string)"/></item>
-               /// <item><see cref="System.AppDomain.CreateInstanceAndUnwrap(string, string, bool, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo, object[])"/></item>
-               /// <item><see cref="System.AppDomain.CreateInstanceAndUnwrap(string, string, object[])"/></item>
-               /// </list>
-               /// </summary>
-               AppDomain_CreateInstanceAndUnwrap,
-               /// <summary>
-               /// <list type="table">
-               /// <item><see cref="System.AppDomain.CreateInstanceFrom(string, string)"/></item>
-               /// <item><see cref="System.AppDomain.CreateInstanceFrom(string, string, bool, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo, object[])"/></item>
-               /// <item><see cref="System.AppDomain.CreateInstanceFrom(string, string, object[])"/></item>
-               /// </list>
-               /// </summary>
-               AppDomain_CreateInstanceFrom,
-               /// <summary>
-               /// <list type="table">
-               /// <item><see cref="System.AppDomain.CreateInstanceFromAndUnwrap(string, string)"/></item>
-               /// <item><see cref="System.AppDomain.CreateInstanceFromAndUnwrap(string, string, bool, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo, object[])"/></item>
-               /// <item><see cref="System.AppDomain.CreateInstanceFromAndUnwrap(string, string, object[])"/></item>
-               /// </list>
-               /// </summary>
-               AppDomain_CreateInstanceFromAndUnwrap,
-               /// <summary>
-               /// <list type="table">
-               /// <item><see cref="System.Reflection.Assembly.CreateInstance(string)"/></item>
-               /// <item><see cref="System.Reflection.Assembly.CreateInstance(string, bool)"/></item>
-               /// <item><see cref="System.Reflection.Assembly.CreateInstance(string, bool, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo, object[])"/></item>
-               /// </list>
-               /// </summary>
-               Assembly_CreateInstance,
-               /// <summary>
-               /// <see cref="System.Reflection.RuntimeReflectionExtensions.GetRuntimeEvent(System.Type, string)"/>
-               /// </summary>
-               RuntimeReflectionExtensions_GetRuntimeEvent,
-               /// <summary>
-               /// <see cref="System.Reflection.RuntimeReflectionExtensions.GetRuntimeField(System.Type, string)"/>
-               /// </summary>
-               RuntimeReflectionExtensions_GetRuntimeField,
-               /// <summary>
-               /// <see cref="System.Reflection.RuntimeReflectionExtensions.GetRuntimeMethod(System.Type, string, System.Type[])"/>
-               /// </summary>
-               RuntimeReflectionExtensions_GetRuntimeMethod,
-               /// <summary>
-               /// <see cref="System.Reflection.RuntimeReflectionExtensions.GetRuntimeProperty(System.Type, string)"/>
-               /// </summary>
-               RuntimeReflectionExtensions_GetRuntimeProperty,
-               /// <summary>
-               /// <see cref="System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(System.RuntimeTypeHandle)"/>
-               /// </summary>
-               RuntimeHelpers_RunClassConstructor,
-               /// <summary>
-               /// <see cref="System.Reflection.MethodInfo.MakeGenericMethod(System.Type[])"/>
-               /// </summary>
-               MethodInfo_MakeGenericMethod,
-               /// <summary>
-               /// <see cref="System.Nullable.GetUnderlyingType(System.Type)"/>
-               /// </summary>
-               Nullable_GetUnderlyingType
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/Intrinsics.cs b/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/Intrinsics.cs
deleted file mode 100644 (file)
index fa71f74..0000000
+++ /dev/null
@@ -1,380 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using ILLink.Shared.TypeSystemProxy;
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.TrimAnalysis
-{
-       internal static class Intrinsics
-       {
-               public static IntrinsicId GetIntrinsicIdForMethod (MethodProxy calledMethod)
-               {
-                       return calledMethod.Name switch {
-                               // static System.Reflection.IntrospectionExtensions.GetTypeInfo (Type type)
-                               "GetTypeInfo" when calledMethod.IsDeclaredOnType ("System.Reflection.IntrospectionExtensions") => IntrinsicId.IntrospectionExtensions_GetTypeInfo,
-
-                               // System.Reflection.TypeInfo.AsType ()
-                               "AsType" when calledMethod.IsDeclaredOnType ("System.Reflection.TypeInfo") => IntrinsicId.TypeInfo_AsType,
-
-                               // System.Type.GetTypeInfo (Type type)
-                               "GetTypeFromHandle" when calledMethod.IsDeclaredOnType ("System.Type") => IntrinsicId.Type_GetTypeFromHandle,
-
-                               // System.Type.TypeHandle getter
-                               "get_TypeHandle" when calledMethod.IsDeclaredOnType ("System.Type") => IntrinsicId.Type_get_TypeHandle,
-
-                               // static System.Reflection.MethodBase.GetMethodFromHandle (RuntimeMethodHandle handle)
-                               // static System.Reflection.MethodBase.GetMethodFromHandle (RuntimeMethodHandle handle, RuntimeTypeHandle declaringType)
-                               "GetMethodFromHandle" when calledMethod.IsDeclaredOnType ("System.Reflection.MethodBase")
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 0, "System.RuntimeMethodHandle")
-                                       && (calledMethod.HasMetadataParametersCount (1) || calledMethod.HasMetadataParametersCount (2))
-                                       => IntrinsicId.MethodBase_GetMethodFromHandle,
-
-                               // System.Reflection.MethodBase.MethodHandle getter
-                               "get_MethodHandle" when calledMethod.IsDeclaredOnType ("System.Reflection.MethodBase") => IntrinsicId.MethodBase_get_MethodHandle,
-
-                               // static System.Type.MakeGenericType (Type [] typeArguments)
-                               "MakeGenericType" when calledMethod.IsDeclaredOnType ("System.Type") => IntrinsicId.Type_MakeGenericType,
-
-                               // static System.Reflection.RuntimeReflectionExtensions.GetRuntimeEvent (this Type type, string name)
-                               "GetRuntimeEvent" when calledMethod.IsDeclaredOnType ("System.Reflection.RuntimeReflectionExtensions")
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 0, "System.Type")
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 1, "System.String")
-                                       => IntrinsicId.RuntimeReflectionExtensions_GetRuntimeEvent,
-
-                               // static System.Reflection.RuntimeReflectionExtensions.GetRuntimeField (this Type type, string name)
-                               "GetRuntimeField" when calledMethod.IsDeclaredOnType ("System.Reflection.RuntimeReflectionExtensions")
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 0, "System.Type")
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 1, "System.,String")
-                                       => IntrinsicId.RuntimeReflectionExtensions_GetRuntimeField,
-
-                               // static System.Reflection.RuntimeReflectionExtensions.GetRuntimeMethod (this Type type, string name, Type[] parameters)
-                               "GetRuntimeMethod" when calledMethod.IsDeclaredOnType ("System.Reflection.RuntimeReflectionExtensions")
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 0, "System.Type")
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 1, "System.String")
-                                       => IntrinsicId.RuntimeReflectionExtensions_GetRuntimeMethod,
-
-                               // static System.Reflection.RuntimeReflectionExtensions.GetRuntimeProperty (this Type type, string name)
-                               "GetRuntimeProperty" when calledMethod.IsDeclaredOnType ("System.Reflection.RuntimeReflectionExtensions")
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 0, "System.Type")
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 1, "System.String")
-                                       => IntrinsicId.RuntimeReflectionExtensions_GetRuntimeProperty,
-
-                               // static System.Linq.Expressions.Expression.Call (Type, String, Type[], Expression[])
-                               "Call" when calledMethod.IsDeclaredOnType ("System.Linq.Expressions.Expression")
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 0, "System.Type")
-                                       && calledMethod.HasMetadataParametersCount (4)
-                                       => IntrinsicId.Expression_Call,
-
-                               // static System.Linq.Expressions.Expression.Field (Expression, Type, String)
-                               "Field" when calledMethod.IsDeclaredOnType ("System.Linq.Expressions.Expression")
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 1, "System.Type")
-                                       && calledMethod.HasMetadataParametersCount (3)
-                                       => IntrinsicId.Expression_Field,
-
-                               // static System.Linq.Expressions.Expression.Property (Expression, Type, String)
-                               // static System.Linq.Expressions.Expression.Property (Expression, MethodInfo)
-                               "Property" when calledMethod.IsDeclaredOnType ("System.Linq.Expressions.Expression")
-                                       && ((calledMethod.HasParameterOfType ((ParameterIndex) 1, "System.Type") && calledMethod.HasMetadataParametersCount (3))
-                                       || (calledMethod.HasParameterOfType ((ParameterIndex) 1, "System.Reflection.MethodInfo") && calledMethod.HasMetadataParametersCount (2)))
-                                       => IntrinsicId.Expression_Property,
-
-                               // static System.Linq.Expressions.Expression.New (Type)
-                               "New" when calledMethod.IsDeclaredOnType ("System.Linq.Expressions.Expression")
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 0, "System.Type")
-                                       && calledMethod.HasMetadataParametersCount (1)
-                                       => IntrinsicId.Expression_New,
-
-                               // static Array System.Enum.GetValues (Type)
-                               "GetValues" when calledMethod.IsDeclaredOnType ("System.Enum")
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 0, "System.Type")
-                                       && calledMethod.HasMetadataParametersCount (1)
-                                       => IntrinsicId.Enum_GetValues,
-
-                               // static int System.Runtime.InteropServices.Marshal.SizeOf (Type)
-                               "SizeOf" when calledMethod.IsDeclaredOnType ("System.Runtime.InteropServices.Marshal")
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 0, "System.Type")
-                                       && calledMethod.HasMetadataParametersCount (1)
-                                       => IntrinsicId.Marshal_SizeOf,
-
-                               // static int System.Runtime.InteropServices.Marshal.OffsetOf (Type, string)
-                               "OffsetOf" when calledMethod.IsDeclaredOnType ("System.Runtime.InteropServices.Marshal")
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 0, "System.Type")
-                                       && calledMethod.HasMetadataParametersCount (2)
-                                       => IntrinsicId.Marshal_OffsetOf,
-
-                               // static object System.Runtime.InteropServices.Marshal.PtrToStructure (IntPtr, Type)
-                               "PtrToStructure" when calledMethod.IsDeclaredOnType ("System.Runtime.InteropServices.Marshal")
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 1, "System.Type")
-                                       && calledMethod.HasMetadataParametersCount (2)
-                                       => IntrinsicId.Marshal_PtrToStructure,
-
-                               // static void System.Runtime.InteropServices.Marshal.DestroyStructure (IntPtr, Type)
-                               "DestroyStructure" when calledMethod.IsDeclaredOnType ("System.Runtime.InteropServices.Marshal")
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 1, "System.Type")
-                                       && calledMethod.HasMetadataParametersCount (2)
-                                       => IntrinsicId.Marshal_DestroyStructure,
-
-                               // static Delegate System.Runtime.InteropServices.Marshal.GetDelegateForFunctionPointer (IntPtr, Type)
-                               "GetDelegateForFunctionPointer" when calledMethod.IsDeclaredOnType ("System.Runtime.InteropServices.Marshal")
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 1, "System.Type")
-                                       && calledMethod.HasMetadataParametersCount (2)
-                                       => IntrinsicId.Marshal_GetDelegateForFunctionPointer,
-
-                               // static System.Type.GetType (string)
-                               // static System.Type.GetType (string, Boolean)
-                               // static System.Type.GetType (string, Boolean, Boolean)
-                               // static System.Type.GetType (string, Func<AssemblyName, Assembly>, Func<Assembly, String, Boolean, Type>)
-                               // static System.Type.GetType (string, Func<AssemblyName, Assembly>, Func<Assembly, String, Boolean, Type>, Boolean)
-                               // static System.Type.GetType (string, Func<AssemblyName, Assembly>, Func<Assembly, String, Boolean, Type>, Boolean, Boolean)
-                               "GetType" when calledMethod.IsDeclaredOnType ("System.Type")
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 0, "System.String")
-                                       => IntrinsicId.Type_GetType,
-
-                               // System.Type.GetConstructor (Type[])
-                               // System.Type.GetConstructor (BindingFlags, Type[])
-                               // System.Type.GetConstructor (BindingFlags, Binder, Type[], ParameterModifier [])
-                               // System.Type.GetConstructor (BindingFlags, Binder, CallingConventions, Type[], ParameterModifier [])
-                               "GetConstructor" when calledMethod.IsDeclaredOnType ("System.Type")
-                                       && !calledMethod.IsStatic ()
-                                       => IntrinsicId.Type_GetConstructor,
-
-                               // System.Type.GetConstructors (BindingFlags)
-                               "GetConstructors" when calledMethod.IsDeclaredOnType ("System.Type")
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 1, "System.Reflection.BindingFlags")
-                                       && calledMethod.HasMetadataParametersCount (1)
-                                       && !calledMethod.IsStatic ()
-                                       => IntrinsicId.Type_GetConstructors__BindingFlags,
-
-                               // System.Type.GetMethod (string)
-                               // System.Type.GetMethod (string, BindingFlags)
-                               // System.Type.GetMethod (string, Type[])
-                               // System.Type.GetMethod (string, Type[], ParameterModifier[])
-                               // System.Type.GetMethod (string, BindingFlags, Type[])
-                               // System.Type.GetMethod (string, BindingFlags, Binder, Type[], ParameterModifier[])
-                               // System.Type.GetMethod (string, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[])
-                               // System.Type.GetMethod (string, int, Type[])
-                               // System.Type.GetMethod (string, int, Type[], ParameterModifier[]?)
-                               // System.Type.GetMethod (string, int, BindingFlags, Binder?, Type[], ParameterModifier[]?)
-                               // System.Type.GetMethod (string, int, BindingFlags, Binder?, CallingConventions, Type[], ParameterModifier[]?)
-                               "GetMethod" when calledMethod.IsDeclaredOnType ("System.Type")
-                                       && calledMethod.HasImplicitThis ()
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 1, "System.String")
-                                       => IntrinsicId.Type_GetMethod,
-
-                               // System.Type.GetMethods (BindingFlags)
-                               "GetMethods" when calledMethod.IsDeclaredOnType ("System.Type")
-                                       && calledMethod.HasImplicitThis ()
-                                       && calledMethod.HasMetadataParametersCount (1)
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 1, "System.Reflection.BindingFlags")
-                                       => IntrinsicId.Type_GetMethods__BindingFlags,
-
-                               // System.Type.GetField (string)
-                               // System.Type.GetField (string, BindingFlags)
-                               "GetField" when calledMethod.IsDeclaredOnType ("System.Type")
-                                       && calledMethod.HasImplicitThis ()
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 1, "System.String")
-                                       => IntrinsicId.Type_GetField,
-
-                               // System.Type.GetFields (BindingFlags)
-                               "GetFields" when calledMethod.IsDeclaredOnType ("System.Type")
-                                       && calledMethod.HasImplicitThis ()
-                                       && calledMethod.HasMetadataParametersCount (1)
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 1, "System.Reflection.BindingFlags")
-                                       => IntrinsicId.Type_GetFields__BindingFlags,
-
-                               // System.Type.GetEvent (string)
-                               // System.Type.GetEvent (string, BindingFlags)
-                               "GetEvent" when calledMethod.IsDeclaredOnType ("System.Type")
-                                       && calledMethod.HasImplicitThis ()
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 1, "System.String")
-                                       => IntrinsicId.Type_GetEvent,
-
-                               // System.Type.GetEvents (BindingFlags)
-                               "GetEvents" when calledMethod.IsDeclaredOnType ("System.Type")
-                                       && calledMethod.HasImplicitThis ()
-                                       && calledMethod.HasMetadataParametersCount (1)
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 1, "System.Reflection.BindingFlags")
-                                       => IntrinsicId.Type_GetEvents__BindingFlags,
-
-                               // System.Type.GetNestedType (string)
-                               // System.Type.GetNestedType (string, BindingFlags)
-                               "GetNestedType" when calledMethod.IsDeclaredOnType ("System.Type")
-                                       && calledMethod.HasImplicitThis ()
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 1, "System.String")
-                                       => IntrinsicId.Type_GetNestedType,
-
-                               // System.Type.GetNestedTypes (BindingFlags)
-                               "GetNestedTypes" when calledMethod.IsDeclaredOnType ("System.Type")
-                                       && calledMethod.HasImplicitThis ()
-                                       && calledMethod.HasMetadataParametersCount (1)
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 1, "System.Reflection.BindingFlags")
-                                       => IntrinsicId.Type_GetNestedTypes__BindingFlags,
-
-                               // System.Type.GetMember (String)
-                               // System.Type.GetMember (String, BindingFlags)
-                               // System.Type.GetMember (String, MemberTypes, BindingFlags)
-                               "GetMember" when calledMethod.IsDeclaredOnType ("System.Type")
-                                       && calledMethod.HasImplicitThis ()
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 1, "System.String")
-                                       && (calledMethod.HasMetadataParametersCount (1) ||
-                                       (calledMethod.HasMetadataParametersCount (2) && calledMethod.HasParameterOfType ((ParameterIndex) 2, "System.Reflection.BindingFlags")) ||
-                                       (calledMethod.HasMetadataParametersCount (3) && calledMethod.HasParameterOfType ((ParameterIndex) 3, "System.Reflection.BindingFlags")))
-                                       => IntrinsicId.Type_GetMember,
-
-                               // System.Type.GetMembers (BindingFlags)
-                               "GetMembers" when calledMethod.IsDeclaredOnType ("System.Type")
-                                       && calledMethod.HasImplicitThis ()
-                                       && calledMethod.HasMetadataParametersCount (1)
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 1, "System.Reflection.BindingFlags")
-                                       => IntrinsicId.Type_GetMembers__BindingFlags,
-
-                               // System.Type.GetInterface (string)
-                               // System.Type.GetInterface (string, bool)
-                               "GetInterface" when calledMethod.IsDeclaredOnType ("System.Type")
-                                       && calledMethod.HasImplicitThis ()
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 1, "System.String")
-                                       && (calledMethod.HasMetadataParametersCount (1) ||
-                                       (calledMethod.HasMetadataParametersCount (2) && calledMethod.HasParameterOfType ((ParameterIndex) 2, "System.Boolean")))
-                                       => IntrinsicId.Type_GetInterface,
-
-                               // System.Type.AssemblyQualifiedName
-                               "get_AssemblyQualifiedName" when calledMethod.IsDeclaredOnType ("System.Type")
-                                       && calledMethod.HasImplicitThis ()
-                                       && !calledMethod.HasMetadataParameters ()
-                                       => IntrinsicId.Type_get_AssemblyQualifiedName,
-
-                               // System.Type.UnderlyingSystemType
-                               "get_UnderlyingSystemType" when calledMethod.IsDeclaredOnType ("System.Type")
-                                       && calledMethod.HasImplicitThis ()
-                                       && !calledMethod.HasMetadataParameters ()
-                                       => IntrinsicId.Type_get_UnderlyingSystemType,
-
-                               // System.Type.BaseType
-                               "get_BaseType" when calledMethod.IsDeclaredOnType ("System.Type")
-                                       && calledMethod.HasImplicitThis ()
-                                       && !calledMethod.HasMetadataParameters ()
-                                       => IntrinsicId.Type_get_BaseType,
-
-                               // System.Type.GetProperty (string)
-                               // System.Type.GetProperty (string, BindingFlags)
-                               // System.Type.GetProperty (string, Type)
-                               // System.Type.GetProperty (string, Type[])
-                               // System.Type.GetProperty (string, Type, Type[])
-                               // System.Type.GetProperty (string, Type, Type[], ParameterModifier[])
-                               // System.Type.GetProperty (string, BindingFlags, Binder, Type, Type[], ParameterModifier[])
-                               "GetProperty" when calledMethod.IsDeclaredOnType ("System.Type")
-                                       && calledMethod.HasImplicitThis ()
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 1, "System.String")
-                                       => IntrinsicId.Type_GetProperty,
-
-                               // System.Type.GetProperties (BindingFlags)
-                               "GetProperties" when calledMethod.IsDeclaredOnType ("System.Type")
-                                       && calledMethod.HasImplicitThis ()
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 1, "System.Reflection.BindingFlags")
-                                       && calledMethod.HasMetadataParametersCount (1)
-                                       => IntrinsicId.Type_GetProperties__BindingFlags,
-
-                               // static System.Object.GetType ()
-                               "GetType" when calledMethod.IsDeclaredOnType ("System.Object")
-                                       => IntrinsicId.Object_GetType,
-
-                               ".ctor" when calledMethod.IsDeclaredOnType ("System.Reflection.TypeDelegator")
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 1, "System.Type")
-                                       => IntrinsicId.TypeDelegator_Ctor,
-
-                               "Empty" when calledMethod.IsDeclaredOnType ("System.Array")
-                                       => IntrinsicId.Array_Empty,
-
-                               // static System.Activator.CreateInstance (System.Type type)
-                               // static System.Activator.CreateInstance (System.Type type, bool nonPublic)
-                               // static System.Activator.CreateInstance (System.Type type, params object?[]? args)
-                               // static System.Activator.CreateInstance (System.Type type, object?[]? args, object?[]? activationAttributes)
-                               // static System.Activator.CreateInstance (System.Type type, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, object?[]? args, System.Globalization.CultureInfo? culture)
-                               // static System.Activator.CreateInstance (System.Type type, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, object?[]? args, System.Globalization.CultureInfo? culture, object?[]? activationAttributes) { throw null; }
-                               "CreateInstance" when calledMethod.IsDeclaredOnType ("System.Activator")
-                                       && !calledMethod.HasGenericParameters ()
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 0, "System.Type")
-                                       => IntrinsicId.Activator_CreateInstance__Type,
-
-                               // static System.Activator.CreateInstance (string assemblyName, string typeName)
-                               // static System.Activator.CreateInstance (string assemblyName, string typeName, bool ignoreCase, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, object?[]? args, System.Globalization.CultureInfo? culture, object?[]? activationAttributes)
-                               // static System.Activator.CreateInstance (string assemblyName, string typeName, object?[]? activationAttributes)
-                               "CreateInstance" when calledMethod.IsDeclaredOnType ("System.Activator")
-                                       && !calledMethod.HasGenericParameters ()
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 0, "System.String")
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 1, "System.String")
-                                       => IntrinsicId.Activator_CreateInstance__AssemblyName_TypeName,
-
-                               // static System.Activator.CreateInstanceFrom (string assemblyFile, string typeName)
-                               // static System.Activator.CreateInstanceFrom (string assemblyFile, string typeName, bool ignoreCase, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, object? []? args, System.Globalization.CultureInfo? culture, object? []? activationAttributes)
-                               // static System.Activator.CreateInstanceFrom (string assemblyFile, string typeName, object? []? activationAttributes)
-                               "CreateInstanceFrom" when calledMethod.IsDeclaredOnType ("System.Activator")
-                                       && !calledMethod.HasGenericParameters ()
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 0, "System.String")
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 1, "System.String")
-                                       => IntrinsicId.Activator_CreateInstanceFrom,
-
-                               // System.AppDomain.CreateInstance (string assemblyName, string typeName)
-                               // System.AppDomain.CreateInstance (string assemblyName, string typeName, bool ignoreCase, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, object? []? args, System.Globalization.CultureInfo? culture, object? []? activationAttributes)
-                               // System.AppDomain.CreateInstance (string assemblyName, string typeName, object? []? activationAttributes)
-                               "CreateInstance" when calledMethod.IsDeclaredOnType ("System.AppDomain")
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 1, "System.String")
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 2, "System.String")
-                                       => IntrinsicId.AppDomain_CreateInstance,
-
-                               // System.AppDomain.CreateInstanceAndUnwrap (string assemblyName, string typeName)
-                               // System.AppDomain.CreateInstanceAndUnwrap (string assemblyName, string typeName, bool ignoreCase, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, object? []? args, System.Globalization.CultureInfo? culture, object? []? activationAttributes)
-                               // System.AppDomain.CreateInstanceAndUnwrap (string assemblyName, string typeName, object? []? activationAttributes)
-                               "CreateInstanceAndUnwrap" when calledMethod.IsDeclaredOnType ("System.AppDomain")
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 1, "System.String")
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 2, "System.String")
-                                       => IntrinsicId.AppDomain_CreateInstanceAndUnwrap,
-
-                               // System.AppDomain.CreateInstanceFrom (string assemblyFile, string typeName)
-                               // System.AppDomain.CreateInstanceFrom (string assemblyFile, string typeName, bool ignoreCase, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, object? []? args, System.Globalization.CultureInfo? culture, object? []? activationAttributes)
-                               // System.AppDomain.CreateInstanceFrom (string assemblyFile, string typeName, object? []? activationAttributes)
-                               "CreateInstanceFrom" when calledMethod.IsDeclaredOnType ("System.AppDomain")
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 1, "System.String")
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 2, "System.String")
-                                       => IntrinsicId.AppDomain_CreateInstanceFrom,
-
-                               // System.AppDomain.CreateInstanceFromAndUnwrap (string assemblyFile, string typeName)
-                               // System.AppDomain.CreateInstanceFromAndUnwrap (string assemblyFile, string typeName, bool ignoreCase, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, object? []? args, System.Globalization.CultureInfo? culture, object? []? activationAttributes)
-                               // System.AppDomain.CreateInstanceFromAndUnwrap (string assemblyFile, string typeName, object? []? activationAttributes)
-                               "CreateInstanceFromAndUnwrap" when calledMethod.IsDeclaredOnType ("System.AppDomain")
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 1, "System.String")
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 2, "System.String")
-                                       => IntrinsicId.AppDomain_CreateInstanceFromAndUnwrap,
-
-                               // System.Reflection.Assembly.CreateInstance (string typeName)
-                               // System.Reflection.Assembly.CreateInstance (string typeName, bool ignoreCase)
-                               // System.Reflection.Assembly.CreateInstance (string typeName, bool ignoreCase, BindingFlags bindingAttr, Binder? binder, object []? args, CultureInfo? culture, object []? activationAttributes)
-                               "CreateInstance" when calledMethod.IsDeclaredOnType ("System.Reflection.Assembly")
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 1, "System.String")
-                                       => IntrinsicId.Assembly_CreateInstance,
-
-                               // System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor (RuntimeTypeHandle type)
-                               "RunClassConstructor" when calledMethod.IsDeclaredOnType ("System.Runtime.CompilerServices.RuntimeHelpers")
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 0, "System.RuntimeTypeHandle")
-                                       => IntrinsicId.RuntimeHelpers_RunClassConstructor,
-
-                               // System.Reflection.MethodInfo.MakeGenericMethod (Type[] typeArguments)
-                               "MakeGenericMethod" when calledMethod.IsDeclaredOnType ("System.Reflection.MethodInfo")
-                                       && calledMethod.HasImplicitThis ()
-                                       && calledMethod.HasMetadataParametersCount (1)
-                                       => IntrinsicId.MethodInfo_MakeGenericMethod,
-
-                               // static System.Nullable.GetUnderlyingType
-                               "GetUnderlyingType" when calledMethod.IsDeclaredOnType ("System.Nullable")
-                                       && calledMethod.IsStatic ()
-                                       && calledMethod.HasParameterOfType ((ParameterIndex) 0, "System.Type")
-                                       => IntrinsicId.Nullable_GetUnderlyingType,
-
-                               _ => IntrinsicId.None,
-                       };
-               }
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/KnownStringValue.cs b/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/KnownStringValue.cs
deleted file mode 100644 (file)
index b1cee31..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using ILLink.Shared.DataFlow;
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.TrimAnalysis
-{
-       /// <summary>
-       /// A known string - such as the result of a ldstr.
-       /// </summary>
-       internal sealed partial record KnownStringValue : SingleValue
-       {
-               public KnownStringValue (string contents) => Contents = contents;
-
-               public readonly string Contents;
-
-               public override SingleValue DeepCopy () => this; // This value is immutable
-
-               public override string ToString () => this.ValueToString ("\"" + Contents + "\"");
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/MethodParameterValue.cs b/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/MethodParameterValue.cs
deleted file mode 100644 (file)
index 7936158..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-
-using System.Collections.Generic;
-using ILLink.Shared.DataFlow;
-using ILLink.Shared.TypeSystemProxy;
-
-namespace ILLink.Shared.TrimAnalysis
-{
-       internal sealed partial record MethodParameterValue : ValueWithDynamicallyAccessedMembers
-       {
-               // _overrideIsThis is needed for backwards compatibility with MakeGenericType/Method https://github.com/dotnet/linker/issues/2428
-               private readonly bool _overrideIsThis;
-
-               public ParameterProxy Parameter { get; }
-
-               public override IEnumerable<string> GetDiagnosticArgumentsForAnnotationMismatch ()
-                       => Parameter.GetDiagnosticArgumentsForAnnotationMismatch ();
-
-               public override string ToString ()
-                       => this.ValueToString (Parameter.Method.Method, Parameter.Index, DynamicallyAccessedMemberTypes);
-
-               public bool IsThisParameter () => _overrideIsThis || Parameter.IsImplicitThis;
-
-               public override SingleValue DeepCopy () => this; // This value is immutable
-
-               public ParameterIndex Index => Parameter.Index;
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/MethodReturnValue.cs b/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/MethodReturnValue.cs
deleted file mode 100644 (file)
index 9152343..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.TrimAnalysis
-{
-       internal sealed partial record class MethodReturnValue : ValueWithDynamicallyAccessedMembers;
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/NullValue.cs b/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/NullValue.cs
deleted file mode 100644 (file)
index 0e354bf..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using ILLink.Shared.DataFlow;
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.TrimAnalysis
-{
-       internal sealed record NullValue : SingleValue
-       {
-               private NullValue ()
-               {
-               }
-
-               public static NullValue Instance { get; } = new NullValue ();
-
-               public override SingleValue DeepCopy () => this; // This value is immutable
-
-               public override string ToString () => this.ValueToString ();
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/NullableSystemTypeValue.cs b/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/NullableSystemTypeValue.cs
deleted file mode 100644 (file)
index f08d97b..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System.Diagnostics;
-using ILLink.Shared.DataFlow;
-using ILLink.Shared.TypeSystemProxy;
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.TrimAnalysis
-{
-       /// <summary>
-       /// This represents a Nullable<T> where T is a known SystemTypeValue.
-       /// It is necessary to track the underlying type to propagate DynamicallyAccessedMembers annotations to the underlying type when applied to a Nullable.
-       /// </summary>
-       internal sealed record NullableSystemTypeValue : SingleValue
-       {
-               public NullableSystemTypeValue (in TypeProxy nullableType, in SystemTypeValue underlyingTypeValue)
-               {
-                       Debug.Assert (nullableType.IsTypeOf (WellKnownType.System_Nullable_T));
-                       UnderlyingTypeValue = underlyingTypeValue;
-                       NullableType = nullableType;
-               }
-               public readonly TypeProxy NullableType;
-
-               public readonly SystemTypeValue UnderlyingTypeValue;
-
-               public override SingleValue DeepCopy () => this; // This value is immutable
-
-               public override string ToString () => this.ValueToString (UnderlyingTypeValue, NullableType);
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/NullableValueWithDynamicallyAccessedMembers.cs b/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/NullableValueWithDynamicallyAccessedMembers.cs
deleted file mode 100644 (file)
index 38983bd..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Diagnostics.CodeAnalysis;
-using ILLink.Shared.DataFlow;
-using ILLink.Shared.TypeSystemProxy;
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.TrimAnalysis
-{
-       /// <summary>
-       /// This represents a Nullable<T> where T is an unknown value with DynamicallyAccessedMembers annotations.
-       /// It is necessary to track the underlying type to ensure DynamicallyAccessedMembers annotations on the underlying type match the target parameters where the Nullable is used.
-       /// </summary>
-       internal sealed record NullableValueWithDynamicallyAccessedMembers : ValueWithDynamicallyAccessedMembers
-       {
-               public NullableValueWithDynamicallyAccessedMembers (in TypeProxy nullableType, in ValueWithDynamicallyAccessedMembers underlyingTypeValue)
-               {
-                       Debug.Assert (nullableType.IsTypeOf (WellKnownType.System_Nullable_T));
-                       NullableType = nullableType;
-                       UnderlyingTypeValue = underlyingTypeValue;
-               }
-
-               public readonly TypeProxy NullableType;
-               public readonly ValueWithDynamicallyAccessedMembers UnderlyingTypeValue;
-
-               public override DynamicallyAccessedMemberTypes DynamicallyAccessedMemberTypes => UnderlyingTypeValue.DynamicallyAccessedMemberTypes;
-               public override IEnumerable<string> GetDiagnosticArgumentsForAnnotationMismatch ()
-                       => UnderlyingTypeValue.GetDiagnosticArgumentsForAnnotationMismatch ();
-
-               public override SingleValue DeepCopy () => this; // This value is immutable
-
-               public override string ToString () => this.ValueToString (UnderlyingTypeValue, NullableType);
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/ReferenceKind.cs b/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/ReferenceKind.cs
deleted file mode 100644 (file)
index 7355ef8..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-
-namespace ILLink.Shared.TypeSystemProxy
-{
-       public enum ReferenceKind
-       {
-               Ref,
-               In,
-               Out,
-               None
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/RequireDynamicallyAccessedMembersAction.cs b/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/RequireDynamicallyAccessedMembersAction.cs
deleted file mode 100644 (file)
index aa24361..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-using System.Diagnostics.CodeAnalysis;
-using System.Linq;
-using System.Runtime.InteropServices;
-using ILLink.Shared.TypeSystemProxy;
-using MultiValue = ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>;
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.TrimAnalysis
-{
-       [StructLayout (LayoutKind.Auto)]
-       internal partial struct RequireDynamicallyAccessedMembersAction
-       {
-               private readonly DiagnosticContext _diagnosticContext;
-
-               public void Invoke (in MultiValue value, ValueWithDynamicallyAccessedMembers targetValue)
-               {
-                       if (targetValue.DynamicallyAccessedMemberTypes == DynamicallyAccessedMemberTypes.None)
-                               return;
-
-                       foreach (var uniqueValue in value) {
-                               if (targetValue.DynamicallyAccessedMemberTypes == DynamicallyAccessedMemberTypes.PublicParameterlessConstructor
-                                       && uniqueValue is GenericParameterValue genericParam
-                                       && genericParam.GenericParameter.HasDefaultConstructorConstraint ()) {
-                                       // We allow a new() constraint on a generic parameter to satisfy DynamicallyAccessedMemberTypes.PublicParameterlessConstructor
-                               } else if (uniqueValue is ValueWithDynamicallyAccessedMembers valueWithDynamicallyAccessedMembers) {
-                                       if (uniqueValue is NullableValueWithDynamicallyAccessedMembers nullableValue) {
-                                               MarkTypeForDynamicallyAccessedMembers (nullableValue.NullableType, nullableValue.DynamicallyAccessedMemberTypes);
-                                       }
-                                       var availableMemberTypes = valueWithDynamicallyAccessedMembers.DynamicallyAccessedMemberTypes;
-                                       if (!Annotations.SourceHasRequiredAnnotations (availableMemberTypes, targetValue.DynamicallyAccessedMemberTypes, out var missingMemberTypes)) {
-                                               (var diagnosticId, var diagnosticArguments) = Annotations.GetDiagnosticForAnnotationMismatch (valueWithDynamicallyAccessedMembers, targetValue, missingMemberTypes);
-                                               _diagnosticContext.AddDiagnostic (diagnosticId, valueWithDynamicallyAccessedMembers, targetValue, diagnosticArguments);
-                                       }
-                               } else if (uniqueValue is SystemTypeValue systemTypeValue) {
-                                       MarkTypeForDynamicallyAccessedMembers (systemTypeValue.RepresentedType, targetValue.DynamicallyAccessedMemberTypes);
-                               } else if (uniqueValue is KnownStringValue knownStringValue) {
-                                       if (!TryResolveTypeNameAndMark (knownStringValue.Contents, true, out TypeProxy foundType)) {
-                                               // Intentionally ignore - it's not wrong for code to call Type.GetType on non-existing name, the code might expect null/exception back.
-                                       } else {
-                                               MarkTypeForDynamicallyAccessedMembers (foundType, targetValue.DynamicallyAccessedMemberTypes);
-                                       }
-                               } else if (uniqueValue is NullableSystemTypeValue nullableSystemTypeValue) {
-                                       MarkTypeForDynamicallyAccessedMembers (nullableSystemTypeValue.NullableType, targetValue.DynamicallyAccessedMemberTypes);
-                                       MarkTypeForDynamicallyAccessedMembers (nullableSystemTypeValue.UnderlyingTypeValue.RepresentedType, targetValue.DynamicallyAccessedMemberTypes);
-                               } else if (uniqueValue == NullValue.Instance) {
-                                       // Ignore - probably unreachable path as it would fail at runtime anyway.
-                               } else {
-                                       DiagnosticId diagnosticId = targetValue switch {
-                                               MethodParameterValue maybeThis when maybeThis.IsThisParameter () => DiagnosticId.ImplicitThisCannotBeStaticallyDetermined,
-                                               MethodParameterValue => DiagnosticId.MethodParameterCannotBeStaticallyDetermined,
-                                               MethodReturnValue => DiagnosticId.MethodReturnValueCannotBeStaticallyDetermined,
-                                               FieldValue => DiagnosticId.FieldValueCannotBeStaticallyDetermined,
-                                               GenericParameterValue => DiagnosticId.TypePassedToGenericParameterCannotBeStaticallyDetermined,
-                                               _ => throw new NotImplementedException ($"unsupported target value {targetValue}")
-                                       };
-
-                                       _diagnosticContext.AddDiagnostic (diagnosticId, targetValue.GetDiagnosticArgumentsForAnnotationMismatch ().ToArray ());
-                               }
-                       }
-               }
-
-               public partial bool TryResolveTypeNameAndMark (string typeName, bool needsAssemblyName, out TypeProxy type);
-
-               private partial void MarkTypeForDynamicallyAccessedMembers (in TypeProxy type, DynamicallyAccessedMemberTypes dynamicallyAccessedMemberTypes);
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/RuntimeMethodHandleValue.cs b/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/RuntimeMethodHandleValue.cs
deleted file mode 100644 (file)
index f8e0029..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using ILLink.Shared.DataFlow;
-using ILLink.Shared.TypeSystemProxy;
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.TrimAnalysis
-{
-       /// <summary>
-       /// This is the System.RuntimeMethodHandle equivalent to a <see cref="SystemReflectionMethodBaseValue"/> node.
-       /// </summary>
-       internal sealed partial record RuntimeMethodHandleValue : SingleValue
-       {
-               public RuntimeMethodHandleValue (in MethodProxy representedMethod)
-               {
-                       RepresentedMethod = representedMethod;
-               }
-
-               public readonly MethodProxy RepresentedMethod;
-
-               public override SingleValue DeepCopy () => this; // immutable value
-
-               public override string ToString () => this.ValueToString ();
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/RuntimeTypeHandleForGenericParameterValue.cs b/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/RuntimeTypeHandleForGenericParameterValue.cs
deleted file mode 100644 (file)
index c6b82cc..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using ILLink.Shared.DataFlow;
-using ILLink.Shared.TypeSystemProxy;
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.TrimAnalysis
-{
-       /// <summary>
-       /// This is the System.RuntimeTypeHandle equivalent to a <see cref="GenericParameterValue"/> node.
-       /// </summary>
-       internal sealed record RuntimeTypeHandleForGenericParameterValue : SingleValue
-       {
-               public readonly GenericParameterProxy GenericParameter;
-
-               public RuntimeTypeHandleForGenericParameterValue (GenericParameterProxy genericParameter) => GenericParameter = genericParameter;
-
-               public override SingleValue DeepCopy () => this; // This value is immutable
-
-               public override string ToString () => this.ValueToString (GenericParameter);
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/RuntimeTypeHandleForNullableSystemTypeValue.cs b/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/RuntimeTypeHandleForNullableSystemTypeValue.cs
deleted file mode 100644 (file)
index f85536a..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System.Diagnostics;
-using ILLink.Shared.DataFlow;
-using ILLink.Shared.TypeSystemProxy;
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.TrimAnalysis
-{
-       /// <summary>
-       /// This represents a type handle Nullable<T> where T is a known SystemTypeValue.
-       /// It is necessary to track the underlying type to propagate DynamicallyAccessedMembers annotations to the underlying type when applied to a Nullable.
-       /// </summary>
-       internal sealed record RuntimeTypeHandleForNullableSystemTypeValue : SingleValue
-       {
-               public RuntimeTypeHandleForNullableSystemTypeValue (in TypeProxy nullableType, in SystemTypeValue underlyingTypeValue)
-               {
-                       Debug.Assert (nullableType.IsTypeOf (WellKnownType.System_Nullable_T));
-                       UnderlyingTypeValue = underlyingTypeValue;
-                       NullableType = nullableType;
-               }
-               public readonly TypeProxy NullableType;
-
-               public readonly SystemTypeValue UnderlyingTypeValue;
-
-               public override SingleValue DeepCopy () => this; // This value is immutable
-
-               public override string ToString () => this.ValueToString (UnderlyingTypeValue, NullableType);
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/RuntimeTypeHandleForNullableValueWithDynamicallyAccessedMembers.cs b/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/RuntimeTypeHandleForNullableValueWithDynamicallyAccessedMembers.cs
deleted file mode 100644 (file)
index 968e55f..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System.Diagnostics;
-using ILLink.Shared.DataFlow;
-using ILLink.Shared.TypeSystemProxy;
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.TrimAnalysis
-{
-       /// <summary>
-       /// This represents a type handle of a Nullable<T> where T is an unknown value with DynamicallyAccessedMembers annotations.
-       /// It is necessary to track the underlying type to ensure DynamicallyAccessedMembers annotations on the underlying type match the target parameters where the Nullable is used.
-       /// </summary>
-       internal sealed record RuntimeTypeHandleForNullableValueWithDynamicallyAccessedMembers : SingleValue
-       {
-               public RuntimeTypeHandleForNullableValueWithDynamicallyAccessedMembers (in TypeProxy nullableType, in SingleValue underlyingTypeValue)
-               {
-                       Debug.Assert (nullableType.IsTypeOf (WellKnownType.System_Nullable_T));
-                       NullableType = nullableType;
-                       UnderlyingTypeValue = underlyingTypeValue;
-               }
-
-               public readonly TypeProxy NullableType;
-               public readonly SingleValue UnderlyingTypeValue;
-
-               public override SingleValue DeepCopy () => this; // This value is immutable
-
-               public override string ToString () => this.ValueToString (UnderlyingTypeValue, NullableType);
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/RuntimeTypeHandleValue.cs b/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/RuntimeTypeHandleValue.cs
deleted file mode 100644 (file)
index 3e9cbcc..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using ILLink.Shared.DataFlow;
-using ILLink.Shared.TypeSystemProxy;
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.TrimAnalysis
-{
-       /// <summary>
-       /// This is the System.RuntimeTypeHandle equivalent to a <see cref="SystemTypeValue"/> node.
-       /// </summary>
-       internal sealed record RuntimeTypeHandleValue : SingleValue
-       {
-               public RuntimeTypeHandleValue (in TypeProxy representedType)
-               {
-                       RepresentedType = representedType;
-               }
-
-               public readonly TypeProxy RepresentedType;
-
-               public override SingleValue DeepCopy () => this; // This value is immutable
-
-               public override string ToString () => this.ValueToString (RepresentedType);
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/SystemReflectionMethodBaseValue.cs b/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/SystemReflectionMethodBaseValue.cs
deleted file mode 100644 (file)
index ac3d0ec..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using ILLink.Shared.DataFlow;
-using ILLink.Shared.TypeSystemProxy;
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.TrimAnalysis
-{
-       /// <summary>
-       /// This is a known System.Reflection.MethodBase value.  MethodRepresented is the 'value' of the MethodBase.
-       /// </summary>
-       internal sealed partial record SystemReflectionMethodBaseValue : SingleValue
-       {
-               public SystemReflectionMethodBaseValue (MethodProxy representedMethod) => RepresentedMethod = representedMethod;
-
-               public readonly MethodProxy RepresentedMethod;
-
-               public override SingleValue DeepCopy () => this; // This value is immutable
-
-               public override string ToString () => this.ValueToString (RepresentedMethod);
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/SystemTypeValue.cs b/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/SystemTypeValue.cs
deleted file mode 100644 (file)
index 796c433..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using ILLink.Shared.DataFlow;
-using ILLink.Shared.TypeSystemProxy;
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.TrimAnalysis
-{
-       /// <summary>
-       /// This is a known System.Type value. TypeRepresented is the 'value' of the System.Type.
-       /// </summary>
-       internal sealed record SystemTypeValue : SingleValue
-       {
-               public SystemTypeValue (in TypeProxy representedType)
-               {
-                       RepresentedType = representedType;
-               }
-
-               public readonly TypeProxy RepresentedType;
-
-               public override SingleValue DeepCopy () => this; // This value is immutable
-
-               public override string ToString () => this.ValueToString (RepresentedType);
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/UnknownValue.cs b/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/UnknownValue.cs
deleted file mode 100644 (file)
index 863d757..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using ILLink.Shared.DataFlow;
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.TrimAnalysis
-{
-       internal sealed record UnknownValue : SingleValue
-       {
-               private UnknownValue ()
-               {
-               }
-
-               public static UnknownValue Instance { get; } = new UnknownValue ();
-
-               public override SingleValue DeepCopy () => this; // This value is immutable
-
-               public override string ToString () => this.ValueToString ();
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/ValueExtensions.cs b/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/ValueExtensions.cs
deleted file mode 100644 (file)
index 0e7643a..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System.Linq;
-using System.Text;
-using ILLink.Shared.DataFlow;
-using MultiValue = ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>;
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.TrimAnalysis
-{
-       internal static partial class ValueExtensions
-       {
-               internal static string ValueToString (this SingleValue value, params object[] args)
-               {
-                       if (value == null)
-                               return "<null>";
-
-                       StringBuilder sb = new ();
-                       sb.Append (value.GetType ().Name);
-                       sb.Append ('(');
-                       if (args != null) {
-                               for (int i = 0; i < args.Length; i++) {
-                                       if (i > 0)
-                                               sb.Append (',');
-                                       sb.Append (args[i] == null ? "<null>" : args[i].ToString ());
-                               }
-                       }
-                       sb.Append (')');
-                       return sb.ToString ();
-               }
-
-               internal static int? AsConstInt (this SingleValue value)
-               {
-                       if (value is ConstIntValue constInt)
-                               return constInt.Value;
-
-                       return null;
-               }
-
-               internal static int? AsConstInt (this in MultiValue value)
-               {
-                       if (value.AsSingleValue () is ConstIntValue constInt)
-                               return constInt.Value;
-
-                       return null;
-               }
-
-               internal static SingleValue? AsSingleValue (this in MultiValue node)
-               {
-                       if (node.Count () != 1)
-                               return null;
-
-                       return node.Single ();
-               }
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/ValueWithDynamicallyAccessedMembers.cs b/src/coreclr/tools/aot/ILLink.Shared/TrimAnalysis/ValueWithDynamicallyAccessedMembers.cs
deleted file mode 100644 (file)
index c67d300..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System.Collections.Generic;
-using System.Diagnostics.CodeAnalysis;
-using ILLink.Shared.DataFlow;
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.TrimAnalysis
-{
-       public abstract record ValueWithDynamicallyAccessedMembers : SingleValue
-       {
-               public abstract DynamicallyAccessedMemberTypes DynamicallyAccessedMemberTypes { get; }
-
-               public abstract IEnumerable<string> GetDiagnosticArgumentsForAnnotationMismatch ();
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/TypeSystemProxy/GenericParameterProxy.cs b/src/coreclr/tools/aot/ILLink.Shared/TypeSystemProxy/GenericParameterProxy.cs
deleted file mode 100644 (file)
index 09ddbc4..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.TypeSystemProxy
-{
-       internal readonly partial struct GenericParameterProxy
-       {
-               internal partial bool HasDefaultConstructorConstraint ();
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/TypeSystemProxy/IMemberProxy.cs b/src/coreclr/tools/aot/ILLink.Shared/TypeSystemProxy/IMemberProxy.cs
deleted file mode 100644 (file)
index 7f4882e..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.TypeSystemProxy
-{
-       internal interface IMemberProxy
-       {
-               public string Name { get; }
-
-               public string GetDisplayName ();
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/TypeSystemProxy/MethodProxy.cs b/src/coreclr/tools/aot/ILLink.Shared/TypeSystemProxy/MethodProxy.cs
deleted file mode 100644 (file)
index 92ba44e..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System.Collections.Immutable;
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.TypeSystemProxy
-{
-       internal readonly partial struct MethodProxy : IMemberProxy
-       {
-               // Currently this only needs to work on non-nested, non-generic types.
-               // The format of the fullTypeName parameter is 'namespace.typename', so for example 'System.Reflection.Assembly'
-               internal partial bool IsDeclaredOnType (string fullTypeName);
-
-               /// <summary>
-               /// Returns the number of the parameters in the 'parameters' metadata section. This should map directly to the number of parameters in the C# source declaration as well.
-               /// </summary>
-               internal partial int GetMetadataParametersCount ();
-
-               /// <summary>
-               /// Returns true if the method has parameters in the 'parameters' metadata section (i.e. has parameters besides the implicit 'this' parameter)
-               /// </summary>
-               internal partial bool HasMetadataParameters ();
-
-               /// <summary>
-               /// Returns the number of parameters that are passed to the method in IL (including the implicit 'this' parameter).
-               /// In pseudocode: <code>method.HasImplicitThis() ? 1 + MetadataParametersCount : MetadataParametersCount;</code>
-               /// </summary>
-               internal partial int GetParametersCount ();
-
-               /// <summary>
-               /// Returns a List of <see cref="ParameterProxy"/> representing the parameters the method takes, including the implicit 'this' parameters.
-               /// </summary>
-               internal partial ParameterProxyEnumerable GetParameters ();
-
-               /// <summary>
-               /// Returns the ParameterProxy corresponding to the parameter at <paramref name="index"/>, and throws if the index is out of bounds for the method.
-               /// <paramref name="index"/> is the index of the parameters as they are passed to the method, with 0 being the implicit this parameter if it exists.
-               /// See <see cref="ParameterIndex"/> for more info.
-               /// </summary>
-               internal partial ParameterProxy GetParameter (ParameterIndex index);
-
-               /// <summary>
-               /// Returns true if the 'parameters' metadata section has <paramref name="parameterCount"/> number of parameters.
-               /// Metadata parameters count maps directly to the number of parameters in C# source code.
-               /// Metadata parameters count excludes the implicit 'this' parameter.
-               /// </summary>
-               internal bool HasMetadataParametersCount (int parameterCount) => GetMetadataParametersCount () == parameterCount;
-
-               // Currently this only needs to work on non-nested, non-generic types.
-               // The format of the fullTypeName parameter is 'namespace.typename', so for example 'System.Reflection.Assembly'
-               internal bool HasParameterOfType (ParameterIndex parameterIndex, string fullTypeName)
-                       => (int) parameterIndex < GetParametersCount () && GetParameter (parameterIndex).IsTypeOf (fullTypeName);
-               internal partial bool HasGenericParameters ();
-               internal partial bool HasGenericParametersCount (int genericParameterCount);
-               internal partial ImmutableArray<GenericParameterProxy> GetGenericParameters ();
-               internal partial bool IsStatic ();
-               internal partial bool HasImplicitThis ();
-               internal partial bool ReturnsVoid ();
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/TypeSystemProxy/ParameterCollection.cs b/src/coreclr/tools/aot/ILLink.Shared/TypeSystemProxy/ParameterCollection.cs
deleted file mode 100644 (file)
index a7a4310..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.TypeSystemProxy
-{
-       /// <summary>
-       /// Enumerable struct used to enumerator over a method's parameters without allocating or going through IEnumerable
-       /// </summary>
-       internal readonly struct ParameterProxyEnumerable : IEnumerable<ParameterProxy>
-       {
-               private readonly int _start;
-
-               private readonly int _end;
-
-               private readonly MethodProxy _method;
-
-               public ParameterProxyEnumerable (int start, int end, MethodProxy method)
-               {
-                       _start = start;
-                       _end = end;
-                       _method = method;
-               }
-
-               public ParameterEnumerator GetEnumerator () => new ParameterEnumerator (_start, _end, _method);
-
-               IEnumerator<ParameterProxy> IEnumerable<ParameterProxy>.GetEnumerator () => new ParameterEnumerator (_start, _end, _method);
-
-               IEnumerator IEnumerable.GetEnumerator () => new ParameterEnumerator (_start, _end, _method);
-
-               public struct ParameterEnumerator : IEnumerator<ParameterProxy>
-               {
-                       private readonly int _start;
-                       private int _current;
-                       private readonly int _end;
-                       private readonly MethodProxy _method;
-
-                       public ParameterEnumerator (int start, int end, MethodProxy method)
-                       {
-                               _start = start;
-                               _current = start - 1;
-                               _end = end;
-                               _method = method;
-                       }
-
-                       public ParameterProxy Current => new ParameterProxy (_method, (ParameterIndex) _current);
-
-                       object IEnumerator.Current => new ParameterProxy (_method, (ParameterIndex) _current);
-
-                       public bool MoveNext () => ++_current < _end;
-
-                       public void Reset () => _current = _start;
-
-                       void IDisposable.Dispose () { }
-               }
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/TypeSystemProxy/ParameterProxy.cs b/src/coreclr/tools/aot/ILLink.Shared/TypeSystemProxy/ParameterProxy.cs
deleted file mode 100644 (file)
index 16d3ccd..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-using System.Collections.Generic;
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.TypeSystemProxy
-{
-       internal readonly partial struct ParameterProxy
-       {
-               public ParameterProxy (MethodProxy method, ParameterIndex index)
-               {
-                       if ((int) index < 0 || (int) index >= method.GetParametersCount ())
-                               throw new InvalidOperationException ($"Parameter of index {(int) index} does not exist on method {method.GetDisplayName ()} with {method.GetParametersCount ()}");
-                       Method = method;
-                       Index = index;
-               }
-
-               public MethodProxy Method { get; }
-
-               public ParameterIndex Index { get; }
-
-               /// <summary>
-               /// The index of the entry in the '.parameters' metadata section corresponding to this parameter.
-               /// Maps to the index of the parameter in Cecil's MethodReference.Parameters or Roslyn's IMethodSymbol.Parameters
-               /// Throws if the parameter is the implicit 'this' parameter.
-               /// </summary>
-               public int MetadataIndex {
-                       get {
-                               if (Method.HasImplicitThis ()) {
-                                       if (IsImplicitThis)
-                                               throw new InvalidOperationException ("Cannot get metadata index of the implicit 'this' parameter");
-                                       return (int) Index - 1;
-                               }
-                               return (int) Index;
-                       }
-               }
-
-               public partial ReferenceKind GetReferenceKind ();
-
-               public partial string GetDisplayName ();
-
-               public bool IsImplicitThis => Method.HasImplicitThis () && Index == (ParameterIndex) 0;
-
-               public partial bool IsTypeOf (string typeName);
-
-               public IEnumerable<string> GetDiagnosticArgumentsForAnnotationMismatch ()
-                       => IsImplicitThis ?
-                               new string[] { Method.GetDisplayName () }
-
-                               : new string[] { GetDisplayName (), Method.GetDisplayName () };
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/TypeSystemProxy/TypeProxy.cs b/src/coreclr/tools/aot/ILLink.Shared/TypeSystemProxy/TypeProxy.cs
deleted file mode 100644 (file)
index 0c459f0..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System.Collections.Immutable;
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.TypeSystemProxy
-{
-       internal readonly partial struct TypeProxy : IMemberProxy
-       {
-               internal partial ImmutableArray<GenericParameterProxy> GetGenericParameters ();
-       }
-}
diff --git a/src/coreclr/tools/aot/ILLink.Shared/TypeSystemProxy/WellKnownType.cs b/src/coreclr/tools/aot/ILLink.Shared/TypeSystemProxy/WellKnownType.cs
deleted file mode 100644 (file)
index 999f8f4..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using StaticCs;
-
-// This is needed due to NativeAOT which doesn't enable nullable globally yet
-#nullable enable
-
-namespace ILLink.Shared.TypeSystemProxy
-{
-       [Closed]
-       public enum WellKnownType
-       {
-               System_String,
-               System_Nullable_T,
-               System_Type,
-               System_Reflection_IReflect,
-               System_Array,
-               System_Object,
-               System_Attribute,
-               System_NotSupportedException,
-               System_Runtime_CompilerServices_DisablePrivateReflectionAttribute,
-               System_Void
-       }
-
-       public static partial class WellKnownTypeExtensions
-       {
-               public static (string Namespace, string Name) GetNamespaceAndName (this WellKnownType type)
-               {
-                       return type switch {
-                               WellKnownType.System_String => ("System", "String"),
-                               WellKnownType.System_Nullable_T => ("System", "Nullable`1"),
-                               WellKnownType.System_Type => ("System", "Type"),
-                               WellKnownType.System_Reflection_IReflect => ("System.Reflection", "IReflect"),
-                               WellKnownType.System_Array => ("System", "Array"),
-                               WellKnownType.System_Object => ("System", "Object"),
-                               WellKnownType.System_Attribute => ("System", "Attribute"),
-                               WellKnownType.System_NotSupportedException => ("System", "NotSupportedException"),
-                               WellKnownType.System_Runtime_CompilerServices_DisablePrivateReflectionAttribute => ("System.Runtime.CompilerServices", "DisablePrivateReflectionAttribute"),
-                               WellKnownType.System_Void => ("System", "Void"),
-                       };
-               }
-               public static string GetNamespace (this WellKnownType type) => GetNamespaceAndName (type).Namespace;
-               public static string GetName (this WellKnownType type) => GetNamespaceAndName (type).Name;
-               public static WellKnownType? GetWellKnownType (string @namespace, string name)
-               {
-                       return @namespace switch {
-                               "System" => name switch {
-                                       "String" => WellKnownType.System_String,
-                                       "Nullable`1" => WellKnownType.System_Nullable_T,
-                                       "Type" => WellKnownType.System_Type,
-                                       "Array" => WellKnownType.System_Array,
-                                       "Attribute" => WellKnownType.System_Attribute,
-                                       "Object" => WellKnownType.System_Object,
-                                       "NotSupportedException" => WellKnownType.System_NotSupportedException,
-                                       "Void" => WellKnownType.System_Void,
-                                       _ => null
-                               },
-                               "System.Reflection" => name switch {
-                                       "IReflect" => WellKnownType.System_Reflection_IReflect,
-                                       _ => null
-                               },
-                               "System.Runtime.CompilerServices" => name switch {
-                                       "DisablePrivateReflectionAttribute" => WellKnownType.System_Runtime_CompilerServices_DisablePrivateReflectionAttribute,
-                                       _ => null
-                               },
-                               _ => null
-                       };
-               }
-       }
-}
index 2ddeb82..3fe8026 100644 (file)
@@ -16,8 +16,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ILCompiler.Compiler", "ILCo
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "repro", "ILCompiler\repro\repro.csproj", "{CBDE0470-E0C9-4693-9A11-ACC117522F3F}"
 EndProject
-Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ILLink.Shared", "ILLink.Shared\ILLink.Shared.shproj", "{FF598E93-8E9E-4091-9F50-61A7572663AE}"
-EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ILCompiler.Compiler.Tests", "ILCompiler.Compiler.Tests\ILCompiler.Compiler.Tests.csproj", "{24CBA9C6-EDBA-47D6-A0B5-04417BDE5FE3}"
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ILCompiler.TypeSystem.Tests", "ILCompiler.TypeSystem.Tests\ILCompiler.TypeSystem.Tests.csproj", "{740CDFF4-B8EC-4A37-951B-C9FE9980EF2A}"
@@ -28,6 +26,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mono.Linker.Tests.Cases", "
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mono.Linker.Tests.Cases.Expectations", "..\..\..\tools\illink\test\Mono.Linker.Tests.Cases.Expectations\Mono.Linker.Tests.Cases.Expectations.csproj", "{219E0AC3-CDBF-4104-B324-85915DD16E25}"
 EndProject
+Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ILLink.Shared", "..\..\..\tools\illink\src\ILLink.Shared\ILLink.Shared.shproj", "{FF598E93-8E9E-4091-9F50-61A7572663AE}"
+EndProject
 Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
                Checked|Any CPU = Checked|Any CPU
@@ -244,7 +244,7 @@ Global
                SolutionGuid = {A484CF9D-B203-427F-9D15-A5BBC6013421}
        EndGlobalSection
        GlobalSection(SharedMSBuildProjectFiles) = preSolution
-               ILLink.Shared\ILLink.Shared.projitems*{ff598e93-8e9e-4091-9f50-61a7572663ae}*SharedItemsImports = 13
-               ILLink.Shared\ILLink.Shared.projitems*{ffbd9619-de6f-4a98-8732-8a14ec3c1a18}*SharedItemsImports = 5
+               ..\..\..\tools\illink\src\ILLink.Shared\ILLink.Shared.projitems*{ff598e93-8e9e-4091-9f50-61a7572663ae}*SharedItemsImports = 13
+               ..\..\..\tools\illink\src\ILLink.Shared\ILLink.Shared.projitems*{ffbd9619-de6f-4a98-8732-8a14ec3c1a18}*SharedItemsImports = 5
        EndGlobalSection
 EndGlobal
index 39f1a6f..2771264 100644 (file)
@@ -11,7 +11,7 @@ using Microsoft.CodeAnalysis;
 #nullable enable
 namespace ILLink.Shared.TrimAnalysis
 {
-       internal sealed partial class FlowAnnotations
+       public sealed partial class FlowAnnotations
        {
                // In the analyzer there's no stateful data the flow annotations need to store
                // so we just create a singleton on demand.
index a581f2f..39cd90e 100644 (file)
@@ -7,7 +7,6 @@
   <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
   <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" />
   <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" />
-  <PropertyGroup />
   <Import Project="ILLink.Shared.projitems" Label="Shared" />
   <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" />
 </Project>
\ No newline at end of file
index 64d0b6f..7ca5df5 100644 (file)
@@ -10,7 +10,12 @@ using ILLink.Shared.TypeSystemProxy;
 namespace ILLink.Shared.TrimAnalysis
 {
        // Shared helpers to go from MethodProxy to dataflow values.
-       internal partial class FlowAnnotations
+#if ILLINK
+       internal
+#else
+       public
+#endif
+       partial class FlowAnnotations
        {
                internal partial bool MethodRequiresDataFlowAnalysis (MethodProxy method);
 
index 33e3277..16e5cf9 100644 (file)
@@ -21,6 +21,7 @@
     <UseAppHost>false</UseAppHost>
     <NoWarn>$(NoWarn);NU5131</NoWarn>
     <TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);_AddReferenceAssemblyToPackage</TargetsForTfmSpecificContentInPackage>
+    <DefineConstants>$(DefineConstants);ILLINK</DefineConstants>
   </PropertyGroup>
 
   <!-- The default pack logic will include the implementation assembly in lib.
index c8f6a27..fcf0409 100644 (file)
@@ -51,8 +51,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ILCompiler.RyuJit", "..\..\
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ILCompiler.TypeSystem", "..\..\coreclr\tools\aot\ILCompiler.TypeSystem\ILCompiler.TypeSystem.csproj", "{D3CC100A-D02B-492C-A072-FF0FA41B4A4A}"
 EndProject
-Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ILLink.Shared", "..\..\coreclr\tools\aot\ILLink.Shared\ILLink.Shared.shproj", "{66F2F805-0E38-4BBC-B329-FCC2748BEFCC}"
-EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ILLink", "ILLink", "{FB237949-3F88-4E16-A770-8D13E48B84AF}"
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ilc", "ilc", "{BC94A262-6D89-4432-AC11-22FE75FBC91F}"
@@ -430,7 +428,6 @@ Global
                {90D64CE4-C891-4B98-AF59-EE9B04BA1CBE} = {C2969923-7BAA-4FE4-853C-F670B0D3C6C8}
                {8DA71B3B-5809-44E5-A018-5DE5C6FF6C2A} = {03EB085F-3E2E-4A68-A7DF-951ADF59A0CC}
                {6D20F334-B7E4-4585-854B-8A0E2B29B4AA} = {AA0569FB-73E9-4B42-9A19-714BB1229DAE}
-               {FF598E93-8E9E-4091-9F50-61A7572663AE} = {F5F8E1BA-13D4-4F72-83AC-BACA510F81AC}
                {3DDE7064-4B68-4979-8843-FDF4CE5A5140} = {C2969923-7BAA-4FE4-853C-F670B0D3C6C8}
                {7936350A-B085-435D-9330-0A9A7F86886E} = {9E9B5684-2EDC-4E8C-AED0-D1B78C0EE706}
                {6F771650-EC13-4FD5-909A-EC1A5D4FBC20} = {9E9B5684-2EDC-4E8C-AED0-D1B78C0EE706}
@@ -438,7 +435,6 @@ Global
                {EC7B2A97-8B82-45C7-AA6B-3523B17383D4} = {9E9B5684-2EDC-4E8C-AED0-D1B78C0EE706}
                {9DF703D5-DB25-4767-9DAB-2197119204F2} = {9E9B5684-2EDC-4E8C-AED0-D1B78C0EE706}
                {D3CC100A-D02B-492C-A072-FF0FA41B4A4A} = {9E9B5684-2EDC-4E8C-AED0-D1B78C0EE706}
-               {66F2F805-0E38-4BBC-B329-FCC2748BEFCC} = {9E9B5684-2EDC-4E8C-AED0-D1B78C0EE706}
                {FB237949-3F88-4E16-A770-8D13E48B84AF} = {C2969923-7BAA-4FE4-853C-F670B0D3C6C8}
                {BC94A262-6D89-4432-AC11-22FE75FBC91F} = {C2969923-7BAA-4FE4-853C-F670B0D3C6C8}
                {CBB22C4F-0271-48A4-8301-27D0E4B26C02} = {BC94A262-6D89-4432-AC11-22FE75FBC91F}
@@ -447,8 +443,7 @@ Global
                SolutionGuid = {E43A3901-42B0-48CA-BB36-5CD40A99A6EE}
        EndGlobalSection
        GlobalSection(SharedMSBuildProjectFiles) = preSolution
-               ..\..\coreclr\tools\aot\ILLink.Shared\ILLink.Shared.projitems*{66f2f805-0e38-4bbc-b329-fcc2748befcc}*SharedItemsImports = 13
-               ..\..\coreclr\tools\aot\ILLink.Shared\ILLink.Shared.projitems*{6f771650-ec13-4fd5-909a-ec1a5d4fbc20}*SharedItemsImports = 5
+               src\ILLink.Shared\ILLink.Shared.projitems*{6f771650-ec13-4fd5-909a-ec1a5d4fbc20}*SharedItemsImports = 5
                src\ILLink.Shared\ILLink.Shared.projitems*{dd28e2b1-057b-4b4d-a04d-b2ebd9e76e46}*SharedItemsImports = 5
                src\ILLink.Shared\ILLink.Shared.projitems*{f1a44a78-34ee-408b-8285-9a26f0e7d4f2}*SharedItemsImports = 5
                src\ILLink.Shared\ILLink.Shared.projitems*{ff598e93-8e9e-4091-9f50-61a7572663ae}*SharedItemsImports = 13