rustc: Allow non-type-parametric resources to be logged
This commit is contained in:
@@ -111,11 +111,11 @@ print::walk_struct(bool align, const uint8_t *end_sp) {
|
|||||||
|
|
||||||
void
|
void
|
||||||
print::walk_res(bool align, const rust_fn *dtor, uint16_t n_ty_params,
|
print::walk_res(bool align, const rust_fn *dtor, uint16_t n_ty_params,
|
||||||
const uint8_t *ty_params_sp) {
|
const uint8_t *ty_params_sp, const uint8_t *end_sp) {
|
||||||
DPRINT("res@%p", dtor);
|
DPRINT("res@%p", dtor);
|
||||||
if (!n_ty_params)
|
|
||||||
return;
|
|
||||||
|
|
||||||
|
// Print type parameters.
|
||||||
|
if (n_ty_params) {
|
||||||
DPRINT("<");
|
DPRINT("<");
|
||||||
|
|
||||||
bool first = true;
|
bool first = true;
|
||||||
@@ -128,6 +128,25 @@ print::walk_res(bool align, const rust_fn *dtor, uint16_t n_ty_params,
|
|||||||
}
|
}
|
||||||
|
|
||||||
DPRINT(">");
|
DPRINT(">");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Print arguments.
|
||||||
|
|
||||||
|
if (sp == end_sp)
|
||||||
|
return;
|
||||||
|
|
||||||
|
DPRINT("(");
|
||||||
|
|
||||||
|
bool first = true;
|
||||||
|
while (sp != end_sp) {
|
||||||
|
if (!first)
|
||||||
|
DPRINT(",");
|
||||||
|
first = false;
|
||||||
|
|
||||||
|
walk(align);
|
||||||
|
}
|
||||||
|
|
||||||
|
DPRINT(")");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -328,7 +347,8 @@ public:
|
|||||||
const data_pair<uint32_t> &tag_variants);
|
const data_pair<uint32_t> &tag_variants);
|
||||||
void walk_struct(bool align, const uint8_t *end_sp);
|
void walk_struct(bool align, const uint8_t *end_sp);
|
||||||
void walk_res(bool align, const rust_fn *dtor, uint16_t n_ty_params,
|
void walk_res(bool align, const rust_fn *dtor, uint16_t n_ty_params,
|
||||||
const uint8_t *ty_params_sp);
|
const uint8_t *ty_params_sp, const uint8_t *end_sp,
|
||||||
|
const data_pair<uintptr_t> &live);
|
||||||
void walk_variant(bool align, tag_info &tinfo, uint32_t variant_id,
|
void walk_variant(bool align, tag_info &tinfo, uint32_t variant_id,
|
||||||
const std::pair<const uint8_t *,const uint8_t *>
|
const std::pair<const uint8_t *,const uint8_t *>
|
||||||
variant_ptr_and_end);
|
variant_ptr_and_end);
|
||||||
@@ -380,7 +400,8 @@ cmp::walk_struct(bool align, const uint8_t *end_sp) {
|
|||||||
|
|
||||||
void
|
void
|
||||||
cmp::walk_res(bool align, const rust_fn *dtor, uint16_t n_ty_params,
|
cmp::walk_res(bool align, const rust_fn *dtor, uint16_t n_ty_params,
|
||||||
const uint8_t *ty_params_sp) {
|
const uint8_t *ty_params_sp, const uint8_t *end_sp,
|
||||||
|
const data_pair<uintptr_t> &live) {
|
||||||
abort(); // TODO
|
abort(); // TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -480,6 +501,28 @@ log::walk_variant(bool align, tag_info &tinfo, uint32_t variant_id,
|
|||||||
out << ")";
|
out << ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
log::walk_res(bool align, const rust_fn *dtor, uint16_t n_ty_params,
|
||||||
|
const uint8_t *ty_params_sp, const uint8_t *end_sp,
|
||||||
|
bool live) {
|
||||||
|
out << "res";
|
||||||
|
|
||||||
|
if (this->sp == end_sp)
|
||||||
|
return;
|
||||||
|
|
||||||
|
out << "(";
|
||||||
|
|
||||||
|
bool first = true;
|
||||||
|
while (sp != end_sp) {
|
||||||
|
if (!first)
|
||||||
|
out << ", ";
|
||||||
|
walk(align);
|
||||||
|
align = true, first = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
out << ")";
|
||||||
|
}
|
||||||
|
|
||||||
} // end namespace shape
|
} // end namespace shape
|
||||||
|
|
||||||
extern "C" void
|
extern "C" void
|
||||||
|
|||||||
@@ -453,7 +453,8 @@ ctxt<T>::walk_res(bool align) {
|
|||||||
uint16_t sp_size = get_u16_bump(sp);
|
uint16_t sp_size = get_u16_bump(sp);
|
||||||
const uint8_t *end_sp = sp + sp_size;
|
const uint8_t *end_sp = sp + sp_size;
|
||||||
|
|
||||||
static_cast<T *>(this)->walk_res(align, dtor, n_ty_params, ty_params_sp);
|
static_cast<T *>(this)->walk_res(align, dtor, n_ty_params, ty_params_sp,
|
||||||
|
end_sp);
|
||||||
|
|
||||||
sp = end_sp;
|
sp = end_sp;
|
||||||
}
|
}
|
||||||
@@ -479,7 +480,7 @@ public:
|
|||||||
void walk_tag(bool align, tag_info &tinfo);
|
void walk_tag(bool align, tag_info &tinfo);
|
||||||
void walk_struct(bool align, const uint8_t *end_sp);
|
void walk_struct(bool align, const uint8_t *end_sp);
|
||||||
void walk_res(bool align, const rust_fn *dtor, uint16_t n_ty_params,
|
void walk_res(bool align, const rust_fn *dtor, uint16_t n_ty_params,
|
||||||
const uint8_t *ty_params_sp);
|
const uint8_t *ty_params_sp, const uint8_t *end_sp);
|
||||||
void walk_var(bool align, uint8_t param);
|
void walk_var(bool align, uint8_t param);
|
||||||
|
|
||||||
void walk_evec(bool align, bool is_pod, uint16_t sp_size) {
|
void walk_evec(bool align, bool is_pod, uint16_t sp_size) {
|
||||||
@@ -559,7 +560,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void walk_res(bool align, const rust_fn *dtor, uint16_t n_ty_params,
|
void walk_res(bool align, const rust_fn *dtor, uint16_t n_ty_params,
|
||||||
const uint8_t *ty_params_sp) {
|
const uint8_t *ty_params_sp, const uint8_t *end_sp) {
|
||||||
abort(); // TODO
|
abort(); // TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -788,10 +789,11 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void walk_res(bool align, const rust_fn *dtor, uint16_t n_ty_params,
|
void walk_res(bool align, const rust_fn *dtor, uint16_t n_ty_params,
|
||||||
const uint8_t *ty_params_sp) {
|
const uint8_t *ty_params_sp, const uint8_t *end_sp) {
|
||||||
|
typename U::template data<uintptr_t>::t live = bump_dp<uintptr_t>(dp);
|
||||||
// Delegate to the implementation.
|
// Delegate to the implementation.
|
||||||
static_cast<T *>(this)->walk_res(align, dtor, n_ty_params,
|
static_cast<T *>(this)->walk_res(align, dtor, n_ty_params,
|
||||||
ty_params_sp);
|
ty_params_sp, end_sp, live);
|
||||||
}
|
}
|
||||||
|
|
||||||
void walk_var(bool align, uint8_t param_index) {
|
void walk_var(bool align, uint8_t param_index) {
|
||||||
@@ -957,8 +959,6 @@ private:
|
|||||||
: data<log,ptr>(other.task, other.sp, other.params, other.tables, in_dp),
|
: data<log,ptr>(other.task, other.sp, other.params, other.tables, in_dp),
|
||||||
out(other.out) {}
|
out(other.out) {}
|
||||||
|
|
||||||
void walk_string(const std::pair<ptr,ptr> &data);
|
|
||||||
|
|
||||||
void walk_evec(bool align, bool is_pod, uint16_t sp_size) {
|
void walk_evec(bool align, bool is_pod, uint16_t sp_size) {
|
||||||
walk_vec(align, is_pod, get_evec_data_range(dp));
|
walk_vec(align, is_pod, get_evec_data_range(dp));
|
||||||
}
|
}
|
||||||
@@ -991,11 +991,6 @@ private:
|
|||||||
void walk_chan(bool align) { out << "chan"; }
|
void walk_chan(bool align) { out << "chan"; }
|
||||||
void walk_task(bool align) { out << "task"; }
|
void walk_task(bool align) { out << "task"; }
|
||||||
|
|
||||||
void walk_res(bool align, const rust_fn *dtor, uint16_t n_ty_params,
|
|
||||||
const uint8_t *ty_params_sp) {
|
|
||||||
out << "res"; // TODO
|
|
||||||
}
|
|
||||||
|
|
||||||
void walk_subcontext(bool align, log &sub) { sub.walk(align); }
|
void walk_subcontext(bool align, log &sub) { sub.walk(align); }
|
||||||
|
|
||||||
void walk_box_contents(bool align, log &sub, ptr &ref_count_dp) {
|
void walk_box_contents(bool align, log &sub, ptr &ref_count_dp) {
|
||||||
@@ -1010,6 +1005,10 @@ private:
|
|||||||
void walk_variant(bool align, tag_info &tinfo, uint32_t variant_id,
|
void walk_variant(bool align, tag_info &tinfo, uint32_t variant_id,
|
||||||
const std::pair<const uint8_t *,const uint8_t *>
|
const std::pair<const uint8_t *,const uint8_t *>
|
||||||
variant_ptr_and_end);
|
variant_ptr_and_end);
|
||||||
|
void walk_string(const std::pair<ptr,ptr> &data);
|
||||||
|
void walk_res(bool align, const rust_fn *dtor, uint16_t n_ty_params,
|
||||||
|
const uint8_t *ty_params_sp, const uint8_t *end_sp,
|
||||||
|
bool live);
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
void walk_number() { out << get_dp<T>(dp); }
|
void walk_number() { out << get_dp<T>(dp); }
|
||||||
|
|||||||
Reference in New Issue
Block a user