about summary refs log tree commit diff
path: root/src/test/incremental/thinlto
diff options
context:
space:
mode:
authorBjörn Steinbrink <bsteinbr@gmail.com>2017-10-11 20:49:36 +0200
committerBjörn Steinbrink <bsteinbr@gmail.com>2017-10-26 12:54:34 +0200
commit0473a4f1d8f5e10c1ec97b1f7b4918308e1c1090 (patch)
tree8e0605f6915f14b6ecbc420c04572fdb05a13bec /src/test/incremental/thinlto
parent56dc171a2f2dc2373b1930f71140a354fa84b982 (diff)
downloadrust-0473a4f1d8f5e10c1ec97b1f7b4918308e1c1090.tar.gz
rust-0473a4f1d8f5e10c1ec97b1f7b4918308e1c1090.zip
Avoid unnecessary copies of arguments that are simple bindings
Initially MIR differentiated between arguments and locals, which
introduced a need to add extra copies assigning the argument to a
local, even for simple bindings. This differentiation no longer exists,
but we're still creating those copies, bloating the MIR and LLVM IR we
emit.

Additionally, the current approach means that we create debug info for
both the incoming argument (marking it as an argument), and then
immediately shadow it a local that goes by the same name. This can be
confusing when using e.g. "info args" in gdb, or when e.g. a debugger
with a GUI displays the function arguments separately from the local
variables, especially when the binding is mutable, because the argument
doesn't change, while the local variable does.
Diffstat (limited to 'src/test/incremental/thinlto')
0 files changed, 0 insertions, 0 deletions