Commit 5f2fc772 by Nathan Sidwell Committed by Nathan Sidwell

rtl.h (emit_line_note_after): Remove.

	* rtl.h (emit_line_note_after): Remove.
	(emit_note_copy_after, emit_note_copy): New.
	* emit-rtl.c (reorder_insns_with_line_notes): Replace
	emit_line_note_after with emit_note_copy_after.
	(emit_insn_after_with_line_notes): Likewise.
	(emit_line_note_after): Kill.
	(emit_note_copy_after): New.
	(emit_note_copy): New.
	* function.c (emit_return_into_block): Use emit_note_copy_after.
	(thread_prologue_and_epilogue_insns): Likewise.
	* integrate.c (expand_inline_function): Use emit_note_copy.
	(copy_insn_list): Likewise.
	* unroll.c (copy_loop_body): Likewise.
	* cfglayout.c (duplicate_insn_chain): Likewise.

From-SVN: r68767
parent 5b030314
2003-07-01 Nathan Sidwell <nathan@codesourcery.com> 2003-07-01 Nathan Sidwell <nathan@codesourcery.com>
* rtl.h (emit_line_note_after): Remove.
(emit_note_copy_after, emit_note_copy): New.
* emit-rtl.c (reorder_insns_with_line_notes): Replace
emit_line_note_after with emit_note_copy_after.
(emit_insn_after_with_line_notes): Likewise.
(emit_line_note_after): Kill.
(emit_note_copy_after): New.
(emit_note_copy): New.
* function.c (emit_return_into_block): Use emit_note_copy_after.
(thread_prologue_and_epilogue_insns): Likewise.
* integrate.c (expand_inline_function): Use emit_note_copy.
(copy_insn_list): Likewise.
* unroll.c (copy_loop_body): Likewise.
* cfglayout.c (duplicate_insn_chain): Likewise.
2003-07-01 Nathan Sidwell <nathan@codesourcery.com>
* c-tree.h (define_label): Replace filename and lineno arguments * c-tree.h (define_label): Replace filename and lineno arguments
with a location_t. with a location_t.
* c-decl.c (poplevel): Adjust define_label call. * c-decl.c (poplevel): Adjust define_label call.
......
...@@ -1008,8 +1008,7 @@ duplicate_insn_chain (rtx from, rtx to) ...@@ -1008,8 +1008,7 @@ duplicate_insn_chain (rtx from, rtx to)
abort (); abort ();
break; break;
case NOTE_INSN_REPEATED_LINE_NUMBER: case NOTE_INSN_REPEATED_LINE_NUMBER:
emit_line_note (NOTE_SOURCE_FILE (insn), emit_note_copy (insn);
NOTE_LINE_NUMBER (insn));
break; break;
default: default:
...@@ -1017,8 +1016,7 @@ duplicate_insn_chain (rtx from, rtx to) ...@@ -1017,8 +1016,7 @@ duplicate_insn_chain (rtx from, rtx to)
abort (); abort ();
/* It is possible that no_line_number is set and the note /* It is possible that no_line_number is set and the note
won't be emitted. */ won't be emitted. */
emit_line_note (NOTE_SOURCE_FILE (insn), emit_note_copy (insn);
NOTE_LINE_NUMBER (insn));
} }
break; break;
default: default:
......
...@@ -3869,13 +3869,9 @@ reorder_insns_with_line_notes (rtx from, rtx to, rtx after) ...@@ -3869,13 +3869,9 @@ reorder_insns_with_line_notes (rtx from, rtx to, rtx after)
return; return;
if (from_line) if (from_line)
emit_line_note_after (NOTE_SOURCE_FILE (from_line), emit_note_copy_after (from_line, after);
NOTE_LINE_NUMBER (from_line),
after);
if (after_line) if (after_line)
emit_line_note_after (NOTE_SOURCE_FILE (after_line), emit_note_copy_after (after_line, to);
NOTE_LINE_NUMBER (after_line),
to);
} }
/* Remove unnecessary notes from the instruction stream. */ /* Remove unnecessary notes from the instruction stream. */
...@@ -4295,14 +4291,10 @@ emit_insn_after_with_line_notes (rtx x, rtx after, rtx from) ...@@ -4295,14 +4291,10 @@ emit_insn_after_with_line_notes (rtx x, rtx after, rtx from)
rtx insn = emit_insn_after (x, after); rtx insn = emit_insn_after (x, after);
if (from_line) if (from_line)
emit_line_note_after (NOTE_SOURCE_FILE (from_line), emit_note_copy_after (from_line, after);
NOTE_LINE_NUMBER (from_line),
after);
if (after_line) if (after_line)
emit_line_note_after (NOTE_SOURCE_FILE (after_line), emit_note_copy_after (after_line, insn);
NOTE_LINE_NUMBER (after_line),
insn);
} }
/* Make an insn of code JUMP_INSN with body X /* Make an insn of code JUMP_INSN with body X
...@@ -4428,16 +4420,14 @@ emit_note_after (int subtype, rtx after) ...@@ -4428,16 +4420,14 @@ emit_note_after (int subtype, rtx after)
return note; return note;
} }
/* Emit a line note for FILE and LINE after the insn AFTER. */ /* Emit a copy of note ORIG after the insn AFTER. */
rtx rtx
emit_line_note_after (const char *file, int line, rtx after) emit_note_copy_after (rtx orig, rtx after)
{ {
rtx note; rtx note;
if (line < 0) if (NOTE_LINE_NUMBER (orig) >= 0 && no_line_numbers)
abort ();
if (no_line_numbers)
{ {
cur_insn_uid++; cur_insn_uid++;
return 0; return 0;
...@@ -4445,8 +4435,8 @@ emit_line_note_after (const char *file, int line, rtx after) ...@@ -4445,8 +4435,8 @@ emit_line_note_after (const char *file, int line, rtx after)
note = rtx_alloc (NOTE); note = rtx_alloc (NOTE);
INSN_UID (note) = cur_insn_uid++; INSN_UID (note) = cur_insn_uid++;
NOTE_SOURCE_FILE (note) = file; NOTE_LINE_NUMBER (note) = NOTE_LINE_NUMBER (orig);
NOTE_LINE_NUMBER (note) = line; NOTE_DATA (note) = NOTE_DATA (orig);
BLOCK_FOR_INSN (note) = NULL; BLOCK_FOR_INSN (note) = NULL;
add_insn_after (note, after); add_insn_after (note, after);
return note; return note;
...@@ -4704,7 +4694,31 @@ emit_line_note (const char *file, int line) ...@@ -4704,7 +4694,31 @@ emit_line_note (const char *file, int line)
note = emit_note (line); note = emit_note (line);
NOTE_SOURCE_FILE (note) = file; NOTE_SOURCE_FILE (note) = file;
return note;
}
/* Emit a copy of note ORIG. */
rtx
emit_note_copy (rtx orig)
{
rtx note;
if (NOTE_LINE_NUMBER (orig) >= 0 && no_line_numbers)
{
cur_insn_uid++;
return NULL_RTX;
}
note = rtx_alloc (NOTE);
INSN_UID (note) = cur_insn_uid++;
NOTE_DATA (note) = NOTE_DATA (orig);
NOTE_LINE_NUMBER (note) = NOTE_LINE_NUMBER (orig);
BLOCK_FOR_INSN (note) = NULL;
add_insn (note);
return note; return note;
} }
......
...@@ -7412,8 +7412,7 @@ emit_return_into_block (bb, line_note) ...@@ -7412,8 +7412,7 @@ emit_return_into_block (bb, line_note)
{ {
emit_jump_insn_after (gen_return (), bb->end); emit_jump_insn_after (gen_return (), bb->end);
if (line_note) if (line_note)
emit_line_note_after (NOTE_SOURCE_FILE (line_note), emit_note_copy_after (line_note, PREV_INSN (bb->end));
NOTE_LINE_NUMBER (line_note), PREV_INSN (bb->end));
} }
#endif /* HAVE_return */ #endif /* HAVE_return */
...@@ -7997,9 +7996,7 @@ epilogue_done: ...@@ -7997,9 +7996,7 @@ epilogue_done:
insn = PREV_INSN (insn)) insn = PREV_INSN (insn))
if (GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) > 0) if (GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) > 0)
{ {
emit_line_note_after (NOTE_SOURCE_FILE (insn), emit_note_copy_after (insn, prologue_end);
NOTE_LINE_NUMBER (insn),
prologue_end);
break; break;
} }
} }
......
...@@ -924,8 +924,8 @@ expand_inline_function (fndecl, parms, target, ignore, type, ...@@ -924,8 +924,8 @@ expand_inline_function (fndecl, parms, target, ignore, type,
if (GET_CODE (parm_insns) == NOTE if (GET_CODE (parm_insns) == NOTE
&& NOTE_LINE_NUMBER (parm_insns) > 0) && NOTE_LINE_NUMBER (parm_insns) > 0)
{ {
rtx note = emit_line_note (NOTE_SOURCE_FILE (parm_insns), rtx note = emit_note_copy (parm_insns);
NOTE_LINE_NUMBER (parm_insns));
if (note) if (note)
RTX_INTEGRATED_P (note) = 1; RTX_INTEGRATED_P (note) = 1;
} }
...@@ -1682,18 +1682,16 @@ copy_insn_list (insns, map, static_chain_value) ...@@ -1682,18 +1682,16 @@ copy_insn_list (insns, map, static_chain_value)
NOTE_INSN_DELETED notes aren't useful. */ NOTE_INSN_DELETED notes aren't useful. */
if (NOTE_LINE_NUMBER (insn) > 0) if (NOTE_LINE_NUMBER (insn) != NOTE_INSN_FUNCTION_END
copy = emit_line_note (NOTE_SOURCE_FILE (insn),
NOTE_LINE_NUMBER (insn));
else if (NOTE_LINE_NUMBER (insn) != NOTE_INSN_FUNCTION_END
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_FUNCTION_BEG && NOTE_LINE_NUMBER (insn) != NOTE_INSN_FUNCTION_BEG
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED) && NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED)
{ {
copy = emit_note (NOTE_LINE_NUMBER (insn)); copy = emit_note_copy (insn);
NOTE_DATA (copy) = NOTE_DATA (insn); if (!copy)
if ((NOTE_LINE_NUMBER (copy) == NOTE_INSN_BLOCK_BEG /*Copied a line note, but line numbering is off*/;
|| NOTE_LINE_NUMBER (copy) == NOTE_INSN_BLOCK_END) else if ((NOTE_LINE_NUMBER (copy) == NOTE_INSN_BLOCK_BEG
&& NOTE_BLOCK (insn)) || NOTE_LINE_NUMBER (copy) == NOTE_INSN_BLOCK_END)
&& NOTE_BLOCK (insn))
{ {
tree *mapped_block_p; tree *mapped_block_p;
......
...@@ -1528,14 +1528,15 @@ extern rtx emit_call_insn_after_setloc PARAMS ((rtx, rtx, int)); ...@@ -1528,14 +1528,15 @@ extern rtx emit_call_insn_after_setloc PARAMS ((rtx, rtx, int));
extern rtx emit_barrier_after PARAMS ((rtx)); extern rtx emit_barrier_after PARAMS ((rtx));
extern rtx emit_label_after PARAMS ((rtx, rtx)); extern rtx emit_label_after PARAMS ((rtx, rtx));
extern rtx emit_note_after PARAMS ((int, rtx)); extern rtx emit_note_after PARAMS ((int, rtx));
extern rtx emit_line_note_after PARAMS ((const char *, int, rtx)); extern rtx emit_note_copy_after PARAMS ((rtx, rtx));
extern rtx emit_insn PARAMS ((rtx)); extern rtx emit_insn PARAMS ((rtx));
extern rtx emit_jump_insn PARAMS ((rtx)); extern rtx emit_jump_insn PARAMS ((rtx));
extern rtx emit_call_insn PARAMS ((rtx)); extern rtx emit_call_insn PARAMS ((rtx));
extern rtx emit_label PARAMS ((rtx)); extern rtx emit_label PARAMS ((rtx));
extern rtx emit_barrier PARAMS ((void)); extern rtx emit_barrier PARAMS ((void));
extern rtx emit_line_note PARAMS ((const char *, int));
extern rtx emit_note PARAMS ((int)); extern rtx emit_note PARAMS ((int));
extern rtx emit_note_copy PARAMS ((rtx));
extern rtx emit_line_note PARAMS ((const char *, int));
extern rtx emit_line_note_force PARAMS ((const char *, int)); extern rtx emit_line_note_force PARAMS ((const char *, int));
extern rtx make_insn_raw PARAMS ((rtx)); extern rtx make_insn_raw PARAMS ((rtx));
extern void add_function_usage_to PARAMS ((rtx, rtx)); extern void add_function_usage_to PARAMS ((rtx, rtx));
......
...@@ -2252,20 +2252,14 @@ copy_loop_body (loop, copy_start, copy_end, map, exit_label, last_iteration, ...@@ -2252,20 +2252,14 @@ copy_loop_body (loop, copy_start, copy_end, map, exit_label, last_iteration,
the associated rtl. We do not want to share the structure in the associated rtl. We do not want to share the structure in
this new block. */ this new block. */
if (NOTE_LINE_NUMBER (insn) > 0) if (NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED
copy = emit_line_note (NOTE_SOURCE_FILE (insn),
NOTE_LINE_NUMBER (insn));
else if (NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED_LABEL && NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED_LABEL
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_BASIC_BLOCK && NOTE_LINE_NUMBER (insn) != NOTE_INSN_BASIC_BLOCK
&& ((NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_VTOP && ((NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_VTOP
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_CONT) && NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_CONT)
|| (last_iteration || (last_iteration
&& unroll_type != UNROLL_COMPLETELY))) && unroll_type != UNROLL_COMPLETELY)))
{ copy = emit_note_copy (insn);
copy = emit_note (NOTE_LINE_NUMBER (insn));
NOTE_DATA (copy) = NOTE_DATA (insn);
}
else else
copy = 0; copy = 0;
break; break;
...@@ -2310,18 +2304,12 @@ copy_loop_body (loop, copy_start, copy_end, map, exit_label, last_iteration, ...@@ -2310,18 +2304,12 @@ copy_loop_body (loop, copy_start, copy_end, map, exit_label, last_iteration,
instructions before the last insn in the loop, COPY_NOTES_FROM instructions before the last insn in the loop, COPY_NOTES_FROM
can be a NOTE_INSN_LOOP_CONT note if there is no VTOP note, can be a NOTE_INSN_LOOP_CONT note if there is no VTOP note,
as in a do .. while loop. */ as in a do .. while loop. */
if (GET_CODE (insn) != NOTE) if (GET_CODE (insn) == NOTE
/*NOP*/; && ((NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED
else if (NOTE_LINE_NUMBER (insn) > 0)
emit_line_note (NOTE_SOURCE_FILE (insn), NOTE_LINE_NUMBER (insn));
else if (NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_BASIC_BLOCK && NOTE_LINE_NUMBER (insn) != NOTE_INSN_BASIC_BLOCK
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_VTOP && NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_VTOP
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_CONT) && NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_CONT)))
{ emit_note_copy (insn);
rtx copy = emit_note (NOTE_LINE_NUMBER (insn));
NOTE_DATA (copy) = NOTE_DATA (insn);
}
} }
} }
......
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