diff options
author | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-01-23 15:15:12 +0000 |
---|---|---|
committer | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-01-23 15:15:12 +0000 |
commit | 343695df238d8e043fe83c8b0cce11b73f2e2cba (patch) | |
tree | 04e7c2430e813b518ab2f021d422bd49f8d865ec /gcc/genrecog.c | |
parent | af908c02d4c893024a3ccfa73244b96a10caeb2f (diff) | |
download | gcc-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/genrecog.c')
-rw-r--r-- | gcc/genrecog.c | 52 |
1 files changed, 1 insertions, 51 deletions
diff --git a/gcc/genrecog.c b/gcc/genrecog.c index 82248482de0..cb86849e936 100644 --- a/gcc/genrecog.c +++ b/gcc/genrecog.c @@ -61,10 +61,6 @@ #define OUTPUT_LABEL(INDENT_STRING, LABEL_NUMBER) \ printf("%sL%d: ATTRIBUTE_UNUSED_LABEL\n", (INDENT_STRING), (LABEL_NUMBER)) -/* Holds an array of names indexed by insn_code_number. */ -static char **insn_name_ptr = 0; -static int insn_name_ptr_size = 0; - /* A listhead of decision trees. The alternatives to a node are kept in a doubly-linked list so we can easily add nodes to the proper place when merging. */ @@ -473,9 +469,6 @@ static struct decision_head make_insn_sequence static void process_tree (struct decision_head *, enum routine_type); -static void record_insn_name - (int, const char *); - static void debug_decision_0 (struct decision *, int, int); static void debug_decision_1 @@ -2189,7 +2182,7 @@ write_action (struct decision *p, struct decision_test *test, indent, test->u.insn.num_clobbers_to_add); printf ("%sreturn %d; /* %s */\n", indent, test->u.insn.code_number, - insn_name_ptr[test->u.insn.code_number]); + get_insn_name (test->u.insn.code_number)); break; case SPLIT: @@ -2548,8 +2541,6 @@ make_insn_sequence (rtx insn, enum routine_type type) /* We should never see an insn whose C test is false at compile time. */ gcc_assert (truth); - record_insn_name (next_insn_code, (type == RECOG ? XSTR (insn, 0) : NULL)); - c_test_pos[0] = '\0'; if (type == PEEPHOLE2) { @@ -2798,47 +2789,6 @@ main (int argc, char **argv) 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. */ -const char * -get_insn_name (int code) -{ - 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; -} - static void debug_decision_2 (struct decision_test *test) { |