@@ -22,7 +22,6 @@ use machine;
22
22
use type_of;
23
23
24
24
use syntax_pos:: DUMMY_SP ;
25
- use syntax:: parse:: token:: keywords;
26
25
27
26
use std:: ops:: Deref ;
28
27
use std:: rc:: Rc ;
@@ -301,7 +300,6 @@ fn arg_local_refs<'bcx, 'tcx>(bcx: &BlockAndBuilder<'bcx, 'tcx>,
301
300
_ => bug ! ( "spread argument isn't a tuple?!" )
302
301
} ;
303
302
304
- let lltuplety = type_of:: type_of ( bcx. ccx ( ) , arg_ty) ;
305
303
let lltemp = bcx. with_block ( |bcx| {
306
304
base:: alloc_ty ( bcx, arg_ty, & format ! ( "arg{}" , arg_index) )
307
305
} ) ;
@@ -319,27 +317,20 @@ fn arg_local_refs<'bcx, 'tcx>(bcx: &BlockAndBuilder<'bcx, 'tcx>,
319
317
} else {
320
318
arg. store_fn_arg ( bcx, & mut llarg_idx, dst) ;
321
319
}
322
-
323
- bcx. with_block ( |bcx| arg_scope. map ( |scope| {
324
- let byte_offset_of_var_in_tuple =
325
- machine:: llelement_offset ( bcx. ccx ( ) , lltuplety, i) ;
326
-
327
- let ops = unsafe {
328
- [ llvm:: LLVMRustDIBuilderCreateOpDeref ( ) ,
329
- llvm:: LLVMRustDIBuilderCreateOpPlus ( ) ,
330
- byte_offset_of_var_in_tuple as i64 ]
331
- } ;
332
-
333
- let variable_access = VariableAccess :: IndirectVariable {
334
- alloca : lltemp,
335
- address_operations : & ops
336
- } ;
337
- declare_local ( bcx, keywords:: Invalid . name ( ) ,
338
- tupled_arg_ty, scope, variable_access,
339
- VariableKind :: ArgumentVariable ( arg_index + i + 1 ) ,
340
- bcx. fcx ( ) . span . unwrap_or ( DUMMY_SP ) ) ;
341
- } ) ) ;
342
320
}
321
+
322
+ // Now that we have one alloca that contains the aggregate value,
323
+ // we can create one debuginfo entry for the argument.
324
+ bcx. with_block ( |bcx| arg_scope. map ( |scope| {
325
+ let variable_access = VariableAccess :: DirectVariable {
326
+ alloca : lltemp
327
+ } ;
328
+ declare_local ( bcx, arg_decl. debug_name ,
329
+ arg_ty, scope, variable_access,
330
+ VariableKind :: ArgumentVariable ( arg_index + 1 ) ,
331
+ bcx. fcx ( ) . span . unwrap_or ( DUMMY_SP ) ) ;
332
+ } ) ) ;
333
+
343
334
return LocalRef :: Lvalue ( LvalueRef :: new_sized ( lltemp, LvalueTy :: from_ty ( arg_ty) ) ) ;
344
335
}
345
336
0 commit comments