Skip to content

Commit

Permalink
[dotnet] add redirect-class-handles to optimizations. (#18354)
Browse files Browse the repository at this point in the history
Add redirect-class-handles to optimization options.
  • Loading branch information
stephen-hawley authored May 30, 2023
1 parent 3e13f66 commit 62634bd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tools/common/Optimizations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public class Optimizations {
"custom-attributes-removal",
"experimental-xforms-product-type",
"force-rejected-types-removal",
"redirect-class-handles",
};

static ApplePlatform [] [] valid_platforms = new ApplePlatform [] [] {
Expand All @@ -48,6 +49,7 @@ public class Optimizations {
/* Opt.CustomAttributesRemoval */ new ApplePlatform [] { ApplePlatform.iOS, ApplePlatform.MacOSX, ApplePlatform.WatchOS, ApplePlatform.TVOS, ApplePlatform.MacCatalyst },
/* Opt.ExperimentalFormsProductType */ new ApplePlatform [] { ApplePlatform.iOS, ApplePlatform.MacOSX, ApplePlatform.WatchOS, ApplePlatform.TVOS, ApplePlatform.MacCatalyst },
/* Opt.ForceRejectedTypesRemoval */ new ApplePlatform [] { ApplePlatform.iOS, ApplePlatform.WatchOS, ApplePlatform.TVOS, ApplePlatform.MacCatalyst },
/* Opt.RedirectClassHandles */ new ApplePlatform [] { ApplePlatform.iOS, ApplePlatform.MacOSX, ApplePlatform.WatchOS, ApplePlatform.TVOS, ApplePlatform.MacCatalyst },
};

enum Opt {
Expand All @@ -69,6 +71,7 @@ enum Opt {
CustomAttributesRemoval,
ExperimentalFormsProductType,
ForceRejectedTypesRemoval,
RedirectClassHandles,
}

bool? [] values;
Expand Down Expand Up @@ -155,6 +158,11 @@ public bool? ForceRejectedTypesRemoval {
set { values [(int) Opt.ForceRejectedTypesRemoval] = value; }
}

public bool? RedirectClassHandles {
get { return values [(int) Opt.RedirectClassHandles]; }
set { values [(int) Opt.RedirectClassHandles] = value; }
}

public Optimizations ()
{
values = new bool? [opt_names.Length];
Expand Down Expand Up @@ -196,6 +204,7 @@ public void Initialize (Application app, out List<ProductException> messages)
break; // Does not require linker
case Opt.RegisterProtocols:
case Opt.RemoveDynamicRegistrar:
case Opt.RedirectClassHandles:
if (app.Registrar != RegistrarMode.Static && app.Registrar != RegistrarMode.ManagedStatic) {
messages.Add (ErrorHelper.CreateWarning (2003, Errors.MT2003, (values [i].Value ? "" : "-"), opt_names [i]));
values [i] = false;
Expand Down

6 comments on commit 62634bd

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

Please sign in to comment.