1 2024-03-29 Guillaume Gomez <guillaume1.gomez@gmail.com>
3 * libgccjit.cc (gcc_jit_type_get_size): Add pointer support
5 2024-02-10 Jakub Jelinek <jakub@redhat.com>
7 * jit-playback.cc (new_bitcast): Use HOST_WIDE_INT_PRINT_DEC instead
8 of "%ld" and casts to long.
10 2024-02-02 Antoni Boucher <bouanto@zoho.com>
12 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_27): New ABI tag.
13 * docs/topics/expressions.rst: Document gcc_jit_context_new_sizeof.
14 * jit-playback.cc (new_sizeof): New method.
15 * jit-playback.h (new_sizeof): New method.
16 * jit-recording.cc (recording::context::new_sizeof,
17 recording::memento_of_sizeof::replay_into,
18 recording::memento_of_sizeof::make_debug_string,
19 recording::memento_of_sizeof::write_reproducer): New methods.
20 * jit-recording.h (class memento_of_sizeof): New class.
21 * libgccjit.cc (gcc_jit_context_new_sizeof): New function.
22 * libgccjit.h (gcc_jit_context_new_sizeof): New function.
23 * libgccjit.map: New function.
25 2024-01-19 Antoni Boucher <bouanto@zoho.com>
27 * jit-builtins.cc (ensure_optimization_builtins_exist): Add
30 2024-01-19 Antoni Boucher <bouanto@zoho.com>
32 * jit-recording.h (is_numeric_vector, vector_type::new_int): New
34 * libgccjit.cc (gcc_jit_context_new_unary_op,
35 gcc_jit_context_new_binary_op): add checks for
38 2024-01-12 Guillaume Gomez <guillaume1.gomez@gmail.com>
39 Antoni Boucher <bouanto@zoho.com>
41 * docs/topics/compatibility.rst: Add documentation for LIBGCCJIT_ABI_26.
42 * docs/topics/functions.rst: Add documentation for new functions.
43 * docs/topics/expressions.rst: Add documentation for new functions.
45 2024-01-12 Guillaume Gomez <guillaume1.gomez@gmail.com>
46 Antoni Boucher <bouanto@zoho.com>
48 * dummy-frontend.cc (handle_alias_attribute): New function.
49 (handle_always_inline_attribute): New function.
50 (handle_cold_attribute): New function.
51 (handle_fnspec_attribute): New function.
52 (handle_format_arg_attribute): New function.
53 (handle_format_attribute): New function.
54 (handle_noinline_attribute): New function.
55 (handle_target_attribute): New function.
56 (handle_used_attribute): New function.
57 (handle_visibility_attribute): New function.
58 (handle_weak_attribute): New function.
59 (handle_alias_ifunc_attribute): New function.
60 * jit-playback.cc (fn_attribute_to_string): New function.
61 (variable_attribute_to_string): New function.
62 (global_new_decl): Add attributes support.
63 (set_variable_attribute): New function.
64 (new_global): Add attributes support.
65 (new_global_initialized): Add attributes support.
66 (new_local): Add attributes support.
67 * jit-playback.h (fn_attribute_to_string): New function.
68 (set_variable_attribute): New function.
69 * jit-recording.cc (recording::lvalue::add_attribute): New function.
70 (recording::function::function): New function.
71 (recording::function::write_to_dump): Add attributes support.
72 (recording::function::add_attribute): New function.
73 (recording::function::add_string_attribute): New function.
74 (recording::function::add_integer_array_attribute): New function.
75 (recording::global::replay_into): Add attributes support.
76 (recording::local::replay_into): Add attributes support.
77 * jit-recording.h: Add attributes support.
78 * libgccjit.cc (gcc_jit_function_add_attribute): New function.
79 (gcc_jit_function_add_string_attribute): New function.
80 (gcc_jit_function_add_integer_array_attribute): New function.
81 (gcc_jit_lvalue_add_attribute): New function.
82 * libgccjit.h (enum gcc_jit_fn_attribute): New enum.
83 (gcc_jit_function_add_attribute): New function.
84 (gcc_jit_function_add_string_attribute): New function.
85 (gcc_jit_function_add_integer_array_attribute): New function.
86 (enum gcc_jit_variable_attribute): New function.
87 (gcc_jit_lvalue_add_string_attribute): New function.
88 * libgccjit.map: Declare new functions.
90 2023-12-06 David Malcolm <dmalcolm@redhat.com>
92 * dummy-frontend.cc (jit_begin_diagnostic): Make diagnostic_info
94 (jit_end_diagnostic): Likewise. Pass to add_diagnostic by
96 * jit-playback.cc (jit::playback::context::add_diagnostic):
97 Convert diagnostic_info to const reference.
98 * jit-playback.h (jit::playback::context::add_diagnostic):
101 2023-12-05 Richard Sandiford <richard.sandiford@arm.com>
103 * dummy-frontend.cc (jit_gnu_attribute_table): Add extra braces
104 to work around PR 16333 in older compilers.
105 (jit_format_attribute_table): Likewise.
107 2023-12-02 Richard Sandiford <richard.sandiford@arm.com>
109 * dummy-frontend.cc (jit_format_attribute_table): Change type to
110 scoped_attribute_specs, using...
111 (jit_format_attributes): ...this as the underlying array.
112 (jit_attribute_table): Change to an array of scoped_attribute_specs
114 (jit_gnu_attributes, jit_gnu_attribute_table): ...these new globals
115 for the original array. Include the format attributes.
116 (LANG_HOOKS_COMMON_ATTRIBUTE_TABLE): Delete.
117 (LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE): Delete.
118 (LANG_HOOKS_ATTRIBUTE_TABLE): Define.
120 2023-11-09 Guillaume Gomez <guillaume1.gomez@gmail.com>
124 2023-11-04 David Malcolm <dmalcolm@redhat.com>
126 * jit-playback.cc: Update for changes to diagnostic_context.
127 * jit-playback.h: Likewise.
129 2023-10-25 Vibhav Pant <vibhavp@gmail.com>
131 * jit-recording.cc (recording::global::write_to_dump): Fix
132 dump of string literal initializers.
134 2023-10-22 Iain Sandoe <iain@sandoe.co.uk>
136 * Make-lang.in: Handle Darwin rpaths.
138 2023-10-02 David Malcolm <dmalcolm@redhat.com>
140 * dummy-frontend.cc (jit_langhook_init): Update for change to
141 diagnostic_context callbacks.
143 2023-08-31 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
145 * jit-playback.cc: Change spelling to macOS.
147 2023-08-29 Guillaume Gomez <guillaume1.gomez@gmail.com>
149 * docs/topics/compatibility.rst: Add documentation for LIBGCCJIT_ABI_25.
150 * docs/topics/types.rst: Add documentation for gcc_jit_type_get_restrict.
152 2023-08-29 Guillaume Gomez <guillaume1.gomez@gmail.com>
154 * jit-playback.cc: Remove trailing whitespace characters.
155 * jit-playback.h: Add get_restrict method.
156 * jit-recording.cc: Add get_restrict methods.
157 * jit-recording.h: Add get_restrict methods.
158 * libgccjit++.h: Add get_restrict methods.
159 * libgccjit.cc: Add gcc_jit_type_get_restrict.
160 * libgccjit.h: Declare gcc_jit_type_get_restrict.
161 * libgccjit.map: Declare gcc_jit_type_get_restrict.
163 2023-02-16 Patrick Palka <ppalka@redhat.com>
165 * jit-dejagnu.h: Mechanically drop static from static inline
166 functions via s/^static inline/inline/g.
167 * jit-recording.h: Likewise.
169 2023-01-07 LIU Hao <lh_mouse@126.com>
172 * jit-w32.h: Define `WIN32_LEAN_AND_MEAN` before <windows.h>.
174 2022-12-21 Martin Liska <mliska@suse.cz>
176 * jit-playback.h: Use unused attribute.
178 2022-12-14 Antoni Boucher <bouanto@zoho.com>
179 Guillaume Gomez <guillaume1.gomez@gmail.com>
182 * jit-recording.h: Add vector_type::is_same_type_as method
184 2022-12-07 Antoni Boucher <bouanto@zoho.com>
185 Guillaume Gomez <guillaume1.gomez@gmail.com>
188 * jit-playback.cc: Fix vector float comparison
189 * jit-playback.h: Update comparison function signature
190 * jit-recording.cc: Update call for "new_comparison" function
191 * jit-recording.h: Fix vector float comparison
193 2022-11-20 Jeff Law <jlaw@ventanamicro.com>
196 * jit-playback.cc (playback::lvale::mark_addressable): Remove
199 2022-11-19 Jonathan Wakely <jwakely@redhat.com>
200 LIU Hao <lh_mouse@126.com>
202 * jit-playback.cc (playback::context::scoped_lock): Define RAII
204 (playback::context::compile): Use scoped_lock to acquire mutex
205 for the active playback context.
206 (jit_mutex): Change to std::mutex.
207 (playback::context::acquire_mutex): Rename to ...
208 (playback::context::lock): ... this.
209 (playback::context::release_mutex): Rename to ...
210 (playback::context::unlock): ... this.
211 * jit-playback.h (playback::context): Rename members and declare
213 * jit-recording.cc (INCLUDE_PTHREAD_H): Remove unused define.
214 * libgccjit.cc (version_mutex): Change to std::mutex.
215 (struct jit_version_info): Use std::lock_guard to acquire and
218 2022-11-14 Martin Liska <mliska@suse.cz>
221 2022-11-09 Martin Liska <mliska@suse.cz>
224 * docs/cp/index.rst: Moved to...
225 * doc/cp/index.rst: ...here.
226 * docs/cp/intro/index.rst: Moved to...
227 * doc/cp/intro/index.rst: ...here.
228 * docs/cp/intro/tutorial01.rst: Moved to...
229 * doc/cp/intro/tutorial01.rst: ...here.
230 * docs/cp/intro/tutorial02.rst: Moved to...
231 * doc/cp/intro/tutorial02.rst: ...here.
232 * docs/cp/intro/tutorial03.rst: Moved to...
233 * doc/cp/intro/tutorial03.rst: ...here.
234 * docs/cp/intro/tutorial04.rst: Moved to...
235 * doc/cp/intro/tutorial04.rst: ...here.
236 * docs/cp/topics/asm.rst: Moved to...
237 * doc/cp/topics/asm.rst: ...here.
238 * docs/cp/topics/compilation.rst: Moved to...
239 * doc/cp/topics/compilation.rst: ...here.
240 * docs/cp/topics/contexts.rst: Moved to...
241 * doc/cp/topics/contexts.rst: ...here.
242 * docs/cp/topics/expressions.rst: Moved to...
243 * doc/cp/topics/expressions.rst: ...here.
244 * docs/cp/topics/functions.rst: Moved to...
245 * doc/cp/topics/functions.rst: ...here.
246 * docs/cp/topics/index.rst: Moved to...
247 * doc/cp/topics/index.rst: ...here.
248 * docs/cp/topics/locations.rst: Moved to...
249 * doc/cp/topics/locations.rst: ...here.
250 * docs/cp/topics/objects.rst: Moved to...
251 * doc/cp/topics/objects.rst: ...here.
252 * docs/cp/topics/types.rst: Moved to...
253 * doc/cp/topics/types.rst: ...here.
254 * docs/examples/emit-alphabet.bf: Moved to...
255 * doc/examples/emit-alphabet.bf: ...here.
256 * docs/examples/tut01-hello-world.c: Moved to...
257 * doc/examples/tut01-hello-world.c: ...here.
258 * docs/examples/tut01-hello-world.cc: Moved to...
259 * doc/examples/tut01-hello-world.cc: ...here.
260 * docs/examples/tut02-square.c: Moved to...
261 * doc/examples/tut02-square.c: ...here.
262 * docs/examples/tut02-square.cc: Moved to...
263 * doc/examples/tut02-square.cc: ...here.
264 * docs/examples/tut03-sum-of-squares.c: Moved to...
265 * doc/examples/tut03-sum-of-squares.c: ...here.
266 * docs/examples/tut03-sum-of-squares.cc: Moved to...
267 * doc/examples/tut03-sum-of-squares.cc: ...here.
268 * docs/examples/tut04-toyvm/Makefile: Moved to...
269 * doc/examples/tut04-toyvm/Makefile: ...here.
270 * docs/examples/tut04-toyvm/factorial.toy: Moved to...
271 * doc/examples/tut04-toyvm/factorial.toy: ...here.
272 * docs/examples/tut04-toyvm/fibonacci.toy: Moved to...
273 * doc/examples/tut04-toyvm/fibonacci.toy: ...here.
274 * docs/examples/tut04-toyvm/toyvm.c: Moved to...
275 * doc/examples/tut04-toyvm/toyvm.c: ...here.
276 * docs/examples/tut04-toyvm/toyvm.cc: Moved to...
277 * doc/examples/tut04-toyvm/toyvm.cc: ...here.
278 * docs/examples/tut05-bf.c: Moved to...
279 * doc/examples/tut05-bf.c: ...here.
280 * docs/index.rst: Moved to...
281 * doc/index.rst: ...here.
282 * docs/internals/index.rst: Moved to...
283 * doc/internals/index.rst: ...here.
284 * docs/internals/test-hello-world.exe.log.txt: Moved to...
285 * doc/internals/test-hello-world.exe.log.txt: ...here.
286 * docs/_build/texinfo/libgccjit-figures/factorial.png: Moved to...
287 * doc/intro/factorial.png: ...here.
288 * docs/intro/index.rst: Moved to...
289 * doc/intro/index.rst: ...here.
290 * docs/_build/texinfo/libgccjit-figures/sum-of-squares.png: Moved to...
291 * doc/intro/sum-of-squares.png: ...here.
292 * docs/intro/tutorial01.rst: Moved to...
293 * doc/intro/tutorial01.rst: ...here.
294 * docs/intro/tutorial02.rst: Moved to...
295 * doc/intro/tutorial02.rst: ...here.
296 * docs/intro/tutorial03.rst: Moved to...
297 * doc/intro/tutorial03.rst: ...here.
298 * docs/intro/tutorial04.rst: Moved to...
299 * doc/intro/tutorial04.rst: ...here.
300 * docs/intro/tutorial05.rst: Moved to...
301 * doc/intro/tutorial05.rst: ...here.
302 * docs/topics/asm.rst: Moved to...
303 * doc/topics/asm.rst: ...here.
304 * docs/topics/compatibility.rst: Moved to...
305 * doc/topics/compatibility.rst: ...here.
306 * docs/topics/compilation.rst: Moved to...
307 * doc/topics/compilation.rst: ...here.
308 * docs/topics/contexts.rst: Moved to...
309 * doc/topics/contexts.rst: ...here.
310 * docs/topics/expressions.rst: Moved to...
311 * doc/topics/expressions.rst: ...here.
312 * docs/topics/function-pointers.rst: Moved to...
313 * doc/topics/function-pointers.rst: ...here.
314 * docs/topics/functions.rst: Moved to...
315 * doc/topics/functions.rst: ...here.
316 * docs/topics/index.rst: Moved to...
317 * doc/topics/index.rst: ...here.
318 * docs/topics/locations.rst: Moved to...
319 * doc/topics/locations.rst: ...here.
320 * docs/topics/objects.rst: Moved to...
321 * doc/topics/objects.rst: ...here.
322 * docs/topics/performance.rst: Moved to...
323 * doc/topics/performance.rst: ...here.
324 * docs/topics/types.rst: Moved to...
325 * doc/topics/types.rst: ...here.
326 * docs/Makefile: Removed.
327 * docs/_build/texinfo/Makefile: Removed.
328 * docs/_build/texinfo/libgccjit-figures/factorial1.png: Removed.
329 * docs/_build/texinfo/libgccjit-figures/sum-of-squares1.png: Removed.
330 * docs/_build/texinfo/libgccjit.texi: Removed.
331 * docs/conf.py: Removed.
332 * docs/intro/factorial.png: Removed.
333 * docs/intro/sum-of-squares.png: Removed.
334 * doc/conf.py: New file.
336 2022-11-14 Martin Liska <mliska@suse.cz>
339 2022-11-14 Martin Liska <mliska@suse.cz>
341 * Make-lang.in: Support --with-sphinx-build.
343 2022-11-14 Martin Liska <mliska@suse.cz>
346 2022-11-14 Martin Liska <mliska@suse.cz>
348 * doc/internals/index.rst: Fix cross manual refs.
349 * doc/topics/contexts.rst: Likewise.
351 2022-11-14 Martin Liska <mliska@suse.cz>
354 2022-11-14 Martin Liska <mliska@suse.cz>
357 Support installation if sphinx-build is missing.
359 2022-11-14 Martin Liska <mliska@suse.cz>
362 2022-11-14 Martin Liska <mliska@suse.cz>
364 * doc/cp/index.rst: Remove trailing .rst in toctree.
365 * doc/cp/intro/index.rst: Likewise.
366 * doc/cp/topics/index.rst: Likewise.
367 * doc/index.rst: Likewise.
368 * doc/intro/index.rst: Likewise.
369 * doc/topics/index.rst: Likewise.
370 * doc/indices-and-tables.rst: New file.
372 2022-11-11 Martin Liska <mliska@suse.cz>
374 * doc/cp/index.rst: Remove trailing .rst in toctree.
375 * doc/cp/intro/index.rst: Likewise.
376 * doc/cp/topics/index.rst: Likewise.
377 * doc/index.rst: Likewise.
378 * doc/intro/index.rst: Likewise.
379 * doc/topics/index.rst: Likewise.
380 * doc/indices-and-tables.rst: New file.
382 2022-11-09 Martin Liska <mliska@suse.cz>
385 Support installation if sphinx-build is missing.
387 2022-11-09 Martin Liska <mliska@suse.cz>
389 * doc/internals/index.rst: Fix cross manual refs.
390 * doc/topics/contexts.rst: Likewise.
392 2022-11-09 Martin Liska <mliska@suse.cz>
394 * Make-lang.in: Support --with-sphinx-build.
396 2022-11-09 Martin Liska <mliska@suse.cz>
399 * docs/cp/index.rst: Moved to...
400 * doc/cp/index.rst: ...here.
401 * docs/cp/intro/index.rst: Moved to...
402 * doc/cp/intro/index.rst: ...here.
403 * docs/cp/intro/tutorial01.rst: Moved to...
404 * doc/cp/intro/tutorial01.rst: ...here.
405 * docs/cp/intro/tutorial02.rst: Moved to...
406 * doc/cp/intro/tutorial02.rst: ...here.
407 * docs/cp/intro/tutorial03.rst: Moved to...
408 * doc/cp/intro/tutorial03.rst: ...here.
409 * docs/cp/intro/tutorial04.rst: Moved to...
410 * doc/cp/intro/tutorial04.rst: ...here.
411 * docs/cp/topics/asm.rst: Moved to...
412 * doc/cp/topics/asm.rst: ...here.
413 * docs/cp/topics/compilation.rst: Moved to...
414 * doc/cp/topics/compilation.rst: ...here.
415 * docs/cp/topics/contexts.rst: Moved to...
416 * doc/cp/topics/contexts.rst: ...here.
417 * docs/cp/topics/expressions.rst: Moved to...
418 * doc/cp/topics/expressions.rst: ...here.
419 * docs/cp/topics/functions.rst: Moved to...
420 * doc/cp/topics/functions.rst: ...here.
421 * docs/cp/topics/index.rst: Moved to...
422 * doc/cp/topics/index.rst: ...here.
423 * docs/cp/topics/locations.rst: Moved to...
424 * doc/cp/topics/locations.rst: ...here.
425 * docs/cp/topics/objects.rst: Moved to...
426 * doc/cp/topics/objects.rst: ...here.
427 * docs/cp/topics/types.rst: Moved to...
428 * doc/cp/topics/types.rst: ...here.
429 * docs/examples/emit-alphabet.bf: Moved to...
430 * doc/examples/emit-alphabet.bf: ...here.
431 * docs/examples/tut01-hello-world.c: Moved to...
432 * doc/examples/tut01-hello-world.c: ...here.
433 * docs/examples/tut01-hello-world.cc: Moved to...
434 * doc/examples/tut01-hello-world.cc: ...here.
435 * docs/examples/tut02-square.c: Moved to...
436 * doc/examples/tut02-square.c: ...here.
437 * docs/examples/tut02-square.cc: Moved to...
438 * doc/examples/tut02-square.cc: ...here.
439 * docs/examples/tut03-sum-of-squares.c: Moved to...
440 * doc/examples/tut03-sum-of-squares.c: ...here.
441 * docs/examples/tut03-sum-of-squares.cc: Moved to...
442 * doc/examples/tut03-sum-of-squares.cc: ...here.
443 * docs/examples/tut04-toyvm/Makefile: Moved to...
444 * doc/examples/tut04-toyvm/Makefile: ...here.
445 * docs/examples/tut04-toyvm/factorial.toy: Moved to...
446 * doc/examples/tut04-toyvm/factorial.toy: ...here.
447 * docs/examples/tut04-toyvm/fibonacci.toy: Moved to...
448 * doc/examples/tut04-toyvm/fibonacci.toy: ...here.
449 * docs/examples/tut04-toyvm/toyvm.c: Moved to...
450 * doc/examples/tut04-toyvm/toyvm.c: ...here.
451 * docs/examples/tut04-toyvm/toyvm.cc: Moved to...
452 * doc/examples/tut04-toyvm/toyvm.cc: ...here.
453 * docs/examples/tut05-bf.c: Moved to...
454 * doc/examples/tut05-bf.c: ...here.
455 * docs/index.rst: Moved to...
456 * doc/index.rst: ...here.
457 * docs/internals/index.rst: Moved to...
458 * doc/internals/index.rst: ...here.
459 * docs/internals/test-hello-world.exe.log.txt: Moved to...
460 * doc/internals/test-hello-world.exe.log.txt: ...here.
461 * docs/_build/texinfo/libgccjit-figures/factorial.png: Moved to...
462 * doc/intro/factorial.png: ...here.
463 * docs/intro/index.rst: Moved to...
464 * doc/intro/index.rst: ...here.
465 * docs/_build/texinfo/libgccjit-figures/sum-of-squares.png: Moved to...
466 * doc/intro/sum-of-squares.png: ...here.
467 * docs/intro/tutorial01.rst: Moved to...
468 * doc/intro/tutorial01.rst: ...here.
469 * docs/intro/tutorial02.rst: Moved to...
470 * doc/intro/tutorial02.rst: ...here.
471 * docs/intro/tutorial03.rst: Moved to...
472 * doc/intro/tutorial03.rst: ...here.
473 * docs/intro/tutorial04.rst: Moved to...
474 * doc/intro/tutorial04.rst: ...here.
475 * docs/intro/tutorial05.rst: Moved to...
476 * doc/intro/tutorial05.rst: ...here.
477 * docs/topics/asm.rst: Moved to...
478 * doc/topics/asm.rst: ...here.
479 * docs/topics/compatibility.rst: Moved to...
480 * doc/topics/compatibility.rst: ...here.
481 * docs/topics/compilation.rst: Moved to...
482 * doc/topics/compilation.rst: ...here.
483 * docs/topics/contexts.rst: Moved to...
484 * doc/topics/contexts.rst: ...here.
485 * docs/topics/expressions.rst: Moved to...
486 * doc/topics/expressions.rst: ...here.
487 * docs/topics/function-pointers.rst: Moved to...
488 * doc/topics/function-pointers.rst: ...here.
489 * docs/topics/functions.rst: Moved to...
490 * doc/topics/functions.rst: ...here.
491 * docs/topics/index.rst: Moved to...
492 * doc/topics/index.rst: ...here.
493 * docs/topics/locations.rst: Moved to...
494 * doc/topics/locations.rst: ...here.
495 * docs/topics/objects.rst: Moved to...
496 * doc/topics/objects.rst: ...here.
497 * docs/topics/performance.rst: Moved to...
498 * doc/topics/performance.rst: ...here.
499 * docs/topics/types.rst: Moved to...
500 * doc/topics/types.rst: ...here.
501 * docs/Makefile: Removed.
502 * docs/_build/texinfo/Makefile: Removed.
503 * docs/_build/texinfo/libgccjit-figures/factorial1.png: Removed.
504 * docs/_build/texinfo/libgccjit-figures/sum-of-squares1.png: Removed.
505 * docs/_build/texinfo/libgccjit.texi: Removed.
506 * docs/conf.py: Removed.
507 * docs/intro/factorial.png: Removed.
508 * docs/intro/sum-of-squares.png: Removed.
509 * doc/conf.py: New file.
511 2022-09-15 Richard Biener <rguenther@suse.de>
513 * dummy-frontend.cc (jit_langhook_init): Do not initialize
516 2022-08-09 Vibhav Pant <vibhavp@gmail.com>
518 * libgccjit.h (LIBGCCJIT_HAVE_gcc_jit_context_new_bitcast): Move
519 definition out of comment.
521 2022-07-28 David Malcolm <dmalcolm@redhat.com>
523 * docs/internals/index.rst: Remove reference to ".c" extensions
526 2022-07-28 Martin Liška <mliska@suse.cz>
528 * docs/cp/intro/tutorial02.rst:
529 Shorten the assembly example so that there is not slider.
530 * docs/cp/intro/tutorial04.rst: Likewise.
531 * docs/intro/tutorial02.rst: Likewise.
532 * docs/intro/tutorial04.rst: Likewise.
533 * docs/topics/contexts.rst: Likewise.
535 2022-07-28 marxin <mliska@suse.cz>
537 * docs/index.rst: Remove reference to module index
538 as we don't emit any.
540 2022-07-28 marxin <mliska@suse.cz>
542 * docs/cp/intro/tutorial02.rst: Use :expr:`type *` for pointers to a type
543 * docs/cp/topics/asm.rst: Likewise.
544 * docs/cp/topics/contexts.rst: Likewise.
545 * docs/cp/topics/expressions.rst: Likewise.
546 * docs/cp/topics/functions.rst: Likewise.
547 * docs/cp/topics/objects.rst: Likewise.
548 * docs/intro/tutorial02.rst: Likewise.
549 * docs/intro/tutorial03.rst: Likewise.
550 * docs/intro/tutorial04.rst: Likewise.
551 * docs/intro/tutorial05.rst: Likewise.
552 * docs/topics/compilation.rst: Likewise.
553 * docs/topics/contexts.rst: Likewise.
554 * docs/topics/objects.rst: Likewise.
556 2022-07-28 marxin <mliska@suse.cz>
558 * docs/cp/intro/tutorial04.rst: Use list-table.
559 * docs/intro/tutorial04.rst: Likewise.
560 * docs/intro/tutorial05.rst: Likewise.
561 * docs/topics/compilation.rst: Likewise.
562 * docs/topics/expressions.rst: Likewise.
563 * docs/topics/types.rst: Likewise.
565 2022-07-28 marxin <mliska@suse.cz>
567 * docs/cp/topics/expressions.rst: Compact so that the generated
568 output is also more compact.
570 2022-07-28 marxin <mliska@suse.cz>
572 * docs/cp/intro/tutorial02.rst: Use proper reference.
573 * docs/cp/topics/contexts.rst: Likewise.
574 * docs/cp/topics/functions.rst: Put `class` directive before a
575 function as it is not allowed declaring a class in a fn.
576 * docs/cp/topics/types.rst: Add template keyword.
577 * docs/examples/tut04-toyvm/toyvm.c (toyvm_function_compile):
578 Add removed comment used for code snippet ending detection.
579 * docs/intro/tutorial04.rst: Fix to match the real comment.
581 2022-07-28 marxin <mliska@suse.cz>
583 * docs/cp/topics/expressions.rst: Use :expr: for basic types.
584 * docs/topics/compilation.rst: Likewise.
585 * docs/topics/expressions.rst: Likewise.
586 * docs/topics/function-pointers.rst: Likewise.
588 2022-07-28 marxin <mliska@suse.cz>
590 * docs/conf.py: Add needs_sphinx = '3.0' where c:type was added.
591 * docs/index.rst: Remove note about it.
592 * docs/topics/compilation.rst: Use enum directive and reference.
593 * docs/topics/contexts.rst: Likewise.
594 * docs/topics/expressions.rst: Likewise.
595 * docs/topics/functions.rst: Likewise.
597 2022-07-14 Jonathan Wakely <jwakely@redhat.com>
599 * jit-recording.h (recording::memento): Define copy constructor
600 and copy assignment operator as deleted.
601 (recording::string): Likewise.
602 (recording::string::c_str): Add const qualifier.
604 2022-06-29 Antoni Boucher <bouanto@zoho.com>
607 * jit-playback.cc: Use the correct return type when folding in
610 2022-06-29 Sergei Trofimovich <siarheit@google.com>
613 * jit-playback.cc: Include <pthread.h> via "system.h" to avoid calloc()
615 * jit-recording.cc: Ditto.
616 * libgccjit.cc: Ditto.
618 2022-06-10 Antoni Boucher <bouanto@zoho.com>
621 * libgccjit.cc: Add support for floating-point types in
622 gcc_jit_type_get_size.
624 2022-06-08 Yang Yujie <yangyujie@loongson.cn>
626 * Make-lang.in: only link objects from $(EXTRA_GCC_OBJS)
627 that's not in $(EXTRA_OBJS) into libgccjit.
629 2022-05-23 David Malcolm <dmalcolm@redhat.com>
631 * jit-recording.h: Add "final" and "override" to all vfunc
632 implementations that were missing them, as appropriate.
634 2022-05-20 David Malcolm <dmalcolm@redhat.com>
636 * jit-playback.h: Replace uses of "FINAL" and "OVERRIDE" with
637 "final" and "override".
638 * jit-recording.cc: Likewise.
639 * jit-recording.h: Likewise.
641 2022-05-16 Martin Liska <mliska@suse.cz>
643 * jit-builtins.cc (find_builtin_by_name): Use ARRAY_SIZE.
644 (get_string_for_type_id): Likewise.
645 * jit-recording.cc (recording::context::context): Likewise.
647 2022-04-14 Iain Sandoe <iain@sandoe.co.uk>
649 * jit-playback.cc (new_bitcast): Cast values returned by tree_to_uhwi
650 to 'long' to match the print format.
652 2022-04-12 Antoni Boucher <bouanto@zoho.com>
655 * docs/_build/texinfo/libgccjit.texi: Regenerate.
656 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_24): New ABI tag.
657 * docs/topics/expressions.rst: Add documentation for the
658 functions gcc_jit_lvalue_set_alignment and
659 gcc_jit_lvalue_get_alignment.
660 * jit-playback.h: New function (set_alignment).
661 * jit-recording.cc: New function (set_alignment).
662 * jit-recording.h: New functions (set_alignment, get_alignment)
663 and new field (m_alignment).
664 * libgccjit.cc: New functions (gcc_jit_lvalue_get_alignment,
665 gcc_jit_lvalue_set_alignment)
666 * libgccjit.h: New functions (gcc_jit_lvalue_get_alignment,
667 gcc_jit_lvalue_set_alignment)
668 * libgccjit.map (LIBGCCJIT_ABI_24): New ABI tag.
670 2022-04-12 Antoni Boucher <bouanto@zoho.com>
673 * docs/_build/texinfo/libgccjit.texi: Regenerate.
674 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_23): New ABI tag.
675 * docs/topics/contexts.rst: Add documentation for the new
676 function gcc_jit_context_set_bool_print_errors_to_stderr.
677 * jit-common.h: New enum value
678 (INNER_BOOL_OPTION_PRINT_ERRORS_TO_STDERR).
679 * jit-recording.cc: Handle the new option
680 INNER_BOOL_OPTION_PRINT_ERRORS_TO_STDERR.
681 * libgccjit.cc: New function
682 (gcc_jit_context_set_bool_print_errors_to_stderr).
683 * libgccjit.h: New function
684 (gcc_jit_context_set_bool_print_errors_to_stderr).
685 * libgccjit.map (LIBGCCJIT_ABI_23): New ABI tag.
687 2022-04-12 Antoni Boucher <bouanto@zoho.com>
690 * docs/_build/texinfo/libgccjit.texi: Regenerate.
691 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_22): New ABI tag.
692 * docs/topics/expressions.rst: Add documentation for the
693 function gcc_jit_lvalue_set_register_name.
694 * jit-playback.h: New function (set_register_name).
695 * jit-recording.cc: New function (set_register_name) and add
696 support for register variables.
697 * jit-recording.h: New field (m_reg_name) and new function
699 * libgccjit.cc: New function (gcc_jit_lvalue_set_register_name).
700 * libgccjit.h: New function (gcc_jit_lvalue_set_register_name).
701 * libgccjit.map (LIBGCCJIT_ABI_22): New ABI tag.
703 2022-04-12 Antoni Boucher <bouanto@zoho.com>
706 * docs/_build/texinfo/libgccjit.texi: Regenerate.
707 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_21): New ABI tag.
708 * docs/topics/expressions.rst: Add documentation for the
709 function gcc_jit_context_new_bitcast.
710 * jit-playback.cc: New function (new_bitcast).
711 * jit-playback.h: New function (new_bitcast).
712 * jit-recording.cc: New functions (new_bitcast,
713 bitcast::replay_into, bitcast::visit_children,
714 bitcast::make_debug_string, bitcast::write_reproducer).
715 * jit-recording.h: New class (bitcast) and new function
716 (new_bitcast, bitcast::replay_into, bitcast::visit_children,
717 bitcast::make_debug_string, bitcast::write_reproducer,
718 bitcast::get_precedence).
719 * libgccjit.cc: New function (gcc_jit_context_new_bitcast)
720 * libgccjit.h: New function (gcc_jit_context_new_bitcast)
721 * libgccjit.map (LIBGCCJIT_ABI_21): New ABI tag.
723 2022-04-12 Antoni Boucher <bouanto@zoho.com>
726 * docs/_build/texinfo/libgccjit.texi: Regenerate
727 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_20): New ABI tag.
728 * docs/topics/types.rst: Add documentation for the new types
729 GCC_JIT_TYPE_UINT8_T, GCC_JIT_TYPE_UINT16_T,
730 GCC_JIT_TYPE_UINT32_T, GCC_JIT_TYPE_UINT64_T,
731 GCC_JIT_TYPE_UINT128_T, GCC_JIT_TYPE_INT8_T, GCC_JIT_TYPE_INT16_T,
732 GCC_JIT_TYPE_INT32_T, GCC_JIT_TYPE_INT64_T, GCC_JIT_TYPE_INT128_T and
733 new functions (gcc_jit_compatible_types, gcc_jit_type_get_size).
734 * jit-builtins.cc: Add support for BT_UINT128.
735 * jit-common.h: Update the value of NUM_GCC_JIT_TYPES.
736 * jit-playback.cc: Add support for the sized integer types.
737 * jit-recording.cc: Add support for the sized integer types.
738 * jit-recording.h: Add support for comparing integer types
739 and new function (is_signed).
740 * libgccjit.cc (gcc_jit_compatible_types): New.
741 (gcc_jit_type_get_size) New.
742 * libgccjit.h: New enum variants for gcc_jit_types
743 (GCC_JIT_TYPE_UINT8_T, GCC_JIT_TYPE_UINT16_T,
744 GCC_JIT_TYPE_UINT32_T, GCC_JIT_TYPE_UINT64_T,
745 GCC_JIT_TYPE_UINT128_T, GCC_JIT_TYPE_INT8_T,
746 GCC_JIT_TYPE_INT16_T, GCC_JIT_TYPE_INT32_T,
747 GCC_JIT_TYPE_INT64_T, GCC_JIT_TYPE_INT128_T) and new functions
748 (gcc_jit_compatible_types, gcc_jit_type_get_size).
749 * libgccjit.map (LIBGCCJIT_ABI_20): New ABI tag.
751 2022-04-06 David Malcolm <dmalcolm@redhat.com>
754 * docs/_build/texinfo/factorial.png: Move to...
755 * docs/_build/texinfo/libgccjit-figures/factorial.png: ...here.
756 * docs/_build/texinfo/factorial1.png: Move to...
757 * docs/_build/texinfo/libgccjit-figures/factorial1.png: ...here.
758 * docs/_build/texinfo/sum-of-squares.png: Move to...
759 * docs/_build/texinfo/libgccjit-figures/sum-of-squares.png: ...here.
760 * docs/_build/texinfo/sum-of-squares1.png: Move to...
761 * docs/_build/texinfo/libgccjit-figures/sum-of-squares1.png: ...here.
763 2022-04-01 David Malcolm <dmalcolm@redhat.com>
765 * docs/topics/expressions.rst: Fix formatting.
766 * docs/topics/types.rst: Likewise.
767 * docs/_build/texinfo/libgccjit.texi: Regenerate
769 2022-04-01 Petter Tomner <tomner@kth.se>
771 * docs/topics/compatibility.rst: Add 19 tag
772 * docs/topics/compilation.rst: Linking
773 * docs/topics/contexts.rst: Linking example
774 * docs/topics/expressions.rst: Fix formatting and dropped 's'
776 2022-03-07 Jakub Jelinek <jakub@redhat.com>
778 * libgccjit.h: Fix up duplicated word issue in a comment.
780 2022-01-17 Martin Liska <mliska@suse.cz>
782 * config-lang.in: Rename .c names to .cc.
783 * docs/_build/texinfo/libgccjit.texi: Likewise.
784 * docs/internals/index.rst: Likewise.
785 * jit-builtins.cc (builtins_manager::make_builtin_function): Likewise.
786 * jit-playback.cc (fold_const_var): Likewise.
787 (playback::context::~context): Likewise.
788 (new_field): Likewise.
789 (new_bitfield): Likewise.
790 (new_compound_type): Likewise.
791 (playback::compound_type::set_fields): Likewise.
792 (global_set_init_rvalue): Likewise.
793 (load_blob_in_ctor): Likewise.
794 (new_global_initialized): Likewise.
796 (new_string_literal): Likewise.
797 (as_truth_value): Likewise.
798 (build_call): Likewise.
799 (playback::context::build_cast): Likewise.
800 (new_array_access): Likewise.
801 (new_field_access): Likewise.
802 (dereference): Likewise.
803 (postprocess): Likewise.
804 (add_jump): Likewise.
805 (add_switch): Likewise.
806 (build_goto_operands): Likewise.
807 (playback::context::read_dump_file): Likewise.
808 (init_types): Likewise.
809 * jit-recording.cc (recording::context::get_int_type): Likewise.
810 * jit-recording.h: Likewise.
811 * libgccjit.cc (compatible_types): Likewise.
812 (gcc_jit_context_acquire): Likewise.
813 (gcc_jit_context_release): Likewise.
814 (gcc_jit_context_new_child_context): Likewise.
815 (gcc_jit_type_as_object): Likewise.
816 (gcc_jit_context_get_type): Likewise.
817 (gcc_jit_context_get_int_type): Likewise.
818 (gcc_jit_type_get_pointer): Likewise.
819 (gcc_jit_type_get_const): Likewise.
820 (gcc_jit_type_get_volatile): Likewise.
821 (gcc_jit_type_dyncast_array): Likewise.
822 (gcc_jit_type_is_bool): Likewise.
823 (gcc_jit_type_is_pointer): Likewise.
824 (gcc_jit_type_is_integral): Likewise.
825 (gcc_jit_type_dyncast_vector): Likewise.
826 (gcc_jit_type_is_struct): Likewise.
827 (gcc_jit_vector_type_get_num_units): Likewise.
828 (gcc_jit_vector_type_get_element_type): Likewise.
829 (gcc_jit_type_unqualified): Likewise.
830 (gcc_jit_type_dyncast_function_ptr_type): Likewise.
831 (gcc_jit_function_type_get_return_type): Likewise.
832 (gcc_jit_function_type_get_param_count): Likewise.
833 (gcc_jit_function_type_get_param_type): Likewise.
834 (gcc_jit_context_new_array_type): Likewise.
835 (gcc_jit_context_new_field): Likewise.
836 (gcc_jit_field_as_object): Likewise.
837 (gcc_jit_context_new_struct_type): Likewise.
838 (gcc_jit_struct_as_type): Likewise.
839 (gcc_jit_struct_set_fields): Likewise.
840 (gcc_jit_struct_get_field_count): Likewise.
841 (gcc_jit_context_new_union_type): Likewise.
842 (gcc_jit_context_new_function_ptr_type): Likewise.
843 (gcc_jit_param_as_rvalue): Likewise.
844 (gcc_jit_context_new_function): Likewise.
845 (gcc_jit_function_get_return_type): Likewise.
846 (gcc_jit_function_dump_to_dot): Likewise.
847 (gcc_jit_block_get_function): Likewise.
848 (gcc_jit_global_set_initializer_rvalue): Likewise.
849 (gcc_jit_rvalue_get_type): Likewise.
850 (gcc_jit_context_new_rvalue_from_int): Likewise.
851 (gcc_jit_context_one): Likewise.
852 (gcc_jit_context_new_rvalue_from_double): Likewise.
853 (gcc_jit_context_null): Likewise.
854 (gcc_jit_context_new_string_literal): Likewise.
855 (valid_binary_op_p): Likewise.
856 (gcc_jit_context_new_binary_op): Likewise.
857 (gcc_jit_context_new_comparison): Likewise.
858 (gcc_jit_context_new_call): Likewise.
859 (is_valid_cast): Likewise.
860 (gcc_jit_context_new_cast): Likewise.
861 (gcc_jit_object_get_context): Likewise.
862 (gcc_jit_object_get_debug_string): Likewise.
863 (gcc_jit_lvalue_access_field): Likewise.
864 (gcc_jit_rvalue_access_field): Likewise.
865 (gcc_jit_rvalue_dereference_field): Likewise.
866 (gcc_jit_rvalue_dereference): Likewise.
867 (gcc_jit_lvalue_get_address): Likewise.
868 (gcc_jit_lvalue_set_tls_model): Likewise.
869 (gcc_jit_lvalue_set_link_section): Likewise.
870 (gcc_jit_function_new_local): Likewise.
871 (gcc_jit_block_add_eval): Likewise.
872 (gcc_jit_block_add_assignment): Likewise.
874 (gcc_jit_block_end_with_conditional): Likewise.
875 (gcc_jit_block_add_comment): Likewise.
876 (gcc_jit_block_end_with_jump): Likewise.
877 (gcc_jit_block_end_with_return): Likewise.
878 (gcc_jit_block_end_with_void_return): Likewise.
879 (case_range_validator::case_range_validator): Likewise.
880 (case_range_validator::validate): Likewise.
881 (case_range_validator::get_wide_int): Likewise.
882 (gcc_jit_block_end_with_switch): Likewise.
883 (gcc_jit_context_set_str_option): Likewise.
884 (gcc_jit_context_set_int_option): Likewise.
885 (gcc_jit_context_set_bool_option): Likewise.
886 (gcc_jit_context_set_bool_allow_unreachable_blocks): Likewise.
887 (gcc_jit_context_set_bool_use_external_driver): Likewise.
888 (gcc_jit_context_add_command_line_option): Likewise.
889 (gcc_jit_context_add_driver_option): Likewise.
890 (gcc_jit_context_enable_dump): Likewise.
891 (gcc_jit_context_compile): Likewise.
892 (gcc_jit_context_compile_to_file): Likewise.
893 (gcc_jit_context_set_logfile): Likewise.
894 (gcc_jit_context_dump_reproducer_to_file): Likewise.
895 (gcc_jit_context_get_first_error): Likewise.
896 (gcc_jit_context_get_last_error): Likewise.
897 (gcc_jit_result_get_code): Likewise.
898 (gcc_jit_result_get_global): Likewise.
899 (gcc_jit_rvalue_set_bool_require_tail_call): Likewise.
900 (gcc_jit_type_get_aligned): Likewise.
901 (gcc_jit_type_get_vector): Likewise.
902 (gcc_jit_function_get_address): Likewise.
903 (gcc_jit_version_patchlevel): Likewise.
904 (gcc_jit_block_add_extended_asm): Likewise.
905 (gcc_jit_extended_asm_as_object): Likewise.
906 (gcc_jit_extended_asm_set_volatile_flag): Likewise.
907 (gcc_jit_extended_asm_set_inline_flag): Likewise.
908 (gcc_jit_extended_asm_add_output_operand): Likewise.
909 (gcc_jit_extended_asm_add_input_operand): Likewise.
910 (gcc_jit_extended_asm_add_clobber): Likewise.
911 * notes.txt: Likewise.
913 2022-01-17 Martin Liska <mliska@suse.cz>
915 * dummy-frontend.c: Moved to...
916 * dummy-frontend.cc: ...here.
917 * jit-builtins.c: Moved to...
918 * jit-builtins.cc: ...here.
919 * jit-logging.c: Moved to...
920 * jit-logging.cc: ...here.
921 * jit-playback.c: Moved to...
922 * jit-playback.cc: ...here.
923 * jit-recording.c: Moved to...
924 * jit-recording.cc: ...here.
925 * jit-result.c: Moved to...
926 * jit-result.cc: ...here.
927 * jit-spec.c: Moved to...
928 * jit-spec.cc: ...here.
929 * jit-tempdir.c: Moved to...
930 * jit-tempdir.cc: ...here.
931 * jit-w32.c: Moved to...
932 * jit-w32.cc: ...here.
933 * libgccjit.c: Moved to...
934 * libgccjit.cc: ...here.
936 2021-12-28 Martin Liska <mliska@suse.cz>
938 * docs/_build/texinfo/libgccjit.texi: Replace http:// with https.
939 * docs/cp/index.rst: Likewise.
940 * docs/cp/intro/index.rst: Likewise.
941 * docs/cp/intro/tutorial01.rst: Likewise.
942 * docs/cp/intro/tutorial02.rst: Likewise.
943 * docs/cp/intro/tutorial03.rst: Likewise.
944 * docs/cp/intro/tutorial04.rst: Likewise.
945 * docs/cp/topics/asm.rst: Likewise.
946 * docs/cp/topics/compilation.rst: Likewise.
947 * docs/cp/topics/contexts.rst: Likewise.
948 * docs/cp/topics/expressions.rst: Likewise.
949 * docs/cp/topics/functions.rst: Likewise.
950 * docs/cp/topics/index.rst: Likewise.
951 * docs/cp/topics/locations.rst: Likewise.
952 * docs/cp/topics/objects.rst: Likewise.
953 * docs/cp/topics/types.rst: Likewise.
954 * docs/index.rst: Likewise.
955 * docs/internals/index.rst: Likewise.
956 * docs/intro/index.rst: Likewise.
957 * docs/intro/tutorial01.rst: Likewise.
958 * docs/intro/tutorial02.rst: Likewise.
959 * docs/intro/tutorial03.rst: Likewise.
960 * docs/intro/tutorial04.rst: Likewise.
961 * docs/intro/tutorial05.rst: Likewise.
962 * docs/topics/asm.rst: Likewise.
963 * docs/topics/compatibility.rst: Likewise.
964 * docs/topics/compilation.rst: Likewise.
965 * docs/topics/contexts.rst: Likewise.
966 * docs/topics/expressions.rst: Likewise.
967 * docs/topics/function-pointers.rst: Likewise.
968 * docs/topics/functions.rst: Likewise.
969 * docs/topics/index.rst: Likewise.
970 * docs/topics/locations.rst: Likewise.
971 * docs/topics/objects.rst: Likewise.
972 * docs/topics/performance.rst: Likewise.
973 * docs/topics/types.rst: Likewise.
975 2021-12-20 Martin Liska <mliska@suse.cz>
977 * libgccjit.c (struct version_info): Rename to jit_version_info.
978 (struct jit_version_info): Likewise.
979 (gcc_jit_version_major): Likewise.
980 (gcc_jit_version_minor): Likewise.
981 (gcc_jit_version_patchlevel): Likewise.
983 2021-12-14 Petter Tomner <tomner@kth.se>
985 * jit-common.h: New enum
986 * jit-playback.c : Folding an setting intitial
987 (global_new_decl) : Handle const global generation
988 (new_global) : New flag
989 (global_set_init_rvalue) : New
991 (new_global_initialized) : Flag
992 (as_truth_value) : Fold
993 (new_unary_op) : Fold
994 (new_binary_op) : Fold
995 (new_comparison) : Fold
996 (new_array_access) : Fold
997 (new_dereference) : Fold
1000 (global_set_init_rvalue) : New
1004 (new_global_init_rvalue) : New
1006 (ctor) : New, inherits rvalue
1007 (global_init_rvalue) : New, inherits memento
1008 (type::is_union) : New
1009 * libgccjit++.h : New entrypoints, see C-header
1010 * libgccjit.c : See .h
1011 * libgccjit.h : New entrypoints
1012 (gcc_jit_context_new_array_constructor) : New
1013 (gcc_jit_context_new_struct_constructor) : New
1014 (gcc_jit_context_new_union_constructor) : New
1015 (gcc_jit_global_set_initializer_rvalue) : New
1016 (LIBGCCJIT_HAVE_CTORS) : New feuture macro
1017 * libgccjit.map : New entrypoints added to ABI 19
1018 * docs/topics/expressions.rst : Updated docs
1020 2021-12-12 Antoni Boucher <bouanto@zoho.com>
1023 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_18): New ABI
1025 * docs/topics/expressions.rst: Add documentation for the
1026 function gcc_jit_lvalue_set_link_section.
1027 * jit-playback.h: New function (set_link_section).
1028 * jit-recording.c: New function (set_link_section) and
1029 support for setting the link section.
1030 * jit-recording.h: New function (set_link_section) and new
1031 field m_link_section.
1032 * libgccjit.c: New function (gcc_jit_lvalue_set_link_section).
1033 * libgccjit.h: New function (gcc_jit_lvalue_set_link_section).
1034 * libgccjit.map (LIBGCCJIT_ABI_18): New ABI tag.
1036 2021-12-12 Antoni Boucher <bouanto@zoho.com>
1039 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_17): New ABI
1041 * docs/topics/expressions.rst: Add document for the function
1042 gcc_jit_lvalue_set_tls_model.
1043 * jit-playback.h: New function (set_tls_model).
1044 * jit-recording.c: New function (set_tls_model), new
1045 variables (tls_models and tls_model_enum_strings) and support
1046 for setting the tls model.
1047 * jit-recording.h: New function (set_tls_model) and new
1049 * libgccjit.c: New function (gcc_jit_lvalue_set_tls_model).
1050 * libgccjit.h: New function (gcc_jit_lvalue_set_tls_model)
1051 and new enum (gcc_jit_tls_model).
1052 * libgccjit.map (LIBGCCJIT_ABI_17): New ABI tag.
1054 2021-12-11 Antoni Boucher <bouanto@zoho.com>
1058 * jit-builtins.c: Implement missing types for builtins.
1059 * jit-recording.c:: Allow sending a volatile const void * as
1061 * jit-recording.h: New functions (is_volatile, is_const) and
1062 allow comparing qualified types.
1064 2021-12-10 David Malcolm <dmalcolm@redhat.com>
1067 * jit-playback.c (gcc::jit::playback::context::new_function): Set
1068 DECL_CONTEXT of the result_decl.
1070 2021-11-27 Petter Tomner <tomner@kth.se>
1072 * libgccjit.c: %ld -> %zu
1074 2021-11-24 Martin Liska <mliska@suse.cz>
1076 * jit-playback.c (function): Initialize m_blocks vector.
1078 2021-11-20 Antoni Boucher <bouanto@zoho.com>
1081 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_16): New ABI tag.
1082 * docs/topics/functions.rst: Add documentation for the
1083 functions gcc_jit_function_get_return_type and
1084 gcc_jit_function_get_param_count
1085 * docs/topics/types.rst: Add documentation for the functions
1086 gcc_jit_function_type_get_return_type,
1087 gcc_jit_function_type_get_param_count,
1088 gcc_jit_function_type_get_param_type,
1089 gcc_jit_type_unqualified, gcc_jit_type_dyncast_array,
1090 gcc_jit_type_is_bool,
1091 gcc_jit_type_dyncast_function_ptr_type,
1092 gcc_jit_type_is_integral, gcc_jit_type_is_pointer,
1093 gcc_jit_type_dyncast_vector,
1094 gcc_jit_vector_type_get_element_type,
1095 gcc_jit_vector_type_get_num_units,
1096 gcc_jit_struct_get_field, gcc_jit_type_is_struct,
1097 and gcc_jit_struct_get_field_count
1099 (gcc_jit_function_get_return_type, gcc_jit_function_get_param_count,
1100 gcc_jit_function_type_get_return_type,
1101 gcc_jit_function_type_get_param_count,
1102 gcc_jit_function_type_get_param_type, gcc_jit_type_unqualified,
1103 gcc_jit_type_dyncast_array, gcc_jit_type_is_bool,
1104 gcc_jit_type_dyncast_function_ptr_type, gcc_jit_type_is_integral,
1105 gcc_jit_type_is_pointer, gcc_jit_type_dyncast_vector,
1106 gcc_jit_vector_type_get_element_type,
1107 gcc_jit_vector_type_get_num_units, gcc_jit_struct_get_field,
1108 gcc_jit_type_is_struct, gcc_jit_struct_get_field_count): New
1110 (struct gcc_jit_function_type, struct gcc_jit_vector_type):
1113 (gcc_jit_function_get_return_type, gcc_jit_function_get_param_count,
1114 gcc_jit_function_type_get_return_type,
1115 gcc_jit_function_type_get_param_count,
1116 gcc_jit_function_type_get_param_type, gcc_jit_type_unqualified,
1117 gcc_jit_type_dyncast_array, gcc_jit_type_is_bool,
1118 gcc_jit_type_dyncast_function_ptr_type, gcc_jit_type_is_integral,
1119 gcc_jit_type_is_pointer, gcc_jit_type_dyncast_vector,
1120 gcc_jit_vector_type_get_element_type,
1121 gcc_jit_vector_type_get_num_units, gcc_jit_struct_get_field,
1122 gcc_jit_type_is_struct, gcc_jit_struct_get_field_count): New
1123 function declarations.
1124 (struct gcc_jit_function_type, struct gcc_jit_vector_type):
1126 * jit-recording.h: New functions (is_struct and is_vector)
1127 * libgccjit.map (LIBGCCJIT_ABI_16): New ABI tag.
1129 2021-11-12 David Malcolm <dmalcolm@redhat.com>
1132 * docs/examples/tut04-toyvm/toyvm.c (toyvm_function_compile):
1133 Increase size of buffer.
1134 * docs/examples/tut04-toyvm/toyvm.cc
1135 (compilation_state::create_function): Likewise.
1137 2021-09-10 Petter Tomner <tomner@kth.se>
1139 * jit-playback.c: Moved global var processing to after loc handling.
1140 Setting TYPE_NAME for fundamental types.
1141 Using common functions for finalizing globals.
1142 * jit-playback.h: New method init_types().
1143 Changed get_tree_node_for_type() to method.
1145 2021-08-19 Iain Sandoe <iain@sandoe.co.uk>
1147 * docs/examples/tut04-toyvm/toyvm.c: Include jit-dejagnu.h.
1148 * docs/examples/tut04-toyvm/toyvm.cc: Likewise.
1149 * jit-dejagnu.h: New file, imported from dejagnu-1.6.2 and
1150 patched for this application.
1152 2021-08-18 Iain Sandoe <iain@sandoe.co.uk>
1155 * Make-lang.in: Provide clauses for Darwin hosts.
1157 2021-07-18 Antoni Boucher <bouanto@zoho.com>
1160 * jit-playback.c (convert): Add support to handle truncation and
1161 extension in the convert function.
1163 2021-05-19 Martin Liska <mliska@suse.cz>
1166 * libgccjit.c (gcc_jit_context_new_function): Fix typos.
1168 2021-03-24 Matthias Klose <doko@ubuntu.com>
1170 * Make-lang.in (jit.sphinx.html, jit.sphinx.pdf): Use $(mkinstalldirs),
1171 (jit.install-headers): Depend on installdirs.
1173 2021-02-19 David Malcolm <dmalcolm@redhat.com>
1177 (gcc::jit::builtins_manager::get_builtin_function_by_id):
1178 Update assertion to reject BUILT_IN_NONE.
1179 (gcc::jit::builtins_manager::ensure_optimization_builtins_exist):
1182 (gcc::jit::builtins_manager::ensure_optimization_builtins_exist):
1184 * jit-playback.c (gcc::jit::playback::context::replay): Call it.
1185 Remove redundant conditional on bm.
1187 2021-01-14 David Malcolm <dmalcolm@redhat.com>
1189 * docs/cp/index.rst: Remove "Alpha" warning.
1190 * docs/index.rst: Likewise.
1191 * docs/_build/texinfo/libgccjit.texi: Regenerate
1193 2020-11-25 Martin Sebor <msebor@redhat.com>
1196 * jit-recording.c (recording::function::dump_to_dot): Avoid
1198 (recording::block::dump_to_dot): Same.
1200 2020-11-20 Jakub Jelinek <jakub@redhat.com>
1203 * Make-lang.in (jit.serial): Change from goal to a
1205 (.PHONY): Drop jit.serial and jit.prev.
1206 ($(LIBGCCJIT_FILENAME)): Depend on $(jit.serial) rather than
1209 2020-11-18 Jakub Jelinek <jakub@redhat.com>
1211 * Make-lang.in (jit.serial): New goal.
1212 (.PHONY): Add jit.serial jit.prev.
1213 ($(LIBGCCJIT_FILENAME)): Depend on jit.prev. Call LINK_PROGRESS.
1215 2020-11-12 David Malcolm <dmalcolm@redhat.com>
1218 * docs/cp/topics/asm.rst: New file.
1219 * docs/cp/topics/index.rst (Topic Reference): Add it.
1220 * docs/topics/asm.rst: New file.
1221 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_15): New.
1222 * docs/topics/functions.rst (Statements): Add link to extended
1224 * docs/topics/index.rst (Topic Reference): Add asm.rst.
1225 * docs/topics/objects.rst: Add gcc_jit_extended_asm to ASCII art.
1226 * docs/_build/texinfo/Makefile: Regenerate.
1227 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1228 * jit-common.h (gcc::jit::recording::extended_asm): New forward
1230 (gcc::jit::recording::top_level_asm): Likewise.
1231 * jit-playback.c: Include "stmt.h".
1232 (build_string): New.
1233 (gcc::jit::playback::context::new_string_literal): Disambiguate
1235 (gcc::jit::playback::context::add_top_level_asm): New.
1236 (build_operand_chain): New.
1237 (build_clobbers): New.
1238 (build_goto_operands): New.
1239 (gcc::jit::playback::block::add_extended_asm): New.
1240 * jit-playback.h (gcc::jit::playback::context::add_top_level_asm):
1242 (struct gcc::jit::playback::asm_operand): New struct.
1243 (gcc::jit::playback::block::add_extended_asm): New decl.
1244 * jit-recording.c (gcc::jit::recording::context::dump_to_file):
1245 Dump top-level asms.
1246 (gcc::jit::recording::context::add_top_level_asm): New.
1247 (gcc::jit::recording::block::add_extended_asm): New.
1248 (gcc::jit::recording::block::end_with_extended_asm_goto): New.
1249 (gcc::jit::recording::asm_operand::asm_operand): New.
1250 (gcc::jit::recording::asm_operand::print): New.
1251 (gcc::jit::recording::asm_operand::make_debug_string): New.
1252 (gcc::jit::recording::output_asm_operand::write_reproducer): New.
1253 (gcc::jit::recording::output_asm_operand::print): New.
1254 (gcc::jit::recording::input_asm_operand::write_reproducer): New.
1255 (gcc::jit::recording::input_asm_operand::print): New.
1256 (gcc::jit::recording::extended_asm::add_output_operand): New.
1257 (gcc::jit::recording::extended_asm::add_input_operand): New.
1258 (gcc::jit::recording::extended_asm::add_clobber): New.
1259 (gcc::jit::recording::extended_asm::replay_into): New.
1260 (gcc::jit::recording::extended_asm::make_debug_string): New.
1261 (gcc::jit::recording::extended_asm::write_flags): New.
1262 (gcc::jit::recording::extended_asm::write_clobbers): New.
1263 (gcc::jit::recording::extended_asm_simple::write_reproducer): New.
1264 (gcc::jit::recording::extended_asm::maybe_populate_playback_blocks):
1266 (gcc::jit::recording::extended_asm_goto::extended_asm_goto): New.
1267 (gcc::jit::recording::extended_asm_goto::replay_into): New.
1268 (gcc::jit::recording::extended_asm_goto::write_reproducer): New.
1269 (gcc::jit::recording::extended_asm_goto::get_successor_blocks):
1271 (gcc::jit::recording::extended_asm_goto::maybe_print_gotos): New.
1272 (gcc::jit::recording::extended_asm_goto::maybe_populate_playback_blocks):
1274 (gcc::jit::recording::top_level_asm::top_level_asm): New.
1275 (gcc::jit::recording::top_level_asm::replay_into): New.
1276 (gcc::jit::recording::top_level_asm::make_debug_string): New.
1277 (gcc::jit::recording::top_level_asm::write_to_dump): New.
1278 (gcc::jit::recording::top_level_asm::write_reproducer): New.
1280 (gcc::jit::recording::context::add_top_level_asm): New decl.
1281 (gcc::jit::recording::context::m_top_level_asms): New field.
1282 (gcc::jit::recording::block::add_extended_asm): New decl.
1283 (gcc::jit::recording::block::end_with_extended_asm_goto): New
1285 (gcc::jit::recording::asm_operand): New class.
1286 (gcc::jit::recording::output_asm_operand): New class.
1287 (gcc::jit::recording::input_asm_operand): New class.
1288 (gcc::jit::recording::extended_asm): New class.
1289 (gcc::jit::recording::extended_asm_simple): New class.
1290 (gcc::jit::recording::extended_asm_goto): New class.
1291 (gcc::jit::recording::top_level_asm): New class.
1292 * libgccjit++.h (gccjit::extended_asm): New forward decl.
1293 (gccjit::context::add_top_level_asm): New.
1294 (gccjit::block::add_extended_asm): New.
1295 (gccjit::block::end_with_extended_asm_goto): New.
1296 (gccjit::extended_asm): New class.
1297 (gccjit::extended_asm::extended_asm): New ctors.
1298 (gccjit::extended_asm::set_volatile_flag): New.
1299 (gccjit::extended_asm::set_inline_flag): New.
1300 (gccjit::extended_asm::add_output_operand): New.
1301 (gccjit::extended_asm::add_input_operand): New.
1302 (gccjit::extended_asm::add_clobber): New.
1303 (gccjit::extended_asm::get_inner_extended_asm): New.
1304 * libgccjit.c (struct gcc_jit_extended_asm): New.
1305 (jit_error): Make "loc" param take a gcc::jit::recording::location *
1306 rather than a gcc_jit_location *.
1307 (gcc_jit_block_add_extended_asm): New entrypoint.
1308 (gcc_jit_block_end_with_extended_asm_goto): New entrypoint.
1309 (gcc_jit_extended_asm_as_object): New entrypoint.
1310 (gcc_jit_extended_asm_set_volatile_flag): New entrypoint.
1311 (gcc_jit_extended_asm_set_inline_flag): New entrypoint.
1312 (gcc_jit_extended_asm_add_output_operand): New entrypoint.
1313 (gcc_jit_extended_asm_add_clobber): New entrypoint.
1314 (gcc_jit_context_add_top_level_asm): New entrypoint.
1315 * libgccjit.h: Add gcc_jit_extended_asm to ASCII art.
1316 (gcc_jit_extended_asm): New typedef.
1317 (LIBGCCJIT_HAVE_ASM_STATEMENTS): New define.
1318 (gcc_jit_block_add_extended_asm): New entrypoint.
1319 (gcc_jit_block_end_with_extended_asm_goto): New entrypoint.
1320 (gcc_jit_extended_asm_as_object): New entrypoint.
1321 (gcc_jit_extended_asm_set_volatile_flag): New entrypoint.
1322 (gcc_jit_extended_asm_set_inline_flag): New entrypoint.
1323 (gcc_jit_extended_asm_add_output_operand): New entrypoint.
1324 (gcc_jit_extended_asm_add_input_operand): New entrypoint.
1325 (gcc_jit_extended_asm_add_clobber): New entrypoint.
1326 (gcc_jit_context_add_top_level_asm): New entrypoint.
1327 * libgccjit.map (LIBGCCJIT_ABI_15): New.
1329 2020-11-12 David Malcolm <dmalcolm@redhat.com>
1331 * jit-recording.c (recording::context::new_string): Add "escaped"
1332 param and use it when creating the new recording::string instance.
1333 (recording::string::string): Add "escaped" param and use it to
1334 initialize m_escaped.
1335 (recording::string::make_debug_string): Replace check that first
1336 char is double-quote with use of m_escaped. Fix escaping of
1337 '\t' and '\n'. Set "escaped" on the result.
1338 * jit-recording.h (recording::context::new_string): Add "escaped"
1340 (recording::string::string): Add "escaped" param.
1341 (recording::string::m_escaped): New field.
1343 2020-11-12 David Malcolm <dmalcolm@redhat.com>
1345 * libgccjit.h: Fix typo in comment.
1347 2020-09-14 Andrea Corallo <andrea.corallo@arm.com>
1349 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1351 2020-09-11 Andrea Corallo <andrea.corallo@arm.com>
1353 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_14): New ABI tag.
1354 * docs/topics/expressions.rst (gcc_jit_global_set_initializer):
1355 Document new entry point in section 'Global variables'.
1356 * jit-playback.c (global_new_decl, global_finalize_lvalue): New
1358 (playback::context::new_global): Make use of global_new_decl,
1359 global_finalize_lvalue.
1360 (load_blob_in_ctor): New template function in use by the
1362 (playback::context::new_global_initialized): New method.
1363 * jit-playback.h (class context): Decl 'new_global_initialized',
1364 'global_new_decl', 'global_finalize_lvalue'.
1365 (lvalue::set_initializer): Add implementation.
1366 * jit-recording.c (recording::memento_of_get_pointer::get_size)
1367 (recording::memento_of_get_type::get_size): Add implementation.
1368 (recording::global::write_initializer_reproducer): New function in
1369 use by 'recording::global::write_reproducer'.
1370 (recording::global::replay_into)
1371 (recording::global::write_to_dump)
1372 (recording::global::write_reproducer): Handle
1374 * jit-recording.h (class type): Decl 'get_size' and
1376 * libgccjit++.h (class lvalue): Declare new 'set_initializer'
1378 (class lvalue): Decl 'is_global' and 'set_initializer'.
1379 (class global) Decl 'write_initializer_reproducer'. Add
1380 'm_initializer', 'm_initializer_num_bytes' fields. Implement
1381 'set_initializer'. Add a destructor to free 'm_initializer'.
1382 * libgccjit.c (gcc_jit_global_set_initializer): New function.
1383 * libgccjit.h (gcc_jit_global_set_initializer): New function
1385 * libgccjit.map (LIBGCCJIT_ABI_14): New ABI tag.
1387 2020-08-28 Martin Sebor <msebor@redhat.com>
1389 * jit-recording.c (recording::switch_::make_debug_string): Add argument
1392 2020-08-22 Andrea Corallo <andrea.corallo@arm.com>
1395 (gcc_jit_context_new_rvalue_from_int)
1396 (gcc_jit_context_new_rvalue_from_long)
1397 (gcc_jit_context_new_rvalue_from_double)
1398 (gcc_jit_context_new_rvalue_from_ptr): Update function heading
1401 2020-06-16 Nicolas Bértolo <nicolasbertolo@gmail.com>
1403 * Make-lang.in: Always define version, minor and release
1404 numbers. Create the Windows shared library as
1405 libgccjit-$(LIBGCCJIT_VERSION_NUM).dll.
1407 2020-06-03 David Malcolm <dmalcolm@redhat.com>
1410 * jit-builtins.c (builtins_manager::make_primitive_type):
1411 Implement BT_CONST_VOLATILE_PTR.
1413 2020-06-02 David Malcolm <dmalcolm@redhat.com>
1416 * dummy-frontend.c: Include "options.h", "stringpool.h", and
1418 (ATTR_EXCL): New, copied from lto/lto-lang.c.
1419 (attr_noreturn_exclusions): Likewise.
1420 (attr_returns_twice_exclusions): Likewise.
1421 (attr_const_pure_exclusions): Likewise.
1422 (jit_attribute_table): Likewise, copied from lto_attribute_table.
1423 (jit_format_attribute_table): Likewise, copied from
1424 lto_format_attribute_table.
1425 (handle_noreturn_attribute): New, copied from lto/lto-lang.c.
1426 (handle_leaf_attribute): Likewise.
1427 (handle_const_attribute): Likewise.
1428 (handle_malloc_attribute): Likewise.
1429 (handle_pure_attribute): Likewise.
1430 (handle_novops_attribute): Likewise.
1431 (get_nonnull_operand): Likewise.
1432 (handle_nonnull_attribute): Likewise.
1433 (handle_nothrow_attribute): Likewise.
1434 (handle_sentinel_attribute): Likewise.
1435 (handle_type_generic_attribute): Likewise.
1436 (handle_transaction_pure_attribute): Likewise.
1437 (handle_returns_twice_attribute): Likewise.
1438 (handle_patchable_function_entry_attribute): Likewise.
1439 (ignore_attribute): Likewise.
1440 (handle_format_attribute): Likewise.
1441 (handle_format_arg_attribute): Likewise.
1442 (handle_fnspec_attribute): Likewise.
1443 (LANG_HOOKS_COMMON_ATTRIBUTE_TABLE): Define.
1444 (LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE): Define.
1446 2020-05-28 Nicolas Bértolo <nicolasbertolo@gmail.com>
1448 * Make-lang.in: Remove extra slash. Build libgccjit.dll and its
1449 import library in Windows.
1450 * config-lang.in: Update comment about --enable-host-shared.
1451 * jit-w32.h: New file.
1452 * jit-w32.c: New file.
1453 (print_last_error): New function that prints the error
1454 string corresponding to GetLastError().
1455 (get_TOKEN_USER_current_user): Helper function used for getting
1456 the SID belonging to the current user.
1457 (create_directory_for_current_user): Helper function to create
1458 a directory with permissions such that only the current user can
1460 (win_mkdtemp): Create a temporary directory using Windows APIs.
1461 * jit-playback.c: Do not chmod files in Windows. Use LoadLibrary,
1462 FreeLibrary and GetProcAddress instead of libdl.
1463 * jit-result.h, jit-result.c: Introduce result::handle_t to
1464 abstract over the types used for dynamic library handles.
1465 * jit-tempdir.c: Do not use mkdtemp() in Windows, use
1468 2020-05-27 David Malcolm <dmalcolm@redhat.com>
1471 * dummy-frontend.c (LANG_HOOKS_DEEP_UNSHARING): Define to be true.
1472 * jit-playback.h (gcc::jit::playback::rvalue): Mark tree node with
1475 2020-05-27 Tom Tromey <tromey@gcc.gnu.org>
1478 * docs/conf.py (texinfo_documents): Set description.
1479 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1481 2020-05-26 David Malcolm <dmalcolm@redhat.com>
1484 * docs/topics/functions.rst
1485 (gcc_jit_context_get_builtin_function): Document.
1486 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1487 * dummy-frontend.c (jit_langhook_global_bindings_p): Remove
1489 * jit-builtins.c (type_names): New array.
1490 (get_string_for_type_id): New function.
1491 (gcc::jit::builtins_manager::make_primitive_type): Show name of
1492 type in error messages. Update cases to reflect the order in
1493 builtin-types.def. Implement cases for BT_INT8, BT_INT16,
1494 BT_UINT8, BT_CONST_PTR, BT_VOLATILE_PTR, BT_INT_PTR, BT_FLOAT_PTR,
1495 BT_CONST_DOUBLE_PTR, BT_SIZE, BT_CONST_SIZE.
1497 2020-05-26 David Malcolm <dmalcolm@redhat.com>
1499 * docs/topics/compatibility.rst: Fix underline.
1501 * docs/topics/types.rst: Fix missing blank line.
1502 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1504 2020-05-26 David Malcolm <dmalcolm@redhat.com>
1507 * docs/topics/expressions.rst (Unary Operations): Document that
1508 result_type of gcc_jit_context_new_unary_op must be a numeric type.
1509 (Binary Operations): Likewise for gcc_jit_context_new_binary_op.
1510 (Global variables): Document that "type" of
1511 gcc_jit_context_new_global must be non-`void`.
1512 * docs/topics/function-pointers.rst
1513 (gcc_jit_context_new_function_ptr_type): Document that the
1514 param_types must be non-void, but that return_type may be.
1515 * docs/topics/functions.rst (Params): Document that
1516 gcc_jit_context_new_param's type must be non-void.
1517 (Functions): Likewise for gcc_jit_function_new_local.
1518 * docs/topics/types.rst (gcc_jit_context_new_array_type): Document
1519 that the type must be non-void.
1520 (gcc_jit_context_new_field): Likewise.
1521 * docs/_build/texinfo/Makefile: Regenerate.
1522 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1523 * libgccjit.c (gcc_jit_context_new_array_type): Fail if
1524 element_type is void.
1525 (gcc_jit_context_new_field): Likewise for "type".
1526 (gcc_jit_context_new_function_ptr_type): Likewise for each
1527 element of param_types.
1528 (gcc_jit_context_new_param): Likewise for "type".
1529 (gcc_jit_context_new_global): Likewise.
1530 (gcc_jit_function_new_local): Likewise.
1531 (gcc_jit_type_get_aligned): Likewise.
1533 2020-03-31 Andrea Corallo <andrea.corallo@arm.com>
1534 David Malcolm <dmalcolm@redhat.com>
1536 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_13): New ABI tag
1537 plus add version paragraph.
1538 * libgccjit++.h (namespace gccjit::version): Add new namespace.
1539 * libgccjit.c (gcc_jit_version_major, gcc_jit_version_minor)
1540 (gcc_jit_version_patchlevel): New functions.
1541 * libgccjit.h (LIBGCCJIT_HAVE_gcc_jit_version): New macro.
1542 (gcc_jit_version_major, gcc_jit_version_minor)
1543 (gcc_jit_version_patchlevel): New functions.
1544 * libgccjit.map (LIBGCCJIT_ABI_13) New ABI tag.
1546 2020-03-23 Andrea Corallo <andrea.corallo@arm.com>
1549 (gcc::jit::playback::context m_recording_ctxt): Remove
1550 m_char_array_type_node field.
1552 (playback::context::context) Remove m_char_array_type_node from member
1554 (playback::context::new_string_literal) Fix logic to handle string
1557 2020-01-01 Jakub Jelinek <jakub@redhat.com>
1559 Update copyright years.
1561 2019-11-29 Julian Brown <julian@codesourcery.com>
1563 * jit-builtins.c (BT_DFLOAT32_PTR, BT_DFLOAT64_PTR, BT_DFLOAT128_PTR):
1564 Remove commented-out cases.
1566 2019-11-20 David Malcolm <dmalcolm@redhat.com>
1569 * jit-playback.c (gcc::jit::playback::context::make_fake_args):
1570 Update GCC_JIT_BOOL_OPTION_SELFCHECK_GC for new --param syntax.
1572 2019-08-13 Richard Sandiford <richard.sandiford@arm.com>
1575 * jit-playback.c (new_function): Use set_decl_built_in_function.
1577 2019-07-22 Andrea Corallo <andrea.corallo@arm.com>
1579 * jit-recording.c (unary_op_reproducer_strings): Make it extern.
1580 (binary_op_reproducer_strings): Likewise.
1581 * jit-recording.h (unary_op_reproducer_strings): Likewise.
1582 (binary_op_reproducer_strings): Likewise.
1583 * libgccjit.c (gcc_jit_context_new_unary_op): Check result_type to be a
1585 * libgccjit.c (gcc_jit_context_new_binary_op): Improve error message.
1587 2019-07-04 Andrea Corallo <andrea.corallo@arm.com>
1589 * libgccjit.c (gcc_jit_context_new_binary_op): Check result_type to be a
1592 2019-07-04 Andrea Corallo <andrea.corallo@arm.com>
1594 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_12): New ABI tag.
1595 * docs/topics/types.rst: Add gcc_jit_context_new_bitfield.
1596 * jit-common.h (namespace recording): Add class bitfield.
1598 (DECL_C_BIT_FIELD, SET_DECL_C_BIT_FIELD): Add macros.
1599 (playback::context::new_bitfield): New method.
1600 (playback::compound_type::set_fields): Add bitfield support.
1601 (playback::lvalue::mark_addressable): Was jit_mark_addressable make this
1602 a method of lvalue plus return a bool to communicate success.
1603 (playback::lvalue::get_address): Check for jit_mark_addressable return
1605 * jit-playback.h (new_bitfield): New method.
1606 (class bitfield): New class.
1607 (class lvalue): Add jit_mark_addressable method.
1608 * jit-recording.c (recording::context::new_bitfield): New method.
1609 (recording::bitfield::replay_into): New method.
1610 (recording::bitfield::write_to_dump): Likewise.
1611 (recording::bitfield::make_debug_string): Likewise.
1612 (recording::bitfield::write_reproducer): Likewise.
1613 * jit-recording.h (class context): Add new_bitfield method.
1614 (class field): Make it derivable by class bitfield.
1615 (class bitfield): Add new class.
1616 * libgccjit++.h (class context): Add new_bitfield method.
1617 * libgccjit.c (struct gcc_jit_bitfield): New structure.
1618 (gcc_jit_context_new_bitfield): New function.
1620 (LIBGCCJIT_HAVE_gcc_jit_context_new_bitfield) New macro.
1621 (gcc_jit_context_new_bitfield): New function.
1622 * libgccjit.map (LIBGCCJIT_ABI_12) New ABI tag.
1624 2019-03-21 Jakub Jelinek <jakub@redhat.com>
1626 * jit-recording.c (reproducer::m_set_identifiers): Use false as Lazy
1627 in hash_set template param.
1629 2019-02-05 Andrea Corallo <andrea.corallo@arm.com>
1631 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_11): New ABI tag.
1632 * docs/topics/contexts.rst (Additional driver options): New
1634 * jit-playback.c (invoke_driver): Add call to append_driver_options.
1635 * jit-recording.c: Within namespace gcc::jit...
1636 (recording::context::~context): Free the optnames within
1638 (recording::context::add_driver_option): New method.
1639 (recording::context::append_driver_options): New method.
1640 (recording::context::dump_reproducer_to_file): Add driver
1642 * jit-recording.h: Within namespace gcc::jit...
1643 (recording::context::add_driver_option): New method.
1644 (recording::context::append_driver_options): New method.
1645 (recording::context::m_driver_options): New field.
1646 * libgccjit++.h (gccjit::context::add_driver_option): New
1648 * libgccjit.c (gcc_jit_context_add_driver_option): New API
1650 * libgccjit.h (gcc_jit_context_add_driver_option): New API
1652 (LIBGCCJIT_HAVE_gcc_jit_context_add_driver_option): New
1654 * libgccjit.map (LIBGCCJIT_ABI_11): New ABI tag.
1656 2019-01-01 Jakub Jelinek <jakub@redhat.com>
1658 Update copyright years.
1660 2018-11-15 David Malcolm <dmalcolm@redhat.com>
1663 * dummy-frontend.c (jit_begin_diagnostic): Add diagnostic_t param.
1665 2018-11-13 David Malcolm <dmalcolm@redhat.com>
1667 * jit-playback.c: Replace "source_location" with "location_t".
1669 2018-10-17 David Malcolm <dmalcolm@redhat.com>
1671 * Make-lang.in (selftest-jit): New.
1673 2018-06-28 Martin Liska <mliska@suse.cz>
1675 * jit-playback.c: Include opt-suggestions.h.
1677 2018-06-28 Martin Liska <mliska@suse.cz>
1679 * jit-playback.c (class auto_argvec): Moved to vec.h.
1680 (auto_argvec::~auto_argvec): Likewise.
1681 (compile): Use the renamed name.
1682 (invoke_driver): Likewise.
1684 2018-03-21 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1687 * Make-lang.in ($(LIBGCCJIT_FILENAME)): Add $(EXTRA_GCC_LIBS).
1689 2018-03-09 David Malcolm <dmalcolm@redhat.com>
1690 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
1694 * Make-lang.in (COMMA): New.
1695 (LIBGCCJIT_VERSION_SCRIPT_OPTION): New.
1696 (LIBGCCJIT_SONAME_OPTION): New.
1697 (jit): Move --version-script and -soname linker options to the
1700 2018-01-25 David Malcolm <dmalcolm@redhat.com>
1703 * jit-recording.h (gcc::jit::recording::union_): Remove fields
1704 "m_loc" and "m_name".
1706 2018-01-03 Jakub Jelinek <jakub@redhat.com>
1708 Update copyright years.
1710 2017-12-19 Jakub Jelinek <jakub@redhat.com>
1712 * jit-playback.c (get_type, playback::compile_to_file::copy_file,
1713 playback::context::acquire_mutex): Replace Yoda conditions with
1714 typical order conditions.
1715 * libgccjit.c (gcc_jit_context_new_struct_type,
1716 gcc_jit_struct_set_fields, gcc_jit_context_new_union_type,
1717 gcc_jit_context_new_function, gcc_jit_timer_pop): Likewise.
1718 * jit-builtins.c (matches_builtin): Likewise.
1719 * jit-recording.c (recording::compound_type::set_fields,
1720 recording::fields::write_reproducer, recording::rvalue::set_scope,
1721 recording::function::validate): Likewise.
1722 * jit-logging.c (logger::decref): Likewise.
1724 2017-11-30 Jakub Jelinek <jakub@redhat.com>
1727 (recording::memento_of_new_rvalue_from_const <long>::write_reproducer):
1728 Use ; instead of ;;.
1730 2017-11-28 Jakub Jelinek <jakub@redhat.com>
1732 * jit-playback.c (add_switch): Build SWITCH_EXPR using build2 instead
1733 of build3. Formatting fixes. Adjust funciton comment.
1735 2017-11-23 Tom de Vries <tom@codesourcery.com>
1737 * libgccjit.c (RETURN_NULL_IF_FAIL_NONNULL_NUMERIC_TYPE): Wrap in
1738 JIT_{BEGIN,END}_STMT.
1740 2017-10-31 David Malcolm <dmalcolm@redhat.com>
1742 * docs/internals/index.rst (Running the test suite): Document
1743 PRESERVE_EXECUTABLES.
1744 (Running under valgrind): Add markup to RUN_UNDER_VALGRIND.
1745 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1747 2017-10-04 David Malcolm <dmalcolm@redhat.com>
1749 * docs/cp/topics/expressions.rst (Vector expressions): New
1751 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_10): New ABI tag.
1752 * docs/topics/expressions.rst (Vector expressions): New section.
1753 * docs/topics/types.rst (gcc_jit_type_get_vector): Add link to
1754 gcc_jit_context_new_rvalue_from_vector.
1755 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1756 * jit-common.h (gcc::jit:recording::vector_type): New forward
1759 (gcc::jit::playback::context::new_rvalue_from_vector): New method.
1761 (gcc::jit::playback::context::new_rvalue_from_vector): New method.
1762 * jit-recording.c: In namespace gcc::jit::
1763 (class comma_separated_string): New class.
1764 (comma_separated_string::comma_separated_string): New ctor,
1765 adapted from recording::call::make_debug_string.
1766 (comma_separated_string::~comma_separated_string): New dtor.
1767 In namespace gcc::jit::recording::
1768 (context::new_rvalue_from_vector): New method.
1769 (type::get_vector): Update for renaming of memento_of_get_vector.
1770 (class memento_of_get_vector): Rename to...
1771 (class vector_type): ..this.
1772 (memento_of_new_rvalue_from_vector::memento_of_new_rvalue_from_vector):
1774 (memento_of_new_rvalue_from_vector::replay_into): New method.
1775 (memento_of_new_rvalue_from_vector::visit_children): New method.
1776 (memento_of_new_rvalue_from_vector::make_debug_string): New
1778 (memento_of_new_rvalue_from_vector::write_reproducer): New method.
1779 (call::make_debug_string): Split out arg-printing code into ctor
1780 for comma_separated_string.
1781 * jit-recording.h: In namespace gcc::jit::recording::
1782 (context::new_rvalue_from_vector): New method.
1783 (type::dyn_cast_vector_type): New virtual function.
1784 (class memento_of_get_vector): Rename to...
1785 (class vector_type): ...this.
1786 (vector_type::unqualified): Remove this vfunc override in favor
1788 (vector_type::get_element_type): ...this new method.
1789 (vector_type::get_num_units): New method.
1790 (vector_type::dyn_cast_vector_type): New vfunc override.
1791 (class memento_of_new_rvalue_from_vector): New class.
1792 * libgccjit++.h (gccjit::context::new_rvalue): Add overload for
1794 * libgccjit.c (gcc_jit_context_new_binary_op): Strip off type
1795 qualifications when checking that both operands have same type.
1796 (gcc_jit_context_new_rvalue_from_vector): New API entrypoint.
1798 (LIBGCCJIT_HAVE_gcc_jit_context_new_rvalue_from_vector): New
1800 (gcc_jit_context_new_rvalue_from_vector): New API entrypoint.
1801 * libgccjit.map (LIBGCCJIT_ABI_10): New ABI tag.
1803 2017-09-28 David Malcolm <dmalcolm@redhat.com>
1805 * docs/topics/expressions.rst (Function calls): Add link to
1806 gcc_jit_context_new_function_ptr_type.
1807 (Function pointers): Convert to cross-references to
1808 function-pointers.rst, moving material there.
1809 * docs/topics/function-pointers.rst: New page.
1810 * docs/topics/index.rst: Add function-pointers.rst.
1811 * docs/topics/types.rst (Function pointer types): New section.
1812 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1814 2017-09-28 David Malcolm <dmalcolm@redhat.com>
1817 (gcc::jit::recording::function_type::is_same_type_as): New function.
1818 * jit-recording.h: In namespace gcc::jit::recording::
1819 (type::accepts_writes_from): Use is_same_type_as rather than pointer
1821 (type::is_same_type_as): New virtual function.
1822 (function_type::is_same_type_as): New override.
1824 2017-09-27 David Malcolm <dmalcolm@redhat.com>
1826 * docs/cp/topics/expressions.rst (Function pointers): New section.
1827 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_9): New tag.
1828 * docs/topics/expressions.rst (Function pointers): New section.
1829 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1830 * jit-common.h (class gcc::jit::recording::function_pointer): New
1832 * jit-playback.c (gcc::jit::playback::function::get_address): New
1834 * jit-playback.h (gcc::jit::playback::function::get_address): New
1836 * jit-recording.c: Within namespace gcc::jit::recording...
1837 (function::function): Initialize new field "m_fn_ptr_type".
1838 (function::get_address): New method.
1839 (function_pointer::replay_into): New method.
1840 (function_pointer::visit_children): New method.
1841 (function_pointer::make_debug_string): New method.
1842 (function_pointer::write_reproducer): New method.
1843 * jit-recording.h: Within namespace gcc::jit::recording...
1844 (function::get_address): New method.
1845 (function): Add field "m_fn_ptr_type".
1846 (class function_pointer): New subclass of rvalue.
1847 * libgccjit++.h (gccjit::function::get_address): New method.
1848 * libgccjit.c (gcc_jit_function_get_address): New function.
1849 * libgccjit.h (LIBGCCJIT_HAVE_gcc_jit_function_get_address): New
1851 (gcc_jit_function_get_address): New API entrypoint.
1852 * libgccjit.map (LIBGCCJIT_ABI_9): New tag.
1854 2017-09-14 David Malcolm <dmalcolm@redhat.com>
1857 * jit-builtins.c (matches_builtin): Ignore entries with a NULL
1860 2017-08-18 David Malcolm <dmalcolm@redhat.com>
1862 PR tree-optimization/46805
1863 * dummy-frontend.c (jit_langhook_parse_file): Handle vector types.
1865 2017-08-18 David Malcolm <dmalcolm@redhat.com>
1867 * jit-recording.c (class gcc::jit::reproducer): Rename field
1868 "m_identifiers" to "m_map_memento_to_identifier". Add field
1869 "m_set_identifiers" and struct hash_traits for it.
1870 (gcc::jit::reproducer::reproducer): Update for above.
1871 (convert_to_identifier): New function.
1872 (gcc::jit::reproducer::ensure_identifier_is_unique): New method.
1873 (gcc::jit::reproducer::make_identifier): Avoid appending the %p
1874 unless necessary for uniqueness. Update for field renaming.
1875 (gcc::jit::reproducer::get_identifier): Update for field renaming.
1877 2017-08-09 David Malcolm <dmalcolm@redhat.com>
1879 * docs/cp/topics/types.rst (Vector types): New section.
1880 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_8): New tag.
1881 * docs/topics/types.rst (gcc_jit_context_get_type): Fix typo in
1883 (Vector types): New section.
1884 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1885 * jit-playback.c (gcc::jit::playback::type::get_vector): New
1887 * jit-playback.h (gcc::jit::playback::type::get_vector): New
1889 * jit-recording.c: In namespace gcc::jit::recording::
1890 (type::get_vector): New method.
1891 (memento_of_get_aligned::write_reproducer): Fix typo
1893 (memento_of_get_vector::replay_into): New method.
1894 (memento_of_get_vector::make_debug_string): New method.
1895 (memento_of_get_vector::write_reproducer): New method.
1896 * jit-recording.h: In namespace gcc::jit::recording::
1897 (type::get_vector): New
1899 (class memento_of_get_vector): New class.
1900 * libgccjit++.h (gccjit::type::get_vector): New method.
1901 * libgccjit.c (gcc_jit_type_get_vector): New public entrypoint.
1902 * libgccjit.h (LIBGCCJIT_HAVE_gcc_jit_type_get_vector): New
1904 (gcc_jit_type_get_vector): New decl.
1905 * libgccjit.map (LIBGCCJIT_ABI_8): New ABI tag.
1907 2017-07-05 Richard Sandiford <richard.sandiford@linaro.org>
1908 Alan Hayward <alan.hayward@arm.com>
1909 David Sherwood <david.sherwood@arm.com>
1911 * dummy-frontend.c (jit_langhook_type_for_mode): Remove "enum" before
1914 2017-04-24 David Malcolm <dmalcolm@redhat.com>
1916 * docs/cp/topics/types.rst (gccjit::type::get_const): Remove
1918 (gccjit::type::get_aligned): Add.
1919 * docs/topics/compatibility.rst: Add LIBGCCJIT_ABI_7.
1920 * docs/topics/types.rst: Add gcc_jit_type_get_aligned.
1921 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1922 * jit-playback.c (gcc::jit::playback::type::get_aligned): New
1924 * jit-playback.h (gcc::jit::playback::type::get_aligned): New
1926 * jit-recording.c: Within namespace gcc::jit::recording...
1927 (type::get_aligned): New method.
1928 (memento_of_get_aligned::replay_into): New method.
1929 (memento_of_get_aligned::make_debug_string): New method.
1930 (memento_of_get_aligned::write_reproducer): New method.
1931 * jit-recording.h: Within namespace gcc::jit::recording...
1932 (type::get_aligned): New method.
1933 (type::accepts_writes_from): Strip off qualifications from
1934 this when comparing pointer equality.
1935 (decorated_type): New subclass of type, subsuming the
1936 commonality between memento_of_get_const and
1937 memento_of_get_volatile.
1938 (memento_of_get_const): Make a subclass of decorated_type,
1940 (memento_of_get_volatile): Likewise.
1941 (memento_of_get_aligned): Likewise.
1942 * libgccjit++.h: Within namespace gccjit...
1943 (type::get_const): New method.
1944 (type::get_aligned): New method.
1945 * libgccjit.c (gcc_jit_type_get_aligned): New function.
1946 * libgccjit.h (gcc_jit_type_get_aligned): New decl.
1947 * libgccjit.map (LIBGCCJIT_ABI_7): New
1948 (gcc_jit_type_get_aligned): Add.
1950 2017-01-19 David Malcolm <dmalcolm@redhat.com>
1952 * dummy-frontend.c (jit_langhook_type_for_size): Delete.
1953 (LANG_HOOKS_TYPE_FOR_SIZE): Don't redefine.
1955 2017-01-18 David Malcolm <dmalcolm@redhat.com>
1957 * dummy-frontend.c (jit_langhook_type_for_size): Implement, using
1958 lto's lto_type_for_size.
1960 2017-01-01 Jakub Jelinek <jakub@redhat.com>
1962 Update copyright years.
1964 2016-05-20 David Malcolm <dmalcolm@redhat.com>
1966 * docs/topics/compatibility.rst: Add LIBGCCJIT_ABI_6.
1967 * docs/topics/expressions.rst (Function calls): Add documentation
1968 of gcc_jit_rvalue_set_bool_require_tail_call.
1969 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1970 * jit-common.h (gcc::jit::recording::base_call): Add forward decl.
1971 * jit-playback.c: Within namespace gcc::jit::playback...
1972 (context::build_call) Add "require_tail_call" param and use it
1973 to set CALL_EXPR_MUST_TAIL_CALL.
1974 (context::new_call): Add "require_tail_call" param.
1975 (context::new_call_through_ptr): Likewise.
1976 * jit-playback.h: Within namespace gcc::jit::playback...
1977 (context::new_call: Add "require_tail_call" param.
1978 (context::new_call_through_ptr): Likewise.
1979 (context::build_call): Likewise.
1980 * jit-recording.c: Within namespace gcc::jit::recording...
1981 (base_call::base_call): New constructor.
1982 (base_call::write_reproducer_tail_call): New method.
1983 (call::call): Update for inheritance from base_call.
1984 (call::replay_into): Provide m_require_tail_call to call
1986 (call::write_reproducer): Call write_reproducer_tail_call.
1987 (call_through_ptr::call_through_ptr): Update for inheritance from
1989 (call_through_ptr::replay_into): Provide m_require_tail_call to call
1990 to new_call_through_ptr.
1991 (recording::call_through_ptr::write_reproducer): Call
1992 write_reproducer_tail_call.
1993 * jit-recording.h: Within namespace gcc::jit::recording...
1994 (rvalue::dyn_cast_base_call): New virtual function.
1995 (class base_call): New subclass of class rvalue.
1996 (class call): Inherit from base_call rather than directly from
1997 rvalue, moving get_precedence and m_args to base_call.
1998 (class call_through_ptr): Likewise.
1999 * libgccjit.c (gcc_jit_rvalue_set_bool_require_tail_call): New
2002 (LIBGCCJIT_HAVE_gcc_jit_rvalue_set_bool_require_tail_call): New
2004 (gcc_jit_rvalue_set_bool_require_tail_call): New function.
2005 * libgccjit.map (LIBGCCJIT_ABI_6): New.
2006 (gcc_jit_rvalue_set_bool_require_tail_call): Add.
2008 2016-05-17 David Malcolm <dmalcolm@redhat.com>
2010 * dummy-frontend.c: Include diagnostic.h.
2011 (jit_begin_diagnostic): New function.
2012 (jit_end_diagnostic): New function.
2013 (jit_langhook_init): Register jit_begin_diagnostic
2014 and jit_end_diagnostic with the global_dc.
2015 * jit-playback.c: Include diagnostic.h.
2016 (gcc::jit::playback::context::add_diagnostic): New method.
2017 * jit-playback.h (struct diagnostic_context): Add forward
2019 (gcc::jit::playback::context::add_diagnostic): New method.
2021 2016-05-17 David Malcolm <dmalcolm@redhat.com>
2023 * docs/topics/expressions.rst (Function calls): Document
2024 gcc_jit_context_new_call_through_ptr.
2025 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2027 2016-05-13 David Malcolm <dmalcolm@redhat.com>
2029 * jit-playback.h: Within namespace gcc:jit::playback...
2030 (compile_to_memory::postprocess): Mark with FINAL OVERRIDE.
2031 (compile_to_file::postprocess): Likewise.
2032 (function::finalizer): Likewise.
2033 (block::finalizer): Likewise.
2034 (source_file::finalizer): Likewise.
2035 (source_line::finalizer): Likewise.
2036 * jit-recording.c (gcc::jit::rvalue_usage_validator):: Likewise.
2037 * jit-recording.h: Within namespace gcc::jit::recording...
2038 (string::replay_into): Mark with FINAL OVERRIDE.
2039 (string::make_debug_string): Likewise.
2040 (string::write_reproducer): Likewise.
2041 (location::replay_into): Likewise.
2042 (location::dyn_cast_location): Likewise.
2043 (location::make_debug_string): Likewise.
2044 (location::write_reproducer): Likewise.
2045 (memento_of_get_type::dereference): Likewise.
2046 (memento_of_get_type::accepts_writes_from): Likewise.
2047 (memento_of_get_type::is_int): Likewise.
2048 (memento_of_get_type::is_float): Likewise.
2049 (memento_of_get_type::is_bool): Likewise.
2050 (memento_of_get_type::is_pointer): Likewise.
2051 (memento_of_get_type::is_array): Likewise.
2052 (memento_of_get_type::is_void): Likewise.
2053 (memento_of_get_type::replay_into): Likewise.
2054 (memento_of_get_type::make_debug_string): Likewise.
2055 (memento_of_get_type::write_reproducer): Likewise.
2056 (memento_of_get_pointer::dereference): Likewise.
2057 (memento_of_get_pointer::accepts_writes_from): Likewise.
2058 (memento_of_get_pointer::replay_into): Likewise.
2059 (memento_of_get_pointer::is_int): Likewise.
2060 (memento_of_get_pointer::is_float): Likewise.
2061 (memento_of_get_pointer::is_bool): Likewise.
2062 (memento_of_get_pointer::is_pointer): Likewise.
2063 (memento_of_get_pointer::is_array): Likewise.
2064 (memento_of_get_pointer::make_debug_string): Likewise.
2065 (memento_of_get_pointer::write_reproducer): Likewise.
2066 (memento_of_get_const::dereference): Likewise.
2067 (memento_of_get_const::accepts_writes_from): Likewise.
2068 (memento_of_get_const::unqualified): Likewise.
2069 (memento_of_get_const::is_int): Likewise.
2070 (memento_of_get_const::is_float): Likewise.
2071 (memento_of_get_const::is_bool): Likewise.
2072 (memento_of_get_const::is_pointer): Likewise.
2073 (memento_of_get_const::is_array): Likewise.
2074 (memento_of_get_const::void replay_into): Likewise;
2075 (memento_of_get_const::make_debug_string): Likewise.
2076 (memento_of_get_const::write_reproducer): Likewise.
2077 (memento_of_get_volatile::dereference): Likewise.
2078 (memento_of_get_volatile::unqualified): Likewise.
2079 (memento_of_get_volatile::is_int): Likewise.
2080 (memento_of_get_volatile::is_float): Likewise.
2081 (memento_of_get_volatile::is_bool): Likewise.
2082 (memento_of_get_volatile::is_pointer): Likewise.
2083 (memento_of_get_volatile::is_array): Likewise.
2084 (memento_of_get_volatile::replay_into): Likewise;
2085 (memento_of_get_volatile::make_debug_string): Likewise.
2086 (memento_of_get_volatile::write_reproducer): Likewise.
2087 (array_type::dereference): Likewise.
2088 (array_type::is_int): Likewise.
2089 (array_type::is_float): Likewise.
2090 (array_type::is_bool): Likewise.
2091 (array_type::is_pointer): Likewise.
2092 (array_type::is_array): Likewise.
2093 (array_type::replay_into): Likewise;
2094 (array_type::make_debug_string): Likewise.
2095 (array_type::write_reproducer): Likewise.
2096 (function_type::dereference): Likewise.
2097 (function_type::function_dyn_cast_function_type): Likewise.
2098 (function_type::function_as_a_function_type): Likewise.
2099 (function_type::is_int): Likewise.
2100 (function_type::is_float): Likewise.
2101 (function_type::is_bool): Likewise.
2102 (function_type::is_pointer): Likewise.
2103 (function_type::is_array): Likewise.
2104 (function_type::replay_into): Likewise;
2105 (function_type::make_debug_string): Likewise.
2106 (function_type::write_reproducer): Likewise.
2107 (field::replay_into): Likewise;
2108 (field::write_to_dump): Likewise.
2109 (field::make_debug_string): Likewise.
2110 (field::write_reproducer): Likewise.
2111 (compound_type::dereference): Likewise.
2112 (compound_type::is_int): Likewise.
2113 (compound_type::is_float): Likewise.
2114 (compound_type::is_bool): Likewise.
2115 (compound_type::is_pointer): Likewise.
2116 (compound_type::is_array): Likewise.
2117 (compound_type::has_known_size): Likewise.
2118 (struct_::dyn_cast_struct): Likewise.
2119 (struct_::replay_into): Likewise.
2120 (struct_::access_as_type): Likewise.
2121 (struct_::make_debug_string): Likewise.
2122 (struct_::write_reproducer): Likewise.
2123 (fields::replay_into): Likewise.
2124 (fields::write_to_dump): Likewise.
2125 (fields::make_debug_string): Likewise.
2126 (fields::write_reproducer): Likewise.
2127 (union_::replay_into): Likewise.
2128 (union_::make_debug_string): Likewise.
2129 (union_::write_reproducer): Likewise.
2130 (lvalue::access_as_rvalue): Mark with OVERRIDE.
2131 (param::replay_into): Mark with FINAL OVERRIDE.
2132 (param::visit_children): Likewise.
2133 (param::dyn_cast_param): Likewise.
2134 (param::access_as_rvalue): Likewise.
2135 (param::access_as_lvalue): Likewise.
2136 (param::make_debug_string): Likewise.
2137 (param::write_reproducer): Likewise.
2138 (param::get_precedence): Likewise.
2139 (function::replay_into): Likewise.
2140 (function::write_to_dump): Likewise.
2141 (function::make_debug_string): Likewise.
2142 (function::write_reproducer): Likewise.
2143 (block::write_to_dump): Likewise.
2144 (block::make_debug_string): Likewise.
2145 (block::write_reproducer): Likewise.
2146 (block::replay_into): Likewise.
2147 (global::replay_into): Likewise;
2148 (global::visit_children): Likewise.
2149 (global::write_to_dump): Likewise.
2150 (global::make_debug_string): Likewise.
2151 (global::write_reproducer): Likewise.
2152 (global::get_precedence): Likewise.
2153 (memento_of_new_rvalue_from_const::replay_into): Likewise.
2154 (memento_of_new_rvalue_from_const::visit_children): Likewise.
2155 (memento_of_new_rvalue_from_const::is_constant): Likewise.
2156 (memento_of_new_rvalue_from_const::get_wide_int): Likewise.
2157 (memento_of_new_rvalue_from_const::make_debug_string): Likewise.
2158 (memento_of_new_rvalue_from_const::write_reproducer): Likewise.
2159 (memento_of_new_rvalue_from_const::get_precedence): Likewise.
2160 (memento_of_new_string_literal::replay_into): Likewise.
2161 (memento_of_new_string_literal::visit_children): Likewise.
2162 (memento_of_new_string_literal::make_debug_string): Likewise.
2163 (memento_of_new_string_literal::write_reproducer): Likewise.
2164 (memento_of_new_string_literal::get_precedence): Likewise.
2165 (unary_op::replay_into): Likewise.
2166 (unary_op::visit_children): Likewise.
2167 (unary_op::make_debug_string): Likewise.
2168 (unary_op::write_reproducer): Likewise.
2169 (unary_op::get_precedence): Likewise.
2170 (binary_op::replay_into): Likewise.
2171 (binary_op::visit_children): Likewise.
2172 (binary_op::make_debug_string): Likewise.
2173 (binary_op::write_reproducer): Likewise.
2174 (binary_op::get_precedence): Likewise.
2175 (comparison::replay_into): Likewise.
2176 (comparison::visit_children): Likewise.
2177 (comparison::make_debug_string): Likewise.
2178 (comparison::write_reproducer): Likewise.
2179 (comparison::get_precedence): Likewise.
2180 (cast::replay_into): Likewise.
2181 (cast::visit_children): Likewise.
2182 (cast::make_debug_string): Likewise.
2183 (cast::write_reproducer): Likewise.
2184 (cast::get_precedence): Likewise.
2185 (call::replay_into): Likewise.
2186 (call::visit_children): Likewise.
2187 (call::make_debug_string): Likewise.
2188 (call::write_reproducer): Likewise.
2189 (call::get_precedence): Likewise.
2190 (call_through_ptr::replay_into): Likewise.
2191 (call_through_ptr::visit_children): Likewise.
2192 (call_through_ptr::make_debug_string): Likewise.
2193 (call_through_ptr::write_reproducer): Likewise.
2194 (call_through_ptr::get_precedence): Likewise.
2195 (array_access::replay_into): Likewise.
2196 (array_access::visit_children): Likewise.
2197 (array_access::make_debug_string): Likewise.
2198 (array_access::write_reproducer): Likewise.
2199 (array_access::get_precedence): Likewise.
2200 (access_field_of_lvalue::replay_into): Likewise.
2201 (access_field_of_lvalue::visit_children): Likewise.
2202 (access_field_of_lvalue::make_debug_string): Likewise.
2203 (access_field_of_lvalue::write_reproducer): Likewise.
2204 (access_field_of_lvalue::get_precedence): Likewise.
2205 (access_field_rvalue::replay_into): Likewise.
2206 (access_field_rvalue::visit_children): Likewise.
2207 (access_field_rvalue::make_debug_string): Likewise.
2208 (access_field_rvalue::write_reproducer): Likewise.
2209 (access_field_rvalue::get_precedence): Likewise.
2210 (dereference_field_rvalue::replay_into): Likewise.
2211 (dereference_field_rvalue::visit_children): Likewise.
2212 (dereference_field_rvalue::make_debug_string): Likewise.
2213 (dereference_field_rvalue::write_reproducer): Likewise.
2214 (dereference_field_rvalue::get_precedence): Likewise.
2215 (dereference_rvalue::replay_into): Likewise.
2216 (dereference_rvalue::visit_children): Likewise.
2217 (dereference_rvalue::make_debug_string): Likewise.
2218 (dereference_rvalue::write_reproducer): Likewise.
2219 (dereference_rvalue::get_precedence): Likewise.
2220 (get_address_of_lvalue::replay_into): Likewise.
2221 (get_address_of_lvalue::visit_children): Likewise.
2222 (get_address_of_lvalue::make_debug_string): Likewise.
2223 (get_address_of_lvalue::write_reproducer): Likewise.
2224 (get_address_of_lvalue::get_precedence): Likewise.
2225 (local::replay_into): Likewise.
2226 (local::visit_children): Likewise.
2227 (local::write_to_dump): Likewise.
2228 (local::make_debug_string): Likewise.
2229 (local::write_reproducer): Likewise.
2230 (local::get_precedence): Likewise.
2231 (statement::write_to_dump): Likewise.
2232 (eval::replay_into): Likewise.
2233 (eval::make_debug_string): Likewise.
2234 (eval::write_reproducer): Likewise.
2235 (assignment::replay_into): Likewise.
2236 (assignment::make_debug_string): Likewise.
2237 (assignment::write_reproducer): Likewise.
2238 (assignment_op::replay_into): Likewise.
2239 (assignment_op::make_debug_string): Likewise.
2240 (assignment_op::write_reproducer): Likewise.
2241 (comment::replay_into): Likewise.
2242 (comment::make_debug_string): Likewise.
2243 (comment::write_reproducer): Likewise.
2244 (conditional::replay_into): Likewise.
2245 (conditional::get_successor_blocks): Likewise.
2246 (conditional::make_debug_string): Likewise.
2247 (conditional::write_reproducer): Likewise.
2248 (jump::replay_into): Likewise.
2249 (jump::get_successor_blocks): Likewise.
2250 (jump::make_debug_string): Likewise.
2251 (jump::write_reproducer): Likewise.
2252 (return_::replay_into): Likewise.
2253 (return_::get_successor_blocks): Likewise.
2254 (return_::make_debug_string): Likewise.
2255 (return_::write_reproducer): Likewise.
2256 (case_::replay_into): Likewise.
2257 (case_::write_reproducer): Likewise.
2258 (case_::make_debug_string): Likewise.
2259 (switch_::replay_into): Likewise.
2260 (switch_::get_successor_blocks): Likewise.
2261 (switch_::make_debug_string): Likewise.
2262 (switch_::write_reproducer): Likewise.
2264 2016-02-08 David Malcolm <dmalcolm@redhat.com>
2266 * dummy-frontend.c (jit_langhook_init): Remove
2267 second argument to build_common_tree_nodes to
2270 2016-01-23 Iain Buclaw <ibuclaw@gdcproject.org>
2272 * jit-playback.c: Include pthread.h.
2274 2016-01-19 David Malcolm <dmalcolm@redhat.com>
2277 * jit-playback.c (gcc::jit::playback::compile_to_file::postprocess):
2278 Potentially add the temporary artifact to the tempdir's list of
2279 tempfiles needing additional cleanup.
2280 (gcc::jit::playback::context::extract_any_requested_dumps): Likewise
2282 * jit-tempdir.c (gcc::jit::tempdir::~tempdir): Clean up additional
2284 * jit-tempdir.h (gcc::jit::tempdir::add_temp_file): New method.
2285 (gcc::jit::tempdir::m_tempfiles): New field.
2286 * docs/cp/intro/tutorial04.rst: Update for changes to toyvm.cc.
2287 * docs/examples/tut04-toyvm/toyvm.cc (class compilation_result):
2289 (toyvm_function::compile): Change return type from function ptr
2290 to a compilation_result.
2291 (toyvm_function::get_function_name): New accessor.
2292 (toyvm_function::m_funcname): New field.
2293 (get_function_name): Convert to...
2294 (toyvm_function::make_function_name): ...this new method.
2295 (toyvm_function::parse): Call make_function_name.
2296 (toyvm_function::compile): Convert return type from function ptr
2297 to a compilation_result. Use get_function_name.
2298 (compilation_state::compile): Convert return type from
2299 gcc_jit_result * to a compilation_result.
2300 (test_script): Update for above changes, extracting the code from
2301 the compilation_result.
2303 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2305 2016-01-04 Jakub Jelinek <jakub@redhat.com>
2307 Update copyright years.
2309 2015-11-11 Andrew MacLeod <amacleod@redhat.com>
2311 * dummy-frontend.c: Remove unused header files.
2312 * jit-builtins.c: Likewise.
2313 * jit-playback.c: Likewise.
2314 * jit-recording.c: Likewise.
2315 * jit-spec.c: Likewise.
2316 * libgccjit.c: Likewise.
2318 2015-11-07 Richard Sandiford <richard.sandiford@arm.com>
2320 * jit-builtins.c: Don't undef DEF_BUILTIN.
2322 2015-10-29 Andrew MacLeod <amacleod@redhat.com>
2324 * dummy-frontend.c: Reorder #include's and remove duplicates.
2325 * jit-builtins.c: Likewise.
2326 * jit-playback.c: Likewise.
2327 * jit-recording.c: Likewise.
2328 * libgccjit.c: Likewise.
2330 2015-10-13 Jakub Jelinek <jakub@redhat.com>
2332 * jit-builtins.c (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10,
2333 DEF_FUNCTION_TYPE_11): Define.
2334 * jit-builtins.h (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10,
2335 DEF_FUNCTION_TYPE_11): Define.
2337 2015-09-30 Thomas Schwinge <thomas@codesourcery.com>
2338 Ulrich Drepper <drepper@gmail.com>
2340 * jit-builtins.h: Undefine DEF_FUNCTION_TYPE_VAR_6 after use.
2342 2015-09-30 Matthias Klose <doko@ubuntu.com>
2344 * jit-builtins.h Define DEF_FUNCTION_TYPE_VAR_6,
2345 remove DEF_FUNCTION_TYPE_VAR_11.
2346 * jit-builtins.c (builtins_manager::make_type): Define and handle
2347 DEF_FUNCTION_TYPE_VAR_6, remove DEF_FUNCTION_TYPE_VAR_11.
2349 2015-08-25 David Malcolm <dmalcolm@redhat.com>
2351 * docs/cp/topics/contexts.rst
2352 (gccjit::context::set_bool_use_external_driver): New.
2353 * docs/internals/test-hello-world.exe.log.txt: Update.
2354 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_5): New.
2355 * docs/topics/contexts.rst
2356 (gcc_jit_context_set_bool_use_external_driver): New.
2357 * jit-common.h (enum inner_bool_option): Add
2358 INNER_BOOL_OPTION_USE_EXTERNAL_DRIVER.
2359 * jit-playback.c (gcc_driver_name): New global.
2360 (gcc:jit::playback::context::invoke_driver): Split out second
2362 (gcc::jit::playback::context::invoke_embedded_driver): ...this new
2364 (gcc::jit::playback::context::invoke_external_driver): ...this new
2367 (gcc::jit::playback::context::get_inner_bool_option): New.
2368 (gcc::jit::playback::context::invoke_embedded_driver): New.
2369 (gcc::jit::playback::context::invoke_external_driver): New.
2370 * jit-recording.c (inner_bool_option_reproducer_strings):
2371 Add entry for INNER_BOOL_OPTION_USE_EXTERNAL_DRIVER.
2373 (gccjit::context::set_bool_use_external_driver): New.
2374 * libgccjit.c (gcc_jit_context_set_bool_use_external_driver): New.
2375 * libgccjit.h (gcc_jit_context_set_bool_use_external_driver): New.
2376 (LIBGCCJIT_HAVE_gcc_jit_context_set_bool_use_external_driver):
2378 * libgccjit.map (LIBGCCJIT_ABI_5): New.
2379 * notes.txt: Show invocation of embedded copy of driver.
2380 * docs/internals/test-hello-world.exe.log.txt: Update
2382 2015-08-13 David Malcolm <dmalcolm@redhat.com>
2384 * jit-playback.c (invoke_driver): On OS X, add
2385 "-Wl,-undefined,dynamic_lookup" to the driver arguments.
2387 2015-08-03 David Malcolm <dmalcolm@redhat.com>
2389 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_4): New.
2390 * docs/topics/contexts.rst (GCC_JIT_BOOL_OPTION_DUMP_SUMMARY):
2391 We no longer show a profile.
2392 * docs/topics/index.rst (Topic Reference): Add performance.rst.
2393 * docs/topics/performance.rst: New file.
2394 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2395 * jit-playback.c (gcc::jit::playback::context::compile): Add timer
2396 param when constructing the "toplev" instance.
2397 (gcc::jit::playback::context::acquire_mutex): Add timer param when
2398 constructing auto_timevar instance.
2399 (gcc::jit::playback::context::make_fake_args): If we have a timer,
2400 add "-ftime-report".
2401 (gcc::jit::playback::context::invoke_driver): Add timer param when
2402 constructing auto_timevar instance.
2403 (gcc::jit::playback::context::dlopen_built_dso): Likewise.
2404 * jit-playback.h (gcc::jit::playback::context::get_timer): New accessor.
2405 * jit-recording.c: Include timevar.h.
2406 (gcc::jit::recording::context::context): Initialize field "m_timer".
2407 * jit-recording.h: Add forward declaration of class timer.
2408 (gcc::jit::recording::context::set_timer): New method.
2409 (gcc::jit::recording::context::get_timer): New method.
2410 (gcc::jit::recording::context::m_timer): New field.
2411 * libgccjit++.h (gccjit::timer): New class.
2412 (gccjit::auto_time): New class.
2413 (gccjit::context::set_timer): New method.
2414 (gccjit::context::get_timer): New.
2415 (gccjit::timer::timer): New.
2416 (gccjit::timer::push): New.
2417 (gccjit::timer::pop): New.
2418 (timer::print): New.
2419 (timer::get_inner_timer): New.
2420 (timer::release): New.
2421 (auto_time::auto_time): New.
2422 (auto_time::~auto_time): New.
2423 * libgccjit.c: Include timevar.h.
2424 (struct gcc_jit_timer): New.
2425 (gcc_jit_timer_new): New function.
2426 (gcc_jit_timer_release): New function.
2427 (gcc_jit_context_set_timer): New function.
2428 (gcc_jit_context_get_timer): New function.
2429 (gcc_jit_timer_push): New function.
2430 (gcc_jit_timer_pop): New function.
2431 (gcc_jit_timer_print): New function.
2432 * libgccjit.h (LIBGCCJIT_HAVE_TIMING_API): New macro.
2433 (gcc_jit_timer): New typedef.
2434 (gcc_jit_timer_new): New function.
2435 (gcc_jit_timer_release): New function.
2436 (gcc_jit_context_set_timer): New function.
2437 (gcc_jit_context_get_timer): New function.
2438 (gcc_jit_timer_push): New function.
2439 (gcc_jit_timer_pop): New function.
2440 (gcc_jit_timer_print): New function.
2441 * libgccjit.map (LIBGCCJIT_ABI_4): New.
2442 (gcc_jit_timer_new): New function.
2443 (gcc_jit_timer_release): New function.
2444 (gcc_jit_context_set_timer): New function.
2445 (gcc_jit_context_get_timer): New function.
2446 (gcc_jit_timer_push): New function.
2447 (gcc_jit_timer_pop): New function.
2448 (gcc_jit_timer_print): New function.
2450 2015-07-23 David Malcolm <dmalcolm@redhat.com>
2452 * jit-playback.c (invoke_driver): Convert local "argvec"
2453 to an auto_argvec, so that it owns copies of the strings,
2454 rather than borrows them, updating ADD_ARG to use xstrdup
2455 and special-casing the NULL terminator to avoid
2456 xstrdup (NULL). Call add_multilib_driver_arguments at the front
2458 (MULTILIB_DEFAULTS): Provide a default definition.
2459 (multilib_defaults_raw): New constant array.
2460 (gcc::jit::playback::context::add_multilib_driver_arguments): New
2463 (gcc::jit::playback::context::add_multilib_driver_arguments): New
2465 * docs/internals/test-hello-world.exe.log.txt: Update.
2466 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2468 2015-07-16 David Malcolm <dmalcolm@redhat.com>
2470 * docs/internals/index.rst (Overview of code structure): Add note
2471 that the implementation is in C++, despite the .c extension.
2472 (Submitting patches): New subsection.
2473 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2475 2015-07-09 Andrew MacLeod <amacleod@redhat.com>
2477 * dummy-frontend.c: Adjust includes for flags.h changes.
2478 * jit-common.h: Likewise.
2479 * jit-playback.c: Likewise.
2481 2015-07-08 David Malcolm <dmalcolm@redhat.com>
2484 * libgccjit.c (gcc_jit_context_new_field): Show name of field in
2485 "unknown size" error message.
2486 (gcc_jit_struct_set_fields): Show name of struct in error message.
2487 (gcc_jit_context_new_global): Show name of global in
2488 "unknown size" error message.
2489 (gcc_jit_function_new_local): Likewise for local.
2491 2015-07-07 Andrew MacLeod <amacleod@redhat.com>
2493 * dummy-frontend.c: Adjust includes.
2494 * jit-common.h: Likewise.
2495 * jit-playback.c: Likewise.
2497 2015-07-07 David Malcolm <dmalcolm@redhat.com>
2500 * jit-recording.h: Within namespace gcc:jit::recording...
2501 (type::has_known_size): New virtual function.
2502 (struct_has_known_size): New function.
2503 * libgccjit.c (gcc_jit_context_new_field): Verify that the type
2505 (gcc_jit_context_new_global): Likewise.
2506 (gcc_jit_function_new_local): Likewise.
2508 2015-07-07 David Malcolm <dmalcolm@redhat.com>
2511 * dummy-frontend.c (jit_langhook_type_for_mode): Ensure that we
2512 handle modes QI, HI, SI, DI, TI.
2514 2015-07-01 David Malcolm <dmalcolm@redhat.com>
2517 * jit-playback.c (jit_mark_addressable): New function.
2518 (gcc::jit::playback::lvalue::get_address): Call
2519 jit_mark_addressable on the underlying tree.
2521 2015-07-01 David Malcolm <dmalcolm@redhat.com>
2523 * docs/topics/types.rst (gcc_jit_context_new_union_type): Add
2525 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2527 2015-07-01 David Malcolm <dmalcolm@redhat.com>
2529 * docs/topics/contexts.rst (gcc_jit_context_set_bool_option):
2530 Clarify lack of lifetime requirements on (const char *) parameter.
2531 * docs/topics/expressions.rst
2532 (gcc_jit_context_new_string_literal): Likewise.
2533 (gcc_jit_context_new_global): Likewise.
2534 * docs/topics/functions.rst (gcc_jit_context_new_param): Likewise.
2535 (gcc_jit_context_new_function): Likewise.
2536 (gcc_jit_function_new_block): Likewise.
2537 (gcc_jit_block_add_comment): Likewise.
2538 * docs/topics/locations.rst (gcc_jit_context_new_location):
2540 * docs/topics/types.rst (gcc_jit_context_new_field): Likewise.
2541 (gcc_jit_context_new_struct_type): Likewise.
2542 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2544 2015-06-30 David Malcolm <dmalcolm@redhat.com>
2546 * docs/cp/topics/functions.rst (Blocks): Add switch statements to
2547 list of ways to terminate a block.
2548 (gccjit::block::end_with_switch): Add function description.
2549 (gccjit::case_): Add class.
2550 (gccjit::context::new_case): Add function description.
2551 * docs/cp/topics/objects.rst: Add "case_" to class hierarchy.
2552 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_3): New.
2553 * docs/topics/functions.rst (Blocks): Add switch statements to
2554 list of ways to terminate a block.
2555 (gcc_jit_block_end_with_switch): Add function description.
2556 (gcc_jit_case): Add type.
2557 (gcc_jit_context_new_case): Add function description.
2558 (gcc_jit_case_as_object): Add function description.
2559 * docs/topics/objects.rst: Add gcc_jit_case to class hierarchy.
2560 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2561 * jit-common.h (gcc::jit::recording::case_): Add forward decl.
2562 (gcc::jit::playback::case_): Add forward decl.
2563 * jit-playback.c (add_case): New function.
2564 (gcc::jit::playback::block::add_switch): New function.
2565 * jit-playback.h (gcc::jit::playback::case_): New struct.
2566 (gcc::jit::playback::block::get_function): New method.
2567 (gcc::jit::playback::block::add_switch): New method.
2568 * jit-recording.c: Within namespace gcc::jit...
2569 (recording::context::new_case): New method.
2570 (recording::function::validate): Update for change to
2571 get_successor_blocks.
2572 (recording::block::end_with_switch): New method.
2573 (recording::block::get_successor_blocks): Update to support an
2574 arbitrary number of successor blocks.
2575 (recording::block::dump_edges_to_dot): Likewise.
2576 (memento_of_new_rvalue_from_const <int>::get_wide_int): New.
2577 (memento_of_new_rvalue_from_const <long>::get_wide_int): New.
2578 (memento_of_new_rvalue_from_const <double>::get_wide_int): New.
2579 (memento_of_new_rvalue_from_const <void *>::get_wide_int): New.
2580 (recording::statement::get_successor_blocks): Update to support an
2581 arbitrary number of successor blocks.
2582 (recording::conditional::get_successor_blocks): Likewise.
2583 (recording::jump::get_successor_blocks): Likewise.
2584 (recording::return_::get_successor_blocks): Likewise.
2585 (recording::case_::write_reproducer): New.
2586 (recording::case_::make_debug_string): New.
2587 (recording::switch_::switch_): New.
2588 (recording::switch_::replay_into): New.
2589 (recording::switch_::get_successor_blocks): New.
2590 (recording::switch_::make_debug_string): New.
2591 (recording::switch_::write_reproducer): New.
2592 * jit-recording.h: Within namespace gcc::jit::recording...
2593 (context::new_case): New.
2594 (rvalue::is_constant): New.
2595 (rvalue::get_wide_int): New.
2596 (block::end_with_switch): New.
2597 (block::get_successor_blocks): Update to support an arbitrary
2598 number of successor blocks.
2599 (memento_of_new_rvalue_from_const::is_constant): New.
2600 (memento_of_new_rvalue_from_const::get_wide_int): New.
2601 (statement::get_successor_blocks): Update to support an arbitrary
2602 number of successor blocks.
2603 (conditional::get_successor_blocks): Likewise.
2604 (jump::get_successor_blocks): Likewise.
2605 (return_::get_successor_blocks): Likewise.
2606 (case_): New subclass of memento.
2607 (switch_): New subclass of statement.
2608 * libgccjit++.h (gccjit::case_): New subclass of gccjit::object.
2609 (gccjit::context::new_case): New method.
2610 (gccjit::block::end_with_switch): New method.
2611 (gccjit::case_::case): New ctors.
2612 (gccjit::case_::get_inner_case): New method.
2613 * libgccjit.c: Include "typed-splay-tree.h"
2614 (struct gcc_jit_case): New.
2615 (gcc_jit_context_new_case): New function.
2616 (gcc_jit_case_as_object): New function.
2617 (valid_dest_for_switch): New function.
2618 (valid_case_for_switch): New function.
2619 (class api_call_validator): New class.
2620 (class case_range_validator): New class.
2621 (case_range_validator::case_range_validator): New.
2622 (case_range_validator::validate): New.
2623 (case_range_validator::case_compare): New.
2624 (case_range_validator::get_wide_int): new.
2625 (gcc_jit_block_end_with_switch): New.
2626 * libgccjit.h: Add gcc_jit_case to class hierarchy comment.
2627 (gcc_jit_case): New typedef.
2628 (gcc_jit_context_new_case): New function.
2629 (gcc_jit_case_as_object): New function.
2630 (gcc_jit_block_end_with_switch): New function.
2631 (LIBGCCJIT_HAVE_SWITCH_STATEMENTS): New.
2632 * libgccjit.map: Add gcc_jit_block_end_with_switch,
2633 gcc_jit_case_as_object and gcc_jit_context_new_case.
2635 2015-06-30 David Malcolm <dmalcolm@redhat.com>
2638 * docs/cp/topics/contexts.rst
2639 (gccjit::context::set_bool_allow_unreachable_blocks): New.
2640 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_2): New.
2641 * docs/topics/contexts.rst (Options): Add notes discussing the
2642 transition from enums to entrypoints for new options.
2643 (gcc_jit_context_set_bool_allow_unreachable_blocks): New.
2644 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2645 * jit-common.h (gcc::jit::inner_bool_option): New enum.
2646 * jit-recording.c: Within namespace gcc::jit...
2647 (recording::context::context): Handle m_inner_bool_options.
2648 (recording::context::set_inner_bool_option): New.
2649 (inner_bool_option_reproducer_strings): New.
2650 (recording::context::log_all_options): Log the "inner" bool
2652 (recording::context::log_inner_bool_option): New.
2653 (recording::context::dump_reproducer_to_file): Write initializers
2654 for "inner" bool options.
2655 (recording::function::validate): Don't check for block
2656 reachability if INNER_BOOL_OPTION_ALLOW_UNREACHABLE_BLOCKS is set.
2657 * jit-recording.h: Within namespace gcc::jit...
2658 (recording::context::set_inner_bool_option): New.
2659 (recording::context::get_inner_bool_option): New.
2660 (recording::context::log_inner_bool_option): New.
2661 (recording::context::m_inner_bool_options): New.
2663 (gccjit::context::set_bool_allow_unreachable_blocks): New.
2665 (gcc_jit_context_set_bool_allow_unreachable_blocks): New.
2666 * libgccjit.h: Add note about options present in the
2667 initial release of libgccjit.
2668 (gcc_jit_context_set_bool_allow_unreachable_blocks): New API
2670 (LIBGCCJIT_HAVE_gcc_jit_context_set_bool_allow_unreachable_blocks):
2672 * libgccjit.map (LIBGCCJIT_ABI_2): New, containing...
2673 (gcc_jit_context_set_bool_allow_unreachable_blocks): ...this new
2676 2015-06-30 David Malcolm <dmalcolm@redhat.com>
2679 * docs/cp/topics/contexts.rst (Additional command-line options):
2681 * docs/topics/compatibility.rst: New file.
2682 * docs/topics/contexts.rst (Additional command-line options): New
2684 * docs/topics/index.rst: Add compatibility.rst.
2685 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2686 * jit-playback.c (make_fake_args): Add call to
2687 append_command_line_options.
2688 * jit-recording.c: Within namespace gcc::jit...
2689 (recording::context::~context): Free the optnames within
2690 m_command_line_options.
2691 (recording::context::set_bool_option): Likewise.
2692 (recording::context::add_command_line_option): New method.
2693 (recording::context::append_command_line_options): New method.
2694 (recording::context::dump_reproducer_to_file): Add command-line
2696 * jit-recording.h: Within namespace gcc::jit...
2697 (recording::context::add_command_line_option): New method.
2698 (recording::context::append_command_line_options): New method.
2699 (recording::context::m_command_line_options): New field.
2700 * libgccjit++.h (gccjit::context::add_command_line_option): New
2702 * libgccjit.c (gcc_jit_context_add_command_line_option): New API
2704 * libgccjit.h (gcc_jit_context_add_command_line_option): New API
2706 (LIBGCCJIT_HAVE_gcc_jit_context_add_command_line_option): New
2708 * libgccjit.map: Put existing symbols within LIBGCCJIT_ABI_0; add
2709 LIBGCCJIT_ABI_1 and gcc_jit_context_add_command_line_option.
2711 2015-06-30 David Malcolm <dmalcolm@redhat.com>
2714 (gcc::jit::recording::context::dump_reproducer_to_file):
2715 Add pragma to generated reproducers to disable -Wunused-variable.
2716 Fix handling of NULL string options.
2718 2015-06-30 David Malcolm <dmalcolm@redhat.com>
2720 * docs/cp/topics/expressions.rst: Remove stray semicolon.
2721 * docs/cp/topics/functions.rst: Remove stray backslash.
2722 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2724 2015-06-25 Andrew MacLeod <amacleod@redhat.com>
2726 * dummy-frontend.c: Remove ipa-ref.h and plugin-api.h from include list.
2727 * jit-playback.c: Likewise.
2729 2015-06-25 Andrew Macleod <amacleod@redhat.com>
2731 * jit-common.h: Don't include alias.h.
2733 2015-06-17 David Malcolm <dmalcolm@redhat.com>
2735 * libgccjit.c (gcc_jit_lvalue_access_field): Verify that the field
2736 is for the correct struct.
2737 (gcc_jit_rvalue_access_field): Likewise.
2739 2015-06-17 Andrew MacLeod <amacleod@redhat.com>
2741 * dummy-frontend.c: Do not include input.h, line-map.h or is-a.h.
2742 * jit-common.h: Likewise.
2743 * jit-playback.c: Likewise.
2745 2015-06-16 David Malcolm <dmalcolm@redhat.com>
2748 * jit-recording.c: Within namespace gcc::jit::recording::
2749 (rvalue::get_debug_string_parens): New function.
2750 (binary_op::make_debug_string): Update to mimic C precedence
2752 (binary_op_precedence): New array.
2753 (binary_op::get_precedence): New function.
2754 (comparison::make_debug_string): Update to mimic C precedence
2756 (comparison_precedence): New array.
2757 (comparison::get_precedence): New function.
2758 (cast::make_debug_string): Update to mimic C precedence rules.
2759 (call::make_debug_string): Likewise.
2760 (call_through_ptr::make_debug_string): Likewise.
2761 (array_access::make_debug_string): Likewise.
2762 (access_field_of_lvalue::make_debug_string): Likewise.
2763 (access_field_rvalue::make_debug_string): Likewise.
2764 (dereference_field_rvalue::make_debug_string): Likewise.
2765 (dereference_rvalue::make_debug_string): Likewise.
2766 (get_address_of_lvalue::make_debug_string): Likewise.
2767 * jit-recording.h: Within namespace gcc::jit::recording::
2768 (precedence): New enum.
2769 (rvalue::rvalue): Initialize field "m_parenthesized_string".
2770 (rvalue::get_debug_string_parens): New method.
2771 (rvalue::get_precedence): New pure virtual function.
2772 (rvalue::m_parenthesized_string): New field.
2773 (param::get_precedence): New function.
2774 (global::get_precedence): New function.
2775 (memento_of_new_rvalue_from_const::get_precedence): New function.
2776 (memento_of_new_string_literal::get_precedence): New function.
2777 (unary_op::get_precedence): New function.
2778 (binary_op::get_precedence): New function.
2779 (comparison::get_precedence): New function.
2780 (cast::get_precedence): New function.
2781 (call::get_precedence): New function.
2782 (call_through_ptr::get_precedence): New function.
2783 (array_access::get_precedence): New function.
2784 (access_field_of_lvalue::get_precedence): New function.
2785 (access_field_rvalue::get_precedence): New function.
2786 (dereference_field_rvalue::get_precedence): New function.
2787 (dereference_rvalue::get_precedence): New function.
2788 (get_address_of_lvalue::get_precedence): New function.
2789 (local::get_precedence): New function.
2791 2015-06-09 Matthias Klose <doko@ubuntu.com>
2793 * Make-lang.in (jit.install-common): Install headers using INSTALL_DATA.
2795 2015-06-08 Andrew MacLeod <amacleod@redhat.com>
2797 * dummy-frontend.c : Adjust include files.
2798 * jit-common.h : Likewise.
2799 * jit-playback.c : Likewise.
2801 2015-06-05 David Malcolm <dmalcolm@redhat.com>
2804 (jit_langhook_post_compilation_parsing_cleanups): Remove.
2805 (LANG_HOOKS_POST_COMPILATION_PARSING_CLEANUPS): Remove
2806 * jit-playback.c (gcc::jit::playback::context::new_global): Add
2807 call to varpool_node::finalize_decl.
2808 (gcc::jit::playback::context::finalize_global_decls): Remove.
2810 (gcc::jit::playback::context::finalize_global_decls): Remove.
2812 2015-06-05 David Malcolm <dmalcolm@redhat.com>
2814 * dummy-frontend.c (jit_langhook_write_globals): Rename to...
2815 (jit_langhook_post_compilation_parsing_cleanups): ...this, and
2816 eliminate calls to finalize_compilation_unit and
2817 write_global_decls_2.
2818 (LANG_HOOKS_WRITE_GLOBALS): Rename to...
2819 (LANG_HOOKS_POST_COMPILATION_PARSING_CLEANUPS): ...this and
2820 redirect from jit_langhook_write_globals to
2821 jit_langhook_post_compilation_parsing_cleanups.
2823 (gcc::jit::playback::context::write_global_decls_1): Rename to...
2824 (gcc::jit::playback::context::finalize_global_decls): ...this.
2825 (gcc::jit::playback::context::write_global_decls_1): Delete.
2827 (gcc::jit::playback::context::write_global_decls_1): Rename to...
2828 (gcc::jit::playback::context::finalize_global_decls): ...this.
2829 (gcc::jit::playback::context::write_global_decls_1): Delete.
2831 2015-06-04 Andrew MacLeod <amacleod@redhat.com>
2833 * dummy-frontend.c: Adjust includes for restructured coretypes.h.
2834 * jit-common.h: Likewise.
2835 * jit-playback.c: Likewise.
2837 2015-05-12 David Malcolm <dmalcolm@redhat.com>
2839 * jit-builtins.c: Include vec.h before target.h.
2841 2015-04-27 Jim Wilson <jim.wilson@linaro.org>
2843 * Make-lang.in (jit.mostlyclean): Remove shared libraries and object
2846 2015-04-09 David Malcolm <dmalcolm@redhat.com>
2849 * docs/cp/topics/expressions.rst (Simple expressions): Fix copy
2850 and paste error in description of gccjit::context::one.
2851 * docs/topics/expressions.rst (Simple expressions): Likewise in
2852 description of gcc_jit_context_one.
2853 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2855 2015-03-13 Uros Bizjak <ubizjak@gmail.com>
2857 * jit-recording.c (dump::write): Also check vasprintf return value.
2858 (recording::context::add_error_va): Ditto.
2859 (recording::string::from_printf): Ditto.
2861 2015-03-13 David Malcolm <dmalcolm@redhat.com>
2863 * docs/internals/index.rst (Packaging notes): New section.
2864 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2866 2015-03-05 David Malcolm <dmalcolm@redhat.com>
2868 * docs/cp/intro/tutorial03.rst: Add missing arguments to
2869 gccjit::block::end_with_conditional call. Add on_true/on_false
2870 comments. Tweak the wording.
2871 * docs/intro/tutorial03.rst: Add missing arguments to
2872 gcc_jit_block_end_with_conditional call. Add some clarifying
2874 * docs/topics/compilation.rst: Tweak the wording to avoid an
2875 ambiguous use of "this".
2876 * docs/topics/contexts.rst: Fix a typo.
2877 * docs/topics/expressions.rst (GCC_JIT_BINARY_OP_MINUS): Remove
2879 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2881 2015-02-24 Thomas Schwinge <thomas@codesourcery.com>
2884 * jit-builtins.c (DEF_FUNCTION_TYPE_VAR_8)
2885 (DEF_FUNCTION_TYPE_VAR_12): Remove macros.
2886 (DEF_FUNCTION_TYPE_VAR_7, DEF_FUNCTION_TYPE_VAR_11): New macros.
2887 * jit-builtins.h (DEF_FUNCTION_TYPE_VAR_8)
2888 (DEF_FUNCTION_TYPE_VAR_12): Remove macros.
2889 (DEF_FUNCTION_TYPE_VAR_7, DEF_FUNCTION_TYPE_VAR_11): New macros.
2891 2015-02-04 David Malcolm <dmalcolm@redhat.com>
2894 * docs/conf.py (html_theme): Change from 'pyramid'
2897 2015-02-04 David Malcolm <dmalcolm@redhat.com>
2899 * docs/topics/contexts.rst (gcc_jit_context_acquire): Fix
2901 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2903 2015-02-03 David Malcolm <dmalcolm@redhat.com>
2905 * jit-logging.h (gcc::jit::log_user::log): Make const.
2906 * jit-recording.c (gcc::jit::recording::context::set_str_option):
2907 Log the new value of the option.
2908 (gcc::jit::recording::context::set_int_option): Likewise.
2909 (gcc::jit::recording::context::set_bool_option): Likewise.
2910 (gcc::jit::recording::context::compile): Log the value of all
2912 (gcc::jit::recording::context::compile_to_file): Likewise.
2913 (gcc::jit::recording::context::log_all_options): New function.
2914 (gcc::jit::recording::context::log_str_option): New function.
2915 (gcc::jit::recording::context::log_int_option): New function.
2916 (gcc::jit::recording::context::log_bool_option): New function.
2917 * jit-recording.h (gcc::jit::recording::context::log_all_options):
2919 (gcc::jit::recording::context::log_str_option): New function.
2920 (gcc::jit::recording::context::log_int_option): New function.
2921 (gcc::jit::recording::context::log_bool_option): New function.
2922 * docs/internals/test-hello-world.exe.log.txt: Update for above
2924 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2926 2015-02-03 David Malcolm <dmalcolm@redhat.com>
2929 * Make-lang.in (jit_OBJS): Add jit/jit-spec.o and gcc.o.
2930 (LIBGCCJIT_FILENAME): Add EXTRA_GCC_OBJS.
2931 * jit-playback.c: Include gcc.h.
2932 (gcc::jit::playback::context::compile): Move mutex acquisition
2933 to before the call to make_fake_args.
2934 (append_arg_from_driver): New function.
2935 (gcc::jit::playback::context::make_fake_args): On the first call,
2936 call into driver_get_configure_time_options to get configure-time
2937 default options and cache them. Add them to the args for
2939 * jit-spec.c: New source file.
2940 * docs/internals/test-hello-world.exe.log.txt: Update to reflect
2942 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2944 2015-02-02 David Malcolm <dmalcolm@redhat.com>
2947 * dummy-frontend.c (jit_langhook_type_for_mode): Support
2948 TYPE_MODE (long_long_integer_type_node).
2950 2015-01-27 David Malcolm <dmalcolm@redhat.com>
2952 * docs/internals/test-hello-world.exe.log.txt: Add example version
2954 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2955 * jit-common.h (gcc::jit::dump::get_file): New accessor.
2956 * jit-logging.c: Include toplev.h.
2957 (gcc::jit::logger::logger): Log the GCC version.
2958 * jit-recording.c: Include toplev.h.
2959 (gcc:jit::recording::context::dump_reproducer_to_file): Log the
2962 2015-01-26 David Malcolm <dmalcolm@redhat.com>
2964 * docs/topics/compilation.rst (gcc_jit_result_get_code): Fix typo.
2965 * docs/topics/contexts.rst (gcc_jit_context_get_last_error): The
2966 error buffer is only valid until the next call to the context.
2967 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2968 * libgccjit.h (gcc_jit_context_get_first_error): Reword the
2969 comment to omit mention of compiling.
2970 (gcc_jit_context_get_last_error): The error buffer is only valid
2971 until the next call to the context.
2973 2015-01-26 David Malcolm <dmalcolm@redhat.com>
2976 * config-lang.in (compilers): Drop "libgccjit.so".
2978 2015-01-23 David Malcolm <dmalcolm@redhat.com>
2981 * jit-playback.c (gcc::jit::playback::context::compile): Construct
2982 toplev instances with init_signals=false.
2984 2015-01-19 David Malcolm <dmalcolm@redhat.com>
2986 * docs/cp/topics/results.rst: Rename to...
2987 * docs/cp/topics/compilation.rst: ...this, and add section on
2988 ahead-of-time compilation.
2989 * docs/cp/topics/index.rst: Update for renaming of results.rst
2991 * docs/examples/emit-alphabet.bf: New file, a sample "brainf"
2993 * docs/examples/tut05-bf.c: New file, implementing a compiler
2995 * docs/internals/test-hello-world.exe.log.txt: Update to reflect
2996 changes to logger output.
2997 * docs/intro/index.rst: Add tutorial05.rst
2998 * docs/intro/tutorial05.rst: New file.
2999 * docs/topics/results.rst: Rename to...
3000 * docs/topics/compilation.rst: ...this, and add section on
3001 ahead-of-time compilation.
3002 * docs/topics/index.rst: Update for renaming of results.rst to
3004 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3005 * jit-playback.c (gcc::jit::playback::context::compile): Convert
3006 return type from result * to void. Move the code to convert to
3007 dso and dlopen the result to a new pure virtual "postprocess"
3009 (gcc::jit::playback::compile_to_memory::compile_to_memory): New
3011 (gcc::jit::playback::compile_to_memory::postprocess): New
3012 function, based on playback::context::compile.
3013 (gcc::jit::playback::compile_to_file::compile_to_file): New
3015 (gcc::jit::playback::compile_to_file::postprocess): New function.
3016 (gcc::jit::playback::compile_to_file::copy_file): New function.
3017 (gcc::jit::playback::context::convert_to_dso): Move internals
3019 (gcc::jit::playback::context::invoke_driver): New method. Add
3020 "-shared" and "-c" options to driver's argv as needed.
3021 * jit-playback.h: Include "timevar.h".
3022 (gcc::jit::playback::context::compile): Convert return type from
3024 (gcc::jit::playback::context::postprocess): New pure virtual
3025 function, making this an abstract base class.
3026 (gcc::jit::playback::context::get_tempdir): New accessor.
3027 (gcc::jit::playback::context::invoke_driver): New function.
3028 (class gcc::jit::playback::compile_to_memory): New subclass of
3030 (class gcc::jit::playback::compile_to_file): Likewise.
3031 * jit-recording.c (gcc::jit::recording::context::compile): Use a
3032 playback::compile_to_memory, and extract its result.
3033 (gcc::jit::recording::context::compile_to_file): New function.
3034 * jit-recording.h (gcc::jit::recording::context::compile_to_file):
3036 * libgccjit++.h (gccjit::context::compile_to_file): New method.
3037 * libgccjit.c (gcc_jit_context_compile): Update log message to
3038 clarify that this is an in-memory compile.
3039 (gcc_jit_context_compile_to_file): New function.
3040 * libgccjit.h (gcc_jit_context): Clarify that you can compile
3041 a context more than once, and that you can compile to a file
3042 as well as to memory.
3043 (gcc_jit_result): Clarify that this is the result of an
3044 in-memory compilation.
3045 (gcc_jit_context_compile): Clarify that you can compile, and that
3046 this is an in-memory compilation.
3047 (enum gcc_jit_output_kind): New enum.
3048 (gcc_jit_context_compile_to_file): New function.
3049 (gcc_jit_context_enable_dump): Clarify comment to cover both forms
3051 * libgccjit.map (gcc_jit_context_compile_to_file): New API
3053 * notes.txt: Update to show the playback::context::postprocess
3056 2015-01-19 David Malcolm <dmalcolm@redhat.com>
3059 (gcc::jit::recording::memento_of_new_string_literal::make_debug_string):
3060 Add missing format string.
3062 2015-01-16 David Malcolm <dmalcolm@redhat.com>
3064 * Make-lang.in (lang_checks_parallelized): Add "check-jit".
3065 (check_jit_parallelize): Set this to an arbitrary value (10).
3067 2015-01-16 Jakub Jelinek <jakub@redhat.com>
3069 * jit-builtins.h (DEF_FUNCTION_TYPE_VAR_5): Fix spelling of
3071 (DEF_FUNCTION_TYPE_VAR_8, DEF_FUNCTION_TYPE_VAR_12): Define and
3073 * jit-builtins.c (DEF_FUNCTION_TYPE_VAR_8, DEF_FUNCTION_TYPE_VAR_12):
3076 2015-01-15 Richard Sandiford <richard.sandiford@arm.com>
3078 Update copyright years in docs/.
3080 2015-01-15 David Malcolm <dmalcolm@redhat.com>
3082 * libgccjit.c (gcc_jit_block_add_assignment_op): Check that the
3083 lvalue and the rvalue are of compatible type.
3085 2015-01-13 David Malcolm <dmalcolm@redhat.com>
3087 * docs/cp/topics/contexts.rst (Debugging): Add
3088 gccjit::context::dump_reproducer_to_file.
3089 * docs/internals/index.rst (Design notes): New section,
3090 discussing input validation and
3091 gcc_jit_context_dump_reproducer_to_file.
3092 * docs/topics/contexts.rst (Debugging): Add
3093 gcc_jit_context_dump_reproducer_to_file.
3094 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3095 * jit-common.h (gcc::jit::dump::get_context): New accessor.
3096 * jit-recording.c: Include "hash-map.h".
3097 Within namespace ::gcc::jit...
3098 (dump::write): Flush each line.
3099 (dump::make_location): Pass false for new param "created_by_user".
3100 (class allocator): New class.
3101 (allocator::~allocator): New function.
3102 (allocator::xstrdup_printf): New function.
3103 (allocator::xstrdup_printf_va): New function.
3104 (class reproducer): New subclass of dump.
3105 (reproducer::reproducer): New function.
3106 (reproducer::write_params): New function.
3107 (reproducer::write_args): New function.
3108 (reproducer::make_identifier): New function.
3109 (reproducer::make_tmp_identifier): New function.
3110 (reproducer::get_identifier): New pair of functions.
3111 (reproducer::get_identifier_as_rvalue): New function.
3112 (reproducer::get_identifier_as_lvalue): New function.
3113 (reproducer::get_identifier_as_type): New function.
3114 (reproducer::xstrdup_printf): New function.
3115 (recording::context::context): Initialize m_toplevel_ctxt.
3116 (recording::context::new_location): Add param created_by_user.
3117 (str_option_reproducer_strings): New table of strings.
3118 (int_option_reproducer_strings): Likewise.
3119 (bool_option_reproducer_strings): Likewise.
3120 (get_type_enum_strings): Likewise.
3121 (names_of_function_kinds): Likewise.
3122 (global_kind_reproducer_strings): Likewise.
3123 (unary_op_reproducer_strings): Likewise.
3124 (binary_op_reproducer_strings): Likewise.
3125 (comparison_reproducer_strings): Likewise.
3126 Within namespace ::gcc::jit::recording::...
3127 (context::dump_reproducer_to_file): New function.
3128 (string::write_reproducer): Likewise.
3129 (location::write_reproducer): Likewise.
3130 (type::access_as_type): Likewise.
3131 (memento_of_get_type::write_reproducer): Likewise.
3132 (memento_of_get_pointer::write_reproducer): Likewise.
3133 (memento_of_get_const::write_reproducer): Likewise.
3134 (memento_of_get_volatile::write_reproducer): Likewise.
3135 (array_type::write_reproducer): Likewise.
3136 (function_type::write_reproducer): Likewise.
3137 (function_type::write_deferred_reproducer): Likewise.
3138 (field::write_reproducer): Likewise.
3139 (struct_::access_as_type): Likewise.
3140 (struct_::write_reproducer): Likewise.
3141 (union_::write_reproducer): Likewise.
3142 (fields::write_reproducer): Likewise.
3143 (rvalue::access_as_rvalue): Likewise.
3144 (lvalue::access_as_rvalue): Likewise.
3145 (lvalue::access_as_lvalue): Likewise.
3146 (param::access_as_rvalue): Likewise.
3147 (param::access_as_lvalue): Likewise.
3148 (param::write_reproducer): Likewise.
3149 (function::write_reproducer): Likewise.
3150 (block::write_reproducer): Likewise.
3151 (global::write_reproducer): Likewise.
3152 (memento_of_new_rvalue_from_const <int>::write_reproducer):
3154 (memento_of_new_rvalue_from_const <long>::write_reproducer):
3156 (memento_of_new_rvalue_from_const <double>::write_reproducer):
3158 (memento_of_new_rvalue_from_const <void *>::write_reproducer):
3160 (memento_of_new_string_literal::write_reproducer): Likewise.
3161 (unary_op::write_reproducer): Likewise.
3162 (binary_op::write_reproducer): Likewise.
3163 (comparison::write_reproducer): Likewise.
3164 (cast::write_reproducer): Likewise.
3165 (call::write_reproducer): Likewise.
3166 (call_through_ptr::write_reproducer): Likewise.
3167 (array_access::write_reproducer): Likewise.
3168 (access_field_of_lvalue::write_reproducer): Likewise.
3169 (access_field_rvalue::write_reproducer): Likewise.
3170 (dereference_field_rvalue::write_reproducer): Likewise.
3171 (dereference_rvalue::write_reproducer): Likewise.
3172 (get_address_of_lvalue::write_reproducer): Likewise.
3173 (local::write_reproducer): Likewise.
3174 (eval::write_reproducer): Likewise.
3175 (assignment::write_reproducer): Likewise.
3176 (assignment_op::write_reproducer): Likewise.
3177 (comment::write_reproducer): Likewise.
3178 (conditional::write_reproducer): Likewise.
3179 (jump::write_reproducer): Likewise.
3180 (return_::write_reproducer): Likewise.
3181 * jit-recording.h (gcc::jit::reproducer): New forward declararion.
3182 Within namespace ::gcc::jit::recording::...
3183 (context::new_location): Add "created_by_user" param.
3184 (context::dump_reproducer_to_file): New method.
3185 (context::m_toplevel_ctxt): New field.
3186 (memento::write_reproducer): New pure virtual function.
3187 (memento::dyn_cast_location): New virtual function.
3188 (string::write_reproducer):
3189 (location::location): Add "created_by_user" param.
3190 (location::dyn_cast_location): New function.
3191 (location::created_by_user): New accessor.
3192 (location::write_reproducer): New function.
3193 (location::m_created_by_user): New field.
3194 (type::access_as_type): New virtual function.
3195 (location::write_reproducer): Likewise.
3196 (type::access_as_type): Likewise.
3197 (memento_of_get_type::write_reproducer): Likewise.
3198 (memento_of_get_pointer::write_reproducer): Likewise.
3199 (memento_of_get_const::write_reproducer): Likewise.
3200 (memento_of_get_volatile::write_reproducer): Likewise.
3201 (array_type::write_reproducer): Likewise.
3202 (function_type::write_reproducer): Likewise.
3203 (function_type::write_deferred_reproducer): Likewise.
3204 (field::write_reproducer): Likewise.
3205 (struct_::access_as_type): Likewise.
3206 (struct_::write_reproducer): Likewise.
3207 (union_::write_reproducer): Likewise.
3208 (union_::m_fields): Remove stray unused field.
3209 (fields::length): New accessor.
3210 (fields::get_field): New accessor.
3211 (fields::write_reproducer): New function.
3212 (rvalue::access_as_rvalue): Likewise.
3213 (lvalue::access_as_rvalue): Likewise.
3214 (lvalue::access_as_lvalue): Likewise.
3215 (param::access_as_rvalue): Likewise.
3216 (param::access_as_lvalue): Likewise.
3217 (param::write_reproducer): Likewise.
3218 (function::write_reproducer): Likewise.
3219 (block::write_reproducer): Likewise.
3220 (global::write_reproducer): Likewise.
3221 (memento_of_new_rvalue_from_const <HOST_TYPE>::write_reproducer):
3223 (memento_of_new_string_literal::write_reproducer): Likewise.
3224 (unary_op::write_reproducer): Likewise.
3225 (binary_op::write_reproducer): Likewise.
3226 (comparison::write_reproducer): Likewise.
3227 (cast::write_reproducer): Likewise.
3228 (call::write_reproducer): Likewise.
3229 (call_through_ptr::write_reproducer): Likewise.
3230 (array_access::write_reproducer): Likewise.
3231 (access_field_of_lvalue::write_reproducer): Likewise.
3232 (access_field_rvalue::write_reproducer): Likewise.
3233 (dereference_field_rvalue::write_reproducer): Likewise.
3234 (dereference_rvalue::write_reproducer): Likewise.
3235 (get_address_of_lvalue::write_reproducer): Likewise.
3236 (local::write_reproducer): Likewise.
3237 (eval::write_reproducer): Likewise.
3238 (assignment::write_reproducer): Likewise.
3239 (assignment_op::write_reproducer): Likewise.
3240 (comment::write_reproducer): Likewise.
3241 (conditional::write_reproducer): Likewise.
3242 (jump::write_reproducer): Likewise.
3243 (return_::write_reproducer): Likewise.
3244 * libgccjit++.h (gccjit::context::dump_reproducer_to_file): New.
3245 * libgccjit.c (gcc_jit_context_new_location): Pass "true" as
3246 param "created_by_user".
3247 (gcc_jit_context_dump_reproducer_to_file): New API entrypoint.
3248 * libgccjit.h (gcc_jit_context_dump_reproducer_to_file): New API
3250 * libgccjit.map (gcc_jit_context_dump_reproducer_to_file): New API
3253 2015-01-12 David Malcolm <dmalcolm@redhat.com>
3255 * jit-recording.c (class gcc::jit::rvalue_usage_validator): New.
3256 (gcc::jit::rvalue_usage_validator::rvalue_usage_validator): New
3258 (gcc::jit::rvalue_usage_validator::visit): New function.
3259 (gcc::jit::recording::rvalue::verify_valid_within_stmt): New
3261 (gcc::jit::recording::rvalue::set_scope): New function.
3262 (gcc::jit::recording::function::function): Call set_scope on each
3263 param, issuing errors for any params that already have a function.
3264 (gcc::jit::recording::block::add_eval): Return the new statement;
3265 update the comment given that some error-checking now happens after
3267 (gcc::jit::recording::block::add_assignment): Likewise.
3268 (gcc::jit::recording::block::add_assignment_op): Likewise.
3269 (gcc::jit::recording::block::add_comment): Likewise.
3270 (gcc::jit::recording::block::end_with_conditional): Likewise.
3271 (gcc::jit::recording::block::end_with_jump): Likewise.
3272 (gcc::jit::recording::block::end_with_return): Likewise.
3273 (gcc::jit::recording::block::validate): Add a comment.
3274 (gcc::jit::recording::unary_op::visit_children): New function.
3275 (gcc::jit::recording::binary_op::visit_children): New function.
3276 (gcc::jit::recording::comparison::visit_children): New function.
3277 (gcc::jit::recording::cast::visit_children): New function.
3278 (gcc::jit::recording::call::visit_children): New function.
3279 (gcc::jit::recording::call_through_ptr::visit_children): New function.
3280 (gcc::jit::recording::array_access::visit_children): New function.
3281 (gcc::jit::recording::access_field_of_lvalue::visit_children): New
3283 (gcc::jit::recording::access_field_rvalue::visit_children): New
3285 (gcc::jit::recording::dereference_field_rvalue::visit_children):
3287 (gcc::jit::recording::dereference_rvalue::visit_children): New
3289 (gcc::jit::recording::get_address_of_lvalue::visit_children): New
3291 * jit-recording.h: Within namespace gcc::jit::recording...
3292 (class rvalue_visitor): New.
3293 (rvalue::rvalue): Initialize m_scope.
3294 (rvalue::get_loc): New accessor.
3295 (rvalue::verify_valid_within_stmt): New function.
3296 (rvalue::visit_children): New pure virtual function.
3297 (rvalue::set_scope): New function.
3298 (rvalue::get_scope): New function.
3299 (rvalue::dyn_cast_param): New function.
3300 (rvalue::m_scope): New field.
3301 (param::visit_children): New empty function.
3302 (param::dyn_cast_param): New function.
3303 (function::get_loc): New function.
3304 (block::add_eval): Return the new statement.
3305 (block::add_assignment): Likewise.
3306 (block::add_assignment_op): Likewise.
3307 (block::add_comment): Likewise.
3308 (block::end_with_conditional): Likewise.
3309 (block::end_with_jump): Likewise.
3310 (block::end_with_return): Likewise.
3311 (global::visit_children): New function.
3312 (memento_of_new_rvalue_from_const<HOST_TYPE>::visit_children):
3314 (memento_of_new_string_literal::visit_children): New function.
3315 (unary_op::visit_children): New function.
3316 (binary_op::visit_children): New function.
3317 (comparison::visit_children): New function.
3318 (cast::visit_children): New function.
3319 (call::visit_children): New function.
3320 (call_through_ptr::visit_children): New function.
3321 (array_access::visit_children): New function.
3322 (access_field_of_lvalue::visit_children): New function.
3323 (access_field_rvalue::visit_children): New function.
3324 (dereference_field_rvalue::visit_children): New function.
3325 (dereference_rvalue::visit_children): New function.
3326 (get_address_of_lvalue::visit_children): New function.
3327 (local::local): Call set_scope.
3328 (local::visit_children): New function.
3329 (statement::get_block): Make public.
3330 * libgccjit.c (RETURN_VAL_IF_FAIL_PRINTF5): New macro.
3331 (RETURN_NULL_IF_FAIL_PRINTF5): New macro.
3332 (gcc_jit_context_new_function): Verify that each param has
3333 not yet been used for creating another function.
3334 (gcc_jit_block_add_eval): After creating the stmt, verify
3335 that the rvalue expression tree is valid to use within it.
3336 (gcc_jit_block_add_assignment): Likewise for the lvalue and
3337 rvalue expression trees.
3338 (gcc_jit_block_add_assignment_op): Likewise.
3339 (gcc_jit_block_end_with_conditional): Likewise for the boolval
3341 (gcc_jit_block_end_with_return): Likewise for the rvalue
3343 (gcc_jit_block_end_with_void_return): Remove return of "void",
3344 now that block::end_with_return is now non-void.
3346 2015-01-12 David Malcolm <dmalcolm@redhat.com>
3348 * jit-playback.c (gcc::jit::playback::context::read_dump_file):
3349 Add missing fclose on error-handling path.
3351 2015-01-12 David Malcolm <dmalcolm@redhat.com>
3353 * docs/cp/topics/expressions.rst (Global variables): Add
3354 enum gcc_jit_global_kind param to gccjit::context::new_global.
3355 * docs/topics/expressions.rst (Global variables): Likewise.
3356 Document the new enum.
3357 * docs/topics/results.rst (Compilation results): Document
3359 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3360 * dummy-frontend.c (jit_langhook_write_globals): Call into the
3361 playback context's write_global_decls_1 and write_global_decls_2
3362 before and after calling symtab->finalize_compilation_unit ().
3363 * jit-playback.c: Include "debug.h".
3364 (gcc::jit::playback::context::new_global): Add "kind" param and
3365 use it to set TREE_PUBLIC, TREE_STATIC and DECL_EXTERNAL on the
3366 underlying VAR_DECL. Call varpool_node::get_create on the
3367 VAR_DECL, and add it to m_globals.
3368 (gcc::jit::playback::context::write_global_decls_1): New function.
3369 (gcc::jit::playback::context::write_global_decls_2): New function.
3370 * jit-playback.h (gcc::jit::playback::context::context): Call
3371 create on m_globals.
3372 (gcc::jit::playback::context::new_global): Add "kind" param.
3373 (gcc::jit::playback::context::write_global_decls_1): New function.
3374 (gcc::jit::playback::context::write_global_decls_2): New function.
3375 (gcc::jit::playback::context::m_globals): New field.
3376 * jit-recording.c (gcc::jit::recording::context::context):
3377 Initialize m_globals.
3378 (gcc::jit::recording::context::new_global): Add param "kind".
3379 Add the new global to m_globals.
3380 (gcc::jit::recording::context::dump_to_file): Dump the globals.
3381 (gcc::jit::recording::global::replay_into): Add field m_kind.
3382 (gcc::jit::recording::global::write_to_dump): New override.
3383 * jit-recording.h (gcc::jit::recording::context::new_global): Add
3385 (gcc::jit::recording::context::m_globals): New field.
3386 (gcc::jit::recording::global::global): Add param kind.
3387 (gcc::jit::recording::global::write_to_dump): New override.
3388 (gcc::jit::recording::global::m_kind): New field.
3389 * jit-result.c (gcc::jit::result::get_global): New function.
3390 * jit-result.h (gcc::jit::result::get_global): New function.
3391 * libgccjit++.h (gccjit::context::new_global): Add "kind" param.
3392 * libgccjit.c (gcc_jit_context_new_global): Likewise.
3393 (gcc_jit_result_get_global): New API entrypoint.
3394 * libgccjit.h (gcc_jit_result_get_global): New API entrypoint.
3395 (enum gcc_jit_global_kind): New enum.
3396 (gcc_jit_context_new_global): API change: add "kind" param.
3397 * libgccjit.map (gcc_jit_result_get_global): New symbol.
3399 2015-01-09 David Malcolm <dmalcolm@redhat.com>
3401 * dummy-frontend.c: Include "fixed-value.h", "alias.h", "flags.h",
3402 "symtab.h", "inchash.h". Move include of "hash-set.h" much
3404 * jit-builtins.c: Remove redundant includes of "opts.h" and
3406 * jit-common.h: Include "hash-set.h", "input.h", "vec.h",
3407 "double-int.h", "alias.h", "flags.h", "symtab.h", "inchash.h".
3408 * jit-playback.c: Include "hashtab.h", "machmode.h", "input.h",
3409 "statistics.h", "vec.h", "double-int.h", "real.h",
3410 "fixed-value.h", "alias.h", "flags.h", "symtab.h", "tree-core.h",
3411 "inchash.h", "fold-const.h". Move include of "hash-set.h" to
3413 * jit-recording.c: Remove redundant includes of "opts.h" and
3416 2015-01-09 David Malcolm <dmalcolm@redhat.com>
3418 * docs/cp/topics/expressions.rst (Simple expressions): Use
3419 ":c:type:" for C types. Document new overload of
3420 gcc::jit::context::new_rvalue.
3421 * docs/topics/expressions.rst (Simple expressions): Use
3422 ":c:type:" for C types. Document new entrypoint
3423 gcc_jit_context_new_rvalue_from_long.
3424 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3425 * jit-playback.c: Within namespace gcc::jit::playback...
3426 (context::new_rvalue_from_int): Eliminate in favor of...
3427 (context::new_rvalue_from_const <int>): ...this.
3428 (context::new_rvalue_from_double): Eliminate in favor of...
3429 (context::new_rvalue_from_const <double>): ...this.
3430 (context::new_rvalue_from_const <long>): New.
3431 (context::new_rvalue_from_ptr): Eliminate in favor of...
3432 (context::new_rvalue_from_const <void *>): ...this.
3433 * jit-playback.h: Within namespace gcc::jit::playback...
3434 (context::new_rvalue_from_int): Eliminate in favor of...
3435 (context::new_rvalue_from_const <HOST_TYPE>): ...this.
3436 (context::new_rvalue_from_double): Likewise.
3437 (context::new_rvalue_from_ptr): Likewise.
3438 * jit-recording.c: Within namespace gcc::jit::recording...
3439 (context::new_rvalue_from_int): Eliminate.
3440 (context::new_rvalue_from_double): Likewise.
3441 (context::new_rvalue_from_ptr): Likewise.
3442 (class memento_of_new_rvalue_from_const <int>):
3443 Add explicit specialization.
3444 (class memento_of_new_rvalue_from_const <long>):
3446 (class memento_of_new_rvalue_from_const <double>):
3448 (class memento_of_new_rvalue_from_const <void *>):
3450 (memento_of_new_rvalue_from_int::replay_into):
3452 (memento_of_new_rvalue_from_const <HOST_TYPE>::replay_into):
3454 (memento_of_new_rvalue_from_double::replay_into):
3456 (memento_of_new_rvalue_from_ptr::replay_into):
3457 ...and this to be deleted.
3458 (memento_of_new_rvalue_from_int::make_debug_string):
3460 (memento_of_new_rvalue_from_const <int>::make_debug_string):
3462 (memento_of_new_rvalue_from_double::make_debug_string):
3464 (memento_of_new_rvalue_from_const <double>::make_debug_string):
3466 (memento_of_new_rvalue_from_ptr::make_debug_string)
3468 (memento_of_new_rvalue_from_const <void *>::make_debug_string):
3470 (memento_of_new_rvalue_from_const <long>::make_debug_string):
3472 * jit-recording.h: Within namespace gcc::jit::recording...
3473 (context::new_rvalue_from_int): Eliminate.
3474 (context::new_rvalue_from_double): Likewise.
3475 (context::new_rvalue_from_ptr): Likewise, all in favor of...
3476 (context::new_rvalue_from_const <HOST_TYPE>): New family of
3478 (class memento_of_new_rvalue_from_int): Eliminate.
3479 (class memento_of_new_rvalue_from_double): Likewise.
3480 (class memento_of_new_rvalue_from_ptr): Likewise.
3481 (class memento_of_new_rvalue_from_const <HOST_TYPE>): New family
3482 of rvalue subclasses.
3483 * libgccjit++.h (gccjit::context::new_rvalue): New overload, for
3485 * libgccjit.c (gcc_jit_context_new_rvalue_from_int): Update for
3486 rewriting of recording::context::new_rvalue_from_int to
3487 recording::context::new_rvalue_from_const <int>.
3488 (gcc_jit_context_new_rvalue_from_long): New API entrypoint.
3489 (gcc_jit_context_new_rvalue_from_double): Update for
3490 rewriting of recording::context::new_rvalue_from_double to
3491 recording::context::new_rvalue_from_const <double>.
3492 (gcc_jit_context_new_rvalue_from_ptr): Update for
3493 rewriting of recording::context::new_rvalue_from_ptr to
3494 recording::context::new_rvalue_from_const <void *>.
3495 * libgccjit.h (gcc_jit_context_new_rvalue_from_long): New API
3497 * libgccjit.map (gcc_jit_context_new_rvalue_from_long): Likewise.
3499 2015-01-09 David Malcolm <dmalcolm@redhat.com>
3502 * docs/internals/test-hello-world.exe.log.txt: Update, the log now
3503 shows tempdir creation/cleanup.
3504 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3505 * jit-logging.h (class gcc::jit::log_user): Add gcc::jit::tempdir
3506 to the list of subclasses in the comment.
3507 * jit-playback.c (gcc::jit::playback::context::context): Add a
3508 comment clarifying when the tempdir gets cleaned up.
3509 (gcc::jit::playback::context::compile): Pass the context's logger,
3510 if any, to the tempdir.
3511 (gcc::jit::playback::context::dlopen_built_dso): When creating the
3512 gcc::jit::result, if GCC_JIT_BOOL_OPTION_DEBUGINFO is set, hand
3513 over ownership of the tempdir to it.
3514 * jit-result.c: Include "jit-tempdir.h".
3515 (gcc::jit::result::result): Add tempdir param, saving it as
3517 (gcc::jit::result::~result): Delete m_tempdir.
3518 * jit-result.h (gcc::jit::result::result): Add tempdir param.
3519 (gcc::jit::result::m_tempdir): New field.
3520 * jit-tempdir.c (gcc::jit::tempdir::tempdir): Add logger param;
3522 (gcc::jit::tempdir::create): Add JIT_LOG_SCOPE to log entry/exit,
3523 and log m_path_template and m_path_tempdir.
3524 (gcc::jit::tempdir::~tempdir): Add JIT_LOG_SCOPE to log
3525 entry/exit, and log the unlink and rmdir calls.
3526 * jit-tempdir.h: Include "jit-logging.h".
3527 (class gcc::jit::tempdir): Make this be a subclass of log_user.
3528 (gcc::jit::tempdir::tempdir): Add logger param.
3529 * notes.txt: Update to show the two possible places where the
3530 tempdir can be cleaned up.
3532 2015-01-08 David Malcolm <dmalcolm@redhat.com>
3534 * libgccjit.h (struct gcc_jit_context): Rewrite the descriptive
3537 2015-01-08 David Malcolm <dmalcolm@redhat.com>
3539 * docs/topics/contexts.rst (Error-handling): Document new
3540 entrypoint gcc_jit_context_get_last_error.
3541 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3542 * jit-recording.c (gcc::jit::recording::context::context):
3543 Initialize new fields "m_last_error_str" and
3544 "m_owns_last_error_str".
3545 (gcc::jit::recording::context::~context): Clean up
3546 m_last_error_str, if needed.
3547 (gcc::jit::recording::context::add_error_va): Update
3548 m_last_error_str and m_owns_last_error_str, freeing the old
3549 value if appropriate.
3550 (gcc::jit::recording::context::get_last_error): New function.
3551 * jit-recording.h (gcc::jit::recording::context::get_last_error):
3553 (gcc::jit::recording::context): New fields m_last_error_str and
3554 m_owns_last_error_str.
3555 * libgccjit.c (gcc_jit_context_get_last_error): New function.
3556 * libgccjit.h (gcc_jit_context_get_last_error): New declaration.
3557 * libgccjit.map (gcc_jit_context_get_last_error): New function.
3559 2015-01-08 David Malcolm <dmalcolm@redhat.com>
3561 * Make-lang.in (jit_OBJS): Add jit/jit-logging.o.
3562 * docs/internals/index.rst (Overview of code structure): Mention
3563 gcc_jit_context_set_logfile, and embed the example logfile.
3564 * docs/internals/test-hello-world.exe.log.txt: New file: example
3566 * docs/topics/contexts.rst (Debugging): Add documentation
3567 for gcc_jit_context_set_logfile.
3568 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3569 * dummy-frontend.c: Include "jit-logging.h".
3570 (jit_langhook_init): Assert that there is an active playback
3571 context. If it has a logger, log entry/exit to this function.
3572 (jit_langhook_write_globals): Likewise.
3573 * jit-common.h (gcc::jit::logger): New forward declaration.
3574 * jit-logging.c: New file.
3575 * jit-logging.h: New file.
3576 * jit-playback.c: Include "jit-logging.h".
3577 (gcc::jit::playback::context::context): Initialize the log_user
3578 base class from the recording context's logger (if any). Use
3579 JIT_LOG_SCOPE to log entry/exit from the function body.
3580 (gcc::jit::playback::context::~context): Use JIT_LOG_SCOPE to
3581 log entry/exit from the function body.
3582 (gcc::jit::playback::build_stmt_list): Likewise.
3583 (gcc::jit::playback::function::postprocess): Likewise.
3584 (gcc::jit::playback::context::compile): Likewise. Log the
3585 entry/exit to toplev::main and toplev::finalize. Log the
3586 fake argv passed to toplev::main.
3587 (gcc::jit::playback::context::acquire_mutex): Use JIT_LOG_SCOPE to
3588 log entry/exit from the function body.
3589 (gcc::jit::playback::context::release_mutex): Likewise.
3590 (gcc::jit::playback::context::make_fake_args): Likewise.
3591 (gcc::jit::playback::context::extract_any_requested_dumps):
3593 (gcc::jit::playback::context::convert_to_dso): Likewise. Also,
3594 log the arguments that the driver is invoked with.
3595 (gcc::jit::playback::context::dlopen_built_dso): Likewise. Pass
3596 the logger to the result object.
3597 (gcc::jit::playback::context::replay): Use JIT_LOG_SCOPE to
3598 log entry/exit from the function body.
3599 (gcc::jit::playback::context::dump_generated_code): Likewise.
3600 (gcc::jit::playback::context::handle_locations): Likewise.
3601 * jit-playback.h (gcc::jit::playback::context): Make this be
3602 a subclass of gcc::jit::log_user.
3603 * jit-recording.c: Include "jit-logging.h".
3604 (gcc::jit::recording::context::context: Initialize the logger to
3605 NULL for root contexts, or to the parent's logger for child
3607 (gcc::jit::recording::context::~context): Use JIT_LOG_SCOPE to
3608 log entry/exit from the function body.
3609 (gcc::jit::recording::context::replay_into): Likewise.
3610 (gcc::jit::recording::context::disassociate_from_playback):
3612 (gcc::jit::recording::context::compile): Likewise.
3613 (recording::context::add_error_va): Likewise. Also, log the
3615 (gcc::jit::recording::context::validate): Use JIT_LOG_SCOPE to
3616 log entry/exit from the function body.
3617 * jit-recording.h: Include "jit-logging.h".
3618 (gcc::jit::recording::context): Make this be a subclass of
3620 * jit-result.c: Include "jit-common.h" and "jit-logging.h".
3621 (gcc::jit::result::result): Add logger param, recording it.
3622 Use JIT_LOG_SCOPE to log entry/exit from the function body.
3623 (gcc::jit::result::~result(): Use JIT_LOG_SCOPE to
3624 log entry/exit from the function body.
3625 (gcc::jit::result::get_code): Likewise.
3626 * jit-result.h (gcc::jit::result): Make this be a subclass of
3628 (gcc::jit::result::result): Add logger parameter.
3629 * libgccjit++.h (gccjit::context::set_logfile): New function.
3630 * libgccjit.c: Include "jit-logging.h".
3631 (gcc_jit_context_acquire): Log the context.
3632 (gcc_jit_context_release): Use JIT_LOG_FUNC to
3633 log entry/exit from the function body, and log the context.
3634 (gcc_jit_context_new_child_context): Likewise, logging both
3636 (gcc_jit_context_new_location): Use JIT_LOG_FUNC to
3637 log entry/exit from the function body.
3638 (gcc_jit_context_get_type): Likewise.
3639 (gcc_jit_context_get_int_type): Likewise.
3640 (gcc_jit_context_new_array_type): Likewise.
3641 (gcc_jit_context_new_field): Likewise.
3642 (gcc_jit_context_new_struct_type): Likewise.
3643 (gcc_jit_context_new_opaque_struct): Likewise.
3644 (gcc_jit_struct_set_fields): Likewise.
3645 (gcc_jit_context_new_union_type): Likewise.
3646 (gcc_jit_context_new_function_ptr_type): Likewise.
3647 (gcc_jit_context_new_param): Likewise.
3648 (gcc_jit_context_new_function): Likewise.
3649 (gcc_jit_context_get_builtin_function): Likewise.
3650 (gcc_jit_function_get_param): Likewise.
3651 (gcc_jit_function_dump_to_dot): Likewise.
3652 (gcc_jit_function_new_block): Likewise.
3653 (gcc_jit_context_new_global): Likewise.
3654 (gcc_jit_context_new_rvalue_from_int): Likewise.
3655 (gcc_jit_context_zero): Likewise.
3656 (gcc_jit_context_one): Likewise.
3657 (gcc_jit_context_new_rvalue_from_double): Likewise.
3658 (gcc_jit_context_new_rvalue_from_ptr): Likewise.
3659 (gcc_jit_context_null): Likewise.
3660 (gcc_jit_context_new_string_literal): Likewise.
3661 (gcc_jit_context_new_unary_op): Likewise.
3662 (gcc_jit_context_new_binary_op): Likewise.
3663 (gcc_jit_context_new_comparison): Likewise.
3664 (gcc_jit_context_new_call): Likewise.
3665 (gcc_jit_context_new_call_through_ptr): Likewise.
3666 (gcc_jit_context_new_cast): Likewise.
3667 (gcc_jit_context_new_array_access): Likewise.
3668 (gcc_jit_lvalue_access_field): Likewise.
3669 (gcc_jit_rvalue_access_field): Likewise.
3670 (gcc_jit_rvalue_dereference_field): Likewise.
3671 (gcc_jit_rvalue_dereference): Likewise.
3672 (gcc_jit_lvalue_get_address): Likewise.
3673 (gcc_jit_function_new_local): Likewise.
3674 (gcc_jit_block_add_eval): Likewise.
3675 (gcc_jit_block_add_assignment): Likewise.
3676 (gcc_jit_block_add_assignment_op): Likewise.
3677 (gcc_jit_block_end_with_conditional): Likewise.
3678 (gcc_jit_block_add_comment): Likewise.
3679 (gcc_jit_block_end_with_jump): Likewise.
3680 (gcc_jit_block_end_with_return): Likewise.
3681 (gcc_jit_block_end_with_void_return): Likewise.
3682 (gcc_jit_context_set_str_option): Likewise.
3683 (gcc_jit_context_set_int_option): Likewise.
3684 (gcc_jit_context_set_bool_option): Likewise.
3685 (gcc_jit_context_enable_dump): Likewise.
3686 (gcc_jit_context_compile): Likewise. Also log the context,
3688 (gcc_jit_context_dump_to_file): Likewise.
3689 (gcc_jit_context_set_logfile): New function.
3690 (gcc_jit_context_get_first_error): Use JIT_LOG_FUNC to
3691 log entry/exit from the function body.
3692 (gcc_jit_result_get_code): Likewise. Also log the fnname)
3693 and the ptr to be returned.
3694 (gcc_jit_result_release): Likewise. Also log the result.
3695 * libgccjit.h: Include <stdio.h>, since we need FILE *.
3696 (gcc_jit_context_set_logfile): New declaration.
3697 * libgccjit.map (gcc_jit_context_set_logfile): New.
3699 2015-01-07 David Malcolm <dmalcolm@redhat.com>
3701 * jit-recording.h (gcc::jit::recording::type::is_void): New
3703 (gcc::jit::recording::memento_of_get_type::is_void): New
3704 function, overriding default implementation.
3705 * libgccjit.c (gcc_jit_rvalue_dereference): Verify that
3706 the underlying type is not "void".
3708 2015-01-07 David Malcolm <dmalcolm@redhat.com>
3710 * docs/topics/expressions.rst (Unary Operations): Add
3711 GCC_JIT_UNARY_OP_ABS.
3712 * jit-playback.c (gcc::jit::playback::context::new_unary_op):
3714 * jit-recording.c (unary_op_strings): Likewise.
3715 * libgccjit.c (gcc_jit_context_new_unary_op): Update checking
3716 of "op" to reflect addition of GCC_JIT_UNARY_OP_ABS.
3717 * libgccjit.h (enum gcc_jit_unary_op): Add GCC_JIT_UNARY_OP_ABS.
3718 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3720 2015-01-07 David Malcolm <dmalcolm@redhat.com>
3722 * jit-recording.h (gcc::jit::recording::memento_of_get_type): Fix
3725 2015-01-07 David Malcolm <dmalcolm@redhat.com>
3727 * TODO.rst (Test suite): Remove item about running C++ testcases.
3728 * docs/internals/index.rst (Working on the JIT library): Add
3729 "c++" to the enabled languages in the suggested "configure"
3730 invocation, and add a description of why this is necessary.
3731 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3733 2015-01-07 David Malcolm <dmalcolm@redhat.com>
3735 * docs/internals/index.rst: Update to reflect that built
3736 testcases are now test-foo.c.exe, rather than test-foo.exe.
3737 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3739 2015-01-05 Jakub Jelinek <jakub@redhat.com>
3741 Update copyright years.
3743 2014-12-19 David Malcolm <dmalcolm@redhat.com>
3745 * jit-playback.c (gcc::jit::playback::context::build_cast): In
3746 case BOOLEAN_TYPE, don't assume that the source expression is
3749 2014-12-19 David Malcolm <dmalcolm@redhat.com>
3751 * jit-recording.c (gcc::jit::recording::context::context): When
3752 copying string options from a parent context, take a copy of the
3753 underlying buffers, rather than simply copying the pointer.
3755 2014-12-19 David Malcolm <dmalcolm@redhat.com>
3757 * jit-recording.c (gcc::jit::recording::context::set_str_option):
3760 2014-12-11 David Malcolm <dmalcolm@redhat.com>
3762 * docs/cp/topics/contexts.rst (gccjit::context::set_str_option):
3763 Document new function.
3764 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3766 2014-12-10 Ulrich Drepper <drepper@gmail.com>
3768 Minor interface cleanups of libgccjit
3769 * jit-playback.c (convert_to_dso): Use auto_vec instead
3770 of automatic array to build up command line.
3771 * jit-recording.c (recording::context::set_str_option):
3772 Make copy of the string.
3773 (recording::context::~context): Free string options.
3774 * jit-recording.h (recording::context): Adjust type
3775 of m_str_options member.
3776 * libgccjit.h: Adjust comment about
3777 gcc_jit_context_set_str_option parameter being used after
3779 Update comment now that all interfaces are copy strings
3781 * libgccjit++.h (gccjit::context): Add set_str_option
3784 2014-12-10 David Malcolm <dmalcolm@redhat.com>
3786 * docs/cp/index.rst: New file.
3787 * docs/cp/intro/index.rst: New file.
3788 * docs/cp/intro/tutorial01.rst: New file.
3789 * docs/cp/intro/tutorial02.rst: New file.
3790 * docs/cp/intro/tutorial03.rst: New file.
3791 * docs/cp/intro/tutorial04.rst: New file.
3792 * docs/cp/topics/contexts.rst: New file.
3793 * docs/cp/topics/expressions.rst: New file.
3794 * docs/cp/topics/functions.rst: New file.
3795 * docs/cp/topics/index.rst: New file.
3796 * docs/cp/topics/locations.rst: New file.
3797 * docs/cp/topics/objects.rst: New file.
3798 * docs/cp/topics/results.rst: New file.
3799 * docs/cp/topics/types.rst: New file.
3800 * docs/examples/tut01-hello-world.cc: New file.
3801 * docs/examples/tut02-square.c: Fix missing newline in output.
3802 * docs/examples/tut02-square.cc: New file.
3803 * docs/examples/tut03-sum-of-squares.cc: New file.
3804 * docs/examples/tut04-toyvm/toyvm.cc: New file.
3805 * docs/index.rst: Move summary to above the table of contents.
3806 Add text about the C vs C++ APIs.
3807 * docs/topics/contexts.rst: Fix a typo.
3809 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3810 * docs/_build/texinfo/factorial1.png: New file.
3811 * docs/_build/texinfo/sum-of-squares1.png: New file.
3813 2014-12-09 David Malcolm <dmalcolm@redhat.com>
3815 * docs/examples/tut04-toyvm/toyvm.c (toyvm_function_compile): Move
3816 logic for determine "funcname" to new function...
3817 (get_function_name): ...here, adding logic to skip any leading
3818 path from the filename.
3819 (toyvm_function_parse): Use the filename for fn_filename, rather
3820 than "name", so that the debugger can locate the source .toy
3822 (toyvm_function_parse): Don't fclose a NULL FILE *.
3824 2014-12-09 David Malcolm <dmalcolm@redhat.com>
3827 * docs/internals/index.rst (Running under valgrind): New
3829 (docs/_build/texinfo/libgccjit.texi): Regenerate.
3831 2014-12-09 David Malcolm <dmalcolm@redhat.com>
3834 * Make-lang.in (jit_OBJS): Add jit/jit-tempdir.o.
3835 * jit-common.h (gcc::jit::tempdir): New forward decl.
3836 * jit-playback.c: Include jit-tempdir.h.
3837 (gcc::jit::playback::context::context): Initialize m_tempdir.
3838 (gcc::jit::playback::context::~context): Move tempdir
3839 cleanup to new file jit-tempdir.c
3840 (make_tempdir_path_template): Move to new file jit-tempdir.c.
3841 (gcc::jit::playback::context::compile): Move tempdir creation
3842 to new tempdir object in new file jit-tempdir.c.
3843 (gcc::jit::playback::context::make_fake_args): Get path from
3844 tempdir object rather than from member data.
3845 (gcc::jit::playback::context::convert_to_dso): Likewise.
3846 (gcc::jit::playback::context::dlopen_built_dso): Likewise.
3847 (gcc::jit::playback::context::dump_generated_code): Likewise.
3848 (gcc::jit::playback::context::get_path_c_file): New function.
3849 (gcc::jit::playback::context::get_path_s_file): New function.
3850 (gcc::jit::playback::context::get_path_so_file): New function.
3851 * jit-playback.h (gcc::jit::playback::context::get_path_c_file):
3853 (gcc::jit::playback::context::get_path_s_file): New function.
3854 (gcc::jit::playback::context::get_path_so_file): New function.
3855 (gcc::jit::playback::context): Move fields "m_path_template",
3856 "m_path_tempdir", "m_path_c_file", "m_path_s_file",
3857 "m_path_so_file" to new jit::tempdir class; add field "m_tempdir".
3858 * jit-tempdir.c: New file.
3859 * jit-tempdir.h: New file.
3861 2014-12-09 David Malcolm <dmalcolm@redhat.com>
3863 * jit-playback.c (gcc::jit::playback::context::compile): Acquire the
3864 mutex here, immediately before using toplev, and release it here, on
3865 each exit path after acquisition.
3866 (jit_mutex): Move this variable here, from jit-recording.c.
3867 (gcc::jit::playback::context::acquire_mutex): New function, based on
3868 code in jit-recording.c.
3869 (gcc::jit::playback::context::release_mutex): Likewise.
3870 * jit-playback.h (gcc::jit::playback::context::acquire_mutex): New
3872 (gcc::jit::playback::context::release_mutex): New function.
3873 * jit-recording.c (jit_mutex): Move this variable to jit-playback.c.
3874 (gcc::jit::recording::context::compile): Move mutex-handling from
3875 here into jit-playback.c's gcc::jit::playback::context::compile.
3876 * notes.txt: Update to show the new locations of ACQUIRE_MUTEX
3879 2014-12-09 David Malcolm <dmalcolm@redhat.com>
3881 * jit-playback.c (gcc::jit::playback::context::compile): Move the
3883 (gcc::jit::playback::context::dlopen_built_dso): ...this new
3885 * jit-playback.h (gcc::jit::playback::context::dlopen_built_dso):
3888 2014-12-09 David Malcolm <dmalcolm@redhat.com>
3891 * docs/topics/contexts.rst (Debugging): Add description of
3892 gcc_jit_context_enable_dump.
3893 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3894 * jit-playback.c: Include context.h.
3895 (class auto_argvec): New class.
3896 (auto_argvec::~auto_argvec): New function.
3897 (gcc::jit::playback::context::compile): Convert fake_args to be
3898 an auto_argvec, so that it can contain dynamically-allocated
3899 strings. Construct a vec of all requested dumps, and pass it to
3900 make_fake_args. Extract requested dumps between the calls to
3901 toplev::main and toplev::finalize.
3902 (gcc::jit::playback::context::make_fake_args): Convert param
3903 "argvec" to be a vec <char *>, and gain a "requested_dumps"
3904 param. Convert to dynamically-allocated arg strings by converting
3905 ADD_ARG to take a copy of the arg, and add ADD_ARG_TAKE_OWNERSHIP
3906 for args that are already a copy. Add args for all requested dumps.
3907 (gcc::jit::playback::context::extract_any_requested_dumps): New
3909 (gcc::jit::playback::context::read_dump_file): New function.
3910 * jit-playback.h (gcc::jit::playback::context::make_fake_args):
3911 Convert param "argvec" to be a vec <char *>, and gain a
3912 "requested_dumps" param.
3913 (gcc::jit::playback::context::extract_any_requested_dumps): New
3915 (gcc::jit::playback::context::read_dump_file): New function.
3916 * jit-recording.c (gcc::jit::recording::context::enable_dump): New
3918 (gcc::jit::recording::context::get_all_requested_dumps): New
3920 * jit-recording.h (gcc::jit::recording::requested_dump): New
3922 (gcc::jit::recording::context::enable_dump): New function.
3923 (gcc::jit::recording::context::get_all_requested_dumps): New
3925 (gcc::jit::recording::context::m_requested_dumps): New field.
3926 * libgccjit.c (gcc_jit_context_enable_dump): New API entrypoint.
3927 * libgccjit.h (gcc_jit_context_enable_dump): New API entrypoint.
3928 * libgccjit.map (gcc_jit_context_enable_dump): New API entrypoint.
3930 2014-12-08 David Malcolm <dmalcolm@redhat.com>
3932 * libgccjit++.h: Indent the forward declarations of the classes to
3933 show the inheritance hierarchy.
3935 2014-12-08 David Malcolm <dmalcolm@redhat.com>
3937 * notes.txt: Show the beginning and ending of
3938 recording::context::compile vs playback::context::compile. Show
3939 the creation and unlinking of the tempdir. Show toplev::finalize.
3940 Move "RELEASE MUTEX" to the correct location. Show
3941 gcc_jit_result_release, and indicate where the
3942 dlopen/dlsym/dlclose occur.
3944 2014-12-01 David Malcolm <dmalcolm@redhat.com>
3946 * docs/examples/tut02-square.c (main): Release the context
3947 earlier, to show that this is possible. Update error-handling
3948 to avoid a double-release of the context, and to avoid
3949 releasing a NULL result.
3950 * docs/intro/tutorial02.rst: Discuss gcc_jit_context_release.
3951 * docs/topics/functions.rst (GCC_JIT_FUNCTION_EXPORTED): Emphasize
3952 * docs/topics/results.rst (gcc_jit_result): Mention that this
3953 controls the lifetimes of machine code functions.
3954 (gcc_jit_result_get_code): Spell out the requirements for this
3955 to succeed, and the lifetime of the result.
3956 (gcc_jit_result_release): Mention that this invalidates any code
3957 that was obtained from the result.
3958 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3960 2014-12-01 David Malcolm <dmalcolm@redhat.com>
3963 * docs/intro/tutorial02.rst: Spell out lifetime of generated code.
3964 Add description of error-handling, taken in part from...
3965 * docs/topics/contexts.rst (Error-handling): Expand, and move some
3966 content to tutorial02.rst.
3967 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3969 2014-12-01 David Malcolm <dmalcolm@redhat.com>
3972 * docs/topics/types.rst (Standard types) Add new enum values to
3973 the table of enum gcc_jit_types: GCC_JIT_TYPE_COMPLEX_FLOAT,
3974 GCC_JIT_TYPE_COMPLEX_DOUBLE, GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE.
3975 Widen the left-hand column so that
3976 GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE will fit.
3977 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3979 * jit-builtins.c: Include stringpool.h and jit-playback.h.
3980 Move everything out of the gcc::jit::recording namespace into
3982 (struct builtin_data): Add fields "fnclass", "attr", and
3984 (DEF_BUILTIN): Update macro so populate the new fields.
3985 (builtins_manager::builtins_manager): Update for move out of
3986 recording namespace. Initialize the m_attributes array.
3987 (builtins_manager::get_builtin_function): Likewise.
3988 (builtins_manager::get_builtin_function_by_id): New function.
3989 (builtins_manager::make_builtin_function): Update for move out of
3990 recording namespace. Add fix for PR jit/64020 by detecting
3991 specific builtin ids and having them ensure that builtins for
3992 other ids are created as necessary.
3993 (builtins_manager::get_type): Update for move out of recording
3995 (builtins_manager::make_type): Likewise. Add some missing
3997 (builtins_manager::make_primitive_type): Update for move out of
3998 recording namespace. Implement the three BT_COMPLEX_ cases and
4000 (builtins_manager::make_fn_type): Update for move out of recording
4002 (builtins_manager::make_ptr_type): Likewise.
4003 (builtins_manager::finish_playback): New function.
4004 (builtins_manager::get_class): New function.
4005 (builtins_manager::implicit_p): New function.
4006 (builtins_manager::get_attrs_tree): Two new functions.
4007 (builtins_manager::make_attrs_tree): New function.
4009 * jit-builtins.h: Move everything out of the gcc::jit::recording
4010 namespace into just gcc::jit.
4011 (enum built_in_attribute): New.
4012 (builtins_manager::builtins_manager): Update decl for namespace
4014 (builtins_manager::get_builtin_function): Likewise.
4015 (builtins_manager::get_class): New.
4016 (builtins_manager::implicit_p): New.
4017 (builtins_manager::get_attrs_tree): Two new functions.
4018 (builtins_manager::make_attrs_tree): New function.
4019 (builtins_manager::finish_playback): New.
4020 (builtins_manager::get_builtin_function_by_id): New.
4021 (builtins_manager::make_builtin_function): Update decl for
4023 (builtins_manager::get_type): Likewise.
4024 (builtins_manager::make_type): Likewise.
4025 (builtins_manager::make_primitive_type): Likewise.
4026 (builtins_manager::make_fn_type): Likewise.
4027 (builtins_manager::make_ptr_type): Likewise.
4028 (builtins_manager): Likewise for fields. Add new field
4031 * jit-common.h (NUM_GCC_JIT_TYPES): Update.
4032 (builtins_manager): Update forward decl to reflect namespace
4035 * jit-playback.c: Include attribs.h and jit-builtins.h.
4036 (gcc::jit::playback::context::get_tree_node_for_type): Add cases
4037 for the new COMPLEX_ types.
4038 (gcc::jit::playback::context::new_function): If creating a
4039 builtin, set the DECL_BUILT_IN_CLASS and attributes on the fndecl,
4040 and call set_builtin_decl.
4041 (gcc::jit::playback::context::replay): If we have a
4042 builtins_manager, call its finish_playback method when we're done.
4045 (gcc::jit::playback::context::get_builtins_manager): New function.
4048 (gcc::jit::recording::context::get_builtins_manager): New function.
4049 (gcc::jit::recording::get_builtin_function): Use
4050 get_builtins_manager, in case we're a child context.
4051 (gcc::jit::recording::memento_of_get_type::dereference): Add the
4053 (gcc::jit::recording::memento_of_get_type::is_int): Likewise.
4054 (gcc::jit::recording::memento_of_get_type::is_float): Likewise.
4055 (gcc::jit::recording::memento_of_get_type::is_bool): Likewise.
4056 (get_type_strings): Likewise.
4059 (gcc::jit::recording::context::get_builtins_manager): New.
4061 * libgccjit.h (enum gcc_jit_types): Add
4062 GCC_JIT_TYPE_COMPLEX_FLOAT, GCC_JIT_TYPE_COMPLEX_DOUBLE,
4063 GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE.
4065 2014-12-01 David Malcolm <dmalcolm@redhat.com>
4068 (gcc::jit::recording::builtins_manager::get_builtin_function):
4069 Check for NULL return from make_builtin_function.
4070 (gcc::jit::recording::builtins_manager::make_builtin_function):
4071 Check for NULL return from get_type.
4073 2014-12-01 David Malcolm <dmalcolm@redhat.com>
4075 * jit-playback.c (gcc::jit::playback::context::compile): Move DSO
4076 creation code into...
4077 (gcc::jit::playback::context::convert_to_dso): New function.
4078 * jit-playback.h (gcc::jit::playback::context::convert_to_dso):
4081 2014-12-01 David Malcolm <dmalcolm@redhat.com>
4083 * jit-playback.c (gcc::jit::playback::context::compile): Use an
4084 auto_vec<const char *> rather than a const char *[20] for the
4085 top-level argv, and move the logic to build it to...
4086 (gcc::jit::playback::context::make_fake_args): New function.
4087 * jit-playback.h (gcc::jit::playback::context::make_fake_args):
4090 2014-12-01 David Malcolm <dmalcolm@redhat.com>
4092 * Make-lang.in (jit_OBJS): Add jit/jit-result.o.
4093 * jit-playback.c: Include new header jit-result.h.
4094 (gcc::jit::result::result): Move to new file jit-result.c.
4095 (gcc::jit::result::~result): Likewise.
4096 (gcc::jit::playback::result): Likewise.
4097 * jit-recording.h (class gcc::jit::result): Move to new
4098 header jit-result.h.
4099 * jit-result.c: New file, to contain...
4100 (gcc::jit::result::result): Move here from jit-playback.c,
4101 removing erroneous "playback" namespace from comment.
4102 (gcc::jit::result::~result): Likewise.
4103 (gcc::jit::playback::result): Likewise.
4104 * jit-result.h: New file, to contain...
4105 (class gcc::jit::result): Move from jit-recording.h.
4106 * libgccjit.c: Include jit-result.h.
4107 (gcc_jit_result_get_code): Update comment to reflect move
4109 (gcc_jit_result_release): Likewise.
4111 2014-12-01 David Malcolm <dmalcolm@redhat.com>
4114 * docs/examples/tut04-toyvm/toyvm.c
4115 (toyvm_compiled_function): New typedef.
4116 (toyvm_compiled_func) Rename to...
4117 (toyvm_compiled_code) ...this.
4118 (struct toyvm_compiled_function): New struct.
4119 (toyvm_function_compile): Return a toyvm_compiled_function *
4120 rather than a toyvm_compiled_func, so that the caller can fully
4121 clean things up. Free "funcname".
4122 (test_script): Update for change to toyvm_function_compile.
4123 Clean up the toyvm_compiled_function.
4125 (docs/intro/tutorial04.rst): Update to reflect the above changes,
4126 and to better spell out the lifetime of the compiled code.
4128 2014-12-01 David Malcolm <dmalcolm@redhat.com>
4132 (gcc::jit::recording::builtins_manager::make_fn_type): Call the
4133 context's new_function_type method, rather than directly creating
4134 a function_type instance.
4136 (gcc::jit::recording::context::new_function_type): New method,
4137 adapted from part of...
4138 (gcc::jit::recording::context::new_function_ptr_type): ...this.
4139 Update to call new_function_type.
4141 (gcc::jit::recording::context::new_function_type): New method.
4143 2014-12-01 David Malcolm <dmalcolm@redhat.com>
4146 * jit-playback.c: Ensure that ctxt_progname is non-NULL.
4148 2014-11-19 David Malcolm <dmalcolm@redhat.com>
4151 * jit-playback.c (gcc::jit::playback::compound_type::set_fields):
4152 Convert param from const vec<playback::field *> & to
4153 const auto_vec<playback::field *> *.
4154 (gcc::jit::playback::context::new_function_type): Convert param
4155 "param_types" from vec<type *> * to const auto_vec<type *> *.
4156 (gcc::jit::playback::context::new_function): Convert param
4157 "params" from vec<param *> * to const auto_vec<param *> *.
4158 (gcc::jit::playback::context::build_call): Convert param "args"
4159 from vec<rvalue *> to const auto_vec<rvalue *> *.
4160 (gcc::jit::playback::context::new_call): Likewise.
4161 (gcc::jit::playback::context::new_call_through_ptr): Likewise.
4162 (wrapper_finalizer): New function.
4163 (gcc::jit::playback::wrapper::operator new): Call the finalizer
4164 variant of ggc_internal_cleared_alloc, supplying
4166 (gcc::jit::playback::function::finalizer): New.
4167 (gcc::jit::playback::block::finalizer): New.
4168 (gcc::jit::playback::source_file::finalizer): New.
4169 (gcc::jit::playback::source_line::finalizer): New.
4172 (gcc::jit::playback::context::new_function_type): Convert param
4173 "param_types" from vec<type *> * to const auto_vec<type *> *.
4174 (gcc::jit::playback::context::new_function): Convert param
4175 "params" from vec<param *> * to const auto_vec<param *> *.
4176 (gcc::jit::playback::context::new_call): Convert param
4177 "args" from vec<rvalue *> to const auto_vec<rvalue *> *.
4178 (gcc::jit::playback::context::new_call_through_ptr): Likewise.
4179 (gcc::jit::playback::context::build_call): Likewise.
4180 (gcc::jit::playback::context): Convert fields "m_functions",
4181 "m_source_files", "m_cached_locations" from vec to auto_vec.
4182 (gcc::jit::playback::wrapper::finalizer): New virtual function.
4183 (gcc::jit::playback::compound_type::set_fields): Convert param fro
4184 const vec<playback::field *> & to
4185 const auto_vec<playback::field *> *.
4186 (gcc::jit::playback::function::finalizer): New.
4187 (gcc::jit::playback::block::finalizer): New.
4188 (gcc::jit::playback::source_file::finalizer): New.
4189 (gcc::jit::playback::source_line::finalizer): New.
4192 (gcc::jit::recording::function_type::replay_into): Convert local
4193 from a vec into an auto_vec.
4194 (gcc::jit::recording::fields::replay_into): Likewise.
4195 (gcc::jit::recording::function::replay_into): Likewise.
4196 (gcc::jit::recording::call::replay_into): Likewise.
4197 (gcc::jit::recording::call_through_ptr::replay_into): Likewise.
4199 * jit-recording.h (gcc::jit::recording::context): Convert fields
4200 "m_mementos", "m_compound_types", "m_functions" from vec<> to
4202 (gcc::jit::recording::function_type::get_param_types): Convert
4203 return type from vec<type *> to const vec<type *> &.
4204 (gcc::jit::recording::function_type): Convert field
4205 "m_param_types" from a vec<> to an auto_vec<>.
4206 (gcc::jit::recording::fields): Likewise for field "m_fields".
4207 (gcc::jit::recording::function::get_params): Convert return type
4208 from vec <param *> to const vec<param *> &.
4209 (gcc::jit::recording::function): Convert fields "m_params",
4210 "m_locals", "m_blocks" from vec<> to auto_vec<>.
4211 (gcc::jit::recording::block): Likewise for field "m_statements".
4212 vec<> to auto_vec<>.
4213 (gcc::jit::recording::call): Likewise for field "m_args".
4214 (gcc::jit::recording::call_through_ptr): Likewise.
4216 2014-11-19 David Malcolm <dmalcolm@redhat.com>
4219 * jit-recording.c (recording::function::validate): Convert
4220 "worklist" from vec<> to autovec<> to fix a leak.
4222 2014-11-11 David Malcolm <dmalcolm@redhat.com>
4224 * ChangeLog.jit: New.
4226 * Make-lang.in: New.
4228 * config-lang.in: New.
4229 * docs/Makefile: New.
4230 * docs/_build/texinfo/Makefile: New.
4231 * docs/_build/texinfo/factorial.png: New.
4232 * docs/_build/texinfo/libgccjit.texi: New.
4233 * docs/_build/texinfo/sum-of-squares.png: New.
4234 * docs/conf.py: New.
4235 * docs/examples/tut01-hello-world.c: New.
4236 * docs/examples/tut02-square.c: New.
4237 * docs/examples/tut03-sum-of-squares.c: New.
4238 * docs/examples/tut04-toyvm/Makefile: New.
4239 * docs/examples/tut04-toyvm/factorial.toy: New.
4240 * docs/examples/tut04-toyvm/fibonacci.toy: New.
4241 * docs/examples/tut04-toyvm/toyvm.c: New.
4242 * docs/index.rst: New.
4243 * docs/internals/index.rst: New.
4244 * docs/intro/factorial.png: New.
4245 * docs/intro/index.rst: New.
4246 * docs/intro/sum-of-squares.png: New.
4247 * docs/intro/tutorial01.rst: New.
4248 * docs/intro/tutorial02.rst: New.
4249 * docs/intro/tutorial03.rst: New.
4250 * docs/intro/tutorial04.rst: New.
4251 * docs/topics/contexts.rst: New.
4252 * docs/topics/expressions.rst: New.
4253 * docs/topics/functions.rst: New.
4254 * docs/topics/index.rst: New.
4255 * docs/topics/locations.rst: New.
4256 * docs/topics/objects.rst: New.
4257 * docs/topics/results.rst: New.
4258 * docs/topics/types.rst: New.
4259 * dummy-frontend.c: New.
4260 * jit-builtins.c: New.
4261 * jit-builtins.h: New.
4262 * jit-common.h: New.
4263 * jit-playback.c: New.
4264 * jit-playback.h: New.
4265 * jit-recording.c: New.
4266 * jit-recording.h: New.
4267 * libgccjit++.h: New.
4270 * libgccjit.map: New.
4273 2013-07-26 David Malcolm <dmalcolm@redhat.com>
4277 Copyright (C) 2013-2024 Free Software Foundation, Inc.
4279 Copying and distribution of this file, with or without modification,
4280 are permitted in any medium without royalty provided the copyright
4281 notice and this notice are preserved.