From 95770ca3202ebd8529d202aaf4714343a2c4e14e Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Thu, 21 Aug 2014 07:49:28 +0000 Subject: Use rtx_insn internally within generated functions 2014-08-21 David Malcolm * recog.h (insn_output_fn): Update this function typedef to match the changes below to the generated output functions, strengthening the 2nd param from rtx to rtx_insn *. * final.c (get_insn_template): Add a checked cast to rtx_insn * on insn when invoking an output function, to match the new signature of insn_output_fn with a stronger second param. * genconditions.c (write_header): In the generated code for gencondmd.c, strengthen the global "insn" from rtx to rtx_insn * to match the other changes in this patch. * genemit.c (gen_split): Strengthen the 1st param "curr_insn" of the generated "gen_" functions from rtx to rtx_insn * within their implementations. * genrecog.c (write_subroutine): Strengthen the 2nd param "insn" of the subfunctions within the generated "recog_", "split", "peephole2" function trees from rtx to rtx_insn *. For now, the top-level generated functions ("recog", "split", "peephole2") continue to take a plain rtx for "insn", to avoid introducing dependencies on other patches. Rename this 2nd param from "insn" to "uncast_insn", and reintroduce "insn" as a local variable of type rtx_insn *, initialized at the top of the generated function with a checked cast on "uncast_insn". (make_insn_sequence): Strengthen the 1st param "curr_insn" of the generated "gen_" functions from rtx to rtx_insn * within their prototypes. * genoutput.c (process_template): Strengthen the 2nd param within the generated "output_" functions "insn" from rtx to rtx_insn *. From-SVN: r214257 --- gcc/genoutput.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/genoutput.c') diff --git a/gcc/genoutput.c b/gcc/genoutput.c index 7489d38..69d5ab0 100644 --- a/gcc/genoutput.c +++ b/gcc/genoutput.c @@ -643,7 +643,7 @@ process_template (struct data *d, const char *template_code) d->output_format = INSN_OUTPUT_FORMAT_FUNCTION; puts ("\nstatic const char *"); - printf ("output_%d (rtx *operands ATTRIBUTE_UNUSED, rtx insn ATTRIBUTE_UNUSED)\n", + printf ("output_%d (rtx *operands ATTRIBUTE_UNUSED, rtx_insn *insn ATTRIBUTE_UNUSED)\n", d->code_number); puts ("{"); print_md_ptr_loc (template_code); @@ -672,7 +672,7 @@ process_template (struct data *d, const char *template_code) d->output_format = INSN_OUTPUT_FORMAT_FUNCTION; puts ("\nstatic const char *"); printf ("output_%d (rtx *operands ATTRIBUTE_UNUSED, " - "rtx insn ATTRIBUTE_UNUSED)\n", d->code_number); + "rtx_insn *insn ATTRIBUTE_UNUSED)\n", d->code_number); puts ("{"); puts (" switch (which_alternative)\n {"); } -- cgit v1.1