about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-10-26 17:45:43 +0200
committerGitHub <noreply@github.com>2023-10-26 17:45:43 +0200
commitb66c6e719f6b1905c5af59ad8b3d4a7f1ac1143b (patch)
tree9b28db7313fb0e7cda299ca7cba6ff079b205909 /compiler/rustc_codegen_gcc
parent17fb2f4b310e5aab1ba04aeba3dc741fee418de5 (diff)
parentd55487d7e9834c8fe01350b5b4fa402423c855d5 (diff)
downloadrust-b66c6e719f6b1905c5af59ad8b3d4a7f1ac1143b.tar.gz
rust-b66c6e719f6b1905c5af59ad8b3d4a7f1ac1143b.zip
Rollup merge of #117095 - klinvill:smir-fn-arg-count, r=oli-obk
Add way to differentiate argument locals from other locals in Stable MIR

This PR resolves rust-lang/project-stable-mir#47 which request a way to differentiate argument locals in a SMIR `Body` from other locals.

Specifically, this PR exposes the `arg_count` field from the MIR `Body`. However, I'm opening this as a draft PR because I think there are a few outstanding questions on how this information should be exposed and described. Namely:

- Is exposing `arg_count` the best way to surface this information to SMIR users? Would it be better to leave `arg_count` as a private field and add public methods (e.g. `fn arguments(&self) -> Iter<'_, LocalDecls>`) that may use the underlying `arg_count` info from the MIR body, but expose this information to users in a more convenient form? Or is it best to stick close to the current MIR convention?
- If the answer to the above point is to stick with the current MIR convention (`arg_count`), is it reasonable to also commit to sticking to the current MIR convention that the first local is always the return local, while the next `arg_count` locals are always the (in-order) argument locals?
- Should `Body` in SMIR only represent function bodies (as implied by the comment I added)? That seems to be the current case in MIR, but should this restriction always be the case for SMIR?

r? `@celinval`
r? `@oli-obk`
Diffstat (limited to 'compiler/rustc_codegen_gcc')
0 files changed, 0 insertions, 0 deletions