aboutsummaryrefslogtreecommitdiff
path: root/gcc/jit
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/jit')
-rw-r--r--gcc/jit/ChangeLog45
-rw-r--r--gcc/jit/dummy-frontend.cc38
-rw-r--r--gcc/jit/jit-playback.cc2
-rw-r--r--gcc/jit/jit-playback.h9
-rw-r--r--gcc/jit/libgccjit++.h18
5 files changed, 80 insertions, 32 deletions
diff --git a/gcc/jit/ChangeLog b/gcc/jit/ChangeLog
index f0b70c2..fc42e5a 100644
--- a/gcc/jit/ChangeLog
+++ b/gcc/jit/ChangeLog
@@ -1,3 +1,48 @@
+2025-08-13 David Malcolm <dmalcolm@redhat.com>
+
+ PR jit/121516
+ * libgccjit++.h (context::new_struct_type): Replace use of
+ &fields[0] with fields.data ().
+ (context::new_function): Likewise for params.
+ (context::new_rvalue): Likewise for elements.
+ (context::new_call): Likewise for args.
+ (block::end_with_switch): Likewise for cases.
+ (block::end_with_extended_asm_goto): Likewise for goto_blocks.
+ (context::new_struct_ctor): Likewise for fields and values.
+ (context::new_array_ctor): Likewise for values.
+
+2025-07-25 David Malcolm <dmalcolm@redhat.com>
+
+ * dummy-frontend.cc: Update usage of "diagnostic_info" to
+ explicitly refer to "diagnostics::diagnostic_info".
+
+2025-07-25 David Malcolm <dmalcolm@redhat.com>
+
+ * dummy-frontend.cc: Update for diagnostic_t becoming
+ enum class diagnostics::kind.
+
+2025-07-25 David Malcolm <dmalcolm@redhat.com>
+
+ * dummy-frontend.cc: Update for diagnostic_context becoming
+ diagnostics::context.
+ * jit-playback.h: Likewise.
+
+2025-07-25 David Malcolm <dmalcolm@redhat.com>
+
+ * jit-playback.cc: Update for diagnostic_info moving into
+ namespace diagnostics.
+ * jit-playback.h: Likewise.
+
+2025-07-25 David Malcolm <dmalcolm@redhat.com>
+
+ * dummy-frontend.cc: Update for move of diagnostics output formats
+ into namespace "diagnostics" as "sinks".
+
+2025-04-28 David Malcolm <dmalcolm@redhat.com>
+
+ * dummy-frontend.cc: Drop include of "make-unique.h".
+ Replace uses of ::make_unique with std::make_unique.
+
2025-03-29 Iain Sandoe <iain@sandoe.co.uk>
* libgccjit.exports: Add symbols for ABI 28 to 34.
diff --git a/gcc/jit/dummy-frontend.cc b/gcc/jit/dummy-frontend.cc
index 88784ec..3ffca92 100644
--- a/gcc/jit/dummy-frontend.cc
+++ b/gcc/jit/dummy-frontend.cc
@@ -32,8 +32,7 @@ along with GCC; see the file COPYING3. If not see
#include "attribs.h"
#include "cgraph.h"
#include "target.h"
-#include "diagnostic-format-text.h"
-#include "make-unique.h"
+#include "diagnostics/text-sink.h"
#include "print-tree.h"
#include <mpfr.h>
@@ -994,16 +993,16 @@ struct ggc_root_tab jit_root_tab[] =
LAST_GGC_ROOT_TAB
};
-/* Subclass of diagnostic_output_format for libgccjit: like text
+/* Subclass of diagnostics::text_sink for libgccjit: like text
output, but capture the message and call add_diagnostic with it
on the active playback context. */
-class jit_diagnostic_listener : public diagnostic_text_output_format
+class jit_diagnostic_listener : public diagnostics::text_sink
{
public:
- jit_diagnostic_listener (diagnostic_context &dc,
+ jit_diagnostic_listener (diagnostics::context &dc,
gcc::jit::playback::context &playback_ctxt)
- : diagnostic_text_output_format (dc),
+ : diagnostics::text_sink (dc),
m_playback_ctxt (playback_ctxt)
{
}
@@ -1016,13 +1015,13 @@ public:
(void *)&m_playback_ctxt);
}
- void on_report_diagnostic (const diagnostic_info &info,
- diagnostic_t orig_diag_kind) final override
+ void on_report_diagnostic (const diagnostics::diagnostic_info &info,
+ enum diagnostics::kind orig_diag_kind) final override
{
JIT_LOG_SCOPE (gcc::jit::active_playback_ctxt->get_logger ());
/* Let the text output format do most of the work. */
- diagnostic_text_output_format::on_report_diagnostic (info, orig_diag_kind);
+ diagnostics::text_sink::on_report_diagnostic (info, orig_diag_kind);
const char *text = pp_formatted_text (get_printer ());
@@ -1042,8 +1041,8 @@ private:
/* Implementation of "begin_diagnostic". */
static void
-jit_begin_diagnostic (diagnostic_text_output_format &,
- const diagnostic_info */*diagnostic*/)
+jit_begin_diagnostic (diagnostics::text_sink &,
+ const diagnostics::diagnostic_info */*diagnostic*/)
{
gcc_assert (gcc::jit::active_playback_ctxt);
JIT_LOG_SCOPE (gcc::jit::active_playback_ctxt->get_logger ());
@@ -1055,9 +1054,9 @@ jit_begin_diagnostic (diagnostic_text_output_format &,
/* Implementation of "end_diagnostic". */
static void
-jit_end_diagnostic (diagnostic_text_output_format &,
- const diagnostic_info *,
- diagnostic_t)
+jit_end_diagnostic (diagnostics::text_sink &,
+ const diagnostics::diagnostic_info *,
+ enum diagnostics::kind)
{
gcc_assert (gcc::jit::active_playback_ctxt);
JIT_LOG_SCOPE (gcc::jit::active_playback_ctxt->get_logger ());
@@ -1082,12 +1081,13 @@ jit_langhook_init (void)
}
gcc_assert (global_dc);
- diagnostic_text_starter (global_dc) = jit_begin_diagnostic;
- diagnostic_text_finalizer (global_dc) = jit_end_diagnostic;
+ diagnostics::text_starter (global_dc) = jit_begin_diagnostic;
+ diagnostics::text_finalizer (global_dc) = jit_end_diagnostic;
auto sink
- = ::make_unique<jit_diagnostic_listener> (*global_dc,
- *gcc::jit::active_playback_ctxt);
- global_dc->set_output_format (std::move (sink));
+ = std::make_unique<jit_diagnostic_listener>
+ (*global_dc,
+ *gcc::jit::active_playback_ctxt);
+ global_dc->set_sink (std::move (sink));
build_common_tree_nodes (flag_signed_char);
diff --git a/gcc/jit/jit-playback.cc b/gcc/jit/jit-playback.cc
index 6946f10..4473d8b 100644
--- a/gcc/jit/jit-playback.cc
+++ b/gcc/jit/jit-playback.cc
@@ -3892,7 +3892,7 @@ add_error_va (location *loc, const char *fmt, va_list ap)
void
playback::context::
add_diagnostic (const char *text,
- const diagnostic_info &diagnostic)
+ const diagnostics::diagnostic_info &diagnostic)
{
/* Get location information (if any) from the diagnostic.
The recording::context::add_error[_va] methods require a
diff --git a/gcc/jit/jit-playback.h b/gcc/jit/jit-playback.h
index e9a5c38..b0625dc 100644
--- a/gcc/jit/jit-playback.h
+++ b/gcc/jit/jit-playback.h
@@ -30,8 +30,11 @@ along with GCC; see the file COPYING3. If not see
#include "jit-recording.h"
-class diagnostic_context;
-struct diagnostic_info;
+namespace diagnostics
+{
+ class context;
+ struct diagnostic_info;
+}
namespace gcc {
@@ -298,7 +301,7 @@ public:
void
add_diagnostic (const char *text,
- const diagnostic_info &diagnostic);
+ const diagnostics::diagnostic_info &diagnostic);
void
set_tree_location (tree t, location *loc);
diff --git a/gcc/jit/libgccjit++.h b/gcc/jit/libgccjit++.h
index 7ecd915..608c49d 100644
--- a/gcc/jit/libgccjit++.h
+++ b/gcc/jit/libgccjit++.h
@@ -841,7 +841,7 @@ context::new_struct_type (const std::string &name,
location loc)
{
/* Treat std::vector as an array, relying on it not being resized: */
- field *as_array_of_wrappers = &fields[0];
+ field *as_array_of_wrappers = fields.data ();
/* Treat the array as being of the underlying pointers, relying on
the wrapper type being such a pointer internally. */
@@ -885,7 +885,7 @@ context::new_function (enum gcc_jit_function_kind kind,
location loc)
{
/* Treat std::vector as an array, relying on it not being resized: */
- param *as_array_of_wrappers = &params[0];
+ param *as_array_of_wrappers = params.data ();
/* Treat the array as being of the underlying pointers, relying on
the wrapper type being such a pointer internally. */
@@ -988,7 +988,7 @@ context::new_rvalue (type vector_type,
std::vector<rvalue> elements) const
{
/* Treat std::vector as an array, relying on it not being resized: */
- rvalue *as_array_of_wrappers = &elements[0];
+ rvalue *as_array_of_wrappers = elements.data ();
/* Treat the array as being of the underlying pointers, relying on
the wrapper type being such a pointer internally. */
@@ -1194,7 +1194,7 @@ context::new_call (function func,
location loc)
{
/* Treat std::vector as an array, relying on it not being resized: */
- rvalue *as_array_of_wrappers = &args[0];
+ rvalue *as_array_of_wrappers = args.data ();
/* Treat the array as being of the underlying pointers, relying on
the wrapper type being such a pointer internally. */
@@ -1615,7 +1615,7 @@ block::end_with_switch (rvalue expr,
location loc)
{
/* Treat std::vector as an array, relying on it not being resized: */
- case_ *as_array_of_wrappers = &cases[0];
+ case_ *as_array_of_wrappers = cases.data ();
/* Treat the array as being of the underlying pointers, relying on
the wrapper type being such a pointer internally. */
@@ -1645,7 +1645,7 @@ block::end_with_extended_asm_goto (const std::string &asm_template,
location loc)
{
/* Treat std::vector as an array, relying on it not being resized: */
- block *as_array_of_wrappers = &goto_blocks[0];
+ block *as_array_of_wrappers = goto_blocks.data ();
/* Treat the array as being of the underlying pointers, relying on
the wrapper type being such a pointer internally. */
@@ -1869,14 +1869,14 @@ context::new_struct_ctor (type type_,
{
field *pfields = nullptr;
if (fields.size ())
- pfields = &fields[0];
+ pfields = fields.data ();
gcc_jit_field **fields_arr =
reinterpret_cast<gcc_jit_field **> (pfields);
rvalue *pvalues = nullptr;
if (values.size ())
- pvalues = &values[0];
+ pvalues = values.data ();
gcc_jit_rvalue **values_arr =
reinterpret_cast<gcc_jit_rvalue **> (pvalues);
@@ -1898,7 +1898,7 @@ context::new_array_ctor (type type_,
{
rvalue *pvalues = nullptr;
if (values.size ())
- pvalues = &values[0];
+ pvalues = values.data ();
gcc_jit_rvalue **values_arr =
reinterpret_cast<gcc_jit_rvalue **> (pvalues);