(get_first_block_beg): New function.
authorRichard Stallman <rms@gnu.org>
Tue, 6 Oct 1992 21:30:51 +0000 (21:30 +0000)
committerRichard Stallman <rms@gnu.org>
Tue, 6 Oct 1992 21:30:51 +0000 (21:30 +0000)
From-SVN: r2345

gcc/function.c

index 6cde316d273931186565620af89cc73f3a98106d..f79ebd0f05e1bceacaf83c760f0ee9e7d161562f 100644 (file)
@@ -2518,6 +2518,24 @@ get_first_nonparm_insn ()
   return get_insns ();
 }
 
+/* Return the first NOTE_INSN_BLOCK_BEG note in the function.
+   Crash if there is none.  */
+
+rtx
+get_first_block_beg ()
+{
+  register rtx searcher;
+  register rtx insn = get_first_nonparm_insn ();
+
+  for (searcher = insn; searcher; searcher = NEXT_INSN (searcher))
+    if (GET_CODE (searcher) == NOTE
+       && NOTE_LINE_NUMBER (searcher) == NOTE_INSN_BLOCK_BEG)
+      return searcher;
+
+  abort ();    /* Invalid call to this function.  (See comments above.)  */
+  return NULL_RTX;
+}
+
 /* Return 1 if EXP returns an aggregate value, for which an address
    must be passed to the function or returned by the function.  */