File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
src/librustc/middle/trans Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -220,6 +220,7 @@ use util::common::indenter;
220
220
use util:: ppaux:: { Repr , vec_map_to_str} ;
221
221
222
222
use std:: hashmap:: HashMap ;
223
+ use std:: ptr;
223
224
use std:: vec;
224
225
use syntax:: ast;
225
226
use syntax:: ast:: Ident ;
@@ -2046,7 +2047,10 @@ pub fn store_arg(mut bcx: @mut Block,
2046
2047
// Debug information (the llvm.dbg.declare intrinsic to be precise) always expects to get an
2047
2048
// alloca, which only is the case on the general path, so lets disable the optimized path when
2048
2049
// debug info is enabled.
2049
- let fast_path = !bcx. ccx ( ) . sess . opts . extra_debuginfo && simple_identifier ( pat) . is_some ( ) ;
2050
+ let arg_is_alloca = unsafe { llvm:: LLVMIsAAllocaInst ( llval) != ptr:: null ( ) } ;
2051
+
2052
+ let fast_path = ( arg_is_alloca || !bcx. ccx ( ) . sess . opts . extra_debuginfo )
2053
+ && simple_identifier ( pat) . is_some ( ) ;
2050
2054
2051
2055
if fast_path {
2052
2056
// Optimized path for `x: T` case. This just adopts
You can’t perform that action at this time.
0 commit comments