diff options
author | bothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-06-30 18:18:01 +0000 |
---|---|---|
committer | bothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-06-30 18:18:01 +0000 |
commit | 7bd3dcc4338f994821b15d15b47f76779c6b323c (patch) | |
tree | f55d68b85e9f94ddf4bbe5761ff0a2f4ee16bbc9 /gcc/diagnostic.c | |
parent | 2ed8b5d0fb02aeec25a8ff7cd1e48f2fafbf45f3 (diff) | |
download | gcc-7bd3dcc4338f994821b15d15b47f76779c6b323c.tar.gz |
Conditionally compile support for --enable-mapped_location.
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@83921 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/diagnostic.c')
-rw-r--r-- | gcc/diagnostic.c | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c index c7cfb11b504..db4c8fec4da 100644 --- a/gcc/diagnostic.c +++ b/gcc/diagnostic.c @@ -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); } |