File tree Expand file tree Collapse file tree 1 file changed +10
-12
lines changed
src/librustc/middle/trans Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -2000,19 +2000,17 @@ pub fn store_arg(mut bcx: @mut Block,
2000
2000
let arg_ty = node_id_type ( bcx, pat. id ) ;
2001
2001
add_clean ( bcx, llval, arg_ty) ;
2002
2002
2003
- match simple_identifier ( pat) {
2004
- Some ( _) => {
2005
- // Optimized path for `x: T` case. This just adopts
2006
- // `llval` wholesale as the pointer for `x`, avoiding the
2007
- // general logic which may copy out of `llval`.
2008
- bcx. fcx . llargs . insert ( pat. id , llval) ;
2009
- }
2003
+ let fast_path = !bcx. ccx ( ) . sess . opts . extra_debuginfo && simple_identifier ( pat) . is_some ( ) ;
2010
2004
2011
- None => {
2012
- // General path. Copy out the values that are used in the
2013
- // pattern.
2014
- bcx = bind_irrefutable_pat ( bcx, pat, llval, BindArgument ) ;
2015
- }
2005
+ if fast_path {
2006
+ // Optimized path for `x: T` case. This just adopts
2007
+ // `llval` wholesale as the pointer for `x`, avoiding the
2008
+ // general logic which may copy out of `llval`.
2009
+ bcx. fcx . llargs . insert ( pat. id , llval) ;
2010
+ } else {
2011
+ // General path. Copy out the values that are used in the
2012
+ // pattern.
2013
+ bcx = bind_irrefutable_pat ( bcx, pat, llval, BindArgument ) ;
2016
2014
}
2017
2015
2018
2016
return bcx;
You can’t perform that action at this time.
0 commit comments