Conditionally compile support for --enable-mapped_location.
authorPer Bothner <per@bothner.com>
Wed, 30 Jun 2004 18:18:01 +0000 (11:18 -0700)
committerPer Bothner <bothner@gcc.gnu.org>
Wed, 30 Jun 2004 18:18:01 +0000 (11:18 -0700)
* cfgexpand.c:  Handle USE_MAPPED_LOCATION case for function_end_locus.
* cfglayout.c (insn_locators_initialize):  Const cleanup.  New macros.
* cfgrtl.c (delete_insn):  Use new NOTE_DELETED_LABEL_NAME macro.
* print-rtl.c (print_rtx):  Likewise.
* emit-rtl.c:  Don't clear NOTE_SOURCE_FILE if USE_MAPPED_LOCATION.
* combine.c:  Use new SET_INSN_DELETED macro.
* flow.c:  Likewise.
* haifa-sched.c:  Likewise.
* ifcvt.c:  Likewise.
* recog.c:  Likewise.
* reload1.c:  Likewise.
* diagnostic.c:  Use expand_location macro.
* pretty-print.c (pp_base_format_text):  Likewise.
* profile.c:  Likewise.
  * dwarf2out.c:  Likewise.  Also use expand_location, DECL_IS_BUILTIN.
  * dwarf2out.c (dwarf2out_decl:  Use BUILTINS_LOCATION.
* emit-rtl.c (emit_line_note):  Simplify if USE_MAPPED_LOCATION.
(force_next_line_note, insn_emit):  Handle USE_MAPPED_LOCATION case.
* final.c (final):  Likewise.
* haifa-sched.c:  Likewise.
* integrate.c:  Likewise.
* jump.c:  Likewise.
* rtl-error.c:  Likewise.
* stmt.c (check_seenlabel):  Likewise.
* tree-pretty-print.c:  Likewise.

From-SVN: r83921

22 files changed:
gcc/ChangeLog
gcc/cfgexpand.c
gcc/cfglayout.c
gcc/cfgrtl.c
gcc/combine.c
gcc/diagnostic.c
gcc/dwarf2out.c
gcc/emit-rtl.c
gcc/final.c
gcc/flow.c
gcc/haifa-sched.c
gcc/ifcvt.c
gcc/integrate.c
gcc/jump.c
gcc/pretty-print.c
gcc/print-rtl.c
gcc/profile.c
gcc/recog.c
gcc/reload1.c
gcc/rtl-error.c
gcc/stmt.c
gcc/tree-pretty-print.c

index b0eb970d161508ee3b7f1c2af308a272c1c52877..b217e27ee7994771693413d041724a275240914c 100644 (file)
        * c-ppoutput.c:  Use new source_location typedef instead of fileline.
        * c-semantics.c:  Use new macros.
        * c-typeck.c:  Likewise.
+       * cfgexpand.c:  Handle USE_MAPPED_LOCATION case for function_end_locus.
+       * cfglayout.c (insn_locators_initialize):  Const cleanup.  New macros.
+       * cfgrtl.c (delete_insn):  Use new NOTE_DELETED_LABEL_NAME macro.
+       * print-rtl.c (print_rtx):  Likewise.
+       * emit-rtl.c:  Don't clear NOTE_SOURCE_FILE if USE_MAPPED_LOCATION.
+       * combine.c:  Use new SET_INSN_DELETED macro.
+       * flow.c:  Likewise.
+       * haifa-sched.c:  Likewise.
+       * ifcvt.c:  Likewise.
+       * recog.c:  Likewise.
+       * reload1.c:  Likewise.
+       * diagnostic.c:  Use expand_location macro.
+       * pretty-print.c (pp_base_format_text):  Likewise.
+       * profile.c:  Likewise.
+       * dwarf2out.c:  Likewise.  Also use expand_location, DECL_IS_BUILTIN.
+       * dwarf2out.c (dwarf2out_decl:  Use BUILTINS_LOCATION.
+       * emit-rtl.c (emit_line_note):  Simplify if USE_MAPPED_LOCATION.
+       (force_next_line_note, insn_emit):  Handle USE_MAPPED_LOCATION case.
+       * final.c (final):  Likewise.
+       * haifa-sched.c:  Likewise.
+       * integrate.c:  Likewise.
+       * jump.c:  Likewise.
+       * rtl-error.c:  Likewise.
+       * stmt.c (check_seenlabel):  Likewise.
+       * tree-pretty-print.c:  Likewise.
 
 2004-06-30  Richard Sandiford  <rsandifo@redhat.com>
            Eric Christopher  <echristo@redhat.com>
index 1576566dc92a77ca9f7d1a30cecdd9dbf7cfb2e1..58592751d6e3af9f4a0903321b1a9330ebd5fc7e 100644 (file)
@@ -319,7 +319,11 @@ construct_exit_block (void)
 
   /* Make sure the locus is set to the end of the function, so that 
      epilogue line numbers and warnings are set properly.  */
+#ifdef USE_MAPPED_LOCATION
+  if (cfun->function_end_locus != UNKNOWN_LOCATION)
+#else
   if (cfun->function_end_locus.file)
+#endif
     input_location = cfun->function_end_locus;
 
   /* The following insns belong to the top scope.  */
index e887015ac7f75d6f6fda49a4915e14a1f051bf6e..be890d9b399c34bc3f936b72ee3355121844dd4d 100644 (file)
@@ -254,7 +254,7 @@ insn_locators_initialize (void)
   rtx insn, next;
   int loc = 0;
   int line_number = 0, last_line_number = 0;
-  char *file_name = NULL, *last_file_name = NULL;
+  const char *file_name = NULL, *last_file_name = NULL;
 
   prologue_locator = epilogue_locator = 0;
 
@@ -293,7 +293,7 @@ insn_locators_initialize (void)
            {
              loc++;
              VARRAY_PUSH_INT (file_locators_locs, loc);
-             VARRAY_PUSH_CHAR_PTR (file_locators_files, file_name);
+             VARRAY_PUSH_CHAR_PTR (file_locators_files, (char *) file_name);
              last_file_name = file_name;
            }
        }
@@ -324,8 +324,10 @@ insn_locators_initialize (void)
            default:
              if (NOTE_LINE_NUMBER (insn) > 0)
                {
-                 line_number = NOTE_LINE_NUMBER (insn);
-                 file_name = (char *)NOTE_SOURCE_FILE (insn);
+                 expanded_location xloc;
+                 NOTE_EXPANDED_LOCATION (xloc, insn);
+                 line_number = xloc.line;
+                 file_name = xloc.file;
                }
              break;
            }
index 8ef48d092a1143a717056d5a9ba55ab055b9a229..ae073c4fc39edb41d007ac64ee6b3919722a0982 100644 (file)
@@ -130,7 +130,7 @@ delete_insn (rtx insn)
          really_delete = false;
          PUT_CODE (insn, NOTE);
          NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED_LABEL;
-         NOTE_SOURCE_FILE (insn) = name;
+         NOTE_DELETED_LABEL_NAME (insn) = name;
        }
 
       remove_node_from_expr_list (insn, &nonlocal_goto_handler_labels);
index 52c500ae7f1ad51b3143f7b42778e9d4d50e6baf..0762eda455b5f4ccae30cdcfa15e5f43cae6bad8 100644 (file)
@@ -2770,19 +2770,13 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p)
        PATTERN (i2) = newi2pat;
       }
     else
-      {
-       PUT_CODE (i2, NOTE);
-       NOTE_LINE_NUMBER (i2) = NOTE_INSN_DELETED;
-       NOTE_SOURCE_FILE (i2) = 0;
-      }
+      SET_INSN_DELETED (i2);
 
     if (i1)
       {
        LOG_LINKS (i1) = 0;
        REG_NOTES (i1) = 0;
-       PUT_CODE (i1, NOTE);
-       NOTE_LINE_NUMBER (i1) = NOTE_INSN_DELETED;
-       NOTE_SOURCE_FILE (i1) = 0;
+       SET_INSN_DELETED (i1);
       }
 
     /* Get death notes for everything that is now used in either I3 or
@@ -12045,9 +12039,7 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2)
                          distribute_notes (old_notes, tem, tem, NULL_RTX);
                          distribute_links (LOG_LINKS (tem));
 
-                         PUT_CODE (tem, NOTE);
-                         NOTE_LINE_NUMBER (tem) = NOTE_INSN_DELETED;
-                         NOTE_SOURCE_FILE (tem) = 0;
+                         SET_INSN_DELETED (tem);
 
 #ifdef HAVE_cc0
                          /* Delete the setter too.  */
@@ -12061,10 +12053,7 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2)
                                                cc0_setter, NULL_RTX);
                              distribute_links (LOG_LINKS (cc0_setter));
 
-                             PUT_CODE (cc0_setter, NOTE);
-                             NOTE_LINE_NUMBER (cc0_setter)
-                               = NOTE_INSN_DELETED;
-                             NOTE_SOURCE_FILE (cc0_setter) = 0;
+                             SET_INSN_DELETED (cc0_setter);
                            }
 #endif
                        }
index c7cfb11b50492ddda4708c487c07f6f4b3e3a388..db4c8fec4da63e2060bdfa709838f997fac16ab1 100644 (file)
@@ -173,13 +173,13 @@ diagnostic_build_prefix (diagnostic_info *diagnostic)
 #undef DEFINE_DIAGNOSTIC_KIND
     "must-not-happen"
   };
-   if (diagnostic->kind >= DK_LAST_DIAGNOSTIC_KIND)
-     abort();
+  expanded_location s = expand_location (diagnostic->location);
+  if (diagnostic->kind >= DK_LAST_DIAGNOSTIC_KIND)
+    abort();
 
-  return diagnostic->location.file
+  return s.file
     ? build_message_string ("%s:%d: %s",
-                            diagnostic->location.file,
-                            diagnostic->location.line,
+                            s.file, s.line,
                             _(diagnostic_kind_text[diagnostic->kind]))
     : build_message_string ("%s: %s", progname,
                             _(diagnostic_kind_text[diagnostic->kind]));
@@ -206,8 +206,9 @@ diagnostic_count_diagnostic (diagnostic_context *context,
           || diagnostic_kind_count (context, DK_SORRY) > 0)
          && !context->abort_on_error)
        {
+         expanded_location s = expand_location (diagnostic->location);
          fnotice (stderr, "%s:%d: confused by earlier errors, bailing out\n",
-                  diagnostic->location.file, diagnostic->location.line);
+                  s.file, s.line);
          exit (FATAL_EXIT_CODE);
        }
 #endif
@@ -313,16 +314,20 @@ diagnostic_report_current_module (diagnostic_context *context)
       pp_needs_newline (context->printer) = false;
     }
 
-  if (input_file_stack && diagnostic_last_module_changed (context))
+  p = input_file_stack;
+  if (p && diagnostic_last_module_changed (context))
     {
-      p = input_file_stack;
+      expanded_location xloc = expand_location (p->location);
       pp_verbatim (context->printer,
                    "In file included from %s:%d",
-                   p->location.file, p->location.line);
+                  xloc.file, xloc.line);
       while ((p = p->next) != NULL)
-       pp_verbatim (context->printer,
-                     ",\n                 from %s:%d",
-                     p->location.file, p->location.line);
+       {
+         xloc = expand_location (p->location);
+         pp_verbatim (context->printer,
+                      ",\n                 from %s:%d",
+                      xloc.file, xloc.line);
+       }
       pp_verbatim (context->printer, ":\n");
       diagnostic_set_last_module (context);
     }
index 93afca759ede5406d09108b57ef5de6febb5eedf..17b4c2060c0f8d79d439bb13e3084fc7a428ef60 100644 (file)
@@ -10501,10 +10501,11 @@ add_pure_or_virtual_attribute (dw_die_ref die, tree func_decl)
 static void
 add_src_coords_attributes (dw_die_ref die, tree decl)
 {
-  unsigned file_index = lookup_filename (DECL_SOURCE_FILE (decl));
+  expanded_location s = expand_location (DECL_SOURCE_LOCATION (decl));
+  unsigned file_index = lookup_filename (s.file);
 
   add_AT_unsigned (die, DW_AT_decl_file, file_index);
-  add_AT_unsigned (die, DW_AT_decl_line, DECL_SOURCE_LINE (decl));
+  add_AT_unsigned (die, DW_AT_decl_line, s.line);
 }
 
 /* Add a DW_AT_name attribute and source coordinate attribute for the
@@ -11199,7 +11200,8 @@ gen_subprogram_die (tree decl, dw_die_ref context_die)
     }
   else if (old_die)
     {
-      unsigned file_index = lookup_filename (DECL_SOURCE_FILE (decl));
+      expanded_location s = expand_location (DECL_SOURCE_LOCATION (decl));
+      unsigned file_index = lookup_filename (s.file);
 
       if (!get_AT_flag (old_die, DW_AT_declaration)
          /* We can have a normal definition following an inline one in the
@@ -11228,7 +11230,7 @@ gen_subprogram_die (tree decl, dw_die_ref context_die)
          && (DECL_ARTIFICIAL (decl)
              || (get_AT_unsigned (old_die, DW_AT_decl_file) == file_index
                  && (get_AT_unsigned (old_die, DW_AT_decl_line)
-                     == (unsigned) DECL_SOURCE_LINE (decl)))))
+                     == (unsigned) s.line))))
        {
          subr_die = old_die;
 
@@ -11247,9 +11249,9 @@ gen_subprogram_die (tree decl, dw_die_ref context_die)
          if (get_AT_unsigned (old_die, DW_AT_decl_file) != file_index)
            add_AT_unsigned (subr_die, DW_AT_decl_file, file_index);
          if (get_AT_unsigned (old_die, DW_AT_decl_line)
-             != (unsigned) DECL_SOURCE_LINE (decl))
+             != (unsigned) s.line)
            add_AT_unsigned
-             (subr_die, DW_AT_decl_line, DECL_SOURCE_LINE (decl));
+             (subr_die, DW_AT_decl_line, s.line);
        }
     }
   else
@@ -11476,16 +11478,16 @@ gen_variable_die (tree decl, dw_die_ref context_die)
       add_AT_specification (var_die, old_die);
       if (DECL_NAME (decl))
        {
-         unsigned file_index = lookup_filename (DECL_SOURCE_FILE (decl));
+         expanded_location s = expand_location (DECL_SOURCE_LOCATION (decl));
+         unsigned file_index = lookup_filename (s.file);
 
          if (get_AT_unsigned (old_die, DW_AT_decl_file) != file_index)
            add_AT_unsigned (var_die, DW_AT_decl_file, file_index);
 
          if (get_AT_unsigned (old_die, DW_AT_decl_line)
-             != (unsigned) DECL_SOURCE_LINE (decl))
+             != (unsigned) s.line)
 
-           add_AT_unsigned (var_die, DW_AT_decl_line,
-                            DECL_SOURCE_LINE (decl));
+           add_AT_unsigned (var_die, DW_AT_decl_line, s.line);
        }
     }
   else
@@ -12776,6 +12778,7 @@ dwarf2out_imported_module_or_decl (tree decl, tree context)
   dw_die_ref imported_die, at_import_die;
   dw_die_ref scope_die;
   unsigned file_index;
+  expanded_location xloc;
   
   if (debug_info_level <= DINFO_LEVEL_TERSE)
     return;
@@ -12807,10 +12810,11 @@ dwarf2out_imported_module_or_decl (tree decl, tree context)
     imported_die = new_die (DW_TAG_imported_module, scope_die, context);
   else
     imported_die = new_die (DW_TAG_imported_declaration, scope_die, context);
-  
-  file_index = lookup_filename (input_filename);
+
+  xloc = expand_location (input_location);
+  file_index = lookup_filename (xloc.file);
   add_AT_unsigned (imported_die, DW_AT_decl_file, file_index);
-  add_AT_unsigned (imported_die, DW_AT_decl_line, input_line);
+  add_AT_unsigned (imported_die, DW_AT_decl_line, xloc.line);
   add_AT_die_ref (imported_die, DW_AT_import, at_import_die);
 }
 
@@ -12898,7 +12902,7 @@ dwarf2out_decl (tree decl)
 
       /* Don't bother trying to generate any DIEs to represent any of the
         normal built-in types for the language we are compiling.  */
-      if (DECL_SOURCE_LINE (decl) == 0)
+      if (DECL_IS_BUILTIN (decl))
        {
          /* OK, we need to generate one for `bool' so GDB knows what type
             comparisons have.  */
index 91ef8e9fafd51b418e359eefa67ff603de34d6a4..c4235bf3fd1284958ecded155edee683c289cf28 100644 (file)
@@ -4131,7 +4131,9 @@ emit_note_before (int subtype, rtx before)
 {
   rtx note = rtx_alloc (NOTE);
   INSN_UID (note) = cur_insn_uid++;
+#ifndef USE_MAPPED_LOCATION
   NOTE_SOURCE_FILE (note) = 0;
+#endif
   NOTE_LINE_NUMBER (note) = subtype;
   BLOCK_FOR_INSN (note) = NULL;
 
@@ -4354,7 +4356,9 @@ emit_note_after (int subtype, rtx after)
 {
   rtx note = rtx_alloc (NOTE);
   INSN_UID (note) = cur_insn_uid++;
+#ifndef USE_MAPPED_LOCATION
   NOTE_SOURCE_FILE (note) = 0;
+#endif
   NOTE_LINE_NUMBER (note) = subtype;
   BLOCK_FOR_INSN (note) = NULL;
   add_insn_after (note, after);
@@ -4629,10 +4633,15 @@ emit_line_note (location_t location)
   
   set_file_and_line_for_stmt (location);
   
+#ifdef USE_MAPPED_LOCATION
+  if (location == last_location)
+    return NULL_RTX;
+#else
   if (location.file && last_location.file
       && !strcmp (location.file, last_location.file)
       && location.line == last_location.line)
     return NULL_RTX;
+#endif
   last_location = location;
   
   if (no_line_numbers)
@@ -4641,8 +4650,12 @@ emit_line_note (location_t location)
       return NULL_RTX;
     }
 
+#ifdef USE_MAPPED_LOCATION
+  note = emit_note ((int) location);
+#else
   note = emit_note (location.line);
   NOTE_SOURCE_FILE (note) = location.file;
+#endif
   
   return note;
 }
@@ -4694,7 +4707,11 @@ emit_note (int note_no)
 void
 force_next_line_note (void)
 {
+#ifdef USE_MAPPED_LOCATION
+  last_location = -1;
+#else
   last_location.line = -1;
+#endif
 }
 
 /* Place a note of KIND on insn INSN with DATUM as the datum. If a
@@ -5154,8 +5171,7 @@ init_emit (void)
   seq_rtl_expr = NULL;
   cur_insn_uid = 1;
   reg_rtx_no = LAST_VIRTUAL_REGISTER + 1;
-  last_location.line = 0;
-  last_location.file = 0;
+  last_location = UNKNOWN_LOCATION;
   first_label_num = label_num;
   last_label_num = 0;
   seq_stack = NULL;
index 65ebaa0bfcb9fa1dac9eb6f1d33c06d7c76cd335..c7b4a5c4de4a9b5f9e7dee1623a565a69494ae7b 100644 (file)
@@ -1520,8 +1520,13 @@ final (rtx first, FILE *file, int optimize, int prescan)
        if (GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) > 0)
          {
            if (last != 0
+#ifdef USE_MAPPED_LOCATION
+               && NOTE_SOURCE_LOCATION (insn) == NOTE_SOURCE_LOCATION (last)
+#else
                && NOTE_LINE_NUMBER (insn) == NOTE_LINE_NUMBER (last)
-               && NOTE_SOURCE_FILE (insn) == NOTE_SOURCE_FILE (last))
+               && NOTE_SOURCE_FILE (insn) == NOTE_SOURCE_FILE (last)
+#endif)
+             )
              {
                delete_insn (insn);     /* Use delete_note.  */
                continue;
index 1a6546d95408570357d6733ef1ade0669807d2b7..046d51b556450bdf0a6687af7c666e9745cfcc4b 100644 (file)
@@ -3391,8 +3391,7 @@ attempt_auto_inc (struct propagate_block_info *pbi, rtx inc, rtx insn,
        }
 
       PUT_CODE (incr, NOTE);
-      NOTE_LINE_NUMBER (incr) = NOTE_INSN_DELETED;
-      NOTE_SOURCE_FILE (incr) = 0;
+      SET_INSN_DELETED (incr);
     }
 
   if (regno >= FIRST_PSEUDO_REGISTER)
index e3c819c3ea5f1fbe5c2629d8acb386da24192e38..122f9714813d0dd81a824830ee7c7f93947b0b05 100644 (file)
@@ -1559,8 +1559,13 @@ restore_line_notes (rtx head, rtx tail)
             && (note = LINE_NOTE (insn)) != 0
             && note != line
             && (line == 0
+#ifdef USE_MAPPED_LOCATION
+                || NOTE_SOURCE_LOCATION (note) != NOTE_SOURCE_LOCATION (line)
+#else
                 || NOTE_LINE_NUMBER (note) != NOTE_LINE_NUMBER (line)
-                || NOTE_SOURCE_FILE (note) != NOTE_SOURCE_FILE (line)))
+                || NOTE_SOURCE_FILE (note) != NOTE_SOURCE_FILE (line)
+#endif
+                ))
       {
        line = note;
        prev = PREV_INSN (insn);
@@ -1577,7 +1582,9 @@ restore_line_notes (rtx head, rtx tail)
          {
            added_notes++;
            new = emit_note_after (NOTE_LINE_NUMBER (note), prev);
+#ifndef USE_MAPPED_LOCATION
            NOTE_SOURCE_FILE (new) = NOTE_SOURCE_FILE (note);
+#endif
          }
       }
   if (sched_verbose && added_notes)
@@ -1605,17 +1612,20 @@ rm_redundant_line_notes (void)
        if (active_insn == 0)
          {
            notes++;
-           NOTE_SOURCE_FILE (insn) = 0;
-           NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
+           SET_INSN_DELETED (insn);
          }
        /* If the line number is unchanged, LINE is redundant.  */
        else if (line
+#ifdef USE_MAPPED_LOCATION
+                && NOTE_SOURCE_LOCATION (line) == NOTE_SOURCE_LOCATION (insn)
+#else
                 && NOTE_LINE_NUMBER (line) == NOTE_LINE_NUMBER (insn)
-                && NOTE_SOURCE_FILE (line) == NOTE_SOURCE_FILE (insn))
+                && NOTE_SOURCE_FILE (line) == NOTE_SOURCE_FILE (insn)
+#endif
+)
          {
            notes++;
-           NOTE_SOURCE_FILE (line) = 0;
-           NOTE_LINE_NUMBER (line) = NOTE_INSN_DELETED;
+           SET_INSN_DELETED (line);
            line = insn;
          }
        else
index 053424dc0058e18e7d767e8e8cb980f964f2f27f..647c4e8b74d09d499088a44b9b810f6f4d8fe897 100644 (file)
@@ -260,9 +260,7 @@ cond_exec_process_insns (ce_if_block_t *ce_info ATTRIBUTE_UNUSED,
        {
          /* ??? Ug.  Actually unlinking the thing is problematic,
             given what we'd have to coordinate with our callers.  */
-         PUT_CODE (insn, NOTE);
-         NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
-         NOTE_SOURCE_FILE (insn) = 0;
+         SET_INSN_DELETED (insn);
          goto insn_done;
        }
 
index c5befd5cd2ffb960704e06c213be4b3ba8cd0dd0..80eb84bba8c1564dd578e134099e87adc37736bf 100644 (file)
@@ -505,8 +505,13 @@ copy_rtx_and_substitute (rtx orig, struct inline_remap *map, int for_lhs)
          ASM_OPERANDS_INPUT_VEC (copy) = map->copy_asm_operands_vector;
          ASM_OPERANDS_INPUT_CONSTRAINT_VEC (copy)
            = map->copy_asm_constraints_vector;
+#ifdef USE_MAPPED_LOCATION
+         ASM_OPERANDS_SOURCE_LOCATION (copy)
+           = ASM_OPERANDS_SOURCE_LOCATION (orig);
+#else
          ASM_OPERANDS_SOURCE_FILE (copy) = ASM_OPERANDS_SOURCE_FILE (orig);
          ASM_OPERANDS_SOURCE_LINE (copy) = ASM_OPERANDS_SOURCE_LINE (orig);
+#endif
          return copy;
        }
       break;
index c69a4894b6316c60882d61b4343df248529c8e11..0e45c79b69e02d6e0ca837d3aea53b4a8a9bb74c 100644 (file)
@@ -142,8 +142,13 @@ purge_line_number_notes (rtx f)
          {
            /* Delete this note if it is identical to previous note.  */
            if (last_note
+#ifdef USE_MAPPED_LOCATION
+               && NOTE_SOURCE_LOCATION (insn) == NOTE_SOURCE_LOCATION (last_note)
+#else
                && NOTE_SOURCE_FILE (insn) == NOTE_SOURCE_FILE (last_note)
-               && NOTE_LINE_NUMBER (insn) == NOTE_LINE_NUMBER (last_note))
+               && NOTE_LINE_NUMBER (insn) == NOTE_LINE_NUMBER (last_note)
+#endif
+)
              {
                delete_related_insns (insn);
                continue;
index f5a1a77490b6349f8566561288a42709d9a102e4..d6098a7474513422de22f970fd58f67fa91e5627 100644 (file)
@@ -305,11 +305,12 @@ pp_base_format_text (pretty_printer *pp, text_info *text)
 
         case 'H':
           {
-            const location_t *locus = va_arg (*text->args_ptr, location_t *);
+            location_t *locus = va_arg (*text->args_ptr, location_t *);
+           expanded_location s = expand_location (*locus);
             pp_string (pp, "file '");
-            pp_string (pp, locus->file);
+            pp_string (pp, s.file);
             pp_string (pp, "', line ");
-            pp_decimal_int (pp, locus->line);
+            pp_decimal_int (pp, s.line);
           }
           break;
 
index 4f2223a2ef78b0d108b8fad935d8dd8988557d89..0143f096c2965864e6d1ed09cd910e77f7fe4cbb 100644 (file)
@@ -272,10 +272,13 @@ print_rtx (rtx in_rtx)
                break;
 
              case NOTE_INSN_DELETED_LABEL:
-               if (NOTE_SOURCE_FILE (in_rtx))
-                 fprintf (outfile, " (\"%s\")", NOTE_SOURCE_FILE (in_rtx));
-               else
-                 fprintf (outfile, " \"\"");
+               {
+                 const char *label = NOTE_DELETED_LABEL_NAME (in_rtx);
+                 if (label)
+                   fprintf (outfile, " (\"%s\")", label);
+                 else
+                   fprintf (outfile, " \"\"");
+               }
                break;
 
              case NOTE_INSN_PREDICTION:
index 0468a0f828420f41d6418a78ec89ebaaa068e402..9a7b933199b018d03014731a96cae7099617d03f 100644 (file)
@@ -922,23 +922,26 @@ branch_prob (void)
                    ignore_next_note = 0;
                  else
                    {
+                     expanded_location s;
+
                      if (!offset)
                        {
                          offset = gcov_write_tag (GCOV_TAG_LINES);
                          gcov_write_unsigned (BB_TO_GCOV_INDEX (bb));
                        }
 
+                     NOTE_EXPANDED_LOCATION (s, insn);
+
                      /* If this is a new source file, then output the
                         file's name to the .bb file.  */
                      if (!prev_file_name
-                         || strcmp (NOTE_SOURCE_FILE (insn),
-                                    prev_file_name))
+                         || strcmp (s.file, prev_file_name))
                        {
-                         prev_file_name = NOTE_SOURCE_FILE (insn);
+                         prev_file_name = s.file;
                          gcov_write_unsigned (0);
                          gcov_write_string (prev_file_name);
                        }
-                     gcov_write_unsigned (NOTE_LINE_NUMBER (insn));
+                     gcov_write_unsigned (s.line);
                    }
                }
              insn = NEXT_INSN (insn);
index 4fcb6eea428a5bffd9a0fdfe2b3d57ca02faaae1..ad2dd9a49cdddd0466d971fdf2692f4d6fa02f74 100644 (file)
@@ -2677,9 +2677,7 @@ split_insn (rtx insn)
     return NULL_RTX;
 
   /* try_split returns the NOTE that INSN became.  */
-  PUT_CODE (insn, NOTE);
-  NOTE_SOURCE_FILE (insn) = 0;
-  NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
+  SET_INSN_DELETED (insn);
 
   /* ??? Coddle to md files that generate subregs in post-reload
      splitters instead of computing the proper hard register.  */
index ea01b688506bf2a1d4842edac00f025ea015ee38..9a5d40ba111f95c787943e02544a56cb7f08c734 100644 (file)
@@ -1059,11 +1059,7 @@ reload (rtx first, int global)
              else if (reg_set_p (regno_reg_rtx[i], PATTERN (equiv_insn)))
                delete_dead_insn (equiv_insn);
              else
-               {
-                 PUT_CODE (equiv_insn, NOTE);
-                 NOTE_SOURCE_FILE (equiv_insn) = 0;
-                 NOTE_LINE_NUMBER (equiv_insn) = NOTE_INSN_DELETED;
-               }
+               SET_INSN_DELETED (equiv_insn);
            }
        }
     }
@@ -1911,9 +1907,7 @@ delete_dead_insn (rtx insn)
       && ! side_effects_p (SET_SRC (PATTERN (prev))))
     delete_dead_insn (prev);
 
-  PUT_CODE (insn, NOTE);
-  NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
-  NOTE_SOURCE_FILE (insn) = 0;
+  SET_INSN_DELETED (insn);
 }
 
 /* Modify the home of pseudo-reg I.
index 72ef094b112a60e93ab4985aec63ef2cea0a4db9..16d53506b48fb28a0481c6b9e68a50375b218f6c 100644 (file)
@@ -59,10 +59,14 @@ location_for_asm (rtx insn)
     asmop = NULL;
 
   if (asmop)
+#ifdef USE_MAPPED_LOCATION
+    loc = ASM_OPERANDS_SOURCE_LOCATION (asmop);
+#else
     {
       loc.file = ASM_OPERANDS_SOURCE_FILE (asmop);
       loc.line = ASM_OPERANDS_SOURCE_LINE (asmop);
     }
+#endif
   else
     loc = input_location;
   return loc;
index 5ee55b9e6999c944e0ec00cb8957e84f796f0f3e..0b282bb623e46cb22d53c1eb95ced8f103f594dc 100644 (file)
@@ -1565,7 +1565,7 @@ expand_asm_operands (tree string, tree outputs, tree inputs,
                                : GET_MODE (output_rtx[0])),
                               TREE_STRING_POINTER (string),
                               empty_string, 0, argvec, constraintvec,
-                              locus.file, locus.line);
+                              locus);
 
   MEM_VOLATILE_P (body) = vol;
 
@@ -1715,7 +1715,7 @@ expand_asm_operands (tree string, tree outputs, tree inputs,
                           (GET_MODE (output_rtx[i]),
                            TREE_STRING_POINTER (string),
                            constraints[i], i, argvec, constraintvec,
-                           locus.file, locus.line));
+                           locus));
 
          MEM_VOLATILE_P (SET_SRC (XVECEXP (body, 0, i))) = vol;
        }
@@ -3871,8 +3871,12 @@ check_seenlabel (void)
              if (insn)
                 {
                   location_t locus;
+#ifdef USE_MAPPED_LOCATION
+                  locus = NOTE_SOURCE_LOCATION (insn);
+#else
                   locus.file = NOTE_SOURCE_FILE (insn);
                   locus.line = NOTE_LINE_NUMBER (insn);
+#endif
                   warning ("%Hunreachable code at beginning of %s", &locus,
                            case_stack->data.case_stmt.printname);
                 }
index 9eb478caaac73a7fe267b25037030ae2f70132fc..9d415fa88735d520606e2f8b3a496f10cf6d29f4 100644 (file)
@@ -231,13 +231,14 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
       && (flags & TDF_LINENO)
       && EXPR_HAS_LOCATION (node))
     {
+      expanded_location xloc = expand_location (EXPR_LOCATION (node));
       pp_character (buffer, '[');
-      if (EXPR_FILENAME (node))
+      if (xloc.file)
        {
-         pp_string (buffer, EXPR_FILENAME (node));
+         pp_string (buffer, xloc.file);
          pp_string (buffer, " : ");
        }
-      pp_decimal_int (buffer, EXPR_LINENO (node));
+      pp_decimal_int (buffer, xloc.line);
       pp_string (buffer, "] ");
     }
 
@@ -556,7 +557,7 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
       break;
 
     case TYPE_DECL:
-      if (strcmp (DECL_SOURCE_FILE (node), "<built-in>") == 0)
+      if (DECL_IS_BUILTIN (node))
        {
          /* Don't print the declaration of built-in types.  */
          break;
@@ -2224,15 +2225,27 @@ dump_implicit_edges (pretty_printer *buffer, basic_block bb, int indent,
     {
       INDENT (indent);
 
-      if ((flags & TDF_LINENO) && e->goto_locus)
+      if ((flags & TDF_LINENO)
+#ifdef USE_MAPPED_LOCATION
+         && e->goto_locus != UNKNOWN_LOCATION
+#else
+         && e->goto_locus
+#endif
+         )
        {
+         expanded_location goto_xloc;
+#ifdef USE_MAPPED_LOCATION
+         goto_xloc = expand_location (e->goto_locus);
+#else
+         goto_xloc = *e->goto_locus;
+#endif
          pp_character (buffer, '[');
-         if (e->goto_locus->file)
+         if (goto_xloc.file)
            {
-             pp_string (buffer, e->goto_locus->file);
+             pp_string (buffer, goto_xloc.file);
              pp_string (buffer, " : ");
            }
-         pp_decimal_int (buffer, e->goto_locus->line);
+         pp_decimal_int (buffer, goto_xloc.line);
          pp_string (buffer, "] ");
        }