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