diff options
author | Trevor Saunders <tsaunders@mozilla.com> | 2013-12-28 13:11:32 -0500 |
---|---|---|
committer | Trevor Saunders <tsaunders@mozilla.com> | 2014-02-18 22:44:36 -0500 |
commit | 3abfc55847b8beb6b0828089820e02c5999f3f8b (patch) | |
tree | 759a44b0e4e073439675e6df7afb9ee71b5e6cfe | |
parent | f942f0cc87064c558385fd596ef7078844e66fdd (diff) | |
download | gcc-3abfc55847b8beb6b0828089820e02c5999f3f8b.tar.gz |
fixup bitmap debug printing functions
-rw-r--r-- | gcc/bitmap.c | 35 | ||||
-rw-r--r-- | gcc/bitmap.h | 17 | ||||
-rw-r--r-- | gcc/df-core.c | 2 | ||||
-rw-r--r-- | gcc/dse.c | 14 | ||||
-rw-r--r-- | gcc/ira.c | 4 | ||||
-rw-r--r-- | gcc/tree-into-ssa.c | 10 | ||||
-rw-r--r-- | gcc/tree-loop-distribution.c | 2 | ||||
-rw-r--r-- | gcc/tree-ssa-loop-ivopts.c | 5 | ||||
-rw-r--r-- | gcc/tree-ssa-tail-merge.c | 10 | ||||
-rw-r--r-- | gcc/tree-ssa-ter.c | 4 |
10 files changed, 36 insertions, 67 deletions
diff --git a/gcc/bitmap.c b/gcc/bitmap.c index 542f6b462db..cf148f626a9 100644 --- a/gcc/bitmap.c +++ b/gcc/bitmap.c @@ -2078,15 +2078,15 @@ bitmap_head::hash () const /* Debugging function to print out the contents of a bitmap. */ DEBUG_FUNCTION void -debug_bitmap_file (FILE *file, const_bitmap head) +bitmap_head::debug (FILE *file) const { const bitmap_element *ptr; fprintf (file, "\nfirst = " HOST_PTR_PRINTF " current = " HOST_PTR_PRINTF " indx = %u\n", - (void *) head->first, (void *) head->current, head->indx); + (void *) first, (void *) current, indx); - for (ptr = head->first; ptr; ptr = ptr->next) + for (ptr = first; ptr; ptr = ptr->next) { unsigned int i, j, col = 26; @@ -2114,28 +2114,18 @@ debug_bitmap_file (FILE *file, const_bitmap head) } } -/* Function to be called from the debugger to print the contents - of a bitmap. */ - -DEBUG_FUNCTION void -debug_bitmap (const_bitmap head) -{ - debug_bitmap_file (stdout, head); -} - /* Function to print out the contents of a bitmap. Unlike debug_bitmap_file, it does not print anything but the bits. */ DEBUG_FUNCTION void -bitmap_print (FILE *file, const_bitmap head, const char *prefix, - const char *suffix) +bitmap_head::print (FILE *file, const char *prefix, const char *suffix) const { const char *comma = ""; unsigned i; bitmap_iterator bi; fputs (prefix, file); - EXECUTE_IF_SET_IN_BITMAP (head, 0, i, bi) + EXECUTE_IF_SET_IN_BITMAP (this, 0, i, bi) { fprintf (file, "%s%d", comma, i); comma = ", "; @@ -2209,21 +2199,6 @@ dump_bitmap_statistics (void) fprintf (stderr, "---------------------------------------------------------------------------------\n"); } -DEBUG_FUNCTION void -debug (const bitmap_head &ref) -{ - dump_bitmap (stderr, &ref); -} - -DEBUG_FUNCTION void -debug (const bitmap_head *ptr) -{ - if (ptr) - debug (*ptr); - else - fprintf (stderr, "<nil>\n"); -} - void bitmap_head::swap (bitmap_head *other) { diff --git a/gcc/bitmap.h b/gcc/bitmap.h index 9c3038389e8..8ed61882489 100644 --- a/gcc/bitmap.h +++ b/gcc/bitmap.h @@ -210,6 +210,12 @@ struct GTY(()) bitmap_head { /* Compute bitmap hash (for purposes of hashing etc.) */ hashval_t hash () const; +/* Print a bitmap. */ + void print (FILE * = stderr, const char * = "", const char * = "\n") const; + +/* Debug functions to print a bitmap linked list. */ + void debug (FILE * = stdout) const; + unsigned int indx; /* Index of last element looked at. */ unsigned int descriptor_id; /* Unique identifier for the allocation site of this bitmap, for detailed @@ -275,13 +281,6 @@ extern bool bitmap_set_bit (bitmap, int); /* Return true if a register is set in a register set. */ extern int bitmap_bit_p (bitmap, int); -/* Debug functions to print a bitmap linked list. */ -extern void debug_bitmap (const_bitmap); -extern void debug_bitmap_file (FILE *, const_bitmap); - -/* Print a bitmap. */ -extern void bitmap_print (FILE *, const_bitmap, const char *, const char *); - /* Initialize and release a bitmap obstack. */ extern void bitmap_obstack_initialize (bitmap_obstack *); extern void bitmap_obstack_release (bitmap_obstack *); @@ -311,10 +310,8 @@ extern void bitmap_obstack_free (bitmap); /* A few compatibility/functions macros for compatibility with sbitmaps */ inline void dump_bitmap (FILE *file, const_bitmap map) { - bitmap_print (file, map, "", "\n"); + map->print (file); } -extern void debug (const bitmap_head &ref); -extern void debug (const bitmap_head *ptr); /* Allocate a bitmap from a bit obstack. */ diff --git a/gcc/df-core.c b/gcc/df-core.c index 46049917a65..4df4d06e5eb 100644 --- a/gcc/df-core.c +++ b/gcc/df-core.c @@ -500,7 +500,7 @@ df_set_blocks (bitmap blocks) if (blocks) { if (dump_file) - bitmap_print (dump_file, blocks, "setting blocks to analyze ", "\n"); + blocks->print (dump_file, "setting blocks to analyze ", "\n"); if (df->blocks_to_analyze) { /* This block is called to change the focus from one subset diff --git a/gcc/dse.c b/gcc/dse.c index 5a2ed04443c..266868e3227 100644 --- a/gcc/dse.c +++ b/gcc/dse.c @@ -2896,8 +2896,8 @@ dse_step2_init (void) fprintf (dump_file, "group %d(%d+%d): ", i, (int)group->store2_n->count_bits (), (int)group->store2_p->count_bits ()); - bitmap_print (dump_file, group->store2_n, "n ", " "); - bitmap_print (dump_file, group->store2_p, "p ", "\n"); + group->store2_n->print (dump_file, "n ", " "); + group->store2_p->print (dump_file, "p ", "\n"); } } } @@ -3467,19 +3467,19 @@ dse_step4 (void) df_print_bb_index (bb, dump_file); if (bb_info->in) - bitmap_print (dump_file, bb_info->in, " in: ", "\n"); + bb_info->in->print (dump_file, " in: ", "\n"); else fprintf (dump_file, " in: *MISSING*\n"); if (bb_info->gen) - bitmap_print (dump_file, bb_info->gen, " gen: ", "\n"); + bb_info->gen->print (dump_file, " gen: ", "\n"); else fprintf (dump_file, " gen: *MISSING*\n"); if (bb_info->kill) - bitmap_print (dump_file, bb_info->kill, " kill: ", "\n"); + bb_info->kill->print (dump_file, " kill: ", "\n"); else fprintf (dump_file, " kill: *MISSING*\n"); if (bb_info->out) - bitmap_print (dump_file, bb_info->out, " out: ", "\n"); + bb_info->out->print (dump_file, " out: ", "\n"); else fprintf (dump_file, " out: *MISSING*\n\n"); } @@ -3512,7 +3512,7 @@ dse_step5_nospill (void) { fprintf (dump_file, "starting to process insn %d\n", INSN_UID (insn_info->insn)); - bitmap_print (dump_file, v, " v: ", "\n"); + v->print (dump_file, " v: ", "\n"); } /* There may have been code deleted by the dce pass run before diff --git a/gcc/ira.c b/gcc/ira.c index c9078014dd9..cc4e4814369 100644 --- a/gcc/ira.c +++ b/gcc/ira.c @@ -4047,8 +4047,8 @@ static void print_insn_chain (FILE *file, struct insn_chain *c) { fprintf (file, "insn=%d, ", INSN_UID (c->insn)); - bitmap_print (file, &c->live_throughout, "live_throughout: ", ", "); - bitmap_print (file, &c->dead_or_set, "dead_or_set: ", "\n"); + c->live_throughout.print (file, "live_throughout: ", ", "); + c->dead_or_set.print (file, "dead_or_set: ", "\n"); } diff --git a/gcc/tree-into-ssa.c b/gcc/tree-into-ssa.c index 7f76b66d63e..7c79ccc476f 100644 --- a/gcc/tree-into-ssa.c +++ b/gcc/tree-into-ssa.c @@ -1689,12 +1689,10 @@ debug_var_infos_r (var_info_d **slot, FILE *file) fprintf (file, "VAR: "); print_generic_expr (file, info->var, dump_flags); - bitmap_print (file, info->info.def_blocks.def_blocks, - ", DEF_BLOCKS: { ", "}"); - bitmap_print (file, info->info.def_blocks.livein_blocks, - ", LIVEIN_BLOCKS: { ", "}"); - bitmap_print (file, info->info.def_blocks.phi_blocks, - ", PHI_BLOCKS: { ", "}\n"); + info->info.def_blocks.def_blocks->print (file, ", DEF_BLOCKS: { ", "}"); + info->info.def_blocks.livein_blocks->print (file, ", LIVEIN_BLOCKS: { ", + "}"); + info->info.def_blocks.phi_blocks->print (file, ", PHI_BLOCKS: { ", "}\n"); return 1; } diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c index 4fdbaf9c92f..14748acb31a 100644 --- a/gcc/tree-loop-distribution.c +++ b/gcc/tree-loop-distribution.c @@ -1254,7 +1254,7 @@ dump_rdg_partitions (FILE *file, vec<partition_t> partitions) partition_t partition; FOR_EACH_VEC_ELT (partitions, i, partition) - debug_bitmap_file (file, partition->stmts); + partition->stmts->debug (file); } /* Debug PARTITIONS. */ diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c index 23f9923fb58..e9eddffd552 100644 --- a/gcc/tree-ssa-loop-ivopts.c +++ b/gcc/tree-ssa-loop-ivopts.c @@ -5070,8 +5070,7 @@ determine_use_iv_costs (struct ivopts_data *data) use->cost_map[j].cost.cost, use->cost_map[j].cost.complexity); if (use->cost_map[j].depends_on) - bitmap_print (dump_file, - use->cost_map[j].depends_on, "",""); + use->cost_map[j].depends_on->print (dump_file, "",""); if (use->cost_map[j].inv_expr_id != -1) fprintf (dump_file, " inv_expr:%d", use->cost_map[j].inv_expr_id); fprintf (dump_file, "\n"); @@ -5641,7 +5640,7 @@ iv_ca_dump (struct ivopts_data *data, FILE *file, struct iv_ca *ivs) fprintf (file, " cost: %d (complexity %d)\n", cost.cost, cost.complexity); fprintf (file, " cand_cost: %d\n cand_use_cost: %d (complexity %d)\n", ivs->cand_cost, ivs->cand_use_cost.cost, ivs->cand_use_cost.complexity); - bitmap_print (file, ivs->cands, " candidates: ","\n"); + ivs->cands->print (file, " candidates: ", "\n"); for (i = 0; i < ivs->upto; i++) { diff --git a/gcc/tree-ssa-tail-merge.c b/gcc/tree-ssa-tail-merge.c index 2bd2cf0deb3..770801771f4 100644 --- a/gcc/tree-ssa-tail-merge.c +++ b/gcc/tree-ssa-tail-merge.c @@ -389,9 +389,9 @@ static void same_succ_print (FILE *file, const same_succ e) { unsigned int i; - bitmap_print (file, e->bbs, "bbs:", "\n"); - bitmap_print (file, e->succs, "succs:", "\n"); - bitmap_print (file, e->inverse, "inverse:", "\n"); + e->bbs->print (file, "bbs:", "\n"); + e->succs->print (file, "succs:", "\n"); + e->inverse->print (file, "inverse:", "\n"); fprintf (file, "flags:"); for (i = 0; i < e->succ_flags.length (); ++i) fprintf (file, " %x", e->succ_flags[i]); @@ -900,8 +900,8 @@ print_cluster (FILE *file, bb_cluster c) { if (c == NULL) return; - bitmap_print (file, c->bbs, "bbs:", "\n"); - bitmap_print (file, c->preds, "preds:", "\n"); + c->bbs->print (file, "bbs:", "\n"); + c->preds->print (file, "preds:", "\n"); } /* Prints cluster C to stderr. */ diff --git a/gcc/tree-ssa-ter.c b/gcc/tree-ssa-ter.c index dd36221bd35..1d62c6cab3d 100644 --- a/gcc/tree-ssa-ter.c +++ b/gcc/tree-ssa-ter.c @@ -795,8 +795,8 @@ debug_ter (FILE *f, temp_expr_table_p t) fprintf (f, "\n"); } - bitmap_print (f, t->partition_in_use, "Partitions in use ", - "\npartition KILL lists:\n"); + t->partition_in_use->print (f, "Partitions in use ", + "\npartition KILL lists:\n"); for (x = 0; x <= num_var_partitions (t->map); x++) if (t->kill_list[x]) |