diff --git a/src/librustc_trans/trans/_match.rs b/src/librustc_trans/trans/_match.rs index 0ad780fb0e4d..f46a7ea67b5f 100644 --- a/src/librustc_trans/trans/_match.rs +++ b/src/librustc_trans/trans/_match.rs @@ -1760,6 +1760,9 @@ fn mk_binding_alloca<'blk, 'tcx, A, F>(bcx: Block<'blk, 'tcx>, let lvalue = Lvalue::new_with_hint(caller_name, bcx, p_id, HintKind::DontZeroJustUse); let datum = Datum::new(llval, var_ty, lvalue); + debug!("mk_binding_alloca cleanup_scope={:?} llval={} var_ty={:?}", + cleanup_scope, bcx.ccx().tn().val_to_string(llval), var_ty); + // Subtle: be sure that we *populate* the memory *before* // we schedule the cleanup. call_lifetime_start(bcx, llval); diff --git a/src/librustc_trans/trans/adt.rs b/src/librustc_trans/trans/adt.rs index e152e11a6a65..d22d619b9622 100644 --- a/src/librustc_trans/trans/adt.rs +++ b/src/librustc_trans/trans/adt.rs @@ -1281,7 +1281,11 @@ pub fn trans_drop_flag_ptr<'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>, let scratch = unpack_datum!(bcx, datum::lvalue_scratch_datum( bcx, tcx.dtor_type(), "drop_flag", InitAlloca::Uninit("drop flag itself has no dtor"), - cleanup::CustomScope(custom_cleanup_scope), (), |_, bcx, _| bcx + cleanup::CustomScope(custom_cleanup_scope), (), |_, bcx, _| { + debug!("no-op populate call for trans_drop_flag_ptr on dtor_type={:?}", + tcx.dtor_type()); + bcx + } )); bcx = fold_variants(bcx, r, val, |variant_cx, st, value| { let ptr = struct_field_ptr(variant_cx, st, MaybeSizedValue::sized(value), diff --git a/src/librustc_trans/trans/base.rs b/src/librustc_trans/trans/base.rs index b2bc7c2af933..1e5c60609b0b 100644 --- a/src/librustc_trans/trans/base.rs +++ b/src/librustc_trans/trans/base.rs @@ -1689,6 +1689,8 @@ pub fn create_datums_for_fn_args<'a, 'tcx>(mut bcx: Block<'a, 'tcx>, let fcx = bcx.fcx; let arg_scope_id = cleanup::CustomScope(arg_scope); + debug!("create_datums_for_fn_args"); + // Return an array wrapping the ValueRefs that we get from `get_param` for // each argument into datums. // @@ -1723,6 +1725,9 @@ pub fn create_datums_for_fn_args<'a, 'tcx>(mut bcx: Block<'a, 'tcx>, unpack_datum!(bcx, datum::lvalue_scratch_datum(bcx, arg_ty, "", uninit_reason, arg_scope_id, (data, extra), |(data, extra), bcx, dst| { + debug!("populate call for create_datum_for_fn_args \ + early fat arg, on arg[{}] ty={:?}", i, arg_ty); + Store(bcx, data, expr::get_dataptr(bcx, dst)); Store(bcx, extra, expr::get_meta(bcx, dst)); bcx @@ -1738,7 +1743,13 @@ pub fn create_datums_for_fn_args<'a, 'tcx>(mut bcx: Block<'a, 'tcx>, uninit_reason, arg_scope_id, tmp, - |tmp, bcx, dst| tmp.store_to(bcx, dst))) + |tmp, bcx, dst| { + + debug!("populate call for create_datum_for_fn_args \ + early thin arg, on arg[{}] ty={:?}", i, arg_ty); + + tmp.store_to(bcx, dst) + })) } } else { // FIXME(pcwalton): Reduce the amount of code bloat this is responsible for. @@ -1753,7 +1764,9 @@ pub fn create_datums_for_fn_args<'a, 'tcx>(mut bcx: Block<'a, 'tcx>, (), |(), mut bcx, - llval| { + llval| { + debug!("populate call for create_datum_for_fn_args \ + tupled_args, on arg[{}] ty={:?}", i, arg_ty); for (j, &tupled_arg_ty) in tupled_arg_tys.iter().enumerate() { let lldest = StructGEP(bcx, llval, j); diff --git a/src/librustc_trans/trans/datum.rs b/src/librustc_trans/trans/datum.rs index 339b3f0f920d..6a033602adab 100644 --- a/src/librustc_trans/trans/datum.rs +++ b/src/librustc_trans/trans/datum.rs @@ -311,6 +311,8 @@ pub fn lvalue_scratch_datum<'blk, 'tcx, A, F>(bcx: Block<'blk, 'tcx>, // Very subtle: potentially initialize the scratch memory at point where it is alloca'ed. // (See discussion at Issue 30530.) let scratch = alloc_ty_init(bcx, ty, zero, name); + debug!("lvalue_scratch_datum scope={:?} scratch={} ty={:?}", + scope, bcx.ccx().tn().val_to_string(scratch), ty); // Subtle. Populate the scratch memory *before* scheduling cleanup. let bcx = populate(arg, bcx, scratch); @@ -349,6 +351,8 @@ fn add_rvalue_clean<'a, 'tcx>(mode: RvalueMode, scope: cleanup::ScopeId, val: ValueRef, ty: Ty<'tcx>) { + debug!("add_rvalue_clean scope={:?} val={} ty={:?}", + scope, fcx.ccx.tn().val_to_string(val), ty); match mode { ByValue => { fcx.schedule_drop_immediate(scope, val, ty); } ByRef => { @@ -507,6 +511,8 @@ impl<'tcx> Datum<'tcx, Rvalue> { lvalue_scratch_datum( bcx, self.ty, name, InitAlloca::Dropped, scope, self, |this, bcx, llval| { + debug!("populate call for Datum::to_lvalue_datum_in_scope \ + self.ty={:?}", this.ty); call_lifetime_start(bcx, llval); let bcx = this.store_to(bcx, llval); bcx.fcx.schedule_lifetime_end(scope, llval); diff --git a/src/librustc_trans/trans/expr.rs b/src/librustc_trans/trans/expr.rs index fb6f2190207e..57afd0b580f1 100644 --- a/src/librustc_trans/trans/expr.rs +++ b/src/librustc_trans/trans/expr.rs @@ -1487,6 +1487,8 @@ pub fn trans_adt<'a, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>, } }; + debug!("trans_adt"); + // This scope holds intermediates that must be cleaned should // panic occur before the ADT as a whole is ready. let custom_cleanup_scope = fcx.push_custom_cleanup_scope();