From a1950df341b382e455df8f1e58fe29242cc55c08 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Tue, 9 Sep 2014 15:20:07 +0000 Subject: INSN_LOCATION takes an rtx_insn gcc/ChangeLog: 2014-09-09 David Malcolm * rtl.h (INSN_LOCATION): Strengthen param from const_rtx to const rtx_insn *, and from rtx to rtx_insn * for the other overloaded variant. (RTL_LOCATION): Add a checked cast to rtx_insn * when invoking INSN_LOCATION, since we know INSN_P holds. (insn_line): Strengthen param from const_rtx to const rtx_insn *. (insn_file): Likewise. (insn_scope): Likewise. (insn_location): Likewise. * config/mips/mips.c (mips16_gp_pseudo_reg): Strengthen local "insn" from rtx to rtx_insn *, introducing a new local rtx "set" for the result of gen_load_const_gp. * config/rs6000/rs6000-protos.h (output_call): Strengthen first param from rtx to rtx_insn *. * config/rs6000/rs6000.c (output_call): Likewise. * dwarf2out.c (dwarf2out_var_location): Likewise for local "prev", introducing a checked cast to rtx_sequence * and use of the insn method. * emit-rtl.c (emit_copy_of_insn_after): Strengthen both params from rtx to rtx_insn *. (insn_scope): Strengthen param from const_rtx to const rtx_insn *. (insn_line): Likewise. (insn_file): Likewise. (insn_location): Likewise. * emit-rtl.h (emit_copy_of_insn_after): Strengthen both params from rtx to rtx_insn *. * print-rtl.c (print_rtx): Introduce local "in_insn" via a checked cast, using it for calls to INSN_HAS_LOCATION and insn_location. * recog.c (peep2_attempt): Introduce local rtx_insn * "peepinsn" via a checked cast. * reorg.c (relax_delay_slots): Strengthen locals named "after" from rtx to rtx_insn *; use methods of "pat" for type-safety. From-SVN: r215084 --- gcc/rtl.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'gcc/rtl.h') diff --git a/gcc/rtl.h b/gcc/rtl.h index fae3b5d..0f36c48 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -1369,12 +1369,12 @@ inline rtx& PATTERN (rtx insn) return XEXP (insn, 3); } -inline unsigned int INSN_LOCATION (const_rtx insn) +inline unsigned int INSN_LOCATION (const rtx_insn *insn) { return XUINT (insn, 4); } -inline unsigned int& INSN_LOCATION (rtx insn) +inline unsigned int& INSN_LOCATION (rtx_insn *insn) { return XUINT (insn, 4); } @@ -1386,7 +1386,8 @@ inline bool INSN_HAS_LOCATION (const rtx_insn *insn) /* LOCATION of an RTX if relevant. */ #define RTL_LOCATION(X) (INSN_P (X) ? \ - INSN_LOCATION (X) : UNKNOWN_LOCATION) + INSN_LOCATION (as_a (X)) \ + : UNKNOWN_LOCATION) /* Code number of instruction, from when it was recognized. -1 means this instruction has not been recognized yet. */ @@ -2644,10 +2645,10 @@ extern rtx_insn *next_cc0_user (rtx); extern rtx_insn *prev_cc0_setter (rtx); /* In emit-rtl.c */ -extern int insn_line (const_rtx); -extern const char * insn_file (const_rtx); -extern tree insn_scope (const_rtx); -extern expanded_location insn_location (const_rtx); +extern int insn_line (const rtx_insn *); +extern const char * insn_file (const rtx_insn *); +extern tree insn_scope (const rtx_insn *); +extern expanded_location insn_location (const rtx_insn *); extern location_t prologue_location, epilogue_location; /* In jump.c */ -- cgit v1.1