diff options
author | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-07-09 00:44:34 +0000 |
---|---|---|
committer | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-07-09 00:44:34 +0000 |
commit | 7492620dc25a8cef1b7ef7427bcf41e09678e797 (patch) | |
tree | de9aaefcc4ca5501862b82012e9dc7f369354405 | |
parent | 542f09c7d771834b5db184b76cbaf3ee576954f3 (diff) | |
download | gcc-7492620dc25a8cef1b7ef7427bcf41e09678e797.tar.gz |
* genattr.c (internal_dfa_insn_code): Don't prototype.
* genattrtab.c (attr_desc): Add `static_p' field.
(expand_units): Make blockage range and ready cost functions
static.
(write_attr_get): Don't add extern prototypes in C file. Mark
static functions as appropriate.
(find_attr, make_internal_attr): Initialize static_p.
* genattrtab.h (ATTR_STATIC): New macro.
* genautomata.c (output_internal_reset_func): Mark output function
as inline.
(make_internal_dfa_insn_code_attr): Mark output function as static.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@69116 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 14 | ||||
-rw-r--r-- | gcc/genattr.c | 1 | ||||
-rw-r--r-- | gcc/genattrtab.c | 35 | ||||
-rw-r--r-- | gcc/genattrtab.h | 1 | ||||
-rw-r--r-- | gcc/genautomata.c | 4 |
5 files changed, 30 insertions, 25 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0eea6e2fdd4..6e43c3ea446 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,19 @@ 2003-07-08 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + * genattr.c (internal_dfa_insn_code): Don't prototype. + * genattrtab.c (attr_desc): Add `static_p' field. + (expand_units): Make blockage range and ready cost functions + static. + (write_attr_get): Don't add extern prototypes in C file. Mark + static functions as appropriate. + (find_attr, make_internal_attr): Initialize static_p. + * genattrtab.h (ATTR_STATIC): New macro. + * genautomata.c (output_internal_reset_func): Mark output function + as inline. + (make_internal_dfa_insn_code_attr): Mark output function as static. + +2003-07-08 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + * genattrtab.h: Add new macros for attr `special' flags. * genattrtab.c (attr_desc): Reorder/resize fields better. Use attr `special' macros in all calls to make_internal_attr. diff --git a/gcc/genattr.c b/gcc/genattr.c index cccacba3915..98cd08cee4d 100644 --- a/gcc/genattr.c +++ b/gcc/genattr.c @@ -379,7 +379,6 @@ main (int argc, char **argv) printf (" insns scheduling heuristics. */\n"); printf ("extern int insn_alts (rtx);\n\n"); printf ("#endif\n\n"); - printf ("extern int internal_dfa_insn_code (rtx);\n\n"); printf ("/* Maximal possible number of insns waiting results being\n"); printf (" produced by insns whose execution is not finished. */\n"); printf ("extern int max_insn_queue_index;\n\n"); diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c index c3cadc8af45..15a8afabc22 100644 --- a/gcc/genattrtab.c +++ b/gcc/genattrtab.c @@ -185,6 +185,7 @@ struct attr_desc unsigned is_special : 1; /* Don't call `write_attr_set'. */ unsigned func_units_p : 1; /* this is the function_units attribute */ unsigned blockage_p : 1; /* this is the blockage range function */ + unsigned static_p : 1; /* Make the output function static. */ }; #define NULL_ATTR (struct attr_desc *) NULL @@ -2078,18 +2079,20 @@ expand_units (void) str = attr_printf ((strlen (unit->name) + sizeof "*_unit_blockage_range"), "*%s_unit_blockage_range", unit->name); - make_internal_attr (str, newexp, (ATTR_BLOCKAGE|ATTR_UNSIGNED)); + make_internal_attr (str, newexp, (ATTR_STATIC|ATTR_BLOCKAGE|ATTR_UNSIGNED)); } str = attr_printf (strlen (unit->name) + sizeof "*_unit_ready_cost", "*%s_unit_ready_cost", unit->name); + make_internal_attr (str, readycost, ATTR_STATIC); } else - str = "*result_ready_cost"; - - /* Make an attribute for the ready_cost function. Simplifying - further with simplify_by_exploding doesn't win. */ - make_internal_attr (str, readycost, ATTR_NONE); + { + /* Make an attribute for the ready_cost function. Simplifying + further with simplify_by_exploding doesn't win. */ + str = "*result_ready_cost"; + make_internal_attr (str, readycost, ATTR_NONE); + } } /* For each unit that requires a conflict cost function, make an attribute @@ -4766,23 +4769,10 @@ write_attr_get (struct attr_desc *attr) switch we will generate. */ common_av = find_most_used (attr); - /* Write out prototype of function. */ - if (!attr->is_numeric) - printf ("extern enum attr_%s ", attr->name); - else if (attr->unsigned_p) - printf ("extern unsigned int "); - else - printf ("extern int "); - /* If the attribute name starts with a star, the remainder is the name of - the subroutine to use, instead of `get_attr_...'. */ - if (attr->name[0] == '*') - printf ("%s (rtx);\n", &attr->name[1]); - else - printf ("get_attr_%s (%s);\n", attr->name, - (attr->is_const ? "void" : "rtx")); - /* Write out start of function, then all values with explicit `case' lines, then a `default', then the value with the most uses. */ + if (attr->static_p) + printf ("static "); if (!attr->is_numeric) printf ("enum attr_%s\n", attr->name); else if (attr->unsigned_p) @@ -5593,7 +5583,7 @@ find_attr (const char *name, int create) attr->name = attr_string (name, strlen (name)); attr->first_value = attr->default_val = NULL; attr->is_numeric = attr->negative_ok = attr->is_const = attr->is_special = 0; - attr->unsigned_p = attr->func_units_p = attr->blockage_p = 0; + attr->unsigned_p = attr->func_units_p = attr->blockage_p = attr->static_p = 0; attr->next = attrs[index]; attrs[index] = attr; @@ -5618,6 +5608,7 @@ make_internal_attr (const char *name, rtx value, int special) attr->unsigned_p = (special & ATTR_UNSIGNED) != 0; attr->func_units_p = (special & ATTR_FUNC_UNITS) != 0; attr->blockage_p = (special & ATTR_BLOCKAGE) != 0; + attr->static_p = (special & ATTR_STATIC) != 0; attr->default_val = get_attr_value (value, attr, -2); } diff --git a/gcc/genattrtab.h b/gcc/genattrtab.h index d5c04005753..1af43c0a191 100644 --- a/gcc/genattrtab.h +++ b/gcc/genattrtab.h @@ -55,3 +55,4 @@ extern void write_automata (void); #define ATTR_UNSIGNED (1 << 2) #define ATTR_FUNC_UNITS (1 << 3) #define ATTR_BLOCKAGE (1 << 4) +#define ATTR_STATIC (1 << 5) diff --git a/gcc/genautomata.c b/gcc/genautomata.c index 635d3627991..bafb2553cde 100644 --- a/gcc/genautomata.c +++ b/gcc/genautomata.c @@ -8572,7 +8572,7 @@ output_dead_lock_func (void) static void output_internal_reset_func (void) { - fprintf (output_file, "static void\n%s (struct %s *%s)\n", + fprintf (output_file, "static inline 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); @@ -9474,7 +9474,7 @@ make_internal_dfa_insn_code_attr (void) (attr_printf (sizeof ("*") + strlen (INTERNAL_DFA_INSN_CODE_FUNC_NAME) + 1, "*%s", INTERNAL_DFA_INSN_CODE_FUNC_NAME), - condexp, ATTR_NONE); + condexp, ATTR_STATIC); } |