Commit 2307e372 by Richard Henderson Committed by Richard Henderson

basic-block.h (compute_bb_for_insn): Declare.

        * basic-block.h (compute_bb_for_insn): Declare.
        * flow.c (compute_bb_for_insn): Export.  Don't accept the varray
        to use; set size of basic_block_for_insn directly.
        (find_basic_blocks): Update.

From-SVN: r29530
parent 8801244b
Mon Sep 20 12:59:16 1999 Richard Henderson <rth@cygnus.com>
* basic-block.h (compute_bb_for_insn): Declare.
* flow.c (compute_bb_for_insn): Export. Don't accept the varray
to use; set size of basic_block_for_insn directly.
(find_basic_blocks): Update.
Mon Sep 20 15:11:54 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> Mon Sep 20 15:11:54 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* flow.c (verify_flow_info): Fix typo, "abort;" -> "abort ();". * flow.c (verify_flow_info): Fix typo, "abort;" -> "abort ();".
......
...@@ -233,6 +233,7 @@ extern varray_type basic_block_for_insn; ...@@ -233,6 +233,7 @@ extern varray_type basic_block_for_insn;
#define BLOCK_FOR_INSN(INSN) VARRAY_BB (basic_block_for_insn, INSN_UID (INSN)) #define BLOCK_FOR_INSN(INSN) VARRAY_BB (basic_block_for_insn, INSN_UID (INSN))
#define BLOCK_NUM(INSN) (BLOCK_FOR_INSN (INSN)->index + 0) #define BLOCK_NUM(INSN) (BLOCK_FOR_INSN (INSN)->index + 0)
extern void compute_bb_for_insn PROTO ((int));
extern void set_block_for_insn PROTO ((rtx, basic_block)); extern void set_block_for_insn PROTO ((rtx, basic_block));
extern void dump_bb_data PROTO ((FILE *, int_list_ptr *, extern void dump_bb_data PROTO ((FILE *, int_list_ptr *,
......
...@@ -276,7 +276,6 @@ static bitmap uid_volatile; ...@@ -276,7 +276,6 @@ static bitmap uid_volatile;
static int count_basic_blocks PROTO((rtx)); static int count_basic_blocks PROTO((rtx));
static rtx find_basic_blocks_1 PROTO((rtx, rtx*)); static rtx find_basic_blocks_1 PROTO((rtx, rtx*));
static void create_basic_block PROTO((int, rtx, rtx, rtx)); static void create_basic_block PROTO((int, rtx, rtx, rtx));
static void compute_bb_for_insn PROTO((varray_type, int));
static void clear_edges PROTO((void)); static void clear_edges PROTO((void));
static void make_edges PROTO((rtx, rtx*)); static void make_edges PROTO((rtx, rtx*));
static void make_edge PROTO((basic_block, basic_block, int)); static void make_edge PROTO((basic_block, basic_block, int));
...@@ -404,8 +403,7 @@ find_basic_blocks (f, nregs, file, do_cleanup) ...@@ -404,8 +403,7 @@ find_basic_blocks (f, nregs, file, do_cleanup)
max_uid += max_uid / 10; max_uid += max_uid / 10;
#endif #endif
VARRAY_BB_INIT (basic_block_for_insn, max_uid, "basic_block_for_insn"); compute_bb_for_insn (max_uid);
compute_bb_for_insn (basic_block_for_insn, max_uid);
/* Discover the edges of our cfg. */ /* Discover the edges of our cfg. */
...@@ -804,13 +802,14 @@ create_basic_block (index, head, end, bb_note) ...@@ -804,13 +802,14 @@ create_basic_block (index, head, end, bb_note)
/* Records the basic block struct in BB_FOR_INSN, for every instruction /* Records the basic block struct in BB_FOR_INSN, for every instruction
indexed by INSN_UID. MAX is the size of the array. */ indexed by INSN_UID. MAX is the size of the array. */
static void void
compute_bb_for_insn (bb_for_insn, max) compute_bb_for_insn (max)
varray_type bb_for_insn;
int max; int max;
{ {
int i; int i;
VARRAY_BB_INIT (basic_block_for_insn, max, "basic_block_for_insn");
for (i = 0; i < n_basic_blocks; ++i) for (i = 0; i < n_basic_blocks; ++i)
{ {
basic_block bb = BASIC_BLOCK (i); basic_block bb = BASIC_BLOCK (i);
...@@ -822,7 +821,7 @@ compute_bb_for_insn (bb_for_insn, max) ...@@ -822,7 +821,7 @@ compute_bb_for_insn (bb_for_insn, max)
{ {
int uid = INSN_UID (insn); int uid = INSN_UID (insn);
if (uid < max) if (uid < max)
VARRAY_BB (bb_for_insn, uid) = bb; VARRAY_BB (basic_block_for_insn, uid) = bb;
if (insn == end) if (insn == end)
break; break;
insn = NEXT_INSN (insn); insn = NEXT_INSN (insn);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment