Commit 7967c666 by Richard Kenner

Add prototypes for all functions defined in file.

Change a few occurrences of RTX_CODE to enum rtx_code for consistency.
(merge_trees): Add casts of args to mybcopy.
(write_tree_1): Now static.
(fatal): Always called with one arg, so define that way.

From-SVN: r3914
parent e4135fa5
...@@ -164,26 +164,37 @@ static struct pred_table ...@@ -164,26 +164,37 @@ static struct pred_table
#define NUM_KNOWN_PREDS (sizeof preds / sizeof preds[0]) #define NUM_KNOWN_PREDS (sizeof preds / sizeof preds[0])
static int try_merge_1 (); static struct decision_head make_insn_sequence PROTO((rtx, enum routine_type));
static int no_same_mode (); static struct decision *add_to_sequence PROTO((rtx, struct decision_head *,
static int same_codes (); char *));
static int same_modes (); static int not_both_true PROTO((struct decision *, struct decision *,
char *xmalloc (); int));
static struct decision *add_to_sequence (); static int position_merit PROTO((struct decision *, enum machine_mode,
static struct decision_head merge_trees (); enum rtx_code));
static struct decision *try_merge_2 (); static struct decision_head merge_trees PROTO((struct decision_head,
static void write_subroutine (); struct decision_head));
static void print_code (); static int break_out_subroutines PROTO((struct decision_head,
static void clear_codes (); enum routine_type, int));
static void clear_modes (); static void write_subroutine PROTO((struct decision *, enum routine_type));
static void change_state (); static void write_tree_1 PROTO((struct decision *, char *,
static void write_tree (); struct decision *, enum routine_type));
static char *copystr (); static void print_code PROTO((enum rtx_code));
static char *concat (); static int same_codes PROTO((struct decision *, enum rtx_code));
static void fatal (); static void clear_codes PROTO((struct decision *));
void fancy_abort (); static int same_modes PROTO((struct decision *, enum machine_mode));
static void mybzero (); static void clear_modes PROTO((struct decision *));
static void mybcopy (); static void write_tree PROTO((struct decision *, char *,
struct decision *, int,
enum routine_type));
static void change_state PROTO((char *, char *, int));
static char *copystr PROTO((char *));
static void mybzero PROTO((char *, unsigned));
static void mybcopy PROTO((char *, char *, unsigned));
static char *concat PROTO((char *, char *));
static void fatal PROTO((char *));
char *xrealloc PROTO((char *, unsigned));
char *xmalloc PROTO((unsigned));
void fancy_abort PROTO((void));
/* Construct and return a sequence of decisions /* Construct and return a sequence of decisions
that will recognize INSN. that will recognize INSN.
...@@ -653,7 +664,7 @@ static int ...@@ -653,7 +664,7 @@ static int
position_merit (p, mode, code) position_merit (p, mode, code)
struct decision *p; struct decision *p;
enum machine_mode mode; enum machine_mode mode;
RTX_CODE code; enum rtx_code code;
{ {
enum machine_mode p_mode; enum machine_mode p_mode;
...@@ -793,7 +804,8 @@ merge_trees (oldh, addh) ...@@ -793,7 +804,8 @@ merge_trees (oldh, addh)
struct decision *split struct decision *split
= (struct decision *) xmalloc (sizeof (struct decision)); = (struct decision *) xmalloc (sizeof (struct decision));
mybcopy (old, split, sizeof (struct decision)); mybcopy ((char *) old, (char *) split,
sizeof (struct decision));
old->success.first = old->success.last = split; old->success.first = old->success.last = split;
old->c_test = 0; old->c_test = 0;
...@@ -819,7 +831,8 @@ merge_trees (oldh, addh) ...@@ -819,7 +831,8 @@ merge_trees (oldh, addh)
struct decision *split struct decision *split
= (struct decision *) xmalloc (sizeof (struct decision)); = (struct decision *) xmalloc (sizeof (struct decision));
mybcopy (add, split, sizeof (struct decision)); mybcopy ((char *) add, (char *) split,
sizeof (struct decision));
add->success.first = add->success.last = split; add->success.first = add->success.last = split;
add->c_test = 0; add->c_test = 0;
...@@ -1018,7 +1031,7 @@ static char *indents[] ...@@ -1018,7 +1031,7 @@ static char *indents[]
resulting function. We do check for when every test is the same mode resulting function. We do check for when every test is the same mode
or code. */ or code. */
void static void
write_tree_1 (tree, prevpos, afterward, type) write_tree_1 (tree, prevpos, afterward, type)
struct decision *tree; struct decision *tree;
char *prevpos; char *prevpos;
...@@ -1441,7 +1454,7 @@ write_tree_1 (tree, prevpos, afterward, type) ...@@ -1441,7 +1454,7 @@ write_tree_1 (tree, prevpos, afterward, type)
static void static void
print_code (code) print_code (code)
RTX_CODE code; enum rtx_code code;
{ {
register char *p1; register char *p1;
for (p1 = GET_RTX_NAME (code); *p1; p1++) for (p1 = GET_RTX_NAME (code); *p1; p1++)
...@@ -1456,7 +1469,7 @@ print_code (code) ...@@ -1456,7 +1469,7 @@ print_code (code)
static int static int
same_codes (p, code) same_codes (p, code)
register struct decision *p; register struct decision *p;
register RTX_CODE code; register enum rtx_code code;
{ {
for (; p; p = p->next) for (; p; p = p->next)
if (p->code != code) if (p->code != code)
...@@ -1652,11 +1665,11 @@ xmalloc (size) ...@@ -1652,11 +1665,11 @@ xmalloc (size)
} }
static void static void
fatal (s, a1, a2) fatal (s)
char *s; char *s;
{ {
fprintf (stderr, "genrecog: "); fprintf (stderr, "genrecog: ");
fprintf (stderr, s, a1, a2); fprintf (stderr, s);
fprintf (stderr, "\n"); fprintf (stderr, "\n");
fprintf (stderr, "after %d definitions\n", next_index); fprintf (stderr, "after %d definitions\n", next_index);
exit (FATAL_EXIT_CODE); exit (FATAL_EXIT_CODE);
......
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