Context: #129926 (comment)
In the context of an R2R compilation, the operating system and process architecture are constant values, aren't they? If so, it might be a good idea to mark [NonVersionable] the APIs to get the operating system or process architecture, in order to allow more dead code elimination in R2R. Specifically, I'm asking for the following APIs:
OperatingSystem.Is***()
- I am not including the
Is***VersionAtLeast APIs, because the OS version is not known at publish time. As a separate work item, crossgen could expand them as Is***() && Is***VersionAtLeast(x, y, z) to eliminate dead code if we are compiling for a completely different OS.
RuntimeInformation.ProcessArchitecture
We could also mark these APIs, but they are superseded by OperatingSystem.Is*** so it might not be needed:
- The
OSPlatform type.
RuntimeInformation.IsOSPlatform
Context: #129926 (comment)
In the context of an R2R compilation, the operating system and process architecture are constant values, aren't they? If so, it might be a good idea to mark
[NonVersionable]the APIs to get the operating system or process architecture, in order to allow more dead code elimination in R2R. Specifically, I'm asking for the following APIs:OperatingSystem.Is***()Is***VersionAtLeastAPIs, because the OS version is not known at publish time. As a separate work item, crossgen could expand them asIs***() && Is***VersionAtLeast(x, y, z)to eliminate dead code if we are compiling for a completely different OS.RuntimeInformation.ProcessArchitectureWe could also mark these APIs, but they are superseded by
OperatingSystem.Is***so it might not be needed:OSPlatformtype.RuntimeInformation.IsOSPlatform