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