about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMichael Woerister <michaelwoerister@gmail>2013-09-03 11:53:06 +0200
committerMichael Woerister <michaelwoerister@gmail>2013-09-04 18:38:46 +0200
commit6b2df76c244d1cd282dd724135c4bdcb6e28eb52 (patch)
tree766aa7b12503b199548729f6277259a0208ad88a /src
parentc19f493129e45e1f23aaf67900d092fcc2a81ff3 (diff)
downloadrust-6b2df76c244d1cd282dd724135c4bdcb6e28eb52.tar.gz
rust-6b2df76c244d1cd282dd724135c4bdcb6e28eb52.zip
debuginfo: Always copy args to allocas if debuginfo is enabled
Diffstat (limited to 'src')
-rw-r--r--src/librustc/middle/trans/_match.rs22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/librustc/middle/trans/_match.rs b/src/librustc/middle/trans/_match.rs
index ad0ab95ebf0..bc4cc2ce0e1 100644
--- a/src/librustc/middle/trans/_match.rs
+++ b/src/librustc/middle/trans/_match.rs
@@ -2000,19 +2000,17 @@ pub fn store_arg(mut bcx: @mut Block,
     let arg_ty = node_id_type(bcx, pat.id);
     add_clean(bcx, llval, arg_ty);
 
-    match simple_identifier(pat) {
-        Some(_) => {
-            // Optimized path for `x: T` case. This just adopts
-            // `llval` wholesale as the pointer for `x`, avoiding the
-            // general logic which may copy out of `llval`.
-            bcx.fcx.llargs.insert(pat.id, llval);
-        }
+    let fast_path = !bcx.ccx().sess.opts.extra_debuginfo && simple_identifier(pat).is_some();
 
-        None => {
-            // General path. Copy out the values that are used in the
-            // pattern.
-            bcx = bind_irrefutable_pat(bcx, pat, llval, BindArgument);
-        }
+    if fast_path {
+        // Optimized path for `x: T` case. This just adopts
+        // `llval` wholesale as the pointer for `x`, avoiding the
+        // general logic which may copy out of `llval`.
+        bcx.fcx.llargs.insert(pat.id, llval);
+    } else {
+        // General path. Copy out the values that are used in the
+        // pattern.
+        bcx = bind_irrefutable_pat(bcx, pat, llval, BindArgument);
     }
 
     return bcx;