(emit_insns_after): New function.
authorRichard Stallman <rms@gnu.org>
Fri, 21 Aug 1992 06:12:24 +0000 (06:12 +0000)
committerRichard Stallman <rms@gnu.org>
Fri, 21 Aug 1992 06:12:24 +0000 (06:12 +0000)
From-SVN: r1922

gcc/emit-rtl.c

index 7643d7d..82e87ce 100644 (file)
@@ -2185,6 +2185,37 @@ emit_insns_before (insn, before)
   return last;
 }
 
+/* Emit the insns in a chain starting with FIRST and place them in back of
+   the insn AFTER.  Return the last insn emitted.  */
+
+rtx
+emit_insns_after (first, after)
+     register rtx first;
+     register rtx after;
+{
+  register rtx last;
+  register rtx after_after;
+
+  if (!after)
+    abort ();
+
+  if (!first)
+    return first;
+
+  for (last = first; NEXT_INSN (last); last = NEXT_INSN (last))
+    continue;
+
+  after_after = NEXT_INSN (after);
+
+  NEXT_INSN (after) = first;
+  PREV_INSN (first) = after;
+  NEXT_INSN (last) = after_after;
+  if (after_after)
+    PREV_INSN (after_after) = last;
+
+  return last;
+}
+
 /* Make an insn of code JUMP_INSN with pattern PATTERN
    and add it to the end of the doubly-linked list.  */