about summary refs log tree commit diff
path: root/src/test/codegen/align-struct.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-10-26 14:14:15 +0000
committerbors <bors@rust-lang.org>2017-10-26 14:14:15 +0000
commitb0b80f8c2299cccd7a4f22ee3cc1a2ca823eaa31 (patch)
tree011c1b2fa731579f0a7079e3415f1e08d35c06bf /src/test/codegen/align-struct.rs
parente0febe71449008fd35ccc762b0a42d106aa8e4f7 (diff)
parent8ad7c284d793250edffe0e85f6cc898585496283 (diff)
downloadrust-b0b80f8c2299cccd7a4f22ee3cc1a2ca823eaa31.tar.gz
rust-b0b80f8c2299cccd7a4f22ee3cc1a2ca823eaa31.zip
Auto merge of #45380 - dotdash:arg_copies, r=arielb1
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/codegen/align-struct.rs')
-rw-r--r--src/test/codegen/align-struct.rs2
1 files changed, 0 insertions, 2 deletions
diff --git a/src/test/codegen/align-struct.rs b/src/test/codegen/align-struct.rs
index d4828be037a..ba81e2d6046 100644
--- a/src/test/codegen/align-struct.rs
+++ b/src/test/codegen/align-struct.rs
@@ -42,7 +42,6 @@ pub fn align64(i : i32) -> Align64 {
 #[no_mangle]
 pub fn nested64(a: Align64, b: i32, c: i32, d: i8) -> Nested64 {
 // CHECK: %n64 = alloca %Nested64, align 64
-// CHECK: %a = alloca %Align64, align 64
     let n64 = Nested64 { a, b, c, d };
     n64
 }
@@ -51,7 +50,6 @@ pub fn nested64(a: Align64, b: i32, c: i32, d: i8) -> Nested64 {
 #[no_mangle]
 pub fn enum64(a: Align64) -> Enum64 {
 // CHECK: %e64 = alloca %Enum64, align 64
-// CHECK: %a = alloca %Align64, align 64
     let e64 = Enum64::A(a);
     e64
 }