aboutsummaryrefslogtreecommitdiff
path: root/gcc/rtlanal.c
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2009-04-16 16:08:04 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2009-04-16 16:08:04 +0000
commitefc0b2bd809d65e812b3022623b5e5adbc681ba2 (patch)
tree3ebbcbf49394dbd129b5e797695277272a56d921 /gcc/rtlanal.c
parent6080348f0a75caa10df4208617d9247d56e85329 (diff)
downloadgcc-efc0b2bd809d65e812b3022623b5e5adbc681ba2.zip
gcc-efc0b2bd809d65e812b3022623b5e5adbc681ba2.tar.gz
gcc-efc0b2bd809d65e812b3022623b5e5adbc681ba2.tar.bz2
rtlanal.c (alloc_reg_note): New function, broken out of add_reg_note.
* rtlanal.c (alloc_reg_note): New function, broken out of add_reg_note. (add_reg_note): Call alloc_reg_note. * rtl.h (alloc_reg_note): Declare. * combine.c (try_combine): Use alloc_reg_note. (recog_for_combine, move_deaths): Likewise. (distribute_notes): Use alloc_reg_note and add_reg_note. * haifa-sched.c (sched_create_recovery_edges): Use add_reg_note. * combine-stack-adj.c (adjust_frame_related_expr): Likewise. * reload1.c (eliminate_regs_1): Use alloc_reg_note. From-SVN: r146201
Diffstat (limited to 'gcc/rtlanal.c')
-rw-r--r--gcc/rtlanal.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index 73d3b08..d15dbe2 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -1865,10 +1865,11 @@ find_regno_fusage (const_rtx insn, enum rtx_code code, unsigned int regno)
}
-/* Add register note with kind KIND and datum DATUM to INSN. */
+/* Allocate a register note with kind KIND and datum DATUM. LIST is
+ stored as the pointer to the next register note. */
-void
-add_reg_note (rtx insn, enum reg_note kind, rtx datum)
+rtx
+alloc_reg_note (enum reg_note kind, rtx datum, rtx list)
{
rtx note;
@@ -1881,16 +1882,24 @@ add_reg_note (rtx insn, enum reg_note kind, rtx datum)
/* These types of register notes use an INSN_LIST rather than an
EXPR_LIST, so that copying is done right and dumps look
better. */
- note = alloc_INSN_LIST (datum, REG_NOTES (insn));
+ note = alloc_INSN_LIST (datum, list);
PUT_REG_NOTE_KIND (note, kind);
break;
default:
- note = alloc_EXPR_LIST (kind, datum, REG_NOTES (insn));
+ note = alloc_EXPR_LIST (kind, datum, list);
break;
}
- REG_NOTES (insn) = note;
+ return note;
+}
+
+/* Add register note with kind KIND and datum DATUM to INSN. */
+
+void
+add_reg_note (rtx insn, enum reg_note kind, rtx datum)
+{
+ REG_NOTES (insn) = alloc_reg_note (kind, datum, REG_NOTES (insn));
}
/* Remove register note NOTE from the REG_NOTES of INSN. */
@@ -5025,4 +5034,3 @@ constant_pool_constant_p (rtx x)
x = avoid_constant_pool_reference (x);
return GET_CODE (x) == CONST_DOUBLE;
}
-