Skip to content

Commit a0d40bb

Browse files
committed
---
yaml --- r: 5072 b: refs/heads/master c: dc6f785 h: refs/heads/master v: v3
1 parent 93a88ab commit a0d40bb

File tree

3 files changed

+25
-17
lines changed

3 files changed

+25
-17
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: dfcbfa61f3cbc331f4ab0ecf7fdd71b5faea773a
2+
refs/heads/master: dc6f78561c238c472a6bab50eea36f4b3a39671d

trunk/src/rt/rust_shape.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ cmp::walk_variant(tag_info &tinfo, uint32_t variant_id,
426426

427427
void
428428
log::walk_string(const std::pair<ptr,ptr> &data) {
429-
out << "\"" << std::hex;
429+
out << prefix << "\"" << std::hex;
430430

431431
ptr subdp = data.first;
432432
while (subdp < data.second) {
@@ -443,7 +443,7 @@ log::walk_string(const std::pair<ptr,ptr> &data) {
443443

444444
void
445445
log::walk_struct(const uint8_t *end_sp) {
446-
out << "(";
446+
out << prefix << "(";
447447

448448
bool first = true;
449449
while (sp != end_sp) {
@@ -464,16 +464,15 @@ log::walk_vec(bool is_pod, const std::pair<ptr,ptr> &data) {
464464
return;
465465
}
466466

467-
out << "[";
467+
out << prefix << "[";
468468

469469
log sub(*this, data.first);
470470
sub.end_dp = data.second;
471471

472-
bool first = true;
473472
while (sub.dp < data.second) {
474-
if (!first) out << ", ";
475473
sub.walk_reset();
476-
sub.align = true, first = false;
474+
sub.align = true;
475+
sub.prefix = ", ";
477476
}
478477

479478
out << "]";
@@ -500,7 +499,7 @@ log::walk_variant(tag_info &tinfo, uint32_t variant_id,
500499
void
501500
log::walk_res(const rust_fn *dtor, unsigned n_params,
502501
const type_param *params, const uint8_t *end_sp, bool live) {
503-
out << "res";
502+
out << prefix << "res";
504503

505504
if (this->sp == end_sp)
506505
return;

trunk/src/rt/rust_shape.h

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -974,6 +974,7 @@ class log : public data<log,ptr> {
974974

975975
private:
976976
std::ostream &out;
977+
const char *prefix;
977978
bool in_string;
978979

979980
log(log &other,
@@ -986,7 +987,8 @@ class log : public data<log,ptr> {
986987
in_params,
987988
in_tables ? in_tables : other.tables,
988989
other.dp),
989-
out(other.out) {}
990+
out(other.out),
991+
prefix("") {}
990992

991993
log(log &other,
992994
const uint8_t *in_sp,
@@ -999,7 +1001,8 @@ class log : public data<log,ptr> {
9991001
in_params,
10001002
in_tables,
10011003
in_dp),
1002-
out(other.out) {}
1004+
out(other.out),
1005+
prefix("") {}
10031006

10041007
log(log &other, ptr in_dp)
10051008
: data<log,ptr>(other.task,
@@ -1008,7 +1011,8 @@ class log : public data<log,ptr> {
10081011
other.params,
10091012
other.tables,
10101013
in_dp),
1011-
out(other.out) {}
1014+
out(other.out),
1015+
prefix("") {}
10121016

10131017
void walk_evec(bool is_pod, uint16_t sp_size) {
10141018
walk_vec(is_pod, get_evec_data_range(dp));
@@ -1019,28 +1023,29 @@ class log : public data<log,ptr> {
10191023
}
10201024

10211025
void walk_tag(tag_info &tinfo, uint32_t tag_variant) {
1022-
out << "tag" << tag_variant;
1026+
out << prefix << "tag" << tag_variant;
10231027
data<log,ptr>::walk_variant(tinfo, tag_variant);
10241028
}
10251029

10261030
void walk_box() {
1027-
out << "@";
1031+
out << prefix << "@";
10281032
data<log,ptr>::walk_box_contents();
10291033
}
10301034

10311035
void walk_fn() {
1032-
out << "fn";
1036+
out << prefix << "fn";
10331037
data<log,ptr>::walk_fn_contents(dp);
10341038
}
10351039

10361040
void walk_obj() {
1037-
out << "obj";
1041+
out << prefix << "obj";
10381042
data<log,ptr>::walk_obj_contents(dp);
10391043
}
10401044

10411045
void walk_subcontext(log &sub) { sub.walk(); }
10421046

10431047
void walk_box_contents(log &sub, ptr &ref_count_dp) {
1048+
out << prefix;
10441049
if (!ref_count_dp) {
10451050
out << "(null)";
10461051
} else {
@@ -1059,7 +1064,10 @@ class log : public data<log,ptr> {
10591064
const type_param *params, const uint8_t *end_sp, bool live);
10601065

10611066
template<typename T>
1062-
inline void walk_number() { fmt_number(out, get_dp<T>(dp)); }
1067+
inline void walk_number() {
1068+
out << prefix;
1069+
fmt_number(out, get_dp<T>(dp));
1070+
}
10631071

10641072
public:
10651073
log(rust_task *in_task,
@@ -1070,7 +1078,8 @@ class log : public data<log,ptr> {
10701078
uint8_t *in_data,
10711079
std::ostream &in_out)
10721080
: data<log,ptr>(in_task, in_align, in_sp, in_params, in_tables, in_data),
1073-
out(in_out) {}
1081+
out(in_out),
1082+
prefix("") {}
10741083
};
10751084

10761085
} // end namespace shape

0 commit comments

Comments
 (0)