debug instrumentation (can remove)
This commit is contained in:
parent
965b0bfefe
commit
cec7280bf3
5 changed files with 31 additions and 3 deletions
|
@ -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 lvalue = Lvalue::new_with_hint(caller_name, bcx, p_id, HintKind::DontZeroJustUse);
|
||||||
let datum = Datum::new(llval, var_ty, lvalue);
|
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*
|
// Subtle: be sure that we *populate* the memory *before*
|
||||||
// we schedule the cleanup.
|
// we schedule the cleanup.
|
||||||
call_lifetime_start(bcx, llval);
|
call_lifetime_start(bcx, llval);
|
||||||
|
|
|
@ -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(
|
let scratch = unpack_datum!(bcx, datum::lvalue_scratch_datum(
|
||||||
bcx, tcx.dtor_type(), "drop_flag",
|
bcx, tcx.dtor_type(), "drop_flag",
|
||||||
InitAlloca::Uninit("drop flag itself has no dtor"),
|
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| {
|
bcx = fold_variants(bcx, r, val, |variant_cx, st, value| {
|
||||||
let ptr = struct_field_ptr(variant_cx, st, MaybeSizedValue::sized(value),
|
let ptr = struct_field_ptr(variant_cx, st, MaybeSizedValue::sized(value),
|
||||||
|
|
|
@ -1689,6 +1689,8 @@ pub fn create_datums_for_fn_args<'a, 'tcx>(mut bcx: Block<'a, 'tcx>,
|
||||||
let fcx = bcx.fcx;
|
let fcx = bcx.fcx;
|
||||||
let arg_scope_id = cleanup::CustomScope(arg_scope);
|
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
|
// Return an array wrapping the ValueRefs that we get from `get_param` for
|
||||||
// each argument into datums.
|
// 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,
|
unpack_datum!(bcx, datum::lvalue_scratch_datum(bcx, arg_ty, "", uninit_reason,
|
||||||
arg_scope_id, (data, extra),
|
arg_scope_id, (data, extra),
|
||||||
|(data, extra), bcx, dst| {
|
|(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, data, expr::get_dataptr(bcx, dst));
|
||||||
Store(bcx, extra, expr::get_meta(bcx, dst));
|
Store(bcx, extra, expr::get_meta(bcx, dst));
|
||||||
bcx
|
bcx
|
||||||
|
@ -1738,7 +1743,13 @@ pub fn create_datums_for_fn_args<'a, 'tcx>(mut bcx: Block<'a, 'tcx>,
|
||||||
uninit_reason,
|
uninit_reason,
|
||||||
arg_scope_id,
|
arg_scope_id,
|
||||||
tmp,
|
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 {
|
} else {
|
||||||
// FIXME(pcwalton): Reduce the amount of code bloat this is responsible for.
|
// 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,
|
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
|
for (j, &tupled_arg_ty) in
|
||||||
tupled_arg_tys.iter().enumerate() {
|
tupled_arg_tys.iter().enumerate() {
|
||||||
let lldest = StructGEP(bcx, llval, j);
|
let lldest = StructGEP(bcx, llval, j);
|
||||||
|
|
|
@ -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.
|
// Very subtle: potentially initialize the scratch memory at point where it is alloca'ed.
|
||||||
// (See discussion at Issue 30530.)
|
// (See discussion at Issue 30530.)
|
||||||
let scratch = alloc_ty_init(bcx, ty, zero, name);
|
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.
|
// Subtle. Populate the scratch memory *before* scheduling cleanup.
|
||||||
let bcx = populate(arg, bcx, scratch);
|
let bcx = populate(arg, bcx, scratch);
|
||||||
|
@ -349,6 +351,8 @@ fn add_rvalue_clean<'a, 'tcx>(mode: RvalueMode,
|
||||||
scope: cleanup::ScopeId,
|
scope: cleanup::ScopeId,
|
||||||
val: ValueRef,
|
val: ValueRef,
|
||||||
ty: Ty<'tcx>) {
|
ty: Ty<'tcx>) {
|
||||||
|
debug!("add_rvalue_clean scope={:?} val={} ty={:?}",
|
||||||
|
scope, fcx.ccx.tn().val_to_string(val), ty);
|
||||||
match mode {
|
match mode {
|
||||||
ByValue => { fcx.schedule_drop_immediate(scope, val, ty); }
|
ByValue => { fcx.schedule_drop_immediate(scope, val, ty); }
|
||||||
ByRef => {
|
ByRef => {
|
||||||
|
@ -507,6 +511,8 @@ impl<'tcx> Datum<'tcx, Rvalue> {
|
||||||
lvalue_scratch_datum(
|
lvalue_scratch_datum(
|
||||||
bcx, self.ty, name, InitAlloca::Dropped, scope, self,
|
bcx, self.ty, name, InitAlloca::Dropped, scope, self,
|
||||||
|this, bcx, llval| {
|
|this, bcx, llval| {
|
||||||
|
debug!("populate call for Datum::to_lvalue_datum_in_scope \
|
||||||
|
self.ty={:?}", this.ty);
|
||||||
call_lifetime_start(bcx, llval);
|
call_lifetime_start(bcx, llval);
|
||||||
let bcx = this.store_to(bcx, llval);
|
let bcx = this.store_to(bcx, llval);
|
||||||
bcx.fcx.schedule_lifetime_end(scope, llval);
|
bcx.fcx.schedule_lifetime_end(scope, llval);
|
||||||
|
|
|
@ -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
|
// This scope holds intermediates that must be cleaned should
|
||||||
// panic occur before the ADT as a whole is ready.
|
// panic occur before the ADT as a whole is ready.
|
||||||
let custom_cleanup_scope = fcx.push_custom_cleanup_scope();
|
let custom_cleanup_scope = fcx.push_custom_cleanup_scope();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue