From 09bce94b723d2b52fc98ce6a3dc5f6a3a19d4b2a Mon Sep 17 00:00:00 2001 From: Sebastien Pouliot Date: Wed, 23 Jun 2021 16:37:16 -0400 Subject: [PATCH] [WIP][dotnet][linker] Enable the sealer optimization when (by default) * the interpreter is not enabled (since new code might subclass or override the members analyzed at build time) * building for release Reverts https://github.com/xamarin/xamarin-macios/commit/c56b893b68811ffdd1065aa52e8589b72df49fb4 Fix https://github.com/xamarin/xamarin-macios/issues/9573 Work-in-progress: * should be made easier to enable/disable (from user projects) * the above conditions should be the default (if nothing is specified) --- dotnet/targets/Xamarin.Shared.Sdk.targets | 3 +++ tests/linker/ios/link all/SealerTest.cs | 9 --------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/dotnet/targets/Xamarin.Shared.Sdk.targets b/dotnet/targets/Xamarin.Shared.Sdk.targets index 20ad29ca7cb7..8e36bd9ec858 100644 --- a/dotnet/targets/Xamarin.Shared.Sdk.targets +++ b/dotnet/targets/Xamarin.Shared.Sdk.targets @@ -302,6 +302,9 @@ --> <_ExtraTrimmerArgs>$(_ExtraTrimmerArgs) --disable-opt unusedtypechecks + + <_ExtraTrimmerArgs Condition="'$(_BundlerDebug)' != 'true' And '$(MtouchInterpreter)' == '' And '$(_PlatformName)' != 'macOS'">$(_ExtraTrimmerArgs) --enable-opt sealer + false diff --git a/tests/linker/ios/link all/SealerTest.cs b/tests/linker/ios/link all/SealerTest.cs index 1ebe75909078..297600627be0 100644 --- a/tests/linker/ios/link all/SealerTest.cs +++ b/tests/linker/ios/link all/SealerTest.cs @@ -36,9 +36,6 @@ public class Subclass : Base, Interface { [Preserve (AllMembers = true)] public class SealerTest { -#if !DEBUG && NET - [Ignore ("https://github.com/xamarin/xamarin-macios/issues/9573")] -#endif [Test] public void Sealed () { @@ -62,9 +59,6 @@ public void Sealed () #endif } -#if !DEBUG && NET - [Ignore ("https://github.com/xamarin/xamarin-macios/issues/9573")] -#endif [Test] public void Final () { @@ -85,9 +79,6 @@ public void Final () #endif } -#if !DEBUG && NET - [Ignore ("https://github.com/xamarin/xamarin-macios/issues/9573")] -#endif [Test] public void Virtual () {