diff options
author | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-05-12 18:43:33 +0000 |
---|---|---|
committer | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-05-12 18:43:33 +0000 |
commit | be46690ee3370d9008b0220bfa7074563edd7ded (patch) | |
tree | 041a0c07e04b7b1e912cc3fbfff87c4cb5742d5e /gcc/genattr.c | |
parent | 0ef911744f03203291e910fd511fc5fbe17b692f (diff) | |
download | gcc-be46690ee3370d9008b0220bfa7074563edd7ded.tar.gz |
* gensupport.c (n_comma_elts): Moved here from genattrtab.c.
(scan_comma_elt): New function. Accepts whitespace in comma lists.
* gensupport.h: Prototype new routines.
* genattr.c (gen_attr): Use scan_comma_elt. Avoid unnecessary
use of printf.
* genattrtab.c (n_comma_elts): Moved to gensupport.c.
(next_comma_elt): Use scan_comma_elt.
* config/i386/i386.md: Use new attribute notation to break up
long lines in define_attr forms.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53403 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/genattr.c')
-rw-r--r-- | gcc/genattr.c | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/gcc/genattr.c b/gcc/genattr.c index 60045ff8083..b688bd49bad 100644 --- a/gcc/genattr.c +++ b/gcc/genattr.c @@ -86,34 +86,30 @@ static void gen_attr (attr) rtx attr; { - const char *p; + const char *p, *tag; int is_const = GET_CODE (XEXP (attr, 2)) == CONST; printf ("#define HAVE_ATTR_%s\n", XSTR (attr, 0)); /* If numeric attribute, don't need to write an enum. */ - if (*XSTR (attr, 1) == '\0') + p = XSTR (attr, 1); + if (*p == '\0') printf ("extern int get_attr_%s PARAMS ((%s));\n", XSTR (attr, 0), (is_const ? "void" : "rtx")); else { printf ("enum attr_%s {", XSTR (attr, 0)); - write_upcase (XSTR (attr, 0)); - printf ("_"); - for (p = XSTR (attr, 1); *p != '\0'; p++) + while ((tag = scan_comma_elt (&p)) != 0) { - if (*p == ',') - { - printf (", "); - write_upcase (XSTR (attr, 0)); - printf ("_"); - } - else - putchar (TOUPPER(*p)); + write_upcase (XSTR (attr, 0)); + putchar ('_'); + while (tag != p) + putchar (TOUPPER (*tag++)); + fputs (", ", stdout); } - printf ("};\n"); + fputs ("};\n", stdout); printf ("extern enum attr_%s get_attr_%s PARAMS ((%s));\n\n", XSTR (attr, 0), XSTR (attr, 0), (is_const ? "void" : "rtx")); } @@ -122,11 +118,12 @@ gen_attr (attr) variables used by `insn_current_length'. */ if (! strcmp (XSTR (attr, 0), "length")) { - printf ("extern void shorten_branches PARAMS ((rtx));\n"); - printf ("extern int insn_default_length PARAMS ((rtx));\n"); - printf ("extern int insn_variable_length_p PARAMS ((rtx));\n"); - printf ("extern int insn_current_length PARAMS ((rtx));\n\n"); - printf ("#include \"insn-addr.h\"\n\n"); + puts ("\ +extern void shorten_branches PARAMS ((rtx));\n\ +extern int insn_default_length PARAMS ((rtx));\n\ +extern int insn_variable_length_p PARAMS ((rtx));\n\ +extern int insn_current_length PARAMS ((rtx));\n\n\ +#include \"insn-addr.h\"\n"); } } |