From efc0b2bd809d65e812b3022623b5e5adbc681ba2 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 16 Apr 2009 16:08:04 +0000 Subject: 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 --- gcc/rtlanal.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'gcc/rtlanal.c') 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; } - -- cgit v1.1