diff options
author | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-07-05 05:27:22 +0000 |
---|---|---|
committer | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-07-05 05:27:22 +0000 |
commit | 69dc4d0026bf97ffbd6d85776a892709cf944965 (patch) | |
tree | d50d814f99d556b8b58fa2fb6da18f5ac6b89824 /gcc/genautomata.c | |
parent | 5a64d8cf37253f8227d179a52a0c022a927db8b6 (diff) | |
download | gcc-69dc4d0026bf97ffbd6d85776a892709cf944965.tar.gz |
* genattr.c (internal_dfa_insn_code): Output prototype.
* genattrtab.c: Don't output unnecessary decls, output in ISO C.
* genautomata.c: Likewise.
* genconditions.c: Likewise.
* genemit.c: Likewise.
* genextract.c: Likewise.
* gengenrtl.c: Likewise.
* gengtype.c: Likewise.
* genopinit.c: Likewise.
* genoutput.c: Likewise.
* genpeep.c: Likewise.
* genrecog.c: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@68959 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/genautomata.c')
-rw-r--r-- | gcc/genautomata.c | 108 |
1 files changed, 39 insertions, 69 deletions
diff --git a/gcc/genautomata.c b/gcc/genautomata.c index 5ed43a70f7c..1edb5c59740 100644 --- a/gcc/genautomata.c +++ b/gcc/genautomata.c @@ -8207,13 +8207,10 @@ output_automata_list_min_issue_delay_code (automata_list_el_t automata_list) static void output_internal_min_issue_delay_func (void) { - fprintf (output_file, "static int %s (int, struct %s *);\n", - INTERNAL_MIN_ISSUE_DELAY_FUNC_NAME, CHIP_NAME); fprintf (output_file, - "static int\n%s (%s, %s)\n\tint %s;\n\tstruct %s *%s ATTRIBUTE_UNUSED;\n", + "static int\n%s (int %s, struct %s *%s ATTRIBUTE_UNUSED)\n", INTERNAL_MIN_ISSUE_DELAY_FUNC_NAME, INTERNAL_INSN_CODE_NAME, - CHIP_PARAMETER_NAME, INTERNAL_INSN_CODE_NAME, CHIP_NAME, - CHIP_PARAMETER_NAME); + CHIP_NAME, CHIP_PARAMETER_NAME); fprintf (output_file, "{\n int %s ATTRIBUTE_UNUSED;\n int %s = -1;\n", TEMPORARY_VARIABLE_NAME, RESULT_VARIABLE_NAME); fprintf (output_file, "\n switch (%s)\n {\n", INTERNAL_INSN_CODE_NAME); @@ -8323,12 +8320,9 @@ output_automata_list_transition_code (automata_list_el_t automata_list) static void output_internal_trans_func (void) { - fprintf (output_file, "static int %s (int, struct %s *);\n", - INTERNAL_TRANSITION_FUNC_NAME, CHIP_NAME); fprintf (output_file, - "static int\n%s (%s, %s)\n\tint %s;\n\tstruct %s *%s ATTRIBUTE_UNUSED;\n", + "static int\n%s (int %s, struct %s *%s ATTRIBUTE_UNUSED)\n", INTERNAL_TRANSITION_FUNC_NAME, INTERNAL_INSN_CODE_NAME, - CHIP_PARAMETER_NAME, INTERNAL_INSN_CODE_NAME, CHIP_NAME, CHIP_PARAMETER_NAME); fprintf (output_file, "{\n int %s ATTRIBUTE_UNUSED;\n", TEMPORARY_VARIABLE_NAME); fprintf (output_file, "\n switch (%s)\n {\n", INTERNAL_INSN_CODE_NAME); @@ -8373,10 +8367,9 @@ output_dfa_insn_code_func (void) /* Emacs c-mode gets really confused if there's a { or } in column 0 inside a string, so don't do that. */ fprintf (output_file, "\ -static void dfa_insn_code_enlarge (int);\n\ static void\n\ -dfa_insn_code_enlarge (uid)\n\ - int uid;\n{\n\ +dfa_insn_code_enlarge (int uid)\n\ +{\n\ int i = %s;\n\ %s = 2 * uid;\n\ %s = xrealloc (%s,\n\ @@ -8390,15 +8383,12 @@ dfa_insn_code_enlarge (uid)\n\ DFA_INSN_CODES_LENGTH_VARIABLE_NAME, DFA_INSN_CODES_VARIABLE_NAME); fprintf (output_file, "\ -static inline int %s (rtx);\n\ -static inline int\n%s (%s)\n\ - rtx %s;\n{\n\ - int uid = INSN_UID (%s);\n\ - int %s;\n\n", - DFA_INSN_CODE_FUNC_NAME, DFA_INSN_CODE_FUNC_NAME, - INSN_PARAMETER_NAME, INSN_PARAMETER_NAME, - INSN_PARAMETER_NAME, - INTERNAL_INSN_CODE_NAME); +static inline int\n%s (rtx %s)\n\ +{\n\ + int uid = INSN_UID (%s);\n\ + int %s;\n\n", + DFA_INSN_CODE_FUNC_NAME, INSN_PARAMETER_NAME, + INSN_PARAMETER_NAME, INTERNAL_INSN_CODE_NAME); fprintf (output_file, " if (uid >= %s)\n dfa_insn_code_enlarge (uid);\n\n", @@ -8422,9 +8412,9 @@ static inline int\n%s (%s)\n\ static void output_trans_func (void) { - fprintf (output_file, "int\n%s (%s, %s)\n\t%s %s;\n\trtx %s;\n", - TRANSITION_FUNC_NAME, STATE_NAME, INSN_PARAMETER_NAME, - STATE_TYPE_NAME, STATE_NAME, INSN_PARAMETER_NAME); + fprintf (output_file, "int\n%s (%s %s, rtx %s)\n", + TRANSITION_FUNC_NAME, STATE_TYPE_NAME, STATE_NAME, + INSN_PARAMETER_NAME); fprintf (output_file, "{\n int %s;\n", INTERNAL_INSN_CODE_NAME); output_internal_insn_code_evaluation (INSN_PARAMETER_NAME, INTERNAL_INSN_CODE_NAME, -1); @@ -8497,13 +8487,10 @@ output_automata_list_state_alts_code (automata_list_el_t automata_list) static void output_internal_state_alts_func (void) { - fprintf (output_file, "static int %s (int, struct %s *);\n", - INTERNAL_STATE_ALTS_FUNC_NAME, CHIP_NAME); fprintf (output_file, - "static int\n%s (%s, %s)\n\tint %s;\n\tstruct %s *%s;\n", + "static int\n%s (int %s, struct %s *%s)\n", INTERNAL_STATE_ALTS_FUNC_NAME, INTERNAL_INSN_CODE_NAME, - CHIP_PARAMETER_NAME, INTERNAL_INSN_CODE_NAME, CHIP_NAME, - CHIP_PARAMETER_NAME); + CHIP_NAME, CHIP_PARAMETER_NAME); fprintf (output_file, "{\n int %s;\n", RESULT_VARIABLE_NAME); fprintf (output_file, "\n switch (%s)\n {\n", INTERNAL_INSN_CODE_NAME); output_insn_code_cases (output_automata_list_state_alts_code); @@ -8532,9 +8519,9 @@ output_state_alts_func (void) static void output_min_issue_delay_func (void) { - fprintf (output_file, "int\n%s (%s, %s)\n\t%s %s;\n\trtx %s;\n", - MIN_ISSUE_DELAY_FUNC_NAME, STATE_NAME, INSN_PARAMETER_NAME, - STATE_TYPE_NAME, STATE_NAME, INSN_PARAMETER_NAME); + fprintf (output_file, "int\n%s (%s %s, rtx %s)\n", + MIN_ISSUE_DELAY_FUNC_NAME, STATE_TYPE_NAME, STATE_NAME, + INSN_PARAMETER_NAME); fprintf (output_file, "{\n int %s;\n", INTERNAL_INSN_CODE_NAME); fprintf (output_file, "\n if (%s != 0)\n {\n", INSN_PARAMETER_NAME); fprintf (output_file, " %s = %s (%s);\n", INTERNAL_INSN_CODE_NAME, @@ -8555,11 +8542,8 @@ output_internal_dead_lock_func (void) { automaton_t automaton; - fprintf (output_file, "static int %s (struct %s *);\n", - INTERNAL_DEAD_LOCK_FUNC_NAME, CHIP_NAME); - fprintf (output_file, "static int\n%s (%s)\n\tstruct %s *%s;\n", - INTERNAL_DEAD_LOCK_FUNC_NAME, CHIP_PARAMETER_NAME, CHIP_NAME, - CHIP_PARAMETER_NAME); + fprintf (output_file, "static int\n%s (struct %s *%s)\n", + INTERNAL_DEAD_LOCK_FUNC_NAME, CHIP_NAME, CHIP_PARAMETER_NAME); fprintf (output_file, "{\n"); for (automaton = description->first_automaton; automaton != NULL; @@ -8578,8 +8562,8 @@ output_internal_dead_lock_func (void) static void output_dead_lock_func (void) { - fprintf (output_file, "int\n%s (%s)\n\t%s %s;\n", - DEAD_LOCK_FUNC_NAME, STATE_NAME, STATE_TYPE_NAME, STATE_NAME); + fprintf (output_file, "int\n%s (%s %s)\n", + DEAD_LOCK_FUNC_NAME, STATE_TYPE_NAME, STATE_NAME); fprintf (output_file, "{\n return %s (%s);\n}\n\n", INTERNAL_DEAD_LOCK_FUNC_NAME, STATE_NAME); } @@ -8588,11 +8572,8 @@ output_dead_lock_func (void) static void output_internal_reset_func (void) { - fprintf (output_file, "static void %s (struct %s *);\n", - INTERNAL_RESET_FUNC_NAME, CHIP_NAME); - fprintf (output_file, "static void\n%s (%s)\n\tstruct %s *%s;\n", - INTERNAL_RESET_FUNC_NAME, CHIP_PARAMETER_NAME, - CHIP_NAME, CHIP_PARAMETER_NAME); + fprintf (output_file, "static void\n%s (struct %s *%s)\n", + INTERNAL_RESET_FUNC_NAME, CHIP_NAME, CHIP_PARAMETER_NAME); fprintf (output_file, "{\n memset (%s, 0, sizeof (struct %s));\n}\n\n", CHIP_PARAMETER_NAME, CHIP_NAME); } @@ -8601,7 +8582,7 @@ output_internal_reset_func (void) static void output_size_func (void) { - fprintf (output_file, "int\n%s ()\n", SIZE_FUNC_NAME); + fprintf (output_file, "int\n%s (void)\n", SIZE_FUNC_NAME); fprintf (output_file, "{\n return sizeof (struct %s);\n}\n\n", CHIP_NAME); } @@ -8609,8 +8590,8 @@ output_size_func (void) static void output_reset_func (void) { - fprintf (output_file, "void\n%s (%s)\n\t %s %s;\n", - RESET_FUNC_NAME, STATE_NAME, STATE_TYPE_NAME, STATE_NAME); + fprintf (output_file, "void\n%s (%s %s)\n", + RESET_FUNC_NAME, STATE_TYPE_NAME, STATE_NAME); fprintf (output_file, "{\n %s (%s);\n}\n\n", INTERNAL_RESET_FUNC_NAME, STATE_NAME); } @@ -8620,11 +8601,9 @@ static void output_min_insn_conflict_delay_func (void) { fprintf (output_file, - "int\n%s (%s, %s, %s)\n\t%s %s;\n\trtx %s;\n\trtx %s;\n", - MIN_INSN_CONFLICT_DELAY_FUNC_NAME, - STATE_NAME, INSN_PARAMETER_NAME, INSN2_PARAMETER_NAME, - STATE_TYPE_NAME, STATE_NAME, - INSN_PARAMETER_NAME, INSN2_PARAMETER_NAME); + "int\n%s (%s %s, rtx %s, rtx %s)\n", + MIN_INSN_CONFLICT_DELAY_FUNC_NAME, STATE_TYPE_NAME, + STATE_NAME, INSN_PARAMETER_NAME, INSN2_PARAMETER_NAME); fprintf (output_file, "{\n struct %s %s;\n int %s, %s;\n", CHIP_NAME, CHIP_NAME, INTERNAL_INSN_CODE_NAME, INTERNAL_INSN2_CODE_NAME); @@ -8665,18 +8644,11 @@ output_internal_insn_latency_func (void) tabletype = "int"; } - fprintf (output_file, "static int %s (int, int, rtx, rtx);\n", - INTERNAL_INSN_LATENCY_FUNC_NAME); - fprintf (output_file, "static int\n%s (%s, %s, %s, %s)", + fprintf (output_file, "static int\n%s (int %s ATTRIBUTE_UNUSED,\n\tint %s ATTRIBUTE_UNUSED,\n\trtx %s ATTRIBUTE_UNUSED,\n\trtx %s ATTRIBUTE_UNUSED)\n", INTERNAL_INSN_LATENCY_FUNC_NAME, INTERNAL_INSN_CODE_NAME, INTERNAL_INSN2_CODE_NAME, INSN_PARAMETER_NAME, INSN2_PARAMETER_NAME); - fprintf (output_file, - "\n\tint %s ATTRIBUTE_UNUSED;\n\tint %s ATTRIBUTE_UNUSED;\n", - INTERNAL_INSN_CODE_NAME, INTERNAL_INSN2_CODE_NAME); - fprintf (output_file, - "\trtx %s ATTRIBUTE_UNUSED;\n\trtx %s ATTRIBUTE_UNUSED;\n{\n", - INSN_PARAMETER_NAME, INSN2_PARAMETER_NAME); + fprintf (output_file, "{\n"); if (DECL_INSN_RESERV (advance_cycle_insn_decl)->insn_num == 0) { @@ -8751,9 +8723,8 @@ output_internal_insn_latency_func (void) static void output_insn_latency_func (void) { - fprintf (output_file, "int\n%s (%s, %s)\n\trtx %s;\n\trtx %s;\n", - INSN_LATENCY_FUNC_NAME, INSN_PARAMETER_NAME, INSN2_PARAMETER_NAME, - INSN_PARAMETER_NAME, INSN2_PARAMETER_NAME); + fprintf (output_file, "int\n%s (rtx %s, rtx %s)\n", + INSN_LATENCY_FUNC_NAME, INSN_PARAMETER_NAME, INSN2_PARAMETER_NAME); fprintf (output_file, "{\n int %s, %s;\n", INTERNAL_INSN_CODE_NAME, INTERNAL_INSN2_CODE_NAME); output_internal_insn_code_evaluation (INSN_PARAMETER_NAME, @@ -8774,9 +8745,8 @@ output_print_reservation_func (void) int i, j; fprintf (output_file, - "void\n%s (%s, %s)\n\tFILE *%s;\n\trtx %s ATTRIBUTE_UNUSED;\n{\n", + "void\n%s (FILE *%s, rtx %s ATTRIBUTE_UNUSED)\n{\n", PRINT_RESERVATION_FUNC_NAME, FILE_PARAMETER_NAME, - INSN_PARAMETER_NAME, FILE_PARAMETER_NAME, INSN_PARAMETER_NAME); if (DECL_INSN_RESERV (advance_cycle_insn_decl)->insn_num == 0) @@ -8941,7 +8911,7 @@ static void output_dfa_clean_insn_cache_func (void) { fprintf (output_file, - "void\n%s ()\n{\n int %s;\n\n", + "void\n%s (void)\n{\n int %s;\n\n", DFA_CLEAN_INSN_CACHE_FUNC_NAME, I_VARIABLE_NAME); fprintf (output_file, " for (%s = 0; %s < %s; %s++)\n %s [%s] = -1;\n}\n\n", @@ -8955,7 +8925,7 @@ static void output_dfa_start_func (void) { fprintf (output_file, - "void\n%s ()\n{\n %s = get_max_uid ();\n", + "void\n%s (void)\n{\n %s = get_max_uid ();\n", DFA_START_FUNC_NAME, DFA_INSN_CODES_LENGTH_VARIABLE_NAME); fprintf (output_file, " %s = (int *) xmalloc (%s * sizeof (int));\n", DFA_INSN_CODES_VARIABLE_NAME, DFA_INSN_CODES_LENGTH_VARIABLE_NAME); @@ -8966,7 +8936,7 @@ output_dfa_start_func (void) static void output_dfa_finish_func (void) { - fprintf (output_file, "void\n%s ()\n{\n free (%s);\n}\n\n", + fprintf (output_file, "void\n%s (void)\n{\n free (%s);\n}\n\n", DFA_FINISH_FUNC_NAME, DFA_INSN_CODES_VARIABLE_NAME); } |