rtl.h (emit_line_note_after): Remove.
authorNathan Sidwell <nathan@codesourcery.com>
Tue, 1 Jul 2003 09:17:52 +0000 (09:17 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Tue, 1 Jul 2003 09:17:52 +0000 (09:17 +0000)
* 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

gcc/ChangeLog
gcc/cfglayout.c
gcc/emit-rtl.c
gcc/function.c
gcc/integrate.c
gcc/rtl.h
gcc/unroll.c

index f0272ccae669322b5b20d7271373c382ad746ae0..eac7bbfabc762029cb3ce5b0f684aa64bdc7cb1d 100644 (file)
@@ -1,3 +1,20 @@
+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
index 736d8887ec5a4a0cc694f7b3baa4d00487734d47..12cc255293db4eb07c2251773a45cf955ab717b4 100644 (file)
@@ -1008,8 +1008,7 @@ duplicate_insn_chain (rtx from, rtx to)
              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:
@@ -1017,8 +1016,7 @@ duplicate_insn_chain (rtx from, rtx to)
                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:
index 17f68cf98064eb2a6b10fe5b87e9985da8c65d46..c3f36fa9579f5fef87ef99b139df0f490de3b037 100644 (file)
@@ -3869,13 +3869,9 @@ reorder_insns_with_line_notes (rtx from, rtx to, rtx after)
     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.  */
@@ -4295,14 +4291,10 @@ emit_insn_after_with_line_notes (rtx x, rtx after, rtx from)
   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
@@ -4428,16 +4420,14 @@ emit_note_after (int subtype, rtx after)
   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;
@@ -4445,8 +4435,8 @@ emit_line_note_after (const char *file, int line, rtx after)
 
   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;
@@ -4704,7 +4694,31 @@ emit_line_note (const char *file, int line)
 
   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;
 }
 
index b2caea9959c7cafad36beb03ed767769e02a1bcc..074f9206c88614d6bd7250fcaecead5d6dbd299e 100644 (file)
@@ -7412,8 +7412,7 @@ emit_return_into_block (bb, line_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 */
 
@@ -7997,9 +7996,7 @@ epilogue_done:
               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;
              }
        }
index ab4af1823f17f682d165319490eeede033ee5103..622c1abfedabf3f7d8d2bb4d9b57d6a25af2ddae 100644 (file)
@@ -924,8 +924,8 @@ expand_inline_function (fndecl, parms, target, ignore, type,
   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;
     }
@@ -1682,18 +1682,16 @@ copy_insn_list (insns, map, static_chain_value)
 
             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;
 
index bba530181ba08828e61526497eeceee1e4128ef3..de76ec2fa327da37da140f4776c708811be3a210 100644 (file)
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -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_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));
index 84ace299e4ee8c1c50a3be05697ed7bbc9c524ea..b6e280dc819877ab9321fda1ee8d99df4b1df473 100644 (file)
@@ -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
             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;
@@ -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
             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);
        }
     }