Commit 598d62da by David Malcolm Committed by David Malcolm

var-tracking.c: Use rtx_insn

gcc/
2014-08-23  David Malcolm  <dmalcolm@redhat.com>

	* var-tracking.c (struct micro_operation_def): Strengthen field
	"insn" from rtx to rtx_insn *.
	(struct emit_note_data_def): Likewise.
	(insn_stack_adjust_offset_pre_post): Likewise for param "insn".
	(vt_stack_adjustments): Likewise for local "insn".
	(adjust_insn): Likewise for param "insn".
	(val_store): Likewise.
	(val_resolve): Likewise.
	(struct count_use_info): Likewise for field "insn".
	(log_op_type): Likewise for param "insn".
	(reverse_op): Likewise.
	(prepare_call_arguments): Likewise.
	(add_with_sets):  The initial param takes an insn, but we can't
	yet strengthen it from rtx to rtx_insn * since it's used as a
	cselib_record_sets_hook callback.  For now rename initial param
	from "insn" to "uncast_insn", and introduce a local "insn" of
	the stronger rtx_insn * type, with a checked cast.
	(compute_bb_dataflow): Strengthen local "insn" from rtx to
	rtx_insn *.
	(emit_note_insn_var_location): Likewise.
	(emit_notes_for_changes): Likewise.
	(emit_notes_for_differences): Likewise.
	(next_non_note_insn_var_location): Likewise for return type and
	for param "insn".
	(emit_notes_in_bb): Likewise for locals "insn" and "next_insn".
	(vt_initialize): Likewise for local "insn".
	(delete_debug_insns): Likewise for locals "insn" and "next".

From-SVN: r214392
parent 3ddabbd7
2014-08-23 David Malcolm <dmalcolm@redhat.com> 2014-08-23 David Malcolm <dmalcolm@redhat.com>
* var-tracking.c (struct micro_operation_def): Strengthen field
"insn" from rtx to rtx_insn *.
(struct emit_note_data_def): Likewise.
(insn_stack_adjust_offset_pre_post): Likewise for param "insn".
(vt_stack_adjustments): Likewise for local "insn".
(adjust_insn): Likewise for param "insn".
(val_store): Likewise.
(val_resolve): Likewise.
(struct count_use_info): Likewise for field "insn".
(log_op_type): Likewise for param "insn".
(reverse_op): Likewise.
(prepare_call_arguments): Likewise.
(add_with_sets): The initial param takes an insn, but we can't
yet strengthen it from rtx to rtx_insn * since it's used as a
cselib_record_sets_hook callback. For now rename initial param
from "insn" to "uncast_insn", and introduce a local "insn" of
the stronger rtx_insn * type, with a checked cast.
(compute_bb_dataflow): Strengthen local "insn" from rtx to
rtx_insn *.
(emit_note_insn_var_location): Likewise.
(emit_notes_for_changes): Likewise.
(emit_notes_for_differences): Likewise.
(next_non_note_insn_var_location): Likewise for return type and
for param "insn".
(emit_notes_in_bb): Likewise for locals "insn" and "next_insn".
(vt_initialize): Likewise for local "insn".
(delete_debug_insns): Likewise for locals "insn" and "next".
2014-08-23 David Malcolm <dmalcolm@redhat.com>
* varasm.c (mark_constants): Strengthen param "insn" from rtx to * varasm.c (mark_constants): Strengthen param "insn" from rtx to
rtx_insn *. rtx_insn *.
(mark_constant_pool): Likewise for local "insn". (mark_constant_pool): Likewise for local "insn".
......
...@@ -179,7 +179,7 @@ typedef struct micro_operation_def ...@@ -179,7 +179,7 @@ typedef struct micro_operation_def
instruction or note in the original flow (before any var-tracking instruction or note in the original flow (before any var-tracking
notes are inserted, to simplify emission of notes), for MO_SET notes are inserted, to simplify emission of notes), for MO_SET
and MO_CLOBBER. */ and MO_CLOBBER. */
rtx insn; rtx_insn *insn;
union { union {
/* Location. For MO_SET and MO_COPY, this is the SET that /* Location. For MO_SET and MO_COPY, this is the SET that
...@@ -509,7 +509,7 @@ typedef variable_table_type::iterator variable_iterator_type; ...@@ -509,7 +509,7 @@ typedef variable_table_type::iterator variable_iterator_type;
typedef struct emit_note_data_def typedef struct emit_note_data_def
{ {
/* The instruction which the note will be emitted before/after. */ /* The instruction which the note will be emitted before/after. */
rtx insn; rtx_insn *insn;
/* Where the note will be emitted (before/after insn)? */ /* Where the note will be emitted (before/after insn)? */
enum emit_note_where where; enum emit_note_where where;
...@@ -622,7 +622,7 @@ static bool cselib_hook_called; ...@@ -622,7 +622,7 @@ static bool cselib_hook_called;
/* Local function prototypes. */ /* Local function prototypes. */
static void stack_adjust_offset_pre_post (rtx, HOST_WIDE_INT *, static void stack_adjust_offset_pre_post (rtx, HOST_WIDE_INT *,
HOST_WIDE_INT *); HOST_WIDE_INT *);
static void insn_stack_adjust_offset_pre_post (rtx, HOST_WIDE_INT *, static void insn_stack_adjust_offset_pre_post (rtx_insn *, HOST_WIDE_INT *,
HOST_WIDE_INT *); HOST_WIDE_INT *);
static bool vt_stack_adjustments (void); static bool vt_stack_adjustments (void);
...@@ -793,7 +793,7 @@ stack_adjust_offset_pre_post (rtx pattern, HOST_WIDE_INT *pre, ...@@ -793,7 +793,7 @@ stack_adjust_offset_pre_post (rtx pattern, HOST_WIDE_INT *pre,
PRE- and POST-modifying stack pointer. */ PRE- and POST-modifying stack pointer. */
static void static void
insn_stack_adjust_offset_pre_post (rtx insn, HOST_WIDE_INT *pre, insn_stack_adjust_offset_pre_post (rtx_insn *insn, HOST_WIDE_INT *pre,
HOST_WIDE_INT *post) HOST_WIDE_INT *post)
{ {
rtx pattern; rtx pattern;
...@@ -862,7 +862,7 @@ vt_stack_adjustments (void) ...@@ -862,7 +862,7 @@ vt_stack_adjustments (void)
/* Check if the edge destination has been visited yet. */ /* Check if the edge destination has been visited yet. */
if (!VTI (dest)->visited) if (!VTI (dest)->visited)
{ {
rtx insn; rtx_insn *insn;
HOST_WIDE_INT pre, post, offset; HOST_WIDE_INT pre, post, offset;
VTI (dest)->visited = true; VTI (dest)->visited = true;
VTI (dest)->in.stack_adjust = offset = VTI (src)->out.stack_adjust; VTI (dest)->in.stack_adjust = offset = VTI (src)->out.stack_adjust;
...@@ -1198,7 +1198,7 @@ adjust_mem_stores (rtx loc, const_rtx expr, void *data) ...@@ -1198,7 +1198,7 @@ adjust_mem_stores (rtx loc, const_rtx expr, void *data)
as other sets to the insn. */ as other sets to the insn. */
static void static void
adjust_insn (basic_block bb, rtx insn) adjust_insn (basic_block bb, rtx_insn *insn)
{ {
struct adjust_mem_data amd; struct adjust_mem_data amd;
rtx set; rtx set;
...@@ -2471,7 +2471,8 @@ val_bind (dataflow_set *set, rtx val, rtx loc, bool modified) ...@@ -2471,7 +2471,8 @@ val_bind (dataflow_set *set, rtx val, rtx loc, bool modified)
values bound to it. */ values bound to it. */
static void static void
val_store (dataflow_set *set, rtx val, rtx loc, rtx insn, bool modified) val_store (dataflow_set *set, rtx val, rtx loc, rtx_insn *insn,
bool modified)
{ {
cselib_val *v = CSELIB_VAL_PTR (val); cselib_val *v = CSELIB_VAL_PTR (val);
...@@ -2600,7 +2601,7 @@ val_reset (dataflow_set *set, decl_or_value dv) ...@@ -2600,7 +2601,7 @@ val_reset (dataflow_set *set, decl_or_value dv)
value. */ value. */
static void static void
val_resolve (dataflow_set *set, rtx val, rtx loc, rtx insn) val_resolve (dataflow_set *set, rtx val, rtx loc, rtx_insn *insn)
{ {
decl_or_value dv = dv_from_value (val); decl_or_value dv = dv_from_value (val);
...@@ -5295,7 +5296,7 @@ var_lowpart (enum machine_mode mode, rtx loc) ...@@ -5295,7 +5296,7 @@ var_lowpart (enum machine_mode mode, rtx loc)
struct count_use_info struct count_use_info
{ {
/* The insn where the RTX is. */ /* The insn where the RTX is. */
rtx insn; rtx_insn *insn;
/* The basic block where insn is. */ /* The basic block where insn is. */
basic_block bb; basic_block bb;
...@@ -5477,7 +5478,7 @@ use_type (rtx loc, struct count_use_info *cui, enum machine_mode *modep) ...@@ -5477,7 +5478,7 @@ use_type (rtx loc, struct count_use_info *cui, enum machine_mode *modep)
INSN of BB. */ INSN of BB. */
static inline void static inline void
log_op_type (rtx x, basic_block bb, rtx insn, log_op_type (rtx x, basic_block bb, rtx_insn *insn,
enum micro_operation_type mopt, FILE *out) enum micro_operation_type mopt, FILE *out)
{ {
fprintf (out, "bb %i op %i insn %i %s ", fprintf (out, "bb %i op %i insn %i %s ",
...@@ -5729,7 +5730,7 @@ add_uses_1 (rtx *x, void *cui) ...@@ -5729,7 +5730,7 @@ add_uses_1 (rtx *x, void *cui)
no longer live we can express its value as VAL - 6. */ no longer live we can express its value as VAL - 6. */
static void static void
reverse_op (rtx val, const_rtx expr, rtx insn) reverse_op (rtx val, const_rtx expr, rtx_insn *insn)
{ {
rtx src, arg, ret; rtx src, arg, ret;
cselib_val *v; cselib_val *v;
...@@ -6127,7 +6128,7 @@ static rtx call_arguments; ...@@ -6127,7 +6128,7 @@ static rtx call_arguments;
/* Compute call_arguments. */ /* Compute call_arguments. */
static void static void
prepare_call_arguments (basic_block bb, rtx insn) prepare_call_arguments (basic_block bb, rtx_insn *insn)
{ {
rtx link, x, call; rtx link, x, call;
rtx prev, cur, next; rtx prev, cur, next;
...@@ -6463,8 +6464,9 @@ prepare_call_arguments (basic_block bb, rtx insn) ...@@ -6463,8 +6464,9 @@ prepare_call_arguments (basic_block bb, rtx insn)
first place, in which case sets and n_sets will be 0). */ first place, in which case sets and n_sets will be 0). */
static void static void
add_with_sets (rtx insn, struct cselib_set *sets, int n_sets) add_with_sets (rtx uncast_insn, struct cselib_set *sets, int n_sets)
{ {
rtx_insn *insn = as_a <rtx_insn *> (uncast_insn);
basic_block bb = BLOCK_FOR_INSN (insn); basic_block bb = BLOCK_FOR_INSN (insn);
int n1, n2; int n1, n2;
struct count_use_info cui; struct count_use_info cui;
...@@ -6661,7 +6663,7 @@ compute_bb_dataflow (basic_block bb) ...@@ -6661,7 +6663,7 @@ compute_bb_dataflow (basic_block bb)
FOR_EACH_VEC_ELT (VTI (bb)->mos, i, mo) FOR_EACH_VEC_ELT (VTI (bb)->mos, i, mo)
{ {
rtx insn = mo->insn; rtx_insn *insn = mo->insn;
switch (mo->type) switch (mo->type)
{ {
...@@ -8586,7 +8588,7 @@ int ...@@ -8586,7 +8588,7 @@ int
emit_note_insn_var_location (variable_def **varp, emit_note_data *data) emit_note_insn_var_location (variable_def **varp, emit_note_data *data)
{ {
variable var = *varp; variable var = *varp;
rtx insn = data->insn; rtx_insn *insn = data->insn;
enum emit_note_where where = data->where; enum emit_note_where where = data->where;
variable_table_type *vars = data->vars; variable_table_type *vars = data->vars;
rtx_note *note; rtx_note *note;
...@@ -8967,7 +8969,7 @@ process_changed_values (variable_table_type *htab) ...@@ -8967,7 +8969,7 @@ process_changed_values (variable_table_type *htab)
the notes shall be emitted before of after instruction INSN. */ the notes shall be emitted before of after instruction INSN. */
static void static void
emit_notes_for_changes (rtx insn, enum emit_note_where where, emit_notes_for_changes (rtx_insn *insn, enum emit_note_where where,
shared_hash vars) shared_hash vars)
{ {
emit_note_data data; emit_note_data data;
...@@ -9085,7 +9087,7 @@ emit_notes_for_differences_2 (variable_def **slot, variable_table_type *old_vars ...@@ -9085,7 +9087,7 @@ emit_notes_for_differences_2 (variable_def **slot, variable_table_type *old_vars
NEW_SET. */ NEW_SET. */
static void static void
emit_notes_for_differences (rtx insn, dataflow_set *old_set, emit_notes_for_differences (rtx_insn *insn, dataflow_set *old_set,
dataflow_set *new_set) dataflow_set *new_set)
{ {
shared_hash_htab (old_set->vars) shared_hash_htab (old_set->vars)
...@@ -9099,8 +9101,8 @@ emit_notes_for_differences (rtx insn, dataflow_set *old_set, ...@@ -9099,8 +9101,8 @@ emit_notes_for_differences (rtx insn, dataflow_set *old_set,
/* Return the next insn after INSN that is not a NOTE_INSN_VAR_LOCATION. */ /* Return the next insn after INSN that is not a NOTE_INSN_VAR_LOCATION. */
static rtx static rtx_insn *
next_non_note_insn_var_location (rtx insn) next_non_note_insn_var_location (rtx_insn *insn)
{ {
while (insn) while (insn)
{ {
...@@ -9127,8 +9129,8 @@ emit_notes_in_bb (basic_block bb, dataflow_set *set) ...@@ -9127,8 +9129,8 @@ emit_notes_in_bb (basic_block bb, dataflow_set *set)
FOR_EACH_VEC_ELT (VTI (bb)->mos, i, mo) FOR_EACH_VEC_ELT (VTI (bb)->mos, i, mo)
{ {
rtx insn = mo->insn; rtx_insn *insn = mo->insn;
rtx next_insn = next_non_note_insn_var_location (insn); rtx_insn *next_insn = next_non_note_insn_var_location (insn);
switch (mo->type) switch (mo->type)
{ {
...@@ -10050,7 +10052,7 @@ vt_initialize (void) ...@@ -10050,7 +10052,7 @@ vt_initialize (void)
FOR_EACH_BB_FN (bb, cfun) FOR_EACH_BB_FN (bb, cfun)
{ {
rtx insn; rtx_insn *insn;
HOST_WIDE_INT pre, post = 0; HOST_WIDE_INT pre, post = 0;
basic_block first_bb, last_bb; basic_block first_bb, last_bb;
...@@ -10186,7 +10188,7 @@ static void ...@@ -10186,7 +10188,7 @@ static void
delete_debug_insns (void) delete_debug_insns (void)
{ {
basic_block bb; basic_block bb;
rtx insn, next; rtx_insn *insn, *next;
if (!MAY_HAVE_DEBUG_INSNS) if (!MAY_HAVE_DEBUG_INSNS)
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment