aboutsummaryrefslogtreecommitdiff
path: root/gcc/diagnostics/context.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/diagnostics/context.h')
-rw-r--r--gcc/diagnostics/context.h31
1 files changed, 13 insertions, 18 deletions
diff --git a/gcc/diagnostics/context.h b/gcc/diagnostics/context.h
index b6ec85c..dea4588 100644
--- a/gcc/diagnostics/context.h
+++ b/gcc/diagnostics/context.h
@@ -26,6 +26,7 @@ along with GCC; see the file COPYING3. If not see
#include "diagnostics/option-id-manager.h"
#include "diagnostics/context-options.h"
#include "diagnostics/source-printing-options.h"
+#include "diagnostics/column-options.h"
#include "diagnostics/counters.h"
namespace diagnostics {
@@ -99,13 +100,11 @@ public:
bool show_column,
bool colorize) const;
- int get_tabstop () const { return m_tabstop; }
+ int get_tabstop () const { return m_column_options.m_tabstop; }
private:
file_cache &m_file_cache;
- enum diagnostics_column_unit m_column_unit;
- int m_column_origin;
- int m_tabstop;
+ column_options m_column_options;
};
/* A bundle of state for printing locations within diagnostics
@@ -265,7 +264,7 @@ public:
friend class text_sink;
friend class buffer;
- typedef void (*set_locations_callback_t) (context *,
+ typedef void (*set_locations_callback_t) (const context &,
diagnostic_info *);
void initialize (int n_opts);
@@ -393,6 +392,9 @@ public:
}
void set_show_path_depths (bool val) { m_show_path_depths = val; }
void set_show_option_requested (bool val) { m_show_option_requested = val; }
+ void set_show_nesting (bool val);
+ void set_show_nesting_locations (bool val);
+ void set_show_nesting_levels (bool val);
void set_max_errors (int val) { m_max_errors = val; }
void set_escape_format (enum diagnostics_escape_format val)
{
@@ -572,7 +574,7 @@ public:
}
void
- set_adjust_diagnostic_info_callback (void (*cb) (context *,
+ set_adjust_diagnostic_info_callback (void (*cb) (const context &,
diagnostic_info *))
{
m_adjust_diagnostic_info = cb;
@@ -592,6 +594,9 @@ public:
return m_source_printing;
}
+ column_options &get_column_options () { return m_column_options; }
+ const column_options &get_column_options () const { return m_column_options; }
+
void set_caret_max_width (int value);
private:
@@ -708,7 +713,7 @@ private:
/* Client hook to adjust properties of the given diagnostic that we're
about to issue, such as its kind. */
- void (*m_adjust_diagnostic_info)(context *, diagnostic_info *);
+ void (*m_adjust_diagnostic_info)(const context &, diagnostic_info *);
/* Owned by the context; this would be a std::unique_ptr if
context had a proper ctor. */
@@ -739,6 +744,7 @@ private:
bool m_inhibit_notes_p;
source_printing_options m_source_printing;
+ column_options m_column_options;
/* True if -freport-bug option is used. */
bool m_report_bug;
@@ -748,17 +754,6 @@ private:
-fdiagnostics-parseable-fixits and GCC_EXTRA_DIAGNOSTIC_OUTPUT. */
enum diagnostics_extra_output_kind m_extra_output_kind;
-public:
- /* What units to use when outputting the column number. */
- enum diagnostics_column_unit m_column_unit;
-
- /* The origin for the column number (1-based or 0-based typically). */
- int m_column_origin;
-
- /* The size of the tabstop for tab expansion. */
- int m_tabstop;
-
-private:
/* How should non-ASCII/non-printable bytes be escaped when
a diagnostic suggests escaping the source code on output. */
enum diagnostics_escape_format m_escape_format;