-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Use [SkipLocalsInit] & remove code for ILLink to strip locals init #37541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Tagging subscribers to this area: @ViktorHofer |
stephentoub
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this.
Have you confirmed .locals init is appropriately not being output?
src/coreclr/src/System.Private.CoreLib/src/ShouldSkipLocalsInit.cs
Outdated
Show resolved
Hide resolved
| <When Condition="'$(ShouldSkipLocalsInit)' == 'true' and '$(IsNETCoreApp)' == 'true'"> | ||
| <PropertyGroup > | ||
| <!-- This is needed to use the SkipLocalsInitAttribute. --> | ||
| <AllowUnsafeBlocks>true</AllowUnsafeBlocks> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove this from some .csproj files as a result?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@layomia and I checked offline and we really only want to add this attribute to net5.0 configurations, as we were only using the linker to remove locals init for those configurations. I would totally agree with you in removing duplicate properties if all configurations applied, but because it is only netcoreappcurrent then I think it will be messy to have this property basically have conditions in projects that say '$(TargetFramework)' != '$(NetCoreAppCurrent)' so I would probably suggest to live this as is for now.
src/mono/netcore/System.Private.CoreLib/src/ShouldSkipLocalsInit.cs
Outdated
Show resolved
Hide resolved
src/mono/netcore/System.Private.CoreLib/System.Private.CoreLib.csproj
Outdated
Show resolved
Hide resolved
Yes, I've double-checked with various assemblies. |
src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems
Outdated
Show resolved
Hide resolved
joperezr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM other than that one small comment about probably renaming the attribute file. Thanks for fixing this @layomia 😄
eerhardt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. Thanks for getting this done.
Fixes #35527.