Remove extra newline
[official-gcc.git] / gcc / jit / ChangeLog
blobd69a6a84c2c3928799b748bf407c42c606963f70
1 2020-03-31  Andrea Corallo  <andrea.corallo@arm.com>
2             David Malcolm  <dmalcolm@redhat.com>
4         * docs/topics/compatibility.rst (LIBGCCJIT_ABI_13): New ABI tag
5         plus add version paragraph.
6         * libgccjit++.h (namespace gccjit::version): Add new namespace.
7         * libgccjit.c (gcc_jit_version_major, gcc_jit_version_minor)
8         (gcc_jit_version_patchlevel): New functions.
9         * libgccjit.h (LIBGCCJIT_HAVE_gcc_jit_version): New macro.
10         (gcc_jit_version_major, gcc_jit_version_minor)
11         (gcc_jit_version_patchlevel): New functions.
12         * libgccjit.map (LIBGCCJIT_ABI_13) New ABI tag.
14 2020-03-23  Andrea Corallo  <andrea.corallo@arm.com>
16         * jit-playback.h
17         (gcc::jit::playback::context m_recording_ctxt): Remove
18         m_char_array_type_node field.
19         * jit-playback.c
20         (playback::context::context) Remove m_char_array_type_node from member
21         initializer list.
22         (playback::context::new_string_literal) Fix logic to handle string
23         length > 200.
25 2020-01-01  Jakub Jelinek  <jakub@redhat.com>
27         Update copyright years.
29 2019-11-29  Julian Brown  <julian@codesourcery.com>
31         * jit-builtins.c (BT_DFLOAT32_PTR, BT_DFLOAT64_PTR, BT_DFLOAT128_PTR):
32         Remove commented-out cases.
34 2019-11-20  David Malcolm  <dmalcolm@redhat.com>
36         PR jit/92483
37         * jit-playback.c (gcc::jit::playback::context::make_fake_args):
38         Update GCC_JIT_BOOL_OPTION_SELFCHECK_GC for new --param syntax.
40 2019-08-13  Richard Sandiford  <richard.sandiford@arm.com>
42         PR middle-end/91421
43         * jit-playback.c (new_function): Use set_decl_built_in_function.
45 2019-07-22  Andrea Corallo  <andrea.corallo@arm.com>
47         * jit-recording.c (unary_op_reproducer_strings): Make it extern.
48         (binary_op_reproducer_strings): Likewise.
49         * jit-recording.h (unary_op_reproducer_strings): Likewise.
50         (binary_op_reproducer_strings): Likewise.
51         * libgccjit.c (gcc_jit_context_new_unary_op): Check result_type to be a
52         numeric type.
53         * libgccjit.c (gcc_jit_context_new_binary_op): Improve error message.
55 2019-07-04  Andrea Corallo  <andrea.corallo@arm.com>
57         * libgccjit.c (gcc_jit_context_new_binary_op): Check result_type to be a
58         numeric type.
60 2019-07-04  Andrea Corallo  <andrea.corallo@arm.com>
62         * docs/topics/compatibility.rst (LIBGCCJIT_ABI_12): New ABI tag.
63         * docs/topics/types.rst: Add gcc_jit_context_new_bitfield.
64         * jit-common.h (namespace recording): Add class bitfield.
65         * jit-playback.c:
66         (DECL_C_BIT_FIELD, SET_DECL_C_BIT_FIELD): Add macros.
67         (playback::context::new_bitfield): New method.
68         (playback::compound_type::set_fields): Add bitfield support.
69         (playback::lvalue::mark_addressable): Was jit_mark_addressable make this
70         a method of lvalue plus return a bool to communicate success.
71         (playback::lvalue::get_address): Check for jit_mark_addressable return
72         value.
73         * jit-playback.h (new_bitfield): New method.
74         (class bitfield): New class.
75         (class lvalue): Add jit_mark_addressable method.
76         * jit-recording.c (recording::context::new_bitfield): New method.
77         (recording::bitfield::replay_into): New method.
78         (recording::bitfield::write_to_dump): Likewise.
79         (recording::bitfield::make_debug_string): Likewise.
80         (recording::bitfield::write_reproducer): Likewise.
81         * jit-recording.h (class context): Add new_bitfield method.
82         (class field): Make it derivable by class bitfield.
83         (class bitfield): Add new class.
84         * libgccjit++.h (class context): Add new_bitfield method.
85         * libgccjit.c (struct gcc_jit_bitfield): New structure.
86         (gcc_jit_context_new_bitfield): New function.
87         * libgccjit.h
88         (LIBGCCJIT_HAVE_gcc_jit_context_new_bitfield) New macro.
89         (gcc_jit_context_new_bitfield): New function.
90         * libgccjit.map (LIBGCCJIT_ABI_12) New ABI tag.
92 2019-03-21  Jakub Jelinek  <jakub@redhat.com>
94         * jit-recording.c (reproducer::m_set_identifiers): Use false as Lazy
95         in hash_set template param.
97 2019-02-05  Andrea Corallo  <andrea.corallo@arm.com>
99         * docs/topics/compatibility.rst (LIBGCCJIT_ABI_11): New ABI tag.
100         * docs/topics/contexts.rst (Additional driver options): New
101         section.
102         * jit-playback.c (invoke_driver): Add call to append_driver_options.
103         * jit-recording.c: Within namespace gcc::jit...
104         (recording::context::~context): Free the optnames within
105         m_driver_options.
106         (recording::context::add_driver_option): New method.
107         (recording::context::append_driver_options): New method.
108         (recording::context::dump_reproducer_to_file): Add driver
109         options.
110         * jit-recording.h: Within namespace gcc::jit...
111         (recording::context::add_driver_option): New method.
112         (recording::context::append_driver_options): New method.
113         (recording::context::m_driver_options): New field.
114         * libgccjit++.h (gccjit::context::add_driver_option): New
115         method.
116         * libgccjit.c (gcc_jit_context_add_driver_option): New API
117         entrypoint.
118         * libgccjit.h (gcc_jit_context_add_driver_option): New API
119         entrypoint.
120         (LIBGCCJIT_HAVE_gcc_jit_context_add_driver_option): New
121         macro.
122         * libgccjit.map (LIBGCCJIT_ABI_11): New ABI tag.
124 2019-01-01  Jakub Jelinek  <jakub@redhat.com>
126         Update copyright years.
128 2018-11-15  David Malcolm  <dmalcolm@redhat.com>
130         PR other/19165
131         * dummy-frontend.c (jit_begin_diagnostic): Add diagnostic_t param.
133 2018-11-13  David Malcolm  <dmalcolm@redhat.com>
135         * jit-playback.c: Replace "source_location" with "location_t".
137 2018-10-17  David Malcolm  <dmalcolm@redhat.com>
139         * Make-lang.in (selftest-jit): New.
141 2018-06-28  Martin Liska  <mliska@suse.cz>
143         * jit-playback.c: Include opt-suggestions.h.
145 2018-06-28  Martin Liska  <mliska@suse.cz>
147         * jit-playback.c (class auto_argvec): Moved to vec.h.
148         (auto_argvec::~auto_argvec): Likewise.
149         (compile): Use the renamed name.
150         (invoke_driver): Likewise.
152 2018-03-21  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
154         PR jit/84288
155         * Make-lang.in ($(LIBGCCJIT_FILENAME)): Add $(EXTRA_GCC_LIBS).
157 2018-03-09  David Malcolm  <dmalcolm@redhat.com>
158             Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
160         PR jit/64089
161         PR jit/84288
162         * Make-lang.in (COMMA): New.
163         (LIBGCCJIT_VERSION_SCRIPT_OPTION): New.
164         (LIBGCCJIT_SONAME_OPTION): New.
165         (jit): Move --version-script and -soname linker options to the
166         above.
168 2018-01-25  David Malcolm  <dmalcolm@redhat.com>
170         PR jit/81672
171         * jit-recording.h (gcc::jit::recording::union_): Remove fields
172         "m_loc" and "m_name".
174 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
176         Update copyright years.
178 2017-12-19  Jakub Jelinek  <jakub@redhat.com>
180         * jit-playback.c (get_type, playback::compile_to_file::copy_file,
181         playback::context::acquire_mutex): Replace Yoda conditions with
182         typical order conditions.
183         * libgccjit.c (gcc_jit_context_new_struct_type,
184         gcc_jit_struct_set_fields, gcc_jit_context_new_union_type,
185         gcc_jit_context_new_function, gcc_jit_timer_pop): Likewise.
186         * jit-builtins.c (matches_builtin): Likewise.
187         * jit-recording.c (recording::compound_type::set_fields,
188         recording::fields::write_reproducer, recording::rvalue::set_scope,
189         recording::function::validate): Likewise.
190         * jit-logging.c (logger::decref): Likewise.
192 2017-11-30  Jakub Jelinek  <jakub@redhat.com>
194         * jit-recording.c
195         (recording::memento_of_new_rvalue_from_const <long>::write_reproducer):
196         Use ; instead of ;;.
198 2017-11-28  Jakub Jelinek  <jakub@redhat.com>
200         * jit-playback.c (add_switch): Build SWITCH_EXPR using build2 instead
201         of build3.  Formatting fixes.  Adjust funciton comment.
203 2017-11-23  Tom de Vries  <tom@codesourcery.com>
205         * libgccjit.c (RETURN_NULL_IF_FAIL_NONNULL_NUMERIC_TYPE): Wrap in
206         JIT_{BEGIN,END}_STMT.
208 2017-10-31  David Malcolm  <dmalcolm@redhat.com>
210         * docs/internals/index.rst (Running the test suite): Document
211         PRESERVE_EXECUTABLES.
212         (Running under valgrind): Add markup to RUN_UNDER_VALGRIND.
213         * docs/_build/texinfo/libgccjit.texi: Regenerate.
215 2017-10-04  David Malcolm  <dmalcolm@redhat.com>
217         * docs/cp/topics/expressions.rst (Vector expressions): New
218         section.
219         * docs/topics/compatibility.rst (LIBGCCJIT_ABI_10): New ABI tag.
220         * docs/topics/expressions.rst (Vector expressions): New section.
221         * docs/topics/types.rst (gcc_jit_type_get_vector): Add link to
222         gcc_jit_context_new_rvalue_from_vector.
223         * docs/_build/texinfo/libgccjit.texi: Regenerate.
224         * jit-common.h (gcc::jit:recording::vector_type): New forward
225         decl.
226         * jit-playback.c
227         (gcc::jit::playback::context::new_rvalue_from_vector): New method.
228         * jit-playback.h
229         (gcc::jit::playback::context::new_rvalue_from_vector): New method.
230         * jit-recording.c: In namespace gcc::jit::
231         (class comma_separated_string): New class.
232         (comma_separated_string::comma_separated_string): New ctor,
233         adapted from recording::call::make_debug_string.
234         (comma_separated_string::~comma_separated_string): New dtor.
235         In namespace gcc::jit::recording::
236         (context::new_rvalue_from_vector): New method.
237         (type::get_vector): Update for renaming of memento_of_get_vector.
238         (class memento_of_get_vector): Rename to...
239         (class vector_type): ..this.
240         (memento_of_new_rvalue_from_vector::memento_of_new_rvalue_from_vector):
241         New ctor.
242         (memento_of_new_rvalue_from_vector::replay_into): New method.
243         (memento_of_new_rvalue_from_vector::visit_children): New method.
244         (memento_of_new_rvalue_from_vector::make_debug_string): New
245         method.
246         (memento_of_new_rvalue_from_vector::write_reproducer): New method.
247         (call::make_debug_string): Split out arg-printing code into ctor
248         for comma_separated_string.
249         * jit-recording.h: In namespace gcc::jit::recording::
250         (context::new_rvalue_from_vector): New method.
251         (type::dyn_cast_vector_type): New virtual function.
252         (class memento_of_get_vector): Rename to...
253         (class vector_type): ...this.
254         (vector_type::unqualified): Remove this vfunc override in favor
255         of...
256         (vector_type::get_element_type): ...this new method.
257         (vector_type::get_num_units): New method.
258         (vector_type::dyn_cast_vector_type): New vfunc override.
259         (class memento_of_new_rvalue_from_vector): New class.
260         * libgccjit++.h (gccjit::context::new_rvalue): Add overload for
261         vector of rvalue.
262         * libgccjit.c (gcc_jit_context_new_binary_op): Strip off type
263         qualifications when checking that both operands have same type.
264         (gcc_jit_context_new_rvalue_from_vector): New API entrypoint.
265         * libgccjit.h
266         (LIBGCCJIT_HAVE_gcc_jit_context_new_rvalue_from_vector): New
267         macro.
268         (gcc_jit_context_new_rvalue_from_vector): New API entrypoint.
269         * libgccjit.map (LIBGCCJIT_ABI_10): New ABI tag.
271 2017-09-28  David Malcolm  <dmalcolm@redhat.com>
273         * docs/topics/expressions.rst (Function calls): Add link to
274         gcc_jit_context_new_function_ptr_type.
275         (Function pointers): Convert to cross-references to
276         function-pointers.rst, moving material there.
277         * docs/topics/function-pointers.rst: New page.
278         * docs/topics/index.rst: Add function-pointers.rst.
279         * docs/topics/types.rst (Function pointer types): New section.
280         * docs/_build/texinfo/libgccjit.texi: Regenerate.
282 2017-09-28  David Malcolm  <dmalcolm@redhat.com>
284         * jit-recording.c
285         (gcc::jit::recording::function_type::is_same_type_as): New function.
286         * jit-recording.h: In namespace gcc::jit::recording::
287         (type::accepts_writes_from): Use is_same_type_as rather than pointer
288         equality.
289         (type::is_same_type_as): New virtual function.
290         (function_type::is_same_type_as): New override.
292 2017-09-27  David Malcolm  <dmalcolm@redhat.com>
294         * docs/cp/topics/expressions.rst (Function pointers): New section.
295         * docs/topics/compatibility.rst (LIBGCCJIT_ABI_9): New tag.
296         * docs/topics/expressions.rst (Function pointers): New section.
297         * docs/_build/texinfo/libgccjit.texi: Regenerate.
298         * jit-common.h (class gcc::jit::recording::function_pointer): New
299         forward decl.
300         * jit-playback.c (gcc::jit::playback::function::get_address): New
301         method.
302         * jit-playback.h (gcc::jit::playback::function::get_address): New
303         method decl.
304         * jit-recording.c: Within namespace gcc::jit::recording...
305         (function::function): Initialize new field "m_fn_ptr_type".
306         (function::get_address): New method.
307         (function_pointer::replay_into): New method.
308         (function_pointer::visit_children): New method.
309         (function_pointer::make_debug_string): New method.
310         (function_pointer::write_reproducer): New method.
311         * jit-recording.h: Within namespace gcc::jit::recording...
312         (function::get_address): New method.
313         (function): Add field "m_fn_ptr_type".
314         (class function_pointer): New subclass of rvalue.
315         * libgccjit++.h (gccjit::function::get_address): New method.
316         * libgccjit.c (gcc_jit_function_get_address): New function.
317         * libgccjit.h (LIBGCCJIT_HAVE_gcc_jit_function_get_address): New
318         macro.
319         (gcc_jit_function_get_address): New API entrypoint.
320         * libgccjit.map (LIBGCCJIT_ABI_9): New tag.
322 2017-09-14  David Malcolm  <dmalcolm@redhat.com>
324         PR jit/82174
325         * jit-builtins.c (matches_builtin): Ignore entries with a NULL
326         name.
328 2017-08-18  David Malcolm  <dmalcolm@redhat.com>
330         PR tree-optimization/46805
331         * dummy-frontend.c (jit_langhook_parse_file): Handle vector types.
333 2017-08-18  David Malcolm  <dmalcolm@redhat.com>
335         * jit-recording.c (class gcc::jit::reproducer): Rename field
336         "m_identifiers" to "m_map_memento_to_identifier".  Add field
337         "m_set_identifiers" and struct hash_traits for it.
338         (gcc::jit::reproducer::reproducer): Update for above.
339         (convert_to_identifier): New function.
340         (gcc::jit::reproducer::ensure_identifier_is_unique): New method.
341         (gcc::jit::reproducer::make_identifier): Avoid appending the %p
342         unless necessary for uniqueness.  Update for field renaming.
343         (gcc::jit::reproducer::get_identifier): Update for field renaming.
345 2017-08-09  David Malcolm  <dmalcolm@redhat.com>
347         * docs/cp/topics/types.rst (Vector types): New section.
348         * docs/topics/compatibility.rst (LIBGCCJIT_ABI_8): New tag.
349         * docs/topics/types.rst (gcc_jit_context_get_type): Fix typo in
350         example.
351         (Vector types): New section.
352         * docs/_build/texinfo/libgccjit.texi: Regenerate.
353         * jit-playback.c (gcc::jit::playback::type::get_vector): New
354         method.
355         * jit-playback.h (gcc::jit::playback::type::get_vector): New
356         method.
357         * jit-recording.c: In namespace gcc::jit::recording::
358         (type::get_vector): New method.
359         (memento_of_get_aligned::write_reproducer): Fix typo
360         in leading comment.
361         (memento_of_get_vector::replay_into): New method.
362         (memento_of_get_vector::make_debug_string): New method.
363         (memento_of_get_vector::write_reproducer): New method.
364         * jit-recording.h: In namespace gcc::jit::recording::
365         (type::get_vector): New
366          method.
367         (class memento_of_get_vector): New class.
368         * libgccjit++.h (gccjit::type::get_vector): New method.
369         * libgccjit.c (gcc_jit_type_get_vector): New public entrypoint.
370         * libgccjit.h (LIBGCCJIT_HAVE_gcc_jit_type_get_vector): New
371         define.
372         (gcc_jit_type_get_vector): New decl.
373         * libgccjit.map (LIBGCCJIT_ABI_8): New ABI tag.
375 2017-07-05  Richard Sandiford  <richard.sandiford@linaro.org>
376             Alan Hayward  <alan.hayward@arm.com>
377             David Sherwood  <david.sherwood@arm.com>
379         * dummy-frontend.c (jit_langhook_type_for_mode): Remove "enum" before
380         "machine_mode".
382 2017-04-24  David Malcolm  <dmalcolm@redhat.com>
384         * docs/cp/topics/types.rst (gccjit::type::get_const): Remove
385         comment.
386         (gccjit::type::get_aligned): Add.
387         * docs/topics/compatibility.rst: Add LIBGCCJIT_ABI_7.
388         * docs/topics/types.rst: Add gcc_jit_type_get_aligned.
389         * docs/_build/texinfo/libgccjit.texi: Regenerate.
390         * jit-playback.c (gcc::jit::playback::type::get_aligned): New
391         method.
392         * jit-playback.h (gcc::jit::playback::type::get_aligned): New
393         method.
394         * jit-recording.c: Within namespace gcc::jit::recording...
395         (type::get_aligned): New method.
396         (memento_of_get_aligned::replay_into): New method.
397         (memento_of_get_aligned::make_debug_string): New method.
398         (memento_of_get_aligned::write_reproducer): New method.
399         * jit-recording.h: Within namespace gcc::jit::recording...
400         (type::get_aligned): New method.
401         (type::accepts_writes_from): Strip off qualifications from
402         this when comparing pointer equality.
403         (decorated_type): New subclass of type, subsuming the
404         commonality between memento_of_get_const and
405         memento_of_get_volatile.
406         (memento_of_get_const): Make a subclass of decorated_type,
407         rather than type.
408         (memento_of_get_volatile): Likewise.
409         (memento_of_get_aligned): Likewise.
410         * libgccjit++.h: Within namespace gccjit...
411         (type::get_const): New method.
412         (type::get_aligned): New method.
413         * libgccjit.c (gcc_jit_type_get_aligned): New function.
414         * libgccjit.h (gcc_jit_type_get_aligned): New decl.
415         * libgccjit.map (LIBGCCJIT_ABI_7): New
416         (gcc_jit_type_get_aligned): Add.
418 2017-01-19  David Malcolm  <dmalcolm@redhat.com>
420         * dummy-frontend.c (jit_langhook_type_for_size): Delete.
421         (LANG_HOOKS_TYPE_FOR_SIZE): Don't redefine.
423 2017-01-18  David Malcolm  <dmalcolm@redhat.com>
425         * dummy-frontend.c (jit_langhook_type_for_size): Implement, using
426         lto's lto_type_for_size.
428 2017-01-01  Jakub Jelinek  <jakub@redhat.com>
430         Update copyright years.
432 2016-05-20  David Malcolm  <dmalcolm@redhat.com>
434         * docs/topics/compatibility.rst: Add LIBGCCJIT_ABI_6.
435         * docs/topics/expressions.rst (Function calls): Add documentation
436         of gcc_jit_rvalue_set_bool_require_tail_call.
437         * docs/_build/texinfo/libgccjit.texi: Regenerate.
438         * jit-common.h (gcc::jit::recording::base_call): Add forward decl.
439         * jit-playback.c: Within namespace gcc::jit::playback...
440         (context::build_call) Add "require_tail_call" param and use it
441         to set CALL_EXPR_MUST_TAIL_CALL.
442         (context::new_call): Add "require_tail_call" param.
443         (context::new_call_through_ptr): Likewise.
444         * jit-playback.h: Within namespace gcc::jit::playback...
445         (context::new_call: Add "require_tail_call" param.
446         (context::new_call_through_ptr): Likewise.
447         (context::build_call): Likewise.
448         * jit-recording.c: Within namespace gcc::jit::recording...
449         (base_call::base_call): New constructor.
450         (base_call::write_reproducer_tail_call): New method.
451         (call::call): Update for inheritance from base_call.
452         (call::replay_into): Provide m_require_tail_call to call
453         to new_call.
454         (call::write_reproducer): Call write_reproducer_tail_call.
455         (call_through_ptr::call_through_ptr): Update for inheritance from
456         base_call.
457         (call_through_ptr::replay_into): Provide m_require_tail_call to call
458         to new_call_through_ptr.
459         (recording::call_through_ptr::write_reproducer): Call
460         write_reproducer_tail_call.
461         * jit-recording.h: Within namespace gcc::jit::recording...
462         (rvalue::dyn_cast_base_call): New virtual function.
463         (class base_call): New subclass of class rvalue.
464         (class call): Inherit from base_call rather than directly from
465         rvalue, moving get_precedence and m_args to base_call.
466         (class call_through_ptr): Likewise.
467         * libgccjit.c (gcc_jit_rvalue_set_bool_require_tail_call): New
468         function.
469         * libgccjit.h
470         (LIBGCCJIT_HAVE_gcc_jit_rvalue_set_bool_require_tail_call): New
471         macro.
472         (gcc_jit_rvalue_set_bool_require_tail_call): New function.
473         * libgccjit.map (LIBGCCJIT_ABI_6): New.
474         (gcc_jit_rvalue_set_bool_require_tail_call): Add.
476 2016-05-17  David Malcolm  <dmalcolm@redhat.com>
478         * dummy-frontend.c: Include diagnostic.h.
479         (jit_begin_diagnostic): New function.
480         (jit_end_diagnostic): New function.
481         (jit_langhook_init): Register jit_begin_diagnostic
482         and jit_end_diagnostic with the global_dc.
483         * jit-playback.c: Include diagnostic.h.
484         (gcc::jit::playback::context::add_diagnostic): New method.
485         * jit-playback.h (struct diagnostic_context): Add forward
486         declaration.
487         (gcc::jit::playback::context::add_diagnostic): New method.
489 2016-05-17  David Malcolm  <dmalcolm@redhat.com>
491         * docs/topics/expressions.rst (Function calls): Document
492         gcc_jit_context_new_call_through_ptr.
493         * docs/_build/texinfo/libgccjit.texi: Regenerate.
495 2016-05-13  David Malcolm  <dmalcolm@redhat.com>
497         * jit-playback.h: Within namespace gcc:jit::playback...
498         (compile_to_memory::postprocess): Mark with FINAL OVERRIDE.
499         (compile_to_file::postprocess): Likewise.
500         (function::finalizer): Likewise.
501         (block::finalizer): Likewise.
502         (source_file::finalizer): Likewise.
503         (source_line::finalizer): Likewise.
504         * jit-recording.c (gcc::jit::rvalue_usage_validator):: Likewise.
505         * jit-recording.h: Within namespace gcc::jit::recording...
506         (string::replay_into): Mark with FINAL OVERRIDE.
507         (string::make_debug_string): Likewise.
508         (string::write_reproducer): Likewise.
509         (location::replay_into): Likewise.
510         (location::dyn_cast_location): Likewise.
511         (location::make_debug_string): Likewise.
512         (location::write_reproducer): Likewise.
513         (memento_of_get_type::dereference): Likewise.
514         (memento_of_get_type::accepts_writes_from): Likewise.
515         (memento_of_get_type::is_int): Likewise.
516         (memento_of_get_type::is_float): Likewise.
517         (memento_of_get_type::is_bool): Likewise.
518         (memento_of_get_type::is_pointer): Likewise.
519         (memento_of_get_type::is_array): Likewise.
520         (memento_of_get_type::is_void): Likewise.
521         (memento_of_get_type::replay_into): Likewise.
522         (memento_of_get_type::make_debug_string): Likewise.
523         (memento_of_get_type::write_reproducer): Likewise.
524         (memento_of_get_pointer::dereference): Likewise.
525         (memento_of_get_pointer::accepts_writes_from): Likewise.
526         (memento_of_get_pointer::replay_into): Likewise.
527         (memento_of_get_pointer::is_int): Likewise.
528         (memento_of_get_pointer::is_float): Likewise.
529         (memento_of_get_pointer::is_bool): Likewise.
530         (memento_of_get_pointer::is_pointer): Likewise.
531         (memento_of_get_pointer::is_array): Likewise.
532         (memento_of_get_pointer::make_debug_string): Likewise.
533         (memento_of_get_pointer::write_reproducer): Likewise.
534         (memento_of_get_const::dereference): Likewise.
535         (memento_of_get_const::accepts_writes_from): Likewise.
536         (memento_of_get_const::unqualified): Likewise.
537         (memento_of_get_const::is_int): Likewise.
538         (memento_of_get_const::is_float): Likewise.
539         (memento_of_get_const::is_bool): Likewise.
540         (memento_of_get_const::is_pointer): Likewise.
541         (memento_of_get_const::is_array): Likewise.
542         (memento_of_get_const::void replay_into): Likewise;
543         (memento_of_get_const::make_debug_string): Likewise.
544         (memento_of_get_const::write_reproducer): Likewise.
545         (memento_of_get_volatile::dereference): Likewise.
546         (memento_of_get_volatile::unqualified): Likewise.
547         (memento_of_get_volatile::is_int): Likewise.
548         (memento_of_get_volatile::is_float): Likewise.
549         (memento_of_get_volatile::is_bool): Likewise.
550         (memento_of_get_volatile::is_pointer): Likewise.
551         (memento_of_get_volatile::is_array): Likewise.
552         (memento_of_get_volatile::replay_into): Likewise;
553         (memento_of_get_volatile::make_debug_string): Likewise.
554         (memento_of_get_volatile::write_reproducer): Likewise.
555         (array_type::dereference): Likewise.
556         (array_type::is_int): Likewise.
557         (array_type::is_float): Likewise.
558         (array_type::is_bool): Likewise.
559         (array_type::is_pointer): Likewise.
560         (array_type::is_array): Likewise.
561         (array_type::replay_into): Likewise;
562         (array_type::make_debug_string): Likewise.
563         (array_type::write_reproducer): Likewise.
564         (function_type::dereference): Likewise.
565         (function_type::function_dyn_cast_function_type): Likewise.
566         (function_type::function_as_a_function_type): Likewise.
567         (function_type::is_int): Likewise.
568         (function_type::is_float): Likewise.
569         (function_type::is_bool): Likewise.
570         (function_type::is_pointer): Likewise.
571         (function_type::is_array): Likewise.
572         (function_type::replay_into): Likewise;
573         (function_type::make_debug_string): Likewise.
574         (function_type::write_reproducer): Likewise.
575         (field::replay_into): Likewise;
576         (field::write_to_dump): Likewise.
577         (field::make_debug_string): Likewise.
578         (field::write_reproducer): Likewise.
579         (compound_type::dereference): Likewise.
580         (compound_type::is_int): Likewise.
581         (compound_type::is_float): Likewise.
582         (compound_type::is_bool): Likewise.
583         (compound_type::is_pointer): Likewise.
584         (compound_type::is_array): Likewise.
585         (compound_type::has_known_size): Likewise.
586         (struct_::dyn_cast_struct): Likewise.
587         (struct_::replay_into): Likewise.
588         (struct_::access_as_type): Likewise.
589         (struct_::make_debug_string): Likewise.
590         (struct_::write_reproducer): Likewise.
591         (fields::replay_into): Likewise.
592         (fields::write_to_dump): Likewise.
593         (fields::make_debug_string): Likewise.
594         (fields::write_reproducer): Likewise.
595         (union_::replay_into): Likewise.
596         (union_::make_debug_string): Likewise.
597         (union_::write_reproducer): Likewise.
598         (lvalue::access_as_rvalue): Mark with OVERRIDE.
599         (param::replay_into): Mark with FINAL OVERRIDE.
600         (param::visit_children): Likewise.
601         (param::dyn_cast_param): Likewise.
602         (param::access_as_rvalue): Likewise.
603         (param::access_as_lvalue): Likewise.
604         (param::make_debug_string): Likewise.
605         (param::write_reproducer): Likewise.
606         (param::get_precedence): Likewise.
607         (function::replay_into): Likewise.
608         (function::write_to_dump): Likewise.
609         (function::make_debug_string): Likewise.
610         (function::write_reproducer): Likewise.
611         (block::write_to_dump): Likewise.
612         (block::make_debug_string): Likewise.
613         (block::write_reproducer): Likewise.
614         (block::replay_into): Likewise.
615         (global::replay_into): Likewise;
616         (global::visit_children): Likewise.
617         (global::write_to_dump): Likewise.
618         (global::make_debug_string): Likewise.
619         (global::write_reproducer): Likewise.
620         (global::get_precedence): Likewise.
621         (memento_of_new_rvalue_from_const::replay_into): Likewise.
622         (memento_of_new_rvalue_from_const::visit_children): Likewise.
623         (memento_of_new_rvalue_from_const::is_constant): Likewise.
624         (memento_of_new_rvalue_from_const::get_wide_int): Likewise.
625         (memento_of_new_rvalue_from_const::make_debug_string): Likewise.
626         (memento_of_new_rvalue_from_const::write_reproducer): Likewise.
627         (memento_of_new_rvalue_from_const::get_precedence): Likewise.
628         (memento_of_new_string_literal::replay_into): Likewise.
629         (memento_of_new_string_literal::visit_children): Likewise.
630         (memento_of_new_string_literal::make_debug_string): Likewise.
631         (memento_of_new_string_literal::write_reproducer): Likewise.
632         (memento_of_new_string_literal::get_precedence): Likewise.
633         (unary_op::replay_into): Likewise.
634         (unary_op::visit_children): Likewise.
635         (unary_op::make_debug_string): Likewise.
636         (unary_op::write_reproducer): Likewise.
637         (unary_op::get_precedence): Likewise.
638         (binary_op::replay_into): Likewise.
639         (binary_op::visit_children): Likewise.
640         (binary_op::make_debug_string): Likewise.
641         (binary_op::write_reproducer): Likewise.
642         (binary_op::get_precedence): Likewise.
643         (comparison::replay_into): Likewise.
644         (comparison::visit_children): Likewise.
645         (comparison::make_debug_string): Likewise.
646         (comparison::write_reproducer): Likewise.
647         (comparison::get_precedence): Likewise.
648         (cast::replay_into): Likewise.
649         (cast::visit_children): Likewise.
650         (cast::make_debug_string): Likewise.
651         (cast::write_reproducer): Likewise.
652         (cast::get_precedence): Likewise.
653         (call::replay_into): Likewise.
654         (call::visit_children): Likewise.
655         (call::make_debug_string): Likewise.
656         (call::write_reproducer): Likewise.
657         (call::get_precedence): Likewise.
658         (call_through_ptr::replay_into): Likewise.
659         (call_through_ptr::visit_children): Likewise.
660         (call_through_ptr::make_debug_string): Likewise.
661         (call_through_ptr::write_reproducer): Likewise.
662         (call_through_ptr::get_precedence): Likewise.
663         (array_access::replay_into): Likewise.
664         (array_access::visit_children): Likewise.
665         (array_access::make_debug_string): Likewise.
666         (array_access::write_reproducer): Likewise.
667         (array_access::get_precedence): Likewise.
668         (access_field_of_lvalue::replay_into): Likewise.
669         (access_field_of_lvalue::visit_children): Likewise.
670         (access_field_of_lvalue::make_debug_string): Likewise.
671         (access_field_of_lvalue::write_reproducer): Likewise.
672         (access_field_of_lvalue::get_precedence): Likewise.
673         (access_field_rvalue::replay_into): Likewise.
674         (access_field_rvalue::visit_children): Likewise.
675         (access_field_rvalue::make_debug_string): Likewise.
676         (access_field_rvalue::write_reproducer): Likewise.
677         (access_field_rvalue::get_precedence): Likewise.
678         (dereference_field_rvalue::replay_into): Likewise.
679         (dereference_field_rvalue::visit_children): Likewise.
680         (dereference_field_rvalue::make_debug_string): Likewise.
681         (dereference_field_rvalue::write_reproducer): Likewise.
682         (dereference_field_rvalue::get_precedence): Likewise.
683         (dereference_rvalue::replay_into): Likewise.
684         (dereference_rvalue::visit_children): Likewise.
685         (dereference_rvalue::make_debug_string): Likewise.
686         (dereference_rvalue::write_reproducer): Likewise.
687         (dereference_rvalue::get_precedence): Likewise.
688         (get_address_of_lvalue::replay_into): Likewise.
689         (get_address_of_lvalue::visit_children): Likewise.
690         (get_address_of_lvalue::make_debug_string): Likewise.
691         (get_address_of_lvalue::write_reproducer): Likewise.
692         (get_address_of_lvalue::get_precedence): Likewise.
693         (local::replay_into): Likewise.
694         (local::visit_children): Likewise.
695         (local::write_to_dump): Likewise.
696         (local::make_debug_string): Likewise.
697         (local::write_reproducer): Likewise.
698         (local::get_precedence): Likewise.
699         (statement::write_to_dump): Likewise.
700         (eval::replay_into): Likewise.
701         (eval::make_debug_string): Likewise.
702         (eval::write_reproducer): Likewise.
703         (assignment::replay_into): Likewise.
704         (assignment::make_debug_string): Likewise.
705         (assignment::write_reproducer): Likewise.
706         (assignment_op::replay_into): Likewise.
707         (assignment_op::make_debug_string): Likewise.
708         (assignment_op::write_reproducer): Likewise.
709         (comment::replay_into): Likewise.
710         (comment::make_debug_string): Likewise.
711         (comment::write_reproducer): Likewise.
712         (conditional::replay_into): Likewise.
713         (conditional::get_successor_blocks): Likewise.
714         (conditional::make_debug_string): Likewise.
715         (conditional::write_reproducer): Likewise.
716         (jump::replay_into): Likewise.
717         (jump::get_successor_blocks): Likewise.
718         (jump::make_debug_string): Likewise.
719         (jump::write_reproducer): Likewise.
720         (return_::replay_into): Likewise.
721         (return_::get_successor_blocks): Likewise.
722         (return_::make_debug_string): Likewise.
723         (return_::write_reproducer): Likewise.
724         (case_::replay_into): Likewise.
725         (case_::write_reproducer): Likewise.
726         (case_::make_debug_string): Likewise.
727         (switch_::replay_into): Likewise.
728         (switch_::get_successor_blocks): Likewise.
729         (switch_::make_debug_string): Likewise.
730         (switch_::write_reproducer): Likewise.
732 2016-02-08  David Malcolm  <dmalcolm@redhat.com>
734         * dummy-frontend.c (jit_langhook_init): Remove
735         second argument to build_common_tree_nodes to
736         track r233218.
738 2016-01-23  Iain Buclaw  <ibuclaw@gdcproject.org>
740         * jit-playback.c: Include pthread.h.
742 2016-01-19  David Malcolm  <dmalcolm@redhat.com>
744         PR jit/69144
745         * jit-playback.c (gcc::jit::playback::compile_to_file::postprocess):
746         Potentially add the temporary artifact to the tempdir's list of
747         tempfiles needing additional cleanup.
748         (gcc::jit::playback::context::extract_any_requested_dumps): Likewise
749         for the dumpfile.
750         * jit-tempdir.c (gcc::jit::tempdir::~tempdir): Clean up additional
751         tempfiles.
752         * jit-tempdir.h (gcc::jit::tempdir::add_temp_file): New method.
753         (gcc::jit::tempdir::m_tempfiles): New field.
754         * docs/cp/intro/tutorial04.rst: Update for changes to toyvm.cc.
755         * docs/examples/tut04-toyvm/toyvm.cc (class compilation_result):
756         New.
757         (toyvm_function::compile): Change return type from function ptr
758         to a compilation_result.
759         (toyvm_function::get_function_name): New accessor.
760         (toyvm_function::m_funcname): New field.
761         (get_function_name): Convert to...
762         (toyvm_function::make_function_name): ...this new method.
763         (toyvm_function::parse): Call make_function_name.
764         (toyvm_function::compile): Convert return type from function ptr
765         to a compilation_result.  Use get_function_name.
766         (compilation_state::compile): Convert return type from
767         gcc_jit_result * to a compilation_result.
768         (test_script): Update for above changes, extracting the code from
769         the compilation_result.
770         (main): Likewise.
771         * docs/_build/texinfo/libgccjit.texi: Regenerate.
773 2016-01-04  Jakub Jelinek  <jakub@redhat.com>
775         Update copyright years.
777 2015-11-11  Andrew MacLeod  <amacleod@redhat.com>
779         * dummy-frontend.c: Remove unused header files.
780         * jit-builtins.c: Likewise.
781         * jit-playback.c: Likewise.
782         * jit-recording.c: Likewise.
783         * jit-spec.c: Likewise.
784         * libgccjit.c: Likewise.
786 2015-11-07  Richard Sandiford  <richard.sandiford@arm.com>
788         * jit-builtins.c: Don't undef DEF_BUILTIN.
790 2015-10-29  Andrew MacLeod  <amacleod@redhat.com>
792         * dummy-frontend.c: Reorder #include's and remove duplicates.
793         * jit-builtins.c: Likewise.
794         * jit-playback.c: Likewise.
795         * jit-recording.c: Likewise.
796         * libgccjit.c: Likewise.
798 2015-10-13  Jakub Jelinek  <jakub@redhat.com>
800         * jit-builtins.c (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10,
801         DEF_FUNCTION_TYPE_11): Define.
802         * jit-builtins.h (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10,
803         DEF_FUNCTION_TYPE_11): Define.
805 2015-09-30  Thomas Schwinge  <thomas@codesourcery.com>
806             Ulrich Drepper  <drepper@gmail.com>
808         * jit-builtins.h: Undefine DEF_FUNCTION_TYPE_VAR_6 after use.
810 2015-09-30  Matthias Klose  <doko@ubuntu.com>
812         * jit-builtins.h Define DEF_FUNCTION_TYPE_VAR_6,
813         remove DEF_FUNCTION_TYPE_VAR_11.
814         * jit-builtins.c (builtins_manager::make_type): Define and handle
815         DEF_FUNCTION_TYPE_VAR_6, remove DEF_FUNCTION_TYPE_VAR_11.
817 2015-08-25  David Malcolm  <dmalcolm@redhat.com>
819         * docs/cp/topics/contexts.rst
820         (gccjit::context::set_bool_use_external_driver): New.
821         * docs/internals/test-hello-world.exe.log.txt: Update.
822         * docs/topics/compatibility.rst (LIBGCCJIT_ABI_5): New.
823         * docs/topics/contexts.rst
824         (gcc_jit_context_set_bool_use_external_driver): New.
825         * jit-common.h (enum inner_bool_option): Add
826         INNER_BOOL_OPTION_USE_EXTERNAL_DRIVER.
827         * jit-playback.c (gcc_driver_name): New global.
828         (gcc:jit::playback::context::invoke_driver): Split out second
829         half into...
830         (gcc::jit::playback::context::invoke_embedded_driver): ...this new
831         function, and...
832         (gcc::jit::playback::context::invoke_external_driver): ...this new
833         function.
834         * jit-playback.h
835         (gcc::jit::playback::context::get_inner_bool_option): New.
836         (gcc::jit::playback::context::invoke_embedded_driver): New.
837         (gcc::jit::playback::context::invoke_external_driver): New.
838         * jit-recording.c (inner_bool_option_reproducer_strings):
839         Add entry for INNER_BOOL_OPTION_USE_EXTERNAL_DRIVER.
840         * libgccjit++.h
841         (gccjit::context::set_bool_use_external_driver): New.
842         * libgccjit.c (gcc_jit_context_set_bool_use_external_driver): New.
843         * libgccjit.h (gcc_jit_context_set_bool_use_external_driver): New.
844         (LIBGCCJIT_HAVE_gcc_jit_context_set_bool_use_external_driver):
845         New.
846         * libgccjit.map (LIBGCCJIT_ABI_5): New.
847         * notes.txt: Show invocation of embedded copy of driver.
848         * docs/internals/test-hello-world.exe.log.txt: Update
850 2015-08-13  David Malcolm  <dmalcolm@redhat.com>
852         * jit-playback.c (invoke_driver): On OS X, add
853         "-Wl,-undefined,dynamic_lookup" to the driver arguments.
855 2015-08-03  David Malcolm  <dmalcolm@redhat.com>
857         * docs/topics/compatibility.rst (LIBGCCJIT_ABI_4): New.
858         * docs/topics/contexts.rst (GCC_JIT_BOOL_OPTION_DUMP_SUMMARY):
859         We no longer show a profile.
860         * docs/topics/index.rst (Topic Reference): Add performance.rst.
861         * docs/topics/performance.rst: New file.
862         * docs/_build/texinfo/libgccjit.texi: Regenerate.
863         * jit-playback.c (gcc::jit::playback::context::compile): Add timer
864         param when constructing the "toplev" instance.
865         (gcc::jit::playback::context::acquire_mutex): Add timer param when
866         constructing auto_timevar instance.
867         (gcc::jit::playback::context::make_fake_args): If we have a timer,
868         add "-ftime-report".
869         (gcc::jit::playback::context::invoke_driver): Add timer param when
870         constructing auto_timevar instance.
871         (gcc::jit::playback::context::dlopen_built_dso): Likewise.
872         * jit-playback.h (gcc::jit::playback::context::get_timer): New accessor.
873         * jit-recording.c: Include timevar.h.
874         (gcc::jit::recording::context::context): Initialize field "m_timer".
875         * jit-recording.h: Add forward declaration of class timer.
876         (gcc::jit::recording::context::set_timer): New method.
877         (gcc::jit::recording::context::get_timer): New method.
878         (gcc::jit::recording::context::m_timer): New field.
879         * libgccjit++.h (gccjit::timer): New class.
880         (gccjit::auto_time): New class.
881         (gccjit::context::set_timer): New method.
882         (gccjit::context::get_timer): New.
883         (gccjit::timer::timer): New.
884         (gccjit::timer::push): New.
885         (gccjit::timer::pop): New.
886         (timer::print): New.
887         (timer::get_inner_timer): New.
888         (timer::release): New.
889         (auto_time::auto_time): New.
890         (auto_time::~auto_time): New.
891         * libgccjit.c: Include timevar.h.
892         (struct gcc_jit_timer): New.
893         (gcc_jit_timer_new): New function.
894         (gcc_jit_timer_release): New function.
895         (gcc_jit_context_set_timer): New function.
896         (gcc_jit_context_get_timer): New function.
897         (gcc_jit_timer_push): New function.
898         (gcc_jit_timer_pop): New function.
899         (gcc_jit_timer_print): New function.
900         * libgccjit.h (LIBGCCJIT_HAVE_TIMING_API): New macro.
901         (gcc_jit_timer): New typedef.
902         (gcc_jit_timer_new): New function.
903         (gcc_jit_timer_release): New function.
904         (gcc_jit_context_set_timer): New function.
905         (gcc_jit_context_get_timer): New function.
906         (gcc_jit_timer_push): New function.
907         (gcc_jit_timer_pop): New function.
908         (gcc_jit_timer_print): New function.
909         * libgccjit.map (LIBGCCJIT_ABI_4): New.
910         (gcc_jit_timer_new): New function.
911         (gcc_jit_timer_release): New function.
912         (gcc_jit_context_set_timer): New function.
913         (gcc_jit_context_get_timer): New function.
914         (gcc_jit_timer_push): New function.
915         (gcc_jit_timer_pop): New function.
916         (gcc_jit_timer_print): New function.
918 2015-07-23  David Malcolm  <dmalcolm@redhat.com>
920         * jit-playback.c (invoke_driver): Convert local "argvec"
921         to an auto_argvec, so that it owns copies of the strings,
922         rather than borrows them, updating ADD_ARG to use xstrdup
923         and special-casing the NULL terminator to avoid
924         xstrdup (NULL).  Call add_multilib_driver_arguments at the front
925         of the arguments.
926         (MULTILIB_DEFAULTS): Provide a default definition.
927         (multilib_defaults_raw): New constant array.
928         (gcc::jit::playback::context::add_multilib_driver_arguments): New
929         method.
930         * jit-playback.h
931         (gcc::jit::playback::context::add_multilib_driver_arguments): New
932         method.
933         * docs/internals/test-hello-world.exe.log.txt: Update.
934         * docs/_build/texinfo/libgccjit.texi: Regenerate.
936 2015-07-16  David Malcolm  <dmalcolm@redhat.com>
938         * docs/internals/index.rst (Overview of code structure): Add note
939         that the implementation is in C++, despite the .c extension.
940         (Submitting patches): New subsection.
941         * docs/_build/texinfo/libgccjit.texi: Regenerate.
943 2015-07-09  Andrew MacLeod  <amacleod@redhat.com>
945         * dummy-frontend.c: Adjust includes for flags.h changes.
946         * jit-common.h: Likewise.
947         * jit-playback.c: Likewise.
949 2015-07-08  David Malcolm  <dmalcolm@redhat.com>
951         PR jit/66783
952         * libgccjit.c (gcc_jit_context_new_field): Show name of field in
953         "unknown size" error message.
954         (gcc_jit_struct_set_fields): Show name of struct in error message.
955         (gcc_jit_context_new_global): Show name of global in
956         "unknown size" error message.
957         (gcc_jit_function_new_local): Likewise for local.
959 2015-07-07  Andrew MacLeod  <amacleod@redhat.com>
961         * dummy-frontend.c: Adjust includes.
962         * jit-common.h: Likewise.
963         * jit-playback.c: Likewise.
965 2015-07-07  David Malcolm  <dmalcolm@redhat.com>
967         PR jit/66783
968         * jit-recording.h: Within namespace gcc:jit::recording...
969         (type::has_known_size): New virtual function.
970         (struct_has_known_size): New function.
971         * libgccjit.c (gcc_jit_context_new_field): Verify that the type
972         has a known size.
973         (gcc_jit_context_new_global): Likewise.
974         (gcc_jit_function_new_local): Likewise.
976 2015-07-07  David Malcolm  <dmalcolm@redhat.com>
978         PR jit/66779
979         * dummy-frontend.c (jit_langhook_type_for_mode): Ensure that we
980         handle modes QI, HI, SI, DI, TI.
982 2015-07-01  David Malcolm  <dmalcolm@redhat.com>
984         PR jit/66700
985         * jit-playback.c (jit_mark_addressable): New function.
986         (gcc::jit::playback::lvalue::get_address): Call
987         jit_mark_addressable on the underlying tree.
989 2015-07-01  David Malcolm  <dmalcolm@redhat.com>
991         * docs/topics/types.rst (gcc_jit_context_new_union_type): Add
992         documentation.
993         * docs/_build/texinfo/libgccjit.texi: Regenerate.
995 2015-07-01  David Malcolm  <dmalcolm@redhat.com>
997         * docs/topics/contexts.rst (gcc_jit_context_set_bool_option):
998         Clarify lack of lifetime requirements on (const char *) parameter.
999         * docs/topics/expressions.rst
1000         (gcc_jit_context_new_string_literal): Likewise.
1001         (gcc_jit_context_new_global): Likewise.
1002         * docs/topics/functions.rst (gcc_jit_context_new_param): Likewise.
1003         (gcc_jit_context_new_function): Likewise.
1004         (gcc_jit_function_new_block): Likewise.
1005         (gcc_jit_block_add_comment): Likewise.
1006         * docs/topics/locations.rst (gcc_jit_context_new_location):
1007         Likewise.
1008         * docs/topics/types.rst (gcc_jit_context_new_field): Likewise.
1009         (gcc_jit_context_new_struct_type): Likewise.
1010         * docs/_build/texinfo/libgccjit.texi: Regenerate.
1012 2015-06-30  David Malcolm  <dmalcolm@redhat.com>
1014         * docs/cp/topics/functions.rst (Blocks): Add switch statements to
1015         list of ways to terminate a block.
1016         (gccjit::block::end_with_switch): Add function description.
1017         (gccjit::case_): Add class.
1018         (gccjit::context::new_case): Add function description.
1019         * docs/cp/topics/objects.rst: Add "case_" to class hierarchy.
1020         * docs/topics/compatibility.rst (LIBGCCJIT_ABI_3): New.
1021         * docs/topics/functions.rst (Blocks): Add switch statements to
1022         list of ways to terminate a block.
1023         (gcc_jit_block_end_with_switch): Add function description.
1024         (gcc_jit_case): Add type.
1025         (gcc_jit_context_new_case): Add function description.
1026         (gcc_jit_case_as_object): Add function description.
1027         * docs/topics/objects.rst: Add gcc_jit_case to class hierarchy.
1028         * docs/_build/texinfo/libgccjit.texi: Regenerate.
1029         * jit-common.h (gcc::jit::recording::case_): Add forward decl.
1030         (gcc::jit::playback::case_): Add forward decl.
1031         * jit-playback.c (add_case): New function.
1032         (gcc::jit::playback::block::add_switch): New function.
1033         * jit-playback.h (gcc::jit::playback::case_): New struct.
1034         (gcc::jit::playback::block::get_function): New method.
1035         (gcc::jit::playback::block::add_switch): New method.
1036         * jit-recording.c: Within namespace gcc::jit...
1037         (recording::context::new_case): New method.
1038         (recording::function::validate): Update for change to
1039         get_successor_blocks.
1040         (recording::block::end_with_switch): New method.
1041         (recording::block::get_successor_blocks): Update to support an
1042         arbitrary number of successor blocks.
1043         (recording::block::dump_edges_to_dot): Likewise.
1044         (memento_of_new_rvalue_from_const <int>::get_wide_int): New.
1045         (memento_of_new_rvalue_from_const <long>::get_wide_int): New.
1046         (memento_of_new_rvalue_from_const <double>::get_wide_int): New.
1047         (memento_of_new_rvalue_from_const <void *>::get_wide_int): New.
1048         (recording::statement::get_successor_blocks): Update to support an
1049         arbitrary number of successor blocks.
1050         (recording::conditional::get_successor_blocks): Likewise.
1051         (recording::jump::get_successor_blocks): Likewise.
1052         (recording::return_::get_successor_blocks): Likewise.
1053         (recording::case_::write_reproducer): New.
1054         (recording::case_::make_debug_string): New.
1055         (recording::switch_::switch_): New.
1056         (recording::switch_::replay_into): New.
1057         (recording::switch_::get_successor_blocks): New.
1058         (recording::switch_::make_debug_string): New.
1059         (recording::switch_::write_reproducer): New.
1060         * jit-recording.h: Within namespace gcc::jit::recording...
1061         (context::new_case): New.
1062         (rvalue::is_constant): New.
1063         (rvalue::get_wide_int): New.
1064         (block::end_with_switch): New.
1065         (block::get_successor_blocks): Update to support an arbitrary
1066         number of successor blocks.
1067         (memento_of_new_rvalue_from_const::is_constant): New.
1068         (memento_of_new_rvalue_from_const::get_wide_int): New.
1069         (statement::get_successor_blocks): Update to support an arbitrary
1070         number of successor blocks.
1071         (conditional::get_successor_blocks): Likewise.
1072         (jump::get_successor_blocks): Likewise.
1073         (return_::get_successor_blocks): Likewise.
1074         (case_): New subclass of memento.
1075         (switch_): New subclass of statement.
1076         * libgccjit++.h (gccjit::case_): New subclass of gccjit::object.
1077         (gccjit::context::new_case): New method.
1078         (gccjit::block::end_with_switch): New method.
1079         (gccjit::case_::case): New ctors.
1080         (gccjit::case_::get_inner_case): New method.
1081         * libgccjit.c: Include "typed-splay-tree.h"
1082         (struct gcc_jit_case): New.
1083         (gcc_jit_context_new_case): New function.
1084         (gcc_jit_case_as_object): New function.
1085         (valid_dest_for_switch): New function.
1086         (valid_case_for_switch): New function.
1087         (class api_call_validator): New class.
1088         (class case_range_validator): New class.
1089         (case_range_validator::case_range_validator): New.
1090         (case_range_validator::validate): New.
1091         (case_range_validator::case_compare): New.
1092         (case_range_validator::get_wide_int): new.
1093         (gcc_jit_block_end_with_switch): New.
1094         * libgccjit.h: Add gcc_jit_case to class hierarchy comment.
1095         (gcc_jit_case): New typedef.
1096         (gcc_jit_context_new_case): New function.
1097         (gcc_jit_case_as_object): New function.
1098         (gcc_jit_block_end_with_switch): New function.
1099         (LIBGCCJIT_HAVE_SWITCH_STATEMENTS): New.
1100         * libgccjit.map: Add gcc_jit_block_end_with_switch,
1101         gcc_jit_case_as_object and gcc_jit_context_new_case.
1103 2015-06-30  David Malcolm  <dmalcolm@redhat.com>
1105         PR jit/66546
1106         * docs/cp/topics/contexts.rst
1107         (gccjit::context::set_bool_allow_unreachable_blocks): New.
1108         * docs/topics/compatibility.rst (LIBGCCJIT_ABI_2): New.
1109         * docs/topics/contexts.rst (Options): Add notes discussing the
1110         transition from enums to entrypoints for new options.
1111         (gcc_jit_context_set_bool_allow_unreachable_blocks): New.
1112         * docs/_build/texinfo/libgccjit.texi: Regenerate.
1113         * jit-common.h (gcc::jit::inner_bool_option): New enum.
1114         * jit-recording.c: Within namespace gcc::jit...
1115         (recording::context::context): Handle m_inner_bool_options.
1116         (recording::context::set_inner_bool_option): New.
1117         (inner_bool_option_reproducer_strings): New.
1118         (recording::context::log_all_options): Log the "inner" bool
1119         options.
1120         (recording::context::log_inner_bool_option): New.
1121         (recording::context::dump_reproducer_to_file): Write initializers
1122         for "inner" bool options.
1123         (recording::function::validate): Don't check for block
1124         reachability if INNER_BOOL_OPTION_ALLOW_UNREACHABLE_BLOCKS is set.
1125         * jit-recording.h: Within namespace gcc::jit...
1126         (recording::context::set_inner_bool_option): New.
1127         (recording::context::get_inner_bool_option): New.
1128         (recording::context::log_inner_bool_option): New.
1129         (recording::context::m_inner_bool_options): New.
1130         * libgccjit++.h
1131         (gccjit::context::set_bool_allow_unreachable_blocks): New.
1132         * libgccjit.c
1133         (gcc_jit_context_set_bool_allow_unreachable_blocks): New.
1134         * libgccjit.h: Add note about options present in the
1135         initial release of libgccjit.
1136         (gcc_jit_context_set_bool_allow_unreachable_blocks): New API
1137         entrypoint.
1138         (LIBGCCJIT_HAVE_gcc_jit_context_set_bool_allow_unreachable_blocks):
1139         New macro.
1140         * libgccjit.map (LIBGCCJIT_ABI_2): New, containing...
1141         (gcc_jit_context_set_bool_allow_unreachable_blocks): ...this new
1142         entrypoint.
1144 2015-06-30  David Malcolm  <dmalcolm@redhat.com>
1146         PR jit/66628
1147         * docs/cp/topics/contexts.rst (Additional command-line options):
1148         New section.
1149         * docs/topics/compatibility.rst: New file.
1150         * docs/topics/contexts.rst (Additional command-line options): New
1151         section.
1152         * docs/topics/index.rst: Add compatibility.rst.
1153         * docs/_build/texinfo/libgccjit.texi: Regenerate.
1154         * jit-playback.c (make_fake_args): Add call to
1155         append_command_line_options.
1156         * jit-recording.c: Within namespace gcc::jit...
1157         (recording::context::~context): Free the optnames within
1158         m_command_line_options.
1159         (recording::context::set_bool_option): Likewise.
1160         (recording::context::add_command_line_option): New method.
1161         (recording::context::append_command_line_options): New method.
1162         (recording::context::dump_reproducer_to_file): Add command-line
1163         options.
1164         * jit-recording.h: Within namespace gcc::jit...
1165         (recording::context::add_command_line_option): New method.
1166         (recording::context::append_command_line_options): New method.
1167         (recording::context::m_command_line_options): New field.
1168         * libgccjit++.h (gccjit::context::add_command_line_option): New
1169         method.
1170         * libgccjit.c (gcc_jit_context_add_command_line_option): New API
1171         entrypoint.
1172         * libgccjit.h (gcc_jit_context_add_command_line_option): New API
1173         entrypoint.
1174         (LIBGCCJIT_HAVE_gcc_jit_context_add_command_line_option): New
1175         macro.
1176         * libgccjit.map: Put existing symbols within LIBGCCJIT_ABI_0; add
1177         LIBGCCJIT_ABI_1 and gcc_jit_context_add_command_line_option.
1179 2015-06-30  David Malcolm  <dmalcolm@redhat.com>
1181         * jit-recording.c
1182         (gcc::jit::recording::context::dump_reproducer_to_file):
1183         Add pragma to generated reproducers to disable -Wunused-variable.
1184         Fix handling of NULL string options.
1186 2015-06-30  David Malcolm  <dmalcolm@redhat.com>
1188         * docs/cp/topics/expressions.rst: Remove stray semicolon.
1189         * docs/cp/topics/functions.rst: Remove stray backslash.
1190         * docs/_build/texinfo/libgccjit.texi: Regenerate.
1192 2015-06-25  Andrew MacLeod  <amacleod@redhat.com>
1194         * dummy-frontend.c: Remove ipa-ref.h and plugin-api.h from include list.
1195         * jit-playback.c: Likewise.
1197 2015-06-25  Andrew Macleod  <amacleod@redhat.com>
1199         * jit-common.h: Don't include alias.h.
1201 2015-06-17  David Malcolm  <dmalcolm@redhat.com>
1203         * libgccjit.c (gcc_jit_lvalue_access_field): Verify that the field
1204         is for the correct struct.
1205         (gcc_jit_rvalue_access_field): Likewise.
1207 2015-06-17  Andrew MacLeod  <amacleod@redhat.com>
1209         * dummy-frontend.c: Do not include input.h, line-map.h or is-a.h.
1210         * jit-common.h: Likewise.
1211         * jit-playback.c: Likewise.
1213 2015-06-16  David Malcolm  <dmalcolm@redhat.com>
1215         PR jit/66539
1216         * jit-recording.c: Within namespace gcc::jit::recording::
1217         (rvalue::get_debug_string_parens): New function.
1218         (binary_op::make_debug_string): Update to mimic C precedence
1219         rules.
1220         (binary_op_precedence): New array.
1221         (binary_op::get_precedence): New function.
1222         (comparison::make_debug_string): Update to mimic C precedence
1223         rules.
1224         (comparison_precedence): New array.
1225         (comparison::get_precedence): New function.
1226         (cast::make_debug_string): Update to mimic C precedence rules.
1227         (call::make_debug_string): Likewise.
1228         (call_through_ptr::make_debug_string): Likewise.
1229         (array_access::make_debug_string): Likewise.
1230         (access_field_of_lvalue::make_debug_string): Likewise.
1231         (access_field_rvalue::make_debug_string): Likewise.
1232         (dereference_field_rvalue::make_debug_string): Likewise.
1233         (dereference_rvalue::make_debug_string): Likewise.
1234         (get_address_of_lvalue::make_debug_string): Likewise.
1235         * jit-recording.h: Within namespace gcc::jit::recording::
1236         (precedence): New enum.
1237         (rvalue::rvalue): Initialize field "m_parenthesized_string".
1238         (rvalue::get_debug_string_parens): New method.
1239         (rvalue::get_precedence): New pure virtual function.
1240         (rvalue::m_parenthesized_string): New field.
1241         (param::get_precedence): New function.
1242         (global::get_precedence): New function.
1243         (memento_of_new_rvalue_from_const::get_precedence): New function.
1244         (memento_of_new_string_literal::get_precedence): New function.
1245         (unary_op::get_precedence): New function.
1246         (binary_op::get_precedence): New function.
1247         (comparison::get_precedence): New function.
1248         (cast::get_precedence): New function.
1249         (call::get_precedence): New function.
1250         (call_through_ptr::get_precedence): New function.
1251         (array_access::get_precedence): New function.
1252         (access_field_of_lvalue::get_precedence): New function.
1253         (access_field_rvalue::get_precedence): New function.
1254         (dereference_field_rvalue::get_precedence): New function.
1255         (dereference_rvalue::get_precedence): New function.
1256         (get_address_of_lvalue::get_precedence): New function.
1257         (local::get_precedence): New function.
1259 2015-06-09  Matthias Klose  <doko@ubuntu.com>
1261         * Make-lang.in (jit.install-common): Install headers using INSTALL_DATA.
1263 2015-06-08  Andrew MacLeod  <amacleod@redhat.com>
1265         * dummy-frontend.c : Adjust include files.
1266         * jit-common.h : Likewise.
1267         * jit-playback.c : Likewise.
1269 2015-06-05  David Malcolm  <dmalcolm@redhat.com>
1271         * dummy-frontend.c
1272         (jit_langhook_post_compilation_parsing_cleanups): Remove.
1273         (LANG_HOOKS_POST_COMPILATION_PARSING_CLEANUPS): Remove
1274         * jit-playback.c (gcc::jit::playback::context::new_global): Add
1275         call to varpool_node::finalize_decl.
1276         (gcc::jit::playback::context::finalize_global_decls): Remove.
1277         * jit-playback.h
1278         (gcc::jit::playback::context::finalize_global_decls): Remove.
1280 2015-06-05  David Malcolm  <dmalcolm@redhat.com>
1282         * dummy-frontend.c (jit_langhook_write_globals): Rename to...
1283         (jit_langhook_post_compilation_parsing_cleanups): ...this, and
1284         eliminate calls to finalize_compilation_unit and
1285         write_global_decls_2.
1286         (LANG_HOOKS_WRITE_GLOBALS): Rename to...
1287         (LANG_HOOKS_POST_COMPILATION_PARSING_CLEANUPS): ...this and
1288         redirect from jit_langhook_write_globals to
1289         jit_langhook_post_compilation_parsing_cleanups.
1290         * jit-playback.c
1291         (gcc::jit::playback::context::write_global_decls_1): Rename to...
1292         (gcc::jit::playback::context::finalize_global_decls): ...this.
1293         (gcc::jit::playback::context::write_global_decls_1): Delete.
1294         * jit-playback.h
1295         (gcc::jit::playback::context::write_global_decls_1): Rename to...
1296         (gcc::jit::playback::context::finalize_global_decls): ...this.
1297         (gcc::jit::playback::context::write_global_decls_1): Delete.
1299 2015-06-04  Andrew MacLeod  <amacleod@redhat.com>
1301         * dummy-frontend.c: Adjust includes for restructured coretypes.h.
1302         * jit-common.h: Likewise.
1303         * jit-playback.c: Likewise.
1305 2015-05-12  David Malcolm  <dmalcolm@redhat.com>
1307         * jit-builtins.c: Include vec.h before target.h.
1309 2015-04-27  Jim Wilson  <jim.wilson@linaro.org>
1311         * Make-lang.in (jit.mostlyclean): Remove shared libraries and object
1312         files.
1314 2015-04-09  David Malcolm  <dmalcolm@redhat.com>
1316         PR jit/65691
1317         * docs/cp/topics/expressions.rst (Simple expressions): Fix copy
1318         and paste error in description of gccjit::context::one.
1319         * docs/topics/expressions.rst (Simple expressions): Likewise in
1320         description of gcc_jit_context_one.
1321         * docs/_build/texinfo/libgccjit.texi: Regenerate.
1323 2015-03-13  Uros Bizjak  <ubizjak@gmail.com>
1325         * jit-recording.c (dump::write): Also check vasprintf return value.
1326         (recording::context::add_error_va): Ditto.
1327         (recording::string::from_printf): Ditto.
1329 2015-03-13  David Malcolm  <dmalcolm@redhat.com>
1331         * docs/internals/index.rst (Packaging notes): New section.
1332         * docs/_build/texinfo/libgccjit.texi: Regenerate.
1334 2015-03-05  David Malcolm  <dmalcolm@redhat.com>
1336         * docs/cp/intro/tutorial03.rst: Add missing arguments to
1337         gccjit::block::end_with_conditional call.  Add on_true/on_false
1338         comments.  Tweak the wording.
1339         * docs/intro/tutorial03.rst: Add missing arguments to
1340         gcc_jit_block_end_with_conditional call.  Add some clarifying
1341         comments.
1342         * docs/topics/compilation.rst: Tweak the wording to avoid an
1343         ambiguous use of "this".
1344         * docs/topics/contexts.rst: Fix a typo.
1345         * docs/topics/expressions.rst (GCC_JIT_BINARY_OP_MINUS): Remove
1346         a stray backtick.
1347         * docs/_build/texinfo/libgccjit.texi: Regenerate.
1349 2015-02-24  Thomas Schwinge  <thomas@codesourcery.com>
1351         PR libgomp/64625
1352         * jit-builtins.c (DEF_FUNCTION_TYPE_VAR_8)
1353         (DEF_FUNCTION_TYPE_VAR_12): Remove macros.
1354         (DEF_FUNCTION_TYPE_VAR_7, DEF_FUNCTION_TYPE_VAR_11): New macros.
1355         * jit-builtins.h (DEF_FUNCTION_TYPE_VAR_8)
1356         (DEF_FUNCTION_TYPE_VAR_12): Remove macros.
1357         (DEF_FUNCTION_TYPE_VAR_7, DEF_FUNCTION_TYPE_VAR_11): New macros.
1359 2015-02-04  David Malcolm  <dmalcolm@redhat.com>
1361         PR jit/64257
1362         * docs/conf.py (html_theme): Change from 'pyramid'
1363         to 'sphinxdoc'.
1365 2015-02-04  David Malcolm  <dmalcolm@redhat.com>
1367         * docs/topics/contexts.rst (gcc_jit_context_acquire): Fix
1368         typo.
1369         * docs/_build/texinfo/libgccjit.texi: Regenerate.
1371 2015-02-03  David Malcolm  <dmalcolm@redhat.com>
1373         * jit-logging.h (gcc::jit::log_user::log): Make const.
1374         * jit-recording.c (gcc::jit::recording::context::set_str_option):
1375         Log the new value of the option.
1376         (gcc::jit::recording::context::set_int_option): Likewise.
1377         (gcc::jit::recording::context::set_bool_option): Likewise.
1378         (gcc::jit::recording::context::compile): Log the value of all
1379         options.
1380         (gcc::jit::recording::context::compile_to_file): Likewise.
1381         (gcc::jit::recording::context::log_all_options): New function.
1382         (gcc::jit::recording::context::log_str_option): New function.
1383         (gcc::jit::recording::context::log_int_option): New function.
1384         (gcc::jit::recording::context::log_bool_option): New function.
1385         * jit-recording.h (gcc::jit::recording::context::log_all_options):
1386         New function.
1387         (gcc::jit::recording::context::log_str_option): New function.
1388         (gcc::jit::recording::context::log_int_option): New function.
1389         (gcc::jit::recording::context::log_bool_option): New function.
1390         * docs/internals/test-hello-world.exe.log.txt: Update for above
1391         changes.
1392         * docs/_build/texinfo/libgccjit.texi: Regenerate.
1394 2015-02-03  David Malcolm  <dmalcolm@redhat.com>
1396         PR jit/64810
1397         * Make-lang.in (jit_OBJS): Add jit/jit-spec.o and gcc.o.
1398         (LIBGCCJIT_FILENAME): Add EXTRA_GCC_OBJS.
1399         * jit-playback.c: Include gcc.h.
1400         (gcc::jit::playback::context::compile): Move mutex acquisition
1401         to before the call to make_fake_args.
1402         (append_arg_from_driver): New function.
1403         (gcc::jit::playback::context::make_fake_args): On the first call,
1404         call into driver_get_configure_time_options to get configure-time
1405         default options and cache them.  Add them to the args for
1406         toplev::main.
1407         * jit-spec.c: New source file.
1408         * docs/internals/test-hello-world.exe.log.txt: Update to reflect
1409         above changes.
1410         * docs/_build/texinfo/libgccjit.texi: Regenerate.
1412 2015-02-02  David Malcolm  <dmalcolm@redhat.com>
1414         PR jit/64810
1415         * dummy-frontend.c (jit_langhook_type_for_mode): Support
1416         TYPE_MODE (long_long_integer_type_node).
1418 2015-01-27  David Malcolm  <dmalcolm@redhat.com>
1420         * docs/internals/test-hello-world.exe.log.txt: Add example version
1421         lines.
1422         * docs/_build/texinfo/libgccjit.texi: Regenerate.
1423         * jit-common.h (gcc::jit::dump::get_file): New accessor.
1424         * jit-logging.c: Include toplev.h.
1425         (gcc::jit::logger::logger): Log the GCC version.
1426         * jit-recording.c: Include toplev.h.
1427         (gcc:jit::recording::context::dump_reproducer_to_file): Log the
1428         GCC version.
1430 2015-01-26  David Malcolm  <dmalcolm@redhat.com>
1432         * docs/topics/compilation.rst (gcc_jit_result_get_code): Fix typo.
1433         * docs/topics/contexts.rst (gcc_jit_context_get_last_error): The
1434         error buffer is only valid until the next call to the context.
1435         * docs/_build/texinfo/libgccjit.texi: Regenerate.
1436         * libgccjit.h (gcc_jit_context_get_first_error): Reword the
1437         comment to omit mention of compiling.
1438         (gcc_jit_context_get_last_error): The error buffer is only valid
1439         until the next call to the context.
1441 2015-01-26  David Malcolm  <dmalcolm@redhat.com>
1443         PR jit/64708
1444         * config-lang.in (compilers): Drop "libgccjit.so".
1446 2015-01-23  David Malcolm  <dmalcolm@redhat.com>
1448         PR jit/64721
1449         * jit-playback.c (gcc::jit::playback::context::compile): Construct
1450         toplev instances with init_signals=false.
1452 2015-01-19  David Malcolm  <dmalcolm@redhat.com>
1454         * docs/cp/topics/results.rst: Rename to...
1455         * docs/cp/topics/compilation.rst: ...this, and add section on
1456         ahead-of-time compilation.
1457         * docs/cp/topics/index.rst: Update for renaming of results.rst
1458         to compilation.rst.
1459         * docs/examples/emit-alphabet.bf: New file, a sample "brainf"
1460         script.
1461         * docs/examples/tut05-bf.c: New file, implementing a compiler
1462         for "brainf".
1463         * docs/internals/test-hello-world.exe.log.txt: Update to reflect
1464         changes to logger output.
1465         * docs/intro/index.rst: Add tutorial05.rst
1466         * docs/intro/tutorial05.rst: New file.
1467         * docs/topics/results.rst: Rename to...
1468         * docs/topics/compilation.rst: ...this, and add section on
1469         ahead-of-time compilation.
1470         * docs/topics/index.rst: Update for renaming of results.rst to
1471         compilation.rst.
1472         * docs/_build/texinfo/libgccjit.texi: Regenerate.
1473         * jit-playback.c (gcc::jit::playback::context::compile): Convert
1474         return type from result * to void.  Move the code to convert to
1475         dso and dlopen the result to a new pure virtual "postprocess"
1476         method.
1477         (gcc::jit::playback::compile_to_memory::compile_to_memory): New
1478         function.
1479         (gcc::jit::playback::compile_to_memory::postprocess): New
1480         function, based on playback::context::compile.
1481         (gcc::jit::playback::compile_to_file::compile_to_file): New
1482         function.
1483         (gcc::jit::playback::compile_to_file::postprocess): New function.
1484         (gcc::jit::playback::compile_to_file::copy_file): New function.
1485         (gcc::jit::playback::context::convert_to_dso): Move internals
1486         to...
1487         (gcc::jit::playback::context::invoke_driver): New method.  Add
1488         "-shared" and "-c" options to driver's argv as needed.
1489         * jit-playback.h: Include "timevar.h".
1490         (gcc::jit::playback::context::compile): Convert return type from
1491         result * to void.
1492         (gcc::jit::playback::context::postprocess): New pure virtual
1493         function, making this an abstract base class.
1494         (gcc::jit::playback::context::get_tempdir): New accessor.
1495         (gcc::jit::playback::context::invoke_driver): New function.
1496         (class gcc::jit::playback::compile_to_memory): New subclass of
1497         playback::context.
1498         (class gcc::jit::playback::compile_to_file): Likewise.
1499         * jit-recording.c (gcc::jit::recording::context::compile): Use a
1500         playback::compile_to_memory, and extract its result.
1501         (gcc::jit::recording::context::compile_to_file): New function.
1502         * jit-recording.h (gcc::jit::recording::context::compile_to_file):
1503         New function.
1504         * libgccjit++.h (gccjit::context::compile_to_file): New method.
1505         * libgccjit.c (gcc_jit_context_compile): Update log message to
1506         clarify that this is an in-memory compile.
1507         (gcc_jit_context_compile_to_file): New function.
1508         * libgccjit.h (gcc_jit_context): Clarify that you can compile
1509         a context more than once, and that you can compile to a file
1510         as well as to memory.
1511         (gcc_jit_result): Clarify that this is the result of an
1512         in-memory compilation.
1513         (gcc_jit_context_compile): Clarify that you can compile, and that
1514         this is an in-memory compilation.
1515         (enum gcc_jit_output_kind): New enum.
1516         (gcc_jit_context_compile_to_file): New function.
1517         (gcc_jit_context_enable_dump): Clarify comment to cover both forms
1518         of compilation.
1519         * libgccjit.map (gcc_jit_context_compile_to_file): New API
1520         entrypoint.
1521         * notes.txt: Update to show the playback::context::postprocess
1522         virtual function.
1524 2015-01-19  David Malcolm  <dmalcolm@redhat.com>
1526         * jit-recording.c
1527         (gcc::jit::recording::memento_of_new_string_literal::make_debug_string):
1528         Add missing format string.
1530 2015-01-16  David Malcolm  <dmalcolm@redhat.com>
1532         * Make-lang.in (lang_checks_parallelized): Add "check-jit".
1533         (check_jit_parallelize): Set this to an arbitrary value (10).
1535 2015-01-16  Jakub Jelinek  <jakub@redhat.com>
1537         * jit-builtins.h (DEF_FUNCTION_TYPE_VAR_5): Fix spelling of
1538         last argument.
1539         (DEF_FUNCTION_TYPE_VAR_8, DEF_FUNCTION_TYPE_VAR_12): Define and
1540         undef afterwards.
1541         * jit-builtins.c (DEF_FUNCTION_TYPE_VAR_8, DEF_FUNCTION_TYPE_VAR_12):
1542         Likewise.
1544 2015-01-15  Richard Sandiford  <richard.sandiford@arm.com>
1546         Update copyright years in docs/.
1548 2015-01-15  David Malcolm  <dmalcolm@redhat.com>
1550         * libgccjit.c (gcc_jit_block_add_assignment_op): Check that the
1551         lvalue and the rvalue are of compatible type.
1553 2015-01-13  David Malcolm  <dmalcolm@redhat.com>
1555         * docs/cp/topics/contexts.rst (Debugging): Add
1556         gccjit::context::dump_reproducer_to_file.
1557         * docs/internals/index.rst (Design notes): New section,
1558         discussing input validation and
1559         gcc_jit_context_dump_reproducer_to_file.
1560         * docs/topics/contexts.rst (Debugging): Add
1561         gcc_jit_context_dump_reproducer_to_file.
1562         * docs/_build/texinfo/libgccjit.texi: Regenerate.
1563         * jit-common.h (gcc::jit::dump::get_context): New accessor.
1564         * jit-recording.c: Include "hash-map.h".
1565         Within namespace ::gcc::jit...
1566         (dump::write): Flush each line.
1567         (dump::make_location): Pass false for new param "created_by_user".
1568         (class allocator): New class.
1569         (allocator::~allocator): New function.
1570         (allocator::xstrdup_printf): New function.
1571         (allocator::xstrdup_printf_va): New function.
1572         (class reproducer): New subclass of dump.
1573         (reproducer::reproducer): New function.
1574         (reproducer::write_params): New function.
1575         (reproducer::write_args): New function.
1576         (reproducer::make_identifier): New function.
1577         (reproducer::make_tmp_identifier): New function.
1578         (reproducer::get_identifier): New pair of functions.
1579         (reproducer::get_identifier_as_rvalue): New function.
1580         (reproducer::get_identifier_as_lvalue): New function.
1581         (reproducer::get_identifier_as_type): New function.
1582         (reproducer::xstrdup_printf): New function.
1583         (recording::context::context): Initialize m_toplevel_ctxt.
1584         (recording::context::new_location): Add param created_by_user.
1585         (str_option_reproducer_strings): New table of strings.
1586         (int_option_reproducer_strings): Likewise.
1587         (bool_option_reproducer_strings): Likewise.
1588         (get_type_enum_strings): Likewise.
1589         (names_of_function_kinds): Likewise.
1590         (global_kind_reproducer_strings): Likewise.
1591         (unary_op_reproducer_strings): Likewise.
1592         (binary_op_reproducer_strings): Likewise.
1593         (comparison_reproducer_strings): Likewise.
1594         Within namespace ::gcc::jit::recording::...
1595         (context::dump_reproducer_to_file): New function.
1596         (string::write_reproducer): Likewise.
1597         (location::write_reproducer): Likewise.
1598         (type::access_as_type): Likewise.
1599         (memento_of_get_type::write_reproducer): Likewise.
1600         (memento_of_get_pointer::write_reproducer): Likewise.
1601         (memento_of_get_const::write_reproducer): Likewise.
1602         (memento_of_get_volatile::write_reproducer): Likewise.
1603         (array_type::write_reproducer): Likewise.
1604         (function_type::write_reproducer): Likewise.
1605         (function_type::write_deferred_reproducer): Likewise.
1606         (field::write_reproducer): Likewise.
1607         (struct_::access_as_type): Likewise.
1608         (struct_::write_reproducer): Likewise.
1609         (union_::write_reproducer): Likewise.
1610         (fields::write_reproducer): Likewise.
1611         (rvalue::access_as_rvalue): Likewise.
1612         (lvalue::access_as_rvalue): Likewise.
1613         (lvalue::access_as_lvalue): Likewise.
1614         (param::access_as_rvalue): Likewise.
1615         (param::access_as_lvalue): Likewise.
1616         (param::write_reproducer): Likewise.
1617         (function::write_reproducer): Likewise.
1618         (block::write_reproducer): Likewise.
1619         (global::write_reproducer): Likewise.
1620         (memento_of_new_rvalue_from_const <int>::write_reproducer):
1621         Likewise.
1622         (memento_of_new_rvalue_from_const <long>::write_reproducer):
1623         Likewise.
1624         (memento_of_new_rvalue_from_const <double>::write_reproducer):
1625         Likewise.
1626         (memento_of_new_rvalue_from_const <void *>::write_reproducer):
1627         Likewise.
1628         (memento_of_new_string_literal::write_reproducer): Likewise.
1629         (unary_op::write_reproducer): Likewise.
1630         (binary_op::write_reproducer): Likewise.
1631         (comparison::write_reproducer): Likewise.
1632         (cast::write_reproducer): Likewise.
1633         (call::write_reproducer): Likewise.
1634         (call_through_ptr::write_reproducer): Likewise.
1635         (array_access::write_reproducer): Likewise.
1636         (access_field_of_lvalue::write_reproducer): Likewise.
1637         (access_field_rvalue::write_reproducer): Likewise.
1638         (dereference_field_rvalue::write_reproducer): Likewise.
1639         (dereference_rvalue::write_reproducer): Likewise.
1640         (get_address_of_lvalue::write_reproducer): Likewise.
1641         (local::write_reproducer): Likewise.
1642         (eval::write_reproducer): Likewise.
1643         (assignment::write_reproducer): Likewise.
1644         (assignment_op::write_reproducer): Likewise.
1645         (comment::write_reproducer): Likewise.
1646         (conditional::write_reproducer): Likewise.
1647         (jump::write_reproducer): Likewise.
1648         (return_::write_reproducer): Likewise.
1649         * jit-recording.h (gcc::jit::reproducer): New forward declararion.
1650         Within namespace ::gcc::jit::recording::...
1651         (context::new_location): Add "created_by_user" param.
1652         (context::dump_reproducer_to_file): New method.
1653         (context::m_toplevel_ctxt): New field.
1654         (memento::write_reproducer): New pure virtual function.
1655         (memento::dyn_cast_location): New virtual function.
1656         (string::write_reproducer):
1657         (location::location): Add "created_by_user" param.
1658         (location::dyn_cast_location): New function.
1659         (location::created_by_user): New accessor.
1660         (location::write_reproducer): New function.
1661         (location::m_created_by_user): New field.
1662         (type::access_as_type): New virtual function.
1663         (location::write_reproducer): Likewise.
1664         (type::access_as_type): Likewise.
1665         (memento_of_get_type::write_reproducer): Likewise.
1666         (memento_of_get_pointer::write_reproducer): Likewise.
1667         (memento_of_get_const::write_reproducer): Likewise.
1668         (memento_of_get_volatile::write_reproducer): Likewise.
1669         (array_type::write_reproducer): Likewise.
1670         (function_type::write_reproducer): Likewise.
1671         (function_type::write_deferred_reproducer): Likewise.
1672         (field::write_reproducer): Likewise.
1673         (struct_::access_as_type): Likewise.
1674         (struct_::write_reproducer): Likewise.
1675         (union_::write_reproducer): Likewise.
1676         (union_::m_fields): Remove stray unused field.
1677         (fields::length): New accessor.
1678         (fields::get_field): New accessor.
1679         (fields::write_reproducer): New function.
1680         (rvalue::access_as_rvalue): Likewise.
1681         (lvalue::access_as_rvalue): Likewise.
1682         (lvalue::access_as_lvalue): Likewise.
1683         (param::access_as_rvalue): Likewise.
1684         (param::access_as_lvalue): Likewise.
1685         (param::write_reproducer): Likewise.
1686         (function::write_reproducer): Likewise.
1687         (block::write_reproducer): Likewise.
1688         (global::write_reproducer): Likewise.
1689         (memento_of_new_rvalue_from_const <HOST_TYPE>::write_reproducer):
1690         Likewise.
1691         (memento_of_new_string_literal::write_reproducer): Likewise.
1692         (unary_op::write_reproducer): Likewise.
1693         (binary_op::write_reproducer): Likewise.
1694         (comparison::write_reproducer): Likewise.
1695         (cast::write_reproducer): Likewise.
1696         (call::write_reproducer): Likewise.
1697         (call_through_ptr::write_reproducer): Likewise.
1698         (array_access::write_reproducer): Likewise.
1699         (access_field_of_lvalue::write_reproducer): Likewise.
1700         (access_field_rvalue::write_reproducer): Likewise.
1701         (dereference_field_rvalue::write_reproducer): Likewise.
1702         (dereference_rvalue::write_reproducer): Likewise.
1703         (get_address_of_lvalue::write_reproducer): Likewise.
1704         (local::write_reproducer): Likewise.
1705         (eval::write_reproducer): Likewise.
1706         (assignment::write_reproducer): Likewise.
1707         (assignment_op::write_reproducer): Likewise.
1708         (comment::write_reproducer): Likewise.
1709         (conditional::write_reproducer): Likewise.
1710         (jump::write_reproducer): Likewise.
1711         (return_::write_reproducer): Likewise.
1712         * libgccjit++.h (gccjit::context::dump_reproducer_to_file): New.
1713         * libgccjit.c (gcc_jit_context_new_location): Pass "true" as
1714         param "created_by_user".
1715         (gcc_jit_context_dump_reproducer_to_file): New API entrypoint.
1716         * libgccjit.h (gcc_jit_context_dump_reproducer_to_file): New API
1717         entrypoint.
1718         * libgccjit.map (gcc_jit_context_dump_reproducer_to_file): New API
1719         entrypoint.
1721 2015-01-12  David Malcolm  <dmalcolm@redhat.com>
1723         * jit-recording.c (class gcc::jit::rvalue_usage_validator): New.
1724         (gcc::jit::rvalue_usage_validator::rvalue_usage_validator): New
1725         ctor.
1726         (gcc::jit::rvalue_usage_validator::visit): New function.
1727         (gcc::jit::recording::rvalue::verify_valid_within_stmt): New
1728         function.
1729         (gcc::jit::recording::rvalue::set_scope): New function.
1730         (gcc::jit::recording::function::function): Call set_scope on each
1731         param, issuing errors for any params that already have a function.
1732         (gcc::jit::recording::block::add_eval): Return the new statement;
1733         update the comment given that some error-checking now happens after
1734         this returns.
1735         (gcc::jit::recording::block::add_assignment): Likewise.
1736         (gcc::jit::recording::block::add_assignment_op): Likewise.
1737         (gcc::jit::recording::block::add_comment): Likewise.
1738         (gcc::jit::recording::block::end_with_conditional): Likewise.
1739         (gcc::jit::recording::block::end_with_jump): Likewise.
1740         (gcc::jit::recording::block::end_with_return): Likewise.
1741         (gcc::jit::recording::block::validate): Add a comment.
1742         (gcc::jit::recording::unary_op::visit_children): New function.
1743         (gcc::jit::recording::binary_op::visit_children): New function.
1744         (gcc::jit::recording::comparison::visit_children): New function.
1745         (gcc::jit::recording::cast::visit_children): New function.
1746         (gcc::jit::recording::call::visit_children): New function.
1747         (gcc::jit::recording::call_through_ptr::visit_children): New function.
1748         (gcc::jit::recording::array_access::visit_children): New function.
1749         (gcc::jit::recording::access_field_of_lvalue::visit_children): New
1750         function.
1751         (gcc::jit::recording::access_field_rvalue::visit_children): New
1752         function.
1753         (gcc::jit::recording::dereference_field_rvalue::visit_children):
1754         New function.
1755         (gcc::jit::recording::dereference_rvalue::visit_children): New
1756         function.
1757         (gcc::jit::recording::get_address_of_lvalue::visit_children): New
1758         function.
1759         * jit-recording.h: Within namespace gcc::jit::recording...
1760         (class rvalue_visitor): New.
1761         (rvalue::rvalue): Initialize m_scope.
1762         (rvalue::get_loc): New accessor.
1763         (rvalue::verify_valid_within_stmt): New function.
1764         (rvalue::visit_children): New pure virtual function.
1765         (rvalue::set_scope): New function.
1766         (rvalue::get_scope): New function.
1767         (rvalue::dyn_cast_param): New function.
1768         (rvalue::m_scope): New field.
1769         (param::visit_children): New empty function.
1770         (param::dyn_cast_param): New function.
1771         (function::get_loc): New function.
1772         (block::add_eval): Return the new statement.
1773         (block::add_assignment): Likewise.
1774         (block::add_assignment_op): Likewise.
1775         (block::add_comment): Likewise.
1776         (block::end_with_conditional): Likewise.
1777         (block::end_with_jump): Likewise.
1778         (block::end_with_return): Likewise.
1779         (global::visit_children): New function.
1780         (memento_of_new_rvalue_from_const<HOST_TYPE>::visit_children):
1781         New function.
1782         (memento_of_new_string_literal::visit_children): New function.
1783         (unary_op::visit_children): New function.
1784         (binary_op::visit_children): New function.
1785         (comparison::visit_children): New function.
1786         (cast::visit_children): New function.
1787         (call::visit_children): New function.
1788         (call_through_ptr::visit_children): New function.
1789         (array_access::visit_children): New function.
1790         (access_field_of_lvalue::visit_children): New function.
1791         (access_field_rvalue::visit_children): New function.
1792         (dereference_field_rvalue::visit_children): New function.
1793         (dereference_rvalue::visit_children): New function.
1794         (get_address_of_lvalue::visit_children): New function.
1795         (local::local): Call set_scope.
1796         (local::visit_children): New function.
1797         (statement::get_block): Make public.
1798         * libgccjit.c (RETURN_VAL_IF_FAIL_PRINTF5): New macro.
1799         (RETURN_NULL_IF_FAIL_PRINTF5): New macro.
1800         (gcc_jit_context_new_function): Verify that each param has
1801         not yet been used for creating another function.
1802         (gcc_jit_block_add_eval): After creating the stmt, verify
1803         that the rvalue expression tree is valid to use within it.
1804         (gcc_jit_block_add_assignment): Likewise for the lvalue and
1805         rvalue expression trees.
1806         (gcc_jit_block_add_assignment_op): Likewise.
1807         (gcc_jit_block_end_with_conditional): Likewise for the boolval
1808         expression tree.
1809         (gcc_jit_block_end_with_return): Likewise for the rvalue
1810         expression tree.
1811         (gcc_jit_block_end_with_void_return): Remove return of "void",
1812         now that block::end_with_return is now non-void.
1814 2015-01-12  David Malcolm  <dmalcolm@redhat.com>
1816         * jit-playback.c (gcc::jit::playback::context::read_dump_file):
1817         Add missing fclose on error-handling path.
1819 2015-01-12  David Malcolm  <dmalcolm@redhat.com>
1821         * docs/cp/topics/expressions.rst (Global variables): Add
1822         enum gcc_jit_global_kind param to gccjit::context::new_global.
1823         * docs/topics/expressions.rst (Global variables): Likewise.
1824         Document the new enum.
1825         * docs/topics/results.rst (Compilation results): Document
1826         globals-handling.
1827         * docs/_build/texinfo/libgccjit.texi: Regenerate.
1828         * dummy-frontend.c (jit_langhook_write_globals): Call into the
1829         playback context's write_global_decls_1 and write_global_decls_2
1830         before and after calling symtab->finalize_compilation_unit ().
1831         * jit-playback.c: Include "debug.h".
1832         (gcc::jit::playback::context::new_global): Add "kind" param and
1833         use it to set TREE_PUBLIC, TREE_STATIC and DECL_EXTERNAL on the
1834         underlying VAR_DECL.  Call varpool_node::get_create on the
1835         VAR_DECL, and add it to m_globals.
1836         (gcc::jit::playback::context::write_global_decls_1): New function.
1837         (gcc::jit::playback::context::write_global_decls_2): New function.
1838         * jit-playback.h (gcc::jit::playback::context::context): Call
1839         create on m_globals.
1840         (gcc::jit::playback::context::new_global): Add "kind" param.
1841         (gcc::jit::playback::context::write_global_decls_1): New function.
1842         (gcc::jit::playback::context::write_global_decls_2): New function.
1843         (gcc::jit::playback::context::m_globals): New field.
1844         * jit-recording.c (gcc::jit::recording::context::context):
1845         Initialize m_globals.
1846         (gcc::jit::recording::context::new_global): Add param "kind".
1847         Add the new global to m_globals.
1848         (gcc::jit::recording::context::dump_to_file): Dump the globals.
1849         (gcc::jit::recording::global::replay_into): Add field m_kind.
1850         (gcc::jit::recording::global::write_to_dump): New override.
1851         * jit-recording.h (gcc::jit::recording::context::new_global): Add
1852         param "kind".
1853         (gcc::jit::recording::context::m_globals): New field.
1854         (gcc::jit::recording::global::global): Add param kind.
1855         (gcc::jit::recording::global::write_to_dump): New override.
1856         (gcc::jit::recording::global::m_kind): New field.
1857         * jit-result.c (gcc::jit::result::get_global): New function.
1858         * jit-result.h (gcc::jit::result::get_global): New function.
1859         * libgccjit++.h (gccjit::context::new_global): Add "kind" param.
1860         * libgccjit.c (gcc_jit_context_new_global): Likewise.
1861         (gcc_jit_result_get_global): New API entrypoint.
1862         * libgccjit.h (gcc_jit_result_get_global): New API entrypoint.
1863         (enum gcc_jit_global_kind): New enum.
1864         (gcc_jit_context_new_global): API change: add "kind" param.
1865         * libgccjit.map (gcc_jit_result_get_global): New symbol.
1867 2015-01-09  David Malcolm  <dmalcolm@redhat.com>
1869         * dummy-frontend.c: Include "fixed-value.h", "alias.h", "flags.h",
1870         "symtab.h", "inchash.h".  Move include of "hash-set.h" much
1871         earlier.
1872         * jit-builtins.c: Remove redundant includes of "opts.h" and
1873         "tree.h".
1874         * jit-common.h: Include "hash-set.h", "input.h", "vec.h",
1875         "double-int.h", "alias.h", "flags.h", "symtab.h", "inchash.h".
1876         * jit-playback.c: Include "hashtab.h", "machmode.h", "input.h",
1877         "statistics.h", "vec.h", "double-int.h", "real.h",
1878         "fixed-value.h", "alias.h", "flags.h", "symtab.h", "tree-core.h",
1879         "inchash.h", "fold-const.h".  Move include of "hash-set.h" to
1880         earlier.
1881         * jit-recording.c: Remove redundant includes of "opts.h" and
1882         "tree.h".
1884 2015-01-09  David Malcolm  <dmalcolm@redhat.com>
1886         * docs/cp/topics/expressions.rst (Simple expressions): Use
1887         ":c:type:" for C types.  Document new overload of
1888         gcc::jit::context::new_rvalue.
1889         * docs/topics/expressions.rst (Simple expressions): Use
1890         ":c:type:" for C types.  Document new entrypoint
1891         gcc_jit_context_new_rvalue_from_long.
1892         * docs/_build/texinfo/libgccjit.texi: Regenerate.
1893         * jit-playback.c: Within namespace gcc::jit::playback...
1894         (context::new_rvalue_from_int): Eliminate in favor of...
1895         (context::new_rvalue_from_const <int>): ...this.
1896         (context::new_rvalue_from_double): Eliminate in favor of...
1897         (context::new_rvalue_from_const <double>): ...this.
1898         (context::new_rvalue_from_const <long>): New.
1899         (context::new_rvalue_from_ptr): Eliminate in favor of...
1900         (context::new_rvalue_from_const <void *>): ...this.
1901         * jit-playback.h: Within namespace gcc::jit::playback...
1902         (context::new_rvalue_from_int): Eliminate in favor of...
1903         (context::new_rvalue_from_const <HOST_TYPE>): ...this.
1904         (context::new_rvalue_from_double): Likewise.
1905         (context::new_rvalue_from_ptr): Likewise.
1906         * jit-recording.c: Within namespace gcc::jit::recording...
1907         (context::new_rvalue_from_int): Eliminate.
1908         (context::new_rvalue_from_double): Likewise.
1909         (context::new_rvalue_from_ptr): Likewise.
1910         (class memento_of_new_rvalue_from_const <int>):
1911         Add explicit specialization.
1912         (class memento_of_new_rvalue_from_const <long>):
1913         Likewise.
1914         (class memento_of_new_rvalue_from_const <double>):
1915         Likewise.
1916         (class memento_of_new_rvalue_from_const <void *>):
1917         Likewise.
1918         (memento_of_new_rvalue_from_int::replay_into):
1919         Generalize into...
1920         (memento_of_new_rvalue_from_const <HOST_TYPE>::replay_into):
1921         ...this...
1922         (memento_of_new_rvalue_from_double::replay_into):
1923         ...allowing this...
1924         (memento_of_new_rvalue_from_ptr::replay_into):
1925         ...and this to be deleted.
1926         (memento_of_new_rvalue_from_int::make_debug_string):
1927         Convert to...
1928         (memento_of_new_rvalue_from_const <int>::make_debug_string):
1929         ...this.
1930         (memento_of_new_rvalue_from_double::make_debug_string):
1931         Convert to...
1932         (memento_of_new_rvalue_from_const <double>::make_debug_string):
1933         ...this.
1934         (memento_of_new_rvalue_from_ptr::make_debug_string)
1935         Convert to...
1936         (memento_of_new_rvalue_from_const <void *>::make_debug_string):
1937         ...this.
1938         (memento_of_new_rvalue_from_const <long>::make_debug_string):
1939         New function.
1940         * jit-recording.h: Within namespace gcc::jit::recording...
1941         (context::new_rvalue_from_int): Eliminate.
1942         (context::new_rvalue_from_double): Likewise.
1943         (context::new_rvalue_from_ptr): Likewise, all in favor of...
1944         (context::new_rvalue_from_const <HOST_TYPE>): New family of
1945         methods.
1946         (class memento_of_new_rvalue_from_int): Eliminate.
1947         (class memento_of_new_rvalue_from_double): Likewise.
1948         (class memento_of_new_rvalue_from_ptr): Likewise.
1949         (class memento_of_new_rvalue_from_const <HOST_TYPE>): New family
1950         of rvalue subclasses.
1951         * libgccjit++.h (gccjit::context::new_rvalue): New overload, for
1952         "long".
1953         * libgccjit.c (gcc_jit_context_new_rvalue_from_int): Update for
1954         rewriting of recording::context::new_rvalue_from_int to
1955         recording::context::new_rvalue_from_const <int>.
1956         (gcc_jit_context_new_rvalue_from_long): New API entrypoint.
1957         (gcc_jit_context_new_rvalue_from_double): Update for
1958         rewriting of recording::context::new_rvalue_from_double to
1959         recording::context::new_rvalue_from_const <double>.
1960         (gcc_jit_context_new_rvalue_from_ptr): Update for
1961         rewriting of recording::context::new_rvalue_from_ptr to
1962         recording::context::new_rvalue_from_const <void *>.
1963         * libgccjit.h (gcc_jit_context_new_rvalue_from_long): New API
1964         entrypoint.
1965         * libgccjit.map (gcc_jit_context_new_rvalue_from_long): Likewise.
1967 2015-01-09  David Malcolm  <dmalcolm@redhat.com>
1969         PR jit/64206
1970         * docs/internals/test-hello-world.exe.log.txt: Update, the log now
1971         shows tempdir creation/cleanup.
1972         * docs/_build/texinfo/libgccjit.texi: Regenerate.
1973         * jit-logging.h (class gcc::jit::log_user): Add gcc::jit::tempdir
1974         to the list of subclasses in the comment.
1975         * jit-playback.c (gcc::jit::playback::context::context): Add a
1976         comment clarifying when the tempdir gets cleaned up.
1977         (gcc::jit::playback::context::compile): Pass the context's logger,
1978         if any, to the tempdir.
1979         (gcc::jit::playback::context::dlopen_built_dso): When creating the
1980         gcc::jit::result, if GCC_JIT_BOOL_OPTION_DEBUGINFO is set, hand
1981         over ownership of the tempdir to it.
1982         * jit-result.c: Include "jit-tempdir.h".
1983         (gcc::jit::result::result): Add tempdir param, saving it as
1984         m_tempdir.
1985         (gcc::jit::result::~result): Delete m_tempdir.
1986         * jit-result.h (gcc::jit::result::result): Add tempdir param.
1987         (gcc::jit::result::m_tempdir): New field.
1988         * jit-tempdir.c (gcc::jit::tempdir::tempdir): Add logger param;
1989         add JIT_LOG_SCOPE.
1990         (gcc::jit::tempdir::create): Add JIT_LOG_SCOPE to log entry/exit,
1991         and log m_path_template and m_path_tempdir.
1992         (gcc::jit::tempdir::~tempdir): Add JIT_LOG_SCOPE to log
1993         entry/exit, and log the unlink and rmdir calls.
1994         * jit-tempdir.h: Include "jit-logging.h".
1995         (class gcc::jit::tempdir): Make this be a subclass of log_user.
1996         (gcc::jit::tempdir::tempdir): Add logger param.
1997         * notes.txt: Update to show the two possible places where the
1998         tempdir can be cleaned up.
2000 2015-01-08  David Malcolm  <dmalcolm@redhat.com>
2002         * libgccjit.h (struct gcc_jit_context): Rewrite the descriptive
2003         comment.
2005 2015-01-08  David Malcolm  <dmalcolm@redhat.com>
2007         * docs/topics/contexts.rst (Error-handling): Document new
2008         entrypoint gcc_jit_context_get_last_error.
2009         * docs/_build/texinfo/libgccjit.texi: Regenerate.
2010         * jit-recording.c (gcc::jit::recording::context::context):
2011         Initialize new fields "m_last_error_str" and
2012         "m_owns_last_error_str".
2013         (gcc::jit::recording::context::~context): Clean up
2014         m_last_error_str, if needed.
2015         (gcc::jit::recording::context::add_error_va): Update
2016         m_last_error_str and m_owns_last_error_str, freeing the old
2017         value if appropriate.
2018         (gcc::jit::recording::context::get_last_error): New function.
2019         * jit-recording.h (gcc::jit::recording::context::get_last_error):
2020         New function.
2021         (gcc::jit::recording::context): New fields m_last_error_str and
2022         m_owns_last_error_str.
2023         * libgccjit.c (gcc_jit_context_get_last_error): New function.
2024         * libgccjit.h (gcc_jit_context_get_last_error): New declaration.
2025         * libgccjit.map (gcc_jit_context_get_last_error): New function.
2027 2015-01-08  David Malcolm  <dmalcolm@redhat.com>
2029         * Make-lang.in (jit_OBJS): Add jit/jit-logging.o.
2030         * docs/internals/index.rst (Overview of code structure): Mention
2031         gcc_jit_context_set_logfile, and embed the example logfile.
2032         * docs/internals/test-hello-world.exe.log.txt: New file: example
2033         of a logfile.
2034         * docs/topics/contexts.rst (Debugging): Add documentation
2035         for gcc_jit_context_set_logfile.
2036         * docs/_build/texinfo/libgccjit.texi: Regenerate.
2037         * dummy-frontend.c: Include "jit-logging.h".
2038         (jit_langhook_init): Assert that there is an active playback
2039         context.  If it has a logger, log entry/exit to this function.
2040         (jit_langhook_write_globals): Likewise.
2041         * jit-common.h (gcc::jit::logger): New forward declaration.
2042         * jit-logging.c: New file.
2043         * jit-logging.h: New file.
2044         * jit-playback.c: Include "jit-logging.h".
2045         (gcc::jit::playback::context::context): Initialize the log_user
2046         base class from the recording context's logger (if any).  Use
2047         JIT_LOG_SCOPE to log entry/exit from the function body.
2048         (gcc::jit::playback::context::~context): Use JIT_LOG_SCOPE to
2049         log entry/exit from the function body.
2050         (gcc::jit::playback::build_stmt_list): Likewise.
2051         (gcc::jit::playback::function::postprocess): Likewise.
2052         (gcc::jit::playback::context::compile): Likewise.  Log the
2053         entry/exit to toplev::main and toplev::finalize.  Log the
2054         fake argv passed to toplev::main.
2055         (gcc::jit::playback::context::acquire_mutex): Use JIT_LOG_SCOPE to
2056         log entry/exit from the function body.
2057         (gcc::jit::playback::context::release_mutex): Likewise.
2058         (gcc::jit::playback::context::make_fake_args): Likewise.
2059         (gcc::jit::playback::context::extract_any_requested_dumps):
2060         Likewise.
2061         (gcc::jit::playback::context::convert_to_dso): Likewise. Also,
2062         log the arguments that the driver is invoked with.
2063         (gcc::jit::playback::context::dlopen_built_dso): Likewise.  Pass
2064         the logger to the result object.
2065         (gcc::jit::playback::context::replay): Use JIT_LOG_SCOPE to
2066         log entry/exit from the function body.
2067         (gcc::jit::playback::context::dump_generated_code): Likewise.
2068         (gcc::jit::playback::context::handle_locations): Likewise.
2069         * jit-playback.h (gcc::jit::playback::context): Make this be
2070         a subclass of gcc::jit::log_user.
2071         * jit-recording.c: Include "jit-logging.h".
2072         (gcc::jit::recording::context::context: Initialize the logger to
2073         NULL for root contexts, or to the parent's logger for child
2074         contexts.
2075         (gcc::jit::recording::context::~context): Use JIT_LOG_SCOPE to
2076         log entry/exit from the function body.
2077         (gcc::jit::recording::context::replay_into): Likewise.
2078         (gcc::jit::recording::context::disassociate_from_playback):
2079         Likewise.
2080         (gcc::jit::recording::context::compile): Likewise.
2081         (recording::context::add_error_va): Likewise.  Also, log the
2082         error.
2083         (gcc::jit::recording::context::validate): Use JIT_LOG_SCOPE to
2084         log entry/exit from the function body.
2085         * jit-recording.h: Include "jit-logging.h".
2086         (gcc::jit::recording::context): Make this be a subclass of
2087         gcc::jit::log_user.
2088         * jit-result.c: Include "jit-common.h" and "jit-logging.h".
2089         (gcc::jit::result::result): Add logger param, recording it.
2090         Use JIT_LOG_SCOPE to log entry/exit from the function body.
2091         (gcc::jit::result::~result(): Use JIT_LOG_SCOPE to
2092         log entry/exit from the function body.
2093         (gcc::jit::result::get_code): Likewise.
2094         * jit-result.h (gcc::jit::result): Make this be a subclass of
2095         gcc::jit::log_user.
2096         (gcc::jit::result::result): Add logger parameter.
2097         * libgccjit++.h (gccjit::context::set_logfile): New function.
2098         * libgccjit.c: Include "jit-logging.h".
2099         (gcc_jit_context_acquire): Log the context.
2100         (gcc_jit_context_release): Use JIT_LOG_FUNC to
2101         log entry/exit from the function body, and log the context.
2102         (gcc_jit_context_new_child_context): Likewise, logging both
2103         contexts.
2104         (gcc_jit_context_new_location): Use JIT_LOG_FUNC to
2105         log entry/exit from the function body.
2106         (gcc_jit_context_get_type): Likewise.
2107         (gcc_jit_context_get_int_type): Likewise.
2108         (gcc_jit_context_new_array_type): Likewise.
2109         (gcc_jit_context_new_field): Likewise.
2110         (gcc_jit_context_new_struct_type): Likewise.
2111         (gcc_jit_context_new_opaque_struct): Likewise.
2112         (gcc_jit_struct_set_fields): Likewise.
2113         (gcc_jit_context_new_union_type): Likewise.
2114         (gcc_jit_context_new_function_ptr_type): Likewise.
2115         (gcc_jit_context_new_param): Likewise.
2116         (gcc_jit_context_new_function): Likewise.
2117         (gcc_jit_context_get_builtin_function): Likewise.
2118         (gcc_jit_function_get_param): Likewise.
2119         (gcc_jit_function_dump_to_dot): Likewise.
2120         (gcc_jit_function_new_block): Likewise.
2121         (gcc_jit_context_new_global): Likewise.
2122         (gcc_jit_context_new_rvalue_from_int): Likewise.
2123         (gcc_jit_context_zero): Likewise.
2124         (gcc_jit_context_one): Likewise.
2125         (gcc_jit_context_new_rvalue_from_double): Likewise.
2126         (gcc_jit_context_new_rvalue_from_ptr): Likewise.
2127         (gcc_jit_context_null): Likewise.
2128         (gcc_jit_context_new_string_literal): Likewise.
2129         (gcc_jit_context_new_unary_op): Likewise.
2130         (gcc_jit_context_new_binary_op): Likewise.
2131         (gcc_jit_context_new_comparison): Likewise.
2132         (gcc_jit_context_new_call): Likewise.
2133         (gcc_jit_context_new_call_through_ptr): Likewise.
2134         (gcc_jit_context_new_cast): Likewise.
2135         (gcc_jit_context_new_array_access): Likewise.
2136         (gcc_jit_lvalue_access_field): Likewise.
2137         (gcc_jit_rvalue_access_field): Likewise.
2138         (gcc_jit_rvalue_dereference_field): Likewise.
2139         (gcc_jit_rvalue_dereference): Likewise.
2140         (gcc_jit_lvalue_get_address): Likewise.
2141         (gcc_jit_function_new_local): Likewise.
2142         (gcc_jit_block_add_eval): Likewise.
2143         (gcc_jit_block_add_assignment): Likewise.
2144         (gcc_jit_block_add_assignment_op): Likewise.
2145         (gcc_jit_block_end_with_conditional): Likewise.
2146         (gcc_jit_block_add_comment): Likewise.
2147         (gcc_jit_block_end_with_jump): Likewise.
2148         (gcc_jit_block_end_with_return): Likewise.
2149         (gcc_jit_block_end_with_void_return): Likewise.
2150         (gcc_jit_context_set_str_option): Likewise.
2151         (gcc_jit_context_set_int_option): Likewise.
2152         (gcc_jit_context_set_bool_option): Likewise.
2153         (gcc_jit_context_enable_dump): Likewise.
2154         (gcc_jit_context_compile): Likewise.  Also log the context,
2155         and the result.
2156         (gcc_jit_context_dump_to_file): Likewise.
2157         (gcc_jit_context_set_logfile): New function.
2158         (gcc_jit_context_get_first_error): Use JIT_LOG_FUNC to
2159         log entry/exit from the function body.
2160         (gcc_jit_result_get_code): Likewise.  Also log the fnname)
2161         and the ptr to be returned.
2162         (gcc_jit_result_release): Likewise.  Also log the result.
2163         * libgccjit.h: Include <stdio.h>, since we need FILE *.
2164         (gcc_jit_context_set_logfile): New declaration.
2165         * libgccjit.map (gcc_jit_context_set_logfile): New.
2167 2015-01-07  David Malcolm  <dmalcolm@redhat.com>
2169         * jit-recording.h (gcc::jit::recording::type::is_void): New
2170         virtual function.
2171         (gcc::jit::recording::memento_of_get_type::is_void): New
2172         function, overriding default implementation.
2173         * libgccjit.c (gcc_jit_rvalue_dereference): Verify that
2174         the underlying type is not "void".
2176 2015-01-07  David Malcolm  <dmalcolm@redhat.com>
2178         * docs/topics/expressions.rst (Unary Operations): Add
2179         GCC_JIT_UNARY_OP_ABS.
2180         * jit-playback.c (gcc::jit::playback::context::new_unary_op):
2181         Likewise.
2182         * jit-recording.c (unary_op_strings): Likewise.
2183         * libgccjit.c (gcc_jit_context_new_unary_op): Update checking
2184         of "op" to reflect addition of GCC_JIT_UNARY_OP_ABS.
2185         * libgccjit.h (enum gcc_jit_unary_op): Add GCC_JIT_UNARY_OP_ABS.
2186         * docs/_build/texinfo/libgccjit.texi: Regenerate.
2188 2015-01-07  David Malcolm  <dmalcolm@redhat.com>
2190         * jit-recording.h (gcc::jit::recording::memento_of_get_type): Fix
2191         typo in comment.
2193 2015-01-07  David Malcolm  <dmalcolm@redhat.com>
2195         * TODO.rst (Test suite): Remove item about running C++ testcases.
2196         * docs/internals/index.rst (Working on the JIT library): Add
2197         "c++" to the enabled languages in the suggested "configure"
2198         invocation, and add a description of why this is necessary.
2199         * docs/_build/texinfo/libgccjit.texi: Regenerate.
2201 2015-01-07  David Malcolm  <dmalcolm@redhat.com>
2203         * docs/internals/index.rst: Update to reflect that built
2204         testcases are now test-foo.c.exe, rather than test-foo.exe.
2205         * docs/_build/texinfo/libgccjit.texi: Regenerate.
2207 2015-01-05  Jakub Jelinek  <jakub@redhat.com>
2209         Update copyright years.
2211 2014-12-19  David Malcolm  <dmalcolm@redhat.com>
2213         * jit-playback.c (gcc::jit::playback::context::build_cast): In
2214         case BOOLEAN_TYPE, don't assume that the source expression is
2215         of type "int".
2217 2014-12-19  David Malcolm  <dmalcolm@redhat.com>
2219         * jit-recording.c (gcc::jit::recording::context::context): When
2220         copying string options from a parent context, take a copy of the
2221         underlying buffers, rather than simply copying the pointer.
2223 2014-12-19  David Malcolm  <dmalcolm@redhat.com>
2225         * jit-recording.c (gcc::jit::recording::context::set_str_option):
2226         Handle NULL.
2228 2014-12-11  David Malcolm  <dmalcolm@redhat.com>
2230         * docs/cp/topics/contexts.rst (gccjit::context::set_str_option):
2231         Document new function.
2232         * docs/_build/texinfo/libgccjit.texi: Regenerate.
2234 2014-12-10  Ulrich Drepper  <drepper@gmail.com>
2236         Minor interface cleanups of libgccjit
2237         * jit-playback.c (convert_to_dso): Use auto_vec instead
2238         of automatic array to build up command line.
2239         * jit-recording.c (recording::context::set_str_option):
2240         Make copy of the string.
2241         (recording::context::~context): Free string options.
2242         * jit-recording.h (recording::context): Adjust type
2243         of m_str_options member.
2244         * libgccjit.h: Adjust comment about
2245         gcc_jit_context_set_str_option parameter being used after
2246         the call.
2247         Update comment now that all interfaces are copy strings
2248         if necessary.
2249         * libgccjit++.h (gccjit::context): Add set_str_option
2250         member function.
2252 2014-12-10  David Malcolm  <dmalcolm@redhat.com>
2254         * docs/cp/index.rst: New file.
2255         * docs/cp/intro/index.rst: New file.
2256         * docs/cp/intro/tutorial01.rst: New file.
2257         * docs/cp/intro/tutorial02.rst: New file.
2258         * docs/cp/intro/tutorial03.rst: New file.
2259         * docs/cp/intro/tutorial04.rst: New file.
2260         * docs/cp/topics/contexts.rst: New file.
2261         * docs/cp/topics/expressions.rst: New file.
2262         * docs/cp/topics/functions.rst: New file.
2263         * docs/cp/topics/index.rst: New file.
2264         * docs/cp/topics/locations.rst: New file.
2265         * docs/cp/topics/objects.rst: New file.
2266         * docs/cp/topics/results.rst: New file.
2267         * docs/cp/topics/types.rst: New file.
2268         * docs/examples/tut01-hello-world.cc: New file.
2269         * docs/examples/tut02-square.c: Fix missing newline in output.
2270         * docs/examples/tut02-square.cc: New file.
2271         * docs/examples/tut03-sum-of-squares.cc: New file.
2272         * docs/examples/tut04-toyvm/toyvm.cc: New file.
2273         * docs/index.rst: Move summary to above the table of contents.
2274         Add text about the C vs C++ APIs.
2275         * docs/topics/contexts.rst: Fix a typo.
2277         * docs/_build/texinfo/libgccjit.texi: Regenerate.
2278         * docs/_build/texinfo/factorial1.png: New file.
2279         * docs/_build/texinfo/sum-of-squares1.png: New file.
2281 2014-12-09  David Malcolm  <dmalcolm@redhat.com>
2283         * docs/examples/tut04-toyvm/toyvm.c (toyvm_function_compile): Move
2284         logic for determine "funcname" to new function...
2285         (get_function_name): ...here, adding logic to skip any leading
2286         path from the filename.
2287         (toyvm_function_parse): Use the filename for fn_filename, rather
2288         than "name", so that the debugger can locate the source .toy
2289         file.
2290         (toyvm_function_parse): Don't fclose a NULL FILE *.
2292 2014-12-09  David Malcolm  <dmalcolm@redhat.com>
2294         PR jit/63854
2295         * docs/internals/index.rst (Running under valgrind): New
2296         subsection.
2297         (docs/_build/texinfo/libgccjit.texi): Regenerate.
2299 2014-12-09  David Malcolm  <dmalcolm@redhat.com>
2301         PR jit/64206
2302         * Make-lang.in (jit_OBJS): Add jit/jit-tempdir.o.
2303         * jit-common.h (gcc::jit::tempdir): New forward decl.
2304         * jit-playback.c: Include jit-tempdir.h.
2305         (gcc::jit::playback::context::context): Initialize m_tempdir.
2306         (gcc::jit::playback::context::~context): Move tempdir
2307         cleanup to new file jit-tempdir.c
2308         (make_tempdir_path_template): Move to new file jit-tempdir.c.
2309         (gcc::jit::playback::context::compile): Move tempdir creation
2310         to new tempdir object in new file jit-tempdir.c.
2311         (gcc::jit::playback::context::make_fake_args): Get path from
2312         tempdir object rather than from member data.
2313         (gcc::jit::playback::context::convert_to_dso): Likewise.
2314         (gcc::jit::playback::context::dlopen_built_dso): Likewise.
2315         (gcc::jit::playback::context::dump_generated_code): Likewise.
2316         (gcc::jit::playback::context::get_path_c_file): New function.
2317         (gcc::jit::playback::context::get_path_s_file): New function.
2318         (gcc::jit::playback::context::get_path_so_file): New function.
2319         * jit-playback.h (gcc::jit::playback::context::get_path_c_file):
2320         New function.
2321         (gcc::jit::playback::context::get_path_s_file): New function.
2322         (gcc::jit::playback::context::get_path_so_file): New function.
2323         (gcc::jit::playback::context): Move fields "m_path_template",
2324         "m_path_tempdir", "m_path_c_file", "m_path_s_file",
2325         "m_path_so_file" to new jit::tempdir class; add field "m_tempdir".
2326         * jit-tempdir.c: New file.
2327         * jit-tempdir.h: New file.
2329 2014-12-09  David Malcolm  <dmalcolm@redhat.com>
2331         * jit-playback.c (gcc::jit::playback::context::compile): Acquire the
2332         mutex here, immediately before using toplev, and release it here, on
2333         each exit path after acquisition.
2334         (jit_mutex): Move this variable here, from jit-recording.c.
2335         (gcc::jit::playback::context::acquire_mutex): New function, based on
2336         code in jit-recording.c.
2337         (gcc::jit::playback::context::release_mutex): Likewise.
2338         * jit-playback.h (gcc::jit::playback::context::acquire_mutex): New
2339         function.
2340         (gcc::jit::playback::context::release_mutex): New function.
2341         * jit-recording.c (jit_mutex): Move this variable to jit-playback.c.
2342         (gcc::jit::recording::context::compile): Move mutex-handling from
2343         here into jit-playback.c's gcc::jit::playback::context::compile.
2344         * notes.txt: Update to show the new locations of ACQUIRE_MUTEX
2345         and RELEASE_MUTEX.
2347 2014-12-09  David Malcolm  <dmalcolm@redhat.com>
2349         * jit-playback.c (gcc::jit::playback::context::compile): Move the
2350         dlopen code into...
2351         (gcc::jit::playback::context::dlopen_built_dso): ...this new
2352         function.
2353         * jit-playback.h (gcc::jit::playback::context::dlopen_built_dso):
2354         New function.
2356 2014-12-09  David Malcolm  <dmalcolm@redhat.com>
2358         PR jit/64166
2359         * docs/topics/contexts.rst (Debugging): Add description of
2360         gcc_jit_context_enable_dump.
2361         * docs/_build/texinfo/libgccjit.texi: Regenerate.
2362         * jit-playback.c: Include context.h.
2363         (class auto_argvec): New class.
2364         (auto_argvec::~auto_argvec): New function.
2365         (gcc::jit::playback::context::compile): Convert fake_args to be
2366         an auto_argvec, so that it can contain dynamically-allocated
2367         strings.   Construct a vec of all requested dumps, and pass it to
2368         make_fake_args.  Extract requested dumps between the calls to
2369         toplev::main and toplev::finalize.
2370         (gcc::jit::playback::context::make_fake_args): Convert param
2371         "argvec" to be a vec <char *>, and gain a "requested_dumps"
2372         param.  Convert to dynamically-allocated arg strings by converting
2373         ADD_ARG to take a copy of the arg, and add ADD_ARG_TAKE_OWNERSHIP
2374         for args that are already a copy.  Add args for all requested dumps.
2375         (gcc::jit::playback::context::extract_any_requested_dumps): New
2376         function.
2377         (gcc::jit::playback::context::read_dump_file): New function.
2378         * jit-playback.h (gcc::jit::playback::context::make_fake_args):
2379         Convert param "argvec" to be a vec <char *>, and gain a
2380         "requested_dumps" param.
2381         (gcc::jit::playback::context::extract_any_requested_dumps): New
2382         function.
2383         (gcc::jit::playback::context::read_dump_file): New function.
2384         * jit-recording.c (gcc::jit::recording::context::enable_dump): New
2385         function.
2386         (gcc::jit::recording::context::get_all_requested_dumps): New
2387         function.
2388         * jit-recording.h (gcc::jit::recording::requested_dump): New
2389         struct.
2390         (gcc::jit::recording::context::enable_dump): New function.
2391         (gcc::jit::recording::context::get_all_requested_dumps): New
2392         function.
2393         (gcc::jit::recording::context::m_requested_dumps): New field.
2394         * libgccjit.c (gcc_jit_context_enable_dump): New API entrypoint.
2395         * libgccjit.h (gcc_jit_context_enable_dump): New API entrypoint.
2396         * libgccjit.map (gcc_jit_context_enable_dump): New API entrypoint.
2398 2014-12-08  David Malcolm  <dmalcolm@redhat.com>
2400         * libgccjit++.h: Indent the forward declarations of the classes to
2401         show the inheritance hierarchy.
2403 2014-12-08  David Malcolm  <dmalcolm@redhat.com>
2405         * notes.txt: Show the beginning and ending of
2406         recording::context::compile vs playback::context::compile.  Show
2407         the creation and unlinking of the tempdir.  Show toplev::finalize.
2408         Move "RELEASE MUTEX" to the correct location.  Show
2409         gcc_jit_result_release, and indicate where the
2410         dlopen/dlsym/dlclose occur.
2412 2014-12-01  David Malcolm  <dmalcolm@redhat.com>
2414         * docs/examples/tut02-square.c (main): Release the context
2415         earlier, to show that this is possible.  Update error-handling
2416         to avoid a double-release of the context, and to avoid
2417         releasing a NULL result.
2418         * docs/intro/tutorial02.rst: Discuss gcc_jit_context_release.
2419         * docs/topics/functions.rst (GCC_JIT_FUNCTION_EXPORTED): Emphasize
2420         * docs/topics/results.rst (gcc_jit_result): Mention that this
2421         controls the lifetimes of machine code functions.
2422         (gcc_jit_result_get_code): Spell out the requirements for this
2423         to succeed, and the lifetime of the result.
2424         (gcc_jit_result_release): Mention that this invalidates any code
2425         that was obtained from the result.
2426         * docs/_build/texinfo/libgccjit.texi: Regenerate.
2428 2014-12-01  David Malcolm  <dmalcolm@redhat.com>
2430         PR jit/64018
2431         * docs/intro/tutorial02.rst: Spell out lifetime of generated code.
2432         Add description of error-handling, taken in part from...
2433         * docs/topics/contexts.rst (Error-handling): Expand, and move some
2434         content to tutorial02.rst.
2435         * docs/_build/texinfo/libgccjit.texi: Regenerate.
2437 2014-12-01  David Malcolm  <dmalcolm@redhat.com>
2439         PR jit/64020
2440         * docs/topics/types.rst (Standard types) Add new enum values to
2441         the table of enum gcc_jit_types: GCC_JIT_TYPE_COMPLEX_FLOAT,
2442         GCC_JIT_TYPE_COMPLEX_DOUBLE, GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE.
2443         Widen the left-hand column so that
2444         GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE will fit.
2445         * docs/_build/texinfo/libgccjit.texi: Regenerate.
2447         * jit-builtins.c: Include stringpool.h and jit-playback.h.
2448         Move everything out of the gcc::jit::recording namespace into
2449         just gcc::jit.
2450         (struct builtin_data): Add fields "fnclass", "attr", and
2451         "implicit_p".
2452         (DEF_BUILTIN): Update macro so populate the new fields.
2453         (builtins_manager::builtins_manager): Update for move out of
2454         recording namespace.  Initialize the m_attributes array.
2455         (builtins_manager::get_builtin_function): Likewise.
2456         (builtins_manager::get_builtin_function_by_id): New function.
2457         (builtins_manager::make_builtin_function): Update for move out of
2458         recording namespace.  Add fix for PR jit/64020 by detecting
2459         specific builtin ids and having them ensure that builtins for
2460         other ids are created as necessary.
2461         (builtins_manager::get_type): Update for move out of recording
2462         namespace.
2463         (builtins_manager::make_type): Likewise.  Add some missing
2464         #undefs.
2465         (builtins_manager::make_primitive_type): Update for move out of
2466         recording namespace.  Implement the three BT_COMPLEX_ cases and
2467         BT_DOUBLE_PTR.
2468         (builtins_manager::make_fn_type): Update for move out of recording
2469         namespace.
2470         (builtins_manager::make_ptr_type): Likewise.
2471         (builtins_manager::finish_playback): New function.
2472         (builtins_manager::get_class): New function.
2473         (builtins_manager::implicit_p): New function.
2474         (builtins_manager::get_attrs_tree): Two new functions.
2475         (builtins_manager::make_attrs_tree): New function.
2477         * jit-builtins.h: Move everything out of the gcc::jit::recording
2478         namespace into just gcc::jit.
2479         (enum built_in_attribute): New.
2480         (builtins_manager::builtins_manager): Update decl for namespace
2481         change.
2482         (builtins_manager::get_builtin_function): Likewise.
2483         (builtins_manager::get_class): New.
2484         (builtins_manager::implicit_p): New.
2485         (builtins_manager::get_attrs_tree): Two new functions.
2486         (builtins_manager::make_attrs_tree): New function.
2487         (builtins_manager::finish_playback): New.
2488         (builtins_manager::get_builtin_function_by_id): New.
2489         (builtins_manager::make_builtin_function): Update decl for
2490         namespace change.
2491         (builtins_manager::get_type): Likewise.
2492         (builtins_manager::make_type): Likewise.
2493         (builtins_manager::make_primitive_type): Likewise.
2494         (builtins_manager::make_fn_type): Likewise.
2495         (builtins_manager::make_ptr_type): Likewise.
2496         (builtins_manager): Likewise for fields.  Add new field
2497         "m_attributes".
2499         * jit-common.h (NUM_GCC_JIT_TYPES): Update.
2500         (builtins_manager): Update forward decl to reflect namespace
2501         change.
2503         * jit-playback.c: Include attribs.h and jit-builtins.h.
2504         (gcc::jit::playback::context::get_tree_node_for_type): Add cases
2505         for the new COMPLEX_ types.
2506         (gcc::jit::playback::context::new_function): If creating a
2507         builtin, set the DECL_BUILT_IN_CLASS and attributes on the fndecl,
2508         and call set_builtin_decl.
2509         (gcc::jit::playback::context::replay): If we have a
2510         builtins_manager, call its finish_playback method when we're done.
2512         * jit-playback.h:
2513         (gcc::jit::playback::context::get_builtins_manager): New function.
2515         * jit-recording.c
2516         (gcc::jit::recording::context::get_builtins_manager): New function.
2517         (gcc::jit::recording::get_builtin_function): Use
2518         get_builtins_manager, in case we're a child context.
2519         (gcc::jit::recording::memento_of_get_type::dereference): Add the
2520         COMPLEX_ types.
2521         (gcc::jit::recording::memento_of_get_type::is_int): Likewise.
2522         (gcc::jit::recording::memento_of_get_type::is_float): Likewise.
2523         (gcc::jit::recording::memento_of_get_type::is_bool): Likewise.
2524         (get_type_strings): Likewise.
2526         * jit-recording.h
2527         (gcc::jit::recording::context::get_builtins_manager): New.
2529         * libgccjit.h (enum gcc_jit_types): Add
2530         GCC_JIT_TYPE_COMPLEX_FLOAT, GCC_JIT_TYPE_COMPLEX_DOUBLE,
2531         GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE.
2533 2014-12-01  David Malcolm  <dmalcolm@redhat.com>
2535         * jit-builtins.c
2536         (gcc::jit::recording::builtins_manager::get_builtin_function):
2537         Check for NULL return from make_builtin_function.
2538         (gcc::jit::recording::builtins_manager::make_builtin_function):
2539         Check for NULL return from get_type.
2541 2014-12-01  David Malcolm  <dmalcolm@redhat.com>
2543         * jit-playback.c (gcc::jit::playback::context::compile): Move DSO
2544         creation code into...
2545         (gcc::jit::playback::context::convert_to_dso): New function.
2546         * jit-playback.h (gcc::jit::playback::context::convert_to_dso):
2547         New function.
2549 2014-12-01  David Malcolm  <dmalcolm@redhat.com>
2551         * jit-playback.c (gcc::jit::playback::context::compile): Use an
2552         auto_vec<const char *> rather than a const char *[20] for the
2553         top-level argv, and move the logic to build it to...
2554         (gcc::jit::playback::context::make_fake_args): New function.
2555         * jit-playback.h (gcc::jit::playback::context::make_fake_args):
2556         New function.
2558 2014-12-01  David Malcolm  <dmalcolm@redhat.com>
2560         * Make-lang.in (jit_OBJS): Add jit/jit-result.o.
2561         * jit-playback.c: Include new header jit-result.h.
2562         (gcc::jit::result::result): Move to new file jit-result.c.
2563         (gcc::jit::result::~result): Likewise.
2564         (gcc::jit::playback::result): Likewise.
2565         * jit-recording.h (class gcc::jit::result): Move to new
2566         header jit-result.h.
2567         * jit-result.c: New file, to contain...
2568         (gcc::jit::result::result): Move here from jit-playback.c,
2569         removing erroneous "playback" namespace from comment.
2570         (gcc::jit::result::~result): Likewise.
2571         (gcc::jit::playback::result): Likewise.
2572         * jit-result.h: New file, to contain...
2573         (class gcc::jit::result): Move from jit-recording.h.
2574         * libgccjit.c: Include jit-result.h.
2575         (gcc_jit_result_get_code): Update comment to reflect move
2576         of implementation.
2577         (gcc_jit_result_release): Likewise.
2579 2014-12-01  David Malcolm  <dmalcolm@redhat.com>
2581         PR jit/63854
2582         * docs/examples/tut04-toyvm/toyvm.c
2583         (toyvm_compiled_function): New typedef.
2584         (toyvm_compiled_func) Rename to...
2585         (toyvm_compiled_code) ...this.
2586         (struct toyvm_compiled_function): New struct.
2587         (toyvm_function_compile): Return a toyvm_compiled_function *
2588         rather than a toyvm_compiled_func, so that the caller can fully
2589         clean things up.  Free "funcname".
2590         (test_script): Update for change to toyvm_function_compile.
2591         Clean up the toyvm_compiled_function.
2592         (main): Likewise.
2593         (docs/intro/tutorial04.rst): Update to reflect the above changes,
2594         and to better spell out the lifetime of the compiled code.
2596 2014-12-01  David Malcolm  <dmalcolm@redhat.com>
2598         PR jit/63854
2599         * jit-builtins.c
2600         (gcc::jit::recording::builtins_manager::make_fn_type): Call the
2601         context's new_function_type method, rather than directly creating
2602         a function_type instance.
2603         * jit-recording.c
2604         (gcc::jit::recording::context::new_function_type): New method,
2605         adapted from part of...
2606         (gcc::jit::recording::context::new_function_ptr_type): ...this.
2607         Update to call new_function_type.
2608         * jit-recording.h
2609         (gcc::jit::recording::context::new_function_type): New method.
2611 2014-12-01  David Malcolm  <dmalcolm@redhat.com>
2613         PR jit/63969
2614         * jit-playback.c: Ensure that ctxt_progname is non-NULL.
2616 2014-11-19  David Malcolm  <dmalcolm@redhat.com>
2618         PR jit/63854
2619         * jit-playback.c (gcc::jit::playback::compound_type::set_fields):
2620         Convert param from const vec<playback::field *> & to
2621         const auto_vec<playback::field *> *.
2622         (gcc::jit::playback::context::new_function_type): Convert param
2623         "param_types" from vec<type *> * to const auto_vec<type *> *.
2624         (gcc::jit::playback::context::new_function): Convert param
2625         "params" from vec<param *> * to const auto_vec<param *> *.
2626         (gcc::jit::playback::context::build_call): Convert param "args"
2627         from vec<rvalue *> to const auto_vec<rvalue *> *.
2628         (gcc::jit::playback::context::new_call): Likewise.
2629         (gcc::jit::playback::context::new_call_through_ptr): Likewise.
2630         (wrapper_finalizer): New function.
2631         (gcc::jit::playback::wrapper::operator new): Call the finalizer
2632         variant of ggc_internal_cleared_alloc, supplying
2633         wrapper_finalizer.
2634         (gcc::jit::playback::function::finalizer): New.
2635         (gcc::jit::playback::block::finalizer): New.
2636         (gcc::jit::playback::source_file::finalizer): New.
2637         (gcc::jit::playback::source_line::finalizer): New.
2639         * jit-playback.h
2640         (gcc::jit::playback::context::new_function_type): Convert param
2641         "param_types" from vec<type *> * to const auto_vec<type *> *.
2642         (gcc::jit::playback::context::new_function): Convert param
2643         "params" from vec<param *> * to const auto_vec<param *> *.
2644         (gcc::jit::playback::context::new_call): Convert param
2645         "args" from vec<rvalue *> to const auto_vec<rvalue *> *.
2646         (gcc::jit::playback::context::new_call_through_ptr): Likewise.
2647         (gcc::jit::playback::context::build_call): Likewise.
2648         (gcc::jit::playback::context): Convert fields "m_functions",
2649         "m_source_files", "m_cached_locations" from vec to auto_vec.
2650         (gcc::jit::playback::wrapper::finalizer): New virtual function.
2651         (gcc::jit::playback::compound_type::set_fields): Convert param fro
2652         const vec<playback::field *> & to
2653         const auto_vec<playback::field *> *.
2654         (gcc::jit::playback::function::finalizer): New.
2655         (gcc::jit::playback::block::finalizer): New.
2656         (gcc::jit::playback::source_file::finalizer): New.
2657         (gcc::jit::playback::source_line::finalizer): New.
2659         * jit-recording.c
2660         (gcc::jit::recording::function_type::replay_into): Convert local
2661         from a vec into an auto_vec.
2662         (gcc::jit::recording::fields::replay_into): Likewise.
2663         (gcc::jit::recording::function::replay_into): Likewise.
2664         (gcc::jit::recording::call::replay_into): Likewise.
2665         (gcc::jit::recording::call_through_ptr::replay_into): Likewise.
2667         * jit-recording.h (gcc::jit::recording::context): Convert fields
2668         "m_mementos", "m_compound_types", "m_functions" from vec<> to
2669         auto_vec <>.
2670         (gcc::jit::recording::function_type::get_param_types): Convert
2671         return type from vec<type *> to const vec<type *> &.
2672         (gcc::jit::recording::function_type): Convert field
2673         "m_param_types" from a vec<> to an auto_vec<>.
2674         (gcc::jit::recording::fields): Likewise for field "m_fields".
2675         (gcc::jit::recording::function::get_params): Convert return type
2676         from vec <param *> to const vec<param *> &.
2677         (gcc::jit::recording::function): Convert fields "m_params",
2678         "m_locals", "m_blocks" from vec<> to auto_vec<>.
2679         (gcc::jit::recording::block): Likewise for field "m_statements".
2680         vec<> to auto_vec<>.
2681         (gcc::jit::recording::call): Likewise for field "m_args".
2682         (gcc::jit::recording::call_through_ptr): Likewise.
2684 2014-11-19  David Malcolm  <dmalcolm@redhat.com>
2686         PR jit/63854
2687         * jit-recording.c (recording::function::validate): Convert
2688         "worklist" from vec<> to autovec<> to fix a leak.
2690 2014-11-11  David Malcolm  <dmalcolm@redhat.com>
2692         * ChangeLog.jit: New.
2693         * ChangeLog: New.
2694         * Make-lang.in: New.
2695         * TODO.rst: New.
2696         * config-lang.in: New.
2697         * docs/Makefile: New.
2698         * docs/_build/texinfo/Makefile: New.
2699         * docs/_build/texinfo/factorial.png: New.
2700         * docs/_build/texinfo/libgccjit.texi: New.
2701         * docs/_build/texinfo/sum-of-squares.png: New.
2702         * docs/conf.py: New.
2703         * docs/examples/tut01-hello-world.c: New.
2704         * docs/examples/tut02-square.c: New.
2705         * docs/examples/tut03-sum-of-squares.c: New.
2706         * docs/examples/tut04-toyvm/Makefile: New.
2707         * docs/examples/tut04-toyvm/factorial.toy: New.
2708         * docs/examples/tut04-toyvm/fibonacci.toy: New.
2709         * docs/examples/tut04-toyvm/toyvm.c: New.
2710         * docs/index.rst: New.
2711         * docs/internals/index.rst: New.
2712         * docs/intro/factorial.png: New.
2713         * docs/intro/index.rst: New.
2714         * docs/intro/sum-of-squares.png: New.
2715         * docs/intro/tutorial01.rst: New.
2716         * docs/intro/tutorial02.rst: New.
2717         * docs/intro/tutorial03.rst: New.
2718         * docs/intro/tutorial04.rst: New.
2719         * docs/topics/contexts.rst: New.
2720         * docs/topics/expressions.rst: New.
2721         * docs/topics/functions.rst: New.
2722         * docs/topics/index.rst: New.
2723         * docs/topics/locations.rst: New.
2724         * docs/topics/objects.rst: New.
2725         * docs/topics/results.rst: New.
2726         * docs/topics/types.rst: New.
2727         * dummy-frontend.c: New.
2728         * jit-builtins.c: New.
2729         * jit-builtins.h: New.
2730         * jit-common.h: New.
2731         * jit-playback.c: New.
2732         * jit-playback.h: New.
2733         * jit-recording.c: New.
2734         * jit-recording.h: New.
2735         * libgccjit++.h: New.
2736         * libgccjit.c: New.
2737         * libgccjit.h: New.
2738         * libgccjit.map: New.
2739         * notes.txt: New.
2741 2013-07-26  David Malcolm  <dmalcolm@redhat.com>
2743         * Initial creation
2745 Copyright (C) 2013-2020 Free Software Foundation, Inc.
2747 Copying and distribution of this file, with or without modification,
2748 are permitted in any medium without royalty provided the copyright
2749 notice and this notice are preserved.