testsuite: -mbig/-mlittle only is valid for powerpc-linux.
[official-gcc.git] / gcc / jit / ChangeLog
blob266ecbd17f5fd755285f173141b0af845b79e88d
1 2022-01-17  Martin Liska  <mliska@suse.cz>
3         * config-lang.in: Rename .c names to .cc.
4         * docs/_build/texinfo/libgccjit.texi: Likewise.
5         * docs/internals/index.rst: Likewise.
6         * jit-builtins.cc (builtins_manager::make_builtin_function): Likewise.
7         * jit-playback.cc (fold_const_var): Likewise.
8         (playback::context::~context): Likewise.
9         (new_field): Likewise.
10         (new_bitfield): Likewise.
11         (new_compound_type): Likewise.
12         (playback::compound_type::set_fields): Likewise.
13         (global_set_init_rvalue): Likewise.
14         (load_blob_in_ctor): Likewise.
15         (new_global_initialized): Likewise.
16         (double>): Likewise.
17         (new_string_literal): Likewise.
18         (as_truth_value): Likewise.
19         (build_call): Likewise.
20         (playback::context::build_cast): Likewise.
21         (new_array_access): Likewise.
22         (new_field_access): Likewise.
23         (dereference): Likewise.
24         (postprocess): Likewise.
25         (add_jump): Likewise.
26         (add_switch): Likewise.
27         (build_goto_operands): Likewise.
28         (playback::context::read_dump_file): Likewise.
29         (init_types): Likewise.
30         * jit-recording.cc (recording::context::get_int_type): Likewise.
31         * jit-recording.h: Likewise.
32         * libgccjit.cc (compatible_types): Likewise.
33         (gcc_jit_context_acquire): Likewise.
34         (gcc_jit_context_release): Likewise.
35         (gcc_jit_context_new_child_context): Likewise.
36         (gcc_jit_type_as_object): Likewise.
37         (gcc_jit_context_get_type): Likewise.
38         (gcc_jit_context_get_int_type): Likewise.
39         (gcc_jit_type_get_pointer): Likewise.
40         (gcc_jit_type_get_const): Likewise.
41         (gcc_jit_type_get_volatile): Likewise.
42         (gcc_jit_type_dyncast_array): Likewise.
43         (gcc_jit_type_is_bool): Likewise.
44         (gcc_jit_type_is_pointer): Likewise.
45         (gcc_jit_type_is_integral): Likewise.
46         (gcc_jit_type_dyncast_vector): Likewise.
47         (gcc_jit_type_is_struct): Likewise.
48         (gcc_jit_vector_type_get_num_units): Likewise.
49         (gcc_jit_vector_type_get_element_type): Likewise.
50         (gcc_jit_type_unqualified): Likewise.
51         (gcc_jit_type_dyncast_function_ptr_type): Likewise.
52         (gcc_jit_function_type_get_return_type): Likewise.
53         (gcc_jit_function_type_get_param_count): Likewise.
54         (gcc_jit_function_type_get_param_type): Likewise.
55         (gcc_jit_context_new_array_type): Likewise.
56         (gcc_jit_context_new_field): Likewise.
57         (gcc_jit_field_as_object): Likewise.
58         (gcc_jit_context_new_struct_type): Likewise.
59         (gcc_jit_struct_as_type): Likewise.
60         (gcc_jit_struct_set_fields): Likewise.
61         (gcc_jit_struct_get_field_count): Likewise.
62         (gcc_jit_context_new_union_type): Likewise.
63         (gcc_jit_context_new_function_ptr_type): Likewise.
64         (gcc_jit_param_as_rvalue): Likewise.
65         (gcc_jit_context_new_function): Likewise.
66         (gcc_jit_function_get_return_type): Likewise.
67         (gcc_jit_function_dump_to_dot): Likewise.
68         (gcc_jit_block_get_function): Likewise.
69         (gcc_jit_global_set_initializer_rvalue): Likewise.
70         (gcc_jit_rvalue_get_type): Likewise.
71         (gcc_jit_context_new_rvalue_from_int): Likewise.
72         (gcc_jit_context_one): Likewise.
73         (gcc_jit_context_new_rvalue_from_double): Likewise.
74         (gcc_jit_context_null): Likewise.
75         (gcc_jit_context_new_string_literal): Likewise.
76         (valid_binary_op_p): Likewise.
77         (gcc_jit_context_new_binary_op): Likewise.
78         (gcc_jit_context_new_comparison): Likewise.
79         (gcc_jit_context_new_call): Likewise.
80         (is_valid_cast): Likewise.
81         (gcc_jit_context_new_cast): Likewise.
82         (gcc_jit_object_get_context): Likewise.
83         (gcc_jit_object_get_debug_string): Likewise.
84         (gcc_jit_lvalue_access_field): Likewise.
85         (gcc_jit_rvalue_access_field): Likewise.
86         (gcc_jit_rvalue_dereference_field): Likewise.
87         (gcc_jit_rvalue_dereference): Likewise.
88         (gcc_jit_lvalue_get_address): Likewise.
89         (gcc_jit_lvalue_set_tls_model): Likewise.
90         (gcc_jit_lvalue_set_link_section): Likewise.
91         (gcc_jit_function_new_local): Likewise.
92         (gcc_jit_block_add_eval): Likewise.
93         (gcc_jit_block_add_assignment): Likewise.
94         (is_bool): Likewise.
95         (gcc_jit_block_end_with_conditional): Likewise.
96         (gcc_jit_block_add_comment): Likewise.
97         (gcc_jit_block_end_with_jump): Likewise.
98         (gcc_jit_block_end_with_return): Likewise.
99         (gcc_jit_block_end_with_void_return): Likewise.
100         (case_range_validator::case_range_validator): Likewise.
101         (case_range_validator::validate): Likewise.
102         (case_range_validator::get_wide_int): Likewise.
103         (gcc_jit_block_end_with_switch): Likewise.
104         (gcc_jit_context_set_str_option): Likewise.
105         (gcc_jit_context_set_int_option): Likewise.
106         (gcc_jit_context_set_bool_option): Likewise.
107         (gcc_jit_context_set_bool_allow_unreachable_blocks): Likewise.
108         (gcc_jit_context_set_bool_use_external_driver): Likewise.
109         (gcc_jit_context_add_command_line_option): Likewise.
110         (gcc_jit_context_add_driver_option): Likewise.
111         (gcc_jit_context_enable_dump): Likewise.
112         (gcc_jit_context_compile): Likewise.
113         (gcc_jit_context_compile_to_file): Likewise.
114         (gcc_jit_context_set_logfile): Likewise.
115         (gcc_jit_context_dump_reproducer_to_file): Likewise.
116         (gcc_jit_context_get_first_error): Likewise.
117         (gcc_jit_context_get_last_error): Likewise.
118         (gcc_jit_result_get_code): Likewise.
119         (gcc_jit_result_get_global): Likewise.
120         (gcc_jit_rvalue_set_bool_require_tail_call): Likewise.
121         (gcc_jit_type_get_aligned): Likewise.
122         (gcc_jit_type_get_vector): Likewise.
123         (gcc_jit_function_get_address): Likewise.
124         (gcc_jit_version_patchlevel): Likewise.
125         (gcc_jit_block_add_extended_asm): Likewise.
126         (gcc_jit_extended_asm_as_object): Likewise.
127         (gcc_jit_extended_asm_set_volatile_flag): Likewise.
128         (gcc_jit_extended_asm_set_inline_flag): Likewise.
129         (gcc_jit_extended_asm_add_output_operand): Likewise.
130         (gcc_jit_extended_asm_add_input_operand): Likewise.
131         (gcc_jit_extended_asm_add_clobber): Likewise.
132         * notes.txt: Likewise.
134 2022-01-17  Martin Liska  <mliska@suse.cz>
136         * dummy-frontend.c: Moved to...
137         * dummy-frontend.cc: ...here.
138         * jit-builtins.c: Moved to...
139         * jit-builtins.cc: ...here.
140         * jit-logging.c: Moved to...
141         * jit-logging.cc: ...here.
142         * jit-playback.c: Moved to...
143         * jit-playback.cc: ...here.
144         * jit-recording.c: Moved to...
145         * jit-recording.cc: ...here.
146         * jit-result.c: Moved to...
147         * jit-result.cc: ...here.
148         * jit-spec.c: Moved to...
149         * jit-spec.cc: ...here.
150         * jit-tempdir.c: Moved to...
151         * jit-tempdir.cc: ...here.
152         * jit-w32.c: Moved to...
153         * jit-w32.cc: ...here.
154         * libgccjit.c: Moved to...
155         * libgccjit.cc: ...here.
157 2021-12-28  Martin Liska  <mliska@suse.cz>
159         * docs/_build/texinfo/libgccjit.texi: Replace http:// with https.
160         * docs/cp/index.rst: Likewise.
161         * docs/cp/intro/index.rst: Likewise.
162         * docs/cp/intro/tutorial01.rst: Likewise.
163         * docs/cp/intro/tutorial02.rst: Likewise.
164         * docs/cp/intro/tutorial03.rst: Likewise.
165         * docs/cp/intro/tutorial04.rst: Likewise.
166         * docs/cp/topics/asm.rst: Likewise.
167         * docs/cp/topics/compilation.rst: Likewise.
168         * docs/cp/topics/contexts.rst: Likewise.
169         * docs/cp/topics/expressions.rst: Likewise.
170         * docs/cp/topics/functions.rst: Likewise.
171         * docs/cp/topics/index.rst: Likewise.
172         * docs/cp/topics/locations.rst: Likewise.
173         * docs/cp/topics/objects.rst: Likewise.
174         * docs/cp/topics/types.rst: Likewise.
175         * docs/index.rst: Likewise.
176         * docs/internals/index.rst: Likewise.
177         * docs/intro/index.rst: Likewise.
178         * docs/intro/tutorial01.rst: Likewise.
179         * docs/intro/tutorial02.rst: Likewise.
180         * docs/intro/tutorial03.rst: Likewise.
181         * docs/intro/tutorial04.rst: Likewise.
182         * docs/intro/tutorial05.rst: Likewise.
183         * docs/topics/asm.rst: Likewise.
184         * docs/topics/compatibility.rst: Likewise.
185         * docs/topics/compilation.rst: Likewise.
186         * docs/topics/contexts.rst: Likewise.
187         * docs/topics/expressions.rst: Likewise.
188         * docs/topics/function-pointers.rst: Likewise.
189         * docs/topics/functions.rst: Likewise.
190         * docs/topics/index.rst: Likewise.
191         * docs/topics/locations.rst: Likewise.
192         * docs/topics/objects.rst: Likewise.
193         * docs/topics/performance.rst: Likewise.
194         * docs/topics/types.rst: Likewise.
196 2021-12-20  Martin Liska  <mliska@suse.cz>
198         * libgccjit.c (struct version_info): Rename to jit_version_info.
199         (struct jit_version_info): Likewise.
200         (gcc_jit_version_major): Likewise.
201         (gcc_jit_version_minor): Likewise.
202         (gcc_jit_version_patchlevel): Likewise.
204 2021-12-14  Petter Tomner  <tomner@kth.se>
206         * jit-common.h: New enum
207         * jit-playback.c : Folding an setting intitial
208         (global_new_decl) : Handle const global generation
209         (new_global) : New flag
210         (global_set_init_rvalue) : New
211         (new_ctor) : New
212         (new_global_initialized) : Flag
213         (as_truth_value) : Fold
214         (new_unary_op) : Fold
215         (new_binary_op) : Fold
216         (new_comparison) : Fold
217         (new_array_access) : Fold
218         (new_dereference) : Fold
219         (get_address) : Fold
220         * jit-playback.h :
221         (global_set_init_rvalue) : New
222         (new_ctor) : New
223         * jit-recording.c :
224         * jit-recording.h :
225         (new_global_init_rvalue) : New
226         (new_ctor) : New
227         (ctor) : New, inherits rvalue
228         (global_init_rvalue) : New, inherits memento
229         (type::is_union) : New
230         * libgccjit++.h : New entrypoints, see C-header
231         * libgccjit.c : See .h
232         * libgccjit.h : New entrypoints
233         (gcc_jit_context_new_array_constructor) : New
234         (gcc_jit_context_new_struct_constructor) : New
235         (gcc_jit_context_new_union_constructor) : New
236         (gcc_jit_global_set_initializer_rvalue) : New
237         (LIBGCCJIT_HAVE_CTORS) : New feuture macro
238         * libgccjit.map : New entrypoints added to ABI 19
239         * docs/topics/expressions.rst : Updated docs
241 2021-12-12  Antoni Boucher  <bouanto@zoho.com>
243         PR target/100688
244         * docs/topics/compatibility.rst (LIBGCCJIT_ABI_18): New ABI
245         tag.
246         * docs/topics/expressions.rst: Add documentation for the
247         function gcc_jit_lvalue_set_link_section.
248         * jit-playback.h: New function (set_link_section).
249         * jit-recording.c: New function (set_link_section) and
250         support for setting the link section.
251         * jit-recording.h: New function (set_link_section) and new
252         field m_link_section.
253         * libgccjit.c: New function (gcc_jit_lvalue_set_link_section).
254         * libgccjit.h: New function (gcc_jit_lvalue_set_link_section).
255         * libgccjit.map (LIBGCCJIT_ABI_18): New ABI tag.
257 2021-12-12  Antoni Boucher  <bouanto@zoho.com>
259         PR target/95415
260         * docs/topics/compatibility.rst (LIBGCCJIT_ABI_17): New ABI
261         tag.
262         * docs/topics/expressions.rst: Add document for the function
263         gcc_jit_lvalue_set_tls_model.
264         * jit-playback.h: New function (set_tls_model).
265         * jit-recording.c: New function (set_tls_model), new
266         variables (tls_models and tls_model_enum_strings) and support
267         for setting the tls model.
268         * jit-recording.h: New function (set_tls_model) and new
269         field m_tls_model.
270         * libgccjit.c: New function (gcc_jit_lvalue_set_tls_model).
271         * libgccjit.h: New function (gcc_jit_lvalue_set_tls_model)
272         and new enum (gcc_jit_tls_model).
273         * libgccjit.map (LIBGCCJIT_ABI_17): New ABI tag.
275 2021-12-11  Antoni Boucher  <bouanto@zoho.com>
277         PR target/96066
278         PR target/96067
279         * jit-builtins.c: Implement missing types for builtins.
280         * jit-recording.c:: Allow sending a volatile const void * as
281         argument.
282         * jit-recording.h: New functions (is_volatile, is_const) and
283         allow comparing qualified types.
285 2021-12-10  David Malcolm  <dmalcolm@redhat.com>
287         PR jit/103562
288         * jit-playback.c (gcc::jit::playback::context::new_function): Set
289         DECL_CONTEXT of the result_decl.
291 2021-11-27  Petter Tomner  <tomner@kth.se>
293         * libgccjit.c: %ld -> %zu
295 2021-11-24  Martin Liska  <mliska@suse.cz>
297         * jit-playback.c (function): Initialize m_blocks vector.
299 2021-11-20  Antoni Boucher  <bouanto@zoho.com>
301         PR target/96889
302         * docs/topics/compatibility.rst (LIBGCCJIT_ABI_16): New ABI tag.
303         * docs/topics/functions.rst: Add documentation for the
304         functions gcc_jit_function_get_return_type and
305         gcc_jit_function_get_param_count
306         * docs/topics/types.rst: Add documentation for the functions
307         gcc_jit_function_type_get_return_type,
308         gcc_jit_function_type_get_param_count,
309         gcc_jit_function_type_get_param_type,
310         gcc_jit_type_unqualified, gcc_jit_type_dyncast_array,
311         gcc_jit_type_is_bool,
312         gcc_jit_type_dyncast_function_ptr_type,
313         gcc_jit_type_is_integral, gcc_jit_type_is_pointer,
314         gcc_jit_type_dyncast_vector,
315         gcc_jit_vector_type_get_element_type,
316         gcc_jit_vector_type_get_num_units,
317         gcc_jit_struct_get_field, gcc_jit_type_is_struct,
318         and gcc_jit_struct_get_field_count
319         * libgccjit.c:
320         (gcc_jit_function_get_return_type, gcc_jit_function_get_param_count,
321         gcc_jit_function_type_get_return_type,
322         gcc_jit_function_type_get_param_count,
323         gcc_jit_function_type_get_param_type, gcc_jit_type_unqualified,
324         gcc_jit_type_dyncast_array, gcc_jit_type_is_bool,
325         gcc_jit_type_dyncast_function_ptr_type, gcc_jit_type_is_integral,
326         gcc_jit_type_is_pointer, gcc_jit_type_dyncast_vector,
327         gcc_jit_vector_type_get_element_type,
328         gcc_jit_vector_type_get_num_units, gcc_jit_struct_get_field,
329         gcc_jit_type_is_struct, gcc_jit_struct_get_field_count): New
330         functions.
331         (struct gcc_jit_function_type, struct gcc_jit_vector_type):
332         New types.
333         * libgccjit.h:
334         (gcc_jit_function_get_return_type, gcc_jit_function_get_param_count,
335         gcc_jit_function_type_get_return_type,
336         gcc_jit_function_type_get_param_count,
337         gcc_jit_function_type_get_param_type, gcc_jit_type_unqualified,
338         gcc_jit_type_dyncast_array, gcc_jit_type_is_bool,
339         gcc_jit_type_dyncast_function_ptr_type, gcc_jit_type_is_integral,
340         gcc_jit_type_is_pointer, gcc_jit_type_dyncast_vector,
341         gcc_jit_vector_type_get_element_type,
342         gcc_jit_vector_type_get_num_units, gcc_jit_struct_get_field,
343         gcc_jit_type_is_struct, gcc_jit_struct_get_field_count): New
344         function declarations.
345         (struct gcc_jit_function_type, struct gcc_jit_vector_type):
346         New types.
347         * jit-recording.h: New functions (is_struct and is_vector)
348         * libgccjit.map (LIBGCCJIT_ABI_16): New ABI tag.
350 2021-11-12  David Malcolm  <dmalcolm@redhat.com>
352         PR jit/103199
353         * docs/examples/tut04-toyvm/toyvm.c (toyvm_function_compile):
354         Increase size of buffer.
355         * docs/examples/tut04-toyvm/toyvm.cc
356         (compilation_state::create_function): Likewise.
358 2021-09-10  Petter Tomner  <tomner@kth.se>
360         * jit-playback.c: Moved global var processing to after loc handling.
361           Setting TYPE_NAME for fundamental types.
362           Using common functions for finalizing globals.
363         * jit-playback.h: New method init_types().
364           Changed get_tree_node_for_type() to method.
366 2021-08-19  Iain Sandoe  <iain@sandoe.co.uk>
368         * docs/examples/tut04-toyvm/toyvm.c: Include jit-dejagnu.h.
369         * docs/examples/tut04-toyvm/toyvm.cc: Likewise.
370         * jit-dejagnu.h: New file, imported from dejagnu-1.6.2 and
371         patched for this application.
373 2021-08-18  Iain Sandoe  <iain@sandoe.co.uk>
375         PR jit/100613
376         * Make-lang.in: Provide clauses for Darwin hosts.
378 2021-07-18  Antoni Boucher  <bouanto@zoho.com>
380         PR target/95498
381         * jit-playback.c (convert): Add support to handle truncation and
382         extension in the convert function.
384 2021-05-19  Martin Liska  <mliska@suse.cz>
386         PR testsuite/100658
387         * libgccjit.c (gcc_jit_context_new_function): Fix typos.
389 2021-03-24  Matthias Klose  <doko@ubuntu.com>
391         * Make-lang.in (jit.sphinx.html, jit.sphinx.pdf): Use $(mkinstalldirs),
392         (jit.install-headers): Depend on installdirs.
394 2021-02-19  David Malcolm  <dmalcolm@redhat.com>
396         PR jit/99126
397         * jit-builtins.c
398         (gcc::jit::builtins_manager::get_builtin_function_by_id):
399         Update assertion to reject BUILT_IN_NONE.
400         (gcc::jit::builtins_manager::ensure_optimization_builtins_exist):
401         New.
402         * jit-builtins.h
403         (gcc::jit::builtins_manager::ensure_optimization_builtins_exist):
404         New decl.
405         * jit-playback.c (gcc::jit::playback::context::replay): Call it.
406         Remove redundant conditional on bm.
408 2021-01-14  David Malcolm  <dmalcolm@redhat.com>
410         * docs/cp/index.rst: Remove "Alpha" warning.
411         * docs/index.rst: Likewise.
412         * docs/_build/texinfo/libgccjit.texi: Regenerate
414 2020-11-25  Martin Sebor  <msebor@redhat.com>
416         PR bootstrap/94982
417         * jit-recording.c (recording::function::dump_to_dot): Avoid
418         -Wformat-diag.
419         (recording::block::dump_to_dot): Same.
421 2020-11-20  Jakub Jelinek  <jakub@redhat.com>
423         PR other/97911
424         * Make-lang.in (jit.serial): Change from goal to a
425         variable.
426         (.PHONY): Drop jit.serial and jit.prev.
427         ($(LIBGCCJIT_FILENAME)): Depend on $(jit.serial) rather than
428         jit.serial.
430 2020-11-18  Jakub Jelinek  <jakub@redhat.com>
432         * Make-lang.in (jit.serial): New goal.
433         (.PHONY): Add jit.serial jit.prev.
434         ($(LIBGCCJIT_FILENAME)): Depend on jit.prev.  Call LINK_PROGRESS.
436 2020-11-12  David Malcolm  <dmalcolm@redhat.com>
438         PR jit/87291
439         * docs/cp/topics/asm.rst: New file.
440         * docs/cp/topics/index.rst (Topic Reference): Add it.
441         * docs/topics/asm.rst: New file.
442         * docs/topics/compatibility.rst (LIBGCCJIT_ABI_15): New.
443         * docs/topics/functions.rst (Statements): Add link to extended
444         asm.
445         * docs/topics/index.rst (Topic Reference): Add asm.rst.
446         * docs/topics/objects.rst: Add gcc_jit_extended_asm to ASCII art.
447         * docs/_build/texinfo/Makefile: Regenerate.
448         * docs/_build/texinfo/libgccjit.texi: Regenerate.
449         * jit-common.h (gcc::jit::recording::extended_asm): New forward
450         decl.
451         (gcc::jit::recording::top_level_asm): Likewise.
452         * jit-playback.c: Include "stmt.h".
453         (build_string): New.
454         (gcc::jit::playback::context::new_string_literal): Disambiguate
455         build_string call.
456         (gcc::jit::playback::context::add_top_level_asm): New.
457         (build_operand_chain): New.
458         (build_clobbers): New.
459         (build_goto_operands): New.
460         (gcc::jit::playback::block::add_extended_asm): New.
461         * jit-playback.h (gcc::jit::playback::context::add_top_level_asm):
462         New decl.
463         (struct gcc::jit::playback::asm_operand): New struct.
464         (gcc::jit::playback::block::add_extended_asm): New decl.
465         * jit-recording.c (gcc::jit::recording::context::dump_to_file):
466         Dump top-level asms.
467         (gcc::jit::recording::context::add_top_level_asm): New.
468         (gcc::jit::recording::block::add_extended_asm): New.
469         (gcc::jit::recording::block::end_with_extended_asm_goto): New.
470         (gcc::jit::recording::asm_operand::asm_operand): New.
471         (gcc::jit::recording::asm_operand::print): New.
472         (gcc::jit::recording::asm_operand::make_debug_string): New.
473         (gcc::jit::recording::output_asm_operand::write_reproducer): New.
474         (gcc::jit::recording::output_asm_operand::print): New.
475         (gcc::jit::recording::input_asm_operand::write_reproducer): New.
476         (gcc::jit::recording::input_asm_operand::print): New.
477         (gcc::jit::recording::extended_asm::add_output_operand): New.
478         (gcc::jit::recording::extended_asm::add_input_operand): New.
479         (gcc::jit::recording::extended_asm::add_clobber): New.
480         (gcc::jit::recording::extended_asm::replay_into): New.
481         (gcc::jit::recording::extended_asm::make_debug_string): New.
482         (gcc::jit::recording::extended_asm::write_flags): New.
483         (gcc::jit::recording::extended_asm::write_clobbers): New.
484         (gcc::jit::recording::extended_asm_simple::write_reproducer): New.
485         (gcc::jit::recording::extended_asm::maybe_populate_playback_blocks):
486         New.
487         (gcc::jit::recording::extended_asm_goto::extended_asm_goto): New.
488         (gcc::jit::recording::extended_asm_goto::replay_into): New.
489         (gcc::jit::recording::extended_asm_goto::write_reproducer): New.
490         (gcc::jit::recording::extended_asm_goto::get_successor_blocks):
491         New.
492         (gcc::jit::recording::extended_asm_goto::maybe_print_gotos): New.
493         (gcc::jit::recording::extended_asm_goto::maybe_populate_playback_blocks):
494         New.
495         (gcc::jit::recording::top_level_asm::top_level_asm): New.
496         (gcc::jit::recording::top_level_asm::replay_into): New.
497         (gcc::jit::recording::top_level_asm::make_debug_string): New.
498         (gcc::jit::recording::top_level_asm::write_to_dump): New.
499         (gcc::jit::recording::top_level_asm::write_reproducer): New.
500         * jit-recording.h
501         (gcc::jit::recording::context::add_top_level_asm): New decl.
502         (gcc::jit::recording::context::m_top_level_asms): New field.
503         (gcc::jit::recording::block::add_extended_asm): New decl.
504         (gcc::jit::recording::block::end_with_extended_asm_goto): New
505         decl.
506         (gcc::jit::recording::asm_operand): New class.
507         (gcc::jit::recording::output_asm_operand): New class.
508         (gcc::jit::recording::input_asm_operand): New class.
509         (gcc::jit::recording::extended_asm): New class.
510         (gcc::jit::recording::extended_asm_simple): New class.
511         (gcc::jit::recording::extended_asm_goto): New class.
512         (gcc::jit::recording::top_level_asm): New class.
513         * libgccjit++.h (gccjit::extended_asm): New forward decl.
514         (gccjit::context::add_top_level_asm): New.
515         (gccjit::block::add_extended_asm): New.
516         (gccjit::block::end_with_extended_asm_goto): New.
517         (gccjit::extended_asm): New class.
518         (gccjit::extended_asm::extended_asm): New ctors.
519         (gccjit::extended_asm::set_volatile_flag): New.
520         (gccjit::extended_asm::set_inline_flag): New.
521         (gccjit::extended_asm::add_output_operand): New.
522         (gccjit::extended_asm::add_input_operand): New.
523         (gccjit::extended_asm::add_clobber): New.
524         (gccjit::extended_asm::get_inner_extended_asm): New.
525         * libgccjit.c (struct gcc_jit_extended_asm): New.
526         (jit_error): Make "loc" param take a gcc::jit::recording::location *
527         rather than a gcc_jit_location *.
528         (gcc_jit_block_add_extended_asm): New entrypoint.
529         (gcc_jit_block_end_with_extended_asm_goto): New entrypoint.
530         (gcc_jit_extended_asm_as_object): New entrypoint.
531         (gcc_jit_extended_asm_set_volatile_flag): New entrypoint.
532         (gcc_jit_extended_asm_set_inline_flag): New entrypoint.
533         (gcc_jit_extended_asm_add_output_operand): New entrypoint.
534         (gcc_jit_extended_asm_add_clobber): New entrypoint.
535         (gcc_jit_context_add_top_level_asm): New entrypoint.
536         * libgccjit.h: Add gcc_jit_extended_asm to ASCII art.
537         (gcc_jit_extended_asm): New typedef.
538         (LIBGCCJIT_HAVE_ASM_STATEMENTS): New define.
539         (gcc_jit_block_add_extended_asm): New entrypoint.
540         (gcc_jit_block_end_with_extended_asm_goto): New entrypoint.
541         (gcc_jit_extended_asm_as_object): New entrypoint.
542         (gcc_jit_extended_asm_set_volatile_flag): New entrypoint.
543         (gcc_jit_extended_asm_set_inline_flag): New entrypoint.
544         (gcc_jit_extended_asm_add_output_operand): New entrypoint.
545         (gcc_jit_extended_asm_add_input_operand): New entrypoint.
546         (gcc_jit_extended_asm_add_clobber): New entrypoint.
547         (gcc_jit_context_add_top_level_asm): New entrypoint.
548         * libgccjit.map (LIBGCCJIT_ABI_15): New.
550 2020-11-12  David Malcolm  <dmalcolm@redhat.com>
552         * jit-recording.c (recording::context::new_string): Add "escaped"
553         param and use it when creating the new recording::string instance.
554         (recording::string::string): Add "escaped" param and use it to
555         initialize m_escaped.
556         (recording::string::make_debug_string): Replace check that first
557         char is double-quote with use of m_escaped.  Fix escaping of
558         '\t' and '\n'.  Set "escaped" on the result.
559         * jit-recording.h (recording::context::new_string): Add "escaped"
560         param.
561         (recording::string::string): Add "escaped" param.
562         (recording::string::m_escaped): New field.
564 2020-11-12  David Malcolm  <dmalcolm@redhat.com>
566         * libgccjit.h: Fix typo in comment.
568 2020-09-14  Andrea Corallo  <andrea.corallo@arm.com>
570         * docs/_build/texinfo/libgccjit.texi: Regenerate.
572 2020-09-11  Andrea Corallo  <andrea.corallo@arm.com>
574         * docs/topics/compatibility.rst (LIBGCCJIT_ABI_14): New ABI tag.
575         * docs/topics/expressions.rst (gcc_jit_global_set_initializer):
576         Document new entry point in section 'Global variables'.
577         * jit-playback.c (global_new_decl, global_finalize_lvalue): New
578         method.
579         (playback::context::new_global): Make use of global_new_decl,
580         global_finalize_lvalue.
581         (load_blob_in_ctor): New template function in use by the
582         following.
583         (playback::context::new_global_initialized): New method.
584         * jit-playback.h (class context): Decl 'new_global_initialized',
585         'global_new_decl', 'global_finalize_lvalue'.
586         (lvalue::set_initializer): Add implementation.
587         * jit-recording.c (recording::memento_of_get_pointer::get_size)
588         (recording::memento_of_get_type::get_size): Add implementation.
589         (recording::global::write_initializer_reproducer): New function in
590         use by 'recording::global::write_reproducer'.
591         (recording::global::replay_into)
592         (recording::global::write_to_dump)
593         (recording::global::write_reproducer): Handle
594         initialized case.
595         * jit-recording.h (class type): Decl 'get_size' and
596         'num_elements'.
597         * libgccjit++.h (class lvalue): Declare new 'set_initializer'
598         method.
599         (class lvalue): Decl 'is_global' and 'set_initializer'.
600         (class global) Decl 'write_initializer_reproducer'. Add
601         'm_initializer', 'm_initializer_num_bytes' fields.  Implement
602         'set_initializer'. Add a destructor to free 'm_initializer'.
603         * libgccjit.c (gcc_jit_global_set_initializer): New function.
604         * libgccjit.h (gcc_jit_global_set_initializer): New function
605         declaration.
606         * libgccjit.map (LIBGCCJIT_ABI_14): New ABI tag.
608 2020-08-28  Martin Sebor  <msebor@redhat.com>
610         * jit-recording.c (recording::switch_::make_debug_string): Add argument
611         to a call.
613 2020-08-22  Andrea Corallo  <andrea.corallo@arm.com>
615         * libgccjit.c:
616         (gcc_jit_context_new_rvalue_from_int)
617         (gcc_jit_context_new_rvalue_from_long)
618         (gcc_jit_context_new_rvalue_from_double)
619         (gcc_jit_context_new_rvalue_from_ptr): Update function heading
620         comments.
622 2020-06-16  Nicolas Bértolo  <nicolasbertolo@gmail.com>
624         * Make-lang.in: Always define version, minor and release
625         numbers. Create the Windows shared library as
626         libgccjit-$(LIBGCCJIT_VERSION_NUM).dll.
628 2020-06-03  David Malcolm  <dmalcolm@redhat.com>
630         PR jit/95306
631         * jit-builtins.c (builtins_manager::make_primitive_type):
632         Implement BT_CONST_VOLATILE_PTR.
634 2020-06-02  David Malcolm  <dmalcolm@redhat.com>
636         PR jit/95426
637         * dummy-frontend.c: Include "options.h", "stringpool.h", and
638         "attribs.h".
639         (ATTR_EXCL): New, copied from lto/lto-lang.c.
640         (attr_noreturn_exclusions): Likewise.
641         (attr_returns_twice_exclusions): Likewise.
642         (attr_const_pure_exclusions): Likewise.
643         (jit_attribute_table): Likewise, copied from lto_attribute_table.
644         (jit_format_attribute_table): Likewise, copied from
645         lto_format_attribute_table.
646         (handle_noreturn_attribute): New, copied from lto/lto-lang.c.
647         (handle_leaf_attribute): Likewise.
648         (handle_const_attribute): Likewise.
649         (handle_malloc_attribute): Likewise.
650         (handle_pure_attribute): Likewise.
651         (handle_novops_attribute): Likewise.
652         (get_nonnull_operand): Likewise.
653         (handle_nonnull_attribute): Likewise.
654         (handle_nothrow_attribute): Likewise.
655         (handle_sentinel_attribute): Likewise.
656         (handle_type_generic_attribute): Likewise.
657         (handle_transaction_pure_attribute): Likewise.
658         (handle_returns_twice_attribute): Likewise.
659         (handle_patchable_function_entry_attribute): Likewise.
660         (ignore_attribute): Likewise.
661         (handle_format_attribute): Likewise.
662         (handle_format_arg_attribute): Likewise.
663         (handle_fnspec_attribute): Likewise.
664         (LANG_HOOKS_COMMON_ATTRIBUTE_TABLE): Define.
665         (LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE): Define.
667 2020-05-28  Nicolas Bértolo  <nicolasbertolo@gmail.com>
669         * Make-lang.in: Remove extra slash. Build libgccjit.dll and its
670         import library in Windows.
671         * config-lang.in: Update comment about --enable-host-shared.
672         * jit-w32.h: New file.
673         * jit-w32.c: New file.
674         (print_last_error): New function that prints the error
675         string corresponding to GetLastError().
676         (get_TOKEN_USER_current_user): Helper function used for getting
677         the SID belonging to the current user.
678         (create_directory_for_current_user): Helper function to create
679         a directory with permissions such that only the current user can
680         access it.
681         (win_mkdtemp): Create a temporary directory using Windows APIs.
682         * jit-playback.c: Do not chmod files in Windows. Use LoadLibrary,
683         FreeLibrary and GetProcAddress instead of libdl.
684         * jit-result.h, jit-result.c: Introduce result::handle_t to
685         abstract over the types used for dynamic library handles.
686         * jit-tempdir.c: Do not use mkdtemp() in Windows, use
687         win_mkdtemp().
689 2020-05-27  David Malcolm  <dmalcolm@redhat.com>
691         PR jit/95314
692         * dummy-frontend.c (LANG_HOOKS_DEEP_UNSHARING): Define to be true.
693         * jit-playback.h (gcc::jit::playback::rvalue): Mark tree node with
694         TREE_VISITED.
696 2020-05-27  Tom Tromey  <tromey@gcc.gnu.org>
698         PR jit/91330
699         * docs/conf.py (texinfo_documents): Set description.
700         * docs/_build/texinfo/libgccjit.texi: Regenerate.
702 2020-05-26  David Malcolm  <dmalcolm@redhat.com>
704         PR jit/95306
705         * docs/topics/functions.rst
706         (gcc_jit_context_get_builtin_function): Document.
707         * docs/_build/texinfo/libgccjit.texi: Regenerate.
708         * dummy-frontend.c (jit_langhook_global_bindings_p): Remove
709         gcc_unreachable.
710         * jit-builtins.c (type_names): New array.
711         (get_string_for_type_id): New function.
712         (gcc::jit::builtins_manager::make_primitive_type): Show name of
713         type in error messages.  Update cases to reflect the order in
714         builtin-types.def.  Implement cases for BT_INT8, BT_INT16,
715         BT_UINT8, BT_CONST_PTR, BT_VOLATILE_PTR, BT_INT_PTR, BT_FLOAT_PTR,
716         BT_CONST_DOUBLE_PTR, BT_SIZE, BT_CONST_SIZE.
718 2020-05-26  David Malcolm  <dmalcolm@redhat.com>
720         * docs/topics/compatibility.rst: Fix underline.
721         Fix missing labels.
722         * docs/topics/types.rst: Fix missing blank line.
723         * docs/_build/texinfo/libgccjit.texi: Regenerate.
725 2020-05-26  David Malcolm  <dmalcolm@redhat.com>
727         PR jit/95296
728         * docs/topics/expressions.rst (Unary Operations): Document that
729         result_type of gcc_jit_context_new_unary_op must be a numeric type.
730         (Binary Operations): Likewise for gcc_jit_context_new_binary_op.
731         (Global variables): Document that "type" of
732         gcc_jit_context_new_global must be non-`void`.
733         * docs/topics/function-pointers.rst
734         (gcc_jit_context_new_function_ptr_type): Document that the
735         param_types must be non-void, but that return_type may be.
736         * docs/topics/functions.rst (Params): Document that
737         gcc_jit_context_new_param's type must be non-void.
738         (Functions): Likewise for gcc_jit_function_new_local.
739         * docs/topics/types.rst (gcc_jit_context_new_array_type): Document
740         that the type must be non-void.
741         (gcc_jit_context_new_field): Likewise.
742         * docs/_build/texinfo/Makefile: Regenerate.
743         * docs/_build/texinfo/libgccjit.texi: Regenerate.
744         * libgccjit.c (gcc_jit_context_new_array_type): Fail if
745         element_type is void.
746         (gcc_jit_context_new_field): Likewise for "type".
747         (gcc_jit_context_new_function_ptr_type): Likewise for each
748         element of param_types.
749         (gcc_jit_context_new_param): Likewise for "type".
750         (gcc_jit_context_new_global): Likewise.
751         (gcc_jit_function_new_local): Likewise.
752         (gcc_jit_type_get_aligned): Likewise.
754 2020-03-31  Andrea Corallo  <andrea.corallo@arm.com>
755             David Malcolm  <dmalcolm@redhat.com>
757         * docs/topics/compatibility.rst (LIBGCCJIT_ABI_13): New ABI tag
758         plus add version paragraph.
759         * libgccjit++.h (namespace gccjit::version): Add new namespace.
760         * libgccjit.c (gcc_jit_version_major, gcc_jit_version_minor)
761         (gcc_jit_version_patchlevel): New functions.
762         * libgccjit.h (LIBGCCJIT_HAVE_gcc_jit_version): New macro.
763         (gcc_jit_version_major, gcc_jit_version_minor)
764         (gcc_jit_version_patchlevel): New functions.
765         * libgccjit.map (LIBGCCJIT_ABI_13) New ABI tag.
767 2020-03-23  Andrea Corallo  <andrea.corallo@arm.com>
769         * jit-playback.h
770         (gcc::jit::playback::context m_recording_ctxt): Remove
771         m_char_array_type_node field.
772         * jit-playback.c
773         (playback::context::context) Remove m_char_array_type_node from member
774         initializer list.
775         (playback::context::new_string_literal) Fix logic to handle string
776         length > 200.
778 2020-01-01  Jakub Jelinek  <jakub@redhat.com>
780         Update copyright years.
782 2019-11-29  Julian Brown  <julian@codesourcery.com>
784         * jit-builtins.c (BT_DFLOAT32_PTR, BT_DFLOAT64_PTR, BT_DFLOAT128_PTR):
785         Remove commented-out cases.
787 2019-11-20  David Malcolm  <dmalcolm@redhat.com>
789         PR jit/92483
790         * jit-playback.c (gcc::jit::playback::context::make_fake_args):
791         Update GCC_JIT_BOOL_OPTION_SELFCHECK_GC for new --param syntax.
793 2019-08-13  Richard Sandiford  <richard.sandiford@arm.com>
795         PR middle-end/91421
796         * jit-playback.c (new_function): Use set_decl_built_in_function.
798 2019-07-22  Andrea Corallo  <andrea.corallo@arm.com>
800         * jit-recording.c (unary_op_reproducer_strings): Make it extern.
801         (binary_op_reproducer_strings): Likewise.
802         * jit-recording.h (unary_op_reproducer_strings): Likewise.
803         (binary_op_reproducer_strings): Likewise.
804         * libgccjit.c (gcc_jit_context_new_unary_op): Check result_type to be a
805         numeric type.
806         * libgccjit.c (gcc_jit_context_new_binary_op): Improve error message.
808 2019-07-04  Andrea Corallo  <andrea.corallo@arm.com>
810         * libgccjit.c (gcc_jit_context_new_binary_op): Check result_type to be a
811         numeric type.
813 2019-07-04  Andrea Corallo  <andrea.corallo@arm.com>
815         * docs/topics/compatibility.rst (LIBGCCJIT_ABI_12): New ABI tag.
816         * docs/topics/types.rst: Add gcc_jit_context_new_bitfield.
817         * jit-common.h (namespace recording): Add class bitfield.
818         * jit-playback.c:
819         (DECL_C_BIT_FIELD, SET_DECL_C_BIT_FIELD): Add macros.
820         (playback::context::new_bitfield): New method.
821         (playback::compound_type::set_fields): Add bitfield support.
822         (playback::lvalue::mark_addressable): Was jit_mark_addressable make this
823         a method of lvalue plus return a bool to communicate success.
824         (playback::lvalue::get_address): Check for jit_mark_addressable return
825         value.
826         * jit-playback.h (new_bitfield): New method.
827         (class bitfield): New class.
828         (class lvalue): Add jit_mark_addressable method.
829         * jit-recording.c (recording::context::new_bitfield): New method.
830         (recording::bitfield::replay_into): New method.
831         (recording::bitfield::write_to_dump): Likewise.
832         (recording::bitfield::make_debug_string): Likewise.
833         (recording::bitfield::write_reproducer): Likewise.
834         * jit-recording.h (class context): Add new_bitfield method.
835         (class field): Make it derivable by class bitfield.
836         (class bitfield): Add new class.
837         * libgccjit++.h (class context): Add new_bitfield method.
838         * libgccjit.c (struct gcc_jit_bitfield): New structure.
839         (gcc_jit_context_new_bitfield): New function.
840         * libgccjit.h
841         (LIBGCCJIT_HAVE_gcc_jit_context_new_bitfield) New macro.
842         (gcc_jit_context_new_bitfield): New function.
843         * libgccjit.map (LIBGCCJIT_ABI_12) New ABI tag.
845 2019-03-21  Jakub Jelinek  <jakub@redhat.com>
847         * jit-recording.c (reproducer::m_set_identifiers): Use false as Lazy
848         in hash_set template param.
850 2019-02-05  Andrea Corallo  <andrea.corallo@arm.com>
852         * docs/topics/compatibility.rst (LIBGCCJIT_ABI_11): New ABI tag.
853         * docs/topics/contexts.rst (Additional driver options): New
854         section.
855         * jit-playback.c (invoke_driver): Add call to append_driver_options.
856         * jit-recording.c: Within namespace gcc::jit...
857         (recording::context::~context): Free the optnames within
858         m_driver_options.
859         (recording::context::add_driver_option): New method.
860         (recording::context::append_driver_options): New method.
861         (recording::context::dump_reproducer_to_file): Add driver
862         options.
863         * jit-recording.h: Within namespace gcc::jit...
864         (recording::context::add_driver_option): New method.
865         (recording::context::append_driver_options): New method.
866         (recording::context::m_driver_options): New field.
867         * libgccjit++.h (gccjit::context::add_driver_option): New
868         method.
869         * libgccjit.c (gcc_jit_context_add_driver_option): New API
870         entrypoint.
871         * libgccjit.h (gcc_jit_context_add_driver_option): New API
872         entrypoint.
873         (LIBGCCJIT_HAVE_gcc_jit_context_add_driver_option): New
874         macro.
875         * libgccjit.map (LIBGCCJIT_ABI_11): New ABI tag.
877 2019-01-01  Jakub Jelinek  <jakub@redhat.com>
879         Update copyright years.
881 2018-11-15  David Malcolm  <dmalcolm@redhat.com>
883         PR other/19165
884         * dummy-frontend.c (jit_begin_diagnostic): Add diagnostic_t param.
886 2018-11-13  David Malcolm  <dmalcolm@redhat.com>
888         * jit-playback.c: Replace "source_location" with "location_t".
890 2018-10-17  David Malcolm  <dmalcolm@redhat.com>
892         * Make-lang.in (selftest-jit): New.
894 2018-06-28  Martin Liska  <mliska@suse.cz>
896         * jit-playback.c: Include opt-suggestions.h.
898 2018-06-28  Martin Liska  <mliska@suse.cz>
900         * jit-playback.c (class auto_argvec): Moved to vec.h.
901         (auto_argvec::~auto_argvec): Likewise.
902         (compile): Use the renamed name.
903         (invoke_driver): Likewise.
905 2018-03-21  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
907         PR jit/84288
908         * Make-lang.in ($(LIBGCCJIT_FILENAME)): Add $(EXTRA_GCC_LIBS).
910 2018-03-09  David Malcolm  <dmalcolm@redhat.com>
911             Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
913         PR jit/64089
914         PR jit/84288
915         * Make-lang.in (COMMA): New.
916         (LIBGCCJIT_VERSION_SCRIPT_OPTION): New.
917         (LIBGCCJIT_SONAME_OPTION): New.
918         (jit): Move --version-script and -soname linker options to the
919         above.
921 2018-01-25  David Malcolm  <dmalcolm@redhat.com>
923         PR jit/81672
924         * jit-recording.h (gcc::jit::recording::union_): Remove fields
925         "m_loc" and "m_name".
927 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
929         Update copyright years.
931 2017-12-19  Jakub Jelinek  <jakub@redhat.com>
933         * jit-playback.c (get_type, playback::compile_to_file::copy_file,
934         playback::context::acquire_mutex): Replace Yoda conditions with
935         typical order conditions.
936         * libgccjit.c (gcc_jit_context_new_struct_type,
937         gcc_jit_struct_set_fields, gcc_jit_context_new_union_type,
938         gcc_jit_context_new_function, gcc_jit_timer_pop): Likewise.
939         * jit-builtins.c (matches_builtin): Likewise.
940         * jit-recording.c (recording::compound_type::set_fields,
941         recording::fields::write_reproducer, recording::rvalue::set_scope,
942         recording::function::validate): Likewise.
943         * jit-logging.c (logger::decref): Likewise.
945 2017-11-30  Jakub Jelinek  <jakub@redhat.com>
947         * jit-recording.c
948         (recording::memento_of_new_rvalue_from_const <long>::write_reproducer):
949         Use ; instead of ;;.
951 2017-11-28  Jakub Jelinek  <jakub@redhat.com>
953         * jit-playback.c (add_switch): Build SWITCH_EXPR using build2 instead
954         of build3.  Formatting fixes.  Adjust funciton comment.
956 2017-11-23  Tom de Vries  <tom@codesourcery.com>
958         * libgccjit.c (RETURN_NULL_IF_FAIL_NONNULL_NUMERIC_TYPE): Wrap in
959         JIT_{BEGIN,END}_STMT.
961 2017-10-31  David Malcolm  <dmalcolm@redhat.com>
963         * docs/internals/index.rst (Running the test suite): Document
964         PRESERVE_EXECUTABLES.
965         (Running under valgrind): Add markup to RUN_UNDER_VALGRIND.
966         * docs/_build/texinfo/libgccjit.texi: Regenerate.
968 2017-10-04  David Malcolm  <dmalcolm@redhat.com>
970         * docs/cp/topics/expressions.rst (Vector expressions): New
971         section.
972         * docs/topics/compatibility.rst (LIBGCCJIT_ABI_10): New ABI tag.
973         * docs/topics/expressions.rst (Vector expressions): New section.
974         * docs/topics/types.rst (gcc_jit_type_get_vector): Add link to
975         gcc_jit_context_new_rvalue_from_vector.
976         * docs/_build/texinfo/libgccjit.texi: Regenerate.
977         * jit-common.h (gcc::jit:recording::vector_type): New forward
978         decl.
979         * jit-playback.c
980         (gcc::jit::playback::context::new_rvalue_from_vector): New method.
981         * jit-playback.h
982         (gcc::jit::playback::context::new_rvalue_from_vector): New method.
983         * jit-recording.c: In namespace gcc::jit::
984         (class comma_separated_string): New class.
985         (comma_separated_string::comma_separated_string): New ctor,
986         adapted from recording::call::make_debug_string.
987         (comma_separated_string::~comma_separated_string): New dtor.
988         In namespace gcc::jit::recording::
989         (context::new_rvalue_from_vector): New method.
990         (type::get_vector): Update for renaming of memento_of_get_vector.
991         (class memento_of_get_vector): Rename to...
992         (class vector_type): ..this.
993         (memento_of_new_rvalue_from_vector::memento_of_new_rvalue_from_vector):
994         New ctor.
995         (memento_of_new_rvalue_from_vector::replay_into): New method.
996         (memento_of_new_rvalue_from_vector::visit_children): New method.
997         (memento_of_new_rvalue_from_vector::make_debug_string): New
998         method.
999         (memento_of_new_rvalue_from_vector::write_reproducer): New method.
1000         (call::make_debug_string): Split out arg-printing code into ctor
1001         for comma_separated_string.
1002         * jit-recording.h: In namespace gcc::jit::recording::
1003         (context::new_rvalue_from_vector): New method.
1004         (type::dyn_cast_vector_type): New virtual function.
1005         (class memento_of_get_vector): Rename to...
1006         (class vector_type): ...this.
1007         (vector_type::unqualified): Remove this vfunc override in favor
1008         of...
1009         (vector_type::get_element_type): ...this new method.
1010         (vector_type::get_num_units): New method.
1011         (vector_type::dyn_cast_vector_type): New vfunc override.
1012         (class memento_of_new_rvalue_from_vector): New class.
1013         * libgccjit++.h (gccjit::context::new_rvalue): Add overload for
1014         vector of rvalue.
1015         * libgccjit.c (gcc_jit_context_new_binary_op): Strip off type
1016         qualifications when checking that both operands have same type.
1017         (gcc_jit_context_new_rvalue_from_vector): New API entrypoint.
1018         * libgccjit.h
1019         (LIBGCCJIT_HAVE_gcc_jit_context_new_rvalue_from_vector): New
1020         macro.
1021         (gcc_jit_context_new_rvalue_from_vector): New API entrypoint.
1022         * libgccjit.map (LIBGCCJIT_ABI_10): New ABI tag.
1024 2017-09-28  David Malcolm  <dmalcolm@redhat.com>
1026         * docs/topics/expressions.rst (Function calls): Add link to
1027         gcc_jit_context_new_function_ptr_type.
1028         (Function pointers): Convert to cross-references to
1029         function-pointers.rst, moving material there.
1030         * docs/topics/function-pointers.rst: New page.
1031         * docs/topics/index.rst: Add function-pointers.rst.
1032         * docs/topics/types.rst (Function pointer types): New section.
1033         * docs/_build/texinfo/libgccjit.texi: Regenerate.
1035 2017-09-28  David Malcolm  <dmalcolm@redhat.com>
1037         * jit-recording.c
1038         (gcc::jit::recording::function_type::is_same_type_as): New function.
1039         * jit-recording.h: In namespace gcc::jit::recording::
1040         (type::accepts_writes_from): Use is_same_type_as rather than pointer
1041         equality.
1042         (type::is_same_type_as): New virtual function.
1043         (function_type::is_same_type_as): New override.
1045 2017-09-27  David Malcolm  <dmalcolm@redhat.com>
1047         * docs/cp/topics/expressions.rst (Function pointers): New section.
1048         * docs/topics/compatibility.rst (LIBGCCJIT_ABI_9): New tag.
1049         * docs/topics/expressions.rst (Function pointers): New section.
1050         * docs/_build/texinfo/libgccjit.texi: Regenerate.
1051         * jit-common.h (class gcc::jit::recording::function_pointer): New
1052         forward decl.
1053         * jit-playback.c (gcc::jit::playback::function::get_address): New
1054         method.
1055         * jit-playback.h (gcc::jit::playback::function::get_address): New
1056         method decl.
1057         * jit-recording.c: Within namespace gcc::jit::recording...
1058         (function::function): Initialize new field "m_fn_ptr_type".
1059         (function::get_address): New method.
1060         (function_pointer::replay_into): New method.
1061         (function_pointer::visit_children): New method.
1062         (function_pointer::make_debug_string): New method.
1063         (function_pointer::write_reproducer): New method.
1064         * jit-recording.h: Within namespace gcc::jit::recording...
1065         (function::get_address): New method.
1066         (function): Add field "m_fn_ptr_type".
1067         (class function_pointer): New subclass of rvalue.
1068         * libgccjit++.h (gccjit::function::get_address): New method.
1069         * libgccjit.c (gcc_jit_function_get_address): New function.
1070         * libgccjit.h (LIBGCCJIT_HAVE_gcc_jit_function_get_address): New
1071         macro.
1072         (gcc_jit_function_get_address): New API entrypoint.
1073         * libgccjit.map (LIBGCCJIT_ABI_9): New tag.
1075 2017-09-14  David Malcolm  <dmalcolm@redhat.com>
1077         PR jit/82174
1078         * jit-builtins.c (matches_builtin): Ignore entries with a NULL
1079         name.
1081 2017-08-18  David Malcolm  <dmalcolm@redhat.com>
1083         PR tree-optimization/46805
1084         * dummy-frontend.c (jit_langhook_parse_file): Handle vector types.
1086 2017-08-18  David Malcolm  <dmalcolm@redhat.com>
1088         * jit-recording.c (class gcc::jit::reproducer): Rename field
1089         "m_identifiers" to "m_map_memento_to_identifier".  Add field
1090         "m_set_identifiers" and struct hash_traits for it.
1091         (gcc::jit::reproducer::reproducer): Update for above.
1092         (convert_to_identifier): New function.
1093         (gcc::jit::reproducer::ensure_identifier_is_unique): New method.
1094         (gcc::jit::reproducer::make_identifier): Avoid appending the %p
1095         unless necessary for uniqueness.  Update for field renaming.
1096         (gcc::jit::reproducer::get_identifier): Update for field renaming.
1098 2017-08-09  David Malcolm  <dmalcolm@redhat.com>
1100         * docs/cp/topics/types.rst (Vector types): New section.
1101         * docs/topics/compatibility.rst (LIBGCCJIT_ABI_8): New tag.
1102         * docs/topics/types.rst (gcc_jit_context_get_type): Fix typo in
1103         example.
1104         (Vector types): New section.
1105         * docs/_build/texinfo/libgccjit.texi: Regenerate.
1106         * jit-playback.c (gcc::jit::playback::type::get_vector): New
1107         method.
1108         * jit-playback.h (gcc::jit::playback::type::get_vector): New
1109         method.
1110         * jit-recording.c: In namespace gcc::jit::recording::
1111         (type::get_vector): New method.
1112         (memento_of_get_aligned::write_reproducer): Fix typo
1113         in leading comment.
1114         (memento_of_get_vector::replay_into): New method.
1115         (memento_of_get_vector::make_debug_string): New method.
1116         (memento_of_get_vector::write_reproducer): New method.
1117         * jit-recording.h: In namespace gcc::jit::recording::
1118         (type::get_vector): New
1119          method.
1120         (class memento_of_get_vector): New class.
1121         * libgccjit++.h (gccjit::type::get_vector): New method.
1122         * libgccjit.c (gcc_jit_type_get_vector): New public entrypoint.
1123         * libgccjit.h (LIBGCCJIT_HAVE_gcc_jit_type_get_vector): New
1124         define.
1125         (gcc_jit_type_get_vector): New decl.
1126         * libgccjit.map (LIBGCCJIT_ABI_8): New ABI tag.
1128 2017-07-05  Richard Sandiford  <richard.sandiford@linaro.org>
1129             Alan Hayward  <alan.hayward@arm.com>
1130             David Sherwood  <david.sherwood@arm.com>
1132         * dummy-frontend.c (jit_langhook_type_for_mode): Remove "enum" before
1133         "machine_mode".
1135 2017-04-24  David Malcolm  <dmalcolm@redhat.com>
1137         * docs/cp/topics/types.rst (gccjit::type::get_const): Remove
1138         comment.
1139         (gccjit::type::get_aligned): Add.
1140         * docs/topics/compatibility.rst: Add LIBGCCJIT_ABI_7.
1141         * docs/topics/types.rst: Add gcc_jit_type_get_aligned.
1142         * docs/_build/texinfo/libgccjit.texi: Regenerate.
1143         * jit-playback.c (gcc::jit::playback::type::get_aligned): New
1144         method.
1145         * jit-playback.h (gcc::jit::playback::type::get_aligned): New
1146         method.
1147         * jit-recording.c: Within namespace gcc::jit::recording...
1148         (type::get_aligned): New method.
1149         (memento_of_get_aligned::replay_into): New method.
1150         (memento_of_get_aligned::make_debug_string): New method.
1151         (memento_of_get_aligned::write_reproducer): New method.
1152         * jit-recording.h: Within namespace gcc::jit::recording...
1153         (type::get_aligned): New method.
1154         (type::accepts_writes_from): Strip off qualifications from
1155         this when comparing pointer equality.
1156         (decorated_type): New subclass of type, subsuming the
1157         commonality between memento_of_get_const and
1158         memento_of_get_volatile.
1159         (memento_of_get_const): Make a subclass of decorated_type,
1160         rather than type.
1161         (memento_of_get_volatile): Likewise.
1162         (memento_of_get_aligned): Likewise.
1163         * libgccjit++.h: Within namespace gccjit...
1164         (type::get_const): New method.
1165         (type::get_aligned): New method.
1166         * libgccjit.c (gcc_jit_type_get_aligned): New function.
1167         * libgccjit.h (gcc_jit_type_get_aligned): New decl.
1168         * libgccjit.map (LIBGCCJIT_ABI_7): New
1169         (gcc_jit_type_get_aligned): Add.
1171 2017-01-19  David Malcolm  <dmalcolm@redhat.com>
1173         * dummy-frontend.c (jit_langhook_type_for_size): Delete.
1174         (LANG_HOOKS_TYPE_FOR_SIZE): Don't redefine.
1176 2017-01-18  David Malcolm  <dmalcolm@redhat.com>
1178         * dummy-frontend.c (jit_langhook_type_for_size): Implement, using
1179         lto's lto_type_for_size.
1181 2017-01-01  Jakub Jelinek  <jakub@redhat.com>
1183         Update copyright years.
1185 2016-05-20  David Malcolm  <dmalcolm@redhat.com>
1187         * docs/topics/compatibility.rst: Add LIBGCCJIT_ABI_6.
1188         * docs/topics/expressions.rst (Function calls): Add documentation
1189         of gcc_jit_rvalue_set_bool_require_tail_call.
1190         * docs/_build/texinfo/libgccjit.texi: Regenerate.
1191         * jit-common.h (gcc::jit::recording::base_call): Add forward decl.
1192         * jit-playback.c: Within namespace gcc::jit::playback...
1193         (context::build_call) Add "require_tail_call" param and use it
1194         to set CALL_EXPR_MUST_TAIL_CALL.
1195         (context::new_call): Add "require_tail_call" param.
1196         (context::new_call_through_ptr): Likewise.
1197         * jit-playback.h: Within namespace gcc::jit::playback...
1198         (context::new_call: Add "require_tail_call" param.
1199         (context::new_call_through_ptr): Likewise.
1200         (context::build_call): Likewise.
1201         * jit-recording.c: Within namespace gcc::jit::recording...
1202         (base_call::base_call): New constructor.
1203         (base_call::write_reproducer_tail_call): New method.
1204         (call::call): Update for inheritance from base_call.
1205         (call::replay_into): Provide m_require_tail_call to call
1206         to new_call.
1207         (call::write_reproducer): Call write_reproducer_tail_call.
1208         (call_through_ptr::call_through_ptr): Update for inheritance from
1209         base_call.
1210         (call_through_ptr::replay_into): Provide m_require_tail_call to call
1211         to new_call_through_ptr.
1212         (recording::call_through_ptr::write_reproducer): Call
1213         write_reproducer_tail_call.
1214         * jit-recording.h: Within namespace gcc::jit::recording...
1215         (rvalue::dyn_cast_base_call): New virtual function.
1216         (class base_call): New subclass of class rvalue.
1217         (class call): Inherit from base_call rather than directly from
1218         rvalue, moving get_precedence and m_args to base_call.
1219         (class call_through_ptr): Likewise.
1220         * libgccjit.c (gcc_jit_rvalue_set_bool_require_tail_call): New
1221         function.
1222         * libgccjit.h
1223         (LIBGCCJIT_HAVE_gcc_jit_rvalue_set_bool_require_tail_call): New
1224         macro.
1225         (gcc_jit_rvalue_set_bool_require_tail_call): New function.
1226         * libgccjit.map (LIBGCCJIT_ABI_6): New.
1227         (gcc_jit_rvalue_set_bool_require_tail_call): Add.
1229 2016-05-17  David Malcolm  <dmalcolm@redhat.com>
1231         * dummy-frontend.c: Include diagnostic.h.
1232         (jit_begin_diagnostic): New function.
1233         (jit_end_diagnostic): New function.
1234         (jit_langhook_init): Register jit_begin_diagnostic
1235         and jit_end_diagnostic with the global_dc.
1236         * jit-playback.c: Include diagnostic.h.
1237         (gcc::jit::playback::context::add_diagnostic): New method.
1238         * jit-playback.h (struct diagnostic_context): Add forward
1239         declaration.
1240         (gcc::jit::playback::context::add_diagnostic): New method.
1242 2016-05-17  David Malcolm  <dmalcolm@redhat.com>
1244         * docs/topics/expressions.rst (Function calls): Document
1245         gcc_jit_context_new_call_through_ptr.
1246         * docs/_build/texinfo/libgccjit.texi: Regenerate.
1248 2016-05-13  David Malcolm  <dmalcolm@redhat.com>
1250         * jit-playback.h: Within namespace gcc:jit::playback...
1251         (compile_to_memory::postprocess): Mark with FINAL OVERRIDE.
1252         (compile_to_file::postprocess): Likewise.
1253         (function::finalizer): Likewise.
1254         (block::finalizer): Likewise.
1255         (source_file::finalizer): Likewise.
1256         (source_line::finalizer): Likewise.
1257         * jit-recording.c (gcc::jit::rvalue_usage_validator):: Likewise.
1258         * jit-recording.h: Within namespace gcc::jit::recording...
1259         (string::replay_into): Mark with FINAL OVERRIDE.
1260         (string::make_debug_string): Likewise.
1261         (string::write_reproducer): Likewise.
1262         (location::replay_into): Likewise.
1263         (location::dyn_cast_location): Likewise.
1264         (location::make_debug_string): Likewise.
1265         (location::write_reproducer): Likewise.
1266         (memento_of_get_type::dereference): Likewise.
1267         (memento_of_get_type::accepts_writes_from): Likewise.
1268         (memento_of_get_type::is_int): Likewise.
1269         (memento_of_get_type::is_float): Likewise.
1270         (memento_of_get_type::is_bool): Likewise.
1271         (memento_of_get_type::is_pointer): Likewise.
1272         (memento_of_get_type::is_array): Likewise.
1273         (memento_of_get_type::is_void): Likewise.
1274         (memento_of_get_type::replay_into): Likewise.
1275         (memento_of_get_type::make_debug_string): Likewise.
1276         (memento_of_get_type::write_reproducer): Likewise.
1277         (memento_of_get_pointer::dereference): Likewise.
1278         (memento_of_get_pointer::accepts_writes_from): Likewise.
1279         (memento_of_get_pointer::replay_into): Likewise.
1280         (memento_of_get_pointer::is_int): Likewise.
1281         (memento_of_get_pointer::is_float): Likewise.
1282         (memento_of_get_pointer::is_bool): Likewise.
1283         (memento_of_get_pointer::is_pointer): Likewise.
1284         (memento_of_get_pointer::is_array): Likewise.
1285         (memento_of_get_pointer::make_debug_string): Likewise.
1286         (memento_of_get_pointer::write_reproducer): Likewise.
1287         (memento_of_get_const::dereference): Likewise.
1288         (memento_of_get_const::accepts_writes_from): Likewise.
1289         (memento_of_get_const::unqualified): Likewise.
1290         (memento_of_get_const::is_int): Likewise.
1291         (memento_of_get_const::is_float): Likewise.
1292         (memento_of_get_const::is_bool): Likewise.
1293         (memento_of_get_const::is_pointer): Likewise.
1294         (memento_of_get_const::is_array): Likewise.
1295         (memento_of_get_const::void replay_into): Likewise;
1296         (memento_of_get_const::make_debug_string): Likewise.
1297         (memento_of_get_const::write_reproducer): Likewise.
1298         (memento_of_get_volatile::dereference): Likewise.
1299         (memento_of_get_volatile::unqualified): Likewise.
1300         (memento_of_get_volatile::is_int): Likewise.
1301         (memento_of_get_volatile::is_float): Likewise.
1302         (memento_of_get_volatile::is_bool): Likewise.
1303         (memento_of_get_volatile::is_pointer): Likewise.
1304         (memento_of_get_volatile::is_array): Likewise.
1305         (memento_of_get_volatile::replay_into): Likewise;
1306         (memento_of_get_volatile::make_debug_string): Likewise.
1307         (memento_of_get_volatile::write_reproducer): Likewise.
1308         (array_type::dereference): Likewise.
1309         (array_type::is_int): Likewise.
1310         (array_type::is_float): Likewise.
1311         (array_type::is_bool): Likewise.
1312         (array_type::is_pointer): Likewise.
1313         (array_type::is_array): Likewise.
1314         (array_type::replay_into): Likewise;
1315         (array_type::make_debug_string): Likewise.
1316         (array_type::write_reproducer): Likewise.
1317         (function_type::dereference): Likewise.
1318         (function_type::function_dyn_cast_function_type): Likewise.
1319         (function_type::function_as_a_function_type): Likewise.
1320         (function_type::is_int): Likewise.
1321         (function_type::is_float): Likewise.
1322         (function_type::is_bool): Likewise.
1323         (function_type::is_pointer): Likewise.
1324         (function_type::is_array): Likewise.
1325         (function_type::replay_into): Likewise;
1326         (function_type::make_debug_string): Likewise.
1327         (function_type::write_reproducer): Likewise.
1328         (field::replay_into): Likewise;
1329         (field::write_to_dump): Likewise.
1330         (field::make_debug_string): Likewise.
1331         (field::write_reproducer): Likewise.
1332         (compound_type::dereference): Likewise.
1333         (compound_type::is_int): Likewise.
1334         (compound_type::is_float): Likewise.
1335         (compound_type::is_bool): Likewise.
1336         (compound_type::is_pointer): Likewise.
1337         (compound_type::is_array): Likewise.
1338         (compound_type::has_known_size): Likewise.
1339         (struct_::dyn_cast_struct): Likewise.
1340         (struct_::replay_into): Likewise.
1341         (struct_::access_as_type): Likewise.
1342         (struct_::make_debug_string): Likewise.
1343         (struct_::write_reproducer): Likewise.
1344         (fields::replay_into): Likewise.
1345         (fields::write_to_dump): Likewise.
1346         (fields::make_debug_string): Likewise.
1347         (fields::write_reproducer): Likewise.
1348         (union_::replay_into): Likewise.
1349         (union_::make_debug_string): Likewise.
1350         (union_::write_reproducer): Likewise.
1351         (lvalue::access_as_rvalue): Mark with OVERRIDE.
1352         (param::replay_into): Mark with FINAL OVERRIDE.
1353         (param::visit_children): Likewise.
1354         (param::dyn_cast_param): Likewise.
1355         (param::access_as_rvalue): Likewise.
1356         (param::access_as_lvalue): Likewise.
1357         (param::make_debug_string): Likewise.
1358         (param::write_reproducer): Likewise.
1359         (param::get_precedence): Likewise.
1360         (function::replay_into): Likewise.
1361         (function::write_to_dump): Likewise.
1362         (function::make_debug_string): Likewise.
1363         (function::write_reproducer): Likewise.
1364         (block::write_to_dump): Likewise.
1365         (block::make_debug_string): Likewise.
1366         (block::write_reproducer): Likewise.
1367         (block::replay_into): Likewise.
1368         (global::replay_into): Likewise;
1369         (global::visit_children): Likewise.
1370         (global::write_to_dump): Likewise.
1371         (global::make_debug_string): Likewise.
1372         (global::write_reproducer): Likewise.
1373         (global::get_precedence): Likewise.
1374         (memento_of_new_rvalue_from_const::replay_into): Likewise.
1375         (memento_of_new_rvalue_from_const::visit_children): Likewise.
1376         (memento_of_new_rvalue_from_const::is_constant): Likewise.
1377         (memento_of_new_rvalue_from_const::get_wide_int): Likewise.
1378         (memento_of_new_rvalue_from_const::make_debug_string): Likewise.
1379         (memento_of_new_rvalue_from_const::write_reproducer): Likewise.
1380         (memento_of_new_rvalue_from_const::get_precedence): Likewise.
1381         (memento_of_new_string_literal::replay_into): Likewise.
1382         (memento_of_new_string_literal::visit_children): Likewise.
1383         (memento_of_new_string_literal::make_debug_string): Likewise.
1384         (memento_of_new_string_literal::write_reproducer): Likewise.
1385         (memento_of_new_string_literal::get_precedence): Likewise.
1386         (unary_op::replay_into): Likewise.
1387         (unary_op::visit_children): Likewise.
1388         (unary_op::make_debug_string): Likewise.
1389         (unary_op::write_reproducer): Likewise.
1390         (unary_op::get_precedence): Likewise.
1391         (binary_op::replay_into): Likewise.
1392         (binary_op::visit_children): Likewise.
1393         (binary_op::make_debug_string): Likewise.
1394         (binary_op::write_reproducer): Likewise.
1395         (binary_op::get_precedence): Likewise.
1396         (comparison::replay_into): Likewise.
1397         (comparison::visit_children): Likewise.
1398         (comparison::make_debug_string): Likewise.
1399         (comparison::write_reproducer): Likewise.
1400         (comparison::get_precedence): Likewise.
1401         (cast::replay_into): Likewise.
1402         (cast::visit_children): Likewise.
1403         (cast::make_debug_string): Likewise.
1404         (cast::write_reproducer): Likewise.
1405         (cast::get_precedence): Likewise.
1406         (call::replay_into): Likewise.
1407         (call::visit_children): Likewise.
1408         (call::make_debug_string): Likewise.
1409         (call::write_reproducer): Likewise.
1410         (call::get_precedence): Likewise.
1411         (call_through_ptr::replay_into): Likewise.
1412         (call_through_ptr::visit_children): Likewise.
1413         (call_through_ptr::make_debug_string): Likewise.
1414         (call_through_ptr::write_reproducer): Likewise.
1415         (call_through_ptr::get_precedence): Likewise.
1416         (array_access::replay_into): Likewise.
1417         (array_access::visit_children): Likewise.
1418         (array_access::make_debug_string): Likewise.
1419         (array_access::write_reproducer): Likewise.
1420         (array_access::get_precedence): Likewise.
1421         (access_field_of_lvalue::replay_into): Likewise.
1422         (access_field_of_lvalue::visit_children): Likewise.
1423         (access_field_of_lvalue::make_debug_string): Likewise.
1424         (access_field_of_lvalue::write_reproducer): Likewise.
1425         (access_field_of_lvalue::get_precedence): Likewise.
1426         (access_field_rvalue::replay_into): Likewise.
1427         (access_field_rvalue::visit_children): Likewise.
1428         (access_field_rvalue::make_debug_string): Likewise.
1429         (access_field_rvalue::write_reproducer): Likewise.
1430         (access_field_rvalue::get_precedence): Likewise.
1431         (dereference_field_rvalue::replay_into): Likewise.
1432         (dereference_field_rvalue::visit_children): Likewise.
1433         (dereference_field_rvalue::make_debug_string): Likewise.
1434         (dereference_field_rvalue::write_reproducer): Likewise.
1435         (dereference_field_rvalue::get_precedence): Likewise.
1436         (dereference_rvalue::replay_into): Likewise.
1437         (dereference_rvalue::visit_children): Likewise.
1438         (dereference_rvalue::make_debug_string): Likewise.
1439         (dereference_rvalue::write_reproducer): Likewise.
1440         (dereference_rvalue::get_precedence): Likewise.
1441         (get_address_of_lvalue::replay_into): Likewise.
1442         (get_address_of_lvalue::visit_children): Likewise.
1443         (get_address_of_lvalue::make_debug_string): Likewise.
1444         (get_address_of_lvalue::write_reproducer): Likewise.
1445         (get_address_of_lvalue::get_precedence): Likewise.
1446         (local::replay_into): Likewise.
1447         (local::visit_children): Likewise.
1448         (local::write_to_dump): Likewise.
1449         (local::make_debug_string): Likewise.
1450         (local::write_reproducer): Likewise.
1451         (local::get_precedence): Likewise.
1452         (statement::write_to_dump): Likewise.
1453         (eval::replay_into): Likewise.
1454         (eval::make_debug_string): Likewise.
1455         (eval::write_reproducer): Likewise.
1456         (assignment::replay_into): Likewise.
1457         (assignment::make_debug_string): Likewise.
1458         (assignment::write_reproducer): Likewise.
1459         (assignment_op::replay_into): Likewise.
1460         (assignment_op::make_debug_string): Likewise.
1461         (assignment_op::write_reproducer): Likewise.
1462         (comment::replay_into): Likewise.
1463         (comment::make_debug_string): Likewise.
1464         (comment::write_reproducer): Likewise.
1465         (conditional::replay_into): Likewise.
1466         (conditional::get_successor_blocks): Likewise.
1467         (conditional::make_debug_string): Likewise.
1468         (conditional::write_reproducer): Likewise.
1469         (jump::replay_into): Likewise.
1470         (jump::get_successor_blocks): Likewise.
1471         (jump::make_debug_string): Likewise.
1472         (jump::write_reproducer): Likewise.
1473         (return_::replay_into): Likewise.
1474         (return_::get_successor_blocks): Likewise.
1475         (return_::make_debug_string): Likewise.
1476         (return_::write_reproducer): Likewise.
1477         (case_::replay_into): Likewise.
1478         (case_::write_reproducer): Likewise.
1479         (case_::make_debug_string): Likewise.
1480         (switch_::replay_into): Likewise.
1481         (switch_::get_successor_blocks): Likewise.
1482         (switch_::make_debug_string): Likewise.
1483         (switch_::write_reproducer): Likewise.
1485 2016-02-08  David Malcolm  <dmalcolm@redhat.com>
1487         * dummy-frontend.c (jit_langhook_init): Remove
1488         second argument to build_common_tree_nodes to
1489         track r233218.
1491 2016-01-23  Iain Buclaw  <ibuclaw@gdcproject.org>
1493         * jit-playback.c: Include pthread.h.
1495 2016-01-19  David Malcolm  <dmalcolm@redhat.com>
1497         PR jit/69144
1498         * jit-playback.c (gcc::jit::playback::compile_to_file::postprocess):
1499         Potentially add the temporary artifact to the tempdir's list of
1500         tempfiles needing additional cleanup.
1501         (gcc::jit::playback::context::extract_any_requested_dumps): Likewise
1502         for the dumpfile.
1503         * jit-tempdir.c (gcc::jit::tempdir::~tempdir): Clean up additional
1504         tempfiles.
1505         * jit-tempdir.h (gcc::jit::tempdir::add_temp_file): New method.
1506         (gcc::jit::tempdir::m_tempfiles): New field.
1507         * docs/cp/intro/tutorial04.rst: Update for changes to toyvm.cc.
1508         * docs/examples/tut04-toyvm/toyvm.cc (class compilation_result):
1509         New.
1510         (toyvm_function::compile): Change return type from function ptr
1511         to a compilation_result.
1512         (toyvm_function::get_function_name): New accessor.
1513         (toyvm_function::m_funcname): New field.
1514         (get_function_name): Convert to...
1515         (toyvm_function::make_function_name): ...this new method.
1516         (toyvm_function::parse): Call make_function_name.
1517         (toyvm_function::compile): Convert return type from function ptr
1518         to a compilation_result.  Use get_function_name.
1519         (compilation_state::compile): Convert return type from
1520         gcc_jit_result * to a compilation_result.
1521         (test_script): Update for above changes, extracting the code from
1522         the compilation_result.
1523         (main): Likewise.
1524         * docs/_build/texinfo/libgccjit.texi: Regenerate.
1526 2016-01-04  Jakub Jelinek  <jakub@redhat.com>
1528         Update copyright years.
1530 2015-11-11  Andrew MacLeod  <amacleod@redhat.com>
1532         * dummy-frontend.c: Remove unused header files.
1533         * jit-builtins.c: Likewise.
1534         * jit-playback.c: Likewise.
1535         * jit-recording.c: Likewise.
1536         * jit-spec.c: Likewise.
1537         * libgccjit.c: Likewise.
1539 2015-11-07  Richard Sandiford  <richard.sandiford@arm.com>
1541         * jit-builtins.c: Don't undef DEF_BUILTIN.
1543 2015-10-29  Andrew MacLeod  <amacleod@redhat.com>
1545         * dummy-frontend.c: Reorder #include's and remove duplicates.
1546         * jit-builtins.c: Likewise.
1547         * jit-playback.c: Likewise.
1548         * jit-recording.c: Likewise.
1549         * libgccjit.c: Likewise.
1551 2015-10-13  Jakub Jelinek  <jakub@redhat.com>
1553         * jit-builtins.c (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10,
1554         DEF_FUNCTION_TYPE_11): Define.
1555         * jit-builtins.h (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10,
1556         DEF_FUNCTION_TYPE_11): Define.
1558 2015-09-30  Thomas Schwinge  <thomas@codesourcery.com>
1559             Ulrich Drepper  <drepper@gmail.com>
1561         * jit-builtins.h: Undefine DEF_FUNCTION_TYPE_VAR_6 after use.
1563 2015-09-30  Matthias Klose  <doko@ubuntu.com>
1565         * jit-builtins.h Define DEF_FUNCTION_TYPE_VAR_6,
1566         remove DEF_FUNCTION_TYPE_VAR_11.
1567         * jit-builtins.c (builtins_manager::make_type): Define and handle
1568         DEF_FUNCTION_TYPE_VAR_6, remove DEF_FUNCTION_TYPE_VAR_11.
1570 2015-08-25  David Malcolm  <dmalcolm@redhat.com>
1572         * docs/cp/topics/contexts.rst
1573         (gccjit::context::set_bool_use_external_driver): New.
1574         * docs/internals/test-hello-world.exe.log.txt: Update.
1575         * docs/topics/compatibility.rst (LIBGCCJIT_ABI_5): New.
1576         * docs/topics/contexts.rst
1577         (gcc_jit_context_set_bool_use_external_driver): New.
1578         * jit-common.h (enum inner_bool_option): Add
1579         INNER_BOOL_OPTION_USE_EXTERNAL_DRIVER.
1580         * jit-playback.c (gcc_driver_name): New global.
1581         (gcc:jit::playback::context::invoke_driver): Split out second
1582         half into...
1583         (gcc::jit::playback::context::invoke_embedded_driver): ...this new
1584         function, and...
1585         (gcc::jit::playback::context::invoke_external_driver): ...this new
1586         function.
1587         * jit-playback.h
1588         (gcc::jit::playback::context::get_inner_bool_option): New.
1589         (gcc::jit::playback::context::invoke_embedded_driver): New.
1590         (gcc::jit::playback::context::invoke_external_driver): New.
1591         * jit-recording.c (inner_bool_option_reproducer_strings):
1592         Add entry for INNER_BOOL_OPTION_USE_EXTERNAL_DRIVER.
1593         * libgccjit++.h
1594         (gccjit::context::set_bool_use_external_driver): New.
1595         * libgccjit.c (gcc_jit_context_set_bool_use_external_driver): New.
1596         * libgccjit.h (gcc_jit_context_set_bool_use_external_driver): New.
1597         (LIBGCCJIT_HAVE_gcc_jit_context_set_bool_use_external_driver):
1598         New.
1599         * libgccjit.map (LIBGCCJIT_ABI_5): New.
1600         * notes.txt: Show invocation of embedded copy of driver.
1601         * docs/internals/test-hello-world.exe.log.txt: Update
1603 2015-08-13  David Malcolm  <dmalcolm@redhat.com>
1605         * jit-playback.c (invoke_driver): On OS X, add
1606         "-Wl,-undefined,dynamic_lookup" to the driver arguments.
1608 2015-08-03  David Malcolm  <dmalcolm@redhat.com>
1610         * docs/topics/compatibility.rst (LIBGCCJIT_ABI_4): New.
1611         * docs/topics/contexts.rst (GCC_JIT_BOOL_OPTION_DUMP_SUMMARY):
1612         We no longer show a profile.
1613         * docs/topics/index.rst (Topic Reference): Add performance.rst.
1614         * docs/topics/performance.rst: New file.
1615         * docs/_build/texinfo/libgccjit.texi: Regenerate.
1616         * jit-playback.c (gcc::jit::playback::context::compile): Add timer
1617         param when constructing the "toplev" instance.
1618         (gcc::jit::playback::context::acquire_mutex): Add timer param when
1619         constructing auto_timevar instance.
1620         (gcc::jit::playback::context::make_fake_args): If we have a timer,
1621         add "-ftime-report".
1622         (gcc::jit::playback::context::invoke_driver): Add timer param when
1623         constructing auto_timevar instance.
1624         (gcc::jit::playback::context::dlopen_built_dso): Likewise.
1625         * jit-playback.h (gcc::jit::playback::context::get_timer): New accessor.
1626         * jit-recording.c: Include timevar.h.
1627         (gcc::jit::recording::context::context): Initialize field "m_timer".
1628         * jit-recording.h: Add forward declaration of class timer.
1629         (gcc::jit::recording::context::set_timer): New method.
1630         (gcc::jit::recording::context::get_timer): New method.
1631         (gcc::jit::recording::context::m_timer): New field.
1632         * libgccjit++.h (gccjit::timer): New class.
1633         (gccjit::auto_time): New class.
1634         (gccjit::context::set_timer): New method.
1635         (gccjit::context::get_timer): New.
1636         (gccjit::timer::timer): New.
1637         (gccjit::timer::push): New.
1638         (gccjit::timer::pop): New.
1639         (timer::print): New.
1640         (timer::get_inner_timer): New.
1641         (timer::release): New.
1642         (auto_time::auto_time): New.
1643         (auto_time::~auto_time): New.
1644         * libgccjit.c: Include timevar.h.
1645         (struct gcc_jit_timer): New.
1646         (gcc_jit_timer_new): New function.
1647         (gcc_jit_timer_release): New function.
1648         (gcc_jit_context_set_timer): New function.
1649         (gcc_jit_context_get_timer): New function.
1650         (gcc_jit_timer_push): New function.
1651         (gcc_jit_timer_pop): New function.
1652         (gcc_jit_timer_print): New function.
1653         * libgccjit.h (LIBGCCJIT_HAVE_TIMING_API): New macro.
1654         (gcc_jit_timer): New typedef.
1655         (gcc_jit_timer_new): New function.
1656         (gcc_jit_timer_release): New function.
1657         (gcc_jit_context_set_timer): New function.
1658         (gcc_jit_context_get_timer): New function.
1659         (gcc_jit_timer_push): New function.
1660         (gcc_jit_timer_pop): New function.
1661         (gcc_jit_timer_print): New function.
1662         * libgccjit.map (LIBGCCJIT_ABI_4): New.
1663         (gcc_jit_timer_new): New function.
1664         (gcc_jit_timer_release): New function.
1665         (gcc_jit_context_set_timer): New function.
1666         (gcc_jit_context_get_timer): New function.
1667         (gcc_jit_timer_push): New function.
1668         (gcc_jit_timer_pop): New function.
1669         (gcc_jit_timer_print): New function.
1671 2015-07-23  David Malcolm  <dmalcolm@redhat.com>
1673         * jit-playback.c (invoke_driver): Convert local "argvec"
1674         to an auto_argvec, so that it owns copies of the strings,
1675         rather than borrows them, updating ADD_ARG to use xstrdup
1676         and special-casing the NULL terminator to avoid
1677         xstrdup (NULL).  Call add_multilib_driver_arguments at the front
1678         of the arguments.
1679         (MULTILIB_DEFAULTS): Provide a default definition.
1680         (multilib_defaults_raw): New constant array.
1681         (gcc::jit::playback::context::add_multilib_driver_arguments): New
1682         method.
1683         * jit-playback.h
1684         (gcc::jit::playback::context::add_multilib_driver_arguments): New
1685         method.
1686         * docs/internals/test-hello-world.exe.log.txt: Update.
1687         * docs/_build/texinfo/libgccjit.texi: Regenerate.
1689 2015-07-16  David Malcolm  <dmalcolm@redhat.com>
1691         * docs/internals/index.rst (Overview of code structure): Add note
1692         that the implementation is in C++, despite the .c extension.
1693         (Submitting patches): New subsection.
1694         * docs/_build/texinfo/libgccjit.texi: Regenerate.
1696 2015-07-09  Andrew MacLeod  <amacleod@redhat.com>
1698         * dummy-frontend.c: Adjust includes for flags.h changes.
1699         * jit-common.h: Likewise.
1700         * jit-playback.c: Likewise.
1702 2015-07-08  David Malcolm  <dmalcolm@redhat.com>
1704         PR jit/66783
1705         * libgccjit.c (gcc_jit_context_new_field): Show name of field in
1706         "unknown size" error message.
1707         (gcc_jit_struct_set_fields): Show name of struct in error message.
1708         (gcc_jit_context_new_global): Show name of global in
1709         "unknown size" error message.
1710         (gcc_jit_function_new_local): Likewise for local.
1712 2015-07-07  Andrew MacLeod  <amacleod@redhat.com>
1714         * dummy-frontend.c: Adjust includes.
1715         * jit-common.h: Likewise.
1716         * jit-playback.c: Likewise.
1718 2015-07-07  David Malcolm  <dmalcolm@redhat.com>
1720         PR jit/66783
1721         * jit-recording.h: Within namespace gcc:jit::recording...
1722         (type::has_known_size): New virtual function.
1723         (struct_has_known_size): New function.
1724         * libgccjit.c (gcc_jit_context_new_field): Verify that the type
1725         has a known size.
1726         (gcc_jit_context_new_global): Likewise.
1727         (gcc_jit_function_new_local): Likewise.
1729 2015-07-07  David Malcolm  <dmalcolm@redhat.com>
1731         PR jit/66779
1732         * dummy-frontend.c (jit_langhook_type_for_mode): Ensure that we
1733         handle modes QI, HI, SI, DI, TI.
1735 2015-07-01  David Malcolm  <dmalcolm@redhat.com>
1737         PR jit/66700
1738         * jit-playback.c (jit_mark_addressable): New function.
1739         (gcc::jit::playback::lvalue::get_address): Call
1740         jit_mark_addressable on the underlying tree.
1742 2015-07-01  David Malcolm  <dmalcolm@redhat.com>
1744         * docs/topics/types.rst (gcc_jit_context_new_union_type): Add
1745         documentation.
1746         * docs/_build/texinfo/libgccjit.texi: Regenerate.
1748 2015-07-01  David Malcolm  <dmalcolm@redhat.com>
1750         * docs/topics/contexts.rst (gcc_jit_context_set_bool_option):
1751         Clarify lack of lifetime requirements on (const char *) parameter.
1752         * docs/topics/expressions.rst
1753         (gcc_jit_context_new_string_literal): Likewise.
1754         (gcc_jit_context_new_global): Likewise.
1755         * docs/topics/functions.rst (gcc_jit_context_new_param): Likewise.
1756         (gcc_jit_context_new_function): Likewise.
1757         (gcc_jit_function_new_block): Likewise.
1758         (gcc_jit_block_add_comment): Likewise.
1759         * docs/topics/locations.rst (gcc_jit_context_new_location):
1760         Likewise.
1761         * docs/topics/types.rst (gcc_jit_context_new_field): Likewise.
1762         (gcc_jit_context_new_struct_type): Likewise.
1763         * docs/_build/texinfo/libgccjit.texi: Regenerate.
1765 2015-06-30  David Malcolm  <dmalcolm@redhat.com>
1767         * docs/cp/topics/functions.rst (Blocks): Add switch statements to
1768         list of ways to terminate a block.
1769         (gccjit::block::end_with_switch): Add function description.
1770         (gccjit::case_): Add class.
1771         (gccjit::context::new_case): Add function description.
1772         * docs/cp/topics/objects.rst: Add "case_" to class hierarchy.
1773         * docs/topics/compatibility.rst (LIBGCCJIT_ABI_3): New.
1774         * docs/topics/functions.rst (Blocks): Add switch statements to
1775         list of ways to terminate a block.
1776         (gcc_jit_block_end_with_switch): Add function description.
1777         (gcc_jit_case): Add type.
1778         (gcc_jit_context_new_case): Add function description.
1779         (gcc_jit_case_as_object): Add function description.
1780         * docs/topics/objects.rst: Add gcc_jit_case to class hierarchy.
1781         * docs/_build/texinfo/libgccjit.texi: Regenerate.
1782         * jit-common.h (gcc::jit::recording::case_): Add forward decl.
1783         (gcc::jit::playback::case_): Add forward decl.
1784         * jit-playback.c (add_case): New function.
1785         (gcc::jit::playback::block::add_switch): New function.
1786         * jit-playback.h (gcc::jit::playback::case_): New struct.
1787         (gcc::jit::playback::block::get_function): New method.
1788         (gcc::jit::playback::block::add_switch): New method.
1789         * jit-recording.c: Within namespace gcc::jit...
1790         (recording::context::new_case): New method.
1791         (recording::function::validate): Update for change to
1792         get_successor_blocks.
1793         (recording::block::end_with_switch): New method.
1794         (recording::block::get_successor_blocks): Update to support an
1795         arbitrary number of successor blocks.
1796         (recording::block::dump_edges_to_dot): Likewise.
1797         (memento_of_new_rvalue_from_const <int>::get_wide_int): New.
1798         (memento_of_new_rvalue_from_const <long>::get_wide_int): New.
1799         (memento_of_new_rvalue_from_const <double>::get_wide_int): New.
1800         (memento_of_new_rvalue_from_const <void *>::get_wide_int): New.
1801         (recording::statement::get_successor_blocks): Update to support an
1802         arbitrary number of successor blocks.
1803         (recording::conditional::get_successor_blocks): Likewise.
1804         (recording::jump::get_successor_blocks): Likewise.
1805         (recording::return_::get_successor_blocks): Likewise.
1806         (recording::case_::write_reproducer): New.
1807         (recording::case_::make_debug_string): New.
1808         (recording::switch_::switch_): New.
1809         (recording::switch_::replay_into): New.
1810         (recording::switch_::get_successor_blocks): New.
1811         (recording::switch_::make_debug_string): New.
1812         (recording::switch_::write_reproducer): New.
1813         * jit-recording.h: Within namespace gcc::jit::recording...
1814         (context::new_case): New.
1815         (rvalue::is_constant): New.
1816         (rvalue::get_wide_int): New.
1817         (block::end_with_switch): New.
1818         (block::get_successor_blocks): Update to support an arbitrary
1819         number of successor blocks.
1820         (memento_of_new_rvalue_from_const::is_constant): New.
1821         (memento_of_new_rvalue_from_const::get_wide_int): New.
1822         (statement::get_successor_blocks): Update to support an arbitrary
1823         number of successor blocks.
1824         (conditional::get_successor_blocks): Likewise.
1825         (jump::get_successor_blocks): Likewise.
1826         (return_::get_successor_blocks): Likewise.
1827         (case_): New subclass of memento.
1828         (switch_): New subclass of statement.
1829         * libgccjit++.h (gccjit::case_): New subclass of gccjit::object.
1830         (gccjit::context::new_case): New method.
1831         (gccjit::block::end_with_switch): New method.
1832         (gccjit::case_::case): New ctors.
1833         (gccjit::case_::get_inner_case): New method.
1834         * libgccjit.c: Include "typed-splay-tree.h"
1835         (struct gcc_jit_case): New.
1836         (gcc_jit_context_new_case): New function.
1837         (gcc_jit_case_as_object): New function.
1838         (valid_dest_for_switch): New function.
1839         (valid_case_for_switch): New function.
1840         (class api_call_validator): New class.
1841         (class case_range_validator): New class.
1842         (case_range_validator::case_range_validator): New.
1843         (case_range_validator::validate): New.
1844         (case_range_validator::case_compare): New.
1845         (case_range_validator::get_wide_int): new.
1846         (gcc_jit_block_end_with_switch): New.
1847         * libgccjit.h: Add gcc_jit_case to class hierarchy comment.
1848         (gcc_jit_case): New typedef.
1849         (gcc_jit_context_new_case): New function.
1850         (gcc_jit_case_as_object): New function.
1851         (gcc_jit_block_end_with_switch): New function.
1852         (LIBGCCJIT_HAVE_SWITCH_STATEMENTS): New.
1853         * libgccjit.map: Add gcc_jit_block_end_with_switch,
1854         gcc_jit_case_as_object and gcc_jit_context_new_case.
1856 2015-06-30  David Malcolm  <dmalcolm@redhat.com>
1858         PR jit/66546
1859         * docs/cp/topics/contexts.rst
1860         (gccjit::context::set_bool_allow_unreachable_blocks): New.
1861         * docs/topics/compatibility.rst (LIBGCCJIT_ABI_2): New.
1862         * docs/topics/contexts.rst (Options): Add notes discussing the
1863         transition from enums to entrypoints for new options.
1864         (gcc_jit_context_set_bool_allow_unreachable_blocks): New.
1865         * docs/_build/texinfo/libgccjit.texi: Regenerate.
1866         * jit-common.h (gcc::jit::inner_bool_option): New enum.
1867         * jit-recording.c: Within namespace gcc::jit...
1868         (recording::context::context): Handle m_inner_bool_options.
1869         (recording::context::set_inner_bool_option): New.
1870         (inner_bool_option_reproducer_strings): New.
1871         (recording::context::log_all_options): Log the "inner" bool
1872         options.
1873         (recording::context::log_inner_bool_option): New.
1874         (recording::context::dump_reproducer_to_file): Write initializers
1875         for "inner" bool options.
1876         (recording::function::validate): Don't check for block
1877         reachability if INNER_BOOL_OPTION_ALLOW_UNREACHABLE_BLOCKS is set.
1878         * jit-recording.h: Within namespace gcc::jit...
1879         (recording::context::set_inner_bool_option): New.
1880         (recording::context::get_inner_bool_option): New.
1881         (recording::context::log_inner_bool_option): New.
1882         (recording::context::m_inner_bool_options): New.
1883         * libgccjit++.h
1884         (gccjit::context::set_bool_allow_unreachable_blocks): New.
1885         * libgccjit.c
1886         (gcc_jit_context_set_bool_allow_unreachable_blocks): New.
1887         * libgccjit.h: Add note about options present in the
1888         initial release of libgccjit.
1889         (gcc_jit_context_set_bool_allow_unreachable_blocks): New API
1890         entrypoint.
1891         (LIBGCCJIT_HAVE_gcc_jit_context_set_bool_allow_unreachable_blocks):
1892         New macro.
1893         * libgccjit.map (LIBGCCJIT_ABI_2): New, containing...
1894         (gcc_jit_context_set_bool_allow_unreachable_blocks): ...this new
1895         entrypoint.
1897 2015-06-30  David Malcolm  <dmalcolm@redhat.com>
1899         PR jit/66628
1900         * docs/cp/topics/contexts.rst (Additional command-line options):
1901         New section.
1902         * docs/topics/compatibility.rst: New file.
1903         * docs/topics/contexts.rst (Additional command-line options): New
1904         section.
1905         * docs/topics/index.rst: Add compatibility.rst.
1906         * docs/_build/texinfo/libgccjit.texi: Regenerate.
1907         * jit-playback.c (make_fake_args): Add call to
1908         append_command_line_options.
1909         * jit-recording.c: Within namespace gcc::jit...
1910         (recording::context::~context): Free the optnames within
1911         m_command_line_options.
1912         (recording::context::set_bool_option): Likewise.
1913         (recording::context::add_command_line_option): New method.
1914         (recording::context::append_command_line_options): New method.
1915         (recording::context::dump_reproducer_to_file): Add command-line
1916         options.
1917         * jit-recording.h: Within namespace gcc::jit...
1918         (recording::context::add_command_line_option): New method.
1919         (recording::context::append_command_line_options): New method.
1920         (recording::context::m_command_line_options): New field.
1921         * libgccjit++.h (gccjit::context::add_command_line_option): New
1922         method.
1923         * libgccjit.c (gcc_jit_context_add_command_line_option): New API
1924         entrypoint.
1925         * libgccjit.h (gcc_jit_context_add_command_line_option): New API
1926         entrypoint.
1927         (LIBGCCJIT_HAVE_gcc_jit_context_add_command_line_option): New
1928         macro.
1929         * libgccjit.map: Put existing symbols within LIBGCCJIT_ABI_0; add
1930         LIBGCCJIT_ABI_1 and gcc_jit_context_add_command_line_option.
1932 2015-06-30  David Malcolm  <dmalcolm@redhat.com>
1934         * jit-recording.c
1935         (gcc::jit::recording::context::dump_reproducer_to_file):
1936         Add pragma to generated reproducers to disable -Wunused-variable.
1937         Fix handling of NULL string options.
1939 2015-06-30  David Malcolm  <dmalcolm@redhat.com>
1941         * docs/cp/topics/expressions.rst: Remove stray semicolon.
1942         * docs/cp/topics/functions.rst: Remove stray backslash.
1943         * docs/_build/texinfo/libgccjit.texi: Regenerate.
1945 2015-06-25  Andrew MacLeod  <amacleod@redhat.com>
1947         * dummy-frontend.c: Remove ipa-ref.h and plugin-api.h from include list.
1948         * jit-playback.c: Likewise.
1950 2015-06-25  Andrew Macleod  <amacleod@redhat.com>
1952         * jit-common.h: Don't include alias.h.
1954 2015-06-17  David Malcolm  <dmalcolm@redhat.com>
1956         * libgccjit.c (gcc_jit_lvalue_access_field): Verify that the field
1957         is for the correct struct.
1958         (gcc_jit_rvalue_access_field): Likewise.
1960 2015-06-17  Andrew MacLeod  <amacleod@redhat.com>
1962         * dummy-frontend.c: Do not include input.h, line-map.h or is-a.h.
1963         * jit-common.h: Likewise.
1964         * jit-playback.c: Likewise.
1966 2015-06-16  David Malcolm  <dmalcolm@redhat.com>
1968         PR jit/66539
1969         * jit-recording.c: Within namespace gcc::jit::recording::
1970         (rvalue::get_debug_string_parens): New function.
1971         (binary_op::make_debug_string): Update to mimic C precedence
1972         rules.
1973         (binary_op_precedence): New array.
1974         (binary_op::get_precedence): New function.
1975         (comparison::make_debug_string): Update to mimic C precedence
1976         rules.
1977         (comparison_precedence): New array.
1978         (comparison::get_precedence): New function.
1979         (cast::make_debug_string): Update to mimic C precedence rules.
1980         (call::make_debug_string): Likewise.
1981         (call_through_ptr::make_debug_string): Likewise.
1982         (array_access::make_debug_string): Likewise.
1983         (access_field_of_lvalue::make_debug_string): Likewise.
1984         (access_field_rvalue::make_debug_string): Likewise.
1985         (dereference_field_rvalue::make_debug_string): Likewise.
1986         (dereference_rvalue::make_debug_string): Likewise.
1987         (get_address_of_lvalue::make_debug_string): Likewise.
1988         * jit-recording.h: Within namespace gcc::jit::recording::
1989         (precedence): New enum.
1990         (rvalue::rvalue): Initialize field "m_parenthesized_string".
1991         (rvalue::get_debug_string_parens): New method.
1992         (rvalue::get_precedence): New pure virtual function.
1993         (rvalue::m_parenthesized_string): New field.
1994         (param::get_precedence): New function.
1995         (global::get_precedence): New function.
1996         (memento_of_new_rvalue_from_const::get_precedence): New function.
1997         (memento_of_new_string_literal::get_precedence): New function.
1998         (unary_op::get_precedence): New function.
1999         (binary_op::get_precedence): New function.
2000         (comparison::get_precedence): New function.
2001         (cast::get_precedence): New function.
2002         (call::get_precedence): New function.
2003         (call_through_ptr::get_precedence): New function.
2004         (array_access::get_precedence): New function.
2005         (access_field_of_lvalue::get_precedence): New function.
2006         (access_field_rvalue::get_precedence): New function.
2007         (dereference_field_rvalue::get_precedence): New function.
2008         (dereference_rvalue::get_precedence): New function.
2009         (get_address_of_lvalue::get_precedence): New function.
2010         (local::get_precedence): New function.
2012 2015-06-09  Matthias Klose  <doko@ubuntu.com>
2014         * Make-lang.in (jit.install-common): Install headers using INSTALL_DATA.
2016 2015-06-08  Andrew MacLeod  <amacleod@redhat.com>
2018         * dummy-frontend.c : Adjust include files.
2019         * jit-common.h : Likewise.
2020         * jit-playback.c : Likewise.
2022 2015-06-05  David Malcolm  <dmalcolm@redhat.com>
2024         * dummy-frontend.c
2025         (jit_langhook_post_compilation_parsing_cleanups): Remove.
2026         (LANG_HOOKS_POST_COMPILATION_PARSING_CLEANUPS): Remove
2027         * jit-playback.c (gcc::jit::playback::context::new_global): Add
2028         call to varpool_node::finalize_decl.
2029         (gcc::jit::playback::context::finalize_global_decls): Remove.
2030         * jit-playback.h
2031         (gcc::jit::playback::context::finalize_global_decls): Remove.
2033 2015-06-05  David Malcolm  <dmalcolm@redhat.com>
2035         * dummy-frontend.c (jit_langhook_write_globals): Rename to...
2036         (jit_langhook_post_compilation_parsing_cleanups): ...this, and
2037         eliminate calls to finalize_compilation_unit and
2038         write_global_decls_2.
2039         (LANG_HOOKS_WRITE_GLOBALS): Rename to...
2040         (LANG_HOOKS_POST_COMPILATION_PARSING_CLEANUPS): ...this and
2041         redirect from jit_langhook_write_globals to
2042         jit_langhook_post_compilation_parsing_cleanups.
2043         * jit-playback.c
2044         (gcc::jit::playback::context::write_global_decls_1): Rename to...
2045         (gcc::jit::playback::context::finalize_global_decls): ...this.
2046         (gcc::jit::playback::context::write_global_decls_1): Delete.
2047         * jit-playback.h
2048         (gcc::jit::playback::context::write_global_decls_1): Rename to...
2049         (gcc::jit::playback::context::finalize_global_decls): ...this.
2050         (gcc::jit::playback::context::write_global_decls_1): Delete.
2052 2015-06-04  Andrew MacLeod  <amacleod@redhat.com>
2054         * dummy-frontend.c: Adjust includes for restructured coretypes.h.
2055         * jit-common.h: Likewise.
2056         * jit-playback.c: Likewise.
2058 2015-05-12  David Malcolm  <dmalcolm@redhat.com>
2060         * jit-builtins.c: Include vec.h before target.h.
2062 2015-04-27  Jim Wilson  <jim.wilson@linaro.org>
2064         * Make-lang.in (jit.mostlyclean): Remove shared libraries and object
2065         files.
2067 2015-04-09  David Malcolm  <dmalcolm@redhat.com>
2069         PR jit/65691
2070         * docs/cp/topics/expressions.rst (Simple expressions): Fix copy
2071         and paste error in description of gccjit::context::one.
2072         * docs/topics/expressions.rst (Simple expressions): Likewise in
2073         description of gcc_jit_context_one.
2074         * docs/_build/texinfo/libgccjit.texi: Regenerate.
2076 2015-03-13  Uros Bizjak  <ubizjak@gmail.com>
2078         * jit-recording.c (dump::write): Also check vasprintf return value.
2079         (recording::context::add_error_va): Ditto.
2080         (recording::string::from_printf): Ditto.
2082 2015-03-13  David Malcolm  <dmalcolm@redhat.com>
2084         * docs/internals/index.rst (Packaging notes): New section.
2085         * docs/_build/texinfo/libgccjit.texi: Regenerate.
2087 2015-03-05  David Malcolm  <dmalcolm@redhat.com>
2089         * docs/cp/intro/tutorial03.rst: Add missing arguments to
2090         gccjit::block::end_with_conditional call.  Add on_true/on_false
2091         comments.  Tweak the wording.
2092         * docs/intro/tutorial03.rst: Add missing arguments to
2093         gcc_jit_block_end_with_conditional call.  Add some clarifying
2094         comments.
2095         * docs/topics/compilation.rst: Tweak the wording to avoid an
2096         ambiguous use of "this".
2097         * docs/topics/contexts.rst: Fix a typo.
2098         * docs/topics/expressions.rst (GCC_JIT_BINARY_OP_MINUS): Remove
2099         a stray backtick.
2100         * docs/_build/texinfo/libgccjit.texi: Regenerate.
2102 2015-02-24  Thomas Schwinge  <thomas@codesourcery.com>
2104         PR libgomp/64625
2105         * jit-builtins.c (DEF_FUNCTION_TYPE_VAR_8)
2106         (DEF_FUNCTION_TYPE_VAR_12): Remove macros.
2107         (DEF_FUNCTION_TYPE_VAR_7, DEF_FUNCTION_TYPE_VAR_11): New macros.
2108         * jit-builtins.h (DEF_FUNCTION_TYPE_VAR_8)
2109         (DEF_FUNCTION_TYPE_VAR_12): Remove macros.
2110         (DEF_FUNCTION_TYPE_VAR_7, DEF_FUNCTION_TYPE_VAR_11): New macros.
2112 2015-02-04  David Malcolm  <dmalcolm@redhat.com>
2114         PR jit/64257
2115         * docs/conf.py (html_theme): Change from 'pyramid'
2116         to 'sphinxdoc'.
2118 2015-02-04  David Malcolm  <dmalcolm@redhat.com>
2120         * docs/topics/contexts.rst (gcc_jit_context_acquire): Fix
2121         typo.
2122         * docs/_build/texinfo/libgccjit.texi: Regenerate.
2124 2015-02-03  David Malcolm  <dmalcolm@redhat.com>
2126         * jit-logging.h (gcc::jit::log_user::log): Make const.
2127         * jit-recording.c (gcc::jit::recording::context::set_str_option):
2128         Log the new value of the option.
2129         (gcc::jit::recording::context::set_int_option): Likewise.
2130         (gcc::jit::recording::context::set_bool_option): Likewise.
2131         (gcc::jit::recording::context::compile): Log the value of all
2132         options.
2133         (gcc::jit::recording::context::compile_to_file): Likewise.
2134         (gcc::jit::recording::context::log_all_options): New function.
2135         (gcc::jit::recording::context::log_str_option): New function.
2136         (gcc::jit::recording::context::log_int_option): New function.
2137         (gcc::jit::recording::context::log_bool_option): New function.
2138         * jit-recording.h (gcc::jit::recording::context::log_all_options):
2139         New function.
2140         (gcc::jit::recording::context::log_str_option): New function.
2141         (gcc::jit::recording::context::log_int_option): New function.
2142         (gcc::jit::recording::context::log_bool_option): New function.
2143         * docs/internals/test-hello-world.exe.log.txt: Update for above
2144         changes.
2145         * docs/_build/texinfo/libgccjit.texi: Regenerate.
2147 2015-02-03  David Malcolm  <dmalcolm@redhat.com>
2149         PR jit/64810
2150         * Make-lang.in (jit_OBJS): Add jit/jit-spec.o and gcc.o.
2151         (LIBGCCJIT_FILENAME): Add EXTRA_GCC_OBJS.
2152         * jit-playback.c: Include gcc.h.
2153         (gcc::jit::playback::context::compile): Move mutex acquisition
2154         to before the call to make_fake_args.
2155         (append_arg_from_driver): New function.
2156         (gcc::jit::playback::context::make_fake_args): On the first call,
2157         call into driver_get_configure_time_options to get configure-time
2158         default options and cache them.  Add them to the args for
2159         toplev::main.
2160         * jit-spec.c: New source file.
2161         * docs/internals/test-hello-world.exe.log.txt: Update to reflect
2162         above changes.
2163         * docs/_build/texinfo/libgccjit.texi: Regenerate.
2165 2015-02-02  David Malcolm  <dmalcolm@redhat.com>
2167         PR jit/64810
2168         * dummy-frontend.c (jit_langhook_type_for_mode): Support
2169         TYPE_MODE (long_long_integer_type_node).
2171 2015-01-27  David Malcolm  <dmalcolm@redhat.com>
2173         * docs/internals/test-hello-world.exe.log.txt: Add example version
2174         lines.
2175         * docs/_build/texinfo/libgccjit.texi: Regenerate.
2176         * jit-common.h (gcc::jit::dump::get_file): New accessor.
2177         * jit-logging.c: Include toplev.h.
2178         (gcc::jit::logger::logger): Log the GCC version.
2179         * jit-recording.c: Include toplev.h.
2180         (gcc:jit::recording::context::dump_reproducer_to_file): Log the
2181         GCC version.
2183 2015-01-26  David Malcolm  <dmalcolm@redhat.com>
2185         * docs/topics/compilation.rst (gcc_jit_result_get_code): Fix typo.
2186         * docs/topics/contexts.rst (gcc_jit_context_get_last_error): The
2187         error buffer is only valid until the next call to the context.
2188         * docs/_build/texinfo/libgccjit.texi: Regenerate.
2189         * libgccjit.h (gcc_jit_context_get_first_error): Reword the
2190         comment to omit mention of compiling.
2191         (gcc_jit_context_get_last_error): The error buffer is only valid
2192         until the next call to the context.
2194 2015-01-26  David Malcolm  <dmalcolm@redhat.com>
2196         PR jit/64708
2197         * config-lang.in (compilers): Drop "libgccjit.so".
2199 2015-01-23  David Malcolm  <dmalcolm@redhat.com>
2201         PR jit/64721
2202         * jit-playback.c (gcc::jit::playback::context::compile): Construct
2203         toplev instances with init_signals=false.
2205 2015-01-19  David Malcolm  <dmalcolm@redhat.com>
2207         * docs/cp/topics/results.rst: Rename to...
2208         * docs/cp/topics/compilation.rst: ...this, and add section on
2209         ahead-of-time compilation.
2210         * docs/cp/topics/index.rst: Update for renaming of results.rst
2211         to compilation.rst.
2212         * docs/examples/emit-alphabet.bf: New file, a sample "brainf"
2213         script.
2214         * docs/examples/tut05-bf.c: New file, implementing a compiler
2215         for "brainf".
2216         * docs/internals/test-hello-world.exe.log.txt: Update to reflect
2217         changes to logger output.
2218         * docs/intro/index.rst: Add tutorial05.rst
2219         * docs/intro/tutorial05.rst: New file.
2220         * docs/topics/results.rst: Rename to...
2221         * docs/topics/compilation.rst: ...this, and add section on
2222         ahead-of-time compilation.
2223         * docs/topics/index.rst: Update for renaming of results.rst to
2224         compilation.rst.
2225         * docs/_build/texinfo/libgccjit.texi: Regenerate.
2226         * jit-playback.c (gcc::jit::playback::context::compile): Convert
2227         return type from result * to void.  Move the code to convert to
2228         dso and dlopen the result to a new pure virtual "postprocess"
2229         method.
2230         (gcc::jit::playback::compile_to_memory::compile_to_memory): New
2231         function.
2232         (gcc::jit::playback::compile_to_memory::postprocess): New
2233         function, based on playback::context::compile.
2234         (gcc::jit::playback::compile_to_file::compile_to_file): New
2235         function.
2236         (gcc::jit::playback::compile_to_file::postprocess): New function.
2237         (gcc::jit::playback::compile_to_file::copy_file): New function.
2238         (gcc::jit::playback::context::convert_to_dso): Move internals
2239         to...
2240         (gcc::jit::playback::context::invoke_driver): New method.  Add
2241         "-shared" and "-c" options to driver's argv as needed.
2242         * jit-playback.h: Include "timevar.h".
2243         (gcc::jit::playback::context::compile): Convert return type from
2244         result * to void.
2245         (gcc::jit::playback::context::postprocess): New pure virtual
2246         function, making this an abstract base class.
2247         (gcc::jit::playback::context::get_tempdir): New accessor.
2248         (gcc::jit::playback::context::invoke_driver): New function.
2249         (class gcc::jit::playback::compile_to_memory): New subclass of
2250         playback::context.
2251         (class gcc::jit::playback::compile_to_file): Likewise.
2252         * jit-recording.c (gcc::jit::recording::context::compile): Use a
2253         playback::compile_to_memory, and extract its result.
2254         (gcc::jit::recording::context::compile_to_file): New function.
2255         * jit-recording.h (gcc::jit::recording::context::compile_to_file):
2256         New function.
2257         * libgccjit++.h (gccjit::context::compile_to_file): New method.
2258         * libgccjit.c (gcc_jit_context_compile): Update log message to
2259         clarify that this is an in-memory compile.
2260         (gcc_jit_context_compile_to_file): New function.
2261         * libgccjit.h (gcc_jit_context): Clarify that you can compile
2262         a context more than once, and that you can compile to a file
2263         as well as to memory.
2264         (gcc_jit_result): Clarify that this is the result of an
2265         in-memory compilation.
2266         (gcc_jit_context_compile): Clarify that you can compile, and that
2267         this is an in-memory compilation.
2268         (enum gcc_jit_output_kind): New enum.
2269         (gcc_jit_context_compile_to_file): New function.
2270         (gcc_jit_context_enable_dump): Clarify comment to cover both forms
2271         of compilation.
2272         * libgccjit.map (gcc_jit_context_compile_to_file): New API
2273         entrypoint.
2274         * notes.txt: Update to show the playback::context::postprocess
2275         virtual function.
2277 2015-01-19  David Malcolm  <dmalcolm@redhat.com>
2279         * jit-recording.c
2280         (gcc::jit::recording::memento_of_new_string_literal::make_debug_string):
2281         Add missing format string.
2283 2015-01-16  David Malcolm  <dmalcolm@redhat.com>
2285         * Make-lang.in (lang_checks_parallelized): Add "check-jit".
2286         (check_jit_parallelize): Set this to an arbitrary value (10).
2288 2015-01-16  Jakub Jelinek  <jakub@redhat.com>
2290         * jit-builtins.h (DEF_FUNCTION_TYPE_VAR_5): Fix spelling of
2291         last argument.
2292         (DEF_FUNCTION_TYPE_VAR_8, DEF_FUNCTION_TYPE_VAR_12): Define and
2293         undef afterwards.
2294         * jit-builtins.c (DEF_FUNCTION_TYPE_VAR_8, DEF_FUNCTION_TYPE_VAR_12):
2295         Likewise.
2297 2015-01-15  Richard Sandiford  <richard.sandiford@arm.com>
2299         Update copyright years in docs/.
2301 2015-01-15  David Malcolm  <dmalcolm@redhat.com>
2303         * libgccjit.c (gcc_jit_block_add_assignment_op): Check that the
2304         lvalue and the rvalue are of compatible type.
2306 2015-01-13  David Malcolm  <dmalcolm@redhat.com>
2308         * docs/cp/topics/contexts.rst (Debugging): Add
2309         gccjit::context::dump_reproducer_to_file.
2310         * docs/internals/index.rst (Design notes): New section,
2311         discussing input validation and
2312         gcc_jit_context_dump_reproducer_to_file.
2313         * docs/topics/contexts.rst (Debugging): Add
2314         gcc_jit_context_dump_reproducer_to_file.
2315         * docs/_build/texinfo/libgccjit.texi: Regenerate.
2316         * jit-common.h (gcc::jit::dump::get_context): New accessor.
2317         * jit-recording.c: Include "hash-map.h".
2318         Within namespace ::gcc::jit...
2319         (dump::write): Flush each line.
2320         (dump::make_location): Pass false for new param "created_by_user".
2321         (class allocator): New class.
2322         (allocator::~allocator): New function.
2323         (allocator::xstrdup_printf): New function.
2324         (allocator::xstrdup_printf_va): New function.
2325         (class reproducer): New subclass of dump.
2326         (reproducer::reproducer): New function.
2327         (reproducer::write_params): New function.
2328         (reproducer::write_args): New function.
2329         (reproducer::make_identifier): New function.
2330         (reproducer::make_tmp_identifier): New function.
2331         (reproducer::get_identifier): New pair of functions.
2332         (reproducer::get_identifier_as_rvalue): New function.
2333         (reproducer::get_identifier_as_lvalue): New function.
2334         (reproducer::get_identifier_as_type): New function.
2335         (reproducer::xstrdup_printf): New function.
2336         (recording::context::context): Initialize m_toplevel_ctxt.
2337         (recording::context::new_location): Add param created_by_user.
2338         (str_option_reproducer_strings): New table of strings.
2339         (int_option_reproducer_strings): Likewise.
2340         (bool_option_reproducer_strings): Likewise.
2341         (get_type_enum_strings): Likewise.
2342         (names_of_function_kinds): Likewise.
2343         (global_kind_reproducer_strings): Likewise.
2344         (unary_op_reproducer_strings): Likewise.
2345         (binary_op_reproducer_strings): Likewise.
2346         (comparison_reproducer_strings): Likewise.
2347         Within namespace ::gcc::jit::recording::...
2348         (context::dump_reproducer_to_file): New function.
2349         (string::write_reproducer): Likewise.
2350         (location::write_reproducer): Likewise.
2351         (type::access_as_type): Likewise.
2352         (memento_of_get_type::write_reproducer): Likewise.
2353         (memento_of_get_pointer::write_reproducer): Likewise.
2354         (memento_of_get_const::write_reproducer): Likewise.
2355         (memento_of_get_volatile::write_reproducer): Likewise.
2356         (array_type::write_reproducer): Likewise.
2357         (function_type::write_reproducer): Likewise.
2358         (function_type::write_deferred_reproducer): Likewise.
2359         (field::write_reproducer): Likewise.
2360         (struct_::access_as_type): Likewise.
2361         (struct_::write_reproducer): Likewise.
2362         (union_::write_reproducer): Likewise.
2363         (fields::write_reproducer): Likewise.
2364         (rvalue::access_as_rvalue): Likewise.
2365         (lvalue::access_as_rvalue): Likewise.
2366         (lvalue::access_as_lvalue): Likewise.
2367         (param::access_as_rvalue): Likewise.
2368         (param::access_as_lvalue): Likewise.
2369         (param::write_reproducer): Likewise.
2370         (function::write_reproducer): Likewise.
2371         (block::write_reproducer): Likewise.
2372         (global::write_reproducer): Likewise.
2373         (memento_of_new_rvalue_from_const <int>::write_reproducer):
2374         Likewise.
2375         (memento_of_new_rvalue_from_const <long>::write_reproducer):
2376         Likewise.
2377         (memento_of_new_rvalue_from_const <double>::write_reproducer):
2378         Likewise.
2379         (memento_of_new_rvalue_from_const <void *>::write_reproducer):
2380         Likewise.
2381         (memento_of_new_string_literal::write_reproducer): Likewise.
2382         (unary_op::write_reproducer): Likewise.
2383         (binary_op::write_reproducer): Likewise.
2384         (comparison::write_reproducer): Likewise.
2385         (cast::write_reproducer): Likewise.
2386         (call::write_reproducer): Likewise.
2387         (call_through_ptr::write_reproducer): Likewise.
2388         (array_access::write_reproducer): Likewise.
2389         (access_field_of_lvalue::write_reproducer): Likewise.
2390         (access_field_rvalue::write_reproducer): Likewise.
2391         (dereference_field_rvalue::write_reproducer): Likewise.
2392         (dereference_rvalue::write_reproducer): Likewise.
2393         (get_address_of_lvalue::write_reproducer): Likewise.
2394         (local::write_reproducer): Likewise.
2395         (eval::write_reproducer): Likewise.
2396         (assignment::write_reproducer): Likewise.
2397         (assignment_op::write_reproducer): Likewise.
2398         (comment::write_reproducer): Likewise.
2399         (conditional::write_reproducer): Likewise.
2400         (jump::write_reproducer): Likewise.
2401         (return_::write_reproducer): Likewise.
2402         * jit-recording.h (gcc::jit::reproducer): New forward declararion.
2403         Within namespace ::gcc::jit::recording::...
2404         (context::new_location): Add "created_by_user" param.
2405         (context::dump_reproducer_to_file): New method.
2406         (context::m_toplevel_ctxt): New field.
2407         (memento::write_reproducer): New pure virtual function.
2408         (memento::dyn_cast_location): New virtual function.
2409         (string::write_reproducer):
2410         (location::location): Add "created_by_user" param.
2411         (location::dyn_cast_location): New function.
2412         (location::created_by_user): New accessor.
2413         (location::write_reproducer): New function.
2414         (location::m_created_by_user): New field.
2415         (type::access_as_type): New virtual function.
2416         (location::write_reproducer): Likewise.
2417         (type::access_as_type): Likewise.
2418         (memento_of_get_type::write_reproducer): Likewise.
2419         (memento_of_get_pointer::write_reproducer): Likewise.
2420         (memento_of_get_const::write_reproducer): Likewise.
2421         (memento_of_get_volatile::write_reproducer): Likewise.
2422         (array_type::write_reproducer): Likewise.
2423         (function_type::write_reproducer): Likewise.
2424         (function_type::write_deferred_reproducer): Likewise.
2425         (field::write_reproducer): Likewise.
2426         (struct_::access_as_type): Likewise.
2427         (struct_::write_reproducer): Likewise.
2428         (union_::write_reproducer): Likewise.
2429         (union_::m_fields): Remove stray unused field.
2430         (fields::length): New accessor.
2431         (fields::get_field): New accessor.
2432         (fields::write_reproducer): New function.
2433         (rvalue::access_as_rvalue): Likewise.
2434         (lvalue::access_as_rvalue): Likewise.
2435         (lvalue::access_as_lvalue): Likewise.
2436         (param::access_as_rvalue): Likewise.
2437         (param::access_as_lvalue): Likewise.
2438         (param::write_reproducer): Likewise.
2439         (function::write_reproducer): Likewise.
2440         (block::write_reproducer): Likewise.
2441         (global::write_reproducer): Likewise.
2442         (memento_of_new_rvalue_from_const <HOST_TYPE>::write_reproducer):
2443         Likewise.
2444         (memento_of_new_string_literal::write_reproducer): Likewise.
2445         (unary_op::write_reproducer): Likewise.
2446         (binary_op::write_reproducer): Likewise.
2447         (comparison::write_reproducer): Likewise.
2448         (cast::write_reproducer): Likewise.
2449         (call::write_reproducer): Likewise.
2450         (call_through_ptr::write_reproducer): Likewise.
2451         (array_access::write_reproducer): Likewise.
2452         (access_field_of_lvalue::write_reproducer): Likewise.
2453         (access_field_rvalue::write_reproducer): Likewise.
2454         (dereference_field_rvalue::write_reproducer): Likewise.
2455         (dereference_rvalue::write_reproducer): Likewise.
2456         (get_address_of_lvalue::write_reproducer): Likewise.
2457         (local::write_reproducer): Likewise.
2458         (eval::write_reproducer): Likewise.
2459         (assignment::write_reproducer): Likewise.
2460         (assignment_op::write_reproducer): Likewise.
2461         (comment::write_reproducer): Likewise.
2462         (conditional::write_reproducer): Likewise.
2463         (jump::write_reproducer): Likewise.
2464         (return_::write_reproducer): Likewise.
2465         * libgccjit++.h (gccjit::context::dump_reproducer_to_file): New.
2466         * libgccjit.c (gcc_jit_context_new_location): Pass "true" as
2467         param "created_by_user".
2468         (gcc_jit_context_dump_reproducer_to_file): New API entrypoint.
2469         * libgccjit.h (gcc_jit_context_dump_reproducer_to_file): New API
2470         entrypoint.
2471         * libgccjit.map (gcc_jit_context_dump_reproducer_to_file): New API
2472         entrypoint.
2474 2015-01-12  David Malcolm  <dmalcolm@redhat.com>
2476         * jit-recording.c (class gcc::jit::rvalue_usage_validator): New.
2477         (gcc::jit::rvalue_usage_validator::rvalue_usage_validator): New
2478         ctor.
2479         (gcc::jit::rvalue_usage_validator::visit): New function.
2480         (gcc::jit::recording::rvalue::verify_valid_within_stmt): New
2481         function.
2482         (gcc::jit::recording::rvalue::set_scope): New function.
2483         (gcc::jit::recording::function::function): Call set_scope on each
2484         param, issuing errors for any params that already have a function.
2485         (gcc::jit::recording::block::add_eval): Return the new statement;
2486         update the comment given that some error-checking now happens after
2487         this returns.
2488         (gcc::jit::recording::block::add_assignment): Likewise.
2489         (gcc::jit::recording::block::add_assignment_op): Likewise.
2490         (gcc::jit::recording::block::add_comment): Likewise.
2491         (gcc::jit::recording::block::end_with_conditional): Likewise.
2492         (gcc::jit::recording::block::end_with_jump): Likewise.
2493         (gcc::jit::recording::block::end_with_return): Likewise.
2494         (gcc::jit::recording::block::validate): Add a comment.
2495         (gcc::jit::recording::unary_op::visit_children): New function.
2496         (gcc::jit::recording::binary_op::visit_children): New function.
2497         (gcc::jit::recording::comparison::visit_children): New function.
2498         (gcc::jit::recording::cast::visit_children): New function.
2499         (gcc::jit::recording::call::visit_children): New function.
2500         (gcc::jit::recording::call_through_ptr::visit_children): New function.
2501         (gcc::jit::recording::array_access::visit_children): New function.
2502         (gcc::jit::recording::access_field_of_lvalue::visit_children): New
2503         function.
2504         (gcc::jit::recording::access_field_rvalue::visit_children): New
2505         function.
2506         (gcc::jit::recording::dereference_field_rvalue::visit_children):
2507         New function.
2508         (gcc::jit::recording::dereference_rvalue::visit_children): New
2509         function.
2510         (gcc::jit::recording::get_address_of_lvalue::visit_children): New
2511         function.
2512         * jit-recording.h: Within namespace gcc::jit::recording...
2513         (class rvalue_visitor): New.
2514         (rvalue::rvalue): Initialize m_scope.
2515         (rvalue::get_loc): New accessor.
2516         (rvalue::verify_valid_within_stmt): New function.
2517         (rvalue::visit_children): New pure virtual function.
2518         (rvalue::set_scope): New function.
2519         (rvalue::get_scope): New function.
2520         (rvalue::dyn_cast_param): New function.
2521         (rvalue::m_scope): New field.
2522         (param::visit_children): New empty function.
2523         (param::dyn_cast_param): New function.
2524         (function::get_loc): New function.
2525         (block::add_eval): Return the new statement.
2526         (block::add_assignment): Likewise.
2527         (block::add_assignment_op): Likewise.
2528         (block::add_comment): Likewise.
2529         (block::end_with_conditional): Likewise.
2530         (block::end_with_jump): Likewise.
2531         (block::end_with_return): Likewise.
2532         (global::visit_children): New function.
2533         (memento_of_new_rvalue_from_const<HOST_TYPE>::visit_children):
2534         New function.
2535         (memento_of_new_string_literal::visit_children): New function.
2536         (unary_op::visit_children): New function.
2537         (binary_op::visit_children): New function.
2538         (comparison::visit_children): New function.
2539         (cast::visit_children): New function.
2540         (call::visit_children): New function.
2541         (call_through_ptr::visit_children): New function.
2542         (array_access::visit_children): New function.
2543         (access_field_of_lvalue::visit_children): New function.
2544         (access_field_rvalue::visit_children): New function.
2545         (dereference_field_rvalue::visit_children): New function.
2546         (dereference_rvalue::visit_children): New function.
2547         (get_address_of_lvalue::visit_children): New function.
2548         (local::local): Call set_scope.
2549         (local::visit_children): New function.
2550         (statement::get_block): Make public.
2551         * libgccjit.c (RETURN_VAL_IF_FAIL_PRINTF5): New macro.
2552         (RETURN_NULL_IF_FAIL_PRINTF5): New macro.
2553         (gcc_jit_context_new_function): Verify that each param has
2554         not yet been used for creating another function.
2555         (gcc_jit_block_add_eval): After creating the stmt, verify
2556         that the rvalue expression tree is valid to use within it.
2557         (gcc_jit_block_add_assignment): Likewise for the lvalue and
2558         rvalue expression trees.
2559         (gcc_jit_block_add_assignment_op): Likewise.
2560         (gcc_jit_block_end_with_conditional): Likewise for the boolval
2561         expression tree.
2562         (gcc_jit_block_end_with_return): Likewise for the rvalue
2563         expression tree.
2564         (gcc_jit_block_end_with_void_return): Remove return of "void",
2565         now that block::end_with_return is now non-void.
2567 2015-01-12  David Malcolm  <dmalcolm@redhat.com>
2569         * jit-playback.c (gcc::jit::playback::context::read_dump_file):
2570         Add missing fclose on error-handling path.
2572 2015-01-12  David Malcolm  <dmalcolm@redhat.com>
2574         * docs/cp/topics/expressions.rst (Global variables): Add
2575         enum gcc_jit_global_kind param to gccjit::context::new_global.
2576         * docs/topics/expressions.rst (Global variables): Likewise.
2577         Document the new enum.
2578         * docs/topics/results.rst (Compilation results): Document
2579         globals-handling.
2580         * docs/_build/texinfo/libgccjit.texi: Regenerate.
2581         * dummy-frontend.c (jit_langhook_write_globals): Call into the
2582         playback context's write_global_decls_1 and write_global_decls_2
2583         before and after calling symtab->finalize_compilation_unit ().
2584         * jit-playback.c: Include "debug.h".
2585         (gcc::jit::playback::context::new_global): Add "kind" param and
2586         use it to set TREE_PUBLIC, TREE_STATIC and DECL_EXTERNAL on the
2587         underlying VAR_DECL.  Call varpool_node::get_create on the
2588         VAR_DECL, and add it to m_globals.
2589         (gcc::jit::playback::context::write_global_decls_1): New function.
2590         (gcc::jit::playback::context::write_global_decls_2): New function.
2591         * jit-playback.h (gcc::jit::playback::context::context): Call
2592         create on m_globals.
2593         (gcc::jit::playback::context::new_global): Add "kind" param.
2594         (gcc::jit::playback::context::write_global_decls_1): New function.
2595         (gcc::jit::playback::context::write_global_decls_2): New function.
2596         (gcc::jit::playback::context::m_globals): New field.
2597         * jit-recording.c (gcc::jit::recording::context::context):
2598         Initialize m_globals.
2599         (gcc::jit::recording::context::new_global): Add param "kind".
2600         Add the new global to m_globals.
2601         (gcc::jit::recording::context::dump_to_file): Dump the globals.
2602         (gcc::jit::recording::global::replay_into): Add field m_kind.
2603         (gcc::jit::recording::global::write_to_dump): New override.
2604         * jit-recording.h (gcc::jit::recording::context::new_global): Add
2605         param "kind".
2606         (gcc::jit::recording::context::m_globals): New field.
2607         (gcc::jit::recording::global::global): Add param kind.
2608         (gcc::jit::recording::global::write_to_dump): New override.
2609         (gcc::jit::recording::global::m_kind): New field.
2610         * jit-result.c (gcc::jit::result::get_global): New function.
2611         * jit-result.h (gcc::jit::result::get_global): New function.
2612         * libgccjit++.h (gccjit::context::new_global): Add "kind" param.
2613         * libgccjit.c (gcc_jit_context_new_global): Likewise.
2614         (gcc_jit_result_get_global): New API entrypoint.
2615         * libgccjit.h (gcc_jit_result_get_global): New API entrypoint.
2616         (enum gcc_jit_global_kind): New enum.
2617         (gcc_jit_context_new_global): API change: add "kind" param.
2618         * libgccjit.map (gcc_jit_result_get_global): New symbol.
2620 2015-01-09  David Malcolm  <dmalcolm@redhat.com>
2622         * dummy-frontend.c: Include "fixed-value.h", "alias.h", "flags.h",
2623         "symtab.h", "inchash.h".  Move include of "hash-set.h" much
2624         earlier.
2625         * jit-builtins.c: Remove redundant includes of "opts.h" and
2626         "tree.h".
2627         * jit-common.h: Include "hash-set.h", "input.h", "vec.h",
2628         "double-int.h", "alias.h", "flags.h", "symtab.h", "inchash.h".
2629         * jit-playback.c: Include "hashtab.h", "machmode.h", "input.h",
2630         "statistics.h", "vec.h", "double-int.h", "real.h",
2631         "fixed-value.h", "alias.h", "flags.h", "symtab.h", "tree-core.h",
2632         "inchash.h", "fold-const.h".  Move include of "hash-set.h" to
2633         earlier.
2634         * jit-recording.c: Remove redundant includes of "opts.h" and
2635         "tree.h".
2637 2015-01-09  David Malcolm  <dmalcolm@redhat.com>
2639         * docs/cp/topics/expressions.rst (Simple expressions): Use
2640         ":c:type:" for C types.  Document new overload of
2641         gcc::jit::context::new_rvalue.
2642         * docs/topics/expressions.rst (Simple expressions): Use
2643         ":c:type:" for C types.  Document new entrypoint
2644         gcc_jit_context_new_rvalue_from_long.
2645         * docs/_build/texinfo/libgccjit.texi: Regenerate.
2646         * jit-playback.c: Within namespace gcc::jit::playback...
2647         (context::new_rvalue_from_int): Eliminate in favor of...
2648         (context::new_rvalue_from_const <int>): ...this.
2649         (context::new_rvalue_from_double): Eliminate in favor of...
2650         (context::new_rvalue_from_const <double>): ...this.
2651         (context::new_rvalue_from_const <long>): New.
2652         (context::new_rvalue_from_ptr): Eliminate in favor of...
2653         (context::new_rvalue_from_const <void *>): ...this.
2654         * jit-playback.h: Within namespace gcc::jit::playback...
2655         (context::new_rvalue_from_int): Eliminate in favor of...
2656         (context::new_rvalue_from_const <HOST_TYPE>): ...this.
2657         (context::new_rvalue_from_double): Likewise.
2658         (context::new_rvalue_from_ptr): Likewise.
2659         * jit-recording.c: Within namespace gcc::jit::recording...
2660         (context::new_rvalue_from_int): Eliminate.
2661         (context::new_rvalue_from_double): Likewise.
2662         (context::new_rvalue_from_ptr): Likewise.
2663         (class memento_of_new_rvalue_from_const <int>):
2664         Add explicit specialization.
2665         (class memento_of_new_rvalue_from_const <long>):
2666         Likewise.
2667         (class memento_of_new_rvalue_from_const <double>):
2668         Likewise.
2669         (class memento_of_new_rvalue_from_const <void *>):
2670         Likewise.
2671         (memento_of_new_rvalue_from_int::replay_into):
2672         Generalize into...
2673         (memento_of_new_rvalue_from_const <HOST_TYPE>::replay_into):
2674         ...this...
2675         (memento_of_new_rvalue_from_double::replay_into):
2676         ...allowing this...
2677         (memento_of_new_rvalue_from_ptr::replay_into):
2678         ...and this to be deleted.
2679         (memento_of_new_rvalue_from_int::make_debug_string):
2680         Convert to...
2681         (memento_of_new_rvalue_from_const <int>::make_debug_string):
2682         ...this.
2683         (memento_of_new_rvalue_from_double::make_debug_string):
2684         Convert to...
2685         (memento_of_new_rvalue_from_const <double>::make_debug_string):
2686         ...this.
2687         (memento_of_new_rvalue_from_ptr::make_debug_string)
2688         Convert to...
2689         (memento_of_new_rvalue_from_const <void *>::make_debug_string):
2690         ...this.
2691         (memento_of_new_rvalue_from_const <long>::make_debug_string):
2692         New function.
2693         * jit-recording.h: Within namespace gcc::jit::recording...
2694         (context::new_rvalue_from_int): Eliminate.
2695         (context::new_rvalue_from_double): Likewise.
2696         (context::new_rvalue_from_ptr): Likewise, all in favor of...
2697         (context::new_rvalue_from_const <HOST_TYPE>): New family of
2698         methods.
2699         (class memento_of_new_rvalue_from_int): Eliminate.
2700         (class memento_of_new_rvalue_from_double): Likewise.
2701         (class memento_of_new_rvalue_from_ptr): Likewise.
2702         (class memento_of_new_rvalue_from_const <HOST_TYPE>): New family
2703         of rvalue subclasses.
2704         * libgccjit++.h (gccjit::context::new_rvalue): New overload, for
2705         "long".
2706         * libgccjit.c (gcc_jit_context_new_rvalue_from_int): Update for
2707         rewriting of recording::context::new_rvalue_from_int to
2708         recording::context::new_rvalue_from_const <int>.
2709         (gcc_jit_context_new_rvalue_from_long): New API entrypoint.
2710         (gcc_jit_context_new_rvalue_from_double): Update for
2711         rewriting of recording::context::new_rvalue_from_double to
2712         recording::context::new_rvalue_from_const <double>.
2713         (gcc_jit_context_new_rvalue_from_ptr): Update for
2714         rewriting of recording::context::new_rvalue_from_ptr to
2715         recording::context::new_rvalue_from_const <void *>.
2716         * libgccjit.h (gcc_jit_context_new_rvalue_from_long): New API
2717         entrypoint.
2718         * libgccjit.map (gcc_jit_context_new_rvalue_from_long): Likewise.
2720 2015-01-09  David Malcolm  <dmalcolm@redhat.com>
2722         PR jit/64206
2723         * docs/internals/test-hello-world.exe.log.txt: Update, the log now
2724         shows tempdir creation/cleanup.
2725         * docs/_build/texinfo/libgccjit.texi: Regenerate.
2726         * jit-logging.h (class gcc::jit::log_user): Add gcc::jit::tempdir
2727         to the list of subclasses in the comment.
2728         * jit-playback.c (gcc::jit::playback::context::context): Add a
2729         comment clarifying when the tempdir gets cleaned up.
2730         (gcc::jit::playback::context::compile): Pass the context's logger,
2731         if any, to the tempdir.
2732         (gcc::jit::playback::context::dlopen_built_dso): When creating the
2733         gcc::jit::result, if GCC_JIT_BOOL_OPTION_DEBUGINFO is set, hand
2734         over ownership of the tempdir to it.
2735         * jit-result.c: Include "jit-tempdir.h".
2736         (gcc::jit::result::result): Add tempdir param, saving it as
2737         m_tempdir.
2738         (gcc::jit::result::~result): Delete m_tempdir.
2739         * jit-result.h (gcc::jit::result::result): Add tempdir param.
2740         (gcc::jit::result::m_tempdir): New field.
2741         * jit-tempdir.c (gcc::jit::tempdir::tempdir): Add logger param;
2742         add JIT_LOG_SCOPE.
2743         (gcc::jit::tempdir::create): Add JIT_LOG_SCOPE to log entry/exit,
2744         and log m_path_template and m_path_tempdir.
2745         (gcc::jit::tempdir::~tempdir): Add JIT_LOG_SCOPE to log
2746         entry/exit, and log the unlink and rmdir calls.
2747         * jit-tempdir.h: Include "jit-logging.h".
2748         (class gcc::jit::tempdir): Make this be a subclass of log_user.
2749         (gcc::jit::tempdir::tempdir): Add logger param.
2750         * notes.txt: Update to show the two possible places where the
2751         tempdir can be cleaned up.
2753 2015-01-08  David Malcolm  <dmalcolm@redhat.com>
2755         * libgccjit.h (struct gcc_jit_context): Rewrite the descriptive
2756         comment.
2758 2015-01-08  David Malcolm  <dmalcolm@redhat.com>
2760         * docs/topics/contexts.rst (Error-handling): Document new
2761         entrypoint gcc_jit_context_get_last_error.
2762         * docs/_build/texinfo/libgccjit.texi: Regenerate.
2763         * jit-recording.c (gcc::jit::recording::context::context):
2764         Initialize new fields "m_last_error_str" and
2765         "m_owns_last_error_str".
2766         (gcc::jit::recording::context::~context): Clean up
2767         m_last_error_str, if needed.
2768         (gcc::jit::recording::context::add_error_va): Update
2769         m_last_error_str and m_owns_last_error_str, freeing the old
2770         value if appropriate.
2771         (gcc::jit::recording::context::get_last_error): New function.
2772         * jit-recording.h (gcc::jit::recording::context::get_last_error):
2773         New function.
2774         (gcc::jit::recording::context): New fields m_last_error_str and
2775         m_owns_last_error_str.
2776         * libgccjit.c (gcc_jit_context_get_last_error): New function.
2777         * libgccjit.h (gcc_jit_context_get_last_error): New declaration.
2778         * libgccjit.map (gcc_jit_context_get_last_error): New function.
2780 2015-01-08  David Malcolm  <dmalcolm@redhat.com>
2782         * Make-lang.in (jit_OBJS): Add jit/jit-logging.o.
2783         * docs/internals/index.rst (Overview of code structure): Mention
2784         gcc_jit_context_set_logfile, and embed the example logfile.
2785         * docs/internals/test-hello-world.exe.log.txt: New file: example
2786         of a logfile.
2787         * docs/topics/contexts.rst (Debugging): Add documentation
2788         for gcc_jit_context_set_logfile.
2789         * docs/_build/texinfo/libgccjit.texi: Regenerate.
2790         * dummy-frontend.c: Include "jit-logging.h".
2791         (jit_langhook_init): Assert that there is an active playback
2792         context.  If it has a logger, log entry/exit to this function.
2793         (jit_langhook_write_globals): Likewise.
2794         * jit-common.h (gcc::jit::logger): New forward declaration.
2795         * jit-logging.c: New file.
2796         * jit-logging.h: New file.
2797         * jit-playback.c: Include "jit-logging.h".
2798         (gcc::jit::playback::context::context): Initialize the log_user
2799         base class from the recording context's logger (if any).  Use
2800         JIT_LOG_SCOPE to log entry/exit from the function body.
2801         (gcc::jit::playback::context::~context): Use JIT_LOG_SCOPE to
2802         log entry/exit from the function body.
2803         (gcc::jit::playback::build_stmt_list): Likewise.
2804         (gcc::jit::playback::function::postprocess): Likewise.
2805         (gcc::jit::playback::context::compile): Likewise.  Log the
2806         entry/exit to toplev::main and toplev::finalize.  Log the
2807         fake argv passed to toplev::main.
2808         (gcc::jit::playback::context::acquire_mutex): Use JIT_LOG_SCOPE to
2809         log entry/exit from the function body.
2810         (gcc::jit::playback::context::release_mutex): Likewise.
2811         (gcc::jit::playback::context::make_fake_args): Likewise.
2812         (gcc::jit::playback::context::extract_any_requested_dumps):
2813         Likewise.
2814         (gcc::jit::playback::context::convert_to_dso): Likewise. Also,
2815         log the arguments that the driver is invoked with.
2816         (gcc::jit::playback::context::dlopen_built_dso): Likewise.  Pass
2817         the logger to the result object.
2818         (gcc::jit::playback::context::replay): Use JIT_LOG_SCOPE to
2819         log entry/exit from the function body.
2820         (gcc::jit::playback::context::dump_generated_code): Likewise.
2821         (gcc::jit::playback::context::handle_locations): Likewise.
2822         * jit-playback.h (gcc::jit::playback::context): Make this be
2823         a subclass of gcc::jit::log_user.
2824         * jit-recording.c: Include "jit-logging.h".
2825         (gcc::jit::recording::context::context: Initialize the logger to
2826         NULL for root contexts, or to the parent's logger for child
2827         contexts.
2828         (gcc::jit::recording::context::~context): Use JIT_LOG_SCOPE to
2829         log entry/exit from the function body.
2830         (gcc::jit::recording::context::replay_into): Likewise.
2831         (gcc::jit::recording::context::disassociate_from_playback):
2832         Likewise.
2833         (gcc::jit::recording::context::compile): Likewise.
2834         (recording::context::add_error_va): Likewise.  Also, log the
2835         error.
2836         (gcc::jit::recording::context::validate): Use JIT_LOG_SCOPE to
2837         log entry/exit from the function body.
2838         * jit-recording.h: Include "jit-logging.h".
2839         (gcc::jit::recording::context): Make this be a subclass of
2840         gcc::jit::log_user.
2841         * jit-result.c: Include "jit-common.h" and "jit-logging.h".
2842         (gcc::jit::result::result): Add logger param, recording it.
2843         Use JIT_LOG_SCOPE to log entry/exit from the function body.
2844         (gcc::jit::result::~result(): Use JIT_LOG_SCOPE to
2845         log entry/exit from the function body.
2846         (gcc::jit::result::get_code): Likewise.
2847         * jit-result.h (gcc::jit::result): Make this be a subclass of
2848         gcc::jit::log_user.
2849         (gcc::jit::result::result): Add logger parameter.
2850         * libgccjit++.h (gccjit::context::set_logfile): New function.
2851         * libgccjit.c: Include "jit-logging.h".
2852         (gcc_jit_context_acquire): Log the context.
2853         (gcc_jit_context_release): Use JIT_LOG_FUNC to
2854         log entry/exit from the function body, and log the context.
2855         (gcc_jit_context_new_child_context): Likewise, logging both
2856         contexts.
2857         (gcc_jit_context_new_location): Use JIT_LOG_FUNC to
2858         log entry/exit from the function body.
2859         (gcc_jit_context_get_type): Likewise.
2860         (gcc_jit_context_get_int_type): Likewise.
2861         (gcc_jit_context_new_array_type): Likewise.
2862         (gcc_jit_context_new_field): Likewise.
2863         (gcc_jit_context_new_struct_type): Likewise.
2864         (gcc_jit_context_new_opaque_struct): Likewise.
2865         (gcc_jit_struct_set_fields): Likewise.
2866         (gcc_jit_context_new_union_type): Likewise.
2867         (gcc_jit_context_new_function_ptr_type): Likewise.
2868         (gcc_jit_context_new_param): Likewise.
2869         (gcc_jit_context_new_function): Likewise.
2870         (gcc_jit_context_get_builtin_function): Likewise.
2871         (gcc_jit_function_get_param): Likewise.
2872         (gcc_jit_function_dump_to_dot): Likewise.
2873         (gcc_jit_function_new_block): Likewise.
2874         (gcc_jit_context_new_global): Likewise.
2875         (gcc_jit_context_new_rvalue_from_int): Likewise.
2876         (gcc_jit_context_zero): Likewise.
2877         (gcc_jit_context_one): Likewise.
2878         (gcc_jit_context_new_rvalue_from_double): Likewise.
2879         (gcc_jit_context_new_rvalue_from_ptr): Likewise.
2880         (gcc_jit_context_null): Likewise.
2881         (gcc_jit_context_new_string_literal): Likewise.
2882         (gcc_jit_context_new_unary_op): Likewise.
2883         (gcc_jit_context_new_binary_op): Likewise.
2884         (gcc_jit_context_new_comparison): Likewise.
2885         (gcc_jit_context_new_call): Likewise.
2886         (gcc_jit_context_new_call_through_ptr): Likewise.
2887         (gcc_jit_context_new_cast): Likewise.
2888         (gcc_jit_context_new_array_access): Likewise.
2889         (gcc_jit_lvalue_access_field): Likewise.
2890         (gcc_jit_rvalue_access_field): Likewise.
2891         (gcc_jit_rvalue_dereference_field): Likewise.
2892         (gcc_jit_rvalue_dereference): Likewise.
2893         (gcc_jit_lvalue_get_address): Likewise.
2894         (gcc_jit_function_new_local): Likewise.
2895         (gcc_jit_block_add_eval): Likewise.
2896         (gcc_jit_block_add_assignment): Likewise.
2897         (gcc_jit_block_add_assignment_op): Likewise.
2898         (gcc_jit_block_end_with_conditional): Likewise.
2899         (gcc_jit_block_add_comment): Likewise.
2900         (gcc_jit_block_end_with_jump): Likewise.
2901         (gcc_jit_block_end_with_return): Likewise.
2902         (gcc_jit_block_end_with_void_return): Likewise.
2903         (gcc_jit_context_set_str_option): Likewise.
2904         (gcc_jit_context_set_int_option): Likewise.
2905         (gcc_jit_context_set_bool_option): Likewise.
2906         (gcc_jit_context_enable_dump): Likewise.
2907         (gcc_jit_context_compile): Likewise.  Also log the context,
2908         and the result.
2909         (gcc_jit_context_dump_to_file): Likewise.
2910         (gcc_jit_context_set_logfile): New function.
2911         (gcc_jit_context_get_first_error): Use JIT_LOG_FUNC to
2912         log entry/exit from the function body.
2913         (gcc_jit_result_get_code): Likewise.  Also log the fnname)
2914         and the ptr to be returned.
2915         (gcc_jit_result_release): Likewise.  Also log the result.
2916         * libgccjit.h: Include <stdio.h>, since we need FILE *.
2917         (gcc_jit_context_set_logfile): New declaration.
2918         * libgccjit.map (gcc_jit_context_set_logfile): New.
2920 2015-01-07  David Malcolm  <dmalcolm@redhat.com>
2922         * jit-recording.h (gcc::jit::recording::type::is_void): New
2923         virtual function.
2924         (gcc::jit::recording::memento_of_get_type::is_void): New
2925         function, overriding default implementation.
2926         * libgccjit.c (gcc_jit_rvalue_dereference): Verify that
2927         the underlying type is not "void".
2929 2015-01-07  David Malcolm  <dmalcolm@redhat.com>
2931         * docs/topics/expressions.rst (Unary Operations): Add
2932         GCC_JIT_UNARY_OP_ABS.
2933         * jit-playback.c (gcc::jit::playback::context::new_unary_op):
2934         Likewise.
2935         * jit-recording.c (unary_op_strings): Likewise.
2936         * libgccjit.c (gcc_jit_context_new_unary_op): Update checking
2937         of "op" to reflect addition of GCC_JIT_UNARY_OP_ABS.
2938         * libgccjit.h (enum gcc_jit_unary_op): Add GCC_JIT_UNARY_OP_ABS.
2939         * docs/_build/texinfo/libgccjit.texi: Regenerate.
2941 2015-01-07  David Malcolm  <dmalcolm@redhat.com>
2943         * jit-recording.h (gcc::jit::recording::memento_of_get_type): Fix
2944         typo in comment.
2946 2015-01-07  David Malcolm  <dmalcolm@redhat.com>
2948         * TODO.rst (Test suite): Remove item about running C++ testcases.
2949         * docs/internals/index.rst (Working on the JIT library): Add
2950         "c++" to the enabled languages in the suggested "configure"
2951         invocation, and add a description of why this is necessary.
2952         * docs/_build/texinfo/libgccjit.texi: Regenerate.
2954 2015-01-07  David Malcolm  <dmalcolm@redhat.com>
2956         * docs/internals/index.rst: Update to reflect that built
2957         testcases are now test-foo.c.exe, rather than test-foo.exe.
2958         * docs/_build/texinfo/libgccjit.texi: Regenerate.
2960 2015-01-05  Jakub Jelinek  <jakub@redhat.com>
2962         Update copyright years.
2964 2014-12-19  David Malcolm  <dmalcolm@redhat.com>
2966         * jit-playback.c (gcc::jit::playback::context::build_cast): In
2967         case BOOLEAN_TYPE, don't assume that the source expression is
2968         of type "int".
2970 2014-12-19  David Malcolm  <dmalcolm@redhat.com>
2972         * jit-recording.c (gcc::jit::recording::context::context): When
2973         copying string options from a parent context, take a copy of the
2974         underlying buffers, rather than simply copying the pointer.
2976 2014-12-19  David Malcolm  <dmalcolm@redhat.com>
2978         * jit-recording.c (gcc::jit::recording::context::set_str_option):
2979         Handle NULL.
2981 2014-12-11  David Malcolm  <dmalcolm@redhat.com>
2983         * docs/cp/topics/contexts.rst (gccjit::context::set_str_option):
2984         Document new function.
2985         * docs/_build/texinfo/libgccjit.texi: Regenerate.
2987 2014-12-10  Ulrich Drepper  <drepper@gmail.com>
2989         Minor interface cleanups of libgccjit
2990         * jit-playback.c (convert_to_dso): Use auto_vec instead
2991         of automatic array to build up command line.
2992         * jit-recording.c (recording::context::set_str_option):
2993         Make copy of the string.
2994         (recording::context::~context): Free string options.
2995         * jit-recording.h (recording::context): Adjust type
2996         of m_str_options member.
2997         * libgccjit.h: Adjust comment about
2998         gcc_jit_context_set_str_option parameter being used after
2999         the call.
3000         Update comment now that all interfaces are copy strings
3001         if necessary.
3002         * libgccjit++.h (gccjit::context): Add set_str_option
3003         member function.
3005 2014-12-10  David Malcolm  <dmalcolm@redhat.com>
3007         * docs/cp/index.rst: New file.
3008         * docs/cp/intro/index.rst: New file.
3009         * docs/cp/intro/tutorial01.rst: New file.
3010         * docs/cp/intro/tutorial02.rst: New file.
3011         * docs/cp/intro/tutorial03.rst: New file.
3012         * docs/cp/intro/tutorial04.rst: New file.
3013         * docs/cp/topics/contexts.rst: New file.
3014         * docs/cp/topics/expressions.rst: New file.
3015         * docs/cp/topics/functions.rst: New file.
3016         * docs/cp/topics/index.rst: New file.
3017         * docs/cp/topics/locations.rst: New file.
3018         * docs/cp/topics/objects.rst: New file.
3019         * docs/cp/topics/results.rst: New file.
3020         * docs/cp/topics/types.rst: New file.
3021         * docs/examples/tut01-hello-world.cc: New file.
3022         * docs/examples/tut02-square.c: Fix missing newline in output.
3023         * docs/examples/tut02-square.cc: New file.
3024         * docs/examples/tut03-sum-of-squares.cc: New file.
3025         * docs/examples/tut04-toyvm/toyvm.cc: New file.
3026         * docs/index.rst: Move summary to above the table of contents.
3027         Add text about the C vs C++ APIs.
3028         * docs/topics/contexts.rst: Fix a typo.
3030         * docs/_build/texinfo/libgccjit.texi: Regenerate.
3031         * docs/_build/texinfo/factorial1.png: New file.
3032         * docs/_build/texinfo/sum-of-squares1.png: New file.
3034 2014-12-09  David Malcolm  <dmalcolm@redhat.com>
3036         * docs/examples/tut04-toyvm/toyvm.c (toyvm_function_compile): Move
3037         logic for determine "funcname" to new function...
3038         (get_function_name): ...here, adding logic to skip any leading
3039         path from the filename.
3040         (toyvm_function_parse): Use the filename for fn_filename, rather
3041         than "name", so that the debugger can locate the source .toy
3042         file.
3043         (toyvm_function_parse): Don't fclose a NULL FILE *.
3045 2014-12-09  David Malcolm  <dmalcolm@redhat.com>
3047         PR jit/63854
3048         * docs/internals/index.rst (Running under valgrind): New
3049         subsection.
3050         (docs/_build/texinfo/libgccjit.texi): Regenerate.
3052 2014-12-09  David Malcolm  <dmalcolm@redhat.com>
3054         PR jit/64206
3055         * Make-lang.in (jit_OBJS): Add jit/jit-tempdir.o.
3056         * jit-common.h (gcc::jit::tempdir): New forward decl.
3057         * jit-playback.c: Include jit-tempdir.h.
3058         (gcc::jit::playback::context::context): Initialize m_tempdir.
3059         (gcc::jit::playback::context::~context): Move tempdir
3060         cleanup to new file jit-tempdir.c
3061         (make_tempdir_path_template): Move to new file jit-tempdir.c.
3062         (gcc::jit::playback::context::compile): Move tempdir creation
3063         to new tempdir object in new file jit-tempdir.c.
3064         (gcc::jit::playback::context::make_fake_args): Get path from
3065         tempdir object rather than from member data.
3066         (gcc::jit::playback::context::convert_to_dso): Likewise.
3067         (gcc::jit::playback::context::dlopen_built_dso): Likewise.
3068         (gcc::jit::playback::context::dump_generated_code): Likewise.
3069         (gcc::jit::playback::context::get_path_c_file): New function.
3070         (gcc::jit::playback::context::get_path_s_file): New function.
3071         (gcc::jit::playback::context::get_path_so_file): New function.
3072         * jit-playback.h (gcc::jit::playback::context::get_path_c_file):
3073         New function.
3074         (gcc::jit::playback::context::get_path_s_file): New function.
3075         (gcc::jit::playback::context::get_path_so_file): New function.
3076         (gcc::jit::playback::context): Move fields "m_path_template",
3077         "m_path_tempdir", "m_path_c_file", "m_path_s_file",
3078         "m_path_so_file" to new jit::tempdir class; add field "m_tempdir".
3079         * jit-tempdir.c: New file.
3080         * jit-tempdir.h: New file.
3082 2014-12-09  David Malcolm  <dmalcolm@redhat.com>
3084         * jit-playback.c (gcc::jit::playback::context::compile): Acquire the
3085         mutex here, immediately before using toplev, and release it here, on
3086         each exit path after acquisition.
3087         (jit_mutex): Move this variable here, from jit-recording.c.
3088         (gcc::jit::playback::context::acquire_mutex): New function, based on
3089         code in jit-recording.c.
3090         (gcc::jit::playback::context::release_mutex): Likewise.
3091         * jit-playback.h (gcc::jit::playback::context::acquire_mutex): New
3092         function.
3093         (gcc::jit::playback::context::release_mutex): New function.
3094         * jit-recording.c (jit_mutex): Move this variable to jit-playback.c.
3095         (gcc::jit::recording::context::compile): Move mutex-handling from
3096         here into jit-playback.c's gcc::jit::playback::context::compile.
3097         * notes.txt: Update to show the new locations of ACQUIRE_MUTEX
3098         and RELEASE_MUTEX.
3100 2014-12-09  David Malcolm  <dmalcolm@redhat.com>
3102         * jit-playback.c (gcc::jit::playback::context::compile): Move the
3103         dlopen code into...
3104         (gcc::jit::playback::context::dlopen_built_dso): ...this new
3105         function.
3106         * jit-playback.h (gcc::jit::playback::context::dlopen_built_dso):
3107         New function.
3109 2014-12-09  David Malcolm  <dmalcolm@redhat.com>
3111         PR jit/64166
3112         * docs/topics/contexts.rst (Debugging): Add description of
3113         gcc_jit_context_enable_dump.
3114         * docs/_build/texinfo/libgccjit.texi: Regenerate.
3115         * jit-playback.c: Include context.h.
3116         (class auto_argvec): New class.
3117         (auto_argvec::~auto_argvec): New function.
3118         (gcc::jit::playback::context::compile): Convert fake_args to be
3119         an auto_argvec, so that it can contain dynamically-allocated
3120         strings.   Construct a vec of all requested dumps, and pass it to
3121         make_fake_args.  Extract requested dumps between the calls to
3122         toplev::main and toplev::finalize.
3123         (gcc::jit::playback::context::make_fake_args): Convert param
3124         "argvec" to be a vec <char *>, and gain a "requested_dumps"
3125         param.  Convert to dynamically-allocated arg strings by converting
3126         ADD_ARG to take a copy of the arg, and add ADD_ARG_TAKE_OWNERSHIP
3127         for args that are already a copy.  Add args for all requested dumps.
3128         (gcc::jit::playback::context::extract_any_requested_dumps): New
3129         function.
3130         (gcc::jit::playback::context::read_dump_file): New function.
3131         * jit-playback.h (gcc::jit::playback::context::make_fake_args):
3132         Convert param "argvec" to be a vec <char *>, and gain a
3133         "requested_dumps" param.
3134         (gcc::jit::playback::context::extract_any_requested_dumps): New
3135         function.
3136         (gcc::jit::playback::context::read_dump_file): New function.
3137         * jit-recording.c (gcc::jit::recording::context::enable_dump): New
3138         function.
3139         (gcc::jit::recording::context::get_all_requested_dumps): New
3140         function.
3141         * jit-recording.h (gcc::jit::recording::requested_dump): New
3142         struct.
3143         (gcc::jit::recording::context::enable_dump): New function.
3144         (gcc::jit::recording::context::get_all_requested_dumps): New
3145         function.
3146         (gcc::jit::recording::context::m_requested_dumps): New field.
3147         * libgccjit.c (gcc_jit_context_enable_dump): New API entrypoint.
3148         * libgccjit.h (gcc_jit_context_enable_dump): New API entrypoint.
3149         * libgccjit.map (gcc_jit_context_enable_dump): New API entrypoint.
3151 2014-12-08  David Malcolm  <dmalcolm@redhat.com>
3153         * libgccjit++.h: Indent the forward declarations of the classes to
3154         show the inheritance hierarchy.
3156 2014-12-08  David Malcolm  <dmalcolm@redhat.com>
3158         * notes.txt: Show the beginning and ending of
3159         recording::context::compile vs playback::context::compile.  Show
3160         the creation and unlinking of the tempdir.  Show toplev::finalize.
3161         Move "RELEASE MUTEX" to the correct location.  Show
3162         gcc_jit_result_release, and indicate where the
3163         dlopen/dlsym/dlclose occur.
3165 2014-12-01  David Malcolm  <dmalcolm@redhat.com>
3167         * docs/examples/tut02-square.c (main): Release the context
3168         earlier, to show that this is possible.  Update error-handling
3169         to avoid a double-release of the context, and to avoid
3170         releasing a NULL result.
3171         * docs/intro/tutorial02.rst: Discuss gcc_jit_context_release.
3172         * docs/topics/functions.rst (GCC_JIT_FUNCTION_EXPORTED): Emphasize
3173         * docs/topics/results.rst (gcc_jit_result): Mention that this
3174         controls the lifetimes of machine code functions.
3175         (gcc_jit_result_get_code): Spell out the requirements for this
3176         to succeed, and the lifetime of the result.
3177         (gcc_jit_result_release): Mention that this invalidates any code
3178         that was obtained from the result.
3179         * docs/_build/texinfo/libgccjit.texi: Regenerate.
3181 2014-12-01  David Malcolm  <dmalcolm@redhat.com>
3183         PR jit/64018
3184         * docs/intro/tutorial02.rst: Spell out lifetime of generated code.
3185         Add description of error-handling, taken in part from...
3186         * docs/topics/contexts.rst (Error-handling): Expand, and move some
3187         content to tutorial02.rst.
3188         * docs/_build/texinfo/libgccjit.texi: Regenerate.
3190 2014-12-01  David Malcolm  <dmalcolm@redhat.com>
3192         PR jit/64020
3193         * docs/topics/types.rst (Standard types) Add new enum values to
3194         the table of enum gcc_jit_types: GCC_JIT_TYPE_COMPLEX_FLOAT,
3195         GCC_JIT_TYPE_COMPLEX_DOUBLE, GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE.
3196         Widen the left-hand column so that
3197         GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE will fit.
3198         * docs/_build/texinfo/libgccjit.texi: Regenerate.
3200         * jit-builtins.c: Include stringpool.h and jit-playback.h.
3201         Move everything out of the gcc::jit::recording namespace into
3202         just gcc::jit.
3203         (struct builtin_data): Add fields "fnclass", "attr", and
3204         "implicit_p".
3205         (DEF_BUILTIN): Update macro so populate the new fields.
3206         (builtins_manager::builtins_manager): Update for move out of
3207         recording namespace.  Initialize the m_attributes array.
3208         (builtins_manager::get_builtin_function): Likewise.
3209         (builtins_manager::get_builtin_function_by_id): New function.
3210         (builtins_manager::make_builtin_function): Update for move out of
3211         recording namespace.  Add fix for PR jit/64020 by detecting
3212         specific builtin ids and having them ensure that builtins for
3213         other ids are created as necessary.
3214         (builtins_manager::get_type): Update for move out of recording
3215         namespace.
3216         (builtins_manager::make_type): Likewise.  Add some missing
3217         #undefs.
3218         (builtins_manager::make_primitive_type): Update for move out of
3219         recording namespace.  Implement the three BT_COMPLEX_ cases and
3220         BT_DOUBLE_PTR.
3221         (builtins_manager::make_fn_type): Update for move out of recording
3222         namespace.
3223         (builtins_manager::make_ptr_type): Likewise.
3224         (builtins_manager::finish_playback): New function.
3225         (builtins_manager::get_class): New function.
3226         (builtins_manager::implicit_p): New function.
3227         (builtins_manager::get_attrs_tree): Two new functions.
3228         (builtins_manager::make_attrs_tree): New function.
3230         * jit-builtins.h: Move everything out of the gcc::jit::recording
3231         namespace into just gcc::jit.
3232         (enum built_in_attribute): New.
3233         (builtins_manager::builtins_manager): Update decl for namespace
3234         change.
3235         (builtins_manager::get_builtin_function): Likewise.
3236         (builtins_manager::get_class): New.
3237         (builtins_manager::implicit_p): New.
3238         (builtins_manager::get_attrs_tree): Two new functions.
3239         (builtins_manager::make_attrs_tree): New function.
3240         (builtins_manager::finish_playback): New.
3241         (builtins_manager::get_builtin_function_by_id): New.
3242         (builtins_manager::make_builtin_function): Update decl for
3243         namespace change.
3244         (builtins_manager::get_type): Likewise.
3245         (builtins_manager::make_type): Likewise.
3246         (builtins_manager::make_primitive_type): Likewise.
3247         (builtins_manager::make_fn_type): Likewise.
3248         (builtins_manager::make_ptr_type): Likewise.
3249         (builtins_manager): Likewise for fields.  Add new field
3250         "m_attributes".
3252         * jit-common.h (NUM_GCC_JIT_TYPES): Update.
3253         (builtins_manager): Update forward decl to reflect namespace
3254         change.
3256         * jit-playback.c: Include attribs.h and jit-builtins.h.
3257         (gcc::jit::playback::context::get_tree_node_for_type): Add cases
3258         for the new COMPLEX_ types.
3259         (gcc::jit::playback::context::new_function): If creating a
3260         builtin, set the DECL_BUILT_IN_CLASS and attributes on the fndecl,
3261         and call set_builtin_decl.
3262         (gcc::jit::playback::context::replay): If we have a
3263         builtins_manager, call its finish_playback method when we're done.
3265         * jit-playback.h:
3266         (gcc::jit::playback::context::get_builtins_manager): New function.
3268         * jit-recording.c
3269         (gcc::jit::recording::context::get_builtins_manager): New function.
3270         (gcc::jit::recording::get_builtin_function): Use
3271         get_builtins_manager, in case we're a child context.
3272         (gcc::jit::recording::memento_of_get_type::dereference): Add the
3273         COMPLEX_ types.
3274         (gcc::jit::recording::memento_of_get_type::is_int): Likewise.
3275         (gcc::jit::recording::memento_of_get_type::is_float): Likewise.
3276         (gcc::jit::recording::memento_of_get_type::is_bool): Likewise.
3277         (get_type_strings): Likewise.
3279         * jit-recording.h
3280         (gcc::jit::recording::context::get_builtins_manager): New.
3282         * libgccjit.h (enum gcc_jit_types): Add
3283         GCC_JIT_TYPE_COMPLEX_FLOAT, GCC_JIT_TYPE_COMPLEX_DOUBLE,
3284         GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE.
3286 2014-12-01  David Malcolm  <dmalcolm@redhat.com>
3288         * jit-builtins.c
3289         (gcc::jit::recording::builtins_manager::get_builtin_function):
3290         Check for NULL return from make_builtin_function.
3291         (gcc::jit::recording::builtins_manager::make_builtin_function):
3292         Check for NULL return from get_type.
3294 2014-12-01  David Malcolm  <dmalcolm@redhat.com>
3296         * jit-playback.c (gcc::jit::playback::context::compile): Move DSO
3297         creation code into...
3298         (gcc::jit::playback::context::convert_to_dso): New function.
3299         * jit-playback.h (gcc::jit::playback::context::convert_to_dso):
3300         New function.
3302 2014-12-01  David Malcolm  <dmalcolm@redhat.com>
3304         * jit-playback.c (gcc::jit::playback::context::compile): Use an
3305         auto_vec<const char *> rather than a const char *[20] for the
3306         top-level argv, and move the logic to build it to...
3307         (gcc::jit::playback::context::make_fake_args): New function.
3308         * jit-playback.h (gcc::jit::playback::context::make_fake_args):
3309         New function.
3311 2014-12-01  David Malcolm  <dmalcolm@redhat.com>
3313         * Make-lang.in (jit_OBJS): Add jit/jit-result.o.
3314         * jit-playback.c: Include new header jit-result.h.
3315         (gcc::jit::result::result): Move to new file jit-result.c.
3316         (gcc::jit::result::~result): Likewise.
3317         (gcc::jit::playback::result): Likewise.
3318         * jit-recording.h (class gcc::jit::result): Move to new
3319         header jit-result.h.
3320         * jit-result.c: New file, to contain...
3321         (gcc::jit::result::result): Move here from jit-playback.c,
3322         removing erroneous "playback" namespace from comment.
3323         (gcc::jit::result::~result): Likewise.
3324         (gcc::jit::playback::result): Likewise.
3325         * jit-result.h: New file, to contain...
3326         (class gcc::jit::result): Move from jit-recording.h.
3327         * libgccjit.c: Include jit-result.h.
3328         (gcc_jit_result_get_code): Update comment to reflect move
3329         of implementation.
3330         (gcc_jit_result_release): Likewise.
3332 2014-12-01  David Malcolm  <dmalcolm@redhat.com>
3334         PR jit/63854
3335         * docs/examples/tut04-toyvm/toyvm.c
3336         (toyvm_compiled_function): New typedef.
3337         (toyvm_compiled_func) Rename to...
3338         (toyvm_compiled_code) ...this.
3339         (struct toyvm_compiled_function): New struct.
3340         (toyvm_function_compile): Return a toyvm_compiled_function *
3341         rather than a toyvm_compiled_func, so that the caller can fully
3342         clean things up.  Free "funcname".
3343         (test_script): Update for change to toyvm_function_compile.
3344         Clean up the toyvm_compiled_function.
3345         (main): Likewise.
3346         (docs/intro/tutorial04.rst): Update to reflect the above changes,
3347         and to better spell out the lifetime of the compiled code.
3349 2014-12-01  David Malcolm  <dmalcolm@redhat.com>
3351         PR jit/63854
3352         * jit-builtins.c
3353         (gcc::jit::recording::builtins_manager::make_fn_type): Call the
3354         context's new_function_type method, rather than directly creating
3355         a function_type instance.
3356         * jit-recording.c
3357         (gcc::jit::recording::context::new_function_type): New method,
3358         adapted from part of...
3359         (gcc::jit::recording::context::new_function_ptr_type): ...this.
3360         Update to call new_function_type.
3361         * jit-recording.h
3362         (gcc::jit::recording::context::new_function_type): New method.
3364 2014-12-01  David Malcolm  <dmalcolm@redhat.com>
3366         PR jit/63969
3367         * jit-playback.c: Ensure that ctxt_progname is non-NULL.
3369 2014-11-19  David Malcolm  <dmalcolm@redhat.com>
3371         PR jit/63854
3372         * jit-playback.c (gcc::jit::playback::compound_type::set_fields):
3373         Convert param from const vec<playback::field *> & to
3374         const auto_vec<playback::field *> *.
3375         (gcc::jit::playback::context::new_function_type): Convert param
3376         "param_types" from vec<type *> * to const auto_vec<type *> *.
3377         (gcc::jit::playback::context::new_function): Convert param
3378         "params" from vec<param *> * to const auto_vec<param *> *.
3379         (gcc::jit::playback::context::build_call): Convert param "args"
3380         from vec<rvalue *> to const auto_vec<rvalue *> *.
3381         (gcc::jit::playback::context::new_call): Likewise.
3382         (gcc::jit::playback::context::new_call_through_ptr): Likewise.
3383         (wrapper_finalizer): New function.
3384         (gcc::jit::playback::wrapper::operator new): Call the finalizer
3385         variant of ggc_internal_cleared_alloc, supplying
3386         wrapper_finalizer.
3387         (gcc::jit::playback::function::finalizer): New.
3388         (gcc::jit::playback::block::finalizer): New.
3389         (gcc::jit::playback::source_file::finalizer): New.
3390         (gcc::jit::playback::source_line::finalizer): New.
3392         * jit-playback.h
3393         (gcc::jit::playback::context::new_function_type): Convert param
3394         "param_types" from vec<type *> * to const auto_vec<type *> *.
3395         (gcc::jit::playback::context::new_function): Convert param
3396         "params" from vec<param *> * to const auto_vec<param *> *.
3397         (gcc::jit::playback::context::new_call): Convert param
3398         "args" from vec<rvalue *> to const auto_vec<rvalue *> *.
3399         (gcc::jit::playback::context::new_call_through_ptr): Likewise.
3400         (gcc::jit::playback::context::build_call): Likewise.
3401         (gcc::jit::playback::context): Convert fields "m_functions",
3402         "m_source_files", "m_cached_locations" from vec to auto_vec.
3403         (gcc::jit::playback::wrapper::finalizer): New virtual function.
3404         (gcc::jit::playback::compound_type::set_fields): Convert param fro
3405         const vec<playback::field *> & to
3406         const auto_vec<playback::field *> *.
3407         (gcc::jit::playback::function::finalizer): New.
3408         (gcc::jit::playback::block::finalizer): New.
3409         (gcc::jit::playback::source_file::finalizer): New.
3410         (gcc::jit::playback::source_line::finalizer): New.
3412         * jit-recording.c
3413         (gcc::jit::recording::function_type::replay_into): Convert local
3414         from a vec into an auto_vec.
3415         (gcc::jit::recording::fields::replay_into): Likewise.
3416         (gcc::jit::recording::function::replay_into): Likewise.
3417         (gcc::jit::recording::call::replay_into): Likewise.
3418         (gcc::jit::recording::call_through_ptr::replay_into): Likewise.
3420         * jit-recording.h (gcc::jit::recording::context): Convert fields
3421         "m_mementos", "m_compound_types", "m_functions" from vec<> to
3422         auto_vec <>.
3423         (gcc::jit::recording::function_type::get_param_types): Convert
3424         return type from vec<type *> to const vec<type *> &.
3425         (gcc::jit::recording::function_type): Convert field
3426         "m_param_types" from a vec<> to an auto_vec<>.
3427         (gcc::jit::recording::fields): Likewise for field "m_fields".
3428         (gcc::jit::recording::function::get_params): Convert return type
3429         from vec <param *> to const vec<param *> &.
3430         (gcc::jit::recording::function): Convert fields "m_params",
3431         "m_locals", "m_blocks" from vec<> to auto_vec<>.
3432         (gcc::jit::recording::block): Likewise for field "m_statements".
3433         vec<> to auto_vec<>.
3434         (gcc::jit::recording::call): Likewise for field "m_args".
3435         (gcc::jit::recording::call_through_ptr): Likewise.
3437 2014-11-19  David Malcolm  <dmalcolm@redhat.com>
3439         PR jit/63854
3440         * jit-recording.c (recording::function::validate): Convert
3441         "worklist" from vec<> to autovec<> to fix a leak.
3443 2014-11-11  David Malcolm  <dmalcolm@redhat.com>
3445         * ChangeLog.jit: New.
3446         * ChangeLog: New.
3447         * Make-lang.in: New.
3448         * TODO.rst: New.
3449         * config-lang.in: New.
3450         * docs/Makefile: New.
3451         * docs/_build/texinfo/Makefile: New.
3452         * docs/_build/texinfo/factorial.png: New.
3453         * docs/_build/texinfo/libgccjit.texi: New.
3454         * docs/_build/texinfo/sum-of-squares.png: New.
3455         * docs/conf.py: New.
3456         * docs/examples/tut01-hello-world.c: New.
3457         * docs/examples/tut02-square.c: New.
3458         * docs/examples/tut03-sum-of-squares.c: New.
3459         * docs/examples/tut04-toyvm/Makefile: New.
3460         * docs/examples/tut04-toyvm/factorial.toy: New.
3461         * docs/examples/tut04-toyvm/fibonacci.toy: New.
3462         * docs/examples/tut04-toyvm/toyvm.c: New.
3463         * docs/index.rst: New.
3464         * docs/internals/index.rst: New.
3465         * docs/intro/factorial.png: New.
3466         * docs/intro/index.rst: New.
3467         * docs/intro/sum-of-squares.png: New.
3468         * docs/intro/tutorial01.rst: New.
3469         * docs/intro/tutorial02.rst: New.
3470         * docs/intro/tutorial03.rst: New.
3471         * docs/intro/tutorial04.rst: New.
3472         * docs/topics/contexts.rst: New.
3473         * docs/topics/expressions.rst: New.
3474         * docs/topics/functions.rst: New.
3475         * docs/topics/index.rst: New.
3476         * docs/topics/locations.rst: New.
3477         * docs/topics/objects.rst: New.
3478         * docs/topics/results.rst: New.
3479         * docs/topics/types.rst: New.
3480         * dummy-frontend.c: New.
3481         * jit-builtins.c: New.
3482         * jit-builtins.h: New.
3483         * jit-common.h: New.
3484         * jit-playback.c: New.
3485         * jit-playback.h: New.
3486         * jit-recording.c: New.
3487         * jit-recording.h: New.
3488         * libgccjit++.h: New.
3489         * libgccjit.c: New.
3490         * libgccjit.h: New.
3491         * libgccjit.map: New.
3492         * notes.txt: New.
3494 2013-07-26  David Malcolm  <dmalcolm@redhat.com>
3496         * Initial creation
3498 Copyright (C) 2013-2022 Free Software Foundation, Inc.
3500 Copying and distribution of this file, with or without modification,
3501 are permitted in any medium without royalty provided the copyright
3502 notice and this notice are preserved.