-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
fix(storage): do not inhibit the dead code elimination. #8543
fix(storage): do not inhibit the dead code elimination. #8543
Conversation
Hi there! Does anybody look at PRs in this repo? @codyoss? @jadekler? Please do have a look at the patch, or assign it to a person who reviews changes in /storage. |
Hey @dominiquelefevre, this repo is monitored and we do accept PRs. That being said we may not always get to them immediately so please be patient with us. Also, we encourage all PRs to start with an issue first for discussion and triage to see if it is a change we are willing to make -- it saves both parties time in the long run. I encourage to to please open a corresponding issue to this PR. Thanks. |
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.
Thank you for the PR!
When the go compiler encounters a call to MethodByName(), it assumes that every method of every reachable type can be accessed, and nothing may be eliminated. Go 1.22 has gained support for calls like MethodByName("Foobar"). If the argument to MethodByName() is a compile-time constant, then the compiler no longer disables the DCE, and only keeps methods named Foobar. Rewrite setConditionField() so that MethodByName() is only called with compile-time constants. This way importing cloud.google.com/go/storage will not inhibit the DCE.
ping @BrennaEpp |
Hey, anybody out here? @BrennaEpp? |
When the go compiler encounters a call to MethodByName(), it assumes that every method of every reachable type can be accessed, and nothing may be eliminated.
Go 1.22 has gained support for calls like MethodByName("Foobar"). If the argument to MethodByName() is a compile-time constant, then the compiler no longer disables the DCE, and only keeps methods named Foobar.
Rewrite setConditionField() so that MethodByName() is only called with compile-time constants. This way importing cloud.google.com/go/storage will not inhibit the DCE.
Fixes #8745