diff --git a/src/coreclr/tools/aot/crossgen2/Crossgen2RootCommand.cs b/src/coreclr/tools/aot/crossgen2/Crossgen2RootCommand.cs index b63e33f17ac23b..c31f7175e0b7c8 100644 --- a/src/coreclr/tools/aot/crossgen2/Crossgen2RootCommand.cs +++ b/src/coreclr/tools/aot/crossgen2/Crossgen2RootCommand.cs @@ -42,7 +42,7 @@ internal class Crossgen2RootCommand : RootCommand new("--optimize-space", "--Os") { Description = SR.OptimizeSpaceOption }; public Option OptimizeTime { get; } = new("--optimize-time", "--Ot") { Description = SR.OptimizeSpeedOption }; - public Option EnableCachedInterfaceDispatchSupport { get; } = + public Option EnableCachedInterfaceDispatchSupport { get; } = new("--enable-cached-interface-dispatch-support", "--CID") { Description = SR.EnableCachedInterfaceDispatchSupport }; public Option TypeValidation { get; } = new("--type-validation") { DefaultValueFactory = _ => TypeValidationRule.Automatic, Description = SR.TypeValidation, HelpName = "arg" }; diff --git a/src/coreclr/tools/aot/crossgen2/Program.cs b/src/coreclr/tools/aot/crossgen2/Program.cs index ffa238e9e4388a..2ac14e471e8448 100644 --- a/src/coreclr/tools/aot/crossgen2/Program.cs +++ b/src/coreclr/tools/aot/crossgen2/Program.cs @@ -623,7 +623,7 @@ private void RunSingleCompilation(Dictionary inFilePaths, Instru nodeFactoryFlags.TypeValidation = Get(_command.TypeValidation); nodeFactoryFlags.DeterminismStress = Get(_command.DeterminismStress); nodeFactoryFlags.PrintReproArgs = Get(_command.PrintReproInstructions); - nodeFactoryFlags.EnableCachedInterfaceDispatchSupport = Get(_command.EnableCachedInterfaceDispatchSupport); + nodeFactoryFlags.EnableCachedInterfaceDispatchSupport = Get(_command.EnableCachedInterfaceDispatchSupport) ?? !typeSystemContext.TargetAllowsRuntimeCodeGeneration; builder .UseMapFile(Get(_command.Map)) diff --git a/src/coreclr/tools/aot/crossgen2/Properties/Resources.resx b/src/coreclr/tools/aot/crossgen2/Properties/Resources.resx index e1f59a69a5cff7..ca30cc9a5e31d0 100644 --- a/src/coreclr/tools/aot/crossgen2/Properties/Resources.resx +++ b/src/coreclr/tools/aot/crossgen2/Properties/Resources.resx @@ -424,7 +424,7 @@ Number of nested occurrences of a potentially cyclic generic type to cut off - Enable support for cached interface dispatch + Enable support for cached interface dispatch. Default is true on platforms which do not support runtime code generation Target output format for the ReadyToRun image