summaryrefslogtreecommitdiff
path: root/gcc/diagnostic.h
diff options
context:
space:
mode:
authormanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>2012-04-11 09:26:48 +0000
committermanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>2012-04-11 09:26:48 +0000
commit5a9830842f69ebb059061e26f8b0699cbd85121e (patch)
tree9e780906c85f6be0ad543abba26314c0c15e5512 /gcc/diagnostic.h
parent980af7e02e2f824385a01dea0b053074a70c1645 (diff)
downloadgcc-5a9830842f69ebb059061e26f8b0699cbd85121e.tar.gz
2012-04-11 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR 24985 gcc/ * diagnostic.h (show_caret): Declare. (caret_max_width): Declare. (diagnostic_show_locus): Declare. * diagnostic.c (diagnostic_initialize): Initialize to false. (diagnostic_show_locus): New. (diagnostic_report_diagnostic): Call it. (getenv_columns): New. (adjust_line): New. (diagnostic_set_caret_max_width): New. * input.c (read_line): New. (location_get_source_line): New. * input.h (location_get_source_line): Declare. * toplev.c (general_init): Initialize show_caret from options. * dwarf2out.c (gen_producer_string): Handle fdiagnostics-show-caret. * opts.c (common_handle_option): Likewise. * pretty-print.h (pp_get_prefix): New. (pp_base_get_prefix): New. * common.opt (fdiagnostics-show-caret): New option. * doc/invoke.texi (fdiagnostics-show-caret): Document it. testsuite/ * lib/prune.exp: Add -fno-diagnostics-show-caret. libstdc++-v3/ * testsuite/lib/prune.exp: Handle caret. libmudflap/ * testsuite/lib/libmudflap.exp: Handle caret. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186305 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/diagnostic.h')
-rw-r--r--gcc/diagnostic.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/diagnostic.h b/gcc/diagnostic.h
index 4b1265b7886..63eb3852958 100644
--- a/gcc/diagnostic.h
+++ b/gcc/diagnostic.h
@@ -99,6 +99,13 @@ struct diagnostic_context
int *push_list;
int n_push;
+ /* True if we should print the source line with a caret indicating
+ the location. */
+ bool show_caret;
+
+ /* Maximum width of the source line printed. */
+ int caret_max_width;
+
/* True if we should print the command line option which controls
each diagnostic, if known. */
bool show_option_requested;
@@ -254,6 +261,7 @@ extern diagnostic_context *global_dc;
extern void diagnostic_initialize (diagnostic_context *, int);
extern void diagnostic_finish (diagnostic_context *);
extern void diagnostic_report_current_module (diagnostic_context *, location_t);
+extern void diagnostic_show_locus (diagnostic_context *, const diagnostic_info *);
/* Force diagnostics controlled by OPTIDX to be kind KIND. */
extern diagnostic_t diagnostic_classify_diagnostic (diagnostic_context *,
@@ -275,6 +283,8 @@ extern void diagnostic_set_info_translated (diagnostic_info *, const char *,
extern char *diagnostic_build_prefix (diagnostic_context *, diagnostic_info *);
void default_diagnostic_starter (diagnostic_context *, diagnostic_info *);
void default_diagnostic_finalizer (diagnostic_context *, diagnostic_info *);
+void diagnostic_set_caret_max_width (diagnostic_context *context, int value);
+
/* Pure text formatting support functions. */
extern char *file_name_as_prefix (const char *);