diff options
author | Jakub Jelinek <jakub@gcc.gnu.org> | 2013-04-12 08:19:58 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2013-04-12 08:19:58 +0200 |
commit | 4b84d650e82e29bd3ff901a1e34b08435ee99871 (patch) | |
tree | 6c0949bd9c81eb35e9a104c1b13c71602bef3a0c /gcc/diagnostic.def | |
parent | 067a1e719b28b7a62d0a4c4a0732938fe45a812b (diff) | |
download | gcc-4b84d650e82e29bd3ff901a1e34b08435ee99871.zip gcc-4b84d650e82e29bd3ff901a1e34b08435ee99871.tar.gz gcc-4b84d650e82e29bd3ff901a1e34b08435ee99871.tar.bz2 |
opts.c: Include diagnostic-color.h.
* opts.c: Include diagnostic-color.h.
(common_handle_option): Handle OPT_fdiagnostics_color_.
* Makefile.in (OBJS-libcommon): Add diagnostic-color.o.
(diagnostic.o, opts.o, pretty-print.o): Depend on diagnostic-color.h.
(diagnostic-color.o): New.
* common.opt (fdiagnostics-color, fdiagnostics-color=): New options.
(diagnostic_color_rule): New enum.
* dwarf2out.c (gen_producer_string): Don't print -fdiagnostics-color*.
* langhooks.c (lhd_print_error_function): Add %r "locus" and %R around
the location string.
* diagnostic.def: Add 3rd argument to DEFINE_DIAGNOSTIC_KIND macros,
either NULL, or color kind.
* diagnostic-color.c: New file.
* diagnostic-color.h: New file.
* diagnostic-core.h (DEFINE_DIAGNOSTIC_KIND): Adjust macro for 3
arguments.
* doc/invoke.texi (-fdiagnostics-color): Document.
* pretty-print.h (pp_show_color): Define.
(struct pretty_print_info): Add show_color field.
* diagnostic.c: Include diagnostic-color.h.
(diagnostic_build_prefix): Adjust for 3 argument DEFINE_DIAGNOSTIC_KIND
macros. Colorize error:, warning: etc. strings and also the location
string.
(diagnostic_show_locus): Colorize the caret line.
* pretty-print.c: Include diagnostic-color.h.
(pp_base_format): Handle %r and %R format specifiers. Colorize strings
inside of %< %> quotes or quoted through q format modifier.
c-family/
* c-format.c (gcc_diag_char_table, gcc_tdiag_char_table,
gcc_cdiag_char_table, gcc_cxxdiag_char_table): Add %r and %R format
specifiers.
cp/
* error.c (cp_print_error_function,
print_instantiation_partial_context_line,
maybe_print_constexpr_context): Colorize locus strings.
From-SVN: r197841
Diffstat (limited to 'gcc/diagnostic.def')
-rw-r--r-- | gcc/diagnostic.def | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/gcc/diagnostic.def b/gcc/diagnostic.def index 9566491..2f1e365 100644 --- a/gcc/diagnostic.def +++ b/gcc/diagnostic.def @@ -22,26 +22,26 @@ along with GCC; see the file COPYING3. If not see kind specified. I.e. they're uninitialized. Within the diagnostic machinery, this kind also means "don't change the existing kind", meaning "no change is specified". */ -DEFINE_DIAGNOSTIC_KIND (DK_UNSPECIFIED, "") +DEFINE_DIAGNOSTIC_KIND (DK_UNSPECIFIED, "", NULL) /* If a diagnostic is set to DK_IGNORED, it won't get reported at all. This is used by the diagnostic machinery when it wants to disable a diagnostic without disabling the option which causes it. */ -DEFINE_DIAGNOSTIC_KIND (DK_IGNORED, "") +DEFINE_DIAGNOSTIC_KIND (DK_IGNORED, "", NULL) /* The remainder are real diagnostic types. */ -DEFINE_DIAGNOSTIC_KIND (DK_FATAL, "fatal error: ") -DEFINE_DIAGNOSTIC_KIND (DK_ICE, "internal compiler error: ") -DEFINE_DIAGNOSTIC_KIND (DK_ERROR, "error: ") -DEFINE_DIAGNOSTIC_KIND (DK_SORRY, "sorry, unimplemented: ") -DEFINE_DIAGNOSTIC_KIND (DK_WARNING, "warning: ") -DEFINE_DIAGNOSTIC_KIND (DK_ANACHRONISM, "anachronism: ") -DEFINE_DIAGNOSTIC_KIND (DK_NOTE, "note: ") -DEFINE_DIAGNOSTIC_KIND (DK_DEBUG, "debug: ") +DEFINE_DIAGNOSTIC_KIND (DK_FATAL, "fatal error: ", "error") +DEFINE_DIAGNOSTIC_KIND (DK_ICE, "internal compiler error: ", "error") +DEFINE_DIAGNOSTIC_KIND (DK_ERROR, "error: ", "error") +DEFINE_DIAGNOSTIC_KIND (DK_SORRY, "sorry, unimplemented: ", "error") +DEFINE_DIAGNOSTIC_KIND (DK_WARNING, "warning: ", "warning") +DEFINE_DIAGNOSTIC_KIND (DK_ANACHRONISM, "anachronism: ", "warning") +DEFINE_DIAGNOSTIC_KIND (DK_NOTE, "note: ", "note") +DEFINE_DIAGNOSTIC_KIND (DK_DEBUG, "debug: ", "note") /* These two would be re-classified as DK_WARNING or DK_ERROR, so the prefix does not matter. */ -DEFINE_DIAGNOSTIC_KIND (DK_PEDWARN, "pedwarn: ") -DEFINE_DIAGNOSTIC_KIND (DK_PERMERROR, "permerror: ") +DEFINE_DIAGNOSTIC_KIND (DK_PEDWARN, "pedwarn: ", NULL) +DEFINE_DIAGNOSTIC_KIND (DK_PERMERROR, "permerror: ", NULL) /* This one is just for counting DK_WARNING promoted to DK_ERROR due to -Werror and -Werror=warning. */ -DEFINE_DIAGNOSTIC_KIND (DK_WERROR, "error: ") +DEFINE_DIAGNOSTIC_KIND (DK_WERROR, "error: ", NULL) |