1 2024-09-20 David Malcolm <dmalcolm@redhat.com>
4 * dummy-frontend.cc: Include "diagnostic-format-text.h".
5 (jit_begin_diagnostic): Convert first param from
6 diagnostic_context * to diagnostic_text_output_format &
7 (jit_end_diagnostic): Likewise. Update accordingly.
8 (jit_langhook_init): Update for renamings.
10 2024-09-18 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
12 * libgccjit.h: Include <sys/types.h>
14 2024-09-09 David Malcolm <dmalcolm@redhat.com>
17 * jit-playback.cc (add_diagnostic): Rename diagnostic_context's
18 "printer" field to "m_printer".
20 2024-09-02 Richard Sandiford <richard.sandiford@arm.com>
22 * jit-playback.cc (playback::block::add_extended_asm): Rename
23 ASM_INPUT_P to ASM_BASIC_P.
25 2024-07-24 David Malcolm <dmalcolm@redhat.com>
27 * jit-playback.cc (jit::playback_context::compile) Add a trailing
30 2024-07-05 Antoni Boucher <bouanto@zoho.com>
32 * jit-common.h: Add array_type class.
33 * jit-recording.h (type::dyn_cast_array_type,
34 memento_of_get_aligned::dyn_cast_array_type,
35 array_type::dyn_cast_array_type, array_type::is_same_type_as):
38 2024-07-05 Antoni Boucher <bouanto@zoho.com>
41 * docs/topics/types.rst: Document GCC_JIT_TYPE_BFLOAT16.
42 * jit-common.h: Update NUM_GCC_JIT_TYPES.
43 * jit-playback.cc (get_tree_node_for_type): Support bfloat16.
44 * jit-recording.cc (recording::memento_of_get_type::get_size,
45 recording::memento_of_get_type::dereference,
46 recording::memento_of_get_type::is_int,
47 recording::memento_of_get_type::is_signed,
48 recording::memento_of_get_type::is_float,
49 recording::memento_of_get_type::is_bool): Support bfloat16.
50 * libgccjit.h (enum gcc_jit_types): Add GCC_JIT_TYPE_BFLOAT16.
52 2024-06-29 Iain Sandoe <iain@sandoe.co.uk>
55 (recording::memento_of_typeinfo::make_debug_string): Default the value
57 (recording::memento_of_typeinfo::write_reproducer): Default the value
60 2024-06-27 Antoni Boucher <bouanto@zoho.com>
62 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_28): New ABI tag.
63 * docs/topics/expressions.rst: Document gcc_jit_context_new_alignof.
64 * jit-playback.cc (new_alignof): New method.
65 * jit-playback.h: New method.
66 * jit-recording.cc (recording::context::new_alignof): New
68 (recording::memento_of_sizeof::replay_into,
69 recording::memento_of_typeinfo::replay_into,
70 recording::memento_of_sizeof::make_debug_string,
71 recording::memento_of_typeinfo::make_debug_string,
72 recording::memento_of_sizeof::write_reproducer,
73 recording::memento_of_typeinfo::write_reproducer): Rename.
74 * jit-recording.h (enum type_info_type): New enum.
75 (class memento_of_sizeof class memento_of_typeinfo): Rename.
76 * libgccjit.cc (gcc_jit_context_new_alignof): New function.
77 * libgccjit.h (gcc_jit_context_new_alignof): New function.
78 * libgccjit.map: New function.
80 2024-06-25 Kewen Lin <linkw@linux.ibm.com>
82 * jit-recording.cc (recording::memento_of_get_type::get_size): Update
83 macros {FLOAT,DOUBLE,LONG_DOUBLE}_TYPE_SIZE by calling
84 targetm.c.mode_for_floating_type with
85 TI_{FLOAT,DOUBLE,LONG_DOUBLE}_TYPE.
87 2024-06-12 David Malcolm <dmalcolm@redhat.com>
89 * jit-recording.cc (recording::function::dump_to_dot): Update for
90 fields of pretty_printer becoming private.
92 2024-06-11 Andrew Pinski <quic_apinski@quicinc.com>
95 * jit-recording.cc: Define INCLUDE_SSTREAM before including
96 system.h and don't directly incldue sstream.
98 2024-04-09 Jakub Jelinek <jakub@redhat.com>
100 * docs/topics/expressions.rst (Constructor expressions): Fix
101 duplicated words; have have -> have.
103 2024-04-02 Iain Sandoe <iain@sandoe.co.uk>
105 * Make-lang.in: Implement exports list, and use a shared
107 * libgccjit.exports: New file.
109 2024-03-29 Guillaume Gomez <guillaume1.gomez@gmail.com>
111 * libgccjit.cc (gcc_jit_type_get_size): Add pointer support
113 2024-02-10 Jakub Jelinek <jakub@redhat.com>
115 * jit-playback.cc (new_bitcast): Use HOST_WIDE_INT_PRINT_DEC instead
116 of "%ld" and casts to long.
118 2024-02-02 Antoni Boucher <bouanto@zoho.com>
120 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_27): New ABI tag.
121 * docs/topics/expressions.rst: Document gcc_jit_context_new_sizeof.
122 * jit-playback.cc (new_sizeof): New method.
123 * jit-playback.h (new_sizeof): New method.
124 * jit-recording.cc (recording::context::new_sizeof,
125 recording::memento_of_sizeof::replay_into,
126 recording::memento_of_sizeof::make_debug_string,
127 recording::memento_of_sizeof::write_reproducer): New methods.
128 * jit-recording.h (class memento_of_sizeof): New class.
129 * libgccjit.cc (gcc_jit_context_new_sizeof): New function.
130 * libgccjit.h (gcc_jit_context_new_sizeof): New function.
131 * libgccjit.map: New function.
133 2024-01-19 Antoni Boucher <bouanto@zoho.com>
135 * jit-builtins.cc (ensure_optimization_builtins_exist): Add
138 2024-01-19 Antoni Boucher <bouanto@zoho.com>
140 * jit-recording.h (is_numeric_vector, vector_type::new_int): New
142 * libgccjit.cc (gcc_jit_context_new_unary_op,
143 gcc_jit_context_new_binary_op): add checks for
146 2024-01-12 Guillaume Gomez <guillaume1.gomez@gmail.com>
147 Antoni Boucher <bouanto@zoho.com>
149 * docs/topics/compatibility.rst: Add documentation for LIBGCCJIT_ABI_26.
150 * docs/topics/functions.rst: Add documentation for new functions.
151 * docs/topics/expressions.rst: Add documentation for new functions.
153 2024-01-12 Guillaume Gomez <guillaume1.gomez@gmail.com>
154 Antoni Boucher <bouanto@zoho.com>
156 * dummy-frontend.cc (handle_alias_attribute): New function.
157 (handle_always_inline_attribute): New function.
158 (handle_cold_attribute): New function.
159 (handle_fnspec_attribute): New function.
160 (handle_format_arg_attribute): New function.
161 (handle_format_attribute): New function.
162 (handle_noinline_attribute): New function.
163 (handle_target_attribute): New function.
164 (handle_used_attribute): New function.
165 (handle_visibility_attribute): New function.
166 (handle_weak_attribute): New function.
167 (handle_alias_ifunc_attribute): New function.
168 * jit-playback.cc (fn_attribute_to_string): New function.
169 (variable_attribute_to_string): New function.
170 (global_new_decl): Add attributes support.
171 (set_variable_attribute): New function.
172 (new_global): Add attributes support.
173 (new_global_initialized): Add attributes support.
174 (new_local): Add attributes support.
175 * jit-playback.h (fn_attribute_to_string): New function.
176 (set_variable_attribute): New function.
177 * jit-recording.cc (recording::lvalue::add_attribute): New function.
178 (recording::function::function): New function.
179 (recording::function::write_to_dump): Add attributes support.
180 (recording::function::add_attribute): New function.
181 (recording::function::add_string_attribute): New function.
182 (recording::function::add_integer_array_attribute): New function.
183 (recording::global::replay_into): Add attributes support.
184 (recording::local::replay_into): Add attributes support.
185 * jit-recording.h: Add attributes support.
186 * libgccjit.cc (gcc_jit_function_add_attribute): New function.
187 (gcc_jit_function_add_string_attribute): New function.
188 (gcc_jit_function_add_integer_array_attribute): New function.
189 (gcc_jit_lvalue_add_attribute): New function.
190 * libgccjit.h (enum gcc_jit_fn_attribute): New enum.
191 (gcc_jit_function_add_attribute): New function.
192 (gcc_jit_function_add_string_attribute): New function.
193 (gcc_jit_function_add_integer_array_attribute): New function.
194 (enum gcc_jit_variable_attribute): New function.
195 (gcc_jit_lvalue_add_string_attribute): New function.
196 * libgccjit.map: Declare new functions.
198 2023-12-06 David Malcolm <dmalcolm@redhat.com>
200 * dummy-frontend.cc (jit_begin_diagnostic): Make diagnostic_info
202 (jit_end_diagnostic): Likewise. Pass to add_diagnostic by
204 * jit-playback.cc (jit::playback::context::add_diagnostic):
205 Convert diagnostic_info to const reference.
206 * jit-playback.h (jit::playback::context::add_diagnostic):
209 2023-12-05 Richard Sandiford <richard.sandiford@arm.com>
211 * dummy-frontend.cc (jit_gnu_attribute_table): Add extra braces
212 to work around PR 16333 in older compilers.
213 (jit_format_attribute_table): Likewise.
215 2023-12-02 Richard Sandiford <richard.sandiford@arm.com>
217 * dummy-frontend.cc (jit_format_attribute_table): Change type to
218 scoped_attribute_specs, using...
219 (jit_format_attributes): ...this as the underlying array.
220 (jit_attribute_table): Change to an array of scoped_attribute_specs
222 (jit_gnu_attributes, jit_gnu_attribute_table): ...these new globals
223 for the original array. Include the format attributes.
224 (LANG_HOOKS_COMMON_ATTRIBUTE_TABLE): Delete.
225 (LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE): Delete.
226 (LANG_HOOKS_ATTRIBUTE_TABLE): Define.
228 2023-11-09 Guillaume Gomez <guillaume1.gomez@gmail.com>
232 2023-11-04 David Malcolm <dmalcolm@redhat.com>
234 * jit-playback.cc: Update for changes to diagnostic_context.
235 * jit-playback.h: Likewise.
237 2023-10-25 Vibhav Pant <vibhavp@gmail.com>
239 * jit-recording.cc (recording::global::write_to_dump): Fix
240 dump of string literal initializers.
242 2023-10-22 Iain Sandoe <iain@sandoe.co.uk>
244 * Make-lang.in: Handle Darwin rpaths.
246 2023-10-02 David Malcolm <dmalcolm@redhat.com>
248 * dummy-frontend.cc (jit_langhook_init): Update for change to
249 diagnostic_context callbacks.
251 2023-08-31 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
253 * jit-playback.cc: Change spelling to macOS.
255 2023-08-29 Guillaume Gomez <guillaume1.gomez@gmail.com>
257 * docs/topics/compatibility.rst: Add documentation for LIBGCCJIT_ABI_25.
258 * docs/topics/types.rst: Add documentation for gcc_jit_type_get_restrict.
260 2023-08-29 Guillaume Gomez <guillaume1.gomez@gmail.com>
262 * jit-playback.cc: Remove trailing whitespace characters.
263 * jit-playback.h: Add get_restrict method.
264 * jit-recording.cc: Add get_restrict methods.
265 * jit-recording.h: Add get_restrict methods.
266 * libgccjit++.h: Add get_restrict methods.
267 * libgccjit.cc: Add gcc_jit_type_get_restrict.
268 * libgccjit.h: Declare gcc_jit_type_get_restrict.
269 * libgccjit.map: Declare gcc_jit_type_get_restrict.
271 2023-02-16 Patrick Palka <ppalka@redhat.com>
273 * jit-dejagnu.h: Mechanically drop static from static inline
274 functions via s/^static inline/inline/g.
275 * jit-recording.h: Likewise.
277 2023-01-07 LIU Hao <lh_mouse@126.com>
280 * jit-w32.h: Define `WIN32_LEAN_AND_MEAN` before <windows.h>.
282 2022-12-21 Martin Liska <mliska@suse.cz>
284 * jit-playback.h: Use unused attribute.
286 2022-12-14 Antoni Boucher <bouanto@zoho.com>
287 Guillaume Gomez <guillaume1.gomez@gmail.com>
290 * jit-recording.h: Add vector_type::is_same_type_as method
292 2022-12-07 Antoni Boucher <bouanto@zoho.com>
293 Guillaume Gomez <guillaume1.gomez@gmail.com>
296 * jit-playback.cc: Fix vector float comparison
297 * jit-playback.h: Update comparison function signature
298 * jit-recording.cc: Update call for "new_comparison" function
299 * jit-recording.h: Fix vector float comparison
301 2022-11-20 Jeff Law <jlaw@ventanamicro.com>
304 * jit-playback.cc (playback::lvale::mark_addressable): Remove
307 2022-11-19 Jonathan Wakely <jwakely@redhat.com>
308 LIU Hao <lh_mouse@126.com>
310 * jit-playback.cc (playback::context::scoped_lock): Define RAII
312 (playback::context::compile): Use scoped_lock to acquire mutex
313 for the active playback context.
314 (jit_mutex): Change to std::mutex.
315 (playback::context::acquire_mutex): Rename to ...
316 (playback::context::lock): ... this.
317 (playback::context::release_mutex): Rename to ...
318 (playback::context::unlock): ... this.
319 * jit-playback.h (playback::context): Rename members and declare
321 * jit-recording.cc (INCLUDE_PTHREAD_H): Remove unused define.
322 * libgccjit.cc (version_mutex): Change to std::mutex.
323 (struct jit_version_info): Use std::lock_guard to acquire and
326 2022-11-14 Martin Liska <mliska@suse.cz>
329 2022-11-09 Martin Liska <mliska@suse.cz>
332 * docs/cp/index.rst: Moved to...
333 * doc/cp/index.rst: ...here.
334 * docs/cp/intro/index.rst: Moved to...
335 * doc/cp/intro/index.rst: ...here.
336 * docs/cp/intro/tutorial01.rst: Moved to...
337 * doc/cp/intro/tutorial01.rst: ...here.
338 * docs/cp/intro/tutorial02.rst: Moved to...
339 * doc/cp/intro/tutorial02.rst: ...here.
340 * docs/cp/intro/tutorial03.rst: Moved to...
341 * doc/cp/intro/tutorial03.rst: ...here.
342 * docs/cp/intro/tutorial04.rst: Moved to...
343 * doc/cp/intro/tutorial04.rst: ...here.
344 * docs/cp/topics/asm.rst: Moved to...
345 * doc/cp/topics/asm.rst: ...here.
346 * docs/cp/topics/compilation.rst: Moved to...
347 * doc/cp/topics/compilation.rst: ...here.
348 * docs/cp/topics/contexts.rst: Moved to...
349 * doc/cp/topics/contexts.rst: ...here.
350 * docs/cp/topics/expressions.rst: Moved to...
351 * doc/cp/topics/expressions.rst: ...here.
352 * docs/cp/topics/functions.rst: Moved to...
353 * doc/cp/topics/functions.rst: ...here.
354 * docs/cp/topics/index.rst: Moved to...
355 * doc/cp/topics/index.rst: ...here.
356 * docs/cp/topics/locations.rst: Moved to...
357 * doc/cp/topics/locations.rst: ...here.
358 * docs/cp/topics/objects.rst: Moved to...
359 * doc/cp/topics/objects.rst: ...here.
360 * docs/cp/topics/types.rst: Moved to...
361 * doc/cp/topics/types.rst: ...here.
362 * docs/examples/emit-alphabet.bf: Moved to...
363 * doc/examples/emit-alphabet.bf: ...here.
364 * docs/examples/tut01-hello-world.c: Moved to...
365 * doc/examples/tut01-hello-world.c: ...here.
366 * docs/examples/tut01-hello-world.cc: Moved to...
367 * doc/examples/tut01-hello-world.cc: ...here.
368 * docs/examples/tut02-square.c: Moved to...
369 * doc/examples/tut02-square.c: ...here.
370 * docs/examples/tut02-square.cc: Moved to...
371 * doc/examples/tut02-square.cc: ...here.
372 * docs/examples/tut03-sum-of-squares.c: Moved to...
373 * doc/examples/tut03-sum-of-squares.c: ...here.
374 * docs/examples/tut03-sum-of-squares.cc: Moved to...
375 * doc/examples/tut03-sum-of-squares.cc: ...here.
376 * docs/examples/tut04-toyvm/Makefile: Moved to...
377 * doc/examples/tut04-toyvm/Makefile: ...here.
378 * docs/examples/tut04-toyvm/factorial.toy: Moved to...
379 * doc/examples/tut04-toyvm/factorial.toy: ...here.
380 * docs/examples/tut04-toyvm/fibonacci.toy: Moved to...
381 * doc/examples/tut04-toyvm/fibonacci.toy: ...here.
382 * docs/examples/tut04-toyvm/toyvm.c: Moved to...
383 * doc/examples/tut04-toyvm/toyvm.c: ...here.
384 * docs/examples/tut04-toyvm/toyvm.cc: Moved to...
385 * doc/examples/tut04-toyvm/toyvm.cc: ...here.
386 * docs/examples/tut05-bf.c: Moved to...
387 * doc/examples/tut05-bf.c: ...here.
388 * docs/index.rst: Moved to...
389 * doc/index.rst: ...here.
390 * docs/internals/index.rst: Moved to...
391 * doc/internals/index.rst: ...here.
392 * docs/internals/test-hello-world.exe.log.txt: Moved to...
393 * doc/internals/test-hello-world.exe.log.txt: ...here.
394 * docs/_build/texinfo/libgccjit-figures/factorial.png: Moved to...
395 * doc/intro/factorial.png: ...here.
396 * docs/intro/index.rst: Moved to...
397 * doc/intro/index.rst: ...here.
398 * docs/_build/texinfo/libgccjit-figures/sum-of-squares.png: Moved to...
399 * doc/intro/sum-of-squares.png: ...here.
400 * docs/intro/tutorial01.rst: Moved to...
401 * doc/intro/tutorial01.rst: ...here.
402 * docs/intro/tutorial02.rst: Moved to...
403 * doc/intro/tutorial02.rst: ...here.
404 * docs/intro/tutorial03.rst: Moved to...
405 * doc/intro/tutorial03.rst: ...here.
406 * docs/intro/tutorial04.rst: Moved to...
407 * doc/intro/tutorial04.rst: ...here.
408 * docs/intro/tutorial05.rst: Moved to...
409 * doc/intro/tutorial05.rst: ...here.
410 * docs/topics/asm.rst: Moved to...
411 * doc/topics/asm.rst: ...here.
412 * docs/topics/compatibility.rst: Moved to...
413 * doc/topics/compatibility.rst: ...here.
414 * docs/topics/compilation.rst: Moved to...
415 * doc/topics/compilation.rst: ...here.
416 * docs/topics/contexts.rst: Moved to...
417 * doc/topics/contexts.rst: ...here.
418 * docs/topics/expressions.rst: Moved to...
419 * doc/topics/expressions.rst: ...here.
420 * docs/topics/function-pointers.rst: Moved to...
421 * doc/topics/function-pointers.rst: ...here.
422 * docs/topics/functions.rst: Moved to...
423 * doc/topics/functions.rst: ...here.
424 * docs/topics/index.rst: Moved to...
425 * doc/topics/index.rst: ...here.
426 * docs/topics/locations.rst: Moved to...
427 * doc/topics/locations.rst: ...here.
428 * docs/topics/objects.rst: Moved to...
429 * doc/topics/objects.rst: ...here.
430 * docs/topics/performance.rst: Moved to...
431 * doc/topics/performance.rst: ...here.
432 * docs/topics/types.rst: Moved to...
433 * doc/topics/types.rst: ...here.
434 * docs/Makefile: Removed.
435 * docs/_build/texinfo/Makefile: Removed.
436 * docs/_build/texinfo/libgccjit-figures/factorial1.png: Removed.
437 * docs/_build/texinfo/libgccjit-figures/sum-of-squares1.png: Removed.
438 * docs/_build/texinfo/libgccjit.texi: Removed.
439 * docs/conf.py: Removed.
440 * docs/intro/factorial.png: Removed.
441 * docs/intro/sum-of-squares.png: Removed.
442 * doc/conf.py: New file.
444 2022-11-14 Martin Liska <mliska@suse.cz>
447 2022-11-14 Martin Liska <mliska@suse.cz>
449 * Make-lang.in: Support --with-sphinx-build.
451 2022-11-14 Martin Liska <mliska@suse.cz>
454 2022-11-14 Martin Liska <mliska@suse.cz>
456 * doc/internals/index.rst: Fix cross manual refs.
457 * doc/topics/contexts.rst: Likewise.
459 2022-11-14 Martin Liska <mliska@suse.cz>
462 2022-11-14 Martin Liska <mliska@suse.cz>
465 Support installation if sphinx-build is missing.
467 2022-11-14 Martin Liska <mliska@suse.cz>
470 2022-11-14 Martin Liska <mliska@suse.cz>
472 * doc/cp/index.rst: Remove trailing .rst in toctree.
473 * doc/cp/intro/index.rst: Likewise.
474 * doc/cp/topics/index.rst: Likewise.
475 * doc/index.rst: Likewise.
476 * doc/intro/index.rst: Likewise.
477 * doc/topics/index.rst: Likewise.
478 * doc/indices-and-tables.rst: New file.
480 2022-11-11 Martin Liska <mliska@suse.cz>
482 * doc/cp/index.rst: Remove trailing .rst in toctree.
483 * doc/cp/intro/index.rst: Likewise.
484 * doc/cp/topics/index.rst: Likewise.
485 * doc/index.rst: Likewise.
486 * doc/intro/index.rst: Likewise.
487 * doc/topics/index.rst: Likewise.
488 * doc/indices-and-tables.rst: New file.
490 2022-11-09 Martin Liska <mliska@suse.cz>
493 Support installation if sphinx-build is missing.
495 2022-11-09 Martin Liska <mliska@suse.cz>
497 * doc/internals/index.rst: Fix cross manual refs.
498 * doc/topics/contexts.rst: Likewise.
500 2022-11-09 Martin Liska <mliska@suse.cz>
502 * Make-lang.in: Support --with-sphinx-build.
504 2022-11-09 Martin Liska <mliska@suse.cz>
507 * docs/cp/index.rst: Moved to...
508 * doc/cp/index.rst: ...here.
509 * docs/cp/intro/index.rst: Moved to...
510 * doc/cp/intro/index.rst: ...here.
511 * docs/cp/intro/tutorial01.rst: Moved to...
512 * doc/cp/intro/tutorial01.rst: ...here.
513 * docs/cp/intro/tutorial02.rst: Moved to...
514 * doc/cp/intro/tutorial02.rst: ...here.
515 * docs/cp/intro/tutorial03.rst: Moved to...
516 * doc/cp/intro/tutorial03.rst: ...here.
517 * docs/cp/intro/tutorial04.rst: Moved to...
518 * doc/cp/intro/tutorial04.rst: ...here.
519 * docs/cp/topics/asm.rst: Moved to...
520 * doc/cp/topics/asm.rst: ...here.
521 * docs/cp/topics/compilation.rst: Moved to...
522 * doc/cp/topics/compilation.rst: ...here.
523 * docs/cp/topics/contexts.rst: Moved to...
524 * doc/cp/topics/contexts.rst: ...here.
525 * docs/cp/topics/expressions.rst: Moved to...
526 * doc/cp/topics/expressions.rst: ...here.
527 * docs/cp/topics/functions.rst: Moved to...
528 * doc/cp/topics/functions.rst: ...here.
529 * docs/cp/topics/index.rst: Moved to...
530 * doc/cp/topics/index.rst: ...here.
531 * docs/cp/topics/locations.rst: Moved to...
532 * doc/cp/topics/locations.rst: ...here.
533 * docs/cp/topics/objects.rst: Moved to...
534 * doc/cp/topics/objects.rst: ...here.
535 * docs/cp/topics/types.rst: Moved to...
536 * doc/cp/topics/types.rst: ...here.
537 * docs/examples/emit-alphabet.bf: Moved to...
538 * doc/examples/emit-alphabet.bf: ...here.
539 * docs/examples/tut01-hello-world.c: Moved to...
540 * doc/examples/tut01-hello-world.c: ...here.
541 * docs/examples/tut01-hello-world.cc: Moved to...
542 * doc/examples/tut01-hello-world.cc: ...here.
543 * docs/examples/tut02-square.c: Moved to...
544 * doc/examples/tut02-square.c: ...here.
545 * docs/examples/tut02-square.cc: Moved to...
546 * doc/examples/tut02-square.cc: ...here.
547 * docs/examples/tut03-sum-of-squares.c: Moved to...
548 * doc/examples/tut03-sum-of-squares.c: ...here.
549 * docs/examples/tut03-sum-of-squares.cc: Moved to...
550 * doc/examples/tut03-sum-of-squares.cc: ...here.
551 * docs/examples/tut04-toyvm/Makefile: Moved to...
552 * doc/examples/tut04-toyvm/Makefile: ...here.
553 * docs/examples/tut04-toyvm/factorial.toy: Moved to...
554 * doc/examples/tut04-toyvm/factorial.toy: ...here.
555 * docs/examples/tut04-toyvm/fibonacci.toy: Moved to...
556 * doc/examples/tut04-toyvm/fibonacci.toy: ...here.
557 * docs/examples/tut04-toyvm/toyvm.c: Moved to...
558 * doc/examples/tut04-toyvm/toyvm.c: ...here.
559 * docs/examples/tut04-toyvm/toyvm.cc: Moved to...
560 * doc/examples/tut04-toyvm/toyvm.cc: ...here.
561 * docs/examples/tut05-bf.c: Moved to...
562 * doc/examples/tut05-bf.c: ...here.
563 * docs/index.rst: Moved to...
564 * doc/index.rst: ...here.
565 * docs/internals/index.rst: Moved to...
566 * doc/internals/index.rst: ...here.
567 * docs/internals/test-hello-world.exe.log.txt: Moved to...
568 * doc/internals/test-hello-world.exe.log.txt: ...here.
569 * docs/_build/texinfo/libgccjit-figures/factorial.png: Moved to...
570 * doc/intro/factorial.png: ...here.
571 * docs/intro/index.rst: Moved to...
572 * doc/intro/index.rst: ...here.
573 * docs/_build/texinfo/libgccjit-figures/sum-of-squares.png: Moved to...
574 * doc/intro/sum-of-squares.png: ...here.
575 * docs/intro/tutorial01.rst: Moved to...
576 * doc/intro/tutorial01.rst: ...here.
577 * docs/intro/tutorial02.rst: Moved to...
578 * doc/intro/tutorial02.rst: ...here.
579 * docs/intro/tutorial03.rst: Moved to...
580 * doc/intro/tutorial03.rst: ...here.
581 * docs/intro/tutorial04.rst: Moved to...
582 * doc/intro/tutorial04.rst: ...here.
583 * docs/intro/tutorial05.rst: Moved to...
584 * doc/intro/tutorial05.rst: ...here.
585 * docs/topics/asm.rst: Moved to...
586 * doc/topics/asm.rst: ...here.
587 * docs/topics/compatibility.rst: Moved to...
588 * doc/topics/compatibility.rst: ...here.
589 * docs/topics/compilation.rst: Moved to...
590 * doc/topics/compilation.rst: ...here.
591 * docs/topics/contexts.rst: Moved to...
592 * doc/topics/contexts.rst: ...here.
593 * docs/topics/expressions.rst: Moved to...
594 * doc/topics/expressions.rst: ...here.
595 * docs/topics/function-pointers.rst: Moved to...
596 * doc/topics/function-pointers.rst: ...here.
597 * docs/topics/functions.rst: Moved to...
598 * doc/topics/functions.rst: ...here.
599 * docs/topics/index.rst: Moved to...
600 * doc/topics/index.rst: ...here.
601 * docs/topics/locations.rst: Moved to...
602 * doc/topics/locations.rst: ...here.
603 * docs/topics/objects.rst: Moved to...
604 * doc/topics/objects.rst: ...here.
605 * docs/topics/performance.rst: Moved to...
606 * doc/topics/performance.rst: ...here.
607 * docs/topics/types.rst: Moved to...
608 * doc/topics/types.rst: ...here.
609 * docs/Makefile: Removed.
610 * docs/_build/texinfo/Makefile: Removed.
611 * docs/_build/texinfo/libgccjit-figures/factorial1.png: Removed.
612 * docs/_build/texinfo/libgccjit-figures/sum-of-squares1.png: Removed.
613 * docs/_build/texinfo/libgccjit.texi: Removed.
614 * docs/conf.py: Removed.
615 * docs/intro/factorial.png: Removed.
616 * docs/intro/sum-of-squares.png: Removed.
617 * doc/conf.py: New file.
619 2022-09-15 Richard Biener <rguenther@suse.de>
621 * dummy-frontend.cc (jit_langhook_init): Do not initialize
624 2022-08-09 Vibhav Pant <vibhavp@gmail.com>
626 * libgccjit.h (LIBGCCJIT_HAVE_gcc_jit_context_new_bitcast): Move
627 definition out of comment.
629 2022-07-28 David Malcolm <dmalcolm@redhat.com>
631 * docs/internals/index.rst: Remove reference to ".c" extensions
634 2022-07-28 Martin Liška <mliska@suse.cz>
636 * docs/cp/intro/tutorial02.rst:
637 Shorten the assembly example so that there is not slider.
638 * docs/cp/intro/tutorial04.rst: Likewise.
639 * docs/intro/tutorial02.rst: Likewise.
640 * docs/intro/tutorial04.rst: Likewise.
641 * docs/topics/contexts.rst: Likewise.
643 2022-07-28 marxin <mliska@suse.cz>
645 * docs/index.rst: Remove reference to module index
646 as we don't emit any.
648 2022-07-28 marxin <mliska@suse.cz>
650 * docs/cp/intro/tutorial02.rst: Use :expr:`type *` for pointers to a type
651 * docs/cp/topics/asm.rst: Likewise.
652 * docs/cp/topics/contexts.rst: Likewise.
653 * docs/cp/topics/expressions.rst: Likewise.
654 * docs/cp/topics/functions.rst: Likewise.
655 * docs/cp/topics/objects.rst: Likewise.
656 * docs/intro/tutorial02.rst: Likewise.
657 * docs/intro/tutorial03.rst: Likewise.
658 * docs/intro/tutorial04.rst: Likewise.
659 * docs/intro/tutorial05.rst: Likewise.
660 * docs/topics/compilation.rst: Likewise.
661 * docs/topics/contexts.rst: Likewise.
662 * docs/topics/objects.rst: Likewise.
664 2022-07-28 marxin <mliska@suse.cz>
666 * docs/cp/intro/tutorial04.rst: Use list-table.
667 * docs/intro/tutorial04.rst: Likewise.
668 * docs/intro/tutorial05.rst: Likewise.
669 * docs/topics/compilation.rst: Likewise.
670 * docs/topics/expressions.rst: Likewise.
671 * docs/topics/types.rst: Likewise.
673 2022-07-28 marxin <mliska@suse.cz>
675 * docs/cp/topics/expressions.rst: Compact so that the generated
676 output is also more compact.
678 2022-07-28 marxin <mliska@suse.cz>
680 * docs/cp/intro/tutorial02.rst: Use proper reference.
681 * docs/cp/topics/contexts.rst: Likewise.
682 * docs/cp/topics/functions.rst: Put `class` directive before a
683 function as it is not allowed declaring a class in a fn.
684 * docs/cp/topics/types.rst: Add template keyword.
685 * docs/examples/tut04-toyvm/toyvm.c (toyvm_function_compile):
686 Add removed comment used for code snippet ending detection.
687 * docs/intro/tutorial04.rst: Fix to match the real comment.
689 2022-07-28 marxin <mliska@suse.cz>
691 * docs/cp/topics/expressions.rst: Use :expr: for basic types.
692 * docs/topics/compilation.rst: Likewise.
693 * docs/topics/expressions.rst: Likewise.
694 * docs/topics/function-pointers.rst: Likewise.
696 2022-07-28 marxin <mliska@suse.cz>
698 * docs/conf.py: Add needs_sphinx = '3.0' where c:type was added.
699 * docs/index.rst: Remove note about it.
700 * docs/topics/compilation.rst: Use enum directive and reference.
701 * docs/topics/contexts.rst: Likewise.
702 * docs/topics/expressions.rst: Likewise.
703 * docs/topics/functions.rst: Likewise.
705 2022-07-14 Jonathan Wakely <jwakely@redhat.com>
707 * jit-recording.h (recording::memento): Define copy constructor
708 and copy assignment operator as deleted.
709 (recording::string): Likewise.
710 (recording::string::c_str): Add const qualifier.
712 2022-06-29 Antoni Boucher <bouanto@zoho.com>
715 * jit-playback.cc: Use the correct return type when folding in
718 2022-06-29 Sergei Trofimovich <siarheit@google.com>
721 * jit-playback.cc: Include <pthread.h> via "system.h" to avoid calloc()
723 * jit-recording.cc: Ditto.
724 * libgccjit.cc: Ditto.
726 2022-06-10 Antoni Boucher <bouanto@zoho.com>
729 * libgccjit.cc: Add support for floating-point types in
730 gcc_jit_type_get_size.
732 2022-06-08 Yang Yujie <yangyujie@loongson.cn>
734 * Make-lang.in: only link objects from $(EXTRA_GCC_OBJS)
735 that's not in $(EXTRA_OBJS) into libgccjit.
737 2022-05-23 David Malcolm <dmalcolm@redhat.com>
739 * jit-recording.h: Add "final" and "override" to all vfunc
740 implementations that were missing them, as appropriate.
742 2022-05-20 David Malcolm <dmalcolm@redhat.com>
744 * jit-playback.h: Replace uses of "FINAL" and "OVERRIDE" with
745 "final" and "override".
746 * jit-recording.cc: Likewise.
747 * jit-recording.h: Likewise.
749 2022-05-16 Martin Liska <mliska@suse.cz>
751 * jit-builtins.cc (find_builtin_by_name): Use ARRAY_SIZE.
752 (get_string_for_type_id): Likewise.
753 * jit-recording.cc (recording::context::context): Likewise.
755 2022-04-14 Iain Sandoe <iain@sandoe.co.uk>
757 * jit-playback.cc (new_bitcast): Cast values returned by tree_to_uhwi
758 to 'long' to match the print format.
760 2022-04-12 Antoni Boucher <bouanto@zoho.com>
763 * docs/_build/texinfo/libgccjit.texi: Regenerate.
764 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_24): New ABI tag.
765 * docs/topics/expressions.rst: Add documentation for the
766 functions gcc_jit_lvalue_set_alignment and
767 gcc_jit_lvalue_get_alignment.
768 * jit-playback.h: New function (set_alignment).
769 * jit-recording.cc: New function (set_alignment).
770 * jit-recording.h: New functions (set_alignment, get_alignment)
771 and new field (m_alignment).
772 * libgccjit.cc: New functions (gcc_jit_lvalue_get_alignment,
773 gcc_jit_lvalue_set_alignment)
774 * libgccjit.h: New functions (gcc_jit_lvalue_get_alignment,
775 gcc_jit_lvalue_set_alignment)
776 * libgccjit.map (LIBGCCJIT_ABI_24): New ABI tag.
778 2022-04-12 Antoni Boucher <bouanto@zoho.com>
781 * docs/_build/texinfo/libgccjit.texi: Regenerate.
782 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_23): New ABI tag.
783 * docs/topics/contexts.rst: Add documentation for the new
784 function gcc_jit_context_set_bool_print_errors_to_stderr.
785 * jit-common.h: New enum value
786 (INNER_BOOL_OPTION_PRINT_ERRORS_TO_STDERR).
787 * jit-recording.cc: Handle the new option
788 INNER_BOOL_OPTION_PRINT_ERRORS_TO_STDERR.
789 * libgccjit.cc: New function
790 (gcc_jit_context_set_bool_print_errors_to_stderr).
791 * libgccjit.h: New function
792 (gcc_jit_context_set_bool_print_errors_to_stderr).
793 * libgccjit.map (LIBGCCJIT_ABI_23): New ABI tag.
795 2022-04-12 Antoni Boucher <bouanto@zoho.com>
798 * docs/_build/texinfo/libgccjit.texi: Regenerate.
799 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_22): New ABI tag.
800 * docs/topics/expressions.rst: Add documentation for the
801 function gcc_jit_lvalue_set_register_name.
802 * jit-playback.h: New function (set_register_name).
803 * jit-recording.cc: New function (set_register_name) and add
804 support for register variables.
805 * jit-recording.h: New field (m_reg_name) and new function
807 * libgccjit.cc: New function (gcc_jit_lvalue_set_register_name).
808 * libgccjit.h: New function (gcc_jit_lvalue_set_register_name).
809 * libgccjit.map (LIBGCCJIT_ABI_22): New ABI tag.
811 2022-04-12 Antoni Boucher <bouanto@zoho.com>
814 * docs/_build/texinfo/libgccjit.texi: Regenerate.
815 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_21): New ABI tag.
816 * docs/topics/expressions.rst: Add documentation for the
817 function gcc_jit_context_new_bitcast.
818 * jit-playback.cc: New function (new_bitcast).
819 * jit-playback.h: New function (new_bitcast).
820 * jit-recording.cc: New functions (new_bitcast,
821 bitcast::replay_into, bitcast::visit_children,
822 bitcast::make_debug_string, bitcast::write_reproducer).
823 * jit-recording.h: New class (bitcast) and new function
824 (new_bitcast, bitcast::replay_into, bitcast::visit_children,
825 bitcast::make_debug_string, bitcast::write_reproducer,
826 bitcast::get_precedence).
827 * libgccjit.cc: New function (gcc_jit_context_new_bitcast)
828 * libgccjit.h: New function (gcc_jit_context_new_bitcast)
829 * libgccjit.map (LIBGCCJIT_ABI_21): New ABI tag.
831 2022-04-12 Antoni Boucher <bouanto@zoho.com>
834 * docs/_build/texinfo/libgccjit.texi: Regenerate
835 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_20): New ABI tag.
836 * docs/topics/types.rst: Add documentation for the new types
837 GCC_JIT_TYPE_UINT8_T, GCC_JIT_TYPE_UINT16_T,
838 GCC_JIT_TYPE_UINT32_T, GCC_JIT_TYPE_UINT64_T,
839 GCC_JIT_TYPE_UINT128_T, GCC_JIT_TYPE_INT8_T, GCC_JIT_TYPE_INT16_T,
840 GCC_JIT_TYPE_INT32_T, GCC_JIT_TYPE_INT64_T, GCC_JIT_TYPE_INT128_T and
841 new functions (gcc_jit_compatible_types, gcc_jit_type_get_size).
842 * jit-builtins.cc: Add support for BT_UINT128.
843 * jit-common.h: Update the value of NUM_GCC_JIT_TYPES.
844 * jit-playback.cc: Add support for the sized integer types.
845 * jit-recording.cc: Add support for the sized integer types.
846 * jit-recording.h: Add support for comparing integer types
847 and new function (is_signed).
848 * libgccjit.cc (gcc_jit_compatible_types): New.
849 (gcc_jit_type_get_size) New.
850 * libgccjit.h: New enum variants for gcc_jit_types
851 (GCC_JIT_TYPE_UINT8_T, GCC_JIT_TYPE_UINT16_T,
852 GCC_JIT_TYPE_UINT32_T, GCC_JIT_TYPE_UINT64_T,
853 GCC_JIT_TYPE_UINT128_T, GCC_JIT_TYPE_INT8_T,
854 GCC_JIT_TYPE_INT16_T, GCC_JIT_TYPE_INT32_T,
855 GCC_JIT_TYPE_INT64_T, GCC_JIT_TYPE_INT128_T) and new functions
856 (gcc_jit_compatible_types, gcc_jit_type_get_size).
857 * libgccjit.map (LIBGCCJIT_ABI_20): New ABI tag.
859 2022-04-06 David Malcolm <dmalcolm@redhat.com>
862 * docs/_build/texinfo/factorial.png: Move to...
863 * docs/_build/texinfo/libgccjit-figures/factorial.png: ...here.
864 * docs/_build/texinfo/factorial1.png: Move to...
865 * docs/_build/texinfo/libgccjit-figures/factorial1.png: ...here.
866 * docs/_build/texinfo/sum-of-squares.png: Move to...
867 * docs/_build/texinfo/libgccjit-figures/sum-of-squares.png: ...here.
868 * docs/_build/texinfo/sum-of-squares1.png: Move to...
869 * docs/_build/texinfo/libgccjit-figures/sum-of-squares1.png: ...here.
871 2022-04-01 David Malcolm <dmalcolm@redhat.com>
873 * docs/topics/expressions.rst: Fix formatting.
874 * docs/topics/types.rst: Likewise.
875 * docs/_build/texinfo/libgccjit.texi: Regenerate
877 2022-04-01 Petter Tomner <tomner@kth.se>
879 * docs/topics/compatibility.rst: Add 19 tag
880 * docs/topics/compilation.rst: Linking
881 * docs/topics/contexts.rst: Linking example
882 * docs/topics/expressions.rst: Fix formatting and dropped 's'
884 2022-03-07 Jakub Jelinek <jakub@redhat.com>
886 * libgccjit.h: Fix up duplicated word issue in a comment.
888 2022-01-17 Martin Liska <mliska@suse.cz>
890 * config-lang.in: Rename .c names to .cc.
891 * docs/_build/texinfo/libgccjit.texi: Likewise.
892 * docs/internals/index.rst: Likewise.
893 * jit-builtins.cc (builtins_manager::make_builtin_function): Likewise.
894 * jit-playback.cc (fold_const_var): Likewise.
895 (playback::context::~context): Likewise.
896 (new_field): Likewise.
897 (new_bitfield): Likewise.
898 (new_compound_type): Likewise.
899 (playback::compound_type::set_fields): Likewise.
900 (global_set_init_rvalue): Likewise.
901 (load_blob_in_ctor): Likewise.
902 (new_global_initialized): Likewise.
904 (new_string_literal): Likewise.
905 (as_truth_value): Likewise.
906 (build_call): Likewise.
907 (playback::context::build_cast): Likewise.
908 (new_array_access): Likewise.
909 (new_field_access): Likewise.
910 (dereference): Likewise.
911 (postprocess): Likewise.
912 (add_jump): Likewise.
913 (add_switch): Likewise.
914 (build_goto_operands): Likewise.
915 (playback::context::read_dump_file): Likewise.
916 (init_types): Likewise.
917 * jit-recording.cc (recording::context::get_int_type): Likewise.
918 * jit-recording.h: Likewise.
919 * libgccjit.cc (compatible_types): Likewise.
920 (gcc_jit_context_acquire): Likewise.
921 (gcc_jit_context_release): Likewise.
922 (gcc_jit_context_new_child_context): Likewise.
923 (gcc_jit_type_as_object): Likewise.
924 (gcc_jit_context_get_type): Likewise.
925 (gcc_jit_context_get_int_type): Likewise.
926 (gcc_jit_type_get_pointer): Likewise.
927 (gcc_jit_type_get_const): Likewise.
928 (gcc_jit_type_get_volatile): Likewise.
929 (gcc_jit_type_dyncast_array): Likewise.
930 (gcc_jit_type_is_bool): Likewise.
931 (gcc_jit_type_is_pointer): Likewise.
932 (gcc_jit_type_is_integral): Likewise.
933 (gcc_jit_type_dyncast_vector): Likewise.
934 (gcc_jit_type_is_struct): Likewise.
935 (gcc_jit_vector_type_get_num_units): Likewise.
936 (gcc_jit_vector_type_get_element_type): Likewise.
937 (gcc_jit_type_unqualified): Likewise.
938 (gcc_jit_type_dyncast_function_ptr_type): Likewise.
939 (gcc_jit_function_type_get_return_type): Likewise.
940 (gcc_jit_function_type_get_param_count): Likewise.
941 (gcc_jit_function_type_get_param_type): Likewise.
942 (gcc_jit_context_new_array_type): Likewise.
943 (gcc_jit_context_new_field): Likewise.
944 (gcc_jit_field_as_object): Likewise.
945 (gcc_jit_context_new_struct_type): Likewise.
946 (gcc_jit_struct_as_type): Likewise.
947 (gcc_jit_struct_set_fields): Likewise.
948 (gcc_jit_struct_get_field_count): Likewise.
949 (gcc_jit_context_new_union_type): Likewise.
950 (gcc_jit_context_new_function_ptr_type): Likewise.
951 (gcc_jit_param_as_rvalue): Likewise.
952 (gcc_jit_context_new_function): Likewise.
953 (gcc_jit_function_get_return_type): Likewise.
954 (gcc_jit_function_dump_to_dot): Likewise.
955 (gcc_jit_block_get_function): Likewise.
956 (gcc_jit_global_set_initializer_rvalue): Likewise.
957 (gcc_jit_rvalue_get_type): Likewise.
958 (gcc_jit_context_new_rvalue_from_int): Likewise.
959 (gcc_jit_context_one): Likewise.
960 (gcc_jit_context_new_rvalue_from_double): Likewise.
961 (gcc_jit_context_null): Likewise.
962 (gcc_jit_context_new_string_literal): Likewise.
963 (valid_binary_op_p): Likewise.
964 (gcc_jit_context_new_binary_op): Likewise.
965 (gcc_jit_context_new_comparison): Likewise.
966 (gcc_jit_context_new_call): Likewise.
967 (is_valid_cast): Likewise.
968 (gcc_jit_context_new_cast): Likewise.
969 (gcc_jit_object_get_context): Likewise.
970 (gcc_jit_object_get_debug_string): Likewise.
971 (gcc_jit_lvalue_access_field): Likewise.
972 (gcc_jit_rvalue_access_field): Likewise.
973 (gcc_jit_rvalue_dereference_field): Likewise.
974 (gcc_jit_rvalue_dereference): Likewise.
975 (gcc_jit_lvalue_get_address): Likewise.
976 (gcc_jit_lvalue_set_tls_model): Likewise.
977 (gcc_jit_lvalue_set_link_section): Likewise.
978 (gcc_jit_function_new_local): Likewise.
979 (gcc_jit_block_add_eval): Likewise.
980 (gcc_jit_block_add_assignment): Likewise.
982 (gcc_jit_block_end_with_conditional): Likewise.
983 (gcc_jit_block_add_comment): Likewise.
984 (gcc_jit_block_end_with_jump): Likewise.
985 (gcc_jit_block_end_with_return): Likewise.
986 (gcc_jit_block_end_with_void_return): Likewise.
987 (case_range_validator::case_range_validator): Likewise.
988 (case_range_validator::validate): Likewise.
989 (case_range_validator::get_wide_int): Likewise.
990 (gcc_jit_block_end_with_switch): Likewise.
991 (gcc_jit_context_set_str_option): Likewise.
992 (gcc_jit_context_set_int_option): Likewise.
993 (gcc_jit_context_set_bool_option): Likewise.
994 (gcc_jit_context_set_bool_allow_unreachable_blocks): Likewise.
995 (gcc_jit_context_set_bool_use_external_driver): Likewise.
996 (gcc_jit_context_add_command_line_option): Likewise.
997 (gcc_jit_context_add_driver_option): Likewise.
998 (gcc_jit_context_enable_dump): Likewise.
999 (gcc_jit_context_compile): Likewise.
1000 (gcc_jit_context_compile_to_file): Likewise.
1001 (gcc_jit_context_set_logfile): Likewise.
1002 (gcc_jit_context_dump_reproducer_to_file): Likewise.
1003 (gcc_jit_context_get_first_error): Likewise.
1004 (gcc_jit_context_get_last_error): Likewise.
1005 (gcc_jit_result_get_code): Likewise.
1006 (gcc_jit_result_get_global): Likewise.
1007 (gcc_jit_rvalue_set_bool_require_tail_call): Likewise.
1008 (gcc_jit_type_get_aligned): Likewise.
1009 (gcc_jit_type_get_vector): Likewise.
1010 (gcc_jit_function_get_address): Likewise.
1011 (gcc_jit_version_patchlevel): Likewise.
1012 (gcc_jit_block_add_extended_asm): Likewise.
1013 (gcc_jit_extended_asm_as_object): Likewise.
1014 (gcc_jit_extended_asm_set_volatile_flag): Likewise.
1015 (gcc_jit_extended_asm_set_inline_flag): Likewise.
1016 (gcc_jit_extended_asm_add_output_operand): Likewise.
1017 (gcc_jit_extended_asm_add_input_operand): Likewise.
1018 (gcc_jit_extended_asm_add_clobber): Likewise.
1019 * notes.txt: Likewise.
1021 2022-01-17 Martin Liska <mliska@suse.cz>
1023 * dummy-frontend.c: Moved to...
1024 * dummy-frontend.cc: ...here.
1025 * jit-builtins.c: Moved to...
1026 * jit-builtins.cc: ...here.
1027 * jit-logging.c: Moved to...
1028 * jit-logging.cc: ...here.
1029 * jit-playback.c: Moved to...
1030 * jit-playback.cc: ...here.
1031 * jit-recording.c: Moved to...
1032 * jit-recording.cc: ...here.
1033 * jit-result.c: Moved to...
1034 * jit-result.cc: ...here.
1035 * jit-spec.c: Moved to...
1036 * jit-spec.cc: ...here.
1037 * jit-tempdir.c: Moved to...
1038 * jit-tempdir.cc: ...here.
1039 * jit-w32.c: Moved to...
1040 * jit-w32.cc: ...here.
1041 * libgccjit.c: Moved to...
1042 * libgccjit.cc: ...here.
1044 2021-12-28 Martin Liska <mliska@suse.cz>
1046 * docs/_build/texinfo/libgccjit.texi: Replace http:// with https.
1047 * docs/cp/index.rst: Likewise.
1048 * docs/cp/intro/index.rst: Likewise.
1049 * docs/cp/intro/tutorial01.rst: Likewise.
1050 * docs/cp/intro/tutorial02.rst: Likewise.
1051 * docs/cp/intro/tutorial03.rst: Likewise.
1052 * docs/cp/intro/tutorial04.rst: Likewise.
1053 * docs/cp/topics/asm.rst: Likewise.
1054 * docs/cp/topics/compilation.rst: Likewise.
1055 * docs/cp/topics/contexts.rst: Likewise.
1056 * docs/cp/topics/expressions.rst: Likewise.
1057 * docs/cp/topics/functions.rst: Likewise.
1058 * docs/cp/topics/index.rst: Likewise.
1059 * docs/cp/topics/locations.rst: Likewise.
1060 * docs/cp/topics/objects.rst: Likewise.
1061 * docs/cp/topics/types.rst: Likewise.
1062 * docs/index.rst: Likewise.
1063 * docs/internals/index.rst: Likewise.
1064 * docs/intro/index.rst: Likewise.
1065 * docs/intro/tutorial01.rst: Likewise.
1066 * docs/intro/tutorial02.rst: Likewise.
1067 * docs/intro/tutorial03.rst: Likewise.
1068 * docs/intro/tutorial04.rst: Likewise.
1069 * docs/intro/tutorial05.rst: Likewise.
1070 * docs/topics/asm.rst: Likewise.
1071 * docs/topics/compatibility.rst: Likewise.
1072 * docs/topics/compilation.rst: Likewise.
1073 * docs/topics/contexts.rst: Likewise.
1074 * docs/topics/expressions.rst: Likewise.
1075 * docs/topics/function-pointers.rst: Likewise.
1076 * docs/topics/functions.rst: Likewise.
1077 * docs/topics/index.rst: Likewise.
1078 * docs/topics/locations.rst: Likewise.
1079 * docs/topics/objects.rst: Likewise.
1080 * docs/topics/performance.rst: Likewise.
1081 * docs/topics/types.rst: Likewise.
1083 2021-12-20 Martin Liska <mliska@suse.cz>
1085 * libgccjit.c (struct version_info): Rename to jit_version_info.
1086 (struct jit_version_info): Likewise.
1087 (gcc_jit_version_major): Likewise.
1088 (gcc_jit_version_minor): Likewise.
1089 (gcc_jit_version_patchlevel): Likewise.
1091 2021-12-14 Petter Tomner <tomner@kth.se>
1093 * jit-common.h: New enum
1094 * jit-playback.c : Folding an setting intitial
1095 (global_new_decl) : Handle const global generation
1096 (new_global) : New flag
1097 (global_set_init_rvalue) : New
1099 (new_global_initialized) : Flag
1100 (as_truth_value) : Fold
1101 (new_unary_op) : Fold
1102 (new_binary_op) : Fold
1103 (new_comparison) : Fold
1104 (new_array_access) : Fold
1105 (new_dereference) : Fold
1106 (get_address) : Fold
1108 (global_set_init_rvalue) : New
1112 (new_global_init_rvalue) : New
1114 (ctor) : New, inherits rvalue
1115 (global_init_rvalue) : New, inherits memento
1116 (type::is_union) : New
1117 * libgccjit++.h : New entrypoints, see C-header
1118 * libgccjit.c : See .h
1119 * libgccjit.h : New entrypoints
1120 (gcc_jit_context_new_array_constructor) : New
1121 (gcc_jit_context_new_struct_constructor) : New
1122 (gcc_jit_context_new_union_constructor) : New
1123 (gcc_jit_global_set_initializer_rvalue) : New
1124 (LIBGCCJIT_HAVE_CTORS) : New feuture macro
1125 * libgccjit.map : New entrypoints added to ABI 19
1126 * docs/topics/expressions.rst : Updated docs
1128 2021-12-12 Antoni Boucher <bouanto@zoho.com>
1131 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_18): New ABI
1133 * docs/topics/expressions.rst: Add documentation for the
1134 function gcc_jit_lvalue_set_link_section.
1135 * jit-playback.h: New function (set_link_section).
1136 * jit-recording.c: New function (set_link_section) and
1137 support for setting the link section.
1138 * jit-recording.h: New function (set_link_section) and new
1139 field m_link_section.
1140 * libgccjit.c: New function (gcc_jit_lvalue_set_link_section).
1141 * libgccjit.h: New function (gcc_jit_lvalue_set_link_section).
1142 * libgccjit.map (LIBGCCJIT_ABI_18): New ABI tag.
1144 2021-12-12 Antoni Boucher <bouanto@zoho.com>
1147 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_17): New ABI
1149 * docs/topics/expressions.rst: Add document for the function
1150 gcc_jit_lvalue_set_tls_model.
1151 * jit-playback.h: New function (set_tls_model).
1152 * jit-recording.c: New function (set_tls_model), new
1153 variables (tls_models and tls_model_enum_strings) and support
1154 for setting the tls model.
1155 * jit-recording.h: New function (set_tls_model) and new
1157 * libgccjit.c: New function (gcc_jit_lvalue_set_tls_model).
1158 * libgccjit.h: New function (gcc_jit_lvalue_set_tls_model)
1159 and new enum (gcc_jit_tls_model).
1160 * libgccjit.map (LIBGCCJIT_ABI_17): New ABI tag.
1162 2021-12-11 Antoni Boucher <bouanto@zoho.com>
1166 * jit-builtins.c: Implement missing types for builtins.
1167 * jit-recording.c:: Allow sending a volatile const void * as
1169 * jit-recording.h: New functions (is_volatile, is_const) and
1170 allow comparing qualified types.
1172 2021-12-10 David Malcolm <dmalcolm@redhat.com>
1175 * jit-playback.c (gcc::jit::playback::context::new_function): Set
1176 DECL_CONTEXT of the result_decl.
1178 2021-11-27 Petter Tomner <tomner@kth.se>
1180 * libgccjit.c: %ld -> %zu
1182 2021-11-24 Martin Liska <mliska@suse.cz>
1184 * jit-playback.c (function): Initialize m_blocks vector.
1186 2021-11-20 Antoni Boucher <bouanto@zoho.com>
1189 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_16): New ABI tag.
1190 * docs/topics/functions.rst: Add documentation for the
1191 functions gcc_jit_function_get_return_type and
1192 gcc_jit_function_get_param_count
1193 * docs/topics/types.rst: Add documentation for the functions
1194 gcc_jit_function_type_get_return_type,
1195 gcc_jit_function_type_get_param_count,
1196 gcc_jit_function_type_get_param_type,
1197 gcc_jit_type_unqualified, gcc_jit_type_dyncast_array,
1198 gcc_jit_type_is_bool,
1199 gcc_jit_type_dyncast_function_ptr_type,
1200 gcc_jit_type_is_integral, gcc_jit_type_is_pointer,
1201 gcc_jit_type_dyncast_vector,
1202 gcc_jit_vector_type_get_element_type,
1203 gcc_jit_vector_type_get_num_units,
1204 gcc_jit_struct_get_field, gcc_jit_type_is_struct,
1205 and gcc_jit_struct_get_field_count
1207 (gcc_jit_function_get_return_type, gcc_jit_function_get_param_count,
1208 gcc_jit_function_type_get_return_type,
1209 gcc_jit_function_type_get_param_count,
1210 gcc_jit_function_type_get_param_type, gcc_jit_type_unqualified,
1211 gcc_jit_type_dyncast_array, gcc_jit_type_is_bool,
1212 gcc_jit_type_dyncast_function_ptr_type, gcc_jit_type_is_integral,
1213 gcc_jit_type_is_pointer, gcc_jit_type_dyncast_vector,
1214 gcc_jit_vector_type_get_element_type,
1215 gcc_jit_vector_type_get_num_units, gcc_jit_struct_get_field,
1216 gcc_jit_type_is_struct, gcc_jit_struct_get_field_count): New
1218 (struct gcc_jit_function_type, struct gcc_jit_vector_type):
1221 (gcc_jit_function_get_return_type, gcc_jit_function_get_param_count,
1222 gcc_jit_function_type_get_return_type,
1223 gcc_jit_function_type_get_param_count,
1224 gcc_jit_function_type_get_param_type, gcc_jit_type_unqualified,
1225 gcc_jit_type_dyncast_array, gcc_jit_type_is_bool,
1226 gcc_jit_type_dyncast_function_ptr_type, gcc_jit_type_is_integral,
1227 gcc_jit_type_is_pointer, gcc_jit_type_dyncast_vector,
1228 gcc_jit_vector_type_get_element_type,
1229 gcc_jit_vector_type_get_num_units, gcc_jit_struct_get_field,
1230 gcc_jit_type_is_struct, gcc_jit_struct_get_field_count): New
1231 function declarations.
1232 (struct gcc_jit_function_type, struct gcc_jit_vector_type):
1234 * jit-recording.h: New functions (is_struct and is_vector)
1235 * libgccjit.map (LIBGCCJIT_ABI_16): New ABI tag.
1237 2021-11-12 David Malcolm <dmalcolm@redhat.com>
1240 * docs/examples/tut04-toyvm/toyvm.c (toyvm_function_compile):
1241 Increase size of buffer.
1242 * docs/examples/tut04-toyvm/toyvm.cc
1243 (compilation_state::create_function): Likewise.
1245 2021-09-10 Petter Tomner <tomner@kth.se>
1247 * jit-playback.c: Moved global var processing to after loc handling.
1248 Setting TYPE_NAME for fundamental types.
1249 Using common functions for finalizing globals.
1250 * jit-playback.h: New method init_types().
1251 Changed get_tree_node_for_type() to method.
1253 2021-08-19 Iain Sandoe <iain@sandoe.co.uk>
1255 * docs/examples/tut04-toyvm/toyvm.c: Include jit-dejagnu.h.
1256 * docs/examples/tut04-toyvm/toyvm.cc: Likewise.
1257 * jit-dejagnu.h: New file, imported from dejagnu-1.6.2 and
1258 patched for this application.
1260 2021-08-18 Iain Sandoe <iain@sandoe.co.uk>
1263 * Make-lang.in: Provide clauses for Darwin hosts.
1265 2021-07-18 Antoni Boucher <bouanto@zoho.com>
1268 * jit-playback.c (convert): Add support to handle truncation and
1269 extension in the convert function.
1271 2021-05-19 Martin Liska <mliska@suse.cz>
1274 * libgccjit.c (gcc_jit_context_new_function): Fix typos.
1276 2021-03-24 Matthias Klose <doko@ubuntu.com>
1278 * Make-lang.in (jit.sphinx.html, jit.sphinx.pdf): Use $(mkinstalldirs),
1279 (jit.install-headers): Depend on installdirs.
1281 2021-02-19 David Malcolm <dmalcolm@redhat.com>
1285 (gcc::jit::builtins_manager::get_builtin_function_by_id):
1286 Update assertion to reject BUILT_IN_NONE.
1287 (gcc::jit::builtins_manager::ensure_optimization_builtins_exist):
1290 (gcc::jit::builtins_manager::ensure_optimization_builtins_exist):
1292 * jit-playback.c (gcc::jit::playback::context::replay): Call it.
1293 Remove redundant conditional on bm.
1295 2021-01-14 David Malcolm <dmalcolm@redhat.com>
1297 * docs/cp/index.rst: Remove "Alpha" warning.
1298 * docs/index.rst: Likewise.
1299 * docs/_build/texinfo/libgccjit.texi: Regenerate
1301 2020-11-25 Martin Sebor <msebor@redhat.com>
1304 * jit-recording.c (recording::function::dump_to_dot): Avoid
1306 (recording::block::dump_to_dot): Same.
1308 2020-11-20 Jakub Jelinek <jakub@redhat.com>
1311 * Make-lang.in (jit.serial): Change from goal to a
1313 (.PHONY): Drop jit.serial and jit.prev.
1314 ($(LIBGCCJIT_FILENAME)): Depend on $(jit.serial) rather than
1317 2020-11-18 Jakub Jelinek <jakub@redhat.com>
1319 * Make-lang.in (jit.serial): New goal.
1320 (.PHONY): Add jit.serial jit.prev.
1321 ($(LIBGCCJIT_FILENAME)): Depend on jit.prev. Call LINK_PROGRESS.
1323 2020-11-12 David Malcolm <dmalcolm@redhat.com>
1326 * docs/cp/topics/asm.rst: New file.
1327 * docs/cp/topics/index.rst (Topic Reference): Add it.
1328 * docs/topics/asm.rst: New file.
1329 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_15): New.
1330 * docs/topics/functions.rst (Statements): Add link to extended
1332 * docs/topics/index.rst (Topic Reference): Add asm.rst.
1333 * docs/topics/objects.rst: Add gcc_jit_extended_asm to ASCII art.
1334 * docs/_build/texinfo/Makefile: Regenerate.
1335 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1336 * jit-common.h (gcc::jit::recording::extended_asm): New forward
1338 (gcc::jit::recording::top_level_asm): Likewise.
1339 * jit-playback.c: Include "stmt.h".
1340 (build_string): New.
1341 (gcc::jit::playback::context::new_string_literal): Disambiguate
1343 (gcc::jit::playback::context::add_top_level_asm): New.
1344 (build_operand_chain): New.
1345 (build_clobbers): New.
1346 (build_goto_operands): New.
1347 (gcc::jit::playback::block::add_extended_asm): New.
1348 * jit-playback.h (gcc::jit::playback::context::add_top_level_asm):
1350 (struct gcc::jit::playback::asm_operand): New struct.
1351 (gcc::jit::playback::block::add_extended_asm): New decl.
1352 * jit-recording.c (gcc::jit::recording::context::dump_to_file):
1353 Dump top-level asms.
1354 (gcc::jit::recording::context::add_top_level_asm): New.
1355 (gcc::jit::recording::block::add_extended_asm): New.
1356 (gcc::jit::recording::block::end_with_extended_asm_goto): New.
1357 (gcc::jit::recording::asm_operand::asm_operand): New.
1358 (gcc::jit::recording::asm_operand::print): New.
1359 (gcc::jit::recording::asm_operand::make_debug_string): New.
1360 (gcc::jit::recording::output_asm_operand::write_reproducer): New.
1361 (gcc::jit::recording::output_asm_operand::print): New.
1362 (gcc::jit::recording::input_asm_operand::write_reproducer): New.
1363 (gcc::jit::recording::input_asm_operand::print): New.
1364 (gcc::jit::recording::extended_asm::add_output_operand): New.
1365 (gcc::jit::recording::extended_asm::add_input_operand): New.
1366 (gcc::jit::recording::extended_asm::add_clobber): New.
1367 (gcc::jit::recording::extended_asm::replay_into): New.
1368 (gcc::jit::recording::extended_asm::make_debug_string): New.
1369 (gcc::jit::recording::extended_asm::write_flags): New.
1370 (gcc::jit::recording::extended_asm::write_clobbers): New.
1371 (gcc::jit::recording::extended_asm_simple::write_reproducer): New.
1372 (gcc::jit::recording::extended_asm::maybe_populate_playback_blocks):
1374 (gcc::jit::recording::extended_asm_goto::extended_asm_goto): New.
1375 (gcc::jit::recording::extended_asm_goto::replay_into): New.
1376 (gcc::jit::recording::extended_asm_goto::write_reproducer): New.
1377 (gcc::jit::recording::extended_asm_goto::get_successor_blocks):
1379 (gcc::jit::recording::extended_asm_goto::maybe_print_gotos): New.
1380 (gcc::jit::recording::extended_asm_goto::maybe_populate_playback_blocks):
1382 (gcc::jit::recording::top_level_asm::top_level_asm): New.
1383 (gcc::jit::recording::top_level_asm::replay_into): New.
1384 (gcc::jit::recording::top_level_asm::make_debug_string): New.
1385 (gcc::jit::recording::top_level_asm::write_to_dump): New.
1386 (gcc::jit::recording::top_level_asm::write_reproducer): New.
1388 (gcc::jit::recording::context::add_top_level_asm): New decl.
1389 (gcc::jit::recording::context::m_top_level_asms): New field.
1390 (gcc::jit::recording::block::add_extended_asm): New decl.
1391 (gcc::jit::recording::block::end_with_extended_asm_goto): New
1393 (gcc::jit::recording::asm_operand): New class.
1394 (gcc::jit::recording::output_asm_operand): New class.
1395 (gcc::jit::recording::input_asm_operand): New class.
1396 (gcc::jit::recording::extended_asm): New class.
1397 (gcc::jit::recording::extended_asm_simple): New class.
1398 (gcc::jit::recording::extended_asm_goto): New class.
1399 (gcc::jit::recording::top_level_asm): New class.
1400 * libgccjit++.h (gccjit::extended_asm): New forward decl.
1401 (gccjit::context::add_top_level_asm): New.
1402 (gccjit::block::add_extended_asm): New.
1403 (gccjit::block::end_with_extended_asm_goto): New.
1404 (gccjit::extended_asm): New class.
1405 (gccjit::extended_asm::extended_asm): New ctors.
1406 (gccjit::extended_asm::set_volatile_flag): New.
1407 (gccjit::extended_asm::set_inline_flag): New.
1408 (gccjit::extended_asm::add_output_operand): New.
1409 (gccjit::extended_asm::add_input_operand): New.
1410 (gccjit::extended_asm::add_clobber): New.
1411 (gccjit::extended_asm::get_inner_extended_asm): New.
1412 * libgccjit.c (struct gcc_jit_extended_asm): New.
1413 (jit_error): Make "loc" param take a gcc::jit::recording::location *
1414 rather than a gcc_jit_location *.
1415 (gcc_jit_block_add_extended_asm): New entrypoint.
1416 (gcc_jit_block_end_with_extended_asm_goto): New entrypoint.
1417 (gcc_jit_extended_asm_as_object): New entrypoint.
1418 (gcc_jit_extended_asm_set_volatile_flag): New entrypoint.
1419 (gcc_jit_extended_asm_set_inline_flag): New entrypoint.
1420 (gcc_jit_extended_asm_add_output_operand): New entrypoint.
1421 (gcc_jit_extended_asm_add_clobber): New entrypoint.
1422 (gcc_jit_context_add_top_level_asm): New entrypoint.
1423 * libgccjit.h: Add gcc_jit_extended_asm to ASCII art.
1424 (gcc_jit_extended_asm): New typedef.
1425 (LIBGCCJIT_HAVE_ASM_STATEMENTS): New define.
1426 (gcc_jit_block_add_extended_asm): New entrypoint.
1427 (gcc_jit_block_end_with_extended_asm_goto): New entrypoint.
1428 (gcc_jit_extended_asm_as_object): New entrypoint.
1429 (gcc_jit_extended_asm_set_volatile_flag): New entrypoint.
1430 (gcc_jit_extended_asm_set_inline_flag): New entrypoint.
1431 (gcc_jit_extended_asm_add_output_operand): New entrypoint.
1432 (gcc_jit_extended_asm_add_input_operand): New entrypoint.
1433 (gcc_jit_extended_asm_add_clobber): New entrypoint.
1434 (gcc_jit_context_add_top_level_asm): New entrypoint.
1435 * libgccjit.map (LIBGCCJIT_ABI_15): New.
1437 2020-11-12 David Malcolm <dmalcolm@redhat.com>
1439 * jit-recording.c (recording::context::new_string): Add "escaped"
1440 param and use it when creating the new recording::string instance.
1441 (recording::string::string): Add "escaped" param and use it to
1442 initialize m_escaped.
1443 (recording::string::make_debug_string): Replace check that first
1444 char is double-quote with use of m_escaped. Fix escaping of
1445 '\t' and '\n'. Set "escaped" on the result.
1446 * jit-recording.h (recording::context::new_string): Add "escaped"
1448 (recording::string::string): Add "escaped" param.
1449 (recording::string::m_escaped): New field.
1451 2020-11-12 David Malcolm <dmalcolm@redhat.com>
1453 * libgccjit.h: Fix typo in comment.
1455 2020-09-14 Andrea Corallo <andrea.corallo@arm.com>
1457 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1459 2020-09-11 Andrea Corallo <andrea.corallo@arm.com>
1461 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_14): New ABI tag.
1462 * docs/topics/expressions.rst (gcc_jit_global_set_initializer):
1463 Document new entry point in section 'Global variables'.
1464 * jit-playback.c (global_new_decl, global_finalize_lvalue): New
1466 (playback::context::new_global): Make use of global_new_decl,
1467 global_finalize_lvalue.
1468 (load_blob_in_ctor): New template function in use by the
1470 (playback::context::new_global_initialized): New method.
1471 * jit-playback.h (class context): Decl 'new_global_initialized',
1472 'global_new_decl', 'global_finalize_lvalue'.
1473 (lvalue::set_initializer): Add implementation.
1474 * jit-recording.c (recording::memento_of_get_pointer::get_size)
1475 (recording::memento_of_get_type::get_size): Add implementation.
1476 (recording::global::write_initializer_reproducer): New function in
1477 use by 'recording::global::write_reproducer'.
1478 (recording::global::replay_into)
1479 (recording::global::write_to_dump)
1480 (recording::global::write_reproducer): Handle
1482 * jit-recording.h (class type): Decl 'get_size' and
1484 * libgccjit++.h (class lvalue): Declare new 'set_initializer'
1486 (class lvalue): Decl 'is_global' and 'set_initializer'.
1487 (class global) Decl 'write_initializer_reproducer'. Add
1488 'm_initializer', 'm_initializer_num_bytes' fields. Implement
1489 'set_initializer'. Add a destructor to free 'm_initializer'.
1490 * libgccjit.c (gcc_jit_global_set_initializer): New function.
1491 * libgccjit.h (gcc_jit_global_set_initializer): New function
1493 * libgccjit.map (LIBGCCJIT_ABI_14): New ABI tag.
1495 2020-08-28 Martin Sebor <msebor@redhat.com>
1497 * jit-recording.c (recording::switch_::make_debug_string): Add argument
1500 2020-08-22 Andrea Corallo <andrea.corallo@arm.com>
1503 (gcc_jit_context_new_rvalue_from_int)
1504 (gcc_jit_context_new_rvalue_from_long)
1505 (gcc_jit_context_new_rvalue_from_double)
1506 (gcc_jit_context_new_rvalue_from_ptr): Update function heading
1509 2020-06-16 Nicolas Bértolo <nicolasbertolo@gmail.com>
1511 * Make-lang.in: Always define version, minor and release
1512 numbers. Create the Windows shared library as
1513 libgccjit-$(LIBGCCJIT_VERSION_NUM).dll.
1515 2020-06-03 David Malcolm <dmalcolm@redhat.com>
1518 * jit-builtins.c (builtins_manager::make_primitive_type):
1519 Implement BT_CONST_VOLATILE_PTR.
1521 2020-06-02 David Malcolm <dmalcolm@redhat.com>
1524 * dummy-frontend.c: Include "options.h", "stringpool.h", and
1526 (ATTR_EXCL): New, copied from lto/lto-lang.c.
1527 (attr_noreturn_exclusions): Likewise.
1528 (attr_returns_twice_exclusions): Likewise.
1529 (attr_const_pure_exclusions): Likewise.
1530 (jit_attribute_table): Likewise, copied from lto_attribute_table.
1531 (jit_format_attribute_table): Likewise, copied from
1532 lto_format_attribute_table.
1533 (handle_noreturn_attribute): New, copied from lto/lto-lang.c.
1534 (handle_leaf_attribute): Likewise.
1535 (handle_const_attribute): Likewise.
1536 (handle_malloc_attribute): Likewise.
1537 (handle_pure_attribute): Likewise.
1538 (handle_novops_attribute): Likewise.
1539 (get_nonnull_operand): Likewise.
1540 (handle_nonnull_attribute): Likewise.
1541 (handle_nothrow_attribute): Likewise.
1542 (handle_sentinel_attribute): Likewise.
1543 (handle_type_generic_attribute): Likewise.
1544 (handle_transaction_pure_attribute): Likewise.
1545 (handle_returns_twice_attribute): Likewise.
1546 (handle_patchable_function_entry_attribute): Likewise.
1547 (ignore_attribute): Likewise.
1548 (handle_format_attribute): Likewise.
1549 (handle_format_arg_attribute): Likewise.
1550 (handle_fnspec_attribute): Likewise.
1551 (LANG_HOOKS_COMMON_ATTRIBUTE_TABLE): Define.
1552 (LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE): Define.
1554 2020-05-28 Nicolas Bértolo <nicolasbertolo@gmail.com>
1556 * Make-lang.in: Remove extra slash. Build libgccjit.dll and its
1557 import library in Windows.
1558 * config-lang.in: Update comment about --enable-host-shared.
1559 * jit-w32.h: New file.
1560 * jit-w32.c: New file.
1561 (print_last_error): New function that prints the error
1562 string corresponding to GetLastError().
1563 (get_TOKEN_USER_current_user): Helper function used for getting
1564 the SID belonging to the current user.
1565 (create_directory_for_current_user): Helper function to create
1566 a directory with permissions such that only the current user can
1568 (win_mkdtemp): Create a temporary directory using Windows APIs.
1569 * jit-playback.c: Do not chmod files in Windows. Use LoadLibrary,
1570 FreeLibrary and GetProcAddress instead of libdl.
1571 * jit-result.h, jit-result.c: Introduce result::handle_t to
1572 abstract over the types used for dynamic library handles.
1573 * jit-tempdir.c: Do not use mkdtemp() in Windows, use
1576 2020-05-27 David Malcolm <dmalcolm@redhat.com>
1579 * dummy-frontend.c (LANG_HOOKS_DEEP_UNSHARING): Define to be true.
1580 * jit-playback.h (gcc::jit::playback::rvalue): Mark tree node with
1583 2020-05-27 Tom Tromey <tromey@gcc.gnu.org>
1586 * docs/conf.py (texinfo_documents): Set description.
1587 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1589 2020-05-26 David Malcolm <dmalcolm@redhat.com>
1592 * docs/topics/functions.rst
1593 (gcc_jit_context_get_builtin_function): Document.
1594 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1595 * dummy-frontend.c (jit_langhook_global_bindings_p): Remove
1597 * jit-builtins.c (type_names): New array.
1598 (get_string_for_type_id): New function.
1599 (gcc::jit::builtins_manager::make_primitive_type): Show name of
1600 type in error messages. Update cases to reflect the order in
1601 builtin-types.def. Implement cases for BT_INT8, BT_INT16,
1602 BT_UINT8, BT_CONST_PTR, BT_VOLATILE_PTR, BT_INT_PTR, BT_FLOAT_PTR,
1603 BT_CONST_DOUBLE_PTR, BT_SIZE, BT_CONST_SIZE.
1605 2020-05-26 David Malcolm <dmalcolm@redhat.com>
1607 * docs/topics/compatibility.rst: Fix underline.
1609 * docs/topics/types.rst: Fix missing blank line.
1610 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1612 2020-05-26 David Malcolm <dmalcolm@redhat.com>
1615 * docs/topics/expressions.rst (Unary Operations): Document that
1616 result_type of gcc_jit_context_new_unary_op must be a numeric type.
1617 (Binary Operations): Likewise for gcc_jit_context_new_binary_op.
1618 (Global variables): Document that "type" of
1619 gcc_jit_context_new_global must be non-`void`.
1620 * docs/topics/function-pointers.rst
1621 (gcc_jit_context_new_function_ptr_type): Document that the
1622 param_types must be non-void, but that return_type may be.
1623 * docs/topics/functions.rst (Params): Document that
1624 gcc_jit_context_new_param's type must be non-void.
1625 (Functions): Likewise for gcc_jit_function_new_local.
1626 * docs/topics/types.rst (gcc_jit_context_new_array_type): Document
1627 that the type must be non-void.
1628 (gcc_jit_context_new_field): Likewise.
1629 * docs/_build/texinfo/Makefile: Regenerate.
1630 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1631 * libgccjit.c (gcc_jit_context_new_array_type): Fail if
1632 element_type is void.
1633 (gcc_jit_context_new_field): Likewise for "type".
1634 (gcc_jit_context_new_function_ptr_type): Likewise for each
1635 element of param_types.
1636 (gcc_jit_context_new_param): Likewise for "type".
1637 (gcc_jit_context_new_global): Likewise.
1638 (gcc_jit_function_new_local): Likewise.
1639 (gcc_jit_type_get_aligned): Likewise.
1641 2020-03-31 Andrea Corallo <andrea.corallo@arm.com>
1642 David Malcolm <dmalcolm@redhat.com>
1644 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_13): New ABI tag
1645 plus add version paragraph.
1646 * libgccjit++.h (namespace gccjit::version): Add new namespace.
1647 * libgccjit.c (gcc_jit_version_major, gcc_jit_version_minor)
1648 (gcc_jit_version_patchlevel): New functions.
1649 * libgccjit.h (LIBGCCJIT_HAVE_gcc_jit_version): New macro.
1650 (gcc_jit_version_major, gcc_jit_version_minor)
1651 (gcc_jit_version_patchlevel): New functions.
1652 * libgccjit.map (LIBGCCJIT_ABI_13) New ABI tag.
1654 2020-03-23 Andrea Corallo <andrea.corallo@arm.com>
1657 (gcc::jit::playback::context m_recording_ctxt): Remove
1658 m_char_array_type_node field.
1660 (playback::context::context) Remove m_char_array_type_node from member
1662 (playback::context::new_string_literal) Fix logic to handle string
1665 2020-01-01 Jakub Jelinek <jakub@redhat.com>
1667 Update copyright years.
1669 2019-11-29 Julian Brown <julian@codesourcery.com>
1671 * jit-builtins.c (BT_DFLOAT32_PTR, BT_DFLOAT64_PTR, BT_DFLOAT128_PTR):
1672 Remove commented-out cases.
1674 2019-11-20 David Malcolm <dmalcolm@redhat.com>
1677 * jit-playback.c (gcc::jit::playback::context::make_fake_args):
1678 Update GCC_JIT_BOOL_OPTION_SELFCHECK_GC for new --param syntax.
1680 2019-08-13 Richard Sandiford <richard.sandiford@arm.com>
1683 * jit-playback.c (new_function): Use set_decl_built_in_function.
1685 2019-07-22 Andrea Corallo <andrea.corallo@arm.com>
1687 * jit-recording.c (unary_op_reproducer_strings): Make it extern.
1688 (binary_op_reproducer_strings): Likewise.
1689 * jit-recording.h (unary_op_reproducer_strings): Likewise.
1690 (binary_op_reproducer_strings): Likewise.
1691 * libgccjit.c (gcc_jit_context_new_unary_op): Check result_type to be a
1693 * libgccjit.c (gcc_jit_context_new_binary_op): Improve error message.
1695 2019-07-04 Andrea Corallo <andrea.corallo@arm.com>
1697 * libgccjit.c (gcc_jit_context_new_binary_op): Check result_type to be a
1700 2019-07-04 Andrea Corallo <andrea.corallo@arm.com>
1702 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_12): New ABI tag.
1703 * docs/topics/types.rst: Add gcc_jit_context_new_bitfield.
1704 * jit-common.h (namespace recording): Add class bitfield.
1706 (DECL_C_BIT_FIELD, SET_DECL_C_BIT_FIELD): Add macros.
1707 (playback::context::new_bitfield): New method.
1708 (playback::compound_type::set_fields): Add bitfield support.
1709 (playback::lvalue::mark_addressable): Was jit_mark_addressable make this
1710 a method of lvalue plus return a bool to communicate success.
1711 (playback::lvalue::get_address): Check for jit_mark_addressable return
1713 * jit-playback.h (new_bitfield): New method.
1714 (class bitfield): New class.
1715 (class lvalue): Add jit_mark_addressable method.
1716 * jit-recording.c (recording::context::new_bitfield): New method.
1717 (recording::bitfield::replay_into): New method.
1718 (recording::bitfield::write_to_dump): Likewise.
1719 (recording::bitfield::make_debug_string): Likewise.
1720 (recording::bitfield::write_reproducer): Likewise.
1721 * jit-recording.h (class context): Add new_bitfield method.
1722 (class field): Make it derivable by class bitfield.
1723 (class bitfield): Add new class.
1724 * libgccjit++.h (class context): Add new_bitfield method.
1725 * libgccjit.c (struct gcc_jit_bitfield): New structure.
1726 (gcc_jit_context_new_bitfield): New function.
1728 (LIBGCCJIT_HAVE_gcc_jit_context_new_bitfield) New macro.
1729 (gcc_jit_context_new_bitfield): New function.
1730 * libgccjit.map (LIBGCCJIT_ABI_12) New ABI tag.
1732 2019-03-21 Jakub Jelinek <jakub@redhat.com>
1734 * jit-recording.c (reproducer::m_set_identifiers): Use false as Lazy
1735 in hash_set template param.
1737 2019-02-05 Andrea Corallo <andrea.corallo@arm.com>
1739 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_11): New ABI tag.
1740 * docs/topics/contexts.rst (Additional driver options): New
1742 * jit-playback.c (invoke_driver): Add call to append_driver_options.
1743 * jit-recording.c: Within namespace gcc::jit...
1744 (recording::context::~context): Free the optnames within
1746 (recording::context::add_driver_option): New method.
1747 (recording::context::append_driver_options): New method.
1748 (recording::context::dump_reproducer_to_file): Add driver
1750 * jit-recording.h: Within namespace gcc::jit...
1751 (recording::context::add_driver_option): New method.
1752 (recording::context::append_driver_options): New method.
1753 (recording::context::m_driver_options): New field.
1754 * libgccjit++.h (gccjit::context::add_driver_option): New
1756 * libgccjit.c (gcc_jit_context_add_driver_option): New API
1758 * libgccjit.h (gcc_jit_context_add_driver_option): New API
1760 (LIBGCCJIT_HAVE_gcc_jit_context_add_driver_option): New
1762 * libgccjit.map (LIBGCCJIT_ABI_11): New ABI tag.
1764 2019-01-01 Jakub Jelinek <jakub@redhat.com>
1766 Update copyright years.
1768 2018-11-15 David Malcolm <dmalcolm@redhat.com>
1771 * dummy-frontend.c (jit_begin_diagnostic): Add diagnostic_t param.
1773 2018-11-13 David Malcolm <dmalcolm@redhat.com>
1775 * jit-playback.c: Replace "source_location" with "location_t".
1777 2018-10-17 David Malcolm <dmalcolm@redhat.com>
1779 * Make-lang.in (selftest-jit): New.
1781 2018-06-28 Martin Liska <mliska@suse.cz>
1783 * jit-playback.c: Include opt-suggestions.h.
1785 2018-06-28 Martin Liska <mliska@suse.cz>
1787 * jit-playback.c (class auto_argvec): Moved to vec.h.
1788 (auto_argvec::~auto_argvec): Likewise.
1789 (compile): Use the renamed name.
1790 (invoke_driver): Likewise.
1792 2018-03-21 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1795 * Make-lang.in ($(LIBGCCJIT_FILENAME)): Add $(EXTRA_GCC_LIBS).
1797 2018-03-09 David Malcolm <dmalcolm@redhat.com>
1798 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
1802 * Make-lang.in (COMMA): New.
1803 (LIBGCCJIT_VERSION_SCRIPT_OPTION): New.
1804 (LIBGCCJIT_SONAME_OPTION): New.
1805 (jit): Move --version-script and -soname linker options to the
1808 2018-01-25 David Malcolm <dmalcolm@redhat.com>
1811 * jit-recording.h (gcc::jit::recording::union_): Remove fields
1812 "m_loc" and "m_name".
1814 2018-01-03 Jakub Jelinek <jakub@redhat.com>
1816 Update copyright years.
1818 2017-12-19 Jakub Jelinek <jakub@redhat.com>
1820 * jit-playback.c (get_type, playback::compile_to_file::copy_file,
1821 playback::context::acquire_mutex): Replace Yoda conditions with
1822 typical order conditions.
1823 * libgccjit.c (gcc_jit_context_new_struct_type,
1824 gcc_jit_struct_set_fields, gcc_jit_context_new_union_type,
1825 gcc_jit_context_new_function, gcc_jit_timer_pop): Likewise.
1826 * jit-builtins.c (matches_builtin): Likewise.
1827 * jit-recording.c (recording::compound_type::set_fields,
1828 recording::fields::write_reproducer, recording::rvalue::set_scope,
1829 recording::function::validate): Likewise.
1830 * jit-logging.c (logger::decref): Likewise.
1832 2017-11-30 Jakub Jelinek <jakub@redhat.com>
1835 (recording::memento_of_new_rvalue_from_const <long>::write_reproducer):
1836 Use ; instead of ;;.
1838 2017-11-28 Jakub Jelinek <jakub@redhat.com>
1840 * jit-playback.c (add_switch): Build SWITCH_EXPR using build2 instead
1841 of build3. Formatting fixes. Adjust funciton comment.
1843 2017-11-23 Tom de Vries <tom@codesourcery.com>
1845 * libgccjit.c (RETURN_NULL_IF_FAIL_NONNULL_NUMERIC_TYPE): Wrap in
1846 JIT_{BEGIN,END}_STMT.
1848 2017-10-31 David Malcolm <dmalcolm@redhat.com>
1850 * docs/internals/index.rst (Running the test suite): Document
1851 PRESERVE_EXECUTABLES.
1852 (Running under valgrind): Add markup to RUN_UNDER_VALGRIND.
1853 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1855 2017-10-04 David Malcolm <dmalcolm@redhat.com>
1857 * docs/cp/topics/expressions.rst (Vector expressions): New
1859 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_10): New ABI tag.
1860 * docs/topics/expressions.rst (Vector expressions): New section.
1861 * docs/topics/types.rst (gcc_jit_type_get_vector): Add link to
1862 gcc_jit_context_new_rvalue_from_vector.
1863 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1864 * jit-common.h (gcc::jit:recording::vector_type): New forward
1867 (gcc::jit::playback::context::new_rvalue_from_vector): New method.
1869 (gcc::jit::playback::context::new_rvalue_from_vector): New method.
1870 * jit-recording.c: In namespace gcc::jit::
1871 (class comma_separated_string): New class.
1872 (comma_separated_string::comma_separated_string): New ctor,
1873 adapted from recording::call::make_debug_string.
1874 (comma_separated_string::~comma_separated_string): New dtor.
1875 In namespace gcc::jit::recording::
1876 (context::new_rvalue_from_vector): New method.
1877 (type::get_vector): Update for renaming of memento_of_get_vector.
1878 (class memento_of_get_vector): Rename to...
1879 (class vector_type): ..this.
1880 (memento_of_new_rvalue_from_vector::memento_of_new_rvalue_from_vector):
1882 (memento_of_new_rvalue_from_vector::replay_into): New method.
1883 (memento_of_new_rvalue_from_vector::visit_children): New method.
1884 (memento_of_new_rvalue_from_vector::make_debug_string): New
1886 (memento_of_new_rvalue_from_vector::write_reproducer): New method.
1887 (call::make_debug_string): Split out arg-printing code into ctor
1888 for comma_separated_string.
1889 * jit-recording.h: In namespace gcc::jit::recording::
1890 (context::new_rvalue_from_vector): New method.
1891 (type::dyn_cast_vector_type): New virtual function.
1892 (class memento_of_get_vector): Rename to...
1893 (class vector_type): ...this.
1894 (vector_type::unqualified): Remove this vfunc override in favor
1896 (vector_type::get_element_type): ...this new method.
1897 (vector_type::get_num_units): New method.
1898 (vector_type::dyn_cast_vector_type): New vfunc override.
1899 (class memento_of_new_rvalue_from_vector): New class.
1900 * libgccjit++.h (gccjit::context::new_rvalue): Add overload for
1902 * libgccjit.c (gcc_jit_context_new_binary_op): Strip off type
1903 qualifications when checking that both operands have same type.
1904 (gcc_jit_context_new_rvalue_from_vector): New API entrypoint.
1906 (LIBGCCJIT_HAVE_gcc_jit_context_new_rvalue_from_vector): New
1908 (gcc_jit_context_new_rvalue_from_vector): New API entrypoint.
1909 * libgccjit.map (LIBGCCJIT_ABI_10): New ABI tag.
1911 2017-09-28 David Malcolm <dmalcolm@redhat.com>
1913 * docs/topics/expressions.rst (Function calls): Add link to
1914 gcc_jit_context_new_function_ptr_type.
1915 (Function pointers): Convert to cross-references to
1916 function-pointers.rst, moving material there.
1917 * docs/topics/function-pointers.rst: New page.
1918 * docs/topics/index.rst: Add function-pointers.rst.
1919 * docs/topics/types.rst (Function pointer types): New section.
1920 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1922 2017-09-28 David Malcolm <dmalcolm@redhat.com>
1925 (gcc::jit::recording::function_type::is_same_type_as): New function.
1926 * jit-recording.h: In namespace gcc::jit::recording::
1927 (type::accepts_writes_from): Use is_same_type_as rather than pointer
1929 (type::is_same_type_as): New virtual function.
1930 (function_type::is_same_type_as): New override.
1932 2017-09-27 David Malcolm <dmalcolm@redhat.com>
1934 * docs/cp/topics/expressions.rst (Function pointers): New section.
1935 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_9): New tag.
1936 * docs/topics/expressions.rst (Function pointers): New section.
1937 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1938 * jit-common.h (class gcc::jit::recording::function_pointer): New
1940 * jit-playback.c (gcc::jit::playback::function::get_address): New
1942 * jit-playback.h (gcc::jit::playback::function::get_address): New
1944 * jit-recording.c: Within namespace gcc::jit::recording...
1945 (function::function): Initialize new field "m_fn_ptr_type".
1946 (function::get_address): New method.
1947 (function_pointer::replay_into): New method.
1948 (function_pointer::visit_children): New method.
1949 (function_pointer::make_debug_string): New method.
1950 (function_pointer::write_reproducer): New method.
1951 * jit-recording.h: Within namespace gcc::jit::recording...
1952 (function::get_address): New method.
1953 (function): Add field "m_fn_ptr_type".
1954 (class function_pointer): New subclass of rvalue.
1955 * libgccjit++.h (gccjit::function::get_address): New method.
1956 * libgccjit.c (gcc_jit_function_get_address): New function.
1957 * libgccjit.h (LIBGCCJIT_HAVE_gcc_jit_function_get_address): New
1959 (gcc_jit_function_get_address): New API entrypoint.
1960 * libgccjit.map (LIBGCCJIT_ABI_9): New tag.
1962 2017-09-14 David Malcolm <dmalcolm@redhat.com>
1965 * jit-builtins.c (matches_builtin): Ignore entries with a NULL
1968 2017-08-18 David Malcolm <dmalcolm@redhat.com>
1970 PR tree-optimization/46805
1971 * dummy-frontend.c (jit_langhook_parse_file): Handle vector types.
1973 2017-08-18 David Malcolm <dmalcolm@redhat.com>
1975 * jit-recording.c (class gcc::jit::reproducer): Rename field
1976 "m_identifiers" to "m_map_memento_to_identifier". Add field
1977 "m_set_identifiers" and struct hash_traits for it.
1978 (gcc::jit::reproducer::reproducer): Update for above.
1979 (convert_to_identifier): New function.
1980 (gcc::jit::reproducer::ensure_identifier_is_unique): New method.
1981 (gcc::jit::reproducer::make_identifier): Avoid appending the %p
1982 unless necessary for uniqueness. Update for field renaming.
1983 (gcc::jit::reproducer::get_identifier): Update for field renaming.
1985 2017-08-09 David Malcolm <dmalcolm@redhat.com>
1987 * docs/cp/topics/types.rst (Vector types): New section.
1988 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_8): New tag.
1989 * docs/topics/types.rst (gcc_jit_context_get_type): Fix typo in
1991 (Vector types): New section.
1992 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1993 * jit-playback.c (gcc::jit::playback::type::get_vector): New
1995 * jit-playback.h (gcc::jit::playback::type::get_vector): New
1997 * jit-recording.c: In namespace gcc::jit::recording::
1998 (type::get_vector): New method.
1999 (memento_of_get_aligned::write_reproducer): Fix typo
2001 (memento_of_get_vector::replay_into): New method.
2002 (memento_of_get_vector::make_debug_string): New method.
2003 (memento_of_get_vector::write_reproducer): New method.
2004 * jit-recording.h: In namespace gcc::jit::recording::
2005 (type::get_vector): New
2007 (class memento_of_get_vector): New class.
2008 * libgccjit++.h (gccjit::type::get_vector): New method.
2009 * libgccjit.c (gcc_jit_type_get_vector): New public entrypoint.
2010 * libgccjit.h (LIBGCCJIT_HAVE_gcc_jit_type_get_vector): New
2012 (gcc_jit_type_get_vector): New decl.
2013 * libgccjit.map (LIBGCCJIT_ABI_8): New ABI tag.
2015 2017-07-05 Richard Sandiford <richard.sandiford@linaro.org>
2016 Alan Hayward <alan.hayward@arm.com>
2017 David Sherwood <david.sherwood@arm.com>
2019 * dummy-frontend.c (jit_langhook_type_for_mode): Remove "enum" before
2022 2017-04-24 David Malcolm <dmalcolm@redhat.com>
2024 * docs/cp/topics/types.rst (gccjit::type::get_const): Remove
2026 (gccjit::type::get_aligned): Add.
2027 * docs/topics/compatibility.rst: Add LIBGCCJIT_ABI_7.
2028 * docs/topics/types.rst: Add gcc_jit_type_get_aligned.
2029 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2030 * jit-playback.c (gcc::jit::playback::type::get_aligned): New
2032 * jit-playback.h (gcc::jit::playback::type::get_aligned): New
2034 * jit-recording.c: Within namespace gcc::jit::recording...
2035 (type::get_aligned): New method.
2036 (memento_of_get_aligned::replay_into): New method.
2037 (memento_of_get_aligned::make_debug_string): New method.
2038 (memento_of_get_aligned::write_reproducer): New method.
2039 * jit-recording.h: Within namespace gcc::jit::recording...
2040 (type::get_aligned): New method.
2041 (type::accepts_writes_from): Strip off qualifications from
2042 this when comparing pointer equality.
2043 (decorated_type): New subclass of type, subsuming the
2044 commonality between memento_of_get_const and
2045 memento_of_get_volatile.
2046 (memento_of_get_const): Make a subclass of decorated_type,
2048 (memento_of_get_volatile): Likewise.
2049 (memento_of_get_aligned): Likewise.
2050 * libgccjit++.h: Within namespace gccjit...
2051 (type::get_const): New method.
2052 (type::get_aligned): New method.
2053 * libgccjit.c (gcc_jit_type_get_aligned): New function.
2054 * libgccjit.h (gcc_jit_type_get_aligned): New decl.
2055 * libgccjit.map (LIBGCCJIT_ABI_7): New
2056 (gcc_jit_type_get_aligned): Add.
2058 2017-01-19 David Malcolm <dmalcolm@redhat.com>
2060 * dummy-frontend.c (jit_langhook_type_for_size): Delete.
2061 (LANG_HOOKS_TYPE_FOR_SIZE): Don't redefine.
2063 2017-01-18 David Malcolm <dmalcolm@redhat.com>
2065 * dummy-frontend.c (jit_langhook_type_for_size): Implement, using
2066 lto's lto_type_for_size.
2068 2017-01-01 Jakub Jelinek <jakub@redhat.com>
2070 Update copyright years.
2072 2016-05-20 David Malcolm <dmalcolm@redhat.com>
2074 * docs/topics/compatibility.rst: Add LIBGCCJIT_ABI_6.
2075 * docs/topics/expressions.rst (Function calls): Add documentation
2076 of gcc_jit_rvalue_set_bool_require_tail_call.
2077 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2078 * jit-common.h (gcc::jit::recording::base_call): Add forward decl.
2079 * jit-playback.c: Within namespace gcc::jit::playback...
2080 (context::build_call) Add "require_tail_call" param and use it
2081 to set CALL_EXPR_MUST_TAIL_CALL.
2082 (context::new_call): Add "require_tail_call" param.
2083 (context::new_call_through_ptr): Likewise.
2084 * jit-playback.h: Within namespace gcc::jit::playback...
2085 (context::new_call: Add "require_tail_call" param.
2086 (context::new_call_through_ptr): Likewise.
2087 (context::build_call): Likewise.
2088 * jit-recording.c: Within namespace gcc::jit::recording...
2089 (base_call::base_call): New constructor.
2090 (base_call::write_reproducer_tail_call): New method.
2091 (call::call): Update for inheritance from base_call.
2092 (call::replay_into): Provide m_require_tail_call to call
2094 (call::write_reproducer): Call write_reproducer_tail_call.
2095 (call_through_ptr::call_through_ptr): Update for inheritance from
2097 (call_through_ptr::replay_into): Provide m_require_tail_call to call
2098 to new_call_through_ptr.
2099 (recording::call_through_ptr::write_reproducer): Call
2100 write_reproducer_tail_call.
2101 * jit-recording.h: Within namespace gcc::jit::recording...
2102 (rvalue::dyn_cast_base_call): New virtual function.
2103 (class base_call): New subclass of class rvalue.
2104 (class call): Inherit from base_call rather than directly from
2105 rvalue, moving get_precedence and m_args to base_call.
2106 (class call_through_ptr): Likewise.
2107 * libgccjit.c (gcc_jit_rvalue_set_bool_require_tail_call): New
2110 (LIBGCCJIT_HAVE_gcc_jit_rvalue_set_bool_require_tail_call): New
2112 (gcc_jit_rvalue_set_bool_require_tail_call): New function.
2113 * libgccjit.map (LIBGCCJIT_ABI_6): New.
2114 (gcc_jit_rvalue_set_bool_require_tail_call): Add.
2116 2016-05-17 David Malcolm <dmalcolm@redhat.com>
2118 * dummy-frontend.c: Include diagnostic.h.
2119 (jit_begin_diagnostic): New function.
2120 (jit_end_diagnostic): New function.
2121 (jit_langhook_init): Register jit_begin_diagnostic
2122 and jit_end_diagnostic with the global_dc.
2123 * jit-playback.c: Include diagnostic.h.
2124 (gcc::jit::playback::context::add_diagnostic): New method.
2125 * jit-playback.h (struct diagnostic_context): Add forward
2127 (gcc::jit::playback::context::add_diagnostic): New method.
2129 2016-05-17 David Malcolm <dmalcolm@redhat.com>
2131 * docs/topics/expressions.rst (Function calls): Document
2132 gcc_jit_context_new_call_through_ptr.
2133 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2135 2016-05-13 David Malcolm <dmalcolm@redhat.com>
2137 * jit-playback.h: Within namespace gcc:jit::playback...
2138 (compile_to_memory::postprocess): Mark with FINAL OVERRIDE.
2139 (compile_to_file::postprocess): Likewise.
2140 (function::finalizer): Likewise.
2141 (block::finalizer): Likewise.
2142 (source_file::finalizer): Likewise.
2143 (source_line::finalizer): Likewise.
2144 * jit-recording.c (gcc::jit::rvalue_usage_validator):: Likewise.
2145 * jit-recording.h: Within namespace gcc::jit::recording...
2146 (string::replay_into): Mark with FINAL OVERRIDE.
2147 (string::make_debug_string): Likewise.
2148 (string::write_reproducer): Likewise.
2149 (location::replay_into): Likewise.
2150 (location::dyn_cast_location): Likewise.
2151 (location::make_debug_string): Likewise.
2152 (location::write_reproducer): Likewise.
2153 (memento_of_get_type::dereference): Likewise.
2154 (memento_of_get_type::accepts_writes_from): Likewise.
2155 (memento_of_get_type::is_int): Likewise.
2156 (memento_of_get_type::is_float): Likewise.
2157 (memento_of_get_type::is_bool): Likewise.
2158 (memento_of_get_type::is_pointer): Likewise.
2159 (memento_of_get_type::is_array): Likewise.
2160 (memento_of_get_type::is_void): Likewise.
2161 (memento_of_get_type::replay_into): Likewise.
2162 (memento_of_get_type::make_debug_string): Likewise.
2163 (memento_of_get_type::write_reproducer): Likewise.
2164 (memento_of_get_pointer::dereference): Likewise.
2165 (memento_of_get_pointer::accepts_writes_from): Likewise.
2166 (memento_of_get_pointer::replay_into): Likewise.
2167 (memento_of_get_pointer::is_int): Likewise.
2168 (memento_of_get_pointer::is_float): Likewise.
2169 (memento_of_get_pointer::is_bool): Likewise.
2170 (memento_of_get_pointer::is_pointer): Likewise.
2171 (memento_of_get_pointer::is_array): Likewise.
2172 (memento_of_get_pointer::make_debug_string): Likewise.
2173 (memento_of_get_pointer::write_reproducer): Likewise.
2174 (memento_of_get_const::dereference): Likewise.
2175 (memento_of_get_const::accepts_writes_from): Likewise.
2176 (memento_of_get_const::unqualified): Likewise.
2177 (memento_of_get_const::is_int): Likewise.
2178 (memento_of_get_const::is_float): Likewise.
2179 (memento_of_get_const::is_bool): Likewise.
2180 (memento_of_get_const::is_pointer): Likewise.
2181 (memento_of_get_const::is_array): Likewise.
2182 (memento_of_get_const::void replay_into): Likewise;
2183 (memento_of_get_const::make_debug_string): Likewise.
2184 (memento_of_get_const::write_reproducer): Likewise.
2185 (memento_of_get_volatile::dereference): Likewise.
2186 (memento_of_get_volatile::unqualified): Likewise.
2187 (memento_of_get_volatile::is_int): Likewise.
2188 (memento_of_get_volatile::is_float): Likewise.
2189 (memento_of_get_volatile::is_bool): Likewise.
2190 (memento_of_get_volatile::is_pointer): Likewise.
2191 (memento_of_get_volatile::is_array): Likewise.
2192 (memento_of_get_volatile::replay_into): Likewise;
2193 (memento_of_get_volatile::make_debug_string): Likewise.
2194 (memento_of_get_volatile::write_reproducer): Likewise.
2195 (array_type::dereference): Likewise.
2196 (array_type::is_int): Likewise.
2197 (array_type::is_float): Likewise.
2198 (array_type::is_bool): Likewise.
2199 (array_type::is_pointer): Likewise.
2200 (array_type::is_array): Likewise.
2201 (array_type::replay_into): Likewise;
2202 (array_type::make_debug_string): Likewise.
2203 (array_type::write_reproducer): Likewise.
2204 (function_type::dereference): Likewise.
2205 (function_type::function_dyn_cast_function_type): Likewise.
2206 (function_type::function_as_a_function_type): Likewise.
2207 (function_type::is_int): Likewise.
2208 (function_type::is_float): Likewise.
2209 (function_type::is_bool): Likewise.
2210 (function_type::is_pointer): Likewise.
2211 (function_type::is_array): Likewise.
2212 (function_type::replay_into): Likewise;
2213 (function_type::make_debug_string): Likewise.
2214 (function_type::write_reproducer): Likewise.
2215 (field::replay_into): Likewise;
2216 (field::write_to_dump): Likewise.
2217 (field::make_debug_string): Likewise.
2218 (field::write_reproducer): Likewise.
2219 (compound_type::dereference): Likewise.
2220 (compound_type::is_int): Likewise.
2221 (compound_type::is_float): Likewise.
2222 (compound_type::is_bool): Likewise.
2223 (compound_type::is_pointer): Likewise.
2224 (compound_type::is_array): Likewise.
2225 (compound_type::has_known_size): Likewise.
2226 (struct_::dyn_cast_struct): Likewise.
2227 (struct_::replay_into): Likewise.
2228 (struct_::access_as_type): Likewise.
2229 (struct_::make_debug_string): Likewise.
2230 (struct_::write_reproducer): Likewise.
2231 (fields::replay_into): Likewise.
2232 (fields::write_to_dump): Likewise.
2233 (fields::make_debug_string): Likewise.
2234 (fields::write_reproducer): Likewise.
2235 (union_::replay_into): Likewise.
2236 (union_::make_debug_string): Likewise.
2237 (union_::write_reproducer): Likewise.
2238 (lvalue::access_as_rvalue): Mark with OVERRIDE.
2239 (param::replay_into): Mark with FINAL OVERRIDE.
2240 (param::visit_children): Likewise.
2241 (param::dyn_cast_param): Likewise.
2242 (param::access_as_rvalue): Likewise.
2243 (param::access_as_lvalue): Likewise.
2244 (param::make_debug_string): Likewise.
2245 (param::write_reproducer): Likewise.
2246 (param::get_precedence): Likewise.
2247 (function::replay_into): Likewise.
2248 (function::write_to_dump): Likewise.
2249 (function::make_debug_string): Likewise.
2250 (function::write_reproducer): Likewise.
2251 (block::write_to_dump): Likewise.
2252 (block::make_debug_string): Likewise.
2253 (block::write_reproducer): Likewise.
2254 (block::replay_into): Likewise.
2255 (global::replay_into): Likewise;
2256 (global::visit_children): Likewise.
2257 (global::write_to_dump): Likewise.
2258 (global::make_debug_string): Likewise.
2259 (global::write_reproducer): Likewise.
2260 (global::get_precedence): Likewise.
2261 (memento_of_new_rvalue_from_const::replay_into): Likewise.
2262 (memento_of_new_rvalue_from_const::visit_children): Likewise.
2263 (memento_of_new_rvalue_from_const::is_constant): Likewise.
2264 (memento_of_new_rvalue_from_const::get_wide_int): Likewise.
2265 (memento_of_new_rvalue_from_const::make_debug_string): Likewise.
2266 (memento_of_new_rvalue_from_const::write_reproducer): Likewise.
2267 (memento_of_new_rvalue_from_const::get_precedence): Likewise.
2268 (memento_of_new_string_literal::replay_into): Likewise.
2269 (memento_of_new_string_literal::visit_children): Likewise.
2270 (memento_of_new_string_literal::make_debug_string): Likewise.
2271 (memento_of_new_string_literal::write_reproducer): Likewise.
2272 (memento_of_new_string_literal::get_precedence): Likewise.
2273 (unary_op::replay_into): Likewise.
2274 (unary_op::visit_children): Likewise.
2275 (unary_op::make_debug_string): Likewise.
2276 (unary_op::write_reproducer): Likewise.
2277 (unary_op::get_precedence): Likewise.
2278 (binary_op::replay_into): Likewise.
2279 (binary_op::visit_children): Likewise.
2280 (binary_op::make_debug_string): Likewise.
2281 (binary_op::write_reproducer): Likewise.
2282 (binary_op::get_precedence): Likewise.
2283 (comparison::replay_into): Likewise.
2284 (comparison::visit_children): Likewise.
2285 (comparison::make_debug_string): Likewise.
2286 (comparison::write_reproducer): Likewise.
2287 (comparison::get_precedence): Likewise.
2288 (cast::replay_into): Likewise.
2289 (cast::visit_children): Likewise.
2290 (cast::make_debug_string): Likewise.
2291 (cast::write_reproducer): Likewise.
2292 (cast::get_precedence): Likewise.
2293 (call::replay_into): Likewise.
2294 (call::visit_children): Likewise.
2295 (call::make_debug_string): Likewise.
2296 (call::write_reproducer): Likewise.
2297 (call::get_precedence): Likewise.
2298 (call_through_ptr::replay_into): Likewise.
2299 (call_through_ptr::visit_children): Likewise.
2300 (call_through_ptr::make_debug_string): Likewise.
2301 (call_through_ptr::write_reproducer): Likewise.
2302 (call_through_ptr::get_precedence): Likewise.
2303 (array_access::replay_into): Likewise.
2304 (array_access::visit_children): Likewise.
2305 (array_access::make_debug_string): Likewise.
2306 (array_access::write_reproducer): Likewise.
2307 (array_access::get_precedence): Likewise.
2308 (access_field_of_lvalue::replay_into): Likewise.
2309 (access_field_of_lvalue::visit_children): Likewise.
2310 (access_field_of_lvalue::make_debug_string): Likewise.
2311 (access_field_of_lvalue::write_reproducer): Likewise.
2312 (access_field_of_lvalue::get_precedence): Likewise.
2313 (access_field_rvalue::replay_into): Likewise.
2314 (access_field_rvalue::visit_children): Likewise.
2315 (access_field_rvalue::make_debug_string): Likewise.
2316 (access_field_rvalue::write_reproducer): Likewise.
2317 (access_field_rvalue::get_precedence): Likewise.
2318 (dereference_field_rvalue::replay_into): Likewise.
2319 (dereference_field_rvalue::visit_children): Likewise.
2320 (dereference_field_rvalue::make_debug_string): Likewise.
2321 (dereference_field_rvalue::write_reproducer): Likewise.
2322 (dereference_field_rvalue::get_precedence): Likewise.
2323 (dereference_rvalue::replay_into): Likewise.
2324 (dereference_rvalue::visit_children): Likewise.
2325 (dereference_rvalue::make_debug_string): Likewise.
2326 (dereference_rvalue::write_reproducer): Likewise.
2327 (dereference_rvalue::get_precedence): Likewise.
2328 (get_address_of_lvalue::replay_into): Likewise.
2329 (get_address_of_lvalue::visit_children): Likewise.
2330 (get_address_of_lvalue::make_debug_string): Likewise.
2331 (get_address_of_lvalue::write_reproducer): Likewise.
2332 (get_address_of_lvalue::get_precedence): Likewise.
2333 (local::replay_into): Likewise.
2334 (local::visit_children): Likewise.
2335 (local::write_to_dump): Likewise.
2336 (local::make_debug_string): Likewise.
2337 (local::write_reproducer): Likewise.
2338 (local::get_precedence): Likewise.
2339 (statement::write_to_dump): Likewise.
2340 (eval::replay_into): Likewise.
2341 (eval::make_debug_string): Likewise.
2342 (eval::write_reproducer): Likewise.
2343 (assignment::replay_into): Likewise.
2344 (assignment::make_debug_string): Likewise.
2345 (assignment::write_reproducer): Likewise.
2346 (assignment_op::replay_into): Likewise.
2347 (assignment_op::make_debug_string): Likewise.
2348 (assignment_op::write_reproducer): Likewise.
2349 (comment::replay_into): Likewise.
2350 (comment::make_debug_string): Likewise.
2351 (comment::write_reproducer): Likewise.
2352 (conditional::replay_into): Likewise.
2353 (conditional::get_successor_blocks): Likewise.
2354 (conditional::make_debug_string): Likewise.
2355 (conditional::write_reproducer): Likewise.
2356 (jump::replay_into): Likewise.
2357 (jump::get_successor_blocks): Likewise.
2358 (jump::make_debug_string): Likewise.
2359 (jump::write_reproducer): Likewise.
2360 (return_::replay_into): Likewise.
2361 (return_::get_successor_blocks): Likewise.
2362 (return_::make_debug_string): Likewise.
2363 (return_::write_reproducer): Likewise.
2364 (case_::replay_into): Likewise.
2365 (case_::write_reproducer): Likewise.
2366 (case_::make_debug_string): Likewise.
2367 (switch_::replay_into): Likewise.
2368 (switch_::get_successor_blocks): Likewise.
2369 (switch_::make_debug_string): Likewise.
2370 (switch_::write_reproducer): Likewise.
2372 2016-02-08 David Malcolm <dmalcolm@redhat.com>
2374 * dummy-frontend.c (jit_langhook_init): Remove
2375 second argument to build_common_tree_nodes to
2378 2016-01-23 Iain Buclaw <ibuclaw@gdcproject.org>
2380 * jit-playback.c: Include pthread.h.
2382 2016-01-19 David Malcolm <dmalcolm@redhat.com>
2385 * jit-playback.c (gcc::jit::playback::compile_to_file::postprocess):
2386 Potentially add the temporary artifact to the tempdir's list of
2387 tempfiles needing additional cleanup.
2388 (gcc::jit::playback::context::extract_any_requested_dumps): Likewise
2390 * jit-tempdir.c (gcc::jit::tempdir::~tempdir): Clean up additional
2392 * jit-tempdir.h (gcc::jit::tempdir::add_temp_file): New method.
2393 (gcc::jit::tempdir::m_tempfiles): New field.
2394 * docs/cp/intro/tutorial04.rst: Update for changes to toyvm.cc.
2395 * docs/examples/tut04-toyvm/toyvm.cc (class compilation_result):
2397 (toyvm_function::compile): Change return type from function ptr
2398 to a compilation_result.
2399 (toyvm_function::get_function_name): New accessor.
2400 (toyvm_function::m_funcname): New field.
2401 (get_function_name): Convert to...
2402 (toyvm_function::make_function_name): ...this new method.
2403 (toyvm_function::parse): Call make_function_name.
2404 (toyvm_function::compile): Convert return type from function ptr
2405 to a compilation_result. Use get_function_name.
2406 (compilation_state::compile): Convert return type from
2407 gcc_jit_result * to a compilation_result.
2408 (test_script): Update for above changes, extracting the code from
2409 the compilation_result.
2411 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2413 2016-01-04 Jakub Jelinek <jakub@redhat.com>
2415 Update copyright years.
2417 2015-11-11 Andrew MacLeod <amacleod@redhat.com>
2419 * dummy-frontend.c: Remove unused header files.
2420 * jit-builtins.c: Likewise.
2421 * jit-playback.c: Likewise.
2422 * jit-recording.c: Likewise.
2423 * jit-spec.c: Likewise.
2424 * libgccjit.c: Likewise.
2426 2015-11-07 Richard Sandiford <richard.sandiford@arm.com>
2428 * jit-builtins.c: Don't undef DEF_BUILTIN.
2430 2015-10-29 Andrew MacLeod <amacleod@redhat.com>
2432 * dummy-frontend.c: Reorder #include's and remove duplicates.
2433 * jit-builtins.c: Likewise.
2434 * jit-playback.c: Likewise.
2435 * jit-recording.c: Likewise.
2436 * libgccjit.c: Likewise.
2438 2015-10-13 Jakub Jelinek <jakub@redhat.com>
2440 * jit-builtins.c (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10,
2441 DEF_FUNCTION_TYPE_11): Define.
2442 * jit-builtins.h (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10,
2443 DEF_FUNCTION_TYPE_11): Define.
2445 2015-09-30 Thomas Schwinge <thomas@codesourcery.com>
2446 Ulrich Drepper <drepper@gmail.com>
2448 * jit-builtins.h: Undefine DEF_FUNCTION_TYPE_VAR_6 after use.
2450 2015-09-30 Matthias Klose <doko@ubuntu.com>
2452 * jit-builtins.h Define DEF_FUNCTION_TYPE_VAR_6,
2453 remove DEF_FUNCTION_TYPE_VAR_11.
2454 * jit-builtins.c (builtins_manager::make_type): Define and handle
2455 DEF_FUNCTION_TYPE_VAR_6, remove DEF_FUNCTION_TYPE_VAR_11.
2457 2015-08-25 David Malcolm <dmalcolm@redhat.com>
2459 * docs/cp/topics/contexts.rst
2460 (gccjit::context::set_bool_use_external_driver): New.
2461 * docs/internals/test-hello-world.exe.log.txt: Update.
2462 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_5): New.
2463 * docs/topics/contexts.rst
2464 (gcc_jit_context_set_bool_use_external_driver): New.
2465 * jit-common.h (enum inner_bool_option): Add
2466 INNER_BOOL_OPTION_USE_EXTERNAL_DRIVER.
2467 * jit-playback.c (gcc_driver_name): New global.
2468 (gcc:jit::playback::context::invoke_driver): Split out second
2470 (gcc::jit::playback::context::invoke_embedded_driver): ...this new
2472 (gcc::jit::playback::context::invoke_external_driver): ...this new
2475 (gcc::jit::playback::context::get_inner_bool_option): New.
2476 (gcc::jit::playback::context::invoke_embedded_driver): New.
2477 (gcc::jit::playback::context::invoke_external_driver): New.
2478 * jit-recording.c (inner_bool_option_reproducer_strings):
2479 Add entry for INNER_BOOL_OPTION_USE_EXTERNAL_DRIVER.
2481 (gccjit::context::set_bool_use_external_driver): New.
2482 * libgccjit.c (gcc_jit_context_set_bool_use_external_driver): New.
2483 * libgccjit.h (gcc_jit_context_set_bool_use_external_driver): New.
2484 (LIBGCCJIT_HAVE_gcc_jit_context_set_bool_use_external_driver):
2486 * libgccjit.map (LIBGCCJIT_ABI_5): New.
2487 * notes.txt: Show invocation of embedded copy of driver.
2488 * docs/internals/test-hello-world.exe.log.txt: Update
2490 2015-08-13 David Malcolm <dmalcolm@redhat.com>
2492 * jit-playback.c (invoke_driver): On OS X, add
2493 "-Wl,-undefined,dynamic_lookup" to the driver arguments.
2495 2015-08-03 David Malcolm <dmalcolm@redhat.com>
2497 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_4): New.
2498 * docs/topics/contexts.rst (GCC_JIT_BOOL_OPTION_DUMP_SUMMARY):
2499 We no longer show a profile.
2500 * docs/topics/index.rst (Topic Reference): Add performance.rst.
2501 * docs/topics/performance.rst: New file.
2502 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2503 * jit-playback.c (gcc::jit::playback::context::compile): Add timer
2504 param when constructing the "toplev" instance.
2505 (gcc::jit::playback::context::acquire_mutex): Add timer param when
2506 constructing auto_timevar instance.
2507 (gcc::jit::playback::context::make_fake_args): If we have a timer,
2508 add "-ftime-report".
2509 (gcc::jit::playback::context::invoke_driver): Add timer param when
2510 constructing auto_timevar instance.
2511 (gcc::jit::playback::context::dlopen_built_dso): Likewise.
2512 * jit-playback.h (gcc::jit::playback::context::get_timer): New accessor.
2513 * jit-recording.c: Include timevar.h.
2514 (gcc::jit::recording::context::context): Initialize field "m_timer".
2515 * jit-recording.h: Add forward declaration of class timer.
2516 (gcc::jit::recording::context::set_timer): New method.
2517 (gcc::jit::recording::context::get_timer): New method.
2518 (gcc::jit::recording::context::m_timer): New field.
2519 * libgccjit++.h (gccjit::timer): New class.
2520 (gccjit::auto_time): New class.
2521 (gccjit::context::set_timer): New method.
2522 (gccjit::context::get_timer): New.
2523 (gccjit::timer::timer): New.
2524 (gccjit::timer::push): New.
2525 (gccjit::timer::pop): New.
2526 (timer::print): New.
2527 (timer::get_inner_timer): New.
2528 (timer::release): New.
2529 (auto_time::auto_time): New.
2530 (auto_time::~auto_time): New.
2531 * libgccjit.c: Include timevar.h.
2532 (struct gcc_jit_timer): New.
2533 (gcc_jit_timer_new): New function.
2534 (gcc_jit_timer_release): New function.
2535 (gcc_jit_context_set_timer): New function.
2536 (gcc_jit_context_get_timer): New function.
2537 (gcc_jit_timer_push): New function.
2538 (gcc_jit_timer_pop): New function.
2539 (gcc_jit_timer_print): New function.
2540 * libgccjit.h (LIBGCCJIT_HAVE_TIMING_API): New macro.
2541 (gcc_jit_timer): New typedef.
2542 (gcc_jit_timer_new): New function.
2543 (gcc_jit_timer_release): New function.
2544 (gcc_jit_context_set_timer): New function.
2545 (gcc_jit_context_get_timer): New function.
2546 (gcc_jit_timer_push): New function.
2547 (gcc_jit_timer_pop): New function.
2548 (gcc_jit_timer_print): New function.
2549 * libgccjit.map (LIBGCCJIT_ABI_4): New.
2550 (gcc_jit_timer_new): New function.
2551 (gcc_jit_timer_release): New function.
2552 (gcc_jit_context_set_timer): New function.
2553 (gcc_jit_context_get_timer): New function.
2554 (gcc_jit_timer_push): New function.
2555 (gcc_jit_timer_pop): New function.
2556 (gcc_jit_timer_print): New function.
2558 2015-07-23 David Malcolm <dmalcolm@redhat.com>
2560 * jit-playback.c (invoke_driver): Convert local "argvec"
2561 to an auto_argvec, so that it owns copies of the strings,
2562 rather than borrows them, updating ADD_ARG to use xstrdup
2563 and special-casing the NULL terminator to avoid
2564 xstrdup (NULL). Call add_multilib_driver_arguments at the front
2566 (MULTILIB_DEFAULTS): Provide a default definition.
2567 (multilib_defaults_raw): New constant array.
2568 (gcc::jit::playback::context::add_multilib_driver_arguments): New
2571 (gcc::jit::playback::context::add_multilib_driver_arguments): New
2573 * docs/internals/test-hello-world.exe.log.txt: Update.
2574 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2576 2015-07-16 David Malcolm <dmalcolm@redhat.com>
2578 * docs/internals/index.rst (Overview of code structure): Add note
2579 that the implementation is in C++, despite the .c extension.
2580 (Submitting patches): New subsection.
2581 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2583 2015-07-09 Andrew MacLeod <amacleod@redhat.com>
2585 * dummy-frontend.c: Adjust includes for flags.h changes.
2586 * jit-common.h: Likewise.
2587 * jit-playback.c: Likewise.
2589 2015-07-08 David Malcolm <dmalcolm@redhat.com>
2592 * libgccjit.c (gcc_jit_context_new_field): Show name of field in
2593 "unknown size" error message.
2594 (gcc_jit_struct_set_fields): Show name of struct in error message.
2595 (gcc_jit_context_new_global): Show name of global in
2596 "unknown size" error message.
2597 (gcc_jit_function_new_local): Likewise for local.
2599 2015-07-07 Andrew MacLeod <amacleod@redhat.com>
2601 * dummy-frontend.c: Adjust includes.
2602 * jit-common.h: Likewise.
2603 * jit-playback.c: Likewise.
2605 2015-07-07 David Malcolm <dmalcolm@redhat.com>
2608 * jit-recording.h: Within namespace gcc:jit::recording...
2609 (type::has_known_size): New virtual function.
2610 (struct_has_known_size): New function.
2611 * libgccjit.c (gcc_jit_context_new_field): Verify that the type
2613 (gcc_jit_context_new_global): Likewise.
2614 (gcc_jit_function_new_local): Likewise.
2616 2015-07-07 David Malcolm <dmalcolm@redhat.com>
2619 * dummy-frontend.c (jit_langhook_type_for_mode): Ensure that we
2620 handle modes QI, HI, SI, DI, TI.
2622 2015-07-01 David Malcolm <dmalcolm@redhat.com>
2625 * jit-playback.c (jit_mark_addressable): New function.
2626 (gcc::jit::playback::lvalue::get_address): Call
2627 jit_mark_addressable on the underlying tree.
2629 2015-07-01 David Malcolm <dmalcolm@redhat.com>
2631 * docs/topics/types.rst (gcc_jit_context_new_union_type): Add
2633 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2635 2015-07-01 David Malcolm <dmalcolm@redhat.com>
2637 * docs/topics/contexts.rst (gcc_jit_context_set_bool_option):
2638 Clarify lack of lifetime requirements on (const char *) parameter.
2639 * docs/topics/expressions.rst
2640 (gcc_jit_context_new_string_literal): Likewise.
2641 (gcc_jit_context_new_global): Likewise.
2642 * docs/topics/functions.rst (gcc_jit_context_new_param): Likewise.
2643 (gcc_jit_context_new_function): Likewise.
2644 (gcc_jit_function_new_block): Likewise.
2645 (gcc_jit_block_add_comment): Likewise.
2646 * docs/topics/locations.rst (gcc_jit_context_new_location):
2648 * docs/topics/types.rst (gcc_jit_context_new_field): Likewise.
2649 (gcc_jit_context_new_struct_type): Likewise.
2650 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2652 2015-06-30 David Malcolm <dmalcolm@redhat.com>
2654 * docs/cp/topics/functions.rst (Blocks): Add switch statements to
2655 list of ways to terminate a block.
2656 (gccjit::block::end_with_switch): Add function description.
2657 (gccjit::case_): Add class.
2658 (gccjit::context::new_case): Add function description.
2659 * docs/cp/topics/objects.rst: Add "case_" to class hierarchy.
2660 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_3): New.
2661 * docs/topics/functions.rst (Blocks): Add switch statements to
2662 list of ways to terminate a block.
2663 (gcc_jit_block_end_with_switch): Add function description.
2664 (gcc_jit_case): Add type.
2665 (gcc_jit_context_new_case): Add function description.
2666 (gcc_jit_case_as_object): Add function description.
2667 * docs/topics/objects.rst: Add gcc_jit_case to class hierarchy.
2668 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2669 * jit-common.h (gcc::jit::recording::case_): Add forward decl.
2670 (gcc::jit::playback::case_): Add forward decl.
2671 * jit-playback.c (add_case): New function.
2672 (gcc::jit::playback::block::add_switch): New function.
2673 * jit-playback.h (gcc::jit::playback::case_): New struct.
2674 (gcc::jit::playback::block::get_function): New method.
2675 (gcc::jit::playback::block::add_switch): New method.
2676 * jit-recording.c: Within namespace gcc::jit...
2677 (recording::context::new_case): New method.
2678 (recording::function::validate): Update for change to
2679 get_successor_blocks.
2680 (recording::block::end_with_switch): New method.
2681 (recording::block::get_successor_blocks): Update to support an
2682 arbitrary number of successor blocks.
2683 (recording::block::dump_edges_to_dot): Likewise.
2684 (memento_of_new_rvalue_from_const <int>::get_wide_int): New.
2685 (memento_of_new_rvalue_from_const <long>::get_wide_int): New.
2686 (memento_of_new_rvalue_from_const <double>::get_wide_int): New.
2687 (memento_of_new_rvalue_from_const <void *>::get_wide_int): New.
2688 (recording::statement::get_successor_blocks): Update to support an
2689 arbitrary number of successor blocks.
2690 (recording::conditional::get_successor_blocks): Likewise.
2691 (recording::jump::get_successor_blocks): Likewise.
2692 (recording::return_::get_successor_blocks): Likewise.
2693 (recording::case_::write_reproducer): New.
2694 (recording::case_::make_debug_string): New.
2695 (recording::switch_::switch_): New.
2696 (recording::switch_::replay_into): New.
2697 (recording::switch_::get_successor_blocks): New.
2698 (recording::switch_::make_debug_string): New.
2699 (recording::switch_::write_reproducer): New.
2700 * jit-recording.h: Within namespace gcc::jit::recording...
2701 (context::new_case): New.
2702 (rvalue::is_constant): New.
2703 (rvalue::get_wide_int): New.
2704 (block::end_with_switch): New.
2705 (block::get_successor_blocks): Update to support an arbitrary
2706 number of successor blocks.
2707 (memento_of_new_rvalue_from_const::is_constant): New.
2708 (memento_of_new_rvalue_from_const::get_wide_int): New.
2709 (statement::get_successor_blocks): Update to support an arbitrary
2710 number of successor blocks.
2711 (conditional::get_successor_blocks): Likewise.
2712 (jump::get_successor_blocks): Likewise.
2713 (return_::get_successor_blocks): Likewise.
2714 (case_): New subclass of memento.
2715 (switch_): New subclass of statement.
2716 * libgccjit++.h (gccjit::case_): New subclass of gccjit::object.
2717 (gccjit::context::new_case): New method.
2718 (gccjit::block::end_with_switch): New method.
2719 (gccjit::case_::case): New ctors.
2720 (gccjit::case_::get_inner_case): New method.
2721 * libgccjit.c: Include "typed-splay-tree.h"
2722 (struct gcc_jit_case): New.
2723 (gcc_jit_context_new_case): New function.
2724 (gcc_jit_case_as_object): New function.
2725 (valid_dest_for_switch): New function.
2726 (valid_case_for_switch): New function.
2727 (class api_call_validator): New class.
2728 (class case_range_validator): New class.
2729 (case_range_validator::case_range_validator): New.
2730 (case_range_validator::validate): New.
2731 (case_range_validator::case_compare): New.
2732 (case_range_validator::get_wide_int): new.
2733 (gcc_jit_block_end_with_switch): New.
2734 * libgccjit.h: Add gcc_jit_case to class hierarchy comment.
2735 (gcc_jit_case): New typedef.
2736 (gcc_jit_context_new_case): New function.
2737 (gcc_jit_case_as_object): New function.
2738 (gcc_jit_block_end_with_switch): New function.
2739 (LIBGCCJIT_HAVE_SWITCH_STATEMENTS): New.
2740 * libgccjit.map: Add gcc_jit_block_end_with_switch,
2741 gcc_jit_case_as_object and gcc_jit_context_new_case.
2743 2015-06-30 David Malcolm <dmalcolm@redhat.com>
2746 * docs/cp/topics/contexts.rst
2747 (gccjit::context::set_bool_allow_unreachable_blocks): New.
2748 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_2): New.
2749 * docs/topics/contexts.rst (Options): Add notes discussing the
2750 transition from enums to entrypoints for new options.
2751 (gcc_jit_context_set_bool_allow_unreachable_blocks): New.
2752 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2753 * jit-common.h (gcc::jit::inner_bool_option): New enum.
2754 * jit-recording.c: Within namespace gcc::jit...
2755 (recording::context::context): Handle m_inner_bool_options.
2756 (recording::context::set_inner_bool_option): New.
2757 (inner_bool_option_reproducer_strings): New.
2758 (recording::context::log_all_options): Log the "inner" bool
2760 (recording::context::log_inner_bool_option): New.
2761 (recording::context::dump_reproducer_to_file): Write initializers
2762 for "inner" bool options.
2763 (recording::function::validate): Don't check for block
2764 reachability if INNER_BOOL_OPTION_ALLOW_UNREACHABLE_BLOCKS is set.
2765 * jit-recording.h: Within namespace gcc::jit...
2766 (recording::context::set_inner_bool_option): New.
2767 (recording::context::get_inner_bool_option): New.
2768 (recording::context::log_inner_bool_option): New.
2769 (recording::context::m_inner_bool_options): New.
2771 (gccjit::context::set_bool_allow_unreachable_blocks): New.
2773 (gcc_jit_context_set_bool_allow_unreachable_blocks): New.
2774 * libgccjit.h: Add note about options present in the
2775 initial release of libgccjit.
2776 (gcc_jit_context_set_bool_allow_unreachable_blocks): New API
2778 (LIBGCCJIT_HAVE_gcc_jit_context_set_bool_allow_unreachable_blocks):
2780 * libgccjit.map (LIBGCCJIT_ABI_2): New, containing...
2781 (gcc_jit_context_set_bool_allow_unreachable_blocks): ...this new
2784 2015-06-30 David Malcolm <dmalcolm@redhat.com>
2787 * docs/cp/topics/contexts.rst (Additional command-line options):
2789 * docs/topics/compatibility.rst: New file.
2790 * docs/topics/contexts.rst (Additional command-line options): New
2792 * docs/topics/index.rst: Add compatibility.rst.
2793 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2794 * jit-playback.c (make_fake_args): Add call to
2795 append_command_line_options.
2796 * jit-recording.c: Within namespace gcc::jit...
2797 (recording::context::~context): Free the optnames within
2798 m_command_line_options.
2799 (recording::context::set_bool_option): Likewise.
2800 (recording::context::add_command_line_option): New method.
2801 (recording::context::append_command_line_options): New method.
2802 (recording::context::dump_reproducer_to_file): Add command-line
2804 * jit-recording.h: Within namespace gcc::jit...
2805 (recording::context::add_command_line_option): New method.
2806 (recording::context::append_command_line_options): New method.
2807 (recording::context::m_command_line_options): New field.
2808 * libgccjit++.h (gccjit::context::add_command_line_option): New
2810 * libgccjit.c (gcc_jit_context_add_command_line_option): New API
2812 * libgccjit.h (gcc_jit_context_add_command_line_option): New API
2814 (LIBGCCJIT_HAVE_gcc_jit_context_add_command_line_option): New
2816 * libgccjit.map: Put existing symbols within LIBGCCJIT_ABI_0; add
2817 LIBGCCJIT_ABI_1 and gcc_jit_context_add_command_line_option.
2819 2015-06-30 David Malcolm <dmalcolm@redhat.com>
2822 (gcc::jit::recording::context::dump_reproducer_to_file):
2823 Add pragma to generated reproducers to disable -Wunused-variable.
2824 Fix handling of NULL string options.
2826 2015-06-30 David Malcolm <dmalcolm@redhat.com>
2828 * docs/cp/topics/expressions.rst: Remove stray semicolon.
2829 * docs/cp/topics/functions.rst: Remove stray backslash.
2830 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2832 2015-06-25 Andrew MacLeod <amacleod@redhat.com>
2834 * dummy-frontend.c: Remove ipa-ref.h and plugin-api.h from include list.
2835 * jit-playback.c: Likewise.
2837 2015-06-25 Andrew Macleod <amacleod@redhat.com>
2839 * jit-common.h: Don't include alias.h.
2841 2015-06-17 David Malcolm <dmalcolm@redhat.com>
2843 * libgccjit.c (gcc_jit_lvalue_access_field): Verify that the field
2844 is for the correct struct.
2845 (gcc_jit_rvalue_access_field): Likewise.
2847 2015-06-17 Andrew MacLeod <amacleod@redhat.com>
2849 * dummy-frontend.c: Do not include input.h, line-map.h or is-a.h.
2850 * jit-common.h: Likewise.
2851 * jit-playback.c: Likewise.
2853 2015-06-16 David Malcolm <dmalcolm@redhat.com>
2856 * jit-recording.c: Within namespace gcc::jit::recording::
2857 (rvalue::get_debug_string_parens): New function.
2858 (binary_op::make_debug_string): Update to mimic C precedence
2860 (binary_op_precedence): New array.
2861 (binary_op::get_precedence): New function.
2862 (comparison::make_debug_string): Update to mimic C precedence
2864 (comparison_precedence): New array.
2865 (comparison::get_precedence): New function.
2866 (cast::make_debug_string): Update to mimic C precedence rules.
2867 (call::make_debug_string): Likewise.
2868 (call_through_ptr::make_debug_string): Likewise.
2869 (array_access::make_debug_string): Likewise.
2870 (access_field_of_lvalue::make_debug_string): Likewise.
2871 (access_field_rvalue::make_debug_string): Likewise.
2872 (dereference_field_rvalue::make_debug_string): Likewise.
2873 (dereference_rvalue::make_debug_string): Likewise.
2874 (get_address_of_lvalue::make_debug_string): Likewise.
2875 * jit-recording.h: Within namespace gcc::jit::recording::
2876 (precedence): New enum.
2877 (rvalue::rvalue): Initialize field "m_parenthesized_string".
2878 (rvalue::get_debug_string_parens): New method.
2879 (rvalue::get_precedence): New pure virtual function.
2880 (rvalue::m_parenthesized_string): New field.
2881 (param::get_precedence): New function.
2882 (global::get_precedence): New function.
2883 (memento_of_new_rvalue_from_const::get_precedence): New function.
2884 (memento_of_new_string_literal::get_precedence): New function.
2885 (unary_op::get_precedence): New function.
2886 (binary_op::get_precedence): New function.
2887 (comparison::get_precedence): New function.
2888 (cast::get_precedence): New function.
2889 (call::get_precedence): New function.
2890 (call_through_ptr::get_precedence): New function.
2891 (array_access::get_precedence): New function.
2892 (access_field_of_lvalue::get_precedence): New function.
2893 (access_field_rvalue::get_precedence): New function.
2894 (dereference_field_rvalue::get_precedence): New function.
2895 (dereference_rvalue::get_precedence): New function.
2896 (get_address_of_lvalue::get_precedence): New function.
2897 (local::get_precedence): New function.
2899 2015-06-09 Matthias Klose <doko@ubuntu.com>
2901 * Make-lang.in (jit.install-common): Install headers using INSTALL_DATA.
2903 2015-06-08 Andrew MacLeod <amacleod@redhat.com>
2905 * dummy-frontend.c : Adjust include files.
2906 * jit-common.h : Likewise.
2907 * jit-playback.c : Likewise.
2909 2015-06-05 David Malcolm <dmalcolm@redhat.com>
2912 (jit_langhook_post_compilation_parsing_cleanups): Remove.
2913 (LANG_HOOKS_POST_COMPILATION_PARSING_CLEANUPS): Remove
2914 * jit-playback.c (gcc::jit::playback::context::new_global): Add
2915 call to varpool_node::finalize_decl.
2916 (gcc::jit::playback::context::finalize_global_decls): Remove.
2918 (gcc::jit::playback::context::finalize_global_decls): Remove.
2920 2015-06-05 David Malcolm <dmalcolm@redhat.com>
2922 * dummy-frontend.c (jit_langhook_write_globals): Rename to...
2923 (jit_langhook_post_compilation_parsing_cleanups): ...this, and
2924 eliminate calls to finalize_compilation_unit and
2925 write_global_decls_2.
2926 (LANG_HOOKS_WRITE_GLOBALS): Rename to...
2927 (LANG_HOOKS_POST_COMPILATION_PARSING_CLEANUPS): ...this and
2928 redirect from jit_langhook_write_globals to
2929 jit_langhook_post_compilation_parsing_cleanups.
2931 (gcc::jit::playback::context::write_global_decls_1): Rename to...
2932 (gcc::jit::playback::context::finalize_global_decls): ...this.
2933 (gcc::jit::playback::context::write_global_decls_1): Delete.
2935 (gcc::jit::playback::context::write_global_decls_1): Rename to...
2936 (gcc::jit::playback::context::finalize_global_decls): ...this.
2937 (gcc::jit::playback::context::write_global_decls_1): Delete.
2939 2015-06-04 Andrew MacLeod <amacleod@redhat.com>
2941 * dummy-frontend.c: Adjust includes for restructured coretypes.h.
2942 * jit-common.h: Likewise.
2943 * jit-playback.c: Likewise.
2945 2015-05-12 David Malcolm <dmalcolm@redhat.com>
2947 * jit-builtins.c: Include vec.h before target.h.
2949 2015-04-27 Jim Wilson <jim.wilson@linaro.org>
2951 * Make-lang.in (jit.mostlyclean): Remove shared libraries and object
2954 2015-04-09 David Malcolm <dmalcolm@redhat.com>
2957 * docs/cp/topics/expressions.rst (Simple expressions): Fix copy
2958 and paste error in description of gccjit::context::one.
2959 * docs/topics/expressions.rst (Simple expressions): Likewise in
2960 description of gcc_jit_context_one.
2961 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2963 2015-03-13 Uros Bizjak <ubizjak@gmail.com>
2965 * jit-recording.c (dump::write): Also check vasprintf return value.
2966 (recording::context::add_error_va): Ditto.
2967 (recording::string::from_printf): Ditto.
2969 2015-03-13 David Malcolm <dmalcolm@redhat.com>
2971 * docs/internals/index.rst (Packaging notes): New section.
2972 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2974 2015-03-05 David Malcolm <dmalcolm@redhat.com>
2976 * docs/cp/intro/tutorial03.rst: Add missing arguments to
2977 gccjit::block::end_with_conditional call. Add on_true/on_false
2978 comments. Tweak the wording.
2979 * docs/intro/tutorial03.rst: Add missing arguments to
2980 gcc_jit_block_end_with_conditional call. Add some clarifying
2982 * docs/topics/compilation.rst: Tweak the wording to avoid an
2983 ambiguous use of "this".
2984 * docs/topics/contexts.rst: Fix a typo.
2985 * docs/topics/expressions.rst (GCC_JIT_BINARY_OP_MINUS): Remove
2987 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2989 2015-02-24 Thomas Schwinge <thomas@codesourcery.com>
2992 * jit-builtins.c (DEF_FUNCTION_TYPE_VAR_8)
2993 (DEF_FUNCTION_TYPE_VAR_12): Remove macros.
2994 (DEF_FUNCTION_TYPE_VAR_7, DEF_FUNCTION_TYPE_VAR_11): New macros.
2995 * jit-builtins.h (DEF_FUNCTION_TYPE_VAR_8)
2996 (DEF_FUNCTION_TYPE_VAR_12): Remove macros.
2997 (DEF_FUNCTION_TYPE_VAR_7, DEF_FUNCTION_TYPE_VAR_11): New macros.
2999 2015-02-04 David Malcolm <dmalcolm@redhat.com>
3002 * docs/conf.py (html_theme): Change from 'pyramid'
3005 2015-02-04 David Malcolm <dmalcolm@redhat.com>
3007 * docs/topics/contexts.rst (gcc_jit_context_acquire): Fix
3009 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3011 2015-02-03 David Malcolm <dmalcolm@redhat.com>
3013 * jit-logging.h (gcc::jit::log_user::log): Make const.
3014 * jit-recording.c (gcc::jit::recording::context::set_str_option):
3015 Log the new value of the option.
3016 (gcc::jit::recording::context::set_int_option): Likewise.
3017 (gcc::jit::recording::context::set_bool_option): Likewise.
3018 (gcc::jit::recording::context::compile): Log the value of all
3020 (gcc::jit::recording::context::compile_to_file): Likewise.
3021 (gcc::jit::recording::context::log_all_options): New function.
3022 (gcc::jit::recording::context::log_str_option): New function.
3023 (gcc::jit::recording::context::log_int_option): New function.
3024 (gcc::jit::recording::context::log_bool_option): New function.
3025 * jit-recording.h (gcc::jit::recording::context::log_all_options):
3027 (gcc::jit::recording::context::log_str_option): New function.
3028 (gcc::jit::recording::context::log_int_option): New function.
3029 (gcc::jit::recording::context::log_bool_option): New function.
3030 * docs/internals/test-hello-world.exe.log.txt: Update for above
3032 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3034 2015-02-03 David Malcolm <dmalcolm@redhat.com>
3037 * Make-lang.in (jit_OBJS): Add jit/jit-spec.o and gcc.o.
3038 (LIBGCCJIT_FILENAME): Add EXTRA_GCC_OBJS.
3039 * jit-playback.c: Include gcc.h.
3040 (gcc::jit::playback::context::compile): Move mutex acquisition
3041 to before the call to make_fake_args.
3042 (append_arg_from_driver): New function.
3043 (gcc::jit::playback::context::make_fake_args): On the first call,
3044 call into driver_get_configure_time_options to get configure-time
3045 default options and cache them. Add them to the args for
3047 * jit-spec.c: New source file.
3048 * docs/internals/test-hello-world.exe.log.txt: Update to reflect
3050 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3052 2015-02-02 David Malcolm <dmalcolm@redhat.com>
3055 * dummy-frontend.c (jit_langhook_type_for_mode): Support
3056 TYPE_MODE (long_long_integer_type_node).
3058 2015-01-27 David Malcolm <dmalcolm@redhat.com>
3060 * docs/internals/test-hello-world.exe.log.txt: Add example version
3062 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3063 * jit-common.h (gcc::jit::dump::get_file): New accessor.
3064 * jit-logging.c: Include toplev.h.
3065 (gcc::jit::logger::logger): Log the GCC version.
3066 * jit-recording.c: Include toplev.h.
3067 (gcc:jit::recording::context::dump_reproducer_to_file): Log the
3070 2015-01-26 David Malcolm <dmalcolm@redhat.com>
3072 * docs/topics/compilation.rst (gcc_jit_result_get_code): Fix typo.
3073 * docs/topics/contexts.rst (gcc_jit_context_get_last_error): The
3074 error buffer is only valid until the next call to the context.
3075 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3076 * libgccjit.h (gcc_jit_context_get_first_error): Reword the
3077 comment to omit mention of compiling.
3078 (gcc_jit_context_get_last_error): The error buffer is only valid
3079 until the next call to the context.
3081 2015-01-26 David Malcolm <dmalcolm@redhat.com>
3084 * config-lang.in (compilers): Drop "libgccjit.so".
3086 2015-01-23 David Malcolm <dmalcolm@redhat.com>
3089 * jit-playback.c (gcc::jit::playback::context::compile): Construct
3090 toplev instances with init_signals=false.
3092 2015-01-19 David Malcolm <dmalcolm@redhat.com>
3094 * docs/cp/topics/results.rst: Rename to...
3095 * docs/cp/topics/compilation.rst: ...this, and add section on
3096 ahead-of-time compilation.
3097 * docs/cp/topics/index.rst: Update for renaming of results.rst
3099 * docs/examples/emit-alphabet.bf: New file, a sample "brainf"
3101 * docs/examples/tut05-bf.c: New file, implementing a compiler
3103 * docs/internals/test-hello-world.exe.log.txt: Update to reflect
3104 changes to logger output.
3105 * docs/intro/index.rst: Add tutorial05.rst
3106 * docs/intro/tutorial05.rst: New file.
3107 * docs/topics/results.rst: Rename to...
3108 * docs/topics/compilation.rst: ...this, and add section on
3109 ahead-of-time compilation.
3110 * docs/topics/index.rst: Update for renaming of results.rst to
3112 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3113 * jit-playback.c (gcc::jit::playback::context::compile): Convert
3114 return type from result * to void. Move the code to convert to
3115 dso and dlopen the result to a new pure virtual "postprocess"
3117 (gcc::jit::playback::compile_to_memory::compile_to_memory): New
3119 (gcc::jit::playback::compile_to_memory::postprocess): New
3120 function, based on playback::context::compile.
3121 (gcc::jit::playback::compile_to_file::compile_to_file): New
3123 (gcc::jit::playback::compile_to_file::postprocess): New function.
3124 (gcc::jit::playback::compile_to_file::copy_file): New function.
3125 (gcc::jit::playback::context::convert_to_dso): Move internals
3127 (gcc::jit::playback::context::invoke_driver): New method. Add
3128 "-shared" and "-c" options to driver's argv as needed.
3129 * jit-playback.h: Include "timevar.h".
3130 (gcc::jit::playback::context::compile): Convert return type from
3132 (gcc::jit::playback::context::postprocess): New pure virtual
3133 function, making this an abstract base class.
3134 (gcc::jit::playback::context::get_tempdir): New accessor.
3135 (gcc::jit::playback::context::invoke_driver): New function.
3136 (class gcc::jit::playback::compile_to_memory): New subclass of
3138 (class gcc::jit::playback::compile_to_file): Likewise.
3139 * jit-recording.c (gcc::jit::recording::context::compile): Use a
3140 playback::compile_to_memory, and extract its result.
3141 (gcc::jit::recording::context::compile_to_file): New function.
3142 * jit-recording.h (gcc::jit::recording::context::compile_to_file):
3144 * libgccjit++.h (gccjit::context::compile_to_file): New method.
3145 * libgccjit.c (gcc_jit_context_compile): Update log message to
3146 clarify that this is an in-memory compile.
3147 (gcc_jit_context_compile_to_file): New function.
3148 * libgccjit.h (gcc_jit_context): Clarify that you can compile
3149 a context more than once, and that you can compile to a file
3150 as well as to memory.
3151 (gcc_jit_result): Clarify that this is the result of an
3152 in-memory compilation.
3153 (gcc_jit_context_compile): Clarify that you can compile, and that
3154 this is an in-memory compilation.
3155 (enum gcc_jit_output_kind): New enum.
3156 (gcc_jit_context_compile_to_file): New function.
3157 (gcc_jit_context_enable_dump): Clarify comment to cover both forms
3159 * libgccjit.map (gcc_jit_context_compile_to_file): New API
3161 * notes.txt: Update to show the playback::context::postprocess
3164 2015-01-19 David Malcolm <dmalcolm@redhat.com>
3167 (gcc::jit::recording::memento_of_new_string_literal::make_debug_string):
3168 Add missing format string.
3170 2015-01-16 David Malcolm <dmalcolm@redhat.com>
3172 * Make-lang.in (lang_checks_parallelized): Add "check-jit".
3173 (check_jit_parallelize): Set this to an arbitrary value (10).
3175 2015-01-16 Jakub Jelinek <jakub@redhat.com>
3177 * jit-builtins.h (DEF_FUNCTION_TYPE_VAR_5): Fix spelling of
3179 (DEF_FUNCTION_TYPE_VAR_8, DEF_FUNCTION_TYPE_VAR_12): Define and
3181 * jit-builtins.c (DEF_FUNCTION_TYPE_VAR_8, DEF_FUNCTION_TYPE_VAR_12):
3184 2015-01-15 Richard Sandiford <richard.sandiford@arm.com>
3186 Update copyright years in docs/.
3188 2015-01-15 David Malcolm <dmalcolm@redhat.com>
3190 * libgccjit.c (gcc_jit_block_add_assignment_op): Check that the
3191 lvalue and the rvalue are of compatible type.
3193 2015-01-13 David Malcolm <dmalcolm@redhat.com>
3195 * docs/cp/topics/contexts.rst (Debugging): Add
3196 gccjit::context::dump_reproducer_to_file.
3197 * docs/internals/index.rst (Design notes): New section,
3198 discussing input validation and
3199 gcc_jit_context_dump_reproducer_to_file.
3200 * docs/topics/contexts.rst (Debugging): Add
3201 gcc_jit_context_dump_reproducer_to_file.
3202 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3203 * jit-common.h (gcc::jit::dump::get_context): New accessor.
3204 * jit-recording.c: Include "hash-map.h".
3205 Within namespace ::gcc::jit...
3206 (dump::write): Flush each line.
3207 (dump::make_location): Pass false for new param "created_by_user".
3208 (class allocator): New class.
3209 (allocator::~allocator): New function.
3210 (allocator::xstrdup_printf): New function.
3211 (allocator::xstrdup_printf_va): New function.
3212 (class reproducer): New subclass of dump.
3213 (reproducer::reproducer): New function.
3214 (reproducer::write_params): New function.
3215 (reproducer::write_args): New function.
3216 (reproducer::make_identifier): New function.
3217 (reproducer::make_tmp_identifier): New function.
3218 (reproducer::get_identifier): New pair of functions.
3219 (reproducer::get_identifier_as_rvalue): New function.
3220 (reproducer::get_identifier_as_lvalue): New function.
3221 (reproducer::get_identifier_as_type): New function.
3222 (reproducer::xstrdup_printf): New function.
3223 (recording::context::context): Initialize m_toplevel_ctxt.
3224 (recording::context::new_location): Add param created_by_user.
3225 (str_option_reproducer_strings): New table of strings.
3226 (int_option_reproducer_strings): Likewise.
3227 (bool_option_reproducer_strings): Likewise.
3228 (get_type_enum_strings): Likewise.
3229 (names_of_function_kinds): Likewise.
3230 (global_kind_reproducer_strings): Likewise.
3231 (unary_op_reproducer_strings): Likewise.
3232 (binary_op_reproducer_strings): Likewise.
3233 (comparison_reproducer_strings): Likewise.
3234 Within namespace ::gcc::jit::recording::...
3235 (context::dump_reproducer_to_file): New function.
3236 (string::write_reproducer): Likewise.
3237 (location::write_reproducer): Likewise.
3238 (type::access_as_type): Likewise.
3239 (memento_of_get_type::write_reproducer): Likewise.
3240 (memento_of_get_pointer::write_reproducer): Likewise.
3241 (memento_of_get_const::write_reproducer): Likewise.
3242 (memento_of_get_volatile::write_reproducer): Likewise.
3243 (array_type::write_reproducer): Likewise.
3244 (function_type::write_reproducer): Likewise.
3245 (function_type::write_deferred_reproducer): Likewise.
3246 (field::write_reproducer): Likewise.
3247 (struct_::access_as_type): Likewise.
3248 (struct_::write_reproducer): Likewise.
3249 (union_::write_reproducer): Likewise.
3250 (fields::write_reproducer): Likewise.
3251 (rvalue::access_as_rvalue): Likewise.
3252 (lvalue::access_as_rvalue): Likewise.
3253 (lvalue::access_as_lvalue): Likewise.
3254 (param::access_as_rvalue): Likewise.
3255 (param::access_as_lvalue): Likewise.
3256 (param::write_reproducer): Likewise.
3257 (function::write_reproducer): Likewise.
3258 (block::write_reproducer): Likewise.
3259 (global::write_reproducer): Likewise.
3260 (memento_of_new_rvalue_from_const <int>::write_reproducer):
3262 (memento_of_new_rvalue_from_const <long>::write_reproducer):
3264 (memento_of_new_rvalue_from_const <double>::write_reproducer):
3266 (memento_of_new_rvalue_from_const <void *>::write_reproducer):
3268 (memento_of_new_string_literal::write_reproducer): Likewise.
3269 (unary_op::write_reproducer): Likewise.
3270 (binary_op::write_reproducer): Likewise.
3271 (comparison::write_reproducer): Likewise.
3272 (cast::write_reproducer): Likewise.
3273 (call::write_reproducer): Likewise.
3274 (call_through_ptr::write_reproducer): Likewise.
3275 (array_access::write_reproducer): Likewise.
3276 (access_field_of_lvalue::write_reproducer): Likewise.
3277 (access_field_rvalue::write_reproducer): Likewise.
3278 (dereference_field_rvalue::write_reproducer): Likewise.
3279 (dereference_rvalue::write_reproducer): Likewise.
3280 (get_address_of_lvalue::write_reproducer): Likewise.
3281 (local::write_reproducer): Likewise.
3282 (eval::write_reproducer): Likewise.
3283 (assignment::write_reproducer): Likewise.
3284 (assignment_op::write_reproducer): Likewise.
3285 (comment::write_reproducer): Likewise.
3286 (conditional::write_reproducer): Likewise.
3287 (jump::write_reproducer): Likewise.
3288 (return_::write_reproducer): Likewise.
3289 * jit-recording.h (gcc::jit::reproducer): New forward declararion.
3290 Within namespace ::gcc::jit::recording::...
3291 (context::new_location): Add "created_by_user" param.
3292 (context::dump_reproducer_to_file): New method.
3293 (context::m_toplevel_ctxt): New field.
3294 (memento::write_reproducer): New pure virtual function.
3295 (memento::dyn_cast_location): New virtual function.
3296 (string::write_reproducer):
3297 (location::location): Add "created_by_user" param.
3298 (location::dyn_cast_location): New function.
3299 (location::created_by_user): New accessor.
3300 (location::write_reproducer): New function.
3301 (location::m_created_by_user): New field.
3302 (type::access_as_type): New virtual function.
3303 (location::write_reproducer): Likewise.
3304 (type::access_as_type): Likewise.
3305 (memento_of_get_type::write_reproducer): Likewise.
3306 (memento_of_get_pointer::write_reproducer): Likewise.
3307 (memento_of_get_const::write_reproducer): Likewise.
3308 (memento_of_get_volatile::write_reproducer): Likewise.
3309 (array_type::write_reproducer): Likewise.
3310 (function_type::write_reproducer): Likewise.
3311 (function_type::write_deferred_reproducer): Likewise.
3312 (field::write_reproducer): Likewise.
3313 (struct_::access_as_type): Likewise.
3314 (struct_::write_reproducer): Likewise.
3315 (union_::write_reproducer): Likewise.
3316 (union_::m_fields): Remove stray unused field.
3317 (fields::length): New accessor.
3318 (fields::get_field): New accessor.
3319 (fields::write_reproducer): New function.
3320 (rvalue::access_as_rvalue): Likewise.
3321 (lvalue::access_as_rvalue): Likewise.
3322 (lvalue::access_as_lvalue): Likewise.
3323 (param::access_as_rvalue): Likewise.
3324 (param::access_as_lvalue): Likewise.
3325 (param::write_reproducer): Likewise.
3326 (function::write_reproducer): Likewise.
3327 (block::write_reproducer): Likewise.
3328 (global::write_reproducer): Likewise.
3329 (memento_of_new_rvalue_from_const <HOST_TYPE>::write_reproducer):
3331 (memento_of_new_string_literal::write_reproducer): Likewise.
3332 (unary_op::write_reproducer): Likewise.
3333 (binary_op::write_reproducer): Likewise.
3334 (comparison::write_reproducer): Likewise.
3335 (cast::write_reproducer): Likewise.
3336 (call::write_reproducer): Likewise.
3337 (call_through_ptr::write_reproducer): Likewise.
3338 (array_access::write_reproducer): Likewise.
3339 (access_field_of_lvalue::write_reproducer): Likewise.
3340 (access_field_rvalue::write_reproducer): Likewise.
3341 (dereference_field_rvalue::write_reproducer): Likewise.
3342 (dereference_rvalue::write_reproducer): Likewise.
3343 (get_address_of_lvalue::write_reproducer): Likewise.
3344 (local::write_reproducer): Likewise.
3345 (eval::write_reproducer): Likewise.
3346 (assignment::write_reproducer): Likewise.
3347 (assignment_op::write_reproducer): Likewise.
3348 (comment::write_reproducer): Likewise.
3349 (conditional::write_reproducer): Likewise.
3350 (jump::write_reproducer): Likewise.
3351 (return_::write_reproducer): Likewise.
3352 * libgccjit++.h (gccjit::context::dump_reproducer_to_file): New.
3353 * libgccjit.c (gcc_jit_context_new_location): Pass "true" as
3354 param "created_by_user".
3355 (gcc_jit_context_dump_reproducer_to_file): New API entrypoint.
3356 * libgccjit.h (gcc_jit_context_dump_reproducer_to_file): New API
3358 * libgccjit.map (gcc_jit_context_dump_reproducer_to_file): New API
3361 2015-01-12 David Malcolm <dmalcolm@redhat.com>
3363 * jit-recording.c (class gcc::jit::rvalue_usage_validator): New.
3364 (gcc::jit::rvalue_usage_validator::rvalue_usage_validator): New
3366 (gcc::jit::rvalue_usage_validator::visit): New function.
3367 (gcc::jit::recording::rvalue::verify_valid_within_stmt): New
3369 (gcc::jit::recording::rvalue::set_scope): New function.
3370 (gcc::jit::recording::function::function): Call set_scope on each
3371 param, issuing errors for any params that already have a function.
3372 (gcc::jit::recording::block::add_eval): Return the new statement;
3373 update the comment given that some error-checking now happens after
3375 (gcc::jit::recording::block::add_assignment): Likewise.
3376 (gcc::jit::recording::block::add_assignment_op): Likewise.
3377 (gcc::jit::recording::block::add_comment): Likewise.
3378 (gcc::jit::recording::block::end_with_conditional): Likewise.
3379 (gcc::jit::recording::block::end_with_jump): Likewise.
3380 (gcc::jit::recording::block::end_with_return): Likewise.
3381 (gcc::jit::recording::block::validate): Add a comment.
3382 (gcc::jit::recording::unary_op::visit_children): New function.
3383 (gcc::jit::recording::binary_op::visit_children): New function.
3384 (gcc::jit::recording::comparison::visit_children): New function.
3385 (gcc::jit::recording::cast::visit_children): New function.
3386 (gcc::jit::recording::call::visit_children): New function.
3387 (gcc::jit::recording::call_through_ptr::visit_children): New function.
3388 (gcc::jit::recording::array_access::visit_children): New function.
3389 (gcc::jit::recording::access_field_of_lvalue::visit_children): New
3391 (gcc::jit::recording::access_field_rvalue::visit_children): New
3393 (gcc::jit::recording::dereference_field_rvalue::visit_children):
3395 (gcc::jit::recording::dereference_rvalue::visit_children): New
3397 (gcc::jit::recording::get_address_of_lvalue::visit_children): New
3399 * jit-recording.h: Within namespace gcc::jit::recording...
3400 (class rvalue_visitor): New.
3401 (rvalue::rvalue): Initialize m_scope.
3402 (rvalue::get_loc): New accessor.
3403 (rvalue::verify_valid_within_stmt): New function.
3404 (rvalue::visit_children): New pure virtual function.
3405 (rvalue::set_scope): New function.
3406 (rvalue::get_scope): New function.
3407 (rvalue::dyn_cast_param): New function.
3408 (rvalue::m_scope): New field.
3409 (param::visit_children): New empty function.
3410 (param::dyn_cast_param): New function.
3411 (function::get_loc): New function.
3412 (block::add_eval): Return the new statement.
3413 (block::add_assignment): Likewise.
3414 (block::add_assignment_op): Likewise.
3415 (block::add_comment): Likewise.
3416 (block::end_with_conditional): Likewise.
3417 (block::end_with_jump): Likewise.
3418 (block::end_with_return): Likewise.
3419 (global::visit_children): New function.
3420 (memento_of_new_rvalue_from_const<HOST_TYPE>::visit_children):
3422 (memento_of_new_string_literal::visit_children): New function.
3423 (unary_op::visit_children): New function.
3424 (binary_op::visit_children): New function.
3425 (comparison::visit_children): New function.
3426 (cast::visit_children): New function.
3427 (call::visit_children): New function.
3428 (call_through_ptr::visit_children): New function.
3429 (array_access::visit_children): New function.
3430 (access_field_of_lvalue::visit_children): New function.
3431 (access_field_rvalue::visit_children): New function.
3432 (dereference_field_rvalue::visit_children): New function.
3433 (dereference_rvalue::visit_children): New function.
3434 (get_address_of_lvalue::visit_children): New function.
3435 (local::local): Call set_scope.
3436 (local::visit_children): New function.
3437 (statement::get_block): Make public.
3438 * libgccjit.c (RETURN_VAL_IF_FAIL_PRINTF5): New macro.
3439 (RETURN_NULL_IF_FAIL_PRINTF5): New macro.
3440 (gcc_jit_context_new_function): Verify that each param has
3441 not yet been used for creating another function.
3442 (gcc_jit_block_add_eval): After creating the stmt, verify
3443 that the rvalue expression tree is valid to use within it.
3444 (gcc_jit_block_add_assignment): Likewise for the lvalue and
3445 rvalue expression trees.
3446 (gcc_jit_block_add_assignment_op): Likewise.
3447 (gcc_jit_block_end_with_conditional): Likewise for the boolval
3449 (gcc_jit_block_end_with_return): Likewise for the rvalue
3451 (gcc_jit_block_end_with_void_return): Remove return of "void",
3452 now that block::end_with_return is now non-void.
3454 2015-01-12 David Malcolm <dmalcolm@redhat.com>
3456 * jit-playback.c (gcc::jit::playback::context::read_dump_file):
3457 Add missing fclose on error-handling path.
3459 2015-01-12 David Malcolm <dmalcolm@redhat.com>
3461 * docs/cp/topics/expressions.rst (Global variables): Add
3462 enum gcc_jit_global_kind param to gccjit::context::new_global.
3463 * docs/topics/expressions.rst (Global variables): Likewise.
3464 Document the new enum.
3465 * docs/topics/results.rst (Compilation results): Document
3467 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3468 * dummy-frontend.c (jit_langhook_write_globals): Call into the
3469 playback context's write_global_decls_1 and write_global_decls_2
3470 before and after calling symtab->finalize_compilation_unit ().
3471 * jit-playback.c: Include "debug.h".
3472 (gcc::jit::playback::context::new_global): Add "kind" param and
3473 use it to set TREE_PUBLIC, TREE_STATIC and DECL_EXTERNAL on the
3474 underlying VAR_DECL. Call varpool_node::get_create on the
3475 VAR_DECL, and add it to m_globals.
3476 (gcc::jit::playback::context::write_global_decls_1): New function.
3477 (gcc::jit::playback::context::write_global_decls_2): New function.
3478 * jit-playback.h (gcc::jit::playback::context::context): Call
3479 create on m_globals.
3480 (gcc::jit::playback::context::new_global): Add "kind" param.
3481 (gcc::jit::playback::context::write_global_decls_1): New function.
3482 (gcc::jit::playback::context::write_global_decls_2): New function.
3483 (gcc::jit::playback::context::m_globals): New field.
3484 * jit-recording.c (gcc::jit::recording::context::context):
3485 Initialize m_globals.
3486 (gcc::jit::recording::context::new_global): Add param "kind".
3487 Add the new global to m_globals.
3488 (gcc::jit::recording::context::dump_to_file): Dump the globals.
3489 (gcc::jit::recording::global::replay_into): Add field m_kind.
3490 (gcc::jit::recording::global::write_to_dump): New override.
3491 * jit-recording.h (gcc::jit::recording::context::new_global): Add
3493 (gcc::jit::recording::context::m_globals): New field.
3494 (gcc::jit::recording::global::global): Add param kind.
3495 (gcc::jit::recording::global::write_to_dump): New override.
3496 (gcc::jit::recording::global::m_kind): New field.
3497 * jit-result.c (gcc::jit::result::get_global): New function.
3498 * jit-result.h (gcc::jit::result::get_global): New function.
3499 * libgccjit++.h (gccjit::context::new_global): Add "kind" param.
3500 * libgccjit.c (gcc_jit_context_new_global): Likewise.
3501 (gcc_jit_result_get_global): New API entrypoint.
3502 * libgccjit.h (gcc_jit_result_get_global): New API entrypoint.
3503 (enum gcc_jit_global_kind): New enum.
3504 (gcc_jit_context_new_global): API change: add "kind" param.
3505 * libgccjit.map (gcc_jit_result_get_global): New symbol.
3507 2015-01-09 David Malcolm <dmalcolm@redhat.com>
3509 * dummy-frontend.c: Include "fixed-value.h", "alias.h", "flags.h",
3510 "symtab.h", "inchash.h". Move include of "hash-set.h" much
3512 * jit-builtins.c: Remove redundant includes of "opts.h" and
3514 * jit-common.h: Include "hash-set.h", "input.h", "vec.h",
3515 "double-int.h", "alias.h", "flags.h", "symtab.h", "inchash.h".
3516 * jit-playback.c: Include "hashtab.h", "machmode.h", "input.h",
3517 "statistics.h", "vec.h", "double-int.h", "real.h",
3518 "fixed-value.h", "alias.h", "flags.h", "symtab.h", "tree-core.h",
3519 "inchash.h", "fold-const.h". Move include of "hash-set.h" to
3521 * jit-recording.c: Remove redundant includes of "opts.h" and
3524 2015-01-09 David Malcolm <dmalcolm@redhat.com>
3526 * docs/cp/topics/expressions.rst (Simple expressions): Use
3527 ":c:type:" for C types. Document new overload of
3528 gcc::jit::context::new_rvalue.
3529 * docs/topics/expressions.rst (Simple expressions): Use
3530 ":c:type:" for C types. Document new entrypoint
3531 gcc_jit_context_new_rvalue_from_long.
3532 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3533 * jit-playback.c: Within namespace gcc::jit::playback...
3534 (context::new_rvalue_from_int): Eliminate in favor of...
3535 (context::new_rvalue_from_const <int>): ...this.
3536 (context::new_rvalue_from_double): Eliminate in favor of...
3537 (context::new_rvalue_from_const <double>): ...this.
3538 (context::new_rvalue_from_const <long>): New.
3539 (context::new_rvalue_from_ptr): Eliminate in favor of...
3540 (context::new_rvalue_from_const <void *>): ...this.
3541 * jit-playback.h: Within namespace gcc::jit::playback...
3542 (context::new_rvalue_from_int): Eliminate in favor of...
3543 (context::new_rvalue_from_const <HOST_TYPE>): ...this.
3544 (context::new_rvalue_from_double): Likewise.
3545 (context::new_rvalue_from_ptr): Likewise.
3546 * jit-recording.c: Within namespace gcc::jit::recording...
3547 (context::new_rvalue_from_int): Eliminate.
3548 (context::new_rvalue_from_double): Likewise.
3549 (context::new_rvalue_from_ptr): Likewise.
3550 (class memento_of_new_rvalue_from_const <int>):
3551 Add explicit specialization.
3552 (class memento_of_new_rvalue_from_const <long>):
3554 (class memento_of_new_rvalue_from_const <double>):
3556 (class memento_of_new_rvalue_from_const <void *>):
3558 (memento_of_new_rvalue_from_int::replay_into):
3560 (memento_of_new_rvalue_from_const <HOST_TYPE>::replay_into):
3562 (memento_of_new_rvalue_from_double::replay_into):
3564 (memento_of_new_rvalue_from_ptr::replay_into):
3565 ...and this to be deleted.
3566 (memento_of_new_rvalue_from_int::make_debug_string):
3568 (memento_of_new_rvalue_from_const <int>::make_debug_string):
3570 (memento_of_new_rvalue_from_double::make_debug_string):
3572 (memento_of_new_rvalue_from_const <double>::make_debug_string):
3574 (memento_of_new_rvalue_from_ptr::make_debug_string)
3576 (memento_of_new_rvalue_from_const <void *>::make_debug_string):
3578 (memento_of_new_rvalue_from_const <long>::make_debug_string):
3580 * jit-recording.h: Within namespace gcc::jit::recording...
3581 (context::new_rvalue_from_int): Eliminate.
3582 (context::new_rvalue_from_double): Likewise.
3583 (context::new_rvalue_from_ptr): Likewise, all in favor of...
3584 (context::new_rvalue_from_const <HOST_TYPE>): New family of
3586 (class memento_of_new_rvalue_from_int): Eliminate.
3587 (class memento_of_new_rvalue_from_double): Likewise.
3588 (class memento_of_new_rvalue_from_ptr): Likewise.
3589 (class memento_of_new_rvalue_from_const <HOST_TYPE>): New family
3590 of rvalue subclasses.
3591 * libgccjit++.h (gccjit::context::new_rvalue): New overload, for
3593 * libgccjit.c (gcc_jit_context_new_rvalue_from_int): Update for
3594 rewriting of recording::context::new_rvalue_from_int to
3595 recording::context::new_rvalue_from_const <int>.
3596 (gcc_jit_context_new_rvalue_from_long): New API entrypoint.
3597 (gcc_jit_context_new_rvalue_from_double): Update for
3598 rewriting of recording::context::new_rvalue_from_double to
3599 recording::context::new_rvalue_from_const <double>.
3600 (gcc_jit_context_new_rvalue_from_ptr): Update for
3601 rewriting of recording::context::new_rvalue_from_ptr to
3602 recording::context::new_rvalue_from_const <void *>.
3603 * libgccjit.h (gcc_jit_context_new_rvalue_from_long): New API
3605 * libgccjit.map (gcc_jit_context_new_rvalue_from_long): Likewise.
3607 2015-01-09 David Malcolm <dmalcolm@redhat.com>
3610 * docs/internals/test-hello-world.exe.log.txt: Update, the log now
3611 shows tempdir creation/cleanup.
3612 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3613 * jit-logging.h (class gcc::jit::log_user): Add gcc::jit::tempdir
3614 to the list of subclasses in the comment.
3615 * jit-playback.c (gcc::jit::playback::context::context): Add a
3616 comment clarifying when the tempdir gets cleaned up.
3617 (gcc::jit::playback::context::compile): Pass the context's logger,
3618 if any, to the tempdir.
3619 (gcc::jit::playback::context::dlopen_built_dso): When creating the
3620 gcc::jit::result, if GCC_JIT_BOOL_OPTION_DEBUGINFO is set, hand
3621 over ownership of the tempdir to it.
3622 * jit-result.c: Include "jit-tempdir.h".
3623 (gcc::jit::result::result): Add tempdir param, saving it as
3625 (gcc::jit::result::~result): Delete m_tempdir.
3626 * jit-result.h (gcc::jit::result::result): Add tempdir param.
3627 (gcc::jit::result::m_tempdir): New field.
3628 * jit-tempdir.c (gcc::jit::tempdir::tempdir): Add logger param;
3630 (gcc::jit::tempdir::create): Add JIT_LOG_SCOPE to log entry/exit,
3631 and log m_path_template and m_path_tempdir.
3632 (gcc::jit::tempdir::~tempdir): Add JIT_LOG_SCOPE to log
3633 entry/exit, and log the unlink and rmdir calls.
3634 * jit-tempdir.h: Include "jit-logging.h".
3635 (class gcc::jit::tempdir): Make this be a subclass of log_user.
3636 (gcc::jit::tempdir::tempdir): Add logger param.
3637 * notes.txt: Update to show the two possible places where the
3638 tempdir can be cleaned up.
3640 2015-01-08 David Malcolm <dmalcolm@redhat.com>
3642 * libgccjit.h (struct gcc_jit_context): Rewrite the descriptive
3645 2015-01-08 David Malcolm <dmalcolm@redhat.com>
3647 * docs/topics/contexts.rst (Error-handling): Document new
3648 entrypoint gcc_jit_context_get_last_error.
3649 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3650 * jit-recording.c (gcc::jit::recording::context::context):
3651 Initialize new fields "m_last_error_str" and
3652 "m_owns_last_error_str".
3653 (gcc::jit::recording::context::~context): Clean up
3654 m_last_error_str, if needed.
3655 (gcc::jit::recording::context::add_error_va): Update
3656 m_last_error_str and m_owns_last_error_str, freeing the old
3657 value if appropriate.
3658 (gcc::jit::recording::context::get_last_error): New function.
3659 * jit-recording.h (gcc::jit::recording::context::get_last_error):
3661 (gcc::jit::recording::context): New fields m_last_error_str and
3662 m_owns_last_error_str.
3663 * libgccjit.c (gcc_jit_context_get_last_error): New function.
3664 * libgccjit.h (gcc_jit_context_get_last_error): New declaration.
3665 * libgccjit.map (gcc_jit_context_get_last_error): New function.
3667 2015-01-08 David Malcolm <dmalcolm@redhat.com>
3669 * Make-lang.in (jit_OBJS): Add jit/jit-logging.o.
3670 * docs/internals/index.rst (Overview of code structure): Mention
3671 gcc_jit_context_set_logfile, and embed the example logfile.
3672 * docs/internals/test-hello-world.exe.log.txt: New file: example
3674 * docs/topics/contexts.rst (Debugging): Add documentation
3675 for gcc_jit_context_set_logfile.
3676 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3677 * dummy-frontend.c: Include "jit-logging.h".
3678 (jit_langhook_init): Assert that there is an active playback
3679 context. If it has a logger, log entry/exit to this function.
3680 (jit_langhook_write_globals): Likewise.
3681 * jit-common.h (gcc::jit::logger): New forward declaration.
3682 * jit-logging.c: New file.
3683 * jit-logging.h: New file.
3684 * jit-playback.c: Include "jit-logging.h".
3685 (gcc::jit::playback::context::context): Initialize the log_user
3686 base class from the recording context's logger (if any). Use
3687 JIT_LOG_SCOPE to log entry/exit from the function body.
3688 (gcc::jit::playback::context::~context): Use JIT_LOG_SCOPE to
3689 log entry/exit from the function body.
3690 (gcc::jit::playback::build_stmt_list): Likewise.
3691 (gcc::jit::playback::function::postprocess): Likewise.
3692 (gcc::jit::playback::context::compile): Likewise. Log the
3693 entry/exit to toplev::main and toplev::finalize. Log the
3694 fake argv passed to toplev::main.
3695 (gcc::jit::playback::context::acquire_mutex): Use JIT_LOG_SCOPE to
3696 log entry/exit from the function body.
3697 (gcc::jit::playback::context::release_mutex): Likewise.
3698 (gcc::jit::playback::context::make_fake_args): Likewise.
3699 (gcc::jit::playback::context::extract_any_requested_dumps):
3701 (gcc::jit::playback::context::convert_to_dso): Likewise. Also,
3702 log the arguments that the driver is invoked with.
3703 (gcc::jit::playback::context::dlopen_built_dso): Likewise. Pass
3704 the logger to the result object.
3705 (gcc::jit::playback::context::replay): Use JIT_LOG_SCOPE to
3706 log entry/exit from the function body.
3707 (gcc::jit::playback::context::dump_generated_code): Likewise.
3708 (gcc::jit::playback::context::handle_locations): Likewise.
3709 * jit-playback.h (gcc::jit::playback::context): Make this be
3710 a subclass of gcc::jit::log_user.
3711 * jit-recording.c: Include "jit-logging.h".
3712 (gcc::jit::recording::context::context: Initialize the logger to
3713 NULL for root contexts, or to the parent's logger for child
3715 (gcc::jit::recording::context::~context): Use JIT_LOG_SCOPE to
3716 log entry/exit from the function body.
3717 (gcc::jit::recording::context::replay_into): Likewise.
3718 (gcc::jit::recording::context::disassociate_from_playback):
3720 (gcc::jit::recording::context::compile): Likewise.
3721 (recording::context::add_error_va): Likewise. Also, log the
3723 (gcc::jit::recording::context::validate): Use JIT_LOG_SCOPE to
3724 log entry/exit from the function body.
3725 * jit-recording.h: Include "jit-logging.h".
3726 (gcc::jit::recording::context): Make this be a subclass of
3728 * jit-result.c: Include "jit-common.h" and "jit-logging.h".
3729 (gcc::jit::result::result): Add logger param, recording it.
3730 Use JIT_LOG_SCOPE to log entry/exit from the function body.
3731 (gcc::jit::result::~result(): Use JIT_LOG_SCOPE to
3732 log entry/exit from the function body.
3733 (gcc::jit::result::get_code): Likewise.
3734 * jit-result.h (gcc::jit::result): Make this be a subclass of
3736 (gcc::jit::result::result): Add logger parameter.
3737 * libgccjit++.h (gccjit::context::set_logfile): New function.
3738 * libgccjit.c: Include "jit-logging.h".
3739 (gcc_jit_context_acquire): Log the context.
3740 (gcc_jit_context_release): Use JIT_LOG_FUNC to
3741 log entry/exit from the function body, and log the context.
3742 (gcc_jit_context_new_child_context): Likewise, logging both
3744 (gcc_jit_context_new_location): Use JIT_LOG_FUNC to
3745 log entry/exit from the function body.
3746 (gcc_jit_context_get_type): Likewise.
3747 (gcc_jit_context_get_int_type): Likewise.
3748 (gcc_jit_context_new_array_type): Likewise.
3749 (gcc_jit_context_new_field): Likewise.
3750 (gcc_jit_context_new_struct_type): Likewise.
3751 (gcc_jit_context_new_opaque_struct): Likewise.
3752 (gcc_jit_struct_set_fields): Likewise.
3753 (gcc_jit_context_new_union_type): Likewise.
3754 (gcc_jit_context_new_function_ptr_type): Likewise.
3755 (gcc_jit_context_new_param): Likewise.
3756 (gcc_jit_context_new_function): Likewise.
3757 (gcc_jit_context_get_builtin_function): Likewise.
3758 (gcc_jit_function_get_param): Likewise.
3759 (gcc_jit_function_dump_to_dot): Likewise.
3760 (gcc_jit_function_new_block): Likewise.
3761 (gcc_jit_context_new_global): Likewise.
3762 (gcc_jit_context_new_rvalue_from_int): Likewise.
3763 (gcc_jit_context_zero): Likewise.
3764 (gcc_jit_context_one): Likewise.
3765 (gcc_jit_context_new_rvalue_from_double): Likewise.
3766 (gcc_jit_context_new_rvalue_from_ptr): Likewise.
3767 (gcc_jit_context_null): Likewise.
3768 (gcc_jit_context_new_string_literal): Likewise.
3769 (gcc_jit_context_new_unary_op): Likewise.
3770 (gcc_jit_context_new_binary_op): Likewise.
3771 (gcc_jit_context_new_comparison): Likewise.
3772 (gcc_jit_context_new_call): Likewise.
3773 (gcc_jit_context_new_call_through_ptr): Likewise.
3774 (gcc_jit_context_new_cast): Likewise.
3775 (gcc_jit_context_new_array_access): Likewise.
3776 (gcc_jit_lvalue_access_field): Likewise.
3777 (gcc_jit_rvalue_access_field): Likewise.
3778 (gcc_jit_rvalue_dereference_field): Likewise.
3779 (gcc_jit_rvalue_dereference): Likewise.
3780 (gcc_jit_lvalue_get_address): Likewise.
3781 (gcc_jit_function_new_local): Likewise.
3782 (gcc_jit_block_add_eval): Likewise.
3783 (gcc_jit_block_add_assignment): Likewise.
3784 (gcc_jit_block_add_assignment_op): Likewise.
3785 (gcc_jit_block_end_with_conditional): Likewise.
3786 (gcc_jit_block_add_comment): Likewise.
3787 (gcc_jit_block_end_with_jump): Likewise.
3788 (gcc_jit_block_end_with_return): Likewise.
3789 (gcc_jit_block_end_with_void_return): Likewise.
3790 (gcc_jit_context_set_str_option): Likewise.
3791 (gcc_jit_context_set_int_option): Likewise.
3792 (gcc_jit_context_set_bool_option): Likewise.
3793 (gcc_jit_context_enable_dump): Likewise.
3794 (gcc_jit_context_compile): Likewise. Also log the context,
3796 (gcc_jit_context_dump_to_file): Likewise.
3797 (gcc_jit_context_set_logfile): New function.
3798 (gcc_jit_context_get_first_error): Use JIT_LOG_FUNC to
3799 log entry/exit from the function body.
3800 (gcc_jit_result_get_code): Likewise. Also log the fnname)
3801 and the ptr to be returned.
3802 (gcc_jit_result_release): Likewise. Also log the result.
3803 * libgccjit.h: Include <stdio.h>, since we need FILE *.
3804 (gcc_jit_context_set_logfile): New declaration.
3805 * libgccjit.map (gcc_jit_context_set_logfile): New.
3807 2015-01-07 David Malcolm <dmalcolm@redhat.com>
3809 * jit-recording.h (gcc::jit::recording::type::is_void): New
3811 (gcc::jit::recording::memento_of_get_type::is_void): New
3812 function, overriding default implementation.
3813 * libgccjit.c (gcc_jit_rvalue_dereference): Verify that
3814 the underlying type is not "void".
3816 2015-01-07 David Malcolm <dmalcolm@redhat.com>
3818 * docs/topics/expressions.rst (Unary Operations): Add
3819 GCC_JIT_UNARY_OP_ABS.
3820 * jit-playback.c (gcc::jit::playback::context::new_unary_op):
3822 * jit-recording.c (unary_op_strings): Likewise.
3823 * libgccjit.c (gcc_jit_context_new_unary_op): Update checking
3824 of "op" to reflect addition of GCC_JIT_UNARY_OP_ABS.
3825 * libgccjit.h (enum gcc_jit_unary_op): Add GCC_JIT_UNARY_OP_ABS.
3826 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3828 2015-01-07 David Malcolm <dmalcolm@redhat.com>
3830 * jit-recording.h (gcc::jit::recording::memento_of_get_type): Fix
3833 2015-01-07 David Malcolm <dmalcolm@redhat.com>
3835 * TODO.rst (Test suite): Remove item about running C++ testcases.
3836 * docs/internals/index.rst (Working on the JIT library): Add
3837 "c++" to the enabled languages in the suggested "configure"
3838 invocation, and add a description of why this is necessary.
3839 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3841 2015-01-07 David Malcolm <dmalcolm@redhat.com>
3843 * docs/internals/index.rst: Update to reflect that built
3844 testcases are now test-foo.c.exe, rather than test-foo.exe.
3845 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3847 2015-01-05 Jakub Jelinek <jakub@redhat.com>
3849 Update copyright years.
3851 2014-12-19 David Malcolm <dmalcolm@redhat.com>
3853 * jit-playback.c (gcc::jit::playback::context::build_cast): In
3854 case BOOLEAN_TYPE, don't assume that the source expression is
3857 2014-12-19 David Malcolm <dmalcolm@redhat.com>
3859 * jit-recording.c (gcc::jit::recording::context::context): When
3860 copying string options from a parent context, take a copy of the
3861 underlying buffers, rather than simply copying the pointer.
3863 2014-12-19 David Malcolm <dmalcolm@redhat.com>
3865 * jit-recording.c (gcc::jit::recording::context::set_str_option):
3868 2014-12-11 David Malcolm <dmalcolm@redhat.com>
3870 * docs/cp/topics/contexts.rst (gccjit::context::set_str_option):
3871 Document new function.
3872 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3874 2014-12-10 Ulrich Drepper <drepper@gmail.com>
3876 Minor interface cleanups of libgccjit
3877 * jit-playback.c (convert_to_dso): Use auto_vec instead
3878 of automatic array to build up command line.
3879 * jit-recording.c (recording::context::set_str_option):
3880 Make copy of the string.
3881 (recording::context::~context): Free string options.
3882 * jit-recording.h (recording::context): Adjust type
3883 of m_str_options member.
3884 * libgccjit.h: Adjust comment about
3885 gcc_jit_context_set_str_option parameter being used after
3887 Update comment now that all interfaces are copy strings
3889 * libgccjit++.h (gccjit::context): Add set_str_option
3892 2014-12-10 David Malcolm <dmalcolm@redhat.com>
3894 * docs/cp/index.rst: New file.
3895 * docs/cp/intro/index.rst: New file.
3896 * docs/cp/intro/tutorial01.rst: New file.
3897 * docs/cp/intro/tutorial02.rst: New file.
3898 * docs/cp/intro/tutorial03.rst: New file.
3899 * docs/cp/intro/tutorial04.rst: New file.
3900 * docs/cp/topics/contexts.rst: New file.
3901 * docs/cp/topics/expressions.rst: New file.
3902 * docs/cp/topics/functions.rst: New file.
3903 * docs/cp/topics/index.rst: New file.
3904 * docs/cp/topics/locations.rst: New file.
3905 * docs/cp/topics/objects.rst: New file.
3906 * docs/cp/topics/results.rst: New file.
3907 * docs/cp/topics/types.rst: New file.
3908 * docs/examples/tut01-hello-world.cc: New file.
3909 * docs/examples/tut02-square.c: Fix missing newline in output.
3910 * docs/examples/tut02-square.cc: New file.
3911 * docs/examples/tut03-sum-of-squares.cc: New file.
3912 * docs/examples/tut04-toyvm/toyvm.cc: New file.
3913 * docs/index.rst: Move summary to above the table of contents.
3914 Add text about the C vs C++ APIs.
3915 * docs/topics/contexts.rst: Fix a typo.
3917 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3918 * docs/_build/texinfo/factorial1.png: New file.
3919 * docs/_build/texinfo/sum-of-squares1.png: New file.
3921 2014-12-09 David Malcolm <dmalcolm@redhat.com>
3923 * docs/examples/tut04-toyvm/toyvm.c (toyvm_function_compile): Move
3924 logic for determine "funcname" to new function...
3925 (get_function_name): ...here, adding logic to skip any leading
3926 path from the filename.
3927 (toyvm_function_parse): Use the filename for fn_filename, rather
3928 than "name", so that the debugger can locate the source .toy
3930 (toyvm_function_parse): Don't fclose a NULL FILE *.
3932 2014-12-09 David Malcolm <dmalcolm@redhat.com>
3935 * docs/internals/index.rst (Running under valgrind): New
3937 (docs/_build/texinfo/libgccjit.texi): Regenerate.
3939 2014-12-09 David Malcolm <dmalcolm@redhat.com>
3942 * Make-lang.in (jit_OBJS): Add jit/jit-tempdir.o.
3943 * jit-common.h (gcc::jit::tempdir): New forward decl.
3944 * jit-playback.c: Include jit-tempdir.h.
3945 (gcc::jit::playback::context::context): Initialize m_tempdir.
3946 (gcc::jit::playback::context::~context): Move tempdir
3947 cleanup to new file jit-tempdir.c
3948 (make_tempdir_path_template): Move to new file jit-tempdir.c.
3949 (gcc::jit::playback::context::compile): Move tempdir creation
3950 to new tempdir object in new file jit-tempdir.c.
3951 (gcc::jit::playback::context::make_fake_args): Get path from
3952 tempdir object rather than from member data.
3953 (gcc::jit::playback::context::convert_to_dso): Likewise.
3954 (gcc::jit::playback::context::dlopen_built_dso): Likewise.
3955 (gcc::jit::playback::context::dump_generated_code): Likewise.
3956 (gcc::jit::playback::context::get_path_c_file): New function.
3957 (gcc::jit::playback::context::get_path_s_file): New function.
3958 (gcc::jit::playback::context::get_path_so_file): New function.
3959 * jit-playback.h (gcc::jit::playback::context::get_path_c_file):
3961 (gcc::jit::playback::context::get_path_s_file): New function.
3962 (gcc::jit::playback::context::get_path_so_file): New function.
3963 (gcc::jit::playback::context): Move fields "m_path_template",
3964 "m_path_tempdir", "m_path_c_file", "m_path_s_file",
3965 "m_path_so_file" to new jit::tempdir class; add field "m_tempdir".
3966 * jit-tempdir.c: New file.
3967 * jit-tempdir.h: New file.
3969 2014-12-09 David Malcolm <dmalcolm@redhat.com>
3971 * jit-playback.c (gcc::jit::playback::context::compile): Acquire the
3972 mutex here, immediately before using toplev, and release it here, on
3973 each exit path after acquisition.
3974 (jit_mutex): Move this variable here, from jit-recording.c.
3975 (gcc::jit::playback::context::acquire_mutex): New function, based on
3976 code in jit-recording.c.
3977 (gcc::jit::playback::context::release_mutex): Likewise.
3978 * jit-playback.h (gcc::jit::playback::context::acquire_mutex): New
3980 (gcc::jit::playback::context::release_mutex): New function.
3981 * jit-recording.c (jit_mutex): Move this variable to jit-playback.c.
3982 (gcc::jit::recording::context::compile): Move mutex-handling from
3983 here into jit-playback.c's gcc::jit::playback::context::compile.
3984 * notes.txt: Update to show the new locations of ACQUIRE_MUTEX
3987 2014-12-09 David Malcolm <dmalcolm@redhat.com>
3989 * jit-playback.c (gcc::jit::playback::context::compile): Move the
3991 (gcc::jit::playback::context::dlopen_built_dso): ...this new
3993 * jit-playback.h (gcc::jit::playback::context::dlopen_built_dso):
3996 2014-12-09 David Malcolm <dmalcolm@redhat.com>
3999 * docs/topics/contexts.rst (Debugging): Add description of
4000 gcc_jit_context_enable_dump.
4001 * docs/_build/texinfo/libgccjit.texi: Regenerate.
4002 * jit-playback.c: Include context.h.
4003 (class auto_argvec): New class.
4004 (auto_argvec::~auto_argvec): New function.
4005 (gcc::jit::playback::context::compile): Convert fake_args to be
4006 an auto_argvec, so that it can contain dynamically-allocated
4007 strings. Construct a vec of all requested dumps, and pass it to
4008 make_fake_args. Extract requested dumps between the calls to
4009 toplev::main and toplev::finalize.
4010 (gcc::jit::playback::context::make_fake_args): Convert param
4011 "argvec" to be a vec <char *>, and gain a "requested_dumps"
4012 param. Convert to dynamically-allocated arg strings by converting
4013 ADD_ARG to take a copy of the arg, and add ADD_ARG_TAKE_OWNERSHIP
4014 for args that are already a copy. Add args for all requested dumps.
4015 (gcc::jit::playback::context::extract_any_requested_dumps): New
4017 (gcc::jit::playback::context::read_dump_file): New function.
4018 * jit-playback.h (gcc::jit::playback::context::make_fake_args):
4019 Convert param "argvec" to be a vec <char *>, and gain a
4020 "requested_dumps" param.
4021 (gcc::jit::playback::context::extract_any_requested_dumps): New
4023 (gcc::jit::playback::context::read_dump_file): New function.
4024 * jit-recording.c (gcc::jit::recording::context::enable_dump): New
4026 (gcc::jit::recording::context::get_all_requested_dumps): New
4028 * jit-recording.h (gcc::jit::recording::requested_dump): New
4030 (gcc::jit::recording::context::enable_dump): New function.
4031 (gcc::jit::recording::context::get_all_requested_dumps): New
4033 (gcc::jit::recording::context::m_requested_dumps): New field.
4034 * libgccjit.c (gcc_jit_context_enable_dump): New API entrypoint.
4035 * libgccjit.h (gcc_jit_context_enable_dump): New API entrypoint.
4036 * libgccjit.map (gcc_jit_context_enable_dump): New API entrypoint.
4038 2014-12-08 David Malcolm <dmalcolm@redhat.com>
4040 * libgccjit++.h: Indent the forward declarations of the classes to
4041 show the inheritance hierarchy.
4043 2014-12-08 David Malcolm <dmalcolm@redhat.com>
4045 * notes.txt: Show the beginning and ending of
4046 recording::context::compile vs playback::context::compile. Show
4047 the creation and unlinking of the tempdir. Show toplev::finalize.
4048 Move "RELEASE MUTEX" to the correct location. Show
4049 gcc_jit_result_release, and indicate where the
4050 dlopen/dlsym/dlclose occur.
4052 2014-12-01 David Malcolm <dmalcolm@redhat.com>
4054 * docs/examples/tut02-square.c (main): Release the context
4055 earlier, to show that this is possible. Update error-handling
4056 to avoid a double-release of the context, and to avoid
4057 releasing a NULL result.
4058 * docs/intro/tutorial02.rst: Discuss gcc_jit_context_release.
4059 * docs/topics/functions.rst (GCC_JIT_FUNCTION_EXPORTED): Emphasize
4060 * docs/topics/results.rst (gcc_jit_result): Mention that this
4061 controls the lifetimes of machine code functions.
4062 (gcc_jit_result_get_code): Spell out the requirements for this
4063 to succeed, and the lifetime of the result.
4064 (gcc_jit_result_release): Mention that this invalidates any code
4065 that was obtained from the result.
4066 * docs/_build/texinfo/libgccjit.texi: Regenerate.
4068 2014-12-01 David Malcolm <dmalcolm@redhat.com>
4071 * docs/intro/tutorial02.rst: Spell out lifetime of generated code.
4072 Add description of error-handling, taken in part from...
4073 * docs/topics/contexts.rst (Error-handling): Expand, and move some
4074 content to tutorial02.rst.
4075 * docs/_build/texinfo/libgccjit.texi: Regenerate.
4077 2014-12-01 David Malcolm <dmalcolm@redhat.com>
4080 * docs/topics/types.rst (Standard types) Add new enum values to
4081 the table of enum gcc_jit_types: GCC_JIT_TYPE_COMPLEX_FLOAT,
4082 GCC_JIT_TYPE_COMPLEX_DOUBLE, GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE.
4083 Widen the left-hand column so that
4084 GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE will fit.
4085 * docs/_build/texinfo/libgccjit.texi: Regenerate.
4087 * jit-builtins.c: Include stringpool.h and jit-playback.h.
4088 Move everything out of the gcc::jit::recording namespace into
4090 (struct builtin_data): Add fields "fnclass", "attr", and
4092 (DEF_BUILTIN): Update macro so populate the new fields.
4093 (builtins_manager::builtins_manager): Update for move out of
4094 recording namespace. Initialize the m_attributes array.
4095 (builtins_manager::get_builtin_function): Likewise.
4096 (builtins_manager::get_builtin_function_by_id): New function.
4097 (builtins_manager::make_builtin_function): Update for move out of
4098 recording namespace. Add fix for PR jit/64020 by detecting
4099 specific builtin ids and having them ensure that builtins for
4100 other ids are created as necessary.
4101 (builtins_manager::get_type): Update for move out of recording
4103 (builtins_manager::make_type): Likewise. Add some missing
4105 (builtins_manager::make_primitive_type): Update for move out of
4106 recording namespace. Implement the three BT_COMPLEX_ cases and
4108 (builtins_manager::make_fn_type): Update for move out of recording
4110 (builtins_manager::make_ptr_type): Likewise.
4111 (builtins_manager::finish_playback): New function.
4112 (builtins_manager::get_class): New function.
4113 (builtins_manager::implicit_p): New function.
4114 (builtins_manager::get_attrs_tree): Two new functions.
4115 (builtins_manager::make_attrs_tree): New function.
4117 * jit-builtins.h: Move everything out of the gcc::jit::recording
4118 namespace into just gcc::jit.
4119 (enum built_in_attribute): New.
4120 (builtins_manager::builtins_manager): Update decl for namespace
4122 (builtins_manager::get_builtin_function): Likewise.
4123 (builtins_manager::get_class): New.
4124 (builtins_manager::implicit_p): New.
4125 (builtins_manager::get_attrs_tree): Two new functions.
4126 (builtins_manager::make_attrs_tree): New function.
4127 (builtins_manager::finish_playback): New.
4128 (builtins_manager::get_builtin_function_by_id): New.
4129 (builtins_manager::make_builtin_function): Update decl for
4131 (builtins_manager::get_type): Likewise.
4132 (builtins_manager::make_type): Likewise.
4133 (builtins_manager::make_primitive_type): Likewise.
4134 (builtins_manager::make_fn_type): Likewise.
4135 (builtins_manager::make_ptr_type): Likewise.
4136 (builtins_manager): Likewise for fields. Add new field
4139 * jit-common.h (NUM_GCC_JIT_TYPES): Update.
4140 (builtins_manager): Update forward decl to reflect namespace
4143 * jit-playback.c: Include attribs.h and jit-builtins.h.
4144 (gcc::jit::playback::context::get_tree_node_for_type): Add cases
4145 for the new COMPLEX_ types.
4146 (gcc::jit::playback::context::new_function): If creating a
4147 builtin, set the DECL_BUILT_IN_CLASS and attributes on the fndecl,
4148 and call set_builtin_decl.
4149 (gcc::jit::playback::context::replay): If we have a
4150 builtins_manager, call its finish_playback method when we're done.
4153 (gcc::jit::playback::context::get_builtins_manager): New function.
4156 (gcc::jit::recording::context::get_builtins_manager): New function.
4157 (gcc::jit::recording::get_builtin_function): Use
4158 get_builtins_manager, in case we're a child context.
4159 (gcc::jit::recording::memento_of_get_type::dereference): Add the
4161 (gcc::jit::recording::memento_of_get_type::is_int): Likewise.
4162 (gcc::jit::recording::memento_of_get_type::is_float): Likewise.
4163 (gcc::jit::recording::memento_of_get_type::is_bool): Likewise.
4164 (get_type_strings): Likewise.
4167 (gcc::jit::recording::context::get_builtins_manager): New.
4169 * libgccjit.h (enum gcc_jit_types): Add
4170 GCC_JIT_TYPE_COMPLEX_FLOAT, GCC_JIT_TYPE_COMPLEX_DOUBLE,
4171 GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE.
4173 2014-12-01 David Malcolm <dmalcolm@redhat.com>
4176 (gcc::jit::recording::builtins_manager::get_builtin_function):
4177 Check for NULL return from make_builtin_function.
4178 (gcc::jit::recording::builtins_manager::make_builtin_function):
4179 Check for NULL return from get_type.
4181 2014-12-01 David Malcolm <dmalcolm@redhat.com>
4183 * jit-playback.c (gcc::jit::playback::context::compile): Move DSO
4184 creation code into...
4185 (gcc::jit::playback::context::convert_to_dso): New function.
4186 * jit-playback.h (gcc::jit::playback::context::convert_to_dso):
4189 2014-12-01 David Malcolm <dmalcolm@redhat.com>
4191 * jit-playback.c (gcc::jit::playback::context::compile): Use an
4192 auto_vec<const char *> rather than a const char *[20] for the
4193 top-level argv, and move the logic to build it to...
4194 (gcc::jit::playback::context::make_fake_args): New function.
4195 * jit-playback.h (gcc::jit::playback::context::make_fake_args):
4198 2014-12-01 David Malcolm <dmalcolm@redhat.com>
4200 * Make-lang.in (jit_OBJS): Add jit/jit-result.o.
4201 * jit-playback.c: Include new header jit-result.h.
4202 (gcc::jit::result::result): Move to new file jit-result.c.
4203 (gcc::jit::result::~result): Likewise.
4204 (gcc::jit::playback::result): Likewise.
4205 * jit-recording.h (class gcc::jit::result): Move to new
4206 header jit-result.h.
4207 * jit-result.c: New file, to contain...
4208 (gcc::jit::result::result): Move here from jit-playback.c,
4209 removing erroneous "playback" namespace from comment.
4210 (gcc::jit::result::~result): Likewise.
4211 (gcc::jit::playback::result): Likewise.
4212 * jit-result.h: New file, to contain...
4213 (class gcc::jit::result): Move from jit-recording.h.
4214 * libgccjit.c: Include jit-result.h.
4215 (gcc_jit_result_get_code): Update comment to reflect move
4217 (gcc_jit_result_release): Likewise.
4219 2014-12-01 David Malcolm <dmalcolm@redhat.com>
4222 * docs/examples/tut04-toyvm/toyvm.c
4223 (toyvm_compiled_function): New typedef.
4224 (toyvm_compiled_func) Rename to...
4225 (toyvm_compiled_code) ...this.
4226 (struct toyvm_compiled_function): New struct.
4227 (toyvm_function_compile): Return a toyvm_compiled_function *
4228 rather than a toyvm_compiled_func, so that the caller can fully
4229 clean things up. Free "funcname".
4230 (test_script): Update for change to toyvm_function_compile.
4231 Clean up the toyvm_compiled_function.
4233 (docs/intro/tutorial04.rst): Update to reflect the above changes,
4234 and to better spell out the lifetime of the compiled code.
4236 2014-12-01 David Malcolm <dmalcolm@redhat.com>
4240 (gcc::jit::recording::builtins_manager::make_fn_type): Call the
4241 context's new_function_type method, rather than directly creating
4242 a function_type instance.
4244 (gcc::jit::recording::context::new_function_type): New method,
4245 adapted from part of...
4246 (gcc::jit::recording::context::new_function_ptr_type): ...this.
4247 Update to call new_function_type.
4249 (gcc::jit::recording::context::new_function_type): New method.
4251 2014-12-01 David Malcolm <dmalcolm@redhat.com>
4254 * jit-playback.c: Ensure that ctxt_progname is non-NULL.
4256 2014-11-19 David Malcolm <dmalcolm@redhat.com>
4259 * jit-playback.c (gcc::jit::playback::compound_type::set_fields):
4260 Convert param from const vec<playback::field *> & to
4261 const auto_vec<playback::field *> *.
4262 (gcc::jit::playback::context::new_function_type): Convert param
4263 "param_types" from vec<type *> * to const auto_vec<type *> *.
4264 (gcc::jit::playback::context::new_function): Convert param
4265 "params" from vec<param *> * to const auto_vec<param *> *.
4266 (gcc::jit::playback::context::build_call): Convert param "args"
4267 from vec<rvalue *> to const auto_vec<rvalue *> *.
4268 (gcc::jit::playback::context::new_call): Likewise.
4269 (gcc::jit::playback::context::new_call_through_ptr): Likewise.
4270 (wrapper_finalizer): New function.
4271 (gcc::jit::playback::wrapper::operator new): Call the finalizer
4272 variant of ggc_internal_cleared_alloc, supplying
4274 (gcc::jit::playback::function::finalizer): New.
4275 (gcc::jit::playback::block::finalizer): New.
4276 (gcc::jit::playback::source_file::finalizer): New.
4277 (gcc::jit::playback::source_line::finalizer): New.
4280 (gcc::jit::playback::context::new_function_type): Convert param
4281 "param_types" from vec<type *> * to const auto_vec<type *> *.
4282 (gcc::jit::playback::context::new_function): Convert param
4283 "params" from vec<param *> * to const auto_vec<param *> *.
4284 (gcc::jit::playback::context::new_call): Convert param
4285 "args" from vec<rvalue *> to const auto_vec<rvalue *> *.
4286 (gcc::jit::playback::context::new_call_through_ptr): Likewise.
4287 (gcc::jit::playback::context::build_call): Likewise.
4288 (gcc::jit::playback::context): Convert fields "m_functions",
4289 "m_source_files", "m_cached_locations" from vec to auto_vec.
4290 (gcc::jit::playback::wrapper::finalizer): New virtual function.
4291 (gcc::jit::playback::compound_type::set_fields): Convert param fro
4292 const vec<playback::field *> & to
4293 const auto_vec<playback::field *> *.
4294 (gcc::jit::playback::function::finalizer): New.
4295 (gcc::jit::playback::block::finalizer): New.
4296 (gcc::jit::playback::source_file::finalizer): New.
4297 (gcc::jit::playback::source_line::finalizer): New.
4300 (gcc::jit::recording::function_type::replay_into): Convert local
4301 from a vec into an auto_vec.
4302 (gcc::jit::recording::fields::replay_into): Likewise.
4303 (gcc::jit::recording::function::replay_into): Likewise.
4304 (gcc::jit::recording::call::replay_into): Likewise.
4305 (gcc::jit::recording::call_through_ptr::replay_into): Likewise.
4307 * jit-recording.h (gcc::jit::recording::context): Convert fields
4308 "m_mementos", "m_compound_types", "m_functions" from vec<> to
4310 (gcc::jit::recording::function_type::get_param_types): Convert
4311 return type from vec<type *> to const vec<type *> &.
4312 (gcc::jit::recording::function_type): Convert field
4313 "m_param_types" from a vec<> to an auto_vec<>.
4314 (gcc::jit::recording::fields): Likewise for field "m_fields".
4315 (gcc::jit::recording::function::get_params): Convert return type
4316 from vec <param *> to const vec<param *> &.
4317 (gcc::jit::recording::function): Convert fields "m_params",
4318 "m_locals", "m_blocks" from vec<> to auto_vec<>.
4319 (gcc::jit::recording::block): Likewise for field "m_statements".
4320 vec<> to auto_vec<>.
4321 (gcc::jit::recording::call): Likewise for field "m_args".
4322 (gcc::jit::recording::call_through_ptr): Likewise.
4324 2014-11-19 David Malcolm <dmalcolm@redhat.com>
4327 * jit-recording.c (recording::function::validate): Convert
4328 "worklist" from vec<> to autovec<> to fix a leak.
4330 2014-11-11 David Malcolm <dmalcolm@redhat.com>
4332 * ChangeLog.jit: New.
4334 * Make-lang.in: New.
4336 * config-lang.in: New.
4337 * docs/Makefile: New.
4338 * docs/_build/texinfo/Makefile: New.
4339 * docs/_build/texinfo/factorial.png: New.
4340 * docs/_build/texinfo/libgccjit.texi: New.
4341 * docs/_build/texinfo/sum-of-squares.png: New.
4342 * docs/conf.py: New.
4343 * docs/examples/tut01-hello-world.c: New.
4344 * docs/examples/tut02-square.c: New.
4345 * docs/examples/tut03-sum-of-squares.c: New.
4346 * docs/examples/tut04-toyvm/Makefile: New.
4347 * docs/examples/tut04-toyvm/factorial.toy: New.
4348 * docs/examples/tut04-toyvm/fibonacci.toy: New.
4349 * docs/examples/tut04-toyvm/toyvm.c: New.
4350 * docs/index.rst: New.
4351 * docs/internals/index.rst: New.
4352 * docs/intro/factorial.png: New.
4353 * docs/intro/index.rst: New.
4354 * docs/intro/sum-of-squares.png: New.
4355 * docs/intro/tutorial01.rst: New.
4356 * docs/intro/tutorial02.rst: New.
4357 * docs/intro/tutorial03.rst: New.
4358 * docs/intro/tutorial04.rst: New.
4359 * docs/topics/contexts.rst: New.
4360 * docs/topics/expressions.rst: New.
4361 * docs/topics/functions.rst: New.
4362 * docs/topics/index.rst: New.
4363 * docs/topics/locations.rst: New.
4364 * docs/topics/objects.rst: New.
4365 * docs/topics/results.rst: New.
4366 * docs/topics/types.rst: New.
4367 * dummy-frontend.c: New.
4368 * jit-builtins.c: New.
4369 * jit-builtins.h: New.
4370 * jit-common.h: New.
4371 * jit-playback.c: New.
4372 * jit-playback.h: New.
4373 * jit-recording.c: New.
4374 * jit-recording.h: New.
4375 * libgccjit++.h: New.
4378 * libgccjit.map: New.
4381 2013-07-26 David Malcolm <dmalcolm@redhat.com>
4385 Copyright (C) 2013-2024 Free Software Foundation, Inc.
4387 Copying and distribution of this file, with or without modification,
4388 are permitted in any medium without royalty provided the copyright
4389 notice and this notice are preserved.