aboutsummaryrefslogtreecommitdiff
path: root/gcc/genattr.c
diff options
context:
space:
mode:
authorJoern Rennecke <joern.rennecke@embecosm.com>2011-07-25 21:32:56 +0000
committerJoern Rennecke <amylaar@gcc.gnu.org>2011-07-25 22:32:56 +0100
commitc344a8663701f069dd5406d0b65c0de4c589ff69 (patch)
tree8b716a26eaea9d3c08639ff1d1e19e739ed75ba9 /gcc/genattr.c
parentb97927a4e92fce96a44ef58468b532526e91ebfe (diff)
downloadgcc-c344a8663701f069dd5406d0b65c0de4c589ff69.zip
gcc-c344a8663701f069dd5406d0b65c0de4c589ff69.tar.gz
gcc-c344a8663701f069dd5406d0b65c0de4c589ff69.tar.bz2
genattr.c (write_upcase, [...]): Move to ...
* genattr.c (write_upcase, gen_attr <enum definition writing>): Move to ... * genattr-common.c ... here. (main): Call gen_attr. * optc-gen.awk: Make generated program include insn-attr-common.h . * Makefile.in (oprions.o): Depend on insn-attr-common.h From-SVN: r176769
Diffstat (limited to 'gcc/genattr.c')
-rw-r--r--gcc/genattr.c29
1 files changed, 3 insertions, 26 deletions
diff --git a/gcc/genattr.c b/gcc/genattr.c
index 5df138f..34e710d 100644
--- a/gcc/genattr.c
+++ b/gcc/genattr.c
@@ -30,23 +30,15 @@ along with GCC; see the file COPYING3. If not see
#include "gensupport.h"
-static void write_upcase (const char *);
static void gen_attr (rtx);
-static void
-write_upcase (const char *str)
-{
- for (; *str; str++)
- putchar (TOUPPER(*str));
-}
-
static VEC (rtx, heap) *const_attrs, *reservations;
static void
gen_attr (rtx attr)
{
- const char *p, *tag;
+ const char *p;
int is_const = GET_CODE (XEXP (attr, 2)) == CONST;
if (is_const)
@@ -65,23 +57,8 @@ gen_attr (rtx attr)
printf ("extern int get_attr_%s (%s);\n", XSTR (attr, 0),
(is_const ? "void" : "rtx"));
else
- {
- printf ("enum attr_%s {", XSTR (attr, 0));
-
- while ((tag = scan_comma_elt (&p)) != 0)
- {
- write_upcase (XSTR (attr, 0));
- putchar ('_');
- while (tag != p)
- putchar (TOUPPER (*tag++));
- if (*p == ',')
- fputs (", ", stdout);
- }
- fputs ("};\n", stdout);
-
- printf ("extern enum attr_%s get_attr_%s (%s);\n\n",
- XSTR (attr, 0), XSTR (attr, 0), (is_const ? "void" : "rtx"));
- }
+ printf ("extern enum attr_%s get_attr_%s (%s);\n\n",
+ XSTR (attr, 0), XSTR (attr, 0), (is_const ? "void" : "rtx"));
}
/* If `length' attribute, write additional function definitions and define