Skip to content

Commit 2ae4b0e

Browse files
committed
fixup! libgccjit: Do not treat warnings as errors
1 parent f29173e commit 2ae4b0e

File tree

4 files changed

+13
-21
lines changed

4 files changed

+13
-21
lines changed

gcc/jit/jit-playback.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4044,7 +4044,7 @@ add_error (location *loc, const char *fmt, ...)
40444044
va_list ap;
40454045
va_start (ap, fmt);
40464046
m_recording_ctxt->add_error_va (loc ? loc->get_recording_loc () : NULL,
4047-
DK_ERROR, fmt, ap);
4047+
diagnostics::kind::error, fmt, ap);
40484048
va_end (ap);
40494049
}
40504050

@@ -4056,7 +4056,7 @@ playback::context::
40564056
add_error_va (location *loc, const char *fmt, va_list ap)
40574057
{
40584058
m_recording_ctxt->add_error_va (loc ? loc->get_recording_loc () : NULL,
4059-
DK_ERROR, fmt, ap);
4059+
diagnostics::kind::error, fmt, ap);
40604060
}
40614061

40624062
/* Report a diagnostic up to the jit context, so that the
@@ -4086,7 +4086,7 @@ add_diagnostic (const char *text,
40864086
false);
40874087
}
40884088

4089-
m_recording_ctxt->add_diagnostic (rec_loc, diagnostic.kind, "%s", text);
4089+
m_recording_ctxt->add_diagnostic (rec_loc, diagnostic.m_kind, "%s", text);
40904090
}
40914091

40924092
/* Dealing with the linemap API. */

gcc/jit/jit-recording.cc

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -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-
4234
namespace gcc {
4335
namespace jit {
4436

@@ -1745,7 +1737,7 @@ recording::context::get_target_info ()
17451737
it to stderr, and add it to the context. */
17461738

17471739
void
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

17691761
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,
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

gcc/jit/jit-recording.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ class context : public log_user
334334
get_target_info ();
335335

336336
void
337-
add_diagnostic (location *loc, diagnostic_t diagnostic_kind,
337+
add_diagnostic (location *loc, enum diagnostics::kind diagnostic_kind,
338338
const char *fmt, ...)
339339
GNU_PRINTF(4, 5);
340340

@@ -343,7 +343,7 @@ class context : public log_user
343343
GNU_PRINTF(3, 4);
344344

345345
void
346-
add_error_va (location *loc, diagnostic_t diagnostic_kind, const char *fmt,
346+
add_error_va (location *loc, enum diagnostics::kind diagnostic_kind, const char *fmt,
347347
va_list ap)
348348
GNU_PRINTF(4, 0);
349349

gcc/jit/libgccjit.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ jit_error (gcc::jit::recording::context *ctxt,
341341
va_start (ap, fmt);
342342

343343
if (ctxt)
344-
ctxt->add_error_va (loc, DK_ERROR, fmt, ap);
344+
ctxt->add_error_va (loc, diagnostics::kind::error, fmt, ap);
345345
else
346346
{
347347
/* No context? Send to stderr. */

0 commit comments

Comments
 (0)