aboutsummaryrefslogtreecommitdiff
path: root/gcc/jit/libgccjit.h
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2015-06-30 19:38:12 +0000
committerDavid Malcolm <dmalcolm@gcc.gnu.org>2015-06-30 19:38:12 +0000
commit6a3603e356e14096e9554ceef57916fd03d9072b (patch)
tree60b23e2094b5f3e725a9eec2008ef0365a837e1e /gcc/jit/libgccjit.h
parentfa22c20d5ae9df54a5f96f4f72db72a2c4c8e2c7 (diff)
downloadgcc-6a3603e356e14096e9554ceef57916fd03d9072b.zip
gcc-6a3603e356e14096e9554ceef57916fd03d9072b.tar.gz
gcc-6a3603e356e14096e9554ceef57916fd03d9072b.tar.bz2
PR jit/66546: Add gcc_jit_context_set_bool_allow_unreachable_blocks
gcc/jit/ChangeLog: PR jit/66546 * docs/cp/topics/contexts.rst (gccjit::context::set_bool_allow_unreachable_blocks): New. * docs/topics/compatibility.rst (LIBGCCJIT_ABI_2): New. * docs/topics/contexts.rst (Options): Add notes discussing the transition from enums to entrypoints for new options. (gcc_jit_context_set_bool_allow_unreachable_blocks): New. * docs/_build/texinfo/libgccjit.texi: Regenerate. * jit-common.h (gcc::jit::inner_bool_option): New enum. * jit-recording.c: Within namespace gcc::jit... (recording::context::context): Handle m_inner_bool_options. (recording::context::set_inner_bool_option): New. (inner_bool_option_reproducer_strings): New. (recording::context::log_all_options): Log the "inner" bool options. (recording::context::log_inner_bool_option): New. (recording::context::dump_reproducer_to_file): Write initializers for "inner" bool options. (recording::function::validate): Don't check for block reachability if INNER_BOOL_OPTION_ALLOW_UNREACHABLE_BLOCKS is set. * jit-recording.h: Within namespace gcc::jit... (recording::context::set_inner_bool_option): New. (recording::context::get_inner_bool_option): New. (recording::context::log_inner_bool_option): New. (recording::context::m_inner_bool_options): New. * libgccjit++.h (gccjit::context::set_bool_allow_unreachable_blocks): New. * libgccjit.c (gcc_jit_context_set_bool_allow_unreachable_blocks): New. * libgccjit.h: Add note about options present in the initial release of libgccjit. (gcc_jit_context_set_bool_allow_unreachable_blocks): New API entrypoint. (LIBGCCJIT_HAVE_gcc_jit_context_set_bool_allow_unreachable_blocks): New macro. * libgccjit.map (LIBGCCJIT_ABI_2): New, containing... (gcc_jit_context_set_bool_allow_unreachable_blocks): ...this new entrypoint. gcc/testsuite/ChangeLog: PR jit/66546 * jit.dg/all-non-failing-tests.h: Add note about test-validly-unreachable-block.c. * jit.dg/test-validly-unreachable-block.c: New file. From-SVN: r225206
Diffstat (limited to 'gcc/jit/libgccjit.h')
-rw-r--r--gcc/jit/libgccjit.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/jit/libgccjit.h b/gcc/jit/libgccjit.h
index 8b906e7..e33900c 100644
--- a/gcc/jit/libgccjit.h
+++ b/gcc/jit/libgccjit.h
@@ -140,6 +140,9 @@ gcc_jit_context_acquire (void);
extern void
gcc_jit_context_release (gcc_jit_context *ctxt);
+/* Options present in the initial release of libgccjit.
+ These were handled using enums. */
+
/* Options taking string values. */
enum gcc_jit_str_option
{
@@ -243,6 +246,31 @@ gcc_jit_context_set_bool_option (gcc_jit_context *ctxt,
enum gcc_jit_bool_option opt,
int value);
+/* Options added after the initial release of libgccjit.
+ These are handled by providing an entrypoint per option,
+ rather than by extending the enum gcc_jit_*_option,
+ so that client code that use these new options can be identified
+ from binary metadata. */
+
+/* By default, libgccjit will issue an error about unreachable blocks
+ within a function.
+
+ This option can be used to disable that error.
+
+ This entrypoint was added in LIBGCCJIT_ABI_2; you can test for
+ its presence using
+ #ifdef LIBGCCJIT_HAVE_gcc_jit_context_set_bool_allow_unreachable_blocks
+*/
+
+extern void
+gcc_jit_context_set_bool_allow_unreachable_blocks (gcc_jit_context *ctxt,
+ int bool_value);
+
+/* Pre-canned feature macro to indicate the presence of
+ gcc_jit_context_set_bool_allow_unreachable_blocks. This can be
+ tested for with #ifdef. */
+#define LIBGCCJIT_HAVE_gcc_jit_context_set_bool_allow_unreachable_blocks
+
/* Add an arbitrary gcc command-line option to the context.
The context takes a copy of the string, so the
(const char *) optname is not needed anymore after the call