r236342 - in /trunk/gcc: jit/ChangeLog jit/dumm...

dmalcolm@gcc.gnu.org dmalcolm@gcc.gnu.org
Tue May 17 19:28:00 GMT 2016


Author: dmalcolm
Date: Tue May 17 19:28:47 2016
New Revision: 236342

URL: https://gcc.gnu.org/viewcvs?rev=236342&root=gcc&view=rev
Log:
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.


Added:
    trunk/gcc/testsuite/jit.dg/test-error-array-bounds.c
Modified:
    trunk/gcc/jit/ChangeLog
    trunk/gcc/jit/dummy-frontend.c
    trunk/gcc/jit/jit-playback.c
    trunk/gcc/jit/jit-playback.h
    trunk/gcc/testsuite/ChangeLog



More information about the Gcc-cvs mailing list