-
Notifications
You must be signed in to change notification settings - Fork 69
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
Change -Z asm_comments
to -Z verbose_asm
, stop stripping handwritten assembly comments
#762
Comments
This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed. Concerns or objections to the proposal should be discussed on Zulip and formally registered here by adding a comment with the following syntax:
Concerns can be lifted with:
See documentation at https://forge.rust-lang.org cc @rust-lang/compiler @rust-lang/compiler-contributors |
Clang seems to preserve asm comments by default: https://github.com/llvm/llvm-project/blob/4232dd586b65c9301304cab2fb166d8df97c591a/clang/include/clang/Driver/Options.td#L3737-L3741 So there's no downside to just always doing this in rustc. |
@rustbot second |
Change `asm-comments` to `verbose-asm`, always emit user comments Implements what is described in rust-lang/compiler-team#762 Tracking issue: rust-lang#126802
@rustbot label -final-comment-period +major-change-accepted |
Change `asm-comments` to `verbose-asm`, always emit user comments Implements what is described in rust-lang/compiler-team#762 Tracking issue: rust-lang#126802
Rollup merge of rust-lang#126803 - tgross35:verbose-asm, r=Amanieu Change `asm-comments` to `verbose-asm`, always emit user comments Implements what is described in rust-lang/compiler-team#762 Tracking issue: rust-lang#126802
Proposal
-Z asm-comments
currently controls two things: stripping all comments from assembly (PreserveAsmComments
), and LLVM emitting its own verbose comments (AsmVerbose
). By default this option is set to false, so even handwritten comments get stripped:The output doesn't have the "hello" and "world" comments anywhere:
Link: https://rust.godbolt.org/z/jxdEWY6oG
There doesn't seem to be a good reason to strip handwritten assembly comments ever (within the string), since a user can just write Rust comments if they don't want something to show up in the binary. So, proposal:
-Z verbose-asm
, which will be consistent with Clang/GCCAsmVerbose
)PreserveAsmComments
to be always true-Z verbose-asm
might wind up stabilized one dayThe flag was originally added at rust-lang/rust#53290
See background discussion at https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Comments.20in.20.60asm!.60
Mentors or Reviewers
I can do the change
Process
The main points of the Major Change Process are as follows:
@rustbot second
.-C flag
, then full team check-off is required.@rfcbot fcp merge
on either the MCP or the PR.You can read more about Major Change Proposals on forge.
Comments
This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.
The text was updated successfully, but these errors were encountered: