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