-/** dumps a graph extended block-wise. Expects all blockless nodes in arr in irgs link.
- * The outermost nodes: blocks and nodes not op_pin_state_pinned, Bad, Unknown. */
-static void dump_extblock_graph(FILE *F, ir_graph *irg)
-{
- size_t i, arr_len;
- ir_extblk **arr = (ir_extblk**)ird_get_irg_link(irg);
-
- for (i = 0, arr_len = ARR_LEN(arr); i < arr_len; ++i) {
- ir_extblk *extbb = arr[i];
- ir_node *leader = get_extbb_leader(extbb);
- size_t j, n_blks;
-
- fprintf(F, "graph: { title: \"");
- fprintf(F, "x%ld", get_irn_node_nr(leader));
- fprintf(F, "\" label: \"ExtBB %ld\" status:clustered color:lightgreen\n",
- get_irn_node_nr(leader));
-
- for (j = 0, n_blks = ARR_LEN(extbb->blks); j < n_blks; ++j) {
- ir_node *node = extbb->blks[j];
- if (is_Block(node)) {
- /* Dumps the block and all the nodes in the block, which are to
- be found in Block->link. */
- dump_whole_block(F, node);
- } else {
- /* Nodes that are not in a Block. */
- dump_node(F, node);
- if (is_Bad(get_nodes_block(node)) && !node_floats(node)) {
- dump_const_block_local(F, node);
- }
- dump_ir_data_edges(F, node);
- }
- }
- fprintf(F, "}\n");
- }
-
- if ((flags & ir_dump_flag_loops)
- && (is_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_LOOPINFO)))
- dump_loop_nodes_into_graph(F, irg);
-
- free_extbb(irg);
-}
-
-static void dump_blocks_extbb_grouped(FILE *F, ir_graph *irg)
-{
- size_t i;
- ir_entity *ent = get_irg_entity(irg);
-
- if (!is_irg_state(irg, IR_GRAPH_STATE_VALID_EXTENDED_BLOCKS))
- compute_extbb(irg);
-
- construct_extblock_lists(irg);
-
- fprintf(F, "graph: { title: ");
- print_irgid(F, irg);
- fprintf(F, " label: \"%s\" status:clustered color: white\n",
- get_ent_dump_name(ent));
-
- dump_graph_info(F, irg);
- print_dbg_info(F, get_entity_dbg_info(ent));
-
- for (i = get_irp_n_irgs(); i > 0;) {
- ir_graph *other_irg = get_irp_irg(--i);
- list_tuple *lists = (list_tuple*)ird_get_irg_link(other_irg);
-
- if (lists) {
- /* dump the extended blocks first */
- if (ARR_LEN(lists->extbb_list)) {
- ird_set_irg_link(other_irg, lists->extbb_list);
- dump_extblock_graph(F, other_irg);
- }
-
- /* we may have blocks without extended blocks, bad for instance */
- if (ARR_LEN(lists->blk_list)) {
- ird_set_irg_link(other_irg, lists->blk_list);
- dump_block_graph(F, other_irg);
- }
-
- DEL_ARR_F(lists->extbb_list);
- DEL_ARR_F(lists->blk_list);
- xfree(lists);
- }
- }
-
- /* Close the vcg information for the irg */
- fprintf(F, "}\n\n");
-
- free_extbb(irg);
-}
-