aboutsummaryrefslogtreecommitdiff
path: root/gcc/jit/jit-playback.h
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2016-05-17 19:28:47 +0000
committerDavid Malcolm <dmalcolm@gcc.gnu.org>2016-05-17 19:28:47 +0000
commit6b5423a512421989934071586c9ddb6ee42ac417 (patch)
treeff6f37c704f22faac7eab9e79f10232646b62933 /gcc/jit/jit-playback.h
parentf51703a8f80c9935f27148bb53ec7591716fd519 (diff)
downloadgcc-6b5423a512421989934071586c9ddb6ee42ac417.zip
gcc-6b5423a512421989934071586c9ddb6ee42ac417.tar.gz
gcc-6b5423a512421989934071586c9ddb6ee42ac417.tar.bz2
jit: gcc diagnostics are jit errors
libgccjit performs numerous checks at the API boundary, but if these succeed, it ignores errors and other diagnostics emitted within the core of gcc, and treats the compile of a gcc_jit_context as having succeeded. This patch ensures that if any diagnostics are emitted, they are visible from the libgccjit API, and that the the context is flagged as having failed. For now any kind of diagnostic is treated as a jit error, so warnings and notes also count as errors. gcc/jit/ChangeLog: * dummy-frontend.c: Include diagnostic.h. (jit_begin_diagnostic): New function. (jit_end_diagnostic): New function. (jit_langhook_init): Register jit_begin_diagnostic and jit_end_diagnostic with the global_dc. * jit-playback.c: Include diagnostic.h. (gcc::jit::playback::context::add_diagnostic): New method. * jit-playback.h (struct diagnostic_context): Add forward declaration. (gcc::jit::playback::context::add_diagnostic): New method. gcc/testsuite/ChangeLog: * jit.dg/test-error-array-bounds.c: New test case. From-SVN: r236342
Diffstat (limited to 'gcc/jit/jit-playback.h')
-rw-r--r--gcc/jit/jit-playback.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/jit/jit-playback.h b/gcc/jit/jit-playback.h
index 905747c..8f7a43d 100644
--- a/gcc/jit/jit-playback.h
+++ b/gcc/jit/jit-playback.h
@@ -27,6 +27,9 @@ along with GCC; see the file COPYING3. If not see
#include "jit-recording.h"
+struct diagnostic_context;
+struct diagnostic_info;
+
namespace gcc {
namespace jit {
@@ -203,6 +206,10 @@ public:
get_first_error () const;
void
+ add_diagnostic (struct diagnostic_context *context,
+ struct diagnostic_info *diagnostic);
+
+ void
set_tree_location (tree t, location *loc);
tree