From 6ec4a617fd02f7544e60b3f7f45775b05bef6824 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Mon, 1 Jul 2024 21:06:38 +0000 Subject: [PATCH 1/4] Revert "Fix Microsoft.NET.ILLink package (#103251)" This reverts commit 4afb315cf3ff99f8f954eaa35a348c68a45bfc35. --- src/tools/illink/src/linker/Mono.Linker.csproj | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/tools/illink/src/linker/Mono.Linker.csproj b/src/tools/illink/src/linker/Mono.Linker.csproj index 5c151fad0e9639..6e7a03b2a39372 100644 --- a/src/tools/illink/src/linker/Mono.Linker.csproj +++ b/src/tools/illink/src/linker/Mono.Linker.csproj @@ -83,9 +83,7 @@ - - + From 7dc229d1dc446c72cd54d267478feb906b336a4e Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Mon, 1 Jul 2024 21:06:45 +0000 Subject: [PATCH 2/4] Revert "ILLink: Add PropertyNode for dependency analysis (#102026)" This reverts commit 202b1befab8f28bc0d8173b086f2598287082ddb. --- .../Linker.Steps/MarkStep.NodeFactory.cs | 6 --- .../MarkStep.PropertyDefinitionNode.cs | 46 ------------------- .../src/linker/Linker.Steps/MarkStep.cs | 7 ++- 3 files changed, 5 insertions(+), 54 deletions(-) delete mode 100644 src/tools/illink/src/linker/Linker.Steps/MarkStep.PropertyDefinitionNode.cs diff --git a/src/tools/illink/src/linker/Linker.Steps/MarkStep.NodeFactory.cs b/src/tools/illink/src/linker/Linker.Steps/MarkStep.NodeFactory.cs index 61d1e806209f43..7e16f7ac25981d 100644 --- a/src/tools/illink/src/linker/Linker.Steps/MarkStep.NodeFactory.cs +++ b/src/tools/illink/src/linker/Linker.Steps/MarkStep.NodeFactory.cs @@ -15,7 +15,6 @@ internal sealed class NodeFactory (MarkStep markStep) public MarkStep MarkStep { get; } = markStep; readonly NodeCache _typeNodes = new (static t => new TypeDefinitionNode(t)); readonly NodeCache _methodNodes = new (static _ => throw new InvalidOperationException ("Creation of node requires more than the key.")); - readonly NodeCache _propertyNodes = new (static p => new PropertyDefinitionNode(p)); readonly NodeCache _typeIsRelevantToVariantCastingNodes = new (static (t) => new TypeIsRelevantToVariantCastingNode (t)); internal TypeDefinitionNode GetTypeNode (TypeDefinition definition) @@ -33,11 +32,6 @@ internal TypeIsRelevantToVariantCastingNode GetTypeIsRelevantToVariantCastingNod return _typeIsRelevantToVariantCastingNodes.GetOrAdd (type); } - internal PropertyDefinitionNode GetPropertyNode (PropertyDefinition prop) - { - return _propertyNodes.GetOrAdd (prop); - } - struct NodeCache where TKey : notnull { // Change to concurrent dictionary if/when multithreaded marking is enabled diff --git a/src/tools/illink/src/linker/Linker.Steps/MarkStep.PropertyDefinitionNode.cs b/src/tools/illink/src/linker/Linker.Steps/MarkStep.PropertyDefinitionNode.cs deleted file mode 100644 index 68e86ba7edca25..00000000000000 --- a/src/tools/illink/src/linker/Linker.Steps/MarkStep.PropertyDefinitionNode.cs +++ /dev/null @@ -1,46 +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 ILCompiler.DependencyAnalysisFramework; -using Mono.Cecil; - -namespace Mono.Linker.Steps -{ - - public partial class MarkStep - { - internal sealed class PropertyDefinitionNode : DependencyNodeCore - { - PropertyDefinition _property; - public PropertyDefinitionNode(PropertyDefinition property) - { - _property = property; - } - - public override bool InterestingForDynamicDependencyAnalysis => false; - - public override bool HasDynamicDependencies => false; - - public override bool HasConditionalStaticDependencies => false; - - public override bool StaticDependenciesAreComputed => true; - - public override IEnumerable? GetConditionalStaticDependencies (NodeFactory context) => null; - - public override IEnumerable? GetStaticDependencies (NodeFactory context) - { - var propertyOrigin = new MessageOrigin (_property); - - // Consider making this more similar to MarkEvent method? - context.MarkStep.MarkCustomAttributes (_property, new DependencyInfo (DependencyKind.CustomAttribute, _property), propertyOrigin); - context.MarkStep.DoAdditionalPropertyProcessing (_property); - return null; - } - - public override IEnumerable? SearchDynamicDependencies (List> markedNodes, int firstNode, NodeFactory context) => null; - - protected override string GetName (NodeFactory context) => _property.GetDisplayName (); - } - } -} diff --git a/src/tools/illink/src/linker/Linker.Steps/MarkStep.cs b/src/tools/illink/src/linker/Linker.Steps/MarkStep.cs index ab03c049415833..7bb6cf11fc2436 100644 --- a/src/tools/illink/src/linker/Linker.Steps/MarkStep.cs +++ b/src/tools/illink/src/linker/Linker.Steps/MarkStep.cs @@ -3492,8 +3492,11 @@ protected internal void MarkProperty (PropertyDefinition prop, in DependencyInfo if (!Annotations.MarkProcessed (prop, reason)) return; - PropertyDefinitionNode propertyNode = _nodeFactory.GetPropertyNode (prop); - _dependencyGraph.AddRoot (propertyNode, reason.Kind.ToString ()); + var propertyOrigin = new MessageOrigin (prop); + + // Consider making this more similar to MarkEvent method? + MarkCustomAttributes (prop, new DependencyInfo (DependencyKind.CustomAttribute, prop), propertyOrigin); + DoAdditionalPropertyProcessing (prop); } protected internal virtual void MarkEvent (EventDefinition evt, in DependencyInfo reason, MessageOrigin origin) From b6c17af8c7c322559303fc35fff207358094d732 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Mon, 1 Jul 2024 21:24:44 +0000 Subject: [PATCH 3/4] Revert "Begin transition to dependency framework in illink (#101277)" This reverts commit fbb67a62d64b3472ede5c4ee4cfaccf1c03b8673. --- eng/liveILLink.targets | 4 +- src/coreclr/Directory.Build.props | 2 +- ...ompiler.DependencyAnalysisFramework.csproj | 11 +-- .../MarkStep.MethodDefinitionNode.cs | 43 ----------- .../Linker.Steps/MarkStep.NodeFactory.cs | 65 ---------------- .../MarkStep.ProcessCallbackNode.cs | 42 ----------- .../MarkStep.TypeDefinitionNode.cs | 40 ---------- ...Step.TypeIsRelevantToVariantCastingNode.cs | 39 ---------- .../src/linker/Linker.Steps/MarkStep.cs | 74 +++++++++---------- .../src/linker/Linker/DictionaryExtensions.cs | 11 --- .../illink/src/linker/Mono.Linker.csproj | 4 - 11 files changed, 38 insertions(+), 297 deletions(-) delete mode 100644 src/tools/illink/src/linker/Linker.Steps/MarkStep.MethodDefinitionNode.cs delete mode 100644 src/tools/illink/src/linker/Linker.Steps/MarkStep.NodeFactory.cs delete mode 100644 src/tools/illink/src/linker/Linker.Steps/MarkStep.ProcessCallbackNode.cs delete mode 100644 src/tools/illink/src/linker/Linker.Steps/MarkStep.TypeDefinitionNode.cs delete mode 100644 src/tools/illink/src/linker/Linker.Steps/MarkStep.TypeIsRelevantToVariantCastingNode.cs diff --git a/eng/liveILLink.targets b/eng/liveILLink.targets index 6b45e00a49d5ed..f18b89622982d9 100644 --- a/eng/liveILLink.targets +++ b/eng/liveILLink.targets @@ -30,13 +30,11 @@ - + SetConfiguration="Configuration=$(ToolsConfiguration)"> TargetFramework=$(NetCoreAppToolCurrent) TargetFramework=$(NetFrameworkToolCurrent) diff --git a/src/coreclr/Directory.Build.props b/src/coreclr/Directory.Build.props index 2f86002cccf44c..233bfbeacebf0c 100644 --- a/src/coreclr/Directory.Build.props +++ b/src/coreclr/Directory.Build.props @@ -1,6 +1,6 @@ - true + true $(__BuildType) diff --git a/src/coreclr/tools/aot/ILCompiler.DependencyAnalysisFramework/ILCompiler.DependencyAnalysisFramework.csproj b/src/coreclr/tools/aot/ILCompiler.DependencyAnalysisFramework/ILCompiler.DependencyAnalysisFramework.csproj index 763d6bfbc27bf8..28aa33b5afe733 100644 --- a/src/coreclr/tools/aot/ILCompiler.DependencyAnalysisFramework/ILCompiler.DependencyAnalysisFramework.csproj +++ b/src/coreclr/tools/aot/ILCompiler.DependencyAnalysisFramework/ILCompiler.DependencyAnalysisFramework.csproj @@ -1,8 +1,4 @@ - - - AnyCPU - - + Library ILCompiler.DependencyAnalysisFramework @@ -12,10 +8,6 @@ x64;x86 AnyCPU false - - <_RequiresLiveILLink>false - - true