emit-rtl.c (get_first_nonnote_insn, [...]): New functions.

* emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn): New
	functions.
	* rtl.h (get_first_nonnote_insn, get_last_nonnote_insn): Declare.
	* avr/avr.c (avr_output_function_epilogue): Use above to determine
	function size.
	* pa/pa.c (pa_output_function_prologue): Likewise.

From-SVN: r54304
This commit is contained in:
John David Anglin 2002-06-06 06:37:37 +00:00 committed by John David Anglin
parent 2ff581c3af
commit 2a496e8b74
5 changed files with 50 additions and 3 deletions

View File

@ -1,3 +1,12 @@
2002-06-06 John David Anglin <dave@hiauly1.hia.nrc.ca>
* emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn): New
functions.
* rtl.h (get_first_nonnote_insn, get_last_nonnote_insn): Declare.
* avr/avr.c (avr_output_function_epilogue): Use above to determine
function size.
* pa/pa.c (pa_output_function_prologue): Likewise.
2002-06-05 David S. Miller <davem@redhat.com>
* integrate.c (subst_constants): Handle 'B' RTL format.

View File

@ -749,8 +749,8 @@ avr_output_function_epilogue (file, size)
interrupt_func_p = interrupt_function_p (current_function_decl);
signal_func_p = signal_function_p (current_function_decl);
main_p = MAIN_NAME_P (DECL_NAME (current_function_decl));
function_size = (INSN_ADDRESSES (INSN_UID (get_last_insn ()))
- INSN_ADDRESSES (INSN_UID (get_insns ())));
function_size = (INSN_ADDRESSES (INSN_UID (get_last_nonnote_insn ()))
- INSN_ADDRESSES (INSN_UID (get_first_nonnote_insn ())));
function_size += jump_tables_size;
live_seq = sequent_regs_live ();
minimize = (TARGET_CALL_PROLOGUES

View File

@ -3179,7 +3179,7 @@ pa_output_function_prologue (file, size)
{
unsigned int old_total = total_code_bytes;
total_code_bytes += INSN_ADDRESSES (INSN_UID (get_last_insn ()));
total_code_bytes += INSN_ADDRESSES (INSN_UID (get_last_nonnote_insn ()));
total_code_bytes += FUNCTION_BOUNDARY / BITS_PER_UNIT;
/* Be prepared to handle overflows. */

View File

@ -2710,6 +2710,42 @@ get_last_insn_anywhere ()
return 0;
}
/* Return the first nonnote insn emitted in current sequence or current
function. This routine looks inside SEQUENCEs. */
rtx
get_first_nonnote_insn ()
{
rtx insn = first_insn;
while (insn)
{
insn = next_insn (insn);
if (insn == 0 || GET_CODE (insn) != NOTE)
break;
}
return insn;
}
/* Return the last nonnote insn emitted in current sequence or current
function. This routine looks inside SEQUENCEs. */
rtx
get_last_nonnote_insn ()
{
rtx insn = last_insn;
while (insn)
{
insn = previous_insn (insn);
if (insn == 0 || GET_CODE (insn) != NOTE)
break;
}
return insn;
}
/* Return a number larger than any instruction's uid in this function. */
int

View File

@ -1342,6 +1342,8 @@ extern rtx get_insns PARAMS ((void));
extern const char *get_insn_name PARAMS ((int));
extern rtx get_last_insn PARAMS ((void));
extern rtx get_last_insn_anywhere PARAMS ((void));
extern rtx get_first_nonnote_insn PARAMS ((void));
extern rtx get_last_nonnote_insn PARAMS ((void));
extern void start_sequence PARAMS ((void));
extern void push_to_sequence PARAMS ((rtx));
extern void end_sequence PARAMS ((void));