aboutsummaryrefslogtreecommitdiff
path: root/gcc/jit/libgccjit.h
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2015-06-30 19:27:19 +0000
committerDavid Malcolm <dmalcolm@gcc.gnu.org>2015-06-30 19:27:19 +0000
commitfa22c20d5ae9df54a5f96f4f72db72a2c4c8e2c7 (patch)
tree216dcfe8525aa7d749c5a1c65ca69a8493f4dfac /gcc/jit/libgccjit.h
parenta6314e15e0c5671e71f4511011a125aab3cc3d6a (diff)
downloadgcc-fa22c20d5ae9df54a5f96f4f72db72a2c4c8e2c7.zip
gcc-fa22c20d5ae9df54a5f96f4f72db72a2c4c8e2c7.tar.gz
gcc-fa22c20d5ae9df54a5f96f4f72db72a2c4c8e2c7.tar.bz2
PR jit/66628: add gcc_jit_context_add_command_line_option
gcc/jit/ChangeLog: PR jit/66628 * docs/cp/topics/contexts.rst (Additional command-line options): New section. * docs/topics/compatibility.rst: New file. * docs/topics/contexts.rst (Additional command-line options): New section. * docs/topics/index.rst: Add compatibility.rst. * docs/_build/texinfo/libgccjit.texi: Regenerate. * jit-playback.c (make_fake_args): Add call to append_command_line_options. * jit-recording.c: Within namespace gcc::jit... (recording::context::~context): Free the optnames within m_command_line_options. (recording::context::set_bool_option): Likewise. (recording::context::add_command_line_option): New method. (recording::context::append_command_line_options): New method. (recording::context::dump_reproducer_to_file): Add command-line options. * jit-recording.h: Within namespace gcc::jit... (recording::context::add_command_line_option): New method. (recording::context::append_command_line_options): New method. (recording::context::m_command_line_options): New field. * libgccjit++.h (gccjit::context::add_command_line_option): New method. * libgccjit.c (gcc_jit_context_add_command_line_option): New API entrypoint. * libgccjit.h (gcc_jit_context_add_command_line_option): New API entrypoint. (LIBGCCJIT_HAVE_gcc_jit_context_add_command_line_option): New macro. * libgccjit.map: Put existing symbols within LIBGCCJIT_ABI_0; add LIBGCCJIT_ABI_1 and gcc_jit_context_add_command_line_option. gcc/testsuite/ChangeLog: PR jit/66628 * jit.dg/all-non-failing-tests.h: Add note about test-extra-options.c. * jit.dg/test-extra-options.c: New testcase. From-SVN: r225205
Diffstat (limited to 'gcc/jit/libgccjit.h')
-rw-r--r--gcc/jit/libgccjit.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/jit/libgccjit.h b/gcc/jit/libgccjit.h
index 8f4354e..8b906e7 100644
--- a/gcc/jit/libgccjit.h
+++ b/gcc/jit/libgccjit.h
@@ -243,6 +243,29 @@ gcc_jit_context_set_bool_option (gcc_jit_context *ctxt,
enum gcc_jit_bool_option opt,
int value);
+/* 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
+ returns.
+
+ Note that only some options are likely to be meaningful; there is no
+ "frontend" within libgccjit, so typically only those affecting
+ optimization and code-generation are likely to be useful.
+
+ This entrypoint was added in LIBGCCJIT_ABI_1; you can test for
+ its presence using
+ #ifdef LIBGCCJIT_HAVE_gcc_jit_context_add_command_line_option
+*/
+
+extern void
+gcc_jit_context_add_command_line_option (gcc_jit_context *ctxt,
+ const char *optname);
+
+/* Pre-canned feature-test macro for detecting the presence of
+ gcc_jit_context_add_command_line_option within libgccjit.h. */
+
+#define LIBGCCJIT_HAVE_gcc_jit_context_add_command_line_option
+
/* Compile the context to in-memory machine code.
This can be called more that once on a given context,