summaryrefslogtreecommitdiff
path: root/gcc/genpreds.c
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2015-07-16 13:52:22 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2015-07-16 13:52:22 +0000
commitc04601c11c49d37df11fc0e8b598a5ceb9a8d922 (patch)
tree9d8586f4a5e07a89b18a2e4fb2c2f801fafb90b8 /gcc/genpreds.c
parent5d1f193229bf236d8a87f17ae23b02c0dd066a22 (diff)
downloadgcc-c04601c11c49d37df11fc0e8b598a5ceb9a8d922.tar.gz
gcc/
* read-md.h (message_with_line, error_with_line): Delete. * read-md.c (message_with_line, error_with_line): Delete. * gensupport.h: Include read-md.h. (md_rtx_info): New structure. (read_md_rtx): Use it. Return a bool success value. * gensupport.c (read_md_rtx): Likewise. * genattr-common.c (gen_attr): Take an md_rtx_info rather than an rtx. (main): Update after interface changes. * genattr.c (gen_attr): Take an md_rtx_info rather than an rtx. (main): Update after interface changes. * genattrtab.c (insn_code_number): Delete. (optimize_attrs): Add a max_insn_code parameter and use it instead of insn_code_number. (gen_attr): Take an md_rtx_info rather than an rtx and lineno. Use *_at rather than *_with_line functions. (gen_insn): Likewise. (gen_delay): Likewise. (gen_insn_reserv): Likewise. (gen_bypass): Take an md_rtx_info rather than an rtx. (main): Update after interface changes. Use a local max_insn_code variable instead of insn_code_number. * genautomata.c (gen_cpu_unit): Take an md_rtx_info rather than an rtx. Use fatal_at rather than fatal. (gen_query_cpu_unit, gen_bypass, gen_excl_set) (gen_presence_absence_set, gen_presence_set, gen_final_presence_set) (gen_absence_set, gen_final_absence_set, gen_automaton) (gen_automata_option, gen_reserv, gen_insn_reserv): Likewise. (main): Update after interface changes. * gencodes.c (gen_insn): Take an md_rtx_info rather than an rtx and code number. (main): Update after interface changes. * genconditions.c (main): Use new read_md_rtx interface. * genconfig.c (gen_insn): Take an md_rtx_info rather than an rtx. (gen_expand, gen_split, gen_peephole, gen_peephole2): Likewise. (main): Update after interface changes. * genemit.c (insn_code_number, insn_index_number): Delete. (gen_insn): Take an md_rtx_info rather than an rtx and lineno. Use fatal_at rather than fatal. (gen_expand): Take an md_rtx_info rather than an rtx. Use fatal_at rather than fatal. (gen_split): Likewise. (main): Update after interface changes. * genextract.c (line_no): Delete. (gen_insn): Take an md_rtx_info rather than an rtx and lineno. Update call to walk_rtx. (VEC_safe_set_locstr): Add an md_rtx_info argument. Use message_at rather than message_with_line. (walk_rtx): Add an md_rtx_info argument. Update call to VEC_safe_set_locstr. (main): Update after interface changes. * genflags.c (gen_insn): Take an md_rtx_info rather than an rtx and lineno. Use error_at rather than separate message_with_line calls and have_error assignments. (main): Update after interface changes. * genmddump.c (main): Use new read_md_rtx interface. * genopinit.c (insn): Take an md_rtx_info rather than an rtx. (main): Update after interface changes. * genoutput.c (next_code_number): Delete. (gen_insn): Take an md_rtx_info rather than an rtx and lineno. (gen_peephole, gen_expand, gen_split): Likewise. (note_constraint): Likewise. Use *_at rather than *_with_line functions. (main): Update after interface changes. * genpeep.c (gen_peephole): Take an md_rtx_info rather than an rtx and lineno. (main): Update after interface changes. * genpreds.c (process_define_predicate): Take an md_rtx_info rather than an rtx and lineno. (process_define_constraint): Likewise. (process_define_register_constraint): Likewise. (main): Update after interface changes. * genrecog.c (next_insn_code, pattern_lineno): Delete. (validate_pattern): Replace top-level rtx with an md_rtx_info. Use *_at rather than *_with_line functions. (match_pattern_2): Likewise. (match_pattern_1, match_pattern): Add an md_rtx_info parameter. (get_peephole2_pattern): Take an md_rtx_info rather than an rtvec. Use *_at rather than *_with_line functions. * gentarget-def.c (add_insn): New function. (main): Use it. Use new read_md_rtx interface. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@225883 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/genpreds.c')
-rw-r--r--gcc/genpreds.c35
1 files changed, 16 insertions, 19 deletions
diff --git a/gcc/genpreds.c b/gcc/genpreds.c
index 87d56f73fff..eac2180e246 100644
--- a/gcc/genpreds.c
+++ b/gcc/genpreds.c
@@ -91,10 +91,9 @@ validate_exp (rtx exp, const char *name, file_location loc)
/* Predicates are defined with (define_predicate) or
(define_special_predicate) expressions in the machine description. */
static void
-process_define_predicate (rtx defn, int lineno)
+process_define_predicate (md_rtx_info *info)
{
- validate_exp (XEXP (defn, 1), XSTR (defn, 0),
- file_location (read_md_filename, lineno));
+ validate_exp (XEXP (info->def, 1), XSTR (info->def, 0), info->loc);
}
/* Given a predicate, if it has an embedded C block, write the block
@@ -936,20 +935,20 @@ add_constraint (const char *name, const char *regclass,
/* Process a DEFINE_CONSTRAINT, DEFINE_MEMORY_CONSTRAINT, or
DEFINE_ADDRESS_CONSTRAINT expression, C. */
static void
-process_define_constraint (rtx c, int lineno)
+process_define_constraint (md_rtx_info *info)
{
- add_constraint (XSTR (c, 0), 0, XEXP (c, 2),
- GET_CODE (c) == DEFINE_MEMORY_CONSTRAINT,
- GET_CODE (c) == DEFINE_ADDRESS_CONSTRAINT,
- file_location (read_md_filename, lineno));
+ add_constraint (XSTR (info->def, 0), 0, XEXP (info->def, 2),
+ GET_CODE (info->def) == DEFINE_MEMORY_CONSTRAINT,
+ GET_CODE (info->def) == DEFINE_ADDRESS_CONSTRAINT,
+ info->loc);
}
/* Process a DEFINE_REGISTER_CONSTRAINT expression, C. */
static void
-process_define_register_constraint (rtx c, int lineno)
+process_define_register_constraint (md_rtx_info *info)
{
- add_constraint (XSTR (c, 0), XSTR (c, 1), 0, false, false,
- file_location (read_md_filename, lineno));
+ add_constraint (XSTR (info->def, 0), XSTR (info->def, 1),
+ 0, false, false, info->loc);
}
/* Put the constraints into enum order. We want to keep constraints
@@ -1584,31 +1583,29 @@ parse_option (const char *opt)
int
main (int argc, char **argv)
{
- rtx defn;
- int pattern_lineno, next_insn_code = 0;
-
progname = argv[0];
if (argc <= 1)
fatal ("no input file name");
if (!init_rtx_reader_args_cb (argc, argv, parse_option))
return FATAL_EXIT_CODE;
- while ((defn = read_md_rtx (&pattern_lineno, &next_insn_code)) != 0)
- switch (GET_CODE (defn))
+ md_rtx_info info;
+ while (read_md_rtx (&info))
+ switch (GET_CODE (info.def))
{
case DEFINE_PREDICATE:
case DEFINE_SPECIAL_PREDICATE:
- process_define_predicate (defn, pattern_lineno);
+ process_define_predicate (&info);
break;
case DEFINE_CONSTRAINT:
case DEFINE_MEMORY_CONSTRAINT:
case DEFINE_ADDRESS_CONSTRAINT:
- process_define_constraint (defn, pattern_lineno);
+ process_define_constraint (&info);
break;
case DEFINE_REGISTER_CONSTRAINT:
- process_define_register_constraint (defn, pattern_lineno);
+ process_define_register_constraint (&info);
break;
default: