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