aboutsummaryrefslogtreecommitdiff
path: root/gcc/pretty-print.h
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2023-10-03 09:39:16 -0400
committerDavid Malcolm <dmalcolm@redhat.com>2023-10-03 09:39:16 -0400
commitc44ca7c01226e0768e58c5b274ddd5e161378010 (patch)
tree65989de19c04f19fc70f37acddc8256540744887 /gcc/pretty-print.h
parent09881218137f4af9b7c894c2d350cf2ff8e0ee23 (diff)
downloadgcc-c44ca7c01226e0768e58c5b274ddd5e161378010.zip
gcc-c44ca7c01226e0768e58c5b274ddd5e161378010.tar.gz
gcc-c44ca7c01226e0768e58c5b274ddd5e161378010.tar.bz2
diagnostics: add ctors to text_info; add m_ prefixes to fields
No functional change intended. gcc/ada/ChangeLog: * gcc-interface/misc.cc: Use text_info ctor. gcc/analyzer/ChangeLog: * analyzer-logging.cc (logger::log_va_partial): Use text_info ctor. * analyzer.cc (make_label_text): Likewise. (make_label_text_n): Likewise. * pending-diagnostic.cc (evdesc::event_desc::formatted_print): Likewise. gcc/c/ChangeLog: * c-objc-common.cc (c_tree_printer): Update for "m_" prefixes to text_info fields. gcc/cp/ChangeLog: * error.cc: Update for "m_" prefixes to text_info fields. gcc/d/ChangeLog: * d-diagnostic.cc (d_diagnostic_report_diagnostic): Use text_info ctor. gcc/ChangeLog: * diagnostic.cc (diagnostic_set_info_translated): Update for "m_" prefixes to text_info fields. (diagnostic_report_diagnostic): Likewise. (verbatim): Use text_info ctor. (simple_diagnostic_path::add_event): Likewise. (simple_diagnostic_path::add_thread_event): Likewise. * dumpfile.cc (dump_pretty_printer::decode_format): Update for "m_" prefixes to text_info fields. (dump_context::dump_printf_va): Use text_info ctor. * graphviz.cc (graphviz_out::graphviz_out): Use text_info ctor. (graphviz_out::print): Likewise. * opt-problem.cc (opt_problem::opt_problem): Likewise. * pretty-print.cc (pp_format): Update for "m_" prefixes to text_info fields. (pp_printf): Use text_info ctor. (pp_verbatim): Likewise. (assert_pp_format_va): Likewise. * pretty-print.h (struct text_info): Add ctors. Add "m_" prefix to all fields. * text-art/styled-string.cc (styled_string::from_fmt_va): Use text_info ctor. * tree-diagnostic.cc (default_tree_printer): Update for "m_" prefixes to text_info fields. * tree-pretty-print.h (pp_ti_abstract_origin): Likewise. gcc/fortran/ChangeLog: * error.cc (gfc_format_decoder): Update for "m_" prefixes to text_info fields. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'gcc/pretty-print.h')
-rw-r--r--gcc/pretty-print.h24
1 files changed, 19 insertions, 5 deletions
diff --git a/gcc/pretty-print.h b/gcc/pretty-print.h
index 8ba4296..ad6d659 100644
--- a/gcc/pretty-print.h
+++ b/gcc/pretty-print.h
@@ -31,15 +31,29 @@ along with GCC; see the file COPYING3. If not see
along with a list of things. */
struct text_info
{
- const char *format_spec;
- va_list *args_ptr;
- int err_no; /* for %m */
- void **x_data;
- rich_location *m_richloc;
+ text_info () = default;
+ text_info (const char *format_spec,
+ va_list *args_ptr,
+ int err_no,
+ void **data = nullptr,
+ rich_location *rich_loc = nullptr)
+ : m_format_spec (format_spec),
+ m_args_ptr (args_ptr),
+ m_err_no (err_no),
+ m_data (data),
+ m_richloc (rich_loc)
+ {
+ }
void set_location (unsigned int idx, location_t loc,
enum range_display_kind range_display_kind);
location_t get_location (unsigned int index_of_location) const;
+
+ const char *m_format_spec;
+ va_list *m_args_ptr;
+ int m_err_no; /* for %m */
+ void **m_data;
+ rich_location *m_richloc;
};
/* How often diagnostics are prefixed by their locations: