diff options
author | Andrea Corallo <andrea.corallo@arm.com> | 2019-02-05 22:11:04 +0000 |
---|---|---|
committer | David Malcolm <dmalcolm@gcc.gnu.org> | 2019-02-05 22:11:04 +0000 |
commit | 216090cc0fb7dc4de5fa9176860c845d5646c6b7 (patch) | |
tree | d96fc32551e87c9cf55bc83adb77634a87c64af6 /gcc/jit/libgccjit.c | |
parent | 6fc4ecbc55bbf1995513102bba88a934b51a146b (diff) | |
download | gcc-216090cc0fb7dc4de5fa9176860c845d5646c6b7.zip gcc-216090cc0fb7dc4de5fa9176860c845d5646c6b7.tar.gz gcc-216090cc0fb7dc4de5fa9176860c845d5646c6b7.tar.bz2 |
libgccjit: introduce gcc_jit_context_add_driver_option
gcc/jit/ChangeLog:
2019-02-05 Andrea Corallo <andrea.corallo@arm.com>
* docs/topics/compatibility.rst (LIBGCCJIT_ABI_11): New ABI tag.
* docs/topics/contexts.rst (Additional driver options): New
section.
* jit-playback.c (invoke_driver): Add call to append_driver_options.
* jit-recording.c: Within namespace gcc::jit...
(recording::context::~context): Free the optnames within
m_driver_options.
(recording::context::add_driver_option): New method.
(recording::context::append_driver_options): New method.
(recording::context::dump_reproducer_to_file): Add driver
options.
* jit-recording.h: Within namespace gcc::jit...
(recording::context::add_driver_option): New method.
(recording::context::append_driver_options): New method.
(recording::context::m_driver_options): New field.
* libgccjit++.h (gccjit::context::add_driver_option): New
method.
* libgccjit.c (gcc_jit_context_add_driver_option): New API
entrypoint.
* libgccjit.h (gcc_jit_context_add_driver_option): New API
entrypoint.
(LIBGCCJIT_HAVE_gcc_jit_context_add_driver_option): New
macro.
* libgccjit.map (LIBGCCJIT_ABI_11): New ABI tag.
gcc/testsuite/ChangeLog:
2019-02-05 Andrea Corallo <andrea.corallo@arm.com>
* jit.dg/add-driver-options-testlib.c: Add support file for
test-add-driver-options.c testcase.
* jit.dg/all-non-failing-tests.h: Add note about
test-add-driver-options.c
* jit.dg/jit.exp (jit-dg-test): Update to support
add-driver-options-testlib.c compilation.
* jit.dg/test-add-driver-options.c: New testcase.
From-SVN: r268563
Diffstat (limited to 'gcc/jit/libgccjit.c')
-rw-r--r-- | gcc/jit/libgccjit.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c index de7fb25..e4f17f8 100644 --- a/gcc/jit/libgccjit.c +++ b/gcc/jit/libgccjit.c @@ -2644,6 +2644,25 @@ gcc_jit_context_add_command_line_option (gcc_jit_context *ctxt, /* Public entrypoint. See description in libgccjit.h. + The real work is done by the + gcc::jit::recording::context::add_driver_option method in + jit-recording.c. */ + +void +gcc_jit_context_add_driver_option (gcc_jit_context *ctxt, + const char *optname) +{ + RETURN_IF_FAIL (ctxt, NULL, NULL, "NULL context"); + JIT_LOG_FUNC (ctxt->get_logger ()); + RETURN_IF_FAIL (optname, ctxt, NULL, "NULL optname"); + if (ctxt->get_logger ()) + ctxt->get_logger ()->log ("optname: %s", optname); + + ctxt->add_driver_option (optname); +} + +/* Public entrypoint. See description in libgccjit.h. + After error-checking, the real work is done by the gcc::jit::recording::context::enable_dump method in jit-recording.c. */ |