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 /gcc/genattrtab.c | |
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
Diffstat (limited to 'gcc/genattrtab.c')
-rw-r--r-- | gcc/genattrtab.c | 35 |
1 files changed, 13 insertions, 22 deletions
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); } |