diff options
author | David Malcolm <dmalcolm@redhat.com> | 2015-01-20 01:32:48 +0000 |
---|---|---|
committer | David Malcolm <dmalcolm@gcc.gnu.org> | 2015-01-20 01:32:48 +0000 |
commit | fdce7209c23212b50f08604f242e9bbb5281818b (patch) | |
tree | 474c9e2fbfe804a349ce0083fd02f728b0475514 /gcc/jit/notes.txt | |
parent | cb22ab4164a2140fa7ec38cd929d464224d9c222 (diff) | |
download | gcc-fdce7209c23212b50f08604f242e9bbb5281818b.zip gcc-fdce7209c23212b50f08604f242e9bbb5281818b.tar.gz gcc-fdce7209c23212b50f08604f242e9bbb5281818b.tar.bz2 |
New jit API entrypoint: gcc_jit_context_compile_to_file
gcc/jit/ChangeLog:
* docs/cp/topics/results.rst: Rename to...
* docs/cp/topics/compilation.rst: ...this, and add section on
ahead-of-time compilation.
* docs/cp/topics/index.rst: Update for renaming of results.rst
to compilation.rst.
* docs/examples/emit-alphabet.bf: New file, a sample "brainf"
script.
* docs/examples/tut05-bf.c: New file, implementing a compiler
for "brainf".
* docs/internals/test-hello-world.exe.log.txt: Update to reflect
changes to logger output.
* docs/intro/index.rst: Add tutorial05.rst
* docs/intro/tutorial05.rst: New file.
* docs/topics/results.rst: Rename to...
* docs/topics/compilation.rst: ...this, and add section on
ahead-of-time compilation.
* docs/topics/index.rst: Update for renaming of results.rst to
compilation.rst.
* jit-playback.c (gcc::jit::playback::context::compile): Convert
return type from result * to void. Move the code to convert to
dso and dlopen the result to a new pure virtual "postprocess"
method.
(gcc::jit::playback::compile_to_memory::compile_to_memory): New
function.
(gcc::jit::playback::compile_to_memory::postprocess): New
function, based on playback::context::compile.
(gcc::jit::playback::compile_to_file::compile_to_file): New
function.
(gcc::jit::playback::compile_to_file::postprocess): New function.
(gcc::jit::playback::compile_to_file::copy_file): New function.
(gcc::jit::playback::context::convert_to_dso): Move internals
to...
(gcc::jit::playback::context::invoke_driver): New method. Add
"-shared" and "-c" options to driver's argv as needed.
* jit-playback.h: Include "timevar.h".
(gcc::jit::playback::context::compile): Convert return type from
result * to void.
(gcc::jit::playback::context::postprocess): New pure virtual
function, making this an abstract base class.
(gcc::jit::playback::context::get_tempdir): New accessor.
(gcc::jit::playback::context::invoke_driver): New function.
(class gcc::jit::playback::compile_to_memory): New subclass of
playback::context.
(class gcc::jit::playback::compile_to_file): Likewise.
* jit-recording.c (gcc::jit::recording::context::compile): Use a
playback::compile_to_memory, and extract its result.
(gcc::jit::recording::context::compile_to_file): New function.
* jit-recording.h (gcc::jit::recording::context::compile_to_file):
New function.
* libgccjit++.h (gccjit::context::compile_to_file): New method.
* libgccjit.c (gcc_jit_context_compile): Update log message to
clarify that this is an in-memory compile.
(gcc_jit_context_compile_to_file): New function.
* libgccjit.h (gcc_jit_context): Clarify that you can compile
a context more than once, and that you can compile to a file
as well as to memory.
(gcc_jit_result): Clarify that this is the result of an
in-memory compilation.
(gcc_jit_context_compile): Clarify that you can compile, and that
this is an in-memory compilation.
(enum gcc_jit_output_kind): New enum.
(gcc_jit_context_compile_to_file): New function.
(gcc_jit_context_enable_dump): Clarify comment to cover both forms
of compilation.
* libgccjit.map (gcc_jit_context_compile_to_file): New API
entrypoint.
* notes.txt: Update to show the playback::context::postprocess
virtual function.
gcc/testsuite/ChangeLog:
* jit.dg/harness.h: Include <unistd.h>.
(CHECK_NO_ERRORS): New.
(verify_code): Wrap prototype in #ifndef TEST_COMPILING_TO_FILE.
(test_jit): Support new macro TEST_COMPILING_TO_FILE for exercising
gcc_jit_context_compile_to_file.
* jit.dg/jit.exp (fixed_host_execute): Fix the code for passing on
args to the spawned executable.
(jit-expand-vars): New function.
(jit-exe-params): New variable.
(dg-jit-set-exe-params): New function.
(jit-dg-test): Detect testcases that use
jit-verify-compile-to-file and call jit-setup-compile-to-file.
Set arguments of spawned process to jit-exe-params.
(jit-get-output-filename): New function.
(jit-setup-compile-to-file): New function.
(jit-verify-compile-to-file): New function.
(jit-run-executable): New function.
(jit-verify-executable): New function.
* jit.dg/test-compile-to-assembler.c: New testcase.
* jit.dg/test-compile-to-dynamic-library.c: New testcase.
* jit.dg/test-compile-to-executable.c: New testcase.
* jit.dg/test-compile-to-object.c: New testcase.
From-SVN: r219876
Diffstat (limited to 'gcc/jit/notes.txt')
-rw-r--r-- | gcc/jit/notes.txt | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/jit/notes.txt b/gcc/jit/notes.txt index 7df4a7b..e92c665 100644 --- a/gcc/jit/notes.txt +++ b/gcc/jit/notes.txt @@ -74,9 +74,16 @@ Client Code . Generated . libgccjit.so . . . . │ (purge internal state) . . <──────────────────────── end of toplev::finalize . . │ . . - . . │ Convert assembler to DSO ("fake.so") - . . │ . . - . . │ Load DSO (dlopen "fake.so") + . . V─> playback::context::postprocess: + . . │ . . + . . │ (assuming an in-memory compile): + . . │ . . + . . │ . Convert assembler to DSO ("fake.so") + . . │ . . + . . │ . Load DSO (dlopen "fake.so") + . . │ . . + . . │ . Bundle it up in a jit::result + . . <── . . . . │ . . . . │ RELEASE MUTEX . . . │ . . |