0473a4f1d8
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. |
||
---|---|---|
.. | ||
back | ||
debuginfo | ||
mir | ||
abi.rs | ||
adt.rs | ||
allocator.rs | ||
asm.rs | ||
assert_module_sources.rs | ||
attributes.rs | ||
base.rs | ||
build.rs | ||
builder.rs | ||
cabi_aarch64.rs | ||
cabi_arm.rs | ||
cabi_asmjs.rs | ||
cabi_hexagon.rs | ||
cabi_mips64.rs | ||
cabi_mips.rs | ||
cabi_msp430.rs | ||
cabi_nvptx64.rs | ||
cabi_nvptx.rs | ||
cabi_powerpc64.rs | ||
cabi_powerpc.rs | ||
cabi_s390x.rs | ||
cabi_sparc64.rs | ||
cabi_sparc.rs | ||
cabi_x86_64.rs | ||
cabi_x86_win64.rs | ||
cabi_x86.rs | ||
callee.rs | ||
Cargo.toml | ||
common.rs | ||
consts.rs | ||
context.rs | ||
declare.rs | ||
diagnostics.rs | ||
glue.rs | ||
intrinsic.rs | ||
lib.rs | ||
llvm_util.rs | ||
machine.rs | ||
metadata.rs | ||
meth.rs | ||
partitioning.rs | ||
README.md | ||
symbol_names_test.rs | ||
time_graph.rs | ||
trans_item.rs | ||
tvec.rs | ||
type_.rs | ||
type_of.rs | ||
value.rs |
NB: This crate is part of the Rust compiler. For an overview of the
compiler as a whole, see
the README.md file found in librustc
.
The trans
crate contains the code to convert from MIR into LLVM IR,
and then from LLVM IR into machine code. In general it contains code
that runs towards the end of the compilation process.