diff options
author | Jakub Jelinek <jakub@redhat.com> | 2007-09-27 09:24:58 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2007-09-27 09:24:58 +0200 |
commit | c94ed7a1ae35d90b76e04cc7d8a9d72a7aa1451c (patch) | |
tree | da9ad83a363c4d770588541c6c1fc6b8fc3e0b7a /gcc/diagnostic.h | |
parent | dcbb0d145f6999926d17f7d7a3e6b84f6f2182b0 (diff) | |
download | gcc-c94ed7a1ae35d90b76e04cc7d8a9d72a7aa1451c.zip gcc-c94ed7a1ae35d90b76e04cc7d8a9d72a7aa1451c.tar.gz gcc-c94ed7a1ae35d90b76e04cc7d8a9d72a7aa1451c.tar.bz2 |
builtins.c (expand_builtin, [...]): Use new %K format string specifier for diagnostics.
* builtins.c (expand_builtin, expand_builtin_object_size,
expand_builtin_memory_chk, maybe_emit_chk_warning,
maybe_emit_sprintf_chk_warning): Use new %K format string specifier
for diagnostics.
* expr.c (expand_expr_real_1): Likewise.
* langhooks-def.h (struct diagnostic_info): Add forward decl.
(lhd_print_error_function): Add third argument.
* langhooks.h (struct diagnostic_info): Add forward decl.
(struct lang_hooks): Add third argument to print_error_function.
* diagnostic.h (diagnostic_info): Add abstract_origin field.
(diagnostic_last_function_changed, diagnostic_set_last_function): Add
second argument.
(diagnostic_report_current_function): Likewise.
* toplev.c (announce_function): Pass NULL as second argument to
diagnostic_set_last_function.
* diagnostic.c (diagnostic_report_current_function): Add second
argument, pass it as third argument to lang_hooks.print_error_function.
(default_diagnostic_starter): Pass DIAGNOSTIC as second argument
to diagnostic_report_current_function.
(diagnostic_report_diagnostic): Initialize diagnostic->abstract_origin
and message.abstract_origin.
(verbatim): Initialize abstract_origin.
* pretty-print.h (text_info): Add abstract_origin field.
* pretty-print.c (pp_base_format): Handle %K.
* langhooks.c (lhd_print_error_function): Add third argument. If
diagnostic->abstract_origin, print virtual backtrace.
* c-format.c (gcc_diag_char_table, gcc_tdiag_char_table,
gcc_cdiag_char_table, gcc_cxxdiag_char_table): Support %K.
(init_dynamic_diag_info): Likewise.
cp/
* error.c (cxx_print_error_function): Add third argument, pass
it over to lhd_print_error_function.
(cp_print_error_function): If diagnostic->abstract_origin, print
virtual backtrace.
* cp-tree.h (struct diagnostic_info): New forward decl.
(cxx_print_error_function): Add third argument.
java/
* lang.c (java_print_error_function): Add third argument.
testsuite/
* lib/prune.exp: Prune also "^In function .*$" lines and
"^ inlined from .*$" lines.
From-SVN: r128830
Diffstat (limited to 'gcc/diagnostic.h')
-rw-r--r-- | gcc/diagnostic.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/gcc/diagnostic.h b/gcc/diagnostic.h index 94e5f32..02e43bd 100644 --- a/gcc/diagnostic.h +++ b/gcc/diagnostic.h @@ -37,10 +37,13 @@ typedef enum /* A diagnostic is described by the MESSAGE to send, the FILE and LINE of its context and its KIND (ice, error, warning, note, ...) See complete list in diagnostic.def. */ -typedef struct +typedef struct diagnostic_info { text_info message; location_t location; + /* TREE_BLOCK if the diagnostic is to be reported in some inline + function inlined into other function, otherwise NULL. */ + tree abstract_origin; /* The kind of diagnostic it is about. */ diagnostic_t kind; /* Which OPT_* directly controls this diagnostic. */ @@ -137,13 +140,15 @@ struct diagnostic_context /* True if the last function in which a diagnostic was reported is different from the current one. */ -#define diagnostic_last_function_changed(DC) \ - ((DC)->last_function != current_function_decl) +#define diagnostic_last_function_changed(DC, DI) \ + ((DC)->last_function != ((DI)->abstract_origin \ + ? (DI)->abstract_origin : current_function_decl)) /* Remember the current function as being the last one in which we report a diagnostic. */ -#define diagnostic_set_last_function(DC) \ - (DC)->last_function = current_function_decl +#define diagnostic_set_last_function(DC, DI) \ + (DC)->last_function = (((DI) && (DI)->abstract_origin) \ + ? (DI)->abstract_origin : current_function_decl) /* True if the last module or file in which a diagnostic was reported is different from the current one. */ @@ -185,7 +190,8 @@ extern diagnostic_context *global_dc; /* Diagnostic related functions. */ extern void diagnostic_initialize (diagnostic_context *); extern void diagnostic_report_current_module (diagnostic_context *); -extern void diagnostic_report_current_function (diagnostic_context *); +extern void diagnostic_report_current_function (diagnostic_context *, + diagnostic_info *); /* Force diagnostics controlled by OPTIDX to be kind KIND. */ extern diagnostic_t diagnostic_classify_diagnostic (diagnostic_context *, |