@@ -371,7 +371,6 @@ fn arg_local_refs<'bcx, 'tcx>(bcx: &BlockAndBuilder<'bcx, 'tcx>,
371
371
_ => bug ! ( "spread argument isn't a tuple?!" )
372
372
} ;
373
373
374
- let lltuplety = type_of:: type_of ( bcx. ccx ( ) , arg_ty) ;
375
374
let lltemp = bcx. with_block ( |bcx| {
376
375
base:: alloc_ty ( bcx, arg_ty, & format ! ( "arg{}" , arg_index) )
377
376
} ) ;
@@ -391,27 +390,20 @@ fn arg_local_refs<'bcx, 'tcx>(bcx: &BlockAndBuilder<'bcx, 'tcx>,
391
390
} else {
392
391
arg. store_fn_arg ( bcx, & mut llarg_idx, dst) ;
393
392
}
394
-
395
- bcx. with_block ( |bcx| arg_scope. map ( |scope| {
396
- let byte_offset_of_var_in_tuple =
397
- machine:: llelement_offset ( bcx. ccx ( ) , lltuplety, i) ;
398
-
399
- let ops = unsafe {
400
- [ llvm:: LLVMRustDIBuilderCreateOpDeref ( ) ,
401
- llvm:: LLVMRustDIBuilderCreateOpPlus ( ) ,
402
- byte_offset_of_var_in_tuple as i64 ]
403
- } ;
404
-
405
- let variable_access = VariableAccess :: IndirectVariable {
406
- alloca : lltemp,
407
- address_operations : & ops
408
- } ;
409
- declare_local ( bcx, keywords:: Invalid . name ( ) ,
410
- tupled_arg_ty, scope, variable_access,
411
- VariableKind :: ArgumentVariable ( arg_index + i + 1 ) ,
412
- bcx. fcx ( ) . span . unwrap_or ( DUMMY_SP ) ) ;
413
- } ) ) ;
414
393
}
394
+
395
+ // Now that we have one alloca that contains the aggregate value,
396
+ // we can create one debuginfo entry for the argument.
397
+ bcx. with_block ( |bcx| arg_scope. map ( |scope| {
398
+ let variable_access = VariableAccess :: DirectVariable {
399
+ alloca : lltemp
400
+ } ;
401
+ declare_local ( bcx, arg_decl. name . unwrap_or ( keywords:: Invalid . name ( ) ) ,
402
+ arg_ty, scope, variable_access,
403
+ VariableKind :: ArgumentVariable ( arg_index + 1 ) ,
404
+ bcx. fcx ( ) . span . unwrap_or ( DUMMY_SP ) ) ;
405
+ } ) ) ;
406
+
415
407
return LocalRef :: Lvalue ( LvalueRef :: new_sized ( lltemp, LvalueTy :: from_ty ( arg_ty) ) ) ;
416
408
}
417
409
0 commit comments