* 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
+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
abort ();
break;
case NOTE_INSN_REPEATED_LINE_NUMBER:
- emit_line_note (NOTE_SOURCE_FILE (insn),
- NOTE_LINE_NUMBER (insn));
+ emit_note_copy (insn);
break;
default:
abort ();
/* It is possible that no_line_number is set and the note
won't be emitted. */
- emit_line_note (NOTE_SOURCE_FILE (insn),
- NOTE_LINE_NUMBER (insn));
+ emit_note_copy (insn);
}
break;
default:
return;
if (from_line)
- emit_line_note_after (NOTE_SOURCE_FILE (from_line),
- NOTE_LINE_NUMBER (from_line),
- after);
+ emit_note_copy_after (from_line, after);
if (after_line)
- emit_line_note_after (NOTE_SOURCE_FILE (after_line),
- NOTE_LINE_NUMBER (after_line),
- to);
+ emit_note_copy_after (after_line, to);
}
/* Remove unnecessary notes from the instruction stream. */
rtx insn = emit_insn_after (x, after);
if (from_line)
- emit_line_note_after (NOTE_SOURCE_FILE (from_line),
- NOTE_LINE_NUMBER (from_line),
- after);
+ emit_note_copy_after (from_line, after);
if (after_line)
- emit_line_note_after (NOTE_SOURCE_FILE (after_line),
- NOTE_LINE_NUMBER (after_line),
- insn);
+ emit_note_copy_after (after_line, insn);
}
/* Make an insn of code JUMP_INSN with body X
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
-emit_line_note_after (const char *file, int line, rtx after)
+emit_note_copy_after (rtx orig, rtx after)
{
rtx note;
- if (line < 0)
- abort ();
- if (no_line_numbers)
+ if (NOTE_LINE_NUMBER (orig) >= 0 && no_line_numbers)
{
cur_insn_uid++;
return 0;
note = rtx_alloc (NOTE);
INSN_UID (note) = cur_insn_uid++;
- NOTE_SOURCE_FILE (note) = file;
- NOTE_LINE_NUMBER (note) = line;
+ NOTE_LINE_NUMBER (note) = NOTE_LINE_NUMBER (orig);
+ NOTE_DATA (note) = NOTE_DATA (orig);
BLOCK_FOR_INSN (note) = NULL;
add_insn_after (note, after);
return note;
note = emit_note (line);
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;
}
{
emit_jump_insn_after (gen_return (), bb->end);
if (line_note)
- emit_line_note_after (NOTE_SOURCE_FILE (line_note),
- NOTE_LINE_NUMBER (line_note), PREV_INSN (bb->end));
+ emit_note_copy_after (line_note, PREV_INSN (bb->end));
}
#endif /* HAVE_return */
insn = PREV_INSN (insn))
if (GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) > 0)
{
- emit_line_note_after (NOTE_SOURCE_FILE (insn),
- NOTE_LINE_NUMBER (insn),
- prologue_end);
+ emit_note_copy_after (insn, prologue_end);
break;
}
}
if (GET_CODE (parm_insns) == NOTE
&& NOTE_LINE_NUMBER (parm_insns) > 0)
{
- rtx note = emit_line_note (NOTE_SOURCE_FILE (parm_insns),
- NOTE_LINE_NUMBER (parm_insns));
+ rtx note = emit_note_copy (parm_insns);
+
if (note)
RTX_INTEGRATED_P (note) = 1;
}
NOTE_INSN_DELETED notes aren't useful. */
- if (NOTE_LINE_NUMBER (insn) > 0)
- copy = emit_line_note (NOTE_SOURCE_FILE (insn),
- NOTE_LINE_NUMBER (insn));
- else if (NOTE_LINE_NUMBER (insn) != NOTE_INSN_FUNCTION_END
+ if (NOTE_LINE_NUMBER (insn) != NOTE_INSN_FUNCTION_END
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_FUNCTION_BEG
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED)
{
- copy = emit_note (NOTE_LINE_NUMBER (insn));
- NOTE_DATA (copy) = NOTE_DATA (insn);
- if ((NOTE_LINE_NUMBER (copy) == NOTE_INSN_BLOCK_BEG
- || NOTE_LINE_NUMBER (copy) == NOTE_INSN_BLOCK_END)
- && NOTE_BLOCK (insn))
+ copy = emit_note_copy (insn);
+ if (!copy)
+ /*Copied a line note, but line numbering is off*/;
+ else if ((NOTE_LINE_NUMBER (copy) == NOTE_INSN_BLOCK_BEG
+ || NOTE_LINE_NUMBER (copy) == NOTE_INSN_BLOCK_END)
+ && NOTE_BLOCK (insn))
{
tree *mapped_block_p;
extern rtx emit_barrier_after PARAMS ((rtx));
extern rtx emit_label_after PARAMS ((rtx, 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_jump_insn PARAMS ((rtx));
extern rtx emit_call_insn PARAMS ((rtx));
extern rtx emit_label PARAMS ((rtx));
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_copy PARAMS ((rtx));
+extern rtx emit_line_note PARAMS ((const char *, int));
extern rtx emit_line_note_force PARAMS ((const char *, int));
extern rtx make_insn_raw PARAMS ((rtx));
extern void add_function_usage_to PARAMS ((rtx, rtx));
the associated rtl. We do not want to share the structure in
this new block. */
- if (NOTE_LINE_NUMBER (insn) > 0)
- copy = emit_line_note (NOTE_SOURCE_FILE (insn),
- NOTE_LINE_NUMBER (insn));
- else if (NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED
+ if (NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED_LABEL
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_BASIC_BLOCK
&& ((NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_VTOP
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_CONT)
|| (last_iteration
&& unroll_type != UNROLL_COMPLETELY)))
- {
- copy = emit_note (NOTE_LINE_NUMBER (insn));
- NOTE_DATA (copy) = NOTE_DATA (insn);
- }
+ copy = emit_note_copy (insn);
else
copy = 0;
break;
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,
as in a do .. while loop. */
- if (GET_CODE (insn) != NOTE)
- /*NOP*/;
- 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
+ if (GET_CODE (insn) == NOTE
+ && ((NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_BASIC_BLOCK
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_VTOP
- && NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_CONT)
- {
- rtx copy = emit_note (NOTE_LINE_NUMBER (insn));
- NOTE_DATA (copy) = NOTE_DATA (insn);
- }
+ && NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_CONT)))
+ emit_note_copy (insn);
}
}