@@ -31,14 +31,6 @@ along with GCC; see the file COPYING3. If not see
3131#include " jit-recording.h"
3232#include " jit-playback.h"
3333
34- /* This comes from diagnostic.cc. */
35- static const char *const diagnostic_kind_text[] = {
36- #define DEFINE_DIAGNOSTIC_KIND (K, T, C ) (T),
37- #include " diagnostic.def"
38- #undef DEFINE_DIAGNOSTIC_KIND
39- " must-not-happen"
40- };
41-
4234namespace gcc {
4335namespace jit {
4436
@@ -1745,7 +1737,7 @@ recording::context::get_target_info ()
17451737 it to stderr, and add it to the context. */
17461738
17471739void
1748- recording::context::add_diagnostic (location *loc, diagnostic_t diagnostic_kind,
1740+ recording::context::add_diagnostic (location *loc, diagnostics::kind diagnostic_kind,
17491741 const char *fmt, ...)
17501742{
17511743 va_list ap;
@@ -1759,15 +1751,15 @@ recording::context::add_error (location *loc, const char *fmt, ...)
17591751{
17601752 va_list ap;
17611753 va_start (ap, fmt);
1762- add_error_va (loc, DK_ERROR , fmt, ap);
1754+ add_error_va (loc, diagnostics::kind::error , fmt, ap);
17631755 va_end (ap);
17641756}
17651757
17661758/* Format the given error using printf's conventions, print
17671759 it to stderr, and add it to the context. */
17681760
17691761void
1770- recording::context::add_error_va (location *loc, diagnostic_t diagnostic_kind,
1762+ recording::context::add_error_va (location *loc, diagnostics::kind diagnostic_kind,
17711763 const char *fmt, va_list ap)
17721764{
17731765 int len;
@@ -1789,7 +1781,7 @@ recording::context::add_error_va (location *loc, diagnostic_t diagnostic_kind,
17891781 has_ownership = true ;
17901782 }
17911783 if (get_logger ())
1792- get_logger ()->log (" %s %i: %s" , diagnostic_kind_text[ diagnostic_kind] ,
1784+ get_logger ()->log (" %s %i: %s" , diagnostics::get_text_for_kind ( diagnostic_kind) ,
17931785 m_error_count, errmsg);
17941786
17951787 const char *ctxt_progname =
@@ -1805,12 +1797,12 @@ recording::context::add_error_va (location *loc, diagnostic_t diagnostic_kind,
18051797 fprintf (stderr, " %s: %s: %s: %s\n " ,
18061798 ctxt_progname,
18071799 loc->get_debug_string (),
1808- diagnostic_kind_text[ diagnostic_kind] ,
1800+ diagnostics::get_text_for_kind ( diagnostic_kind) ,
18091801 errmsg);
18101802 else
18111803 fprintf (stderr, " %s: %s: %s\n " ,
18121804 ctxt_progname,
1813- diagnostic_kind_text[ diagnostic_kind] ,
1805+ diagnostics::get_text_for_kind ( diagnostic_kind) ,
18141806 errmsg);
18151807 }
18161808
@@ -1826,7 +1818,7 @@ recording::context::add_error_va (location *loc, diagnostic_t diagnostic_kind,
18261818 m_last_error_str = const_cast <char *> (errmsg);
18271819 m_owns_last_error_str = has_ownership;
18281820
1829- if (diagnostic_kind == DK_ERROR )
1821+ if (diagnostic_kind == diagnostics::kind::error )
18301822 m_error_count++;
18311823}
18321824
0 commit comments