[LIB]: Introduce conf_fprintf.suppress_comments

pahole will use it in the --quiet mode.

Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
This commit is contained in:
Arnaldo Carvalho de Melo 2007-06-22 16:51:31 -03:00
parent 949e8c4f14
commit 0b3969bdb4
2 changed files with 7 additions and 5 deletions

View File

@ -2200,7 +2200,7 @@ size_t class__fprintf(struct class *self, const struct cu *cu,
}
pos = tag__class_member(tag_pos);
if ((int)pos->offset != last_offset)
if ((int)pos->offset != last_offset && !cconf.suppress_comments)
printed +=
class__fprintf_cacheline_boundary(last_cacheline,
sum, sum_holes,
@ -2213,7 +2213,8 @@ size_t class__fprintf(struct class *self, const struct cu *cu,
* DW_TAG_inheritance, have to understand why virtual public
* ancestors make the offset go backwards...
*/
if (last_offset != -1 && tag_pos->tag == DW_TAG_member) {
if (!cconf.suppress_comments &&
last_offset != -1 && tag_pos->tag == DW_TAG_member) {
const ssize_t cc_last_size = pos->offset - last_offset;
if ((int)pos->offset < last_offset) {
@ -2281,7 +2282,7 @@ size_t class__fprintf(struct class *self, const struct cu *cu,
printed += fprintf(fp, "%.*s", cconf.indent, tabs);
printed += struct_member__fprintf(pos, type, cu, &cconf, fp);
if (tag__is_struct(type)) {
if (tag__is_struct(type) && !cconf.suppress_comments) {
const uint16_t padding = tag__class(type)->padding;
if (padding > 0) {
++nr_paddings;
@ -2299,7 +2300,7 @@ size_t class__fprintf(struct class *self, const struct cu *cu,
}
}
if (pos->bit_hole != 0) {
if (pos->bit_hole != 0 && !cconf.suppress_comments) {
if (!newline++) {
fputc('\n', fp);
++printed;
@ -2311,7 +2312,7 @@ size_t class__fprintf(struct class *self, const struct cu *cu,
sum_bit_holes += pos->bit_hole;
}
if (pos->hole > 0) {
if (pos->hole > 0 && !cconf.suppress_comments) {
if (!newline++) {
fputc('\n', fp);
++printed;

View File

@ -412,6 +412,7 @@ struct conf_fprintf {
uint8_t expand_types:1;
uint8_t rel_offset:1;
uint8_t emit_stats:1;
uint8_t suppress_comments:1;
uint8_t show_decl_info:1;
uint8_t show_only_data_members:1;
uint8_t no_semicolon:1;