-
Notifications
You must be signed in to change notification settings - Fork 13.5k
compiler: doc/comment some codegen-for-functions interfaces #143716
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
compiler: doc/comment some codegen-for-functions interfaces #143716
Conversation
This requires digging up ffee956 and reading the comments there to understand that the callee in resolve_closure previously directly handled a function pointer value.
r? @fee1-dead rustbot has assigned @fee1-dead. Use |
Some changes occurred in compiler/rustc_codegen_ssa |
r? @WaffleLapkin or reroll idk it's just some comments |
|
143d057
to
afdd2a9
Compare
r? fee1-dead |
/// "Finally codegen the call" | ||
/// | ||
/// The typical case that an argument is None is during the codegen of intrinsics, | ||
/// as they are "fake functions" that have no meaningful ABI. |
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.
Also callng lang items uses a None FnAbi. The FnAbi and Instance passed here are only used for CFI. The caller is expected to have already handled the ABI lowering.
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.
Interesting, so there's no particular reason that our call code looks like this except for CFI?
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.
It is also used for applying some call-site attributes like nounwind or noreturn, but yeah, most of the code in it is for CFI
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.
@bjorn3 Can you please take another look at the latest version to see if I accurately described the situation?
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.
re: the other call-site attributes, my understanding is that applying these attributes would not be required for the sake of correctness.
72aec74
to
7f0be7e
Compare
/// in the context of other compiler-enhanced security features. | ||
/// | ||
/// The typical case that they are None is during the codegen of intrinsics and lang-items, | ||
/// as those are "fake functions" that have no meaningful ABI, et cetera. |
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.
Lang items do have a meaningful ABI. It just happens to match the most naive implementation you can think of as they normally only have primitive arguments and no return value.
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.
"trivial", then.
Partially documents the situation due to LLVM CFI.
7f0be7e
to
39f7707
Compare
r? bjorn3 to take a look at the language though it LGTM. |
@bors r=bjorn3,fee1-dead |
…en-backend-stuff, r=bjorn3,fee1-dead compiler: doc/comment some codegen-for-functions interfaces An out-of-date comment gets updated and some underdocumented functions get documented.
Rollup of 10 pull requests Successful merges: - #142301 (tests: Fix duplicated-path-in-error fail with musl) - #143403 (Port several trait/coherence-related attributes the new attribute system) - #143633 (fix: correct assertion to check for 'noinline' attribute presence before removal) - #143647 (Clarify and expand documentation for std::sys_common dependency structure) - #143716 (compiler: doc/comment some codegen-for-functions interfaces) - #143747 (Add target maintainer information for aarch64-unknown-linux-musl) - #143759 (Fix typos in function names in the `target_feature` test) - #143767 (Bump `src/tools/x` to Edition 2024 and some cleanups) - #143769 (Remove support for SwitchInt edge effects in backward dataflow) - #143770 (build-helper: clippy fixes) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 9 pull requests Successful merges: - #143403 (Port several trait/coherence-related attributes the new attribute system) - #143633 (fix: correct assertion to check for 'noinline' attribute presence before removal) - #143647 (Clarify and expand documentation for std::sys_common dependency structure) - #143716 (compiler: doc/comment some codegen-for-functions interfaces) - #143747 (Add target maintainer information for aarch64-unknown-linux-musl) - #143759 (Fix typos in function names in the `target_feature` test) - #143767 (Bump `src/tools/x` to Edition 2024 and some cleanups) - #143769 (Remove support for SwitchInt edge effects in backward dataflow) - #143770 (build-helper: clippy fixes) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #143716 - workingjubilee:document-some-codegen-backend-stuff, r=bjorn3,fee1-dead compiler: doc/comment some codegen-for-functions interfaces An out-of-date comment gets updated and some underdocumented functions get documented.
Rollup of 9 pull requests Successful merges: - rust-lang/rust#143403 (Port several trait/coherence-related attributes the new attribute system) - rust-lang/rust#143633 (fix: correct assertion to check for 'noinline' attribute presence before removal) - rust-lang/rust#143647 (Clarify and expand documentation for std::sys_common dependency structure) - rust-lang/rust#143716 (compiler: doc/comment some codegen-for-functions interfaces) - rust-lang/rust#143747 (Add target maintainer information for aarch64-unknown-linux-musl) - rust-lang/rust#143759 (Fix typos in function names in the `target_feature` test) - rust-lang/rust#143767 (Bump `src/tools/x` to Edition 2024 and some cleanups) - rust-lang/rust#143769 (Remove support for SwitchInt edge effects in backward dataflow) - rust-lang/rust#143770 (build-helper: clippy fixes) r? `@ghost` `@rustbot` modify labels: rollup
An out-of-date comment gets updated and some underdocumented functions get documented.