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