@@ -31,14 +31,6 @@ along with GCC; see the file COPYING3. If not see
31
31
#include " jit-recording.h"
32
32
#include " jit-playback.h"
33
33
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
-
42
34
namespace gcc {
43
35
namespace jit {
44
36
@@ -1745,7 +1737,7 @@ recording::context::get_target_info ()
1745
1737
it to stderr, and add it to the context. */
1746
1738
1747
1739
void
1748
- recording::context::add_diagnostic (location *loc, diagnostic_t diagnostic_kind,
1740
+ recording::context::add_diagnostic (location *loc, diagnostics::kind diagnostic_kind,
1749
1741
const char *fmt, ...)
1750
1742
{
1751
1743
va_list ap;
@@ -1759,15 +1751,15 @@ recording::context::add_error (location *loc, const char *fmt, ...)
1759
1751
{
1760
1752
va_list ap;
1761
1753
va_start (ap, fmt);
1762
- add_error_va (loc, DK_ERROR , fmt, ap);
1754
+ add_error_va (loc, diagnostics::kind::error , fmt, ap);
1763
1755
va_end (ap);
1764
1756
}
1765
1757
1766
1758
/* Format the given error using printf's conventions, print
1767
1759
it to stderr, and add it to the context. */
1768
1760
1769
1761
void
1770
- recording::context::add_error_va (location *loc, diagnostic_t diagnostic_kind,
1762
+ recording::context::add_error_va (location *loc, diagnostics::kind diagnostic_kind,
1771
1763
const char *fmt, va_list ap)
1772
1764
{
1773
1765
int len;
@@ -1789,7 +1781,7 @@ recording::context::add_error_va (location *loc, diagnostic_t diagnostic_kind,
1789
1781
has_ownership = true ;
1790
1782
}
1791
1783
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) ,
1793
1785
m_error_count, errmsg);
1794
1786
1795
1787
const char *ctxt_progname =
@@ -1805,12 +1797,12 @@ recording::context::add_error_va (location *loc, diagnostic_t diagnostic_kind,
1805
1797
fprintf (stderr, " %s: %s: %s: %s\n " ,
1806
1798
ctxt_progname,
1807
1799
loc->get_debug_string (),
1808
- diagnostic_kind_text[ diagnostic_kind] ,
1800
+ diagnostics::get_text_for_kind ( diagnostic_kind) ,
1809
1801
errmsg);
1810
1802
else
1811
1803
fprintf (stderr, " %s: %s: %s\n " ,
1812
1804
ctxt_progname,
1813
- diagnostic_kind_text[ diagnostic_kind] ,
1805
+ diagnostics::get_text_for_kind ( diagnostic_kind) ,
1814
1806
errmsg);
1815
1807
}
1816
1808
@@ -1826,7 +1818,7 @@ recording::context::add_error_va (location *loc, diagnostic_t diagnostic_kind,
1826
1818
m_last_error_str = const_cast <char *> (errmsg);
1827
1819
m_owns_last_error_str = has_ownership;
1828
1820
1829
- if (diagnostic_kind == DK_ERROR )
1821
+ if (diagnostic_kind == diagnostics::kind::error )
1830
1822
m_error_count++;
1831
1823
}
1832
1824
0 commit comments