Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/linker.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Boemer <sbomer@gmail.com>2022-09-19 20:49:24 +0300
committerGitHub <noreply@github.com>2022-09-19 20:49:24 +0300
commitfda9d062dea827a19f1eae5cb2a0adbc63cba483 (patch)
treee378b06f03fae3d159802ee056f46f91f105ba90
parentddc7da6775ddeb2538bc327011867f65deb4c6f0 (diff)
Remove --keep-facades option (#3036)
* Remove --keep-facades option
-rw-r--r--src/linker/Linker.Dataflow/SingleValueExtensions.cs4
-rw-r--r--src/linker/Linker.Steps/SweepStep.cs40
-rw-r--r--src/linker/Linker/AssemblyResolver.cs9
-rw-r--r--src/linker/Linker/Driver.cs13
-rw-r--r--src/linker/Linker/EmbeddedXmlInfo.cs3
-rw-r--r--src/linker/Linker/LinkContext.cs2
-rw-r--r--test/ILLink.RoslynAnalyzer.Tests/generated/ILLink.RoslynAnalyzer.Tests.Generator/ILLink.RoslynAnalyzer.Tests.TestCaseGenerator/ReferencesTests.g.cs6
-rw-r--r--test/ILLink.RoslynAnalyzer.Tests/generated/ILLink.RoslynAnalyzer.Tests.Generator/ILLink.RoslynAnalyzer.Tests.TestCaseGenerator/TypeForwardingTests.g.cs2
-rw-r--r--test/Mono.Linker.Tests.Cases.Expectations/Metadata/KeepTypeForwarderOnlyAssembliesAttribute.cs17
-rw-r--r--test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/UnusedAttributeWithTypeForwarderIsRemoved.cs3
-rw-r--r--test/Mono.Linker.Tests.Cases/DynamicDependencies/DynamicDependencyOnForwardedType.cs1
-rw-r--r--test/Mono.Linker.Tests.Cases/LinkXml/CanPreserveAnExportedType.cs1
-rw-r--r--test/Mono.Linker.Tests.Cases/LinkXml/CanPreserveExportedTypesUsingRegex.cs1
-rw-r--r--test/Mono.Linker.Tests.Cases/References/AssemblyOnlyUsedByUsingWithCsc.cs1
-rw-r--r--test/Mono.Linker.Tests.Cases/References/AssemblyOnlyUsedByUsingWithCscWithKeepFacades.cs35
-rw-r--r--test/Mono.Linker.Tests.Cases/TypeForwarding/AttributeArgumentForwarded.cs1
-rw-r--r--test/Mono.Linker.Tests.Cases/TypeForwarding/AttributeArgumentForwardedWithCopyAction.cs1
-rw-r--r--test/Mono.Linker.Tests.Cases/TypeForwarding/AttributesScopeUpdated.cs1
-rw-r--r--test/Mono.Linker.Tests.Cases/TypeForwarding/SecurityAttributeScope.cs1
-rw-r--r--test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardedIsUpdatedForMissingType.cs1
-rw-r--r--test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwarderOnlyAssembliesRemoved.cs (renamed from test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwarderOnlyAssembliesKept.cs)5
-rw-r--r--test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwarderOnlyAssemblyCanBePreservedViaLinkXml.cs1
-rw-r--r--test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardersModifiers.cs1
-rw-r--r--test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardersRewrite.cs1
-rw-r--r--test/Mono.Linker.Tests.Cases/TypeForwarding/UnusedForwarderWithAssemblyCopyUsed.cs1
-rw-r--r--test/Mono.Linker.Tests.Cases/TypeForwarding/UnusedForwarderWithAssemblyLinked.cs (renamed from test/Mono.Linker.Tests.Cases/TypeForwarding/UnusedForwarderWithAssemblyLinkedAndFacadesKept.cs)7
-rw-r--r--test/Mono.Linker.Tests.Cases/TypeForwarding/UnusedForwarderWithAssemblyLinkedAndFacadeCopy.cs2
-rw-r--r--test/Mono.Linker.Tests.Cases/TypeForwarding/UsedAndUnusedForwarderReferencedFromCopyUsedAssembly.cs1
-rw-r--r--test/Mono.Linker.Tests.Cases/TypeForwarding/UsedAndUnusedForwarderWithAssemblyCopy.cs1
-rw-r--r--test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderAndUnusedReference.cs1
-rw-r--r--test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderInGenericIsDynamicallyAccessedWithAssemblyCopyUsed.cs1
-rw-r--r--test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderIsDynamicallyAccessedWithAssemblyCopyUsed.cs1
-rw-r--r--test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderIsRemovedWhenLink.cs1
-rw-r--r--test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopy.cs1
-rw-r--r--test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopyUsed.cs2
-rw-r--r--test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopyUsedAndFacadesKept.cs31
-rw-r--r--test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopyUsedAndForwarderLibraryKept.cs1
-rw-r--r--test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopyUsedAndUnusedReference.cs (renamed from test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopyUsedAndFacadesKeptAndUnusedReference.cs)7
-rw-r--r--test/Mono.Linker.Tests.Cases/TypeForwarding/UsedTransitiveForwarderInCopyUsedAssemblyIsDynamicallyAccessed.cs2
-rw-r--r--test/Mono.Linker.Tests.Cases/TypeForwarding/UsedTransitiveForwarderIsDynamicallyAccessed.cs2
-rw-r--r--test/Mono.Linker.Tests.Cases/TypeForwarding/UsedTransitiveForwarderIsResolvedAndFacadeRemoved.cs2
-rw-r--r--test/Mono.Linker.Tests/TestCasesRunner/LinkerArgumentBuilder.cs9
-rw-r--r--test/Mono.Linker.Tests/TestCasesRunner/TestCaseLinkerOptions.cs1
-rw-r--r--test/Mono.Linker.Tests/TestCasesRunner/TestCaseMetadataProvider.cs1
44 files changed, 24 insertions, 202 deletions
diff --git a/src/linker/Linker.Dataflow/SingleValueExtensions.cs b/src/linker/Linker.Dataflow/SingleValueExtensions.cs
index c0024c1cc..9dcb0df70 100644
--- a/src/linker/Linker.Dataflow/SingleValueExtensions.cs
+++ b/src/linker/Linker.Dataflow/SingleValueExtensions.cs
@@ -30,9 +30,7 @@ namespace ILLink.Shared.TrimAnalysis
seenNodes.Add (node);
- if (allNodesSeen != null) {
- allNodesSeen.Add (node);
- }
+ allNodesSeen?.Add (node);
bool foundCycle = false;
switch (node) {
diff --git a/src/linker/Linker.Steps/SweepStep.cs b/src/linker/Linker.Steps/SweepStep.cs
index 5f8a32d07..5da72ea65 100644
--- a/src/linker/Linker.Steps/SweepStep.cs
+++ b/src/linker/Linker.Steps/SweepStep.cs
@@ -43,7 +43,6 @@ namespace Mono.Linker.Steps
public class SweepStep : BaseStep
{
readonly bool sweepSymbols;
- readonly HashSet<AssemblyDefinition> BypassNGenToSave = new HashSet<AssemblyDefinition> ();
public SweepStep (bool sweepSymbols = true)
{
@@ -52,9 +51,7 @@ namespace Mono.Linker.Steps
protected override void Process ()
{
- // To keep facades, scan all references so that even unused facades are kept
- var assemblies = Context.KeepTypeForwarderOnlyAssemblies ?
- Context.GetReferencedAssemblies ().ToArray () : Annotations.GetAssemblies ().ToArray ();
+ var assemblies = Annotations.GetAssemblies ().ToArray ();
// Ensure that any assemblies which need to be removed are marked for deletion,
// including assemblies which are not referenced by any others.
@@ -82,13 +79,10 @@ namespace Mono.Linker.Steps
foreach (var assembly in assemblies)
ProcessAssemblyAction (assembly);
- if (Context.KeepTypeForwarderOnlyAssemblies)
- return;
-
// Ensure that we remove any assemblies which were resolved while sweeping references
foreach (var assembly in Annotations.GetAssemblies ().ToArray ()) {
if (!assemblies.Any (processedAssembly => processedAssembly == assembly)) {
- Debug.Assert (!IsUsedAssembly (assembly));
+ Debug.Assert (!IsMarkedAssembly (assembly));
Annotations.SetAction (assembly, AssemblyAction.Delete);
}
}
@@ -102,7 +96,7 @@ namespace Mono.Linker.Steps
case AssemblyAction.AddBypassNGenUsed:
case AssemblyAction.CopyUsed:
case AssemblyAction.Link:
- if (!IsUsedAssembly (assembly))
+ if (!IsMarkedAssembly (assembly))
RemoveAssembly (assembly);
break;
@@ -160,7 +154,6 @@ namespace Mono.Linker.Steps
goto case AssemblyAction.AddBypassNGen;
case AssemblyAction.AddBypassNGen:
- BypassNGenToSave.Add (assembly);
continue;
}
}
@@ -177,18 +170,9 @@ namespace Mono.Linker.Steps
Annotations.SetAction (assembly, AssemblyAction.AddBypassNGen);
goto case AssemblyAction.AddBypassNGen;
- case AssemblyAction.AddBypassNGen:
- // FIXME: AddBypassNGen is just wrong, it should not be action as we need to
- // turn it to Action.Save here to e.g. correctly update debug symbols
- if (!Context.KeepTypeForwarderOnlyAssemblies || BypassNGenToSave.Contains (assembly)) {
- goto case AssemblyAction.Save;
- }
-
- break;
-
case AssemblyAction.CopyUsed:
AssemblyAction assemblyAction = AssemblyAction.Copy;
- if (!Context.KeepTypeForwarderOnlyAssemblies && SweepTypeForwarders (assembly)) {
+ if (SweepTypeForwarders (assembly)) {
// Need to sweep references, in case sweeping type forwarders removed any
AssemblyReferencesCorrector.SweepAssemblyReferences (assembly);
assemblyAction = AssemblyAction.Save;
@@ -204,8 +188,11 @@ namespace Mono.Linker.Steps
SweepAssembly (assembly);
break;
+ case AssemblyAction.AddBypassNGen:
+ // FIXME: AddBypassNGen is just wrong, it should not be action as we need to
+ // turn it to Action.Save here to e.g. correctly update debug symbols
case AssemblyAction.Save:
- if (!Context.KeepTypeForwarderOnlyAssemblies && SweepTypeForwarders (assembly)) {
+ if (SweepTypeForwarders (assembly)) {
// Need to sweep references, in case sweeping type forwarders removed any
AssemblyReferencesCorrector.SweepAssemblyReferences (assembly);
}
@@ -258,17 +245,6 @@ namespace Mono.Linker.Steps
AssemblyReferencesCorrector.SweepAssemblyReferences (assembly);
}
- bool IsUsedAssembly (AssemblyDefinition assembly)
- {
- if (IsMarkedAssembly (assembly))
- return true;
-
- if (assembly.MainModule.HasExportedTypes && Context.KeepTypeForwarderOnlyAssemblies)
- return true;
-
- return false;
- }
-
bool IsMarkedAssembly (AssemblyDefinition assembly)
{
return Annotations.IsMarked (assembly.MainModule);
diff --git a/src/linker/Linker/AssemblyResolver.cs b/src/linker/Linker/AssemblyResolver.cs
index b833a504c..41363c34c 100644
--- a/src/linker/Linker/AssemblyResolver.cs
+++ b/src/linker/Linker/AssemblyResolver.cs
@@ -155,8 +155,7 @@ namespace Mono.Linker
return result;
} finally {
- if (viewStream != null)
- viewStream.Dispose ();
+ viewStream?.Dispose ();
}
}
@@ -222,11 +221,9 @@ namespace Mono.Linker
}
AssemblyCache.Clear ();
- if (_unresolvedAssemblies != null)
- _unresolvedAssemblies.Clear ();
+ _unresolvedAssemblies?.Clear ();
- if (_reportedUnresolvedAssemblies != null)
- _reportedUnresolvedAssemblies.Clear ();
+ _reportedUnresolvedAssemblies?.Clear ();
foreach (var viewStream in _viewStreams) {
viewStream.Dispose ();
diff --git a/src/linker/Linker/Driver.cs b/src/linker/Linker/Driver.cs
index 77f3b4ddb..b1fcf1b90 100644
--- a/src/linker/Linker/Driver.cs
+++ b/src/linker/Linker/Driver.cs
@@ -352,12 +352,6 @@ namespace Mono.Linker
continue;
- case "--keep-facades":
- if (!GetBoolParam (token, l => context.KeepTypeForwarderOnlyAssemblies = l))
- return -1;
-
- continue;
-
case "--keep-dep-attributes":
if (!GetBoolParam (token, l => set_optimizations.Add ((CodeOptimizations.RemoveDynamicDependencyAttribute, null, !l))))
return -1;
@@ -618,9 +612,6 @@ namespace Mono.Linker
context.OutputDirectory = outputDirectory;
continue;
- case "t":
- context.KeepTypeForwarderOnlyAssemblies = true;
- continue;
case "x": {
if (!GetStringParam (token, out string? xmlFile))
return -1;
@@ -1335,7 +1326,6 @@ namespace Mono.Linker
Console.WriteLine (" --custom-data KEY=VALUE Populates context data set with user specified key-value pair");
Console.WriteLine (" --deterministic Produce a deterministic output for modified assemblies");
Console.WriteLine (" --ignore-descriptors Skips reading embedded descriptors (short -z). Defaults to false");
- Console.WriteLine (" --keep-facades Keep assemblies with type-forwarders (short -t). Defaults to false");
Console.WriteLine (" --skip-unresolved Ignore unresolved types, methods, and assemblies. Defaults to false");
Console.WriteLine (" --output-pinvokes PATH Output a JSON file with all modules and entry points of the P/Invokes found");
Console.WriteLine (" --verbose Log messages indicating progress and warnings");
@@ -1422,8 +1412,7 @@ namespace Mono.Linker
public void Dispose ()
{
- if (context != null)
- context.Dispose ();
+ context?.Dispose ();
}
}
}
diff --git a/src/linker/Linker/EmbeddedXmlInfo.cs b/src/linker/Linker/EmbeddedXmlInfo.cs
index 1edb8124d..84f9c71ad 100644
--- a/src/linker/Linker/EmbeddedXmlInfo.cs
+++ b/src/linker/Linker/EmbeddedXmlInfo.cs
@@ -40,8 +40,7 @@ namespace Mono.Linker
context.LogError (null, DiagnosticId.XmlException, rsc.Name, ex.ToString ());
}
- if (marker != null)
- marker.Mark ();
+ marker?.Mark ();
}
public static SubstitutionInfo? ProcessSubstitutions (AssemblyDefinition assembly, LinkContext context)
diff --git a/src/linker/Linker/LinkContext.cs b/src/linker/Linker/LinkContext.cs
index a10a7ac3e..5a66c4566 100644
--- a/src/linker/Linker/LinkContext.cs
+++ b/src/linker/Linker/LinkContext.cs
@@ -105,8 +105,6 @@ namespace Mono.Linker
public bool LinkSymbols { get; set; }
- public bool KeepTypeForwarderOnlyAssemblies { get; set; }
-
public readonly bool KeepMembersForDebugger = true;
public bool IgnoreUnresolved { get; set; }
diff --git a/test/ILLink.RoslynAnalyzer.Tests/generated/ILLink.RoslynAnalyzer.Tests.Generator/ILLink.RoslynAnalyzer.Tests.TestCaseGenerator/ReferencesTests.g.cs b/test/ILLink.RoslynAnalyzer.Tests/generated/ILLink.RoslynAnalyzer.Tests.Generator/ILLink.RoslynAnalyzer.Tests.TestCaseGenerator/ReferencesTests.g.cs
index 5c91dd7ca..8d7750a09 100644
--- a/test/ILLink.RoslynAnalyzer.Tests/generated/ILLink.RoslynAnalyzer.Tests.Generator/ILLink.RoslynAnalyzer.Tests.TestCaseGenerator/ReferencesTests.g.cs
+++ b/test/ILLink.RoslynAnalyzer.Tests/generated/ILLink.RoslynAnalyzer.Tests.Generator/ILLink.RoslynAnalyzer.Tests.TestCaseGenerator/ReferencesTests.g.cs
@@ -16,12 +16,6 @@ namespace ILLink.RoslynAnalyzer.Tests
}
[Fact]
- public Task AssemblyOnlyUsedByUsingWithCscWithKeepFacades ()
- {
- return RunTest (allowMissingWarnings: true);
- }
-
- [Fact]
public Task AssemblyReferenceIsRemovedWhenUnused ()
{
return RunTest (allowMissingWarnings: true);
diff --git a/test/ILLink.RoslynAnalyzer.Tests/generated/ILLink.RoslynAnalyzer.Tests.Generator/ILLink.RoslynAnalyzer.Tests.TestCaseGenerator/TypeForwardingTests.g.cs b/test/ILLink.RoslynAnalyzer.Tests/generated/ILLink.RoslynAnalyzer.Tests.Generator/ILLink.RoslynAnalyzer.Tests.TestCaseGenerator/TypeForwardingTests.g.cs
index b1400dde9..1b2bb4b15 100644
--- a/test/ILLink.RoslynAnalyzer.Tests/generated/ILLink.RoslynAnalyzer.Tests.Generator/ILLink.RoslynAnalyzer.Tests.TestCaseGenerator/TypeForwardingTests.g.cs
+++ b/test/ILLink.RoslynAnalyzer.Tests/generated/ILLink.RoslynAnalyzer.Tests.Generator/ILLink.RoslynAnalyzer.Tests.TestCaseGenerator/TypeForwardingTests.g.cs
@@ -28,7 +28,7 @@ namespace ILLink.RoslynAnalyzer.Tests
}
[Fact]
- public Task TypeForwarderOnlyAssembliesKept ()
+ public Task TypeForwarderOnlyAssembliesRemoved ()
{
return RunTest (allowMissingWarnings: true);
}
diff --git a/test/Mono.Linker.Tests.Cases.Expectations/Metadata/KeepTypeForwarderOnlyAssembliesAttribute.cs b/test/Mono.Linker.Tests.Cases.Expectations/Metadata/KeepTypeForwarderOnlyAssembliesAttribute.cs
deleted file mode 100644
index e386d3502..000000000
--- a/test/Mono.Linker.Tests.Cases.Expectations/Metadata/KeepTypeForwarderOnlyAssembliesAttribute.cs
+++ /dev/null
@@ -1,17 +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;
-
-namespace Mono.Linker.Tests.Cases.Expectations.Metadata
-{
- [AttributeUsage (AttributeTargets.Class)]
- public sealed class KeepTypeForwarderOnlyAssembliesAttribute : BaseMetadataAttribute
- {
- public KeepTypeForwarderOnlyAssembliesAttribute (string value)
- {
- if (string.IsNullOrEmpty (value))
- throw new ArgumentException ("Value cannot be null or empty.", nameof (value));
- }
- }
-}
diff --git a/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/UnusedAttributeWithTypeForwarderIsRemoved.cs b/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/UnusedAttributeWithTypeForwarderIsRemoved.cs
index 52afdeaae..2e74a3b25 100644
--- a/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/UnusedAttributeWithTypeForwarderIsRemoved.cs
+++ b/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/UnusedAttributeWithTypeForwarderIsRemoved.cs
@@ -5,13 +5,12 @@ using Mono.Linker.Tests.Cases.Expectations.Metadata;
namespace Mono.Linker.Tests.Cases.Attributes.OnlyKeepUsed
{
- [KeepTypeForwarderOnlyAssemblies ("true")]
[SetupLinkerArgument ("--used-attrs-only", "true")]
[SetupCompileBefore ("library.dll", new[] { "Dependencies/UnusedAttributeWithTypeForwarderIsRemoved_Lib.cs" })]
[SetupCompileAfter ("implementation.dll", new[] { "Dependencies/UnusedAttributeWithTypeForwarderIsRemoved_Lib.cs" })]
[SetupCompileAfter ("library.dll", new[] { "Dependencies/UnusedAttributeWithTypeForwarderIsRemoved_Forwarder.cs" }, new[] { "implementation.dll" })]
- [RemovedTypeInAssembly ("library.dll", typeof (UnusedAttributeWithTypeForwarderIsRemoved_LibAttribute))]
+ [RemovedAssembly ("library.dll")]
[RemovedTypeInAssembly ("implementation.dll", typeof (UnusedAttributeWithTypeForwarderIsRemoved_LibAttribute))]
class UnusedAttributeWithTypeForwarderIsRemoved
{
diff --git a/test/Mono.Linker.Tests.Cases/DynamicDependencies/DynamicDependencyOnForwardedType.cs b/test/Mono.Linker.Tests.Cases/DynamicDependencies/DynamicDependencyOnForwardedType.cs
index 95ca79466..ec828c82c 100644
--- a/test/Mono.Linker.Tests.Cases/DynamicDependencies/DynamicDependencyOnForwardedType.cs
+++ b/test/Mono.Linker.Tests.Cases/DynamicDependencies/DynamicDependencyOnForwardedType.cs
@@ -16,6 +16,7 @@ namespace Mono.Linker.Tests.Cases.DynamicDependencies
[SetupCompileBefore ("FacadeAssembly.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" })]
[SetupCompileAfter ("ImplementationLibrary.dll", new[] { "Dependencies/ImplementationLibrary.cs" })]
[SetupCompileAfter ("FacadeAssembly.dll", new[] { "Dependencies/FacadeAssembly.cs" }, new[] { "ImplementationLibrary.dll" })]
+ [KeptAssembly ("FacadeAssembly.dll")]
[LogDoesNotContain ("IL2036")]
public class DynamicDependencyOnForwardedType
{
diff --git a/test/Mono.Linker.Tests.Cases/LinkXml/CanPreserveAnExportedType.cs b/test/Mono.Linker.Tests.Cases/LinkXml/CanPreserveAnExportedType.cs
index b083b446f..da65cb35c 100644
--- a/test/Mono.Linker.Tests.Cases/LinkXml/CanPreserveAnExportedType.cs
+++ b/test/Mono.Linker.Tests.Cases/LinkXml/CanPreserveAnExportedType.cs
@@ -5,7 +5,6 @@ using Mono.Linker.Tests.Cases.LinkXml.Dependencies;
namespace Mono.Linker.Tests.Cases.LinkXml
{
- [KeepTypeForwarderOnlyAssemblies ("false")]
[SetupCompileBefore ("Library.dll", new[] { "Dependencies/CanPreserveAnExportedType_Library.cs" })]
// Add another assembly in that uses the forwarder just to make things a little more complex
[SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/CanPreserveAnExportedType_Forwarder.cs" }, references: new[] { "Library.dll" })]
diff --git a/test/Mono.Linker.Tests.Cases/LinkXml/CanPreserveExportedTypesUsingRegex.cs b/test/Mono.Linker.Tests.Cases/LinkXml/CanPreserveExportedTypesUsingRegex.cs
index d84f952a0..8252d109e 100644
--- a/test/Mono.Linker.Tests.Cases/LinkXml/CanPreserveExportedTypesUsingRegex.cs
+++ b/test/Mono.Linker.Tests.Cases/LinkXml/CanPreserveExportedTypesUsingRegex.cs
@@ -5,7 +5,6 @@ using Mono.Linker.Tests.Cases.LinkXml.Dependencies;
namespace Mono.Linker.Tests.Cases.LinkXml
{
- [KeepTypeForwarderOnlyAssemblies ("false")]
[SetupCompileBefore ("Library.dll", new[] { "Dependencies/CanPreserveAnExportedType_Library.cs" })]
// Add another assembly in that uses the forwarder just to make things a little more complex
[SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/CanPreserveAnExportedType_Forwarder.cs" }, references: new[] { "Library.dll" })]
diff --git a/test/Mono.Linker.Tests.Cases/References/AssemblyOnlyUsedByUsingWithCsc.cs b/test/Mono.Linker.Tests.Cases/References/AssemblyOnlyUsedByUsingWithCsc.cs
index 75c930d64..bc607d441 100644
--- a/test/Mono.Linker.Tests.Cases/References/AssemblyOnlyUsedByUsingWithCsc.cs
+++ b/test/Mono.Linker.Tests.Cases/References/AssemblyOnlyUsedByUsingWithCsc.cs
@@ -10,7 +10,6 @@ namespace Mono.Linker.Tests.Cases.References
/// Because of that, `copied` needs to have it's reference to `library` removed even though we specified an assembly action of `copy`
/// </summary>
[SetupLinkerAction ("copy", "copied")]
- [SetupLinkerArgument ("--keep-facades", "false")]
[SetupCompileBefore ("library.dll", new[] { "Dependencies/AssemblyOnlyUsedByUsing_Lib.cs" })]
// When csc is used, `copied.dll` will have a reference to `library.dll`
diff --git a/test/Mono.Linker.Tests.Cases/References/AssemblyOnlyUsedByUsingWithCscWithKeepFacades.cs b/test/Mono.Linker.Tests.Cases/References/AssemblyOnlyUsedByUsingWithCscWithKeepFacades.cs
deleted file mode 100644
index 3be6aa4e7..000000000
--- a/test/Mono.Linker.Tests.Cases/References/AssemblyOnlyUsedByUsingWithCscWithKeepFacades.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using Mono.Linker.Tests.Cases.Expectations.Assertions;
-using Mono.Linker.Tests.Cases.Expectations.Helpers;
-using Mono.Linker.Tests.Cases.Expectations.Metadata;
-using Mono.Linker.Tests.Cases.References.Dependencies;
-
-namespace Mono.Linker.Tests.Cases.References
-{
- /// <summary>
- /// We can't detect the using usage in the assembly. As a result, nothing in `library` is going to be marked and that assembly will be deleted.
- /// Because of that, `copied` needs to have it's reference to `library` removed even though we specified an assembly action of `copy`
- /// </summary>
- [SetupLinkerAction ("copy", "copied")]
-
- // --keep-facades sends the sweep step down a different code path that caused problems for this corner case
- [SetupLinkerArgument ("--keep-facades", "true")]
- [SetupCompileBefore ("library.dll", new[] { "Dependencies/AssemblyOnlyUsedByUsing_Lib.cs" })]
-
- // When csc is used, `copied.dll` will have a reference to `library.dll`
- [SetupCompileBefore ("copied.dll", new[] { "Dependencies/AssemblyOnlyUsedByUsing_Copied.cs" }, new[] { "library.dll" }, compilerToUse: "csc")]
-
- // Here to assert that the test is setup correctly to copy the copied assembly. This is an important aspect of the bug
- [KeptMemberInAssembly ("copied.dll", typeof (AssemblyOnlyUsedByUsing_Copied), "Unused()")]
-
- // We library should be gone. The `using` statement leaves no traces in the IL so nothing in `library` will be marked
- [RemovedAssembly ("library.dll")]
- [KeptReferencesInAssembly ("copied.dll", new[] { "System.Runtime", "library" })]
- public class AssemblyOnlyUsedByUsingWithCscWithKeepFacades
- {
- public static void Main ()
- {
- // Use something to keep the reference at compile time
- AssemblyOnlyUsedByUsing_Copied.UsedToKeepReference ();
- }
- }
-} \ No newline at end of file
diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/AttributeArgumentForwarded.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/AttributeArgumentForwarded.cs
index b0efefb6a..f9f456803 100644
--- a/test/Mono.Linker.Tests.Cases/TypeForwarding/AttributeArgumentForwarded.cs
+++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/AttributeArgumentForwarded.cs
@@ -8,7 +8,6 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding
// Actions:
// link - This assembly, Forwarder.dll and Implementation.dll
[SetupLinkerDefaultAction ("link")]
- [KeepTypeForwarderOnlyAssemblies ("false")]
[SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })]
diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/AttributeArgumentForwardedWithCopyAction.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/AttributeArgumentForwardedWithCopyAction.cs
index 71e154036..486484595 100644
--- a/test/Mono.Linker.Tests.Cases/TypeForwarding/AttributeArgumentForwardedWithCopyAction.cs
+++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/AttributeArgumentForwardedWithCopyAction.cs
@@ -15,7 +15,6 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding
[SetupLinkerDefaultAction ("link")]
[SetupLinkerAction ("copy", "test")]
- [KeepTypeForwarderOnlyAssemblies ("false")]
[SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })]
diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/AttributesScopeUpdated.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/AttributesScopeUpdated.cs
index 809d0225f..572903750 100644
--- a/test/Mono.Linker.Tests.Cases/TypeForwarding/AttributesScopeUpdated.cs
+++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/AttributesScopeUpdated.cs
@@ -11,7 +11,6 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding
[SetupLinkerDefaultAction ("link")]
[SetupLinkerAction ("copy", "test")]
- [KeepTypeForwarderOnlyAssemblies ("false")]
[SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })]
diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/SecurityAttributeScope.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/SecurityAttributeScope.cs
index b0a7e0144..96d49426c 100644
--- a/test/Mono.Linker.Tests.Cases/TypeForwarding/SecurityAttributeScope.cs
+++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/SecurityAttributeScope.cs
@@ -15,7 +15,6 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding
[SetupLinkerArgument ("--skip-unresolved", "true")]
[SetupLinkerArgument ("--strip-security", "false")]
[Define ("IL_ASSEMBLY_AVAILABLE")]
- [KeepTypeForwarderOnlyAssemblies ("false")]
[SetupLinkerAction ("copy", "Library")]
[SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/SecurityAttributeForwarderLibrary.cs" })]
[SetupCompileBefore ("Library.dll", new[] { "Dependencies/LibraryWithSecurityAttributes.il" }, new[] { "Forwarder.dll" })]
diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardedIsUpdatedForMissingType.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardedIsUpdatedForMissingType.cs
index a5e019cb0..cb60d79e9 100644
--- a/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardedIsUpdatedForMissingType.cs
+++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardedIsUpdatedForMissingType.cs
@@ -5,7 +5,6 @@ using Mono.Linker.Tests.Cases.Expectations.Metadata;
namespace Mono.Linker.Tests.Cases.TypeForwarding
{
[SkipUnresolved (true)]
- [KeepTypeForwarderOnlyAssemblies ("false")]
[SetupCompileBefore ("Lib.dll", new[] { "Dependencies/TypeForwardedIsUpdatedForMissingTypeLib.cs" })]
[SetupCompileBefore ("AnotherLibrary.dll", new[] { "Dependencies/TypeForwardedIsUpdatedForMissingTypeLib2.cs" })]
diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwarderOnlyAssembliesKept.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwarderOnlyAssembliesRemoved.cs
index 407cdab90..929a297f6 100644
--- a/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwarderOnlyAssembliesKept.cs
+++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwarderOnlyAssembliesRemoved.cs
@@ -5,7 +5,6 @@ using Mono.Linker.Tests.Cases.TypeForwarding.Dependencies;
namespace Mono.Linker.Tests.Cases.TypeForwarding
{
- [KeepTypeForwarderOnlyAssemblies ("true")]
[SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })]
// Add another assembly in that uses the forwarder just to make things a little more complex
[SetupCompileBefore ("Library.dll", new[] { "Dependencies/LibraryUsingForwarder.cs" }, references: new[] { "Forwarder.dll" })]
@@ -14,10 +13,10 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding
[SetupCompileAfter ("Implementation.dll", new[] { "Dependencies/ImplementationLibrary.cs" })]
[SetupCompileAfter ("Forwarder.dll", new[] { "Dependencies/ForwarderLibrary.cs" }, references: new[] { "Implementation.dll" })]
- [KeptAssembly ("Forwarder.dll")]
+ [RemovedAssembly ("Forwarder.dll")]
[KeptMemberInAssembly ("Library.dll", typeof (LibraryUsingForwarder), "GetValueFromOtherAssembly()")]
[KeptMemberInAssembly ("Implementation.dll", typeof (ImplementationLibrary), "GetSomeValue()")]
- public class TypeForwarderOnlyAssembliesKept
+ public class TypeForwarderOnlyAssembliesRemoved
{
public static void Main ()
{
diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwarderOnlyAssemblyCanBePreservedViaLinkXml.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwarderOnlyAssemblyCanBePreservedViaLinkXml.cs
index d0fe5a6d0..5b0b41549 100644
--- a/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwarderOnlyAssemblyCanBePreservedViaLinkXml.cs
+++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwarderOnlyAssemblyCanBePreservedViaLinkXml.cs
@@ -5,7 +5,6 @@ using Mono.Linker.Tests.Cases.TypeForwarding.Dependencies;
namespace Mono.Linker.Tests.Cases.TypeForwarding
{
- [KeepTypeForwarderOnlyAssemblies ("false")]
[SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })]
// Add another assembly in that uses the forwarder just to make things a little more complex
[SetupCompileBefore ("Library.dll", new[] { "Dependencies/LibraryUsingForwarder.cs" }, references: new[] { "Forwarder.dll" })]
diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardersModifiers.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardersModifiers.cs
index c3d0dc212..193bb4e97 100644
--- a/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardersModifiers.cs
+++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardersModifiers.cs
@@ -8,7 +8,6 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding
// Actions:
// link - This assembly, TypeForwarderModifiersLibDef.dll and TypeForwardersModifiersLib.dll
[SetupLinkerDefaultAction ("link")]
- [KeepTypeForwarderOnlyAssemblies ("false")]
[Define ("IL_ASSEMBLY_AVAILABLE")]
diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardersRewrite.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardersRewrite.cs
index 754d2c282..240f36543 100644
--- a/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardersRewrite.cs
+++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardersRewrite.cs
@@ -6,7 +6,6 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding
{
// Actions:
// link - This assembly, Forwarder.dll and Implementation.dll
- [KeepTypeForwarderOnlyAssemblies ("false")]
[SetupLinkerArgument ("--skip-unresolved", "true")]
diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/UnusedForwarderWithAssemblyCopyUsed.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/UnusedForwarderWithAssemblyCopyUsed.cs
index f8538f0c5..92ad0b244 100644
--- a/test/Mono.Linker.Tests.Cases/TypeForwarding/UnusedForwarderWithAssemblyCopyUsed.cs
+++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/UnusedForwarderWithAssemblyCopyUsed.cs
@@ -9,7 +9,6 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding
// copyused - Forwarder.dll and Implementation.dll
[SetupLinkerAction ("link", "test")]
[SetupLinkerDefaultAction ("copyused")]
- [KeepTypeForwarderOnlyAssemblies ("false")]
[SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })]
diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/UnusedForwarderWithAssemblyLinkedAndFacadesKept.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/UnusedForwarderWithAssemblyLinked.cs
index 439e73d75..140d96077 100644
--- a/test/Mono.Linker.Tests.Cases/TypeForwarding/UnusedForwarderWithAssemblyLinkedAndFacadesKept.cs
+++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/UnusedForwarderWithAssemblyLinked.cs
@@ -6,9 +6,7 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding
{
// Actions:
// link - This assembly, Forwarder.dll and Implementation.dll
- // --keep-facades
[SetupLinkerDefaultAction ("link")]
- [KeepTypeForwarderOnlyAssemblies ("true")]
[SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })]
@@ -16,10 +14,9 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding
[SetupCompileAfter ("Implementation.dll", new[] { "Dependencies/ImplementationLibrary.cs" })]
[SetupCompileAfter ("Forwarder.dll", new[] { "Dependencies/ForwarderLibrary.cs" }, references: new[] { "Implementation.dll" })]
- [KeptAssembly ("Forwarder.dll")]
- [RemovedForwarder ("Forwarder.dll", "ImplementationLibrary")]
+ [RemovedAssembly ("Forwarder.dll")]
[RemovedAssembly ("Implementation.dll")]
- class UnusedForwarderWithAssemblyLinkedAndFacadesKept
+ class UnusedForwarderWithAssemblyLinked
{
static void Main ()
{
diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/UnusedForwarderWithAssemblyLinkedAndFacadeCopy.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/UnusedForwarderWithAssemblyLinkedAndFacadeCopy.cs
index c4105f7d3..64aa26ad6 100644
--- a/test/Mono.Linker.Tests.Cases/TypeForwarding/UnusedForwarderWithAssemblyLinkedAndFacadeCopy.cs
+++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/UnusedForwarderWithAssemblyLinkedAndFacadeCopy.cs
@@ -7,10 +7,8 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding
// Actions:
// link - This assembly, Implementation.dll
// copy - Forwarder.dll
- // --keep-facades
[SetupLinkerDefaultAction ("link")]
[SetupLinkerAction ("copy", "Forwarder")]
- [KeepTypeForwarderOnlyAssemblies ("true")]
[SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary_3.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })]
diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedAndUnusedForwarderReferencedFromCopyUsedAssembly.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedAndUnusedForwarderReferencedFromCopyUsedAssembly.cs
index f8561ee7a..d68e5c8f4 100644
--- a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedAndUnusedForwarderReferencedFromCopyUsedAssembly.cs
+++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedAndUnusedForwarderReferencedFromCopyUsedAssembly.cs
@@ -7,7 +7,6 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding
// Actions:
// copyused - This assembly
[SetupLinkerAction ("copyused", "test")]
- [KeepTypeForwarderOnlyAssemblies ("false")]
[SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })]
[SetupCompileBefore ("ForwarderUnused.dll", new[] { "Dependencies/AnotherLibraryReferenceImplementation.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })]
diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedAndUnusedForwarderWithAssemblyCopy.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedAndUnusedForwarderWithAssemblyCopy.cs
index d21d34e02..465441df9 100644
--- a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedAndUnusedForwarderWithAssemblyCopy.cs
+++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedAndUnusedForwarderWithAssemblyCopy.cs
@@ -10,7 +10,6 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding
[SetupLinkerDefaultAction ("copy")]
[SetupLinkerAction ("link", "Unused")]
[SetupLinkerAction ("link", "test")]
- [KeepTypeForwarderOnlyAssemblies ("false")]
[SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })]
diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderAndUnusedReference.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderAndUnusedReference.cs
index aaead3bf5..a96657baf 100644
--- a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderAndUnusedReference.cs
+++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderAndUnusedReference.cs
@@ -7,7 +7,6 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding
{
// Actions:
// link - This assembly, Forwarder.dll and Implementation.dll
- [KeepTypeForwarderOnlyAssemblies ("false")]
[SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })]
diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderInGenericIsDynamicallyAccessedWithAssemblyCopyUsed.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderInGenericIsDynamicallyAccessedWithAssemblyCopyUsed.cs
index 41169dc15..3406f85be 100644
--- a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderInGenericIsDynamicallyAccessedWithAssemblyCopyUsed.cs
+++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderInGenericIsDynamicallyAccessedWithAssemblyCopyUsed.cs
@@ -11,7 +11,6 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding
{
[SetupLinkerAction ("copyused", "Forwarder")]
- [KeepTypeForwarderOnlyAssemblies ("false")]
[SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })]
diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderIsDynamicallyAccessedWithAssemblyCopyUsed.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderIsDynamicallyAccessedWithAssemblyCopyUsed.cs
index 06d481f57..88e1a8519 100644
--- a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderIsDynamicallyAccessedWithAssemblyCopyUsed.cs
+++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderIsDynamicallyAccessedWithAssemblyCopyUsed.cs
@@ -10,7 +10,6 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding
{
[SetupLinkerAction ("copyused", "Forwarder")]
- [KeepTypeForwarderOnlyAssemblies ("false")]
[SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })]
diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderIsRemovedWhenLink.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderIsRemovedWhenLink.cs
index 3db42a6ac..fe97b7e59 100644
--- a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderIsRemovedWhenLink.cs
+++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderIsRemovedWhenLink.cs
@@ -7,7 +7,6 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding
{
// Actions:
// link - This assembly, Forwarder.dll and Implementation.dll
- [KeepTypeForwarderOnlyAssemblies ("false")]
[IgnoreDescriptors (false)]
[SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })]
diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopy.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopy.cs
index 7067abe6a..9149662a8 100644
--- a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopy.cs
+++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopy.cs
@@ -9,7 +9,6 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding
// copy - Forwarder.dll and Implementation.dll
[SetupLinkerAction ("link", "test")]
[SetupLinkerDefaultAction ("copy")]
- [KeepTypeForwarderOnlyAssemblies ("false")]
[SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })]
diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopyUsed.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopyUsed.cs
index fb09a5b7c..d07226c14 100644
--- a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopyUsed.cs
+++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopyUsed.cs
@@ -9,7 +9,6 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding
// copyused - Forwarder.dll and Implementation.dll
[SetupLinkerAction ("link", "test")]
[SetupLinkerDefaultAction ("copyused")]
- [KeepTypeForwarderOnlyAssemblies ("false")]
[SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })]
@@ -19,6 +18,7 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding
[RemovedAssembly ("Forwarder.dll")]
[KeptMemberInAssembly ("Implementation.dll", typeof (ImplementationLibrary), "GetSomeValue()")]
+ [RemovedAssemblyReference ("test", "Forwarder")]
class UsedForwarderWithAssemblyCopyUsed
{
static void Main ()
diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopyUsedAndFacadesKept.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopyUsedAndFacadesKept.cs
deleted file mode 100644
index 6aa2e75bf..000000000
--- a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopyUsedAndFacadesKept.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-using Mono.Linker.Tests.Cases.Expectations.Assertions;
-using Mono.Linker.Tests.Cases.Expectations.Metadata;
-using Mono.Linker.Tests.Cases.TypeForwarding.Dependencies;
-
-namespace Mono.Linker.Tests.Cases.TypeForwarding
-{
- // Actions:
- // link - This assembly
- // copyused - Forwarder.dll and Implementation.dll
- // --keep-facades
- [SetupLinkerAction ("link", "test")]
- [SetupLinkerDefaultAction ("copyused")]
- [KeepTypeForwarderOnlyAssemblies ("true")]
-
- [SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })]
-
- // After compiling the test case we then replace the reference impl with implementation + type forwarder
- [SetupCompileAfter ("Implementation.dll", new[] { "Dependencies/ImplementationLibrary.cs" })]
- [SetupCompileAfter ("Forwarder.dll", new[] { "Dependencies/ForwarderLibrary.cs" }, references: new[] { "Implementation.dll" })]
-
- [KeptTypeInAssembly ("Forwarder.dll", typeof (ImplementationLibrary))]
- [KeptMemberInAssembly ("Implementation.dll", typeof (ImplementationLibrary), "GetSomeValue()")]
- [RemovedAssemblyReference ("test", "Forwarder")]
- class UsedForwarderWithAssemblyCopyUsedAndFacadesKept
- {
- static void Main ()
- {
- new ImplementationLibrary ().GetSomeValue ();
- }
- }
-}
diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopyUsedAndForwarderLibraryKept.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopyUsedAndForwarderLibraryKept.cs
index e4e750c3d..789e047e4 100644
--- a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopyUsedAndForwarderLibraryKept.cs
+++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopyUsedAndForwarderLibraryKept.cs
@@ -7,7 +7,6 @@ using Mono.Linker.Tests.Cases.TypeForwarding.Dependencies;
namespace Mono.Linker.Tests.Cases.TypeForwarding
{
[SetupLinkerDefaultAction ("copyused")]
- [KeepTypeForwarderOnlyAssemblies ("false")]
[SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })]
diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopyUsedAndFacadesKeptAndUnusedReference.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopyUsedAndUnusedReference.cs
index c3c6e19ef..996fb2903 100644
--- a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopyUsedAndFacadesKeptAndUnusedReference.cs
+++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopyUsedAndUnusedReference.cs
@@ -7,10 +7,8 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding
// Actions:
// link - This assembly
// copyused - Forwarder.dll, Implementation.dll, and UnusedImplementation.dll
- // --keep-facades
[SetupLinkerAction ("link", "test")]
[SetupLinkerDefaultAction ("copyused")]
- [KeepTypeForwarderOnlyAssemblies ("true")]
[SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationUsedAndUnusedLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })]
@@ -19,12 +17,11 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding
[SetupCompileAfter ("UnusedImplementation.dll", new[] { "Dependencies/UnusedImplementationLibrary.cs" })]
[SetupCompileAfter ("Forwarder.dll", new[] { "Dependencies/ForwarderLibraryWithUnusedReference.cs" }, references: new[] { "Implementation.dll", "UnusedImplementation.dll" })]
- [KeptTypeInAssembly ("Forwarder.dll", typeof (ImplementationLibrary))]
- [KeptTypeInAssembly ("Forwarder.dll", typeof (UnusedImplementationLibrary))]
+ [RemovedAssembly ("Forwarder.dll")]
[KeptMemberInAssembly ("Implementation.dll", typeof (ImplementationLibrary), "GetSomeValue()")]
[RemovedAssemblyReference ("test", "Forwarder")]
[RemovedAssembly ("UnusedImplementation.dll")]
- class UsedForwarderWithAssemblyCopyUsedAndFacadesKeptAndUnusedReference
+ class UsedForwarderWithAssemblyCopyUsedAndUnusedReference
{
static void Main ()
{
diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedTransitiveForwarderInCopyUsedAssemblyIsDynamicallyAccessed.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedTransitiveForwarderInCopyUsedAssemblyIsDynamicallyAccessed.cs
index c94e3d6c4..0bd837533 100644
--- a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedTransitiveForwarderInCopyUsedAssemblyIsDynamicallyAccessed.cs
+++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedTransitiveForwarderInCopyUsedAssemblyIsDynamicallyAccessed.cs
@@ -8,8 +8,6 @@ using Mono.Linker.Tests.Cases.TypeForwarding.Dependencies;
namespace Mono.Linker.Tests.Cases.TypeForwarding
{
- [KeepTypeForwarderOnlyAssemblies ("false")]
-
[SetupCompileBefore ("SecondForwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })]
[SetupCompileBefore ("FirstForwarder.dll", new[] { "Dependencies/ForwarderLibrary.cs" }, references: new[] { "SecondForwarder.dll" })]
diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedTransitiveForwarderIsDynamicallyAccessed.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedTransitiveForwarderIsDynamicallyAccessed.cs
index 1bb6ff188..c5ef41ef0 100644
--- a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedTransitiveForwarderIsDynamicallyAccessed.cs
+++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedTransitiveForwarderIsDynamicallyAccessed.cs
@@ -8,8 +8,6 @@ using Mono.Linker.Tests.Cases.TypeForwarding.Dependencies;
namespace Mono.Linker.Tests.Cases.TypeForwarding
{
- [KeepTypeForwarderOnlyAssemblies ("false")]
-
[SetupCompileBefore ("SecondForwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })]
[SetupCompileBefore ("FirstForwarder.dll", new[] { "Dependencies/ForwarderLibrary.cs" }, references: new[] { "SecondForwarder.dll" })]
diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedTransitiveForwarderIsResolvedAndFacadeRemoved.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedTransitiveForwarderIsResolvedAndFacadeRemoved.cs
index c901b453f..d00a42e12 100644
--- a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedTransitiveForwarderIsResolvedAndFacadeRemoved.cs
+++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedTransitiveForwarderIsResolvedAndFacadeRemoved.cs
@@ -8,8 +8,6 @@ using Mono.Linker.Tests.Cases.TypeForwarding.Dependencies;
namespace Mono.Linker.Tests.Cases.TypeForwarding
{
- [KeepTypeForwarderOnlyAssemblies ("false")]
-
[SetupCompileBefore ("SecondForwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })]
[SetupCompileBefore ("FirstForwarder.dll", new[] { "Dependencies/ForwarderLibrary.cs" }, references: new[] { "SecondForwarder.dll" })]
[SetupCompileAfter ("Implementation.dll", new[] { "Dependencies/ImplementationLibrary.cs" })]
diff --git a/test/Mono.Linker.Tests/TestCasesRunner/LinkerArgumentBuilder.cs b/test/Mono.Linker.Tests/TestCasesRunner/LinkerArgumentBuilder.cs
index 6888c08f8..43dbcdd21 100644
--- a/test/Mono.Linker.Tests/TestCasesRunner/LinkerArgumentBuilder.cs
+++ b/test/Mono.Linker.Tests/TestCasesRunner/LinkerArgumentBuilder.cs
@@ -99,12 +99,6 @@ namespace Mono.Linker.Tests.TestCasesRunner
Append (value);
}
- public virtual void AddKeepTypeForwarderOnlyAssemblies (string value)
- {
- if (bool.Parse (value))
- Append ("-t");
- }
-
public virtual void AddLinkSymbols (string value)
{
Append ("-b");
@@ -221,9 +215,6 @@ namespace Mono.Linker.Tests.TestCasesRunner
AddIl8n (options.Il8n);
#endif
- if (!string.IsNullOrEmpty (options.KeepTypeForwarderOnlyAssemblies))
- AddKeepTypeForwarderOnlyAssemblies (options.KeepTypeForwarderOnlyAssemblies);
-
if (!string.IsNullOrEmpty (options.LinkSymbols))
AddLinkSymbols (options.LinkSymbols);
diff --git a/test/Mono.Linker.Tests/TestCasesRunner/TestCaseLinkerOptions.cs b/test/Mono.Linker.Tests/TestCasesRunner/TestCaseLinkerOptions.cs
index 77bed13a4..67b29656e 100644
--- a/test/Mono.Linker.Tests/TestCasesRunner/TestCaseLinkerOptions.cs
+++ b/test/Mono.Linker.Tests/TestCasesRunner/TestCaseLinkerOptions.cs
@@ -15,7 +15,6 @@ namespace Mono.Linker.Tests.TestCasesRunner
public bool IgnoreDescriptors;
public bool IgnoreSubstitutions;
public bool IgnoreLinkAttributes;
- public string KeepTypeForwarderOnlyAssemblies;
public string KeepDebugMembers;
public string LinkSymbols;
public bool SkipUnresolved;
diff --git a/test/Mono.Linker.Tests/TestCasesRunner/TestCaseMetadataProvider.cs b/test/Mono.Linker.Tests/TestCasesRunner/TestCaseMetadataProvider.cs
index 0c788fa9e..a3290c4f6 100644
--- a/test/Mono.Linker.Tests/TestCasesRunner/TestCaseMetadataProvider.cs
+++ b/test/Mono.Linker.Tests/TestCasesRunner/TestCaseMetadataProvider.cs
@@ -27,7 +27,6 @@ namespace Mono.Linker.Tests.TestCasesRunner
IgnoreDescriptors = GetOptionAttributeValue (nameof (IgnoreDescriptorsAttribute), true),
IgnoreSubstitutions = GetOptionAttributeValue (nameof (IgnoreSubstitutionsAttribute), true),
IgnoreLinkAttributes = GetOptionAttributeValue (nameof (IgnoreLinkAttributesAttribute), true),
- KeepTypeForwarderOnlyAssemblies = GetOptionAttributeValue (nameof (KeepTypeForwarderOnlyAssembliesAttribute), string.Empty),
KeepDebugMembers = GetOptionAttributeValue (nameof (SetupLinkerKeepDebugMembersAttribute), string.Empty),
LinkSymbols = GetOptionAttributeValue (nameof (SetupLinkerLinkSymbolsAttribute), string.Empty),
TrimMode = GetOptionAttributeValue<string> (nameof (SetupLinkerTrimModeAttribute), null),