summaryrefslogtreecommitdiff
path: root/gcc/genextract.c
diff options
context:
space:
mode:
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2006-01-23 15:15:12 +0000
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2006-01-23 15:15:12 +0000
commit343695df238d8e043fe83c8b0cce11b73f2e2cba (patch)
tree04e7c2430e813b518ab2f021d422bd49f8d865ec /gcc/genextract.c
parentaf908c02d4c893024a3ccfa73244b96a10caeb2f (diff)
downloadgcc-343695df238d8e043fe83c8b0cce11b73f2e2cba.tar.gz
r110124@banpei: zack | 2006-01-22 14:45:55 -0800
* gensupport.c: Define get_insn_name and record_insn_name here. (read_md_rtx): Call record_insn_name as appropriate. * genattr.c, genattrtab.c, gencodes.c, genconfig.c, genemit.c * genextract.c, genflags.c, genopinit.c, genoutput.c, genpeep.c * genpreds.c, genrecog.c: Don't define get_insn_name nor record_insn_name. * Makefile.in (BUILD_SUPPORT, BUILD_PRINT): Fold into BUILD_RTL. (BUILD_VARRAY): Delete. (genprognormal): Rename genprogmd. Fold in all programs from genprognoprint; also attrtab. (build/genattrtab): Just mention genautomata.o and varray.o. Reorganize a bit, add comments to make the categories clearer. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110120 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/genextract.c')
-rw-r--r--gcc/genextract.c52
1 files changed, 1 insertions, 51 deletions
diff --git a/gcc/genextract.c b/gcc/genextract.c
index 1fd684228cf..319a0b0bfa9 100644
--- a/gcc/genextract.c
+++ b/gcc/genextract.c
@@ -86,7 +86,6 @@ struct accum_extract
/* Forward declarations. */
static void walk_rtx (rtx, struct accum_extract *);
-static void record_insn_name (int, const char *);
static void
gen_insn (rtx insn, int insn_code_number)
@@ -416,10 +415,7 @@ main (int argc, char **argv)
while ((desc = read_md_rtx (&line_no, &insn_code_number)) != NULL)
{
if (GET_CODE (desc) == DEFINE_INSN)
- {
- record_insn_name (insn_code_number, XSTR (desc, 0));
- gen_insn (desc, insn_code_number);
- }
+ gen_insn (desc, insn_code_number);
else if (GET_CODE (desc) == DEFINE_PEEPHOLE)
{
@@ -493,49 +489,3 @@ main (int argc, char **argv)
fflush (stdout);
return (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
}
-
-/* Define this so we can link with print-rtl.o to get debug_rtx function. */
-
-/* Holds an array of names indexed by insn_code_number. */
-static char **insn_name_ptr = 0;
-static int insn_name_ptr_size = 0;
-
-const char *
-get_insn_name (int code ATTRIBUTE_UNUSED)
-{
- if (code < insn_name_ptr_size)
- return insn_name_ptr[code];
- else
- return NULL;
-}
-
-static void
-record_insn_name (int code, const char *name)
-{
- static const char *last_real_name = "insn";
- static int last_real_code = 0;
- char *new;
-
- if (insn_name_ptr_size <= code)
- {
- int new_size;
- new_size = (insn_name_ptr_size ? insn_name_ptr_size * 2 : 512);
- insn_name_ptr = xrealloc (insn_name_ptr, sizeof(char *) * new_size);
- memset (insn_name_ptr + insn_name_ptr_size, 0,
- sizeof(char *) * (new_size - insn_name_ptr_size));
- insn_name_ptr_size = new_size;
- }
-
- if (!name || name[0] == '\0')
- {
- new = xmalloc (strlen (last_real_name) + 10);
- sprintf (new, "%s+%d", last_real_name, code - last_real_code);
- }
- else
- {
- last_real_name = new = xstrdup (name);
- last_real_code = code;
- }
-
- insn_name_ptr[code] = new;
-}