(emit_insn_after_with_line_notes): New function.
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 20 Sep 1992 09:52:26 +0000 (09:52 +0000)
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 20 Sep 1992 09:52:26 +0000 (09:52 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@2190 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/emit-rtl.c

index 2f2cdcc..3bd88b6 100644 (file)
@@ -2083,6 +2083,28 @@ emit_insn_after (pattern, after)
   return insn;
 }
 
+/* Similar to emit_insn_after, except that line notes are to be inserted so
+   as to act as if this insn were at FROM.  */
+
+void
+emit_insn_after_with_line_notes (pattern, after, from)
+     rtx pattern, after, from;
+{
+  rtx from_line = find_line_note (from);
+  rtx after_line = find_line_note (after);
+  rtx insn = emit_insn_after (pattern, after);
+
+  if (from_line)
+    emit_line_note_after (NOTE_SOURCE_FILE (from_line),
+                         NOTE_LINE_NUMBER (from_line),
+                         after);
+
+  if (after_line)
+    emit_line_note_after (NOTE_SOURCE_FILE (after_line),
+                         NOTE_LINE_NUMBER (after_line),
+                         insn);
+}
+
 /* Make an insn of code JUMP_INSN with body PATTERN
    and output it after the insn AFTER.  */