1 2024-01-19 Antoni Boucher <bouanto@zoho.com>
3 * jit-builtins.cc (ensure_optimization_builtins_exist): Add
6 2024-01-19 Antoni Boucher <bouanto@zoho.com>
8 * jit-recording.h (is_numeric_vector, vector_type::new_int): New
10 * libgccjit.cc (gcc_jit_context_new_unary_op,
11 gcc_jit_context_new_binary_op): add checks for
14 2024-01-12 Guillaume Gomez <guillaume1.gomez@gmail.com>
15 Antoni Boucher <bouanto@zoho.com>
17 * docs/topics/compatibility.rst: Add documentation for LIBGCCJIT_ABI_26.
18 * docs/topics/functions.rst: Add documentation for new functions.
19 * docs/topics/expressions.rst: Add documentation for new functions.
21 2024-01-12 Guillaume Gomez <guillaume1.gomez@gmail.com>
22 Antoni Boucher <bouanto@zoho.com>
24 * dummy-frontend.cc (handle_alias_attribute): New function.
25 (handle_always_inline_attribute): New function.
26 (handle_cold_attribute): New function.
27 (handle_fnspec_attribute): New function.
28 (handle_format_arg_attribute): New function.
29 (handle_format_attribute): New function.
30 (handle_noinline_attribute): New function.
31 (handle_target_attribute): New function.
32 (handle_used_attribute): New function.
33 (handle_visibility_attribute): New function.
34 (handle_weak_attribute): New function.
35 (handle_alias_ifunc_attribute): New function.
36 * jit-playback.cc (fn_attribute_to_string): New function.
37 (variable_attribute_to_string): New function.
38 (global_new_decl): Add attributes support.
39 (set_variable_attribute): New function.
40 (new_global): Add attributes support.
41 (new_global_initialized): Add attributes support.
42 (new_local): Add attributes support.
43 * jit-playback.h (fn_attribute_to_string): New function.
44 (set_variable_attribute): New function.
45 * jit-recording.cc (recording::lvalue::add_attribute): New function.
46 (recording::function::function): New function.
47 (recording::function::write_to_dump): Add attributes support.
48 (recording::function::add_attribute): New function.
49 (recording::function::add_string_attribute): New function.
50 (recording::function::add_integer_array_attribute): New function.
51 (recording::global::replay_into): Add attributes support.
52 (recording::local::replay_into): Add attributes support.
53 * jit-recording.h: Add attributes support.
54 * libgccjit.cc (gcc_jit_function_add_attribute): New function.
55 (gcc_jit_function_add_string_attribute): New function.
56 (gcc_jit_function_add_integer_array_attribute): New function.
57 (gcc_jit_lvalue_add_attribute): New function.
58 * libgccjit.h (enum gcc_jit_fn_attribute): New enum.
59 (gcc_jit_function_add_attribute): New function.
60 (gcc_jit_function_add_string_attribute): New function.
61 (gcc_jit_function_add_integer_array_attribute): New function.
62 (enum gcc_jit_variable_attribute): New function.
63 (gcc_jit_lvalue_add_string_attribute): New function.
64 * libgccjit.map: Declare new functions.
66 2023-12-06 David Malcolm <dmalcolm@redhat.com>
68 * dummy-frontend.cc (jit_begin_diagnostic): Make diagnostic_info
70 (jit_end_diagnostic): Likewise. Pass to add_diagnostic by
72 * jit-playback.cc (jit::playback::context::add_diagnostic):
73 Convert diagnostic_info to const reference.
74 * jit-playback.h (jit::playback::context::add_diagnostic):
77 2023-12-05 Richard Sandiford <richard.sandiford@arm.com>
79 * dummy-frontend.cc (jit_gnu_attribute_table): Add extra braces
80 to work around PR 16333 in older compilers.
81 (jit_format_attribute_table): Likewise.
83 2023-12-02 Richard Sandiford <richard.sandiford@arm.com>
85 * dummy-frontend.cc (jit_format_attribute_table): Change type to
86 scoped_attribute_specs, using...
87 (jit_format_attributes): ...this as the underlying array.
88 (jit_attribute_table): Change to an array of scoped_attribute_specs
90 (jit_gnu_attributes, jit_gnu_attribute_table): ...these new globals
91 for the original array. Include the format attributes.
92 (LANG_HOOKS_COMMON_ATTRIBUTE_TABLE): Delete.
93 (LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE): Delete.
94 (LANG_HOOKS_ATTRIBUTE_TABLE): Define.
96 2023-11-09 Guillaume Gomez <guillaume1.gomez@gmail.com>
100 2023-11-04 David Malcolm <dmalcolm@redhat.com>
102 * jit-playback.cc: Update for changes to diagnostic_context.
103 * jit-playback.h: Likewise.
105 2023-10-25 Vibhav Pant <vibhavp@gmail.com>
107 * jit-recording.cc (recording::global::write_to_dump): Fix
108 dump of string literal initializers.
110 2023-10-22 Iain Sandoe <iain@sandoe.co.uk>
112 * Make-lang.in: Handle Darwin rpaths.
114 2023-10-02 David Malcolm <dmalcolm@redhat.com>
116 * dummy-frontend.cc (jit_langhook_init): Update for change to
117 diagnostic_context callbacks.
119 2023-08-31 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
121 * jit-playback.cc: Change spelling to macOS.
123 2023-08-29 Guillaume Gomez <guillaume1.gomez@gmail.com>
125 * docs/topics/compatibility.rst: Add documentation for LIBGCCJIT_ABI_25.
126 * docs/topics/types.rst: Add documentation for gcc_jit_type_get_restrict.
128 2023-08-29 Guillaume Gomez <guillaume1.gomez@gmail.com>
130 * jit-playback.cc: Remove trailing whitespace characters.
131 * jit-playback.h: Add get_restrict method.
132 * jit-recording.cc: Add get_restrict methods.
133 * jit-recording.h: Add get_restrict methods.
134 * libgccjit++.h: Add get_restrict methods.
135 * libgccjit.cc: Add gcc_jit_type_get_restrict.
136 * libgccjit.h: Declare gcc_jit_type_get_restrict.
137 * libgccjit.map: Declare gcc_jit_type_get_restrict.
139 2023-02-16 Patrick Palka <ppalka@redhat.com>
141 * jit-dejagnu.h: Mechanically drop static from static inline
142 functions via s/^static inline/inline/g.
143 * jit-recording.h: Likewise.
145 2023-01-07 LIU Hao <lh_mouse@126.com>
148 * jit-w32.h: Define `WIN32_LEAN_AND_MEAN` before <windows.h>.
150 2022-12-21 Martin Liska <mliska@suse.cz>
152 * jit-playback.h: Use unused attribute.
154 2022-12-14 Antoni Boucher <bouanto@zoho.com>
155 Guillaume Gomez <guillaume1.gomez@gmail.com>
158 * jit-recording.h: Add vector_type::is_same_type_as method
160 2022-12-07 Antoni Boucher <bouanto@zoho.com>
161 Guillaume Gomez <guillaume1.gomez@gmail.com>
164 * jit-playback.cc: Fix vector float comparison
165 * jit-playback.h: Update comparison function signature
166 * jit-recording.cc: Update call for "new_comparison" function
167 * jit-recording.h: Fix vector float comparison
169 2022-11-20 Jeff Law <jlaw@ventanamicro.com>
172 * jit-playback.cc (playback::lvale::mark_addressable): Remove
175 2022-11-19 Jonathan Wakely <jwakely@redhat.com>
176 LIU Hao <lh_mouse@126.com>
178 * jit-playback.cc (playback::context::scoped_lock): Define RAII
180 (playback::context::compile): Use scoped_lock to acquire mutex
181 for the active playback context.
182 (jit_mutex): Change to std::mutex.
183 (playback::context::acquire_mutex): Rename to ...
184 (playback::context::lock): ... this.
185 (playback::context::release_mutex): Rename to ...
186 (playback::context::unlock): ... this.
187 * jit-playback.h (playback::context): Rename members and declare
189 * jit-recording.cc (INCLUDE_PTHREAD_H): Remove unused define.
190 * libgccjit.cc (version_mutex): Change to std::mutex.
191 (struct jit_version_info): Use std::lock_guard to acquire and
194 2022-11-14 Martin Liska <mliska@suse.cz>
197 2022-11-09 Martin Liska <mliska@suse.cz>
200 * docs/cp/index.rst: Moved to...
201 * doc/cp/index.rst: ...here.
202 * docs/cp/intro/index.rst: Moved to...
203 * doc/cp/intro/index.rst: ...here.
204 * docs/cp/intro/tutorial01.rst: Moved to...
205 * doc/cp/intro/tutorial01.rst: ...here.
206 * docs/cp/intro/tutorial02.rst: Moved to...
207 * doc/cp/intro/tutorial02.rst: ...here.
208 * docs/cp/intro/tutorial03.rst: Moved to...
209 * doc/cp/intro/tutorial03.rst: ...here.
210 * docs/cp/intro/tutorial04.rst: Moved to...
211 * doc/cp/intro/tutorial04.rst: ...here.
212 * docs/cp/topics/asm.rst: Moved to...
213 * doc/cp/topics/asm.rst: ...here.
214 * docs/cp/topics/compilation.rst: Moved to...
215 * doc/cp/topics/compilation.rst: ...here.
216 * docs/cp/topics/contexts.rst: Moved to...
217 * doc/cp/topics/contexts.rst: ...here.
218 * docs/cp/topics/expressions.rst: Moved to...
219 * doc/cp/topics/expressions.rst: ...here.
220 * docs/cp/topics/functions.rst: Moved to...
221 * doc/cp/topics/functions.rst: ...here.
222 * docs/cp/topics/index.rst: Moved to...
223 * doc/cp/topics/index.rst: ...here.
224 * docs/cp/topics/locations.rst: Moved to...
225 * doc/cp/topics/locations.rst: ...here.
226 * docs/cp/topics/objects.rst: Moved to...
227 * doc/cp/topics/objects.rst: ...here.
228 * docs/cp/topics/types.rst: Moved to...
229 * doc/cp/topics/types.rst: ...here.
230 * docs/examples/emit-alphabet.bf: Moved to...
231 * doc/examples/emit-alphabet.bf: ...here.
232 * docs/examples/tut01-hello-world.c: Moved to...
233 * doc/examples/tut01-hello-world.c: ...here.
234 * docs/examples/tut01-hello-world.cc: Moved to...
235 * doc/examples/tut01-hello-world.cc: ...here.
236 * docs/examples/tut02-square.c: Moved to...
237 * doc/examples/tut02-square.c: ...here.
238 * docs/examples/tut02-square.cc: Moved to...
239 * doc/examples/tut02-square.cc: ...here.
240 * docs/examples/tut03-sum-of-squares.c: Moved to...
241 * doc/examples/tut03-sum-of-squares.c: ...here.
242 * docs/examples/tut03-sum-of-squares.cc: Moved to...
243 * doc/examples/tut03-sum-of-squares.cc: ...here.
244 * docs/examples/tut04-toyvm/Makefile: Moved to...
245 * doc/examples/tut04-toyvm/Makefile: ...here.
246 * docs/examples/tut04-toyvm/factorial.toy: Moved to...
247 * doc/examples/tut04-toyvm/factorial.toy: ...here.
248 * docs/examples/tut04-toyvm/fibonacci.toy: Moved to...
249 * doc/examples/tut04-toyvm/fibonacci.toy: ...here.
250 * docs/examples/tut04-toyvm/toyvm.c: Moved to...
251 * doc/examples/tut04-toyvm/toyvm.c: ...here.
252 * docs/examples/tut04-toyvm/toyvm.cc: Moved to...
253 * doc/examples/tut04-toyvm/toyvm.cc: ...here.
254 * docs/examples/tut05-bf.c: Moved to...
255 * doc/examples/tut05-bf.c: ...here.
256 * docs/index.rst: Moved to...
257 * doc/index.rst: ...here.
258 * docs/internals/index.rst: Moved to...
259 * doc/internals/index.rst: ...here.
260 * docs/internals/test-hello-world.exe.log.txt: Moved to...
261 * doc/internals/test-hello-world.exe.log.txt: ...here.
262 * docs/_build/texinfo/libgccjit-figures/factorial.png: Moved to...
263 * doc/intro/factorial.png: ...here.
264 * docs/intro/index.rst: Moved to...
265 * doc/intro/index.rst: ...here.
266 * docs/_build/texinfo/libgccjit-figures/sum-of-squares.png: Moved to...
267 * doc/intro/sum-of-squares.png: ...here.
268 * docs/intro/tutorial01.rst: Moved to...
269 * doc/intro/tutorial01.rst: ...here.
270 * docs/intro/tutorial02.rst: Moved to...
271 * doc/intro/tutorial02.rst: ...here.
272 * docs/intro/tutorial03.rst: Moved to...
273 * doc/intro/tutorial03.rst: ...here.
274 * docs/intro/tutorial04.rst: Moved to...
275 * doc/intro/tutorial04.rst: ...here.
276 * docs/intro/tutorial05.rst: Moved to...
277 * doc/intro/tutorial05.rst: ...here.
278 * docs/topics/asm.rst: Moved to...
279 * doc/topics/asm.rst: ...here.
280 * docs/topics/compatibility.rst: Moved to...
281 * doc/topics/compatibility.rst: ...here.
282 * docs/topics/compilation.rst: Moved to...
283 * doc/topics/compilation.rst: ...here.
284 * docs/topics/contexts.rst: Moved to...
285 * doc/topics/contexts.rst: ...here.
286 * docs/topics/expressions.rst: Moved to...
287 * doc/topics/expressions.rst: ...here.
288 * docs/topics/function-pointers.rst: Moved to...
289 * doc/topics/function-pointers.rst: ...here.
290 * docs/topics/functions.rst: Moved to...
291 * doc/topics/functions.rst: ...here.
292 * docs/topics/index.rst: Moved to...
293 * doc/topics/index.rst: ...here.
294 * docs/topics/locations.rst: Moved to...
295 * doc/topics/locations.rst: ...here.
296 * docs/topics/objects.rst: Moved to...
297 * doc/topics/objects.rst: ...here.
298 * docs/topics/performance.rst: Moved to...
299 * doc/topics/performance.rst: ...here.
300 * docs/topics/types.rst: Moved to...
301 * doc/topics/types.rst: ...here.
302 * docs/Makefile: Removed.
303 * docs/_build/texinfo/Makefile: Removed.
304 * docs/_build/texinfo/libgccjit-figures/factorial1.png: Removed.
305 * docs/_build/texinfo/libgccjit-figures/sum-of-squares1.png: Removed.
306 * docs/_build/texinfo/libgccjit.texi: Removed.
307 * docs/conf.py: Removed.
308 * docs/intro/factorial.png: Removed.
309 * docs/intro/sum-of-squares.png: Removed.
310 * doc/conf.py: New file.
312 2022-11-14 Martin Liska <mliska@suse.cz>
315 2022-11-14 Martin Liska <mliska@suse.cz>
317 * Make-lang.in: Support --with-sphinx-build.
319 2022-11-14 Martin Liska <mliska@suse.cz>
322 2022-11-14 Martin Liska <mliska@suse.cz>
324 * doc/internals/index.rst: Fix cross manual refs.
325 * doc/topics/contexts.rst: Likewise.
327 2022-11-14 Martin Liska <mliska@suse.cz>
330 2022-11-14 Martin Liska <mliska@suse.cz>
333 Support installation if sphinx-build is missing.
335 2022-11-14 Martin Liska <mliska@suse.cz>
338 2022-11-14 Martin Liska <mliska@suse.cz>
340 * doc/cp/index.rst: Remove trailing .rst in toctree.
341 * doc/cp/intro/index.rst: Likewise.
342 * doc/cp/topics/index.rst: Likewise.
343 * doc/index.rst: Likewise.
344 * doc/intro/index.rst: Likewise.
345 * doc/topics/index.rst: Likewise.
346 * doc/indices-and-tables.rst: New file.
348 2022-11-11 Martin Liska <mliska@suse.cz>
350 * doc/cp/index.rst: Remove trailing .rst in toctree.
351 * doc/cp/intro/index.rst: Likewise.
352 * doc/cp/topics/index.rst: Likewise.
353 * doc/index.rst: Likewise.
354 * doc/intro/index.rst: Likewise.
355 * doc/topics/index.rst: Likewise.
356 * doc/indices-and-tables.rst: New file.
358 2022-11-09 Martin Liska <mliska@suse.cz>
361 Support installation if sphinx-build is missing.
363 2022-11-09 Martin Liska <mliska@suse.cz>
365 * doc/internals/index.rst: Fix cross manual refs.
366 * doc/topics/contexts.rst: Likewise.
368 2022-11-09 Martin Liska <mliska@suse.cz>
370 * Make-lang.in: Support --with-sphinx-build.
372 2022-11-09 Martin Liska <mliska@suse.cz>
375 * docs/cp/index.rst: Moved to...
376 * doc/cp/index.rst: ...here.
377 * docs/cp/intro/index.rst: Moved to...
378 * doc/cp/intro/index.rst: ...here.
379 * docs/cp/intro/tutorial01.rst: Moved to...
380 * doc/cp/intro/tutorial01.rst: ...here.
381 * docs/cp/intro/tutorial02.rst: Moved to...
382 * doc/cp/intro/tutorial02.rst: ...here.
383 * docs/cp/intro/tutorial03.rst: Moved to...
384 * doc/cp/intro/tutorial03.rst: ...here.
385 * docs/cp/intro/tutorial04.rst: Moved to...
386 * doc/cp/intro/tutorial04.rst: ...here.
387 * docs/cp/topics/asm.rst: Moved to...
388 * doc/cp/topics/asm.rst: ...here.
389 * docs/cp/topics/compilation.rst: Moved to...
390 * doc/cp/topics/compilation.rst: ...here.
391 * docs/cp/topics/contexts.rst: Moved to...
392 * doc/cp/topics/contexts.rst: ...here.
393 * docs/cp/topics/expressions.rst: Moved to...
394 * doc/cp/topics/expressions.rst: ...here.
395 * docs/cp/topics/functions.rst: Moved to...
396 * doc/cp/topics/functions.rst: ...here.
397 * docs/cp/topics/index.rst: Moved to...
398 * doc/cp/topics/index.rst: ...here.
399 * docs/cp/topics/locations.rst: Moved to...
400 * doc/cp/topics/locations.rst: ...here.
401 * docs/cp/topics/objects.rst: Moved to...
402 * doc/cp/topics/objects.rst: ...here.
403 * docs/cp/topics/types.rst: Moved to...
404 * doc/cp/topics/types.rst: ...here.
405 * docs/examples/emit-alphabet.bf: Moved to...
406 * doc/examples/emit-alphabet.bf: ...here.
407 * docs/examples/tut01-hello-world.c: Moved to...
408 * doc/examples/tut01-hello-world.c: ...here.
409 * docs/examples/tut01-hello-world.cc: Moved to...
410 * doc/examples/tut01-hello-world.cc: ...here.
411 * docs/examples/tut02-square.c: Moved to...
412 * doc/examples/tut02-square.c: ...here.
413 * docs/examples/tut02-square.cc: Moved to...
414 * doc/examples/tut02-square.cc: ...here.
415 * docs/examples/tut03-sum-of-squares.c: Moved to...
416 * doc/examples/tut03-sum-of-squares.c: ...here.
417 * docs/examples/tut03-sum-of-squares.cc: Moved to...
418 * doc/examples/tut03-sum-of-squares.cc: ...here.
419 * docs/examples/tut04-toyvm/Makefile: Moved to...
420 * doc/examples/tut04-toyvm/Makefile: ...here.
421 * docs/examples/tut04-toyvm/factorial.toy: Moved to...
422 * doc/examples/tut04-toyvm/factorial.toy: ...here.
423 * docs/examples/tut04-toyvm/fibonacci.toy: Moved to...
424 * doc/examples/tut04-toyvm/fibonacci.toy: ...here.
425 * docs/examples/tut04-toyvm/toyvm.c: Moved to...
426 * doc/examples/tut04-toyvm/toyvm.c: ...here.
427 * docs/examples/tut04-toyvm/toyvm.cc: Moved to...
428 * doc/examples/tut04-toyvm/toyvm.cc: ...here.
429 * docs/examples/tut05-bf.c: Moved to...
430 * doc/examples/tut05-bf.c: ...here.
431 * docs/index.rst: Moved to...
432 * doc/index.rst: ...here.
433 * docs/internals/index.rst: Moved to...
434 * doc/internals/index.rst: ...here.
435 * docs/internals/test-hello-world.exe.log.txt: Moved to...
436 * doc/internals/test-hello-world.exe.log.txt: ...here.
437 * docs/_build/texinfo/libgccjit-figures/factorial.png: Moved to...
438 * doc/intro/factorial.png: ...here.
439 * docs/intro/index.rst: Moved to...
440 * doc/intro/index.rst: ...here.
441 * docs/_build/texinfo/libgccjit-figures/sum-of-squares.png: Moved to...
442 * doc/intro/sum-of-squares.png: ...here.
443 * docs/intro/tutorial01.rst: Moved to...
444 * doc/intro/tutorial01.rst: ...here.
445 * docs/intro/tutorial02.rst: Moved to...
446 * doc/intro/tutorial02.rst: ...here.
447 * docs/intro/tutorial03.rst: Moved to...
448 * doc/intro/tutorial03.rst: ...here.
449 * docs/intro/tutorial04.rst: Moved to...
450 * doc/intro/tutorial04.rst: ...here.
451 * docs/intro/tutorial05.rst: Moved to...
452 * doc/intro/tutorial05.rst: ...here.
453 * docs/topics/asm.rst: Moved to...
454 * doc/topics/asm.rst: ...here.
455 * docs/topics/compatibility.rst: Moved to...
456 * doc/topics/compatibility.rst: ...here.
457 * docs/topics/compilation.rst: Moved to...
458 * doc/topics/compilation.rst: ...here.
459 * docs/topics/contexts.rst: Moved to...
460 * doc/topics/contexts.rst: ...here.
461 * docs/topics/expressions.rst: Moved to...
462 * doc/topics/expressions.rst: ...here.
463 * docs/topics/function-pointers.rst: Moved to...
464 * doc/topics/function-pointers.rst: ...here.
465 * docs/topics/functions.rst: Moved to...
466 * doc/topics/functions.rst: ...here.
467 * docs/topics/index.rst: Moved to...
468 * doc/topics/index.rst: ...here.
469 * docs/topics/locations.rst: Moved to...
470 * doc/topics/locations.rst: ...here.
471 * docs/topics/objects.rst: Moved to...
472 * doc/topics/objects.rst: ...here.
473 * docs/topics/performance.rst: Moved to...
474 * doc/topics/performance.rst: ...here.
475 * docs/topics/types.rst: Moved to...
476 * doc/topics/types.rst: ...here.
477 * docs/Makefile: Removed.
478 * docs/_build/texinfo/Makefile: Removed.
479 * docs/_build/texinfo/libgccjit-figures/factorial1.png: Removed.
480 * docs/_build/texinfo/libgccjit-figures/sum-of-squares1.png: Removed.
481 * docs/_build/texinfo/libgccjit.texi: Removed.
482 * docs/conf.py: Removed.
483 * docs/intro/factorial.png: Removed.
484 * docs/intro/sum-of-squares.png: Removed.
485 * doc/conf.py: New file.
487 2022-09-15 Richard Biener <rguenther@suse.de>
489 * dummy-frontend.cc (jit_langhook_init): Do not initialize
492 2022-08-09 Vibhav Pant <vibhavp@gmail.com>
494 * libgccjit.h (LIBGCCJIT_HAVE_gcc_jit_context_new_bitcast): Move
495 definition out of comment.
497 2022-07-28 David Malcolm <dmalcolm@redhat.com>
499 * docs/internals/index.rst: Remove reference to ".c" extensions
502 2022-07-28 Martin Liška <mliska@suse.cz>
504 * docs/cp/intro/tutorial02.rst:
505 Shorten the assembly example so that there is not slider.
506 * docs/cp/intro/tutorial04.rst: Likewise.
507 * docs/intro/tutorial02.rst: Likewise.
508 * docs/intro/tutorial04.rst: Likewise.
509 * docs/topics/contexts.rst: Likewise.
511 2022-07-28 marxin <mliska@suse.cz>
513 * docs/index.rst: Remove reference to module index
514 as we don't emit any.
516 2022-07-28 marxin <mliska@suse.cz>
518 * docs/cp/intro/tutorial02.rst: Use :expr:`type *` for pointers to a type
519 * docs/cp/topics/asm.rst: Likewise.
520 * docs/cp/topics/contexts.rst: Likewise.
521 * docs/cp/topics/expressions.rst: Likewise.
522 * docs/cp/topics/functions.rst: Likewise.
523 * docs/cp/topics/objects.rst: Likewise.
524 * docs/intro/tutorial02.rst: Likewise.
525 * docs/intro/tutorial03.rst: Likewise.
526 * docs/intro/tutorial04.rst: Likewise.
527 * docs/intro/tutorial05.rst: Likewise.
528 * docs/topics/compilation.rst: Likewise.
529 * docs/topics/contexts.rst: Likewise.
530 * docs/topics/objects.rst: Likewise.
532 2022-07-28 marxin <mliska@suse.cz>
534 * docs/cp/intro/tutorial04.rst: Use list-table.
535 * docs/intro/tutorial04.rst: Likewise.
536 * docs/intro/tutorial05.rst: Likewise.
537 * docs/topics/compilation.rst: Likewise.
538 * docs/topics/expressions.rst: Likewise.
539 * docs/topics/types.rst: Likewise.
541 2022-07-28 marxin <mliska@suse.cz>
543 * docs/cp/topics/expressions.rst: Compact so that the generated
544 output is also more compact.
546 2022-07-28 marxin <mliska@suse.cz>
548 * docs/cp/intro/tutorial02.rst: Use proper reference.
549 * docs/cp/topics/contexts.rst: Likewise.
550 * docs/cp/topics/functions.rst: Put `class` directive before a
551 function as it is not allowed declaring a class in a fn.
552 * docs/cp/topics/types.rst: Add template keyword.
553 * docs/examples/tut04-toyvm/toyvm.c (toyvm_function_compile):
554 Add removed comment used for code snippet ending detection.
555 * docs/intro/tutorial04.rst: Fix to match the real comment.
557 2022-07-28 marxin <mliska@suse.cz>
559 * docs/cp/topics/expressions.rst: Use :expr: for basic types.
560 * docs/topics/compilation.rst: Likewise.
561 * docs/topics/expressions.rst: Likewise.
562 * docs/topics/function-pointers.rst: Likewise.
564 2022-07-28 marxin <mliska@suse.cz>
566 * docs/conf.py: Add needs_sphinx = '3.0' where c:type was added.
567 * docs/index.rst: Remove note about it.
568 * docs/topics/compilation.rst: Use enum directive and reference.
569 * docs/topics/contexts.rst: Likewise.
570 * docs/topics/expressions.rst: Likewise.
571 * docs/topics/functions.rst: Likewise.
573 2022-07-14 Jonathan Wakely <jwakely@redhat.com>
575 * jit-recording.h (recording::memento): Define copy constructor
576 and copy assignment operator as deleted.
577 (recording::string): Likewise.
578 (recording::string::c_str): Add const qualifier.
580 2022-06-29 Antoni Boucher <bouanto@zoho.com>
583 * jit-playback.cc: Use the correct return type when folding in
586 2022-06-29 Sergei Trofimovich <siarheit@google.com>
589 * jit-playback.cc: Include <pthread.h> via "system.h" to avoid calloc()
591 * jit-recording.cc: Ditto.
592 * libgccjit.cc: Ditto.
594 2022-06-10 Antoni Boucher <bouanto@zoho.com>
597 * libgccjit.cc: Add support for floating-point types in
598 gcc_jit_type_get_size.
600 2022-06-08 Yang Yujie <yangyujie@loongson.cn>
602 * Make-lang.in: only link objects from $(EXTRA_GCC_OBJS)
603 that's not in $(EXTRA_OBJS) into libgccjit.
605 2022-05-23 David Malcolm <dmalcolm@redhat.com>
607 * jit-recording.h: Add "final" and "override" to all vfunc
608 implementations that were missing them, as appropriate.
610 2022-05-20 David Malcolm <dmalcolm@redhat.com>
612 * jit-playback.h: Replace uses of "FINAL" and "OVERRIDE" with
613 "final" and "override".
614 * jit-recording.cc: Likewise.
615 * jit-recording.h: Likewise.
617 2022-05-16 Martin Liska <mliska@suse.cz>
619 * jit-builtins.cc (find_builtin_by_name): Use ARRAY_SIZE.
620 (get_string_for_type_id): Likewise.
621 * jit-recording.cc (recording::context::context): Likewise.
623 2022-04-14 Iain Sandoe <iain@sandoe.co.uk>
625 * jit-playback.cc (new_bitcast): Cast values returned by tree_to_uhwi
626 to 'long' to match the print format.
628 2022-04-12 Antoni Boucher <bouanto@zoho.com>
631 * docs/_build/texinfo/libgccjit.texi: Regenerate.
632 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_24): New ABI tag.
633 * docs/topics/expressions.rst: Add documentation for the
634 functions gcc_jit_lvalue_set_alignment and
635 gcc_jit_lvalue_get_alignment.
636 * jit-playback.h: New function (set_alignment).
637 * jit-recording.cc: New function (set_alignment).
638 * jit-recording.h: New functions (set_alignment, get_alignment)
639 and new field (m_alignment).
640 * libgccjit.cc: New functions (gcc_jit_lvalue_get_alignment,
641 gcc_jit_lvalue_set_alignment)
642 * libgccjit.h: New functions (gcc_jit_lvalue_get_alignment,
643 gcc_jit_lvalue_set_alignment)
644 * libgccjit.map (LIBGCCJIT_ABI_24): New ABI tag.
646 2022-04-12 Antoni Boucher <bouanto@zoho.com>
649 * docs/_build/texinfo/libgccjit.texi: Regenerate.
650 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_23): New ABI tag.
651 * docs/topics/contexts.rst: Add documentation for the new
652 function gcc_jit_context_set_bool_print_errors_to_stderr.
653 * jit-common.h: New enum value
654 (INNER_BOOL_OPTION_PRINT_ERRORS_TO_STDERR).
655 * jit-recording.cc: Handle the new option
656 INNER_BOOL_OPTION_PRINT_ERRORS_TO_STDERR.
657 * libgccjit.cc: New function
658 (gcc_jit_context_set_bool_print_errors_to_stderr).
659 * libgccjit.h: New function
660 (gcc_jit_context_set_bool_print_errors_to_stderr).
661 * libgccjit.map (LIBGCCJIT_ABI_23): New ABI tag.
663 2022-04-12 Antoni Boucher <bouanto@zoho.com>
666 * docs/_build/texinfo/libgccjit.texi: Regenerate.
667 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_22): New ABI tag.
668 * docs/topics/expressions.rst: Add documentation for the
669 function gcc_jit_lvalue_set_register_name.
670 * jit-playback.h: New function (set_register_name).
671 * jit-recording.cc: New function (set_register_name) and add
672 support for register variables.
673 * jit-recording.h: New field (m_reg_name) and new function
675 * libgccjit.cc: New function (gcc_jit_lvalue_set_register_name).
676 * libgccjit.h: New function (gcc_jit_lvalue_set_register_name).
677 * libgccjit.map (LIBGCCJIT_ABI_22): New ABI tag.
679 2022-04-12 Antoni Boucher <bouanto@zoho.com>
682 * docs/_build/texinfo/libgccjit.texi: Regenerate.
683 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_21): New ABI tag.
684 * docs/topics/expressions.rst: Add documentation for the
685 function gcc_jit_context_new_bitcast.
686 * jit-playback.cc: New function (new_bitcast).
687 * jit-playback.h: New function (new_bitcast).
688 * jit-recording.cc: New functions (new_bitcast,
689 bitcast::replay_into, bitcast::visit_children,
690 bitcast::make_debug_string, bitcast::write_reproducer).
691 * jit-recording.h: New class (bitcast) and new function
692 (new_bitcast, bitcast::replay_into, bitcast::visit_children,
693 bitcast::make_debug_string, bitcast::write_reproducer,
694 bitcast::get_precedence).
695 * libgccjit.cc: New function (gcc_jit_context_new_bitcast)
696 * libgccjit.h: New function (gcc_jit_context_new_bitcast)
697 * libgccjit.map (LIBGCCJIT_ABI_21): New ABI tag.
699 2022-04-12 Antoni Boucher <bouanto@zoho.com>
702 * docs/_build/texinfo/libgccjit.texi: Regenerate
703 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_20): New ABI tag.
704 * docs/topics/types.rst: Add documentation for the new types
705 GCC_JIT_TYPE_UINT8_T, GCC_JIT_TYPE_UINT16_T,
706 GCC_JIT_TYPE_UINT32_T, GCC_JIT_TYPE_UINT64_T,
707 GCC_JIT_TYPE_UINT128_T, GCC_JIT_TYPE_INT8_T, GCC_JIT_TYPE_INT16_T,
708 GCC_JIT_TYPE_INT32_T, GCC_JIT_TYPE_INT64_T, GCC_JIT_TYPE_INT128_T and
709 new functions (gcc_jit_compatible_types, gcc_jit_type_get_size).
710 * jit-builtins.cc: Add support for BT_UINT128.
711 * jit-common.h: Update the value of NUM_GCC_JIT_TYPES.
712 * jit-playback.cc: Add support for the sized integer types.
713 * jit-recording.cc: Add support for the sized integer types.
714 * jit-recording.h: Add support for comparing integer types
715 and new function (is_signed).
716 * libgccjit.cc (gcc_jit_compatible_types): New.
717 (gcc_jit_type_get_size) New.
718 * libgccjit.h: New enum variants for gcc_jit_types
719 (GCC_JIT_TYPE_UINT8_T, GCC_JIT_TYPE_UINT16_T,
720 GCC_JIT_TYPE_UINT32_T, GCC_JIT_TYPE_UINT64_T,
721 GCC_JIT_TYPE_UINT128_T, GCC_JIT_TYPE_INT8_T,
722 GCC_JIT_TYPE_INT16_T, GCC_JIT_TYPE_INT32_T,
723 GCC_JIT_TYPE_INT64_T, GCC_JIT_TYPE_INT128_T) and new functions
724 (gcc_jit_compatible_types, gcc_jit_type_get_size).
725 * libgccjit.map (LIBGCCJIT_ABI_20): New ABI tag.
727 2022-04-06 David Malcolm <dmalcolm@redhat.com>
730 * docs/_build/texinfo/factorial.png: Move to...
731 * docs/_build/texinfo/libgccjit-figures/factorial.png: ...here.
732 * docs/_build/texinfo/factorial1.png: Move to...
733 * docs/_build/texinfo/libgccjit-figures/factorial1.png: ...here.
734 * docs/_build/texinfo/sum-of-squares.png: Move to...
735 * docs/_build/texinfo/libgccjit-figures/sum-of-squares.png: ...here.
736 * docs/_build/texinfo/sum-of-squares1.png: Move to...
737 * docs/_build/texinfo/libgccjit-figures/sum-of-squares1.png: ...here.
739 2022-04-01 David Malcolm <dmalcolm@redhat.com>
741 * docs/topics/expressions.rst: Fix formatting.
742 * docs/topics/types.rst: Likewise.
743 * docs/_build/texinfo/libgccjit.texi: Regenerate
745 2022-04-01 Petter Tomner <tomner@kth.se>
747 * docs/topics/compatibility.rst: Add 19 tag
748 * docs/topics/compilation.rst: Linking
749 * docs/topics/contexts.rst: Linking example
750 * docs/topics/expressions.rst: Fix formatting and dropped 's'
752 2022-03-07 Jakub Jelinek <jakub@redhat.com>
754 * libgccjit.h: Fix up duplicated word issue in a comment.
756 2022-01-17 Martin Liska <mliska@suse.cz>
758 * config-lang.in: Rename .c names to .cc.
759 * docs/_build/texinfo/libgccjit.texi: Likewise.
760 * docs/internals/index.rst: Likewise.
761 * jit-builtins.cc (builtins_manager::make_builtin_function): Likewise.
762 * jit-playback.cc (fold_const_var): Likewise.
763 (playback::context::~context): Likewise.
764 (new_field): Likewise.
765 (new_bitfield): Likewise.
766 (new_compound_type): Likewise.
767 (playback::compound_type::set_fields): Likewise.
768 (global_set_init_rvalue): Likewise.
769 (load_blob_in_ctor): Likewise.
770 (new_global_initialized): Likewise.
772 (new_string_literal): Likewise.
773 (as_truth_value): Likewise.
774 (build_call): Likewise.
775 (playback::context::build_cast): Likewise.
776 (new_array_access): Likewise.
777 (new_field_access): Likewise.
778 (dereference): Likewise.
779 (postprocess): Likewise.
780 (add_jump): Likewise.
781 (add_switch): Likewise.
782 (build_goto_operands): Likewise.
783 (playback::context::read_dump_file): Likewise.
784 (init_types): Likewise.
785 * jit-recording.cc (recording::context::get_int_type): Likewise.
786 * jit-recording.h: Likewise.
787 * libgccjit.cc (compatible_types): Likewise.
788 (gcc_jit_context_acquire): Likewise.
789 (gcc_jit_context_release): Likewise.
790 (gcc_jit_context_new_child_context): Likewise.
791 (gcc_jit_type_as_object): Likewise.
792 (gcc_jit_context_get_type): Likewise.
793 (gcc_jit_context_get_int_type): Likewise.
794 (gcc_jit_type_get_pointer): Likewise.
795 (gcc_jit_type_get_const): Likewise.
796 (gcc_jit_type_get_volatile): Likewise.
797 (gcc_jit_type_dyncast_array): Likewise.
798 (gcc_jit_type_is_bool): Likewise.
799 (gcc_jit_type_is_pointer): Likewise.
800 (gcc_jit_type_is_integral): Likewise.
801 (gcc_jit_type_dyncast_vector): Likewise.
802 (gcc_jit_type_is_struct): Likewise.
803 (gcc_jit_vector_type_get_num_units): Likewise.
804 (gcc_jit_vector_type_get_element_type): Likewise.
805 (gcc_jit_type_unqualified): Likewise.
806 (gcc_jit_type_dyncast_function_ptr_type): Likewise.
807 (gcc_jit_function_type_get_return_type): Likewise.
808 (gcc_jit_function_type_get_param_count): Likewise.
809 (gcc_jit_function_type_get_param_type): Likewise.
810 (gcc_jit_context_new_array_type): Likewise.
811 (gcc_jit_context_new_field): Likewise.
812 (gcc_jit_field_as_object): Likewise.
813 (gcc_jit_context_new_struct_type): Likewise.
814 (gcc_jit_struct_as_type): Likewise.
815 (gcc_jit_struct_set_fields): Likewise.
816 (gcc_jit_struct_get_field_count): Likewise.
817 (gcc_jit_context_new_union_type): Likewise.
818 (gcc_jit_context_new_function_ptr_type): Likewise.
819 (gcc_jit_param_as_rvalue): Likewise.
820 (gcc_jit_context_new_function): Likewise.
821 (gcc_jit_function_get_return_type): Likewise.
822 (gcc_jit_function_dump_to_dot): Likewise.
823 (gcc_jit_block_get_function): Likewise.
824 (gcc_jit_global_set_initializer_rvalue): Likewise.
825 (gcc_jit_rvalue_get_type): Likewise.
826 (gcc_jit_context_new_rvalue_from_int): Likewise.
827 (gcc_jit_context_one): Likewise.
828 (gcc_jit_context_new_rvalue_from_double): Likewise.
829 (gcc_jit_context_null): Likewise.
830 (gcc_jit_context_new_string_literal): Likewise.
831 (valid_binary_op_p): Likewise.
832 (gcc_jit_context_new_binary_op): Likewise.
833 (gcc_jit_context_new_comparison): Likewise.
834 (gcc_jit_context_new_call): Likewise.
835 (is_valid_cast): Likewise.
836 (gcc_jit_context_new_cast): Likewise.
837 (gcc_jit_object_get_context): Likewise.
838 (gcc_jit_object_get_debug_string): Likewise.
839 (gcc_jit_lvalue_access_field): Likewise.
840 (gcc_jit_rvalue_access_field): Likewise.
841 (gcc_jit_rvalue_dereference_field): Likewise.
842 (gcc_jit_rvalue_dereference): Likewise.
843 (gcc_jit_lvalue_get_address): Likewise.
844 (gcc_jit_lvalue_set_tls_model): Likewise.
845 (gcc_jit_lvalue_set_link_section): Likewise.
846 (gcc_jit_function_new_local): Likewise.
847 (gcc_jit_block_add_eval): Likewise.
848 (gcc_jit_block_add_assignment): Likewise.
850 (gcc_jit_block_end_with_conditional): Likewise.
851 (gcc_jit_block_add_comment): Likewise.
852 (gcc_jit_block_end_with_jump): Likewise.
853 (gcc_jit_block_end_with_return): Likewise.
854 (gcc_jit_block_end_with_void_return): Likewise.
855 (case_range_validator::case_range_validator): Likewise.
856 (case_range_validator::validate): Likewise.
857 (case_range_validator::get_wide_int): Likewise.
858 (gcc_jit_block_end_with_switch): Likewise.
859 (gcc_jit_context_set_str_option): Likewise.
860 (gcc_jit_context_set_int_option): Likewise.
861 (gcc_jit_context_set_bool_option): Likewise.
862 (gcc_jit_context_set_bool_allow_unreachable_blocks): Likewise.
863 (gcc_jit_context_set_bool_use_external_driver): Likewise.
864 (gcc_jit_context_add_command_line_option): Likewise.
865 (gcc_jit_context_add_driver_option): Likewise.
866 (gcc_jit_context_enable_dump): Likewise.
867 (gcc_jit_context_compile): Likewise.
868 (gcc_jit_context_compile_to_file): Likewise.
869 (gcc_jit_context_set_logfile): Likewise.
870 (gcc_jit_context_dump_reproducer_to_file): Likewise.
871 (gcc_jit_context_get_first_error): Likewise.
872 (gcc_jit_context_get_last_error): Likewise.
873 (gcc_jit_result_get_code): Likewise.
874 (gcc_jit_result_get_global): Likewise.
875 (gcc_jit_rvalue_set_bool_require_tail_call): Likewise.
876 (gcc_jit_type_get_aligned): Likewise.
877 (gcc_jit_type_get_vector): Likewise.
878 (gcc_jit_function_get_address): Likewise.
879 (gcc_jit_version_patchlevel): Likewise.
880 (gcc_jit_block_add_extended_asm): Likewise.
881 (gcc_jit_extended_asm_as_object): Likewise.
882 (gcc_jit_extended_asm_set_volatile_flag): Likewise.
883 (gcc_jit_extended_asm_set_inline_flag): Likewise.
884 (gcc_jit_extended_asm_add_output_operand): Likewise.
885 (gcc_jit_extended_asm_add_input_operand): Likewise.
886 (gcc_jit_extended_asm_add_clobber): Likewise.
887 * notes.txt: Likewise.
889 2022-01-17 Martin Liska <mliska@suse.cz>
891 * dummy-frontend.c: Moved to...
892 * dummy-frontend.cc: ...here.
893 * jit-builtins.c: Moved to...
894 * jit-builtins.cc: ...here.
895 * jit-logging.c: Moved to...
896 * jit-logging.cc: ...here.
897 * jit-playback.c: Moved to...
898 * jit-playback.cc: ...here.
899 * jit-recording.c: Moved to...
900 * jit-recording.cc: ...here.
901 * jit-result.c: Moved to...
902 * jit-result.cc: ...here.
903 * jit-spec.c: Moved to...
904 * jit-spec.cc: ...here.
905 * jit-tempdir.c: Moved to...
906 * jit-tempdir.cc: ...here.
907 * jit-w32.c: Moved to...
908 * jit-w32.cc: ...here.
909 * libgccjit.c: Moved to...
910 * libgccjit.cc: ...here.
912 2021-12-28 Martin Liska <mliska@suse.cz>
914 * docs/_build/texinfo/libgccjit.texi: Replace http:// with https.
915 * docs/cp/index.rst: Likewise.
916 * docs/cp/intro/index.rst: Likewise.
917 * docs/cp/intro/tutorial01.rst: Likewise.
918 * docs/cp/intro/tutorial02.rst: Likewise.
919 * docs/cp/intro/tutorial03.rst: Likewise.
920 * docs/cp/intro/tutorial04.rst: Likewise.
921 * docs/cp/topics/asm.rst: Likewise.
922 * docs/cp/topics/compilation.rst: Likewise.
923 * docs/cp/topics/contexts.rst: Likewise.
924 * docs/cp/topics/expressions.rst: Likewise.
925 * docs/cp/topics/functions.rst: Likewise.
926 * docs/cp/topics/index.rst: Likewise.
927 * docs/cp/topics/locations.rst: Likewise.
928 * docs/cp/topics/objects.rst: Likewise.
929 * docs/cp/topics/types.rst: Likewise.
930 * docs/index.rst: Likewise.
931 * docs/internals/index.rst: Likewise.
932 * docs/intro/index.rst: Likewise.
933 * docs/intro/tutorial01.rst: Likewise.
934 * docs/intro/tutorial02.rst: Likewise.
935 * docs/intro/tutorial03.rst: Likewise.
936 * docs/intro/tutorial04.rst: Likewise.
937 * docs/intro/tutorial05.rst: Likewise.
938 * docs/topics/asm.rst: Likewise.
939 * docs/topics/compatibility.rst: Likewise.
940 * docs/topics/compilation.rst: Likewise.
941 * docs/topics/contexts.rst: Likewise.
942 * docs/topics/expressions.rst: Likewise.
943 * docs/topics/function-pointers.rst: Likewise.
944 * docs/topics/functions.rst: Likewise.
945 * docs/topics/index.rst: Likewise.
946 * docs/topics/locations.rst: Likewise.
947 * docs/topics/objects.rst: Likewise.
948 * docs/topics/performance.rst: Likewise.
949 * docs/topics/types.rst: Likewise.
951 2021-12-20 Martin Liska <mliska@suse.cz>
953 * libgccjit.c (struct version_info): Rename to jit_version_info.
954 (struct jit_version_info): Likewise.
955 (gcc_jit_version_major): Likewise.
956 (gcc_jit_version_minor): Likewise.
957 (gcc_jit_version_patchlevel): Likewise.
959 2021-12-14 Petter Tomner <tomner@kth.se>
961 * jit-common.h: New enum
962 * jit-playback.c : Folding an setting intitial
963 (global_new_decl) : Handle const global generation
964 (new_global) : New flag
965 (global_set_init_rvalue) : New
967 (new_global_initialized) : Flag
968 (as_truth_value) : Fold
969 (new_unary_op) : Fold
970 (new_binary_op) : Fold
971 (new_comparison) : Fold
972 (new_array_access) : Fold
973 (new_dereference) : Fold
976 (global_set_init_rvalue) : New
980 (new_global_init_rvalue) : New
982 (ctor) : New, inherits rvalue
983 (global_init_rvalue) : New, inherits memento
984 (type::is_union) : New
985 * libgccjit++.h : New entrypoints, see C-header
986 * libgccjit.c : See .h
987 * libgccjit.h : New entrypoints
988 (gcc_jit_context_new_array_constructor) : New
989 (gcc_jit_context_new_struct_constructor) : New
990 (gcc_jit_context_new_union_constructor) : New
991 (gcc_jit_global_set_initializer_rvalue) : New
992 (LIBGCCJIT_HAVE_CTORS) : New feuture macro
993 * libgccjit.map : New entrypoints added to ABI 19
994 * docs/topics/expressions.rst : Updated docs
996 2021-12-12 Antoni Boucher <bouanto@zoho.com>
999 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_18): New ABI
1001 * docs/topics/expressions.rst: Add documentation for the
1002 function gcc_jit_lvalue_set_link_section.
1003 * jit-playback.h: New function (set_link_section).
1004 * jit-recording.c: New function (set_link_section) and
1005 support for setting the link section.
1006 * jit-recording.h: New function (set_link_section) and new
1007 field m_link_section.
1008 * libgccjit.c: New function (gcc_jit_lvalue_set_link_section).
1009 * libgccjit.h: New function (gcc_jit_lvalue_set_link_section).
1010 * libgccjit.map (LIBGCCJIT_ABI_18): New ABI tag.
1012 2021-12-12 Antoni Boucher <bouanto@zoho.com>
1015 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_17): New ABI
1017 * docs/topics/expressions.rst: Add document for the function
1018 gcc_jit_lvalue_set_tls_model.
1019 * jit-playback.h: New function (set_tls_model).
1020 * jit-recording.c: New function (set_tls_model), new
1021 variables (tls_models and tls_model_enum_strings) and support
1022 for setting the tls model.
1023 * jit-recording.h: New function (set_tls_model) and new
1025 * libgccjit.c: New function (gcc_jit_lvalue_set_tls_model).
1026 * libgccjit.h: New function (gcc_jit_lvalue_set_tls_model)
1027 and new enum (gcc_jit_tls_model).
1028 * libgccjit.map (LIBGCCJIT_ABI_17): New ABI tag.
1030 2021-12-11 Antoni Boucher <bouanto@zoho.com>
1034 * jit-builtins.c: Implement missing types for builtins.
1035 * jit-recording.c:: Allow sending a volatile const void * as
1037 * jit-recording.h: New functions (is_volatile, is_const) and
1038 allow comparing qualified types.
1040 2021-12-10 David Malcolm <dmalcolm@redhat.com>
1043 * jit-playback.c (gcc::jit::playback::context::new_function): Set
1044 DECL_CONTEXT of the result_decl.
1046 2021-11-27 Petter Tomner <tomner@kth.se>
1048 * libgccjit.c: %ld -> %zu
1050 2021-11-24 Martin Liska <mliska@suse.cz>
1052 * jit-playback.c (function): Initialize m_blocks vector.
1054 2021-11-20 Antoni Boucher <bouanto@zoho.com>
1057 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_16): New ABI tag.
1058 * docs/topics/functions.rst: Add documentation for the
1059 functions gcc_jit_function_get_return_type and
1060 gcc_jit_function_get_param_count
1061 * docs/topics/types.rst: Add documentation for the functions
1062 gcc_jit_function_type_get_return_type,
1063 gcc_jit_function_type_get_param_count,
1064 gcc_jit_function_type_get_param_type,
1065 gcc_jit_type_unqualified, gcc_jit_type_dyncast_array,
1066 gcc_jit_type_is_bool,
1067 gcc_jit_type_dyncast_function_ptr_type,
1068 gcc_jit_type_is_integral, gcc_jit_type_is_pointer,
1069 gcc_jit_type_dyncast_vector,
1070 gcc_jit_vector_type_get_element_type,
1071 gcc_jit_vector_type_get_num_units,
1072 gcc_jit_struct_get_field, gcc_jit_type_is_struct,
1073 and gcc_jit_struct_get_field_count
1075 (gcc_jit_function_get_return_type, gcc_jit_function_get_param_count,
1076 gcc_jit_function_type_get_return_type,
1077 gcc_jit_function_type_get_param_count,
1078 gcc_jit_function_type_get_param_type, gcc_jit_type_unqualified,
1079 gcc_jit_type_dyncast_array, gcc_jit_type_is_bool,
1080 gcc_jit_type_dyncast_function_ptr_type, gcc_jit_type_is_integral,
1081 gcc_jit_type_is_pointer, gcc_jit_type_dyncast_vector,
1082 gcc_jit_vector_type_get_element_type,
1083 gcc_jit_vector_type_get_num_units, gcc_jit_struct_get_field,
1084 gcc_jit_type_is_struct, gcc_jit_struct_get_field_count): New
1086 (struct gcc_jit_function_type, struct gcc_jit_vector_type):
1089 (gcc_jit_function_get_return_type, gcc_jit_function_get_param_count,
1090 gcc_jit_function_type_get_return_type,
1091 gcc_jit_function_type_get_param_count,
1092 gcc_jit_function_type_get_param_type, gcc_jit_type_unqualified,
1093 gcc_jit_type_dyncast_array, gcc_jit_type_is_bool,
1094 gcc_jit_type_dyncast_function_ptr_type, gcc_jit_type_is_integral,
1095 gcc_jit_type_is_pointer, gcc_jit_type_dyncast_vector,
1096 gcc_jit_vector_type_get_element_type,
1097 gcc_jit_vector_type_get_num_units, gcc_jit_struct_get_field,
1098 gcc_jit_type_is_struct, gcc_jit_struct_get_field_count): New
1099 function declarations.
1100 (struct gcc_jit_function_type, struct gcc_jit_vector_type):
1102 * jit-recording.h: New functions (is_struct and is_vector)
1103 * libgccjit.map (LIBGCCJIT_ABI_16): New ABI tag.
1105 2021-11-12 David Malcolm <dmalcolm@redhat.com>
1108 * docs/examples/tut04-toyvm/toyvm.c (toyvm_function_compile):
1109 Increase size of buffer.
1110 * docs/examples/tut04-toyvm/toyvm.cc
1111 (compilation_state::create_function): Likewise.
1113 2021-09-10 Petter Tomner <tomner@kth.se>
1115 * jit-playback.c: Moved global var processing to after loc handling.
1116 Setting TYPE_NAME for fundamental types.
1117 Using common functions for finalizing globals.
1118 * jit-playback.h: New method init_types().
1119 Changed get_tree_node_for_type() to method.
1121 2021-08-19 Iain Sandoe <iain@sandoe.co.uk>
1123 * docs/examples/tut04-toyvm/toyvm.c: Include jit-dejagnu.h.
1124 * docs/examples/tut04-toyvm/toyvm.cc: Likewise.
1125 * jit-dejagnu.h: New file, imported from dejagnu-1.6.2 and
1126 patched for this application.
1128 2021-08-18 Iain Sandoe <iain@sandoe.co.uk>
1131 * Make-lang.in: Provide clauses for Darwin hosts.
1133 2021-07-18 Antoni Boucher <bouanto@zoho.com>
1136 * jit-playback.c (convert): Add support to handle truncation and
1137 extension in the convert function.
1139 2021-05-19 Martin Liska <mliska@suse.cz>
1142 * libgccjit.c (gcc_jit_context_new_function): Fix typos.
1144 2021-03-24 Matthias Klose <doko@ubuntu.com>
1146 * Make-lang.in (jit.sphinx.html, jit.sphinx.pdf): Use $(mkinstalldirs),
1147 (jit.install-headers): Depend on installdirs.
1149 2021-02-19 David Malcolm <dmalcolm@redhat.com>
1153 (gcc::jit::builtins_manager::get_builtin_function_by_id):
1154 Update assertion to reject BUILT_IN_NONE.
1155 (gcc::jit::builtins_manager::ensure_optimization_builtins_exist):
1158 (gcc::jit::builtins_manager::ensure_optimization_builtins_exist):
1160 * jit-playback.c (gcc::jit::playback::context::replay): Call it.
1161 Remove redundant conditional on bm.
1163 2021-01-14 David Malcolm <dmalcolm@redhat.com>
1165 * docs/cp/index.rst: Remove "Alpha" warning.
1166 * docs/index.rst: Likewise.
1167 * docs/_build/texinfo/libgccjit.texi: Regenerate
1169 2020-11-25 Martin Sebor <msebor@redhat.com>
1172 * jit-recording.c (recording::function::dump_to_dot): Avoid
1174 (recording::block::dump_to_dot): Same.
1176 2020-11-20 Jakub Jelinek <jakub@redhat.com>
1179 * Make-lang.in (jit.serial): Change from goal to a
1181 (.PHONY): Drop jit.serial and jit.prev.
1182 ($(LIBGCCJIT_FILENAME)): Depend on $(jit.serial) rather than
1185 2020-11-18 Jakub Jelinek <jakub@redhat.com>
1187 * Make-lang.in (jit.serial): New goal.
1188 (.PHONY): Add jit.serial jit.prev.
1189 ($(LIBGCCJIT_FILENAME)): Depend on jit.prev. Call LINK_PROGRESS.
1191 2020-11-12 David Malcolm <dmalcolm@redhat.com>
1194 * docs/cp/topics/asm.rst: New file.
1195 * docs/cp/topics/index.rst (Topic Reference): Add it.
1196 * docs/topics/asm.rst: New file.
1197 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_15): New.
1198 * docs/topics/functions.rst (Statements): Add link to extended
1200 * docs/topics/index.rst (Topic Reference): Add asm.rst.
1201 * docs/topics/objects.rst: Add gcc_jit_extended_asm to ASCII art.
1202 * docs/_build/texinfo/Makefile: Regenerate.
1203 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1204 * jit-common.h (gcc::jit::recording::extended_asm): New forward
1206 (gcc::jit::recording::top_level_asm): Likewise.
1207 * jit-playback.c: Include "stmt.h".
1208 (build_string): New.
1209 (gcc::jit::playback::context::new_string_literal): Disambiguate
1211 (gcc::jit::playback::context::add_top_level_asm): New.
1212 (build_operand_chain): New.
1213 (build_clobbers): New.
1214 (build_goto_operands): New.
1215 (gcc::jit::playback::block::add_extended_asm): New.
1216 * jit-playback.h (gcc::jit::playback::context::add_top_level_asm):
1218 (struct gcc::jit::playback::asm_operand): New struct.
1219 (gcc::jit::playback::block::add_extended_asm): New decl.
1220 * jit-recording.c (gcc::jit::recording::context::dump_to_file):
1221 Dump top-level asms.
1222 (gcc::jit::recording::context::add_top_level_asm): New.
1223 (gcc::jit::recording::block::add_extended_asm): New.
1224 (gcc::jit::recording::block::end_with_extended_asm_goto): New.
1225 (gcc::jit::recording::asm_operand::asm_operand): New.
1226 (gcc::jit::recording::asm_operand::print): New.
1227 (gcc::jit::recording::asm_operand::make_debug_string): New.
1228 (gcc::jit::recording::output_asm_operand::write_reproducer): New.
1229 (gcc::jit::recording::output_asm_operand::print): New.
1230 (gcc::jit::recording::input_asm_operand::write_reproducer): New.
1231 (gcc::jit::recording::input_asm_operand::print): New.
1232 (gcc::jit::recording::extended_asm::add_output_operand): New.
1233 (gcc::jit::recording::extended_asm::add_input_operand): New.
1234 (gcc::jit::recording::extended_asm::add_clobber): New.
1235 (gcc::jit::recording::extended_asm::replay_into): New.
1236 (gcc::jit::recording::extended_asm::make_debug_string): New.
1237 (gcc::jit::recording::extended_asm::write_flags): New.
1238 (gcc::jit::recording::extended_asm::write_clobbers): New.
1239 (gcc::jit::recording::extended_asm_simple::write_reproducer): New.
1240 (gcc::jit::recording::extended_asm::maybe_populate_playback_blocks):
1242 (gcc::jit::recording::extended_asm_goto::extended_asm_goto): New.
1243 (gcc::jit::recording::extended_asm_goto::replay_into): New.
1244 (gcc::jit::recording::extended_asm_goto::write_reproducer): New.
1245 (gcc::jit::recording::extended_asm_goto::get_successor_blocks):
1247 (gcc::jit::recording::extended_asm_goto::maybe_print_gotos): New.
1248 (gcc::jit::recording::extended_asm_goto::maybe_populate_playback_blocks):
1250 (gcc::jit::recording::top_level_asm::top_level_asm): New.
1251 (gcc::jit::recording::top_level_asm::replay_into): New.
1252 (gcc::jit::recording::top_level_asm::make_debug_string): New.
1253 (gcc::jit::recording::top_level_asm::write_to_dump): New.
1254 (gcc::jit::recording::top_level_asm::write_reproducer): New.
1256 (gcc::jit::recording::context::add_top_level_asm): New decl.
1257 (gcc::jit::recording::context::m_top_level_asms): New field.
1258 (gcc::jit::recording::block::add_extended_asm): New decl.
1259 (gcc::jit::recording::block::end_with_extended_asm_goto): New
1261 (gcc::jit::recording::asm_operand): New class.
1262 (gcc::jit::recording::output_asm_operand): New class.
1263 (gcc::jit::recording::input_asm_operand): New class.
1264 (gcc::jit::recording::extended_asm): New class.
1265 (gcc::jit::recording::extended_asm_simple): New class.
1266 (gcc::jit::recording::extended_asm_goto): New class.
1267 (gcc::jit::recording::top_level_asm): New class.
1268 * libgccjit++.h (gccjit::extended_asm): New forward decl.
1269 (gccjit::context::add_top_level_asm): New.
1270 (gccjit::block::add_extended_asm): New.
1271 (gccjit::block::end_with_extended_asm_goto): New.
1272 (gccjit::extended_asm): New class.
1273 (gccjit::extended_asm::extended_asm): New ctors.
1274 (gccjit::extended_asm::set_volatile_flag): New.
1275 (gccjit::extended_asm::set_inline_flag): New.
1276 (gccjit::extended_asm::add_output_operand): New.
1277 (gccjit::extended_asm::add_input_operand): New.
1278 (gccjit::extended_asm::add_clobber): New.
1279 (gccjit::extended_asm::get_inner_extended_asm): New.
1280 * libgccjit.c (struct gcc_jit_extended_asm): New.
1281 (jit_error): Make "loc" param take a gcc::jit::recording::location *
1282 rather than a gcc_jit_location *.
1283 (gcc_jit_block_add_extended_asm): New entrypoint.
1284 (gcc_jit_block_end_with_extended_asm_goto): New entrypoint.
1285 (gcc_jit_extended_asm_as_object): New entrypoint.
1286 (gcc_jit_extended_asm_set_volatile_flag): New entrypoint.
1287 (gcc_jit_extended_asm_set_inline_flag): New entrypoint.
1288 (gcc_jit_extended_asm_add_output_operand): New entrypoint.
1289 (gcc_jit_extended_asm_add_clobber): New entrypoint.
1290 (gcc_jit_context_add_top_level_asm): New entrypoint.
1291 * libgccjit.h: Add gcc_jit_extended_asm to ASCII art.
1292 (gcc_jit_extended_asm): New typedef.
1293 (LIBGCCJIT_HAVE_ASM_STATEMENTS): New define.
1294 (gcc_jit_block_add_extended_asm): New entrypoint.
1295 (gcc_jit_block_end_with_extended_asm_goto): New entrypoint.
1296 (gcc_jit_extended_asm_as_object): New entrypoint.
1297 (gcc_jit_extended_asm_set_volatile_flag): New entrypoint.
1298 (gcc_jit_extended_asm_set_inline_flag): New entrypoint.
1299 (gcc_jit_extended_asm_add_output_operand): New entrypoint.
1300 (gcc_jit_extended_asm_add_input_operand): New entrypoint.
1301 (gcc_jit_extended_asm_add_clobber): New entrypoint.
1302 (gcc_jit_context_add_top_level_asm): New entrypoint.
1303 * libgccjit.map (LIBGCCJIT_ABI_15): New.
1305 2020-11-12 David Malcolm <dmalcolm@redhat.com>
1307 * jit-recording.c (recording::context::new_string): Add "escaped"
1308 param and use it when creating the new recording::string instance.
1309 (recording::string::string): Add "escaped" param and use it to
1310 initialize m_escaped.
1311 (recording::string::make_debug_string): Replace check that first
1312 char is double-quote with use of m_escaped. Fix escaping of
1313 '\t' and '\n'. Set "escaped" on the result.
1314 * jit-recording.h (recording::context::new_string): Add "escaped"
1316 (recording::string::string): Add "escaped" param.
1317 (recording::string::m_escaped): New field.
1319 2020-11-12 David Malcolm <dmalcolm@redhat.com>
1321 * libgccjit.h: Fix typo in comment.
1323 2020-09-14 Andrea Corallo <andrea.corallo@arm.com>
1325 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1327 2020-09-11 Andrea Corallo <andrea.corallo@arm.com>
1329 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_14): New ABI tag.
1330 * docs/topics/expressions.rst (gcc_jit_global_set_initializer):
1331 Document new entry point in section 'Global variables'.
1332 * jit-playback.c (global_new_decl, global_finalize_lvalue): New
1334 (playback::context::new_global): Make use of global_new_decl,
1335 global_finalize_lvalue.
1336 (load_blob_in_ctor): New template function in use by the
1338 (playback::context::new_global_initialized): New method.
1339 * jit-playback.h (class context): Decl 'new_global_initialized',
1340 'global_new_decl', 'global_finalize_lvalue'.
1341 (lvalue::set_initializer): Add implementation.
1342 * jit-recording.c (recording::memento_of_get_pointer::get_size)
1343 (recording::memento_of_get_type::get_size): Add implementation.
1344 (recording::global::write_initializer_reproducer): New function in
1345 use by 'recording::global::write_reproducer'.
1346 (recording::global::replay_into)
1347 (recording::global::write_to_dump)
1348 (recording::global::write_reproducer): Handle
1350 * jit-recording.h (class type): Decl 'get_size' and
1352 * libgccjit++.h (class lvalue): Declare new 'set_initializer'
1354 (class lvalue): Decl 'is_global' and 'set_initializer'.
1355 (class global) Decl 'write_initializer_reproducer'. Add
1356 'm_initializer', 'm_initializer_num_bytes' fields. Implement
1357 'set_initializer'. Add a destructor to free 'm_initializer'.
1358 * libgccjit.c (gcc_jit_global_set_initializer): New function.
1359 * libgccjit.h (gcc_jit_global_set_initializer): New function
1361 * libgccjit.map (LIBGCCJIT_ABI_14): New ABI tag.
1363 2020-08-28 Martin Sebor <msebor@redhat.com>
1365 * jit-recording.c (recording::switch_::make_debug_string): Add argument
1368 2020-08-22 Andrea Corallo <andrea.corallo@arm.com>
1371 (gcc_jit_context_new_rvalue_from_int)
1372 (gcc_jit_context_new_rvalue_from_long)
1373 (gcc_jit_context_new_rvalue_from_double)
1374 (gcc_jit_context_new_rvalue_from_ptr): Update function heading
1377 2020-06-16 Nicolas Bértolo <nicolasbertolo@gmail.com>
1379 * Make-lang.in: Always define version, minor and release
1380 numbers. Create the Windows shared library as
1381 libgccjit-$(LIBGCCJIT_VERSION_NUM).dll.
1383 2020-06-03 David Malcolm <dmalcolm@redhat.com>
1386 * jit-builtins.c (builtins_manager::make_primitive_type):
1387 Implement BT_CONST_VOLATILE_PTR.
1389 2020-06-02 David Malcolm <dmalcolm@redhat.com>
1392 * dummy-frontend.c: Include "options.h", "stringpool.h", and
1394 (ATTR_EXCL): New, copied from lto/lto-lang.c.
1395 (attr_noreturn_exclusions): Likewise.
1396 (attr_returns_twice_exclusions): Likewise.
1397 (attr_const_pure_exclusions): Likewise.
1398 (jit_attribute_table): Likewise, copied from lto_attribute_table.
1399 (jit_format_attribute_table): Likewise, copied from
1400 lto_format_attribute_table.
1401 (handle_noreturn_attribute): New, copied from lto/lto-lang.c.
1402 (handle_leaf_attribute): Likewise.
1403 (handle_const_attribute): Likewise.
1404 (handle_malloc_attribute): Likewise.
1405 (handle_pure_attribute): Likewise.
1406 (handle_novops_attribute): Likewise.
1407 (get_nonnull_operand): Likewise.
1408 (handle_nonnull_attribute): Likewise.
1409 (handle_nothrow_attribute): Likewise.
1410 (handle_sentinel_attribute): Likewise.
1411 (handle_type_generic_attribute): Likewise.
1412 (handle_transaction_pure_attribute): Likewise.
1413 (handle_returns_twice_attribute): Likewise.
1414 (handle_patchable_function_entry_attribute): Likewise.
1415 (ignore_attribute): Likewise.
1416 (handle_format_attribute): Likewise.
1417 (handle_format_arg_attribute): Likewise.
1418 (handle_fnspec_attribute): Likewise.
1419 (LANG_HOOKS_COMMON_ATTRIBUTE_TABLE): Define.
1420 (LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE): Define.
1422 2020-05-28 Nicolas Bértolo <nicolasbertolo@gmail.com>
1424 * Make-lang.in: Remove extra slash. Build libgccjit.dll and its
1425 import library in Windows.
1426 * config-lang.in: Update comment about --enable-host-shared.
1427 * jit-w32.h: New file.
1428 * jit-w32.c: New file.
1429 (print_last_error): New function that prints the error
1430 string corresponding to GetLastError().
1431 (get_TOKEN_USER_current_user): Helper function used for getting
1432 the SID belonging to the current user.
1433 (create_directory_for_current_user): Helper function to create
1434 a directory with permissions such that only the current user can
1436 (win_mkdtemp): Create a temporary directory using Windows APIs.
1437 * jit-playback.c: Do not chmod files in Windows. Use LoadLibrary,
1438 FreeLibrary and GetProcAddress instead of libdl.
1439 * jit-result.h, jit-result.c: Introduce result::handle_t to
1440 abstract over the types used for dynamic library handles.
1441 * jit-tempdir.c: Do not use mkdtemp() in Windows, use
1444 2020-05-27 David Malcolm <dmalcolm@redhat.com>
1447 * dummy-frontend.c (LANG_HOOKS_DEEP_UNSHARING): Define to be true.
1448 * jit-playback.h (gcc::jit::playback::rvalue): Mark tree node with
1451 2020-05-27 Tom Tromey <tromey@gcc.gnu.org>
1454 * docs/conf.py (texinfo_documents): Set description.
1455 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1457 2020-05-26 David Malcolm <dmalcolm@redhat.com>
1460 * docs/topics/functions.rst
1461 (gcc_jit_context_get_builtin_function): Document.
1462 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1463 * dummy-frontend.c (jit_langhook_global_bindings_p): Remove
1465 * jit-builtins.c (type_names): New array.
1466 (get_string_for_type_id): New function.
1467 (gcc::jit::builtins_manager::make_primitive_type): Show name of
1468 type in error messages. Update cases to reflect the order in
1469 builtin-types.def. Implement cases for BT_INT8, BT_INT16,
1470 BT_UINT8, BT_CONST_PTR, BT_VOLATILE_PTR, BT_INT_PTR, BT_FLOAT_PTR,
1471 BT_CONST_DOUBLE_PTR, BT_SIZE, BT_CONST_SIZE.
1473 2020-05-26 David Malcolm <dmalcolm@redhat.com>
1475 * docs/topics/compatibility.rst: Fix underline.
1477 * docs/topics/types.rst: Fix missing blank line.
1478 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1480 2020-05-26 David Malcolm <dmalcolm@redhat.com>
1483 * docs/topics/expressions.rst (Unary Operations): Document that
1484 result_type of gcc_jit_context_new_unary_op must be a numeric type.
1485 (Binary Operations): Likewise for gcc_jit_context_new_binary_op.
1486 (Global variables): Document that "type" of
1487 gcc_jit_context_new_global must be non-`void`.
1488 * docs/topics/function-pointers.rst
1489 (gcc_jit_context_new_function_ptr_type): Document that the
1490 param_types must be non-void, but that return_type may be.
1491 * docs/topics/functions.rst (Params): Document that
1492 gcc_jit_context_new_param's type must be non-void.
1493 (Functions): Likewise for gcc_jit_function_new_local.
1494 * docs/topics/types.rst (gcc_jit_context_new_array_type): Document
1495 that the type must be non-void.
1496 (gcc_jit_context_new_field): Likewise.
1497 * docs/_build/texinfo/Makefile: Regenerate.
1498 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1499 * libgccjit.c (gcc_jit_context_new_array_type): Fail if
1500 element_type is void.
1501 (gcc_jit_context_new_field): Likewise for "type".
1502 (gcc_jit_context_new_function_ptr_type): Likewise for each
1503 element of param_types.
1504 (gcc_jit_context_new_param): Likewise for "type".
1505 (gcc_jit_context_new_global): Likewise.
1506 (gcc_jit_function_new_local): Likewise.
1507 (gcc_jit_type_get_aligned): Likewise.
1509 2020-03-31 Andrea Corallo <andrea.corallo@arm.com>
1510 David Malcolm <dmalcolm@redhat.com>
1512 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_13): New ABI tag
1513 plus add version paragraph.
1514 * libgccjit++.h (namespace gccjit::version): Add new namespace.
1515 * libgccjit.c (gcc_jit_version_major, gcc_jit_version_minor)
1516 (gcc_jit_version_patchlevel): New functions.
1517 * libgccjit.h (LIBGCCJIT_HAVE_gcc_jit_version): New macro.
1518 (gcc_jit_version_major, gcc_jit_version_minor)
1519 (gcc_jit_version_patchlevel): New functions.
1520 * libgccjit.map (LIBGCCJIT_ABI_13) New ABI tag.
1522 2020-03-23 Andrea Corallo <andrea.corallo@arm.com>
1525 (gcc::jit::playback::context m_recording_ctxt): Remove
1526 m_char_array_type_node field.
1528 (playback::context::context) Remove m_char_array_type_node from member
1530 (playback::context::new_string_literal) Fix logic to handle string
1533 2020-01-01 Jakub Jelinek <jakub@redhat.com>
1535 Update copyright years.
1537 2019-11-29 Julian Brown <julian@codesourcery.com>
1539 * jit-builtins.c (BT_DFLOAT32_PTR, BT_DFLOAT64_PTR, BT_DFLOAT128_PTR):
1540 Remove commented-out cases.
1542 2019-11-20 David Malcolm <dmalcolm@redhat.com>
1545 * jit-playback.c (gcc::jit::playback::context::make_fake_args):
1546 Update GCC_JIT_BOOL_OPTION_SELFCHECK_GC for new --param syntax.
1548 2019-08-13 Richard Sandiford <richard.sandiford@arm.com>
1551 * jit-playback.c (new_function): Use set_decl_built_in_function.
1553 2019-07-22 Andrea Corallo <andrea.corallo@arm.com>
1555 * jit-recording.c (unary_op_reproducer_strings): Make it extern.
1556 (binary_op_reproducer_strings): Likewise.
1557 * jit-recording.h (unary_op_reproducer_strings): Likewise.
1558 (binary_op_reproducer_strings): Likewise.
1559 * libgccjit.c (gcc_jit_context_new_unary_op): Check result_type to be a
1561 * libgccjit.c (gcc_jit_context_new_binary_op): Improve error message.
1563 2019-07-04 Andrea Corallo <andrea.corallo@arm.com>
1565 * libgccjit.c (gcc_jit_context_new_binary_op): Check result_type to be a
1568 2019-07-04 Andrea Corallo <andrea.corallo@arm.com>
1570 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_12): New ABI tag.
1571 * docs/topics/types.rst: Add gcc_jit_context_new_bitfield.
1572 * jit-common.h (namespace recording): Add class bitfield.
1574 (DECL_C_BIT_FIELD, SET_DECL_C_BIT_FIELD): Add macros.
1575 (playback::context::new_bitfield): New method.
1576 (playback::compound_type::set_fields): Add bitfield support.
1577 (playback::lvalue::mark_addressable): Was jit_mark_addressable make this
1578 a method of lvalue plus return a bool to communicate success.
1579 (playback::lvalue::get_address): Check for jit_mark_addressable return
1581 * jit-playback.h (new_bitfield): New method.
1582 (class bitfield): New class.
1583 (class lvalue): Add jit_mark_addressable method.
1584 * jit-recording.c (recording::context::new_bitfield): New method.
1585 (recording::bitfield::replay_into): New method.
1586 (recording::bitfield::write_to_dump): Likewise.
1587 (recording::bitfield::make_debug_string): Likewise.
1588 (recording::bitfield::write_reproducer): Likewise.
1589 * jit-recording.h (class context): Add new_bitfield method.
1590 (class field): Make it derivable by class bitfield.
1591 (class bitfield): Add new class.
1592 * libgccjit++.h (class context): Add new_bitfield method.
1593 * libgccjit.c (struct gcc_jit_bitfield): New structure.
1594 (gcc_jit_context_new_bitfield): New function.
1596 (LIBGCCJIT_HAVE_gcc_jit_context_new_bitfield) New macro.
1597 (gcc_jit_context_new_bitfield): New function.
1598 * libgccjit.map (LIBGCCJIT_ABI_12) New ABI tag.
1600 2019-03-21 Jakub Jelinek <jakub@redhat.com>
1602 * jit-recording.c (reproducer::m_set_identifiers): Use false as Lazy
1603 in hash_set template param.
1605 2019-02-05 Andrea Corallo <andrea.corallo@arm.com>
1607 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_11): New ABI tag.
1608 * docs/topics/contexts.rst (Additional driver options): New
1610 * jit-playback.c (invoke_driver): Add call to append_driver_options.
1611 * jit-recording.c: Within namespace gcc::jit...
1612 (recording::context::~context): Free the optnames within
1614 (recording::context::add_driver_option): New method.
1615 (recording::context::append_driver_options): New method.
1616 (recording::context::dump_reproducer_to_file): Add driver
1618 * jit-recording.h: Within namespace gcc::jit...
1619 (recording::context::add_driver_option): New method.
1620 (recording::context::append_driver_options): New method.
1621 (recording::context::m_driver_options): New field.
1622 * libgccjit++.h (gccjit::context::add_driver_option): New
1624 * libgccjit.c (gcc_jit_context_add_driver_option): New API
1626 * libgccjit.h (gcc_jit_context_add_driver_option): New API
1628 (LIBGCCJIT_HAVE_gcc_jit_context_add_driver_option): New
1630 * libgccjit.map (LIBGCCJIT_ABI_11): New ABI tag.
1632 2019-01-01 Jakub Jelinek <jakub@redhat.com>
1634 Update copyright years.
1636 2018-11-15 David Malcolm <dmalcolm@redhat.com>
1639 * dummy-frontend.c (jit_begin_diagnostic): Add diagnostic_t param.
1641 2018-11-13 David Malcolm <dmalcolm@redhat.com>
1643 * jit-playback.c: Replace "source_location" with "location_t".
1645 2018-10-17 David Malcolm <dmalcolm@redhat.com>
1647 * Make-lang.in (selftest-jit): New.
1649 2018-06-28 Martin Liska <mliska@suse.cz>
1651 * jit-playback.c: Include opt-suggestions.h.
1653 2018-06-28 Martin Liska <mliska@suse.cz>
1655 * jit-playback.c (class auto_argvec): Moved to vec.h.
1656 (auto_argvec::~auto_argvec): Likewise.
1657 (compile): Use the renamed name.
1658 (invoke_driver): Likewise.
1660 2018-03-21 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1663 * Make-lang.in ($(LIBGCCJIT_FILENAME)): Add $(EXTRA_GCC_LIBS).
1665 2018-03-09 David Malcolm <dmalcolm@redhat.com>
1666 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
1670 * Make-lang.in (COMMA): New.
1671 (LIBGCCJIT_VERSION_SCRIPT_OPTION): New.
1672 (LIBGCCJIT_SONAME_OPTION): New.
1673 (jit): Move --version-script and -soname linker options to the
1676 2018-01-25 David Malcolm <dmalcolm@redhat.com>
1679 * jit-recording.h (gcc::jit::recording::union_): Remove fields
1680 "m_loc" and "m_name".
1682 2018-01-03 Jakub Jelinek <jakub@redhat.com>
1684 Update copyright years.
1686 2017-12-19 Jakub Jelinek <jakub@redhat.com>
1688 * jit-playback.c (get_type, playback::compile_to_file::copy_file,
1689 playback::context::acquire_mutex): Replace Yoda conditions with
1690 typical order conditions.
1691 * libgccjit.c (gcc_jit_context_new_struct_type,
1692 gcc_jit_struct_set_fields, gcc_jit_context_new_union_type,
1693 gcc_jit_context_new_function, gcc_jit_timer_pop): Likewise.
1694 * jit-builtins.c (matches_builtin): Likewise.
1695 * jit-recording.c (recording::compound_type::set_fields,
1696 recording::fields::write_reproducer, recording::rvalue::set_scope,
1697 recording::function::validate): Likewise.
1698 * jit-logging.c (logger::decref): Likewise.
1700 2017-11-30 Jakub Jelinek <jakub@redhat.com>
1703 (recording::memento_of_new_rvalue_from_const <long>::write_reproducer):
1704 Use ; instead of ;;.
1706 2017-11-28 Jakub Jelinek <jakub@redhat.com>
1708 * jit-playback.c (add_switch): Build SWITCH_EXPR using build2 instead
1709 of build3. Formatting fixes. Adjust funciton comment.
1711 2017-11-23 Tom de Vries <tom@codesourcery.com>
1713 * libgccjit.c (RETURN_NULL_IF_FAIL_NONNULL_NUMERIC_TYPE): Wrap in
1714 JIT_{BEGIN,END}_STMT.
1716 2017-10-31 David Malcolm <dmalcolm@redhat.com>
1718 * docs/internals/index.rst (Running the test suite): Document
1719 PRESERVE_EXECUTABLES.
1720 (Running under valgrind): Add markup to RUN_UNDER_VALGRIND.
1721 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1723 2017-10-04 David Malcolm <dmalcolm@redhat.com>
1725 * docs/cp/topics/expressions.rst (Vector expressions): New
1727 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_10): New ABI tag.
1728 * docs/topics/expressions.rst (Vector expressions): New section.
1729 * docs/topics/types.rst (gcc_jit_type_get_vector): Add link to
1730 gcc_jit_context_new_rvalue_from_vector.
1731 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1732 * jit-common.h (gcc::jit:recording::vector_type): New forward
1735 (gcc::jit::playback::context::new_rvalue_from_vector): New method.
1737 (gcc::jit::playback::context::new_rvalue_from_vector): New method.
1738 * jit-recording.c: In namespace gcc::jit::
1739 (class comma_separated_string): New class.
1740 (comma_separated_string::comma_separated_string): New ctor,
1741 adapted from recording::call::make_debug_string.
1742 (comma_separated_string::~comma_separated_string): New dtor.
1743 In namespace gcc::jit::recording::
1744 (context::new_rvalue_from_vector): New method.
1745 (type::get_vector): Update for renaming of memento_of_get_vector.
1746 (class memento_of_get_vector): Rename to...
1747 (class vector_type): ..this.
1748 (memento_of_new_rvalue_from_vector::memento_of_new_rvalue_from_vector):
1750 (memento_of_new_rvalue_from_vector::replay_into): New method.
1751 (memento_of_new_rvalue_from_vector::visit_children): New method.
1752 (memento_of_new_rvalue_from_vector::make_debug_string): New
1754 (memento_of_new_rvalue_from_vector::write_reproducer): New method.
1755 (call::make_debug_string): Split out arg-printing code into ctor
1756 for comma_separated_string.
1757 * jit-recording.h: In namespace gcc::jit::recording::
1758 (context::new_rvalue_from_vector): New method.
1759 (type::dyn_cast_vector_type): New virtual function.
1760 (class memento_of_get_vector): Rename to...
1761 (class vector_type): ...this.
1762 (vector_type::unqualified): Remove this vfunc override in favor
1764 (vector_type::get_element_type): ...this new method.
1765 (vector_type::get_num_units): New method.
1766 (vector_type::dyn_cast_vector_type): New vfunc override.
1767 (class memento_of_new_rvalue_from_vector): New class.
1768 * libgccjit++.h (gccjit::context::new_rvalue): Add overload for
1770 * libgccjit.c (gcc_jit_context_new_binary_op): Strip off type
1771 qualifications when checking that both operands have same type.
1772 (gcc_jit_context_new_rvalue_from_vector): New API entrypoint.
1774 (LIBGCCJIT_HAVE_gcc_jit_context_new_rvalue_from_vector): New
1776 (gcc_jit_context_new_rvalue_from_vector): New API entrypoint.
1777 * libgccjit.map (LIBGCCJIT_ABI_10): New ABI tag.
1779 2017-09-28 David Malcolm <dmalcolm@redhat.com>
1781 * docs/topics/expressions.rst (Function calls): Add link to
1782 gcc_jit_context_new_function_ptr_type.
1783 (Function pointers): Convert to cross-references to
1784 function-pointers.rst, moving material there.
1785 * docs/topics/function-pointers.rst: New page.
1786 * docs/topics/index.rst: Add function-pointers.rst.
1787 * docs/topics/types.rst (Function pointer types): New section.
1788 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1790 2017-09-28 David Malcolm <dmalcolm@redhat.com>
1793 (gcc::jit::recording::function_type::is_same_type_as): New function.
1794 * jit-recording.h: In namespace gcc::jit::recording::
1795 (type::accepts_writes_from): Use is_same_type_as rather than pointer
1797 (type::is_same_type_as): New virtual function.
1798 (function_type::is_same_type_as): New override.
1800 2017-09-27 David Malcolm <dmalcolm@redhat.com>
1802 * docs/cp/topics/expressions.rst (Function pointers): New section.
1803 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_9): New tag.
1804 * docs/topics/expressions.rst (Function pointers): New section.
1805 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1806 * jit-common.h (class gcc::jit::recording::function_pointer): New
1808 * jit-playback.c (gcc::jit::playback::function::get_address): New
1810 * jit-playback.h (gcc::jit::playback::function::get_address): New
1812 * jit-recording.c: Within namespace gcc::jit::recording...
1813 (function::function): Initialize new field "m_fn_ptr_type".
1814 (function::get_address): New method.
1815 (function_pointer::replay_into): New method.
1816 (function_pointer::visit_children): New method.
1817 (function_pointer::make_debug_string): New method.
1818 (function_pointer::write_reproducer): New method.
1819 * jit-recording.h: Within namespace gcc::jit::recording...
1820 (function::get_address): New method.
1821 (function): Add field "m_fn_ptr_type".
1822 (class function_pointer): New subclass of rvalue.
1823 * libgccjit++.h (gccjit::function::get_address): New method.
1824 * libgccjit.c (gcc_jit_function_get_address): New function.
1825 * libgccjit.h (LIBGCCJIT_HAVE_gcc_jit_function_get_address): New
1827 (gcc_jit_function_get_address): New API entrypoint.
1828 * libgccjit.map (LIBGCCJIT_ABI_9): New tag.
1830 2017-09-14 David Malcolm <dmalcolm@redhat.com>
1833 * jit-builtins.c (matches_builtin): Ignore entries with a NULL
1836 2017-08-18 David Malcolm <dmalcolm@redhat.com>
1838 PR tree-optimization/46805
1839 * dummy-frontend.c (jit_langhook_parse_file): Handle vector types.
1841 2017-08-18 David Malcolm <dmalcolm@redhat.com>
1843 * jit-recording.c (class gcc::jit::reproducer): Rename field
1844 "m_identifiers" to "m_map_memento_to_identifier". Add field
1845 "m_set_identifiers" and struct hash_traits for it.
1846 (gcc::jit::reproducer::reproducer): Update for above.
1847 (convert_to_identifier): New function.
1848 (gcc::jit::reproducer::ensure_identifier_is_unique): New method.
1849 (gcc::jit::reproducer::make_identifier): Avoid appending the %p
1850 unless necessary for uniqueness. Update for field renaming.
1851 (gcc::jit::reproducer::get_identifier): Update for field renaming.
1853 2017-08-09 David Malcolm <dmalcolm@redhat.com>
1855 * docs/cp/topics/types.rst (Vector types): New section.
1856 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_8): New tag.
1857 * docs/topics/types.rst (gcc_jit_context_get_type): Fix typo in
1859 (Vector types): New section.
1860 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1861 * jit-playback.c (gcc::jit::playback::type::get_vector): New
1863 * jit-playback.h (gcc::jit::playback::type::get_vector): New
1865 * jit-recording.c: In namespace gcc::jit::recording::
1866 (type::get_vector): New method.
1867 (memento_of_get_aligned::write_reproducer): Fix typo
1869 (memento_of_get_vector::replay_into): New method.
1870 (memento_of_get_vector::make_debug_string): New method.
1871 (memento_of_get_vector::write_reproducer): New method.
1872 * jit-recording.h: In namespace gcc::jit::recording::
1873 (type::get_vector): New
1875 (class memento_of_get_vector): New class.
1876 * libgccjit++.h (gccjit::type::get_vector): New method.
1877 * libgccjit.c (gcc_jit_type_get_vector): New public entrypoint.
1878 * libgccjit.h (LIBGCCJIT_HAVE_gcc_jit_type_get_vector): New
1880 (gcc_jit_type_get_vector): New decl.
1881 * libgccjit.map (LIBGCCJIT_ABI_8): New ABI tag.
1883 2017-07-05 Richard Sandiford <richard.sandiford@linaro.org>
1884 Alan Hayward <alan.hayward@arm.com>
1885 David Sherwood <david.sherwood@arm.com>
1887 * dummy-frontend.c (jit_langhook_type_for_mode): Remove "enum" before
1890 2017-04-24 David Malcolm <dmalcolm@redhat.com>
1892 * docs/cp/topics/types.rst (gccjit::type::get_const): Remove
1894 (gccjit::type::get_aligned): Add.
1895 * docs/topics/compatibility.rst: Add LIBGCCJIT_ABI_7.
1896 * docs/topics/types.rst: Add gcc_jit_type_get_aligned.
1897 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1898 * jit-playback.c (gcc::jit::playback::type::get_aligned): New
1900 * jit-playback.h (gcc::jit::playback::type::get_aligned): New
1902 * jit-recording.c: Within namespace gcc::jit::recording...
1903 (type::get_aligned): New method.
1904 (memento_of_get_aligned::replay_into): New method.
1905 (memento_of_get_aligned::make_debug_string): New method.
1906 (memento_of_get_aligned::write_reproducer): New method.
1907 * jit-recording.h: Within namespace gcc::jit::recording...
1908 (type::get_aligned): New method.
1909 (type::accepts_writes_from): Strip off qualifications from
1910 this when comparing pointer equality.
1911 (decorated_type): New subclass of type, subsuming the
1912 commonality between memento_of_get_const and
1913 memento_of_get_volatile.
1914 (memento_of_get_const): Make a subclass of decorated_type,
1916 (memento_of_get_volatile): Likewise.
1917 (memento_of_get_aligned): Likewise.
1918 * libgccjit++.h: Within namespace gccjit...
1919 (type::get_const): New method.
1920 (type::get_aligned): New method.
1921 * libgccjit.c (gcc_jit_type_get_aligned): New function.
1922 * libgccjit.h (gcc_jit_type_get_aligned): New decl.
1923 * libgccjit.map (LIBGCCJIT_ABI_7): New
1924 (gcc_jit_type_get_aligned): Add.
1926 2017-01-19 David Malcolm <dmalcolm@redhat.com>
1928 * dummy-frontend.c (jit_langhook_type_for_size): Delete.
1929 (LANG_HOOKS_TYPE_FOR_SIZE): Don't redefine.
1931 2017-01-18 David Malcolm <dmalcolm@redhat.com>
1933 * dummy-frontend.c (jit_langhook_type_for_size): Implement, using
1934 lto's lto_type_for_size.
1936 2017-01-01 Jakub Jelinek <jakub@redhat.com>
1938 Update copyright years.
1940 2016-05-20 David Malcolm <dmalcolm@redhat.com>
1942 * docs/topics/compatibility.rst: Add LIBGCCJIT_ABI_6.
1943 * docs/topics/expressions.rst (Function calls): Add documentation
1944 of gcc_jit_rvalue_set_bool_require_tail_call.
1945 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1946 * jit-common.h (gcc::jit::recording::base_call): Add forward decl.
1947 * jit-playback.c: Within namespace gcc::jit::playback...
1948 (context::build_call) Add "require_tail_call" param and use it
1949 to set CALL_EXPR_MUST_TAIL_CALL.
1950 (context::new_call): Add "require_tail_call" param.
1951 (context::new_call_through_ptr): Likewise.
1952 * jit-playback.h: Within namespace gcc::jit::playback...
1953 (context::new_call: Add "require_tail_call" param.
1954 (context::new_call_through_ptr): Likewise.
1955 (context::build_call): Likewise.
1956 * jit-recording.c: Within namespace gcc::jit::recording...
1957 (base_call::base_call): New constructor.
1958 (base_call::write_reproducer_tail_call): New method.
1959 (call::call): Update for inheritance from base_call.
1960 (call::replay_into): Provide m_require_tail_call to call
1962 (call::write_reproducer): Call write_reproducer_tail_call.
1963 (call_through_ptr::call_through_ptr): Update for inheritance from
1965 (call_through_ptr::replay_into): Provide m_require_tail_call to call
1966 to new_call_through_ptr.
1967 (recording::call_through_ptr::write_reproducer): Call
1968 write_reproducer_tail_call.
1969 * jit-recording.h: Within namespace gcc::jit::recording...
1970 (rvalue::dyn_cast_base_call): New virtual function.
1971 (class base_call): New subclass of class rvalue.
1972 (class call): Inherit from base_call rather than directly from
1973 rvalue, moving get_precedence and m_args to base_call.
1974 (class call_through_ptr): Likewise.
1975 * libgccjit.c (gcc_jit_rvalue_set_bool_require_tail_call): New
1978 (LIBGCCJIT_HAVE_gcc_jit_rvalue_set_bool_require_tail_call): New
1980 (gcc_jit_rvalue_set_bool_require_tail_call): New function.
1981 * libgccjit.map (LIBGCCJIT_ABI_6): New.
1982 (gcc_jit_rvalue_set_bool_require_tail_call): Add.
1984 2016-05-17 David Malcolm <dmalcolm@redhat.com>
1986 * dummy-frontend.c: Include diagnostic.h.
1987 (jit_begin_diagnostic): New function.
1988 (jit_end_diagnostic): New function.
1989 (jit_langhook_init): Register jit_begin_diagnostic
1990 and jit_end_diagnostic with the global_dc.
1991 * jit-playback.c: Include diagnostic.h.
1992 (gcc::jit::playback::context::add_diagnostic): New method.
1993 * jit-playback.h (struct diagnostic_context): Add forward
1995 (gcc::jit::playback::context::add_diagnostic): New method.
1997 2016-05-17 David Malcolm <dmalcolm@redhat.com>
1999 * docs/topics/expressions.rst (Function calls): Document
2000 gcc_jit_context_new_call_through_ptr.
2001 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2003 2016-05-13 David Malcolm <dmalcolm@redhat.com>
2005 * jit-playback.h: Within namespace gcc:jit::playback...
2006 (compile_to_memory::postprocess): Mark with FINAL OVERRIDE.
2007 (compile_to_file::postprocess): Likewise.
2008 (function::finalizer): Likewise.
2009 (block::finalizer): Likewise.
2010 (source_file::finalizer): Likewise.
2011 (source_line::finalizer): Likewise.
2012 * jit-recording.c (gcc::jit::rvalue_usage_validator):: Likewise.
2013 * jit-recording.h: Within namespace gcc::jit::recording...
2014 (string::replay_into): Mark with FINAL OVERRIDE.
2015 (string::make_debug_string): Likewise.
2016 (string::write_reproducer): Likewise.
2017 (location::replay_into): Likewise.
2018 (location::dyn_cast_location): Likewise.
2019 (location::make_debug_string): Likewise.
2020 (location::write_reproducer): Likewise.
2021 (memento_of_get_type::dereference): Likewise.
2022 (memento_of_get_type::accepts_writes_from): Likewise.
2023 (memento_of_get_type::is_int): Likewise.
2024 (memento_of_get_type::is_float): Likewise.
2025 (memento_of_get_type::is_bool): Likewise.
2026 (memento_of_get_type::is_pointer): Likewise.
2027 (memento_of_get_type::is_array): Likewise.
2028 (memento_of_get_type::is_void): Likewise.
2029 (memento_of_get_type::replay_into): Likewise.
2030 (memento_of_get_type::make_debug_string): Likewise.
2031 (memento_of_get_type::write_reproducer): Likewise.
2032 (memento_of_get_pointer::dereference): Likewise.
2033 (memento_of_get_pointer::accepts_writes_from): Likewise.
2034 (memento_of_get_pointer::replay_into): Likewise.
2035 (memento_of_get_pointer::is_int): Likewise.
2036 (memento_of_get_pointer::is_float): Likewise.
2037 (memento_of_get_pointer::is_bool): Likewise.
2038 (memento_of_get_pointer::is_pointer): Likewise.
2039 (memento_of_get_pointer::is_array): Likewise.
2040 (memento_of_get_pointer::make_debug_string): Likewise.
2041 (memento_of_get_pointer::write_reproducer): Likewise.
2042 (memento_of_get_const::dereference): Likewise.
2043 (memento_of_get_const::accepts_writes_from): Likewise.
2044 (memento_of_get_const::unqualified): Likewise.
2045 (memento_of_get_const::is_int): Likewise.
2046 (memento_of_get_const::is_float): Likewise.
2047 (memento_of_get_const::is_bool): Likewise.
2048 (memento_of_get_const::is_pointer): Likewise.
2049 (memento_of_get_const::is_array): Likewise.
2050 (memento_of_get_const::void replay_into): Likewise;
2051 (memento_of_get_const::make_debug_string): Likewise.
2052 (memento_of_get_const::write_reproducer): Likewise.
2053 (memento_of_get_volatile::dereference): Likewise.
2054 (memento_of_get_volatile::unqualified): Likewise.
2055 (memento_of_get_volatile::is_int): Likewise.
2056 (memento_of_get_volatile::is_float): Likewise.
2057 (memento_of_get_volatile::is_bool): Likewise.
2058 (memento_of_get_volatile::is_pointer): Likewise.
2059 (memento_of_get_volatile::is_array): Likewise.
2060 (memento_of_get_volatile::replay_into): Likewise;
2061 (memento_of_get_volatile::make_debug_string): Likewise.
2062 (memento_of_get_volatile::write_reproducer): Likewise.
2063 (array_type::dereference): Likewise.
2064 (array_type::is_int): Likewise.
2065 (array_type::is_float): Likewise.
2066 (array_type::is_bool): Likewise.
2067 (array_type::is_pointer): Likewise.
2068 (array_type::is_array): Likewise.
2069 (array_type::replay_into): Likewise;
2070 (array_type::make_debug_string): Likewise.
2071 (array_type::write_reproducer): Likewise.
2072 (function_type::dereference): Likewise.
2073 (function_type::function_dyn_cast_function_type): Likewise.
2074 (function_type::function_as_a_function_type): Likewise.
2075 (function_type::is_int): Likewise.
2076 (function_type::is_float): Likewise.
2077 (function_type::is_bool): Likewise.
2078 (function_type::is_pointer): Likewise.
2079 (function_type::is_array): Likewise.
2080 (function_type::replay_into): Likewise;
2081 (function_type::make_debug_string): Likewise.
2082 (function_type::write_reproducer): Likewise.
2083 (field::replay_into): Likewise;
2084 (field::write_to_dump): Likewise.
2085 (field::make_debug_string): Likewise.
2086 (field::write_reproducer): Likewise.
2087 (compound_type::dereference): Likewise.
2088 (compound_type::is_int): Likewise.
2089 (compound_type::is_float): Likewise.
2090 (compound_type::is_bool): Likewise.
2091 (compound_type::is_pointer): Likewise.
2092 (compound_type::is_array): Likewise.
2093 (compound_type::has_known_size): Likewise.
2094 (struct_::dyn_cast_struct): Likewise.
2095 (struct_::replay_into): Likewise.
2096 (struct_::access_as_type): Likewise.
2097 (struct_::make_debug_string): Likewise.
2098 (struct_::write_reproducer): Likewise.
2099 (fields::replay_into): Likewise.
2100 (fields::write_to_dump): Likewise.
2101 (fields::make_debug_string): Likewise.
2102 (fields::write_reproducer): Likewise.
2103 (union_::replay_into): Likewise.
2104 (union_::make_debug_string): Likewise.
2105 (union_::write_reproducer): Likewise.
2106 (lvalue::access_as_rvalue): Mark with OVERRIDE.
2107 (param::replay_into): Mark with FINAL OVERRIDE.
2108 (param::visit_children): Likewise.
2109 (param::dyn_cast_param): Likewise.
2110 (param::access_as_rvalue): Likewise.
2111 (param::access_as_lvalue): Likewise.
2112 (param::make_debug_string): Likewise.
2113 (param::write_reproducer): Likewise.
2114 (param::get_precedence): Likewise.
2115 (function::replay_into): Likewise.
2116 (function::write_to_dump): Likewise.
2117 (function::make_debug_string): Likewise.
2118 (function::write_reproducer): Likewise.
2119 (block::write_to_dump): Likewise.
2120 (block::make_debug_string): Likewise.
2121 (block::write_reproducer): Likewise.
2122 (block::replay_into): Likewise.
2123 (global::replay_into): Likewise;
2124 (global::visit_children): Likewise.
2125 (global::write_to_dump): Likewise.
2126 (global::make_debug_string): Likewise.
2127 (global::write_reproducer): Likewise.
2128 (global::get_precedence): Likewise.
2129 (memento_of_new_rvalue_from_const::replay_into): Likewise.
2130 (memento_of_new_rvalue_from_const::visit_children): Likewise.
2131 (memento_of_new_rvalue_from_const::is_constant): Likewise.
2132 (memento_of_new_rvalue_from_const::get_wide_int): Likewise.
2133 (memento_of_new_rvalue_from_const::make_debug_string): Likewise.
2134 (memento_of_new_rvalue_from_const::write_reproducer): Likewise.
2135 (memento_of_new_rvalue_from_const::get_precedence): Likewise.
2136 (memento_of_new_string_literal::replay_into): Likewise.
2137 (memento_of_new_string_literal::visit_children): Likewise.
2138 (memento_of_new_string_literal::make_debug_string): Likewise.
2139 (memento_of_new_string_literal::write_reproducer): Likewise.
2140 (memento_of_new_string_literal::get_precedence): Likewise.
2141 (unary_op::replay_into): Likewise.
2142 (unary_op::visit_children): Likewise.
2143 (unary_op::make_debug_string): Likewise.
2144 (unary_op::write_reproducer): Likewise.
2145 (unary_op::get_precedence): Likewise.
2146 (binary_op::replay_into): Likewise.
2147 (binary_op::visit_children): Likewise.
2148 (binary_op::make_debug_string): Likewise.
2149 (binary_op::write_reproducer): Likewise.
2150 (binary_op::get_precedence): Likewise.
2151 (comparison::replay_into): Likewise.
2152 (comparison::visit_children): Likewise.
2153 (comparison::make_debug_string): Likewise.
2154 (comparison::write_reproducer): Likewise.
2155 (comparison::get_precedence): Likewise.
2156 (cast::replay_into): Likewise.
2157 (cast::visit_children): Likewise.
2158 (cast::make_debug_string): Likewise.
2159 (cast::write_reproducer): Likewise.
2160 (cast::get_precedence): Likewise.
2161 (call::replay_into): Likewise.
2162 (call::visit_children): Likewise.
2163 (call::make_debug_string): Likewise.
2164 (call::write_reproducer): Likewise.
2165 (call::get_precedence): Likewise.
2166 (call_through_ptr::replay_into): Likewise.
2167 (call_through_ptr::visit_children): Likewise.
2168 (call_through_ptr::make_debug_string): Likewise.
2169 (call_through_ptr::write_reproducer): Likewise.
2170 (call_through_ptr::get_precedence): Likewise.
2171 (array_access::replay_into): Likewise.
2172 (array_access::visit_children): Likewise.
2173 (array_access::make_debug_string): Likewise.
2174 (array_access::write_reproducer): Likewise.
2175 (array_access::get_precedence): Likewise.
2176 (access_field_of_lvalue::replay_into): Likewise.
2177 (access_field_of_lvalue::visit_children): Likewise.
2178 (access_field_of_lvalue::make_debug_string): Likewise.
2179 (access_field_of_lvalue::write_reproducer): Likewise.
2180 (access_field_of_lvalue::get_precedence): Likewise.
2181 (access_field_rvalue::replay_into): Likewise.
2182 (access_field_rvalue::visit_children): Likewise.
2183 (access_field_rvalue::make_debug_string): Likewise.
2184 (access_field_rvalue::write_reproducer): Likewise.
2185 (access_field_rvalue::get_precedence): Likewise.
2186 (dereference_field_rvalue::replay_into): Likewise.
2187 (dereference_field_rvalue::visit_children): Likewise.
2188 (dereference_field_rvalue::make_debug_string): Likewise.
2189 (dereference_field_rvalue::write_reproducer): Likewise.
2190 (dereference_field_rvalue::get_precedence): Likewise.
2191 (dereference_rvalue::replay_into): Likewise.
2192 (dereference_rvalue::visit_children): Likewise.
2193 (dereference_rvalue::make_debug_string): Likewise.
2194 (dereference_rvalue::write_reproducer): Likewise.
2195 (dereference_rvalue::get_precedence): Likewise.
2196 (get_address_of_lvalue::replay_into): Likewise.
2197 (get_address_of_lvalue::visit_children): Likewise.
2198 (get_address_of_lvalue::make_debug_string): Likewise.
2199 (get_address_of_lvalue::write_reproducer): Likewise.
2200 (get_address_of_lvalue::get_precedence): Likewise.
2201 (local::replay_into): Likewise.
2202 (local::visit_children): Likewise.
2203 (local::write_to_dump): Likewise.
2204 (local::make_debug_string): Likewise.
2205 (local::write_reproducer): Likewise.
2206 (local::get_precedence): Likewise.
2207 (statement::write_to_dump): Likewise.
2208 (eval::replay_into): Likewise.
2209 (eval::make_debug_string): Likewise.
2210 (eval::write_reproducer): Likewise.
2211 (assignment::replay_into): Likewise.
2212 (assignment::make_debug_string): Likewise.
2213 (assignment::write_reproducer): Likewise.
2214 (assignment_op::replay_into): Likewise.
2215 (assignment_op::make_debug_string): Likewise.
2216 (assignment_op::write_reproducer): Likewise.
2217 (comment::replay_into): Likewise.
2218 (comment::make_debug_string): Likewise.
2219 (comment::write_reproducer): Likewise.
2220 (conditional::replay_into): Likewise.
2221 (conditional::get_successor_blocks): Likewise.
2222 (conditional::make_debug_string): Likewise.
2223 (conditional::write_reproducer): Likewise.
2224 (jump::replay_into): Likewise.
2225 (jump::get_successor_blocks): Likewise.
2226 (jump::make_debug_string): Likewise.
2227 (jump::write_reproducer): Likewise.
2228 (return_::replay_into): Likewise.
2229 (return_::get_successor_blocks): Likewise.
2230 (return_::make_debug_string): Likewise.
2231 (return_::write_reproducer): Likewise.
2232 (case_::replay_into): Likewise.
2233 (case_::write_reproducer): Likewise.
2234 (case_::make_debug_string): Likewise.
2235 (switch_::replay_into): Likewise.
2236 (switch_::get_successor_blocks): Likewise.
2237 (switch_::make_debug_string): Likewise.
2238 (switch_::write_reproducer): Likewise.
2240 2016-02-08 David Malcolm <dmalcolm@redhat.com>
2242 * dummy-frontend.c (jit_langhook_init): Remove
2243 second argument to build_common_tree_nodes to
2246 2016-01-23 Iain Buclaw <ibuclaw@gdcproject.org>
2248 * jit-playback.c: Include pthread.h.
2250 2016-01-19 David Malcolm <dmalcolm@redhat.com>
2253 * jit-playback.c (gcc::jit::playback::compile_to_file::postprocess):
2254 Potentially add the temporary artifact to the tempdir's list of
2255 tempfiles needing additional cleanup.
2256 (gcc::jit::playback::context::extract_any_requested_dumps): Likewise
2258 * jit-tempdir.c (gcc::jit::tempdir::~tempdir): Clean up additional
2260 * jit-tempdir.h (gcc::jit::tempdir::add_temp_file): New method.
2261 (gcc::jit::tempdir::m_tempfiles): New field.
2262 * docs/cp/intro/tutorial04.rst: Update for changes to toyvm.cc.
2263 * docs/examples/tut04-toyvm/toyvm.cc (class compilation_result):
2265 (toyvm_function::compile): Change return type from function ptr
2266 to a compilation_result.
2267 (toyvm_function::get_function_name): New accessor.
2268 (toyvm_function::m_funcname): New field.
2269 (get_function_name): Convert to...
2270 (toyvm_function::make_function_name): ...this new method.
2271 (toyvm_function::parse): Call make_function_name.
2272 (toyvm_function::compile): Convert return type from function ptr
2273 to a compilation_result. Use get_function_name.
2274 (compilation_state::compile): Convert return type from
2275 gcc_jit_result * to a compilation_result.
2276 (test_script): Update for above changes, extracting the code from
2277 the compilation_result.
2279 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2281 2016-01-04 Jakub Jelinek <jakub@redhat.com>
2283 Update copyright years.
2285 2015-11-11 Andrew MacLeod <amacleod@redhat.com>
2287 * dummy-frontend.c: Remove unused header files.
2288 * jit-builtins.c: Likewise.
2289 * jit-playback.c: Likewise.
2290 * jit-recording.c: Likewise.
2291 * jit-spec.c: Likewise.
2292 * libgccjit.c: Likewise.
2294 2015-11-07 Richard Sandiford <richard.sandiford@arm.com>
2296 * jit-builtins.c: Don't undef DEF_BUILTIN.
2298 2015-10-29 Andrew MacLeod <amacleod@redhat.com>
2300 * dummy-frontend.c: Reorder #include's and remove duplicates.
2301 * jit-builtins.c: Likewise.
2302 * jit-playback.c: Likewise.
2303 * jit-recording.c: Likewise.
2304 * libgccjit.c: Likewise.
2306 2015-10-13 Jakub Jelinek <jakub@redhat.com>
2308 * jit-builtins.c (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10,
2309 DEF_FUNCTION_TYPE_11): Define.
2310 * jit-builtins.h (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10,
2311 DEF_FUNCTION_TYPE_11): Define.
2313 2015-09-30 Thomas Schwinge <thomas@codesourcery.com>
2314 Ulrich Drepper <drepper@gmail.com>
2316 * jit-builtins.h: Undefine DEF_FUNCTION_TYPE_VAR_6 after use.
2318 2015-09-30 Matthias Klose <doko@ubuntu.com>
2320 * jit-builtins.h Define DEF_FUNCTION_TYPE_VAR_6,
2321 remove DEF_FUNCTION_TYPE_VAR_11.
2322 * jit-builtins.c (builtins_manager::make_type): Define and handle
2323 DEF_FUNCTION_TYPE_VAR_6, remove DEF_FUNCTION_TYPE_VAR_11.
2325 2015-08-25 David Malcolm <dmalcolm@redhat.com>
2327 * docs/cp/topics/contexts.rst
2328 (gccjit::context::set_bool_use_external_driver): New.
2329 * docs/internals/test-hello-world.exe.log.txt: Update.
2330 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_5): New.
2331 * docs/topics/contexts.rst
2332 (gcc_jit_context_set_bool_use_external_driver): New.
2333 * jit-common.h (enum inner_bool_option): Add
2334 INNER_BOOL_OPTION_USE_EXTERNAL_DRIVER.
2335 * jit-playback.c (gcc_driver_name): New global.
2336 (gcc:jit::playback::context::invoke_driver): Split out second
2338 (gcc::jit::playback::context::invoke_embedded_driver): ...this new
2340 (gcc::jit::playback::context::invoke_external_driver): ...this new
2343 (gcc::jit::playback::context::get_inner_bool_option): New.
2344 (gcc::jit::playback::context::invoke_embedded_driver): New.
2345 (gcc::jit::playback::context::invoke_external_driver): New.
2346 * jit-recording.c (inner_bool_option_reproducer_strings):
2347 Add entry for INNER_BOOL_OPTION_USE_EXTERNAL_DRIVER.
2349 (gccjit::context::set_bool_use_external_driver): New.
2350 * libgccjit.c (gcc_jit_context_set_bool_use_external_driver): New.
2351 * libgccjit.h (gcc_jit_context_set_bool_use_external_driver): New.
2352 (LIBGCCJIT_HAVE_gcc_jit_context_set_bool_use_external_driver):
2354 * libgccjit.map (LIBGCCJIT_ABI_5): New.
2355 * notes.txt: Show invocation of embedded copy of driver.
2356 * docs/internals/test-hello-world.exe.log.txt: Update
2358 2015-08-13 David Malcolm <dmalcolm@redhat.com>
2360 * jit-playback.c (invoke_driver): On OS X, add
2361 "-Wl,-undefined,dynamic_lookup" to the driver arguments.
2363 2015-08-03 David Malcolm <dmalcolm@redhat.com>
2365 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_4): New.
2366 * docs/topics/contexts.rst (GCC_JIT_BOOL_OPTION_DUMP_SUMMARY):
2367 We no longer show a profile.
2368 * docs/topics/index.rst (Topic Reference): Add performance.rst.
2369 * docs/topics/performance.rst: New file.
2370 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2371 * jit-playback.c (gcc::jit::playback::context::compile): Add timer
2372 param when constructing the "toplev" instance.
2373 (gcc::jit::playback::context::acquire_mutex): Add timer param when
2374 constructing auto_timevar instance.
2375 (gcc::jit::playback::context::make_fake_args): If we have a timer,
2376 add "-ftime-report".
2377 (gcc::jit::playback::context::invoke_driver): Add timer param when
2378 constructing auto_timevar instance.
2379 (gcc::jit::playback::context::dlopen_built_dso): Likewise.
2380 * jit-playback.h (gcc::jit::playback::context::get_timer): New accessor.
2381 * jit-recording.c: Include timevar.h.
2382 (gcc::jit::recording::context::context): Initialize field "m_timer".
2383 * jit-recording.h: Add forward declaration of class timer.
2384 (gcc::jit::recording::context::set_timer): New method.
2385 (gcc::jit::recording::context::get_timer): New method.
2386 (gcc::jit::recording::context::m_timer): New field.
2387 * libgccjit++.h (gccjit::timer): New class.
2388 (gccjit::auto_time): New class.
2389 (gccjit::context::set_timer): New method.
2390 (gccjit::context::get_timer): New.
2391 (gccjit::timer::timer): New.
2392 (gccjit::timer::push): New.
2393 (gccjit::timer::pop): New.
2394 (timer::print): New.
2395 (timer::get_inner_timer): New.
2396 (timer::release): New.
2397 (auto_time::auto_time): New.
2398 (auto_time::~auto_time): New.
2399 * libgccjit.c: Include timevar.h.
2400 (struct gcc_jit_timer): New.
2401 (gcc_jit_timer_new): New function.
2402 (gcc_jit_timer_release): New function.
2403 (gcc_jit_context_set_timer): New function.
2404 (gcc_jit_context_get_timer): New function.
2405 (gcc_jit_timer_push): New function.
2406 (gcc_jit_timer_pop): New function.
2407 (gcc_jit_timer_print): New function.
2408 * libgccjit.h (LIBGCCJIT_HAVE_TIMING_API): New macro.
2409 (gcc_jit_timer): New typedef.
2410 (gcc_jit_timer_new): New function.
2411 (gcc_jit_timer_release): New function.
2412 (gcc_jit_context_set_timer): New function.
2413 (gcc_jit_context_get_timer): New function.
2414 (gcc_jit_timer_push): New function.
2415 (gcc_jit_timer_pop): New function.
2416 (gcc_jit_timer_print): New function.
2417 * libgccjit.map (LIBGCCJIT_ABI_4): New.
2418 (gcc_jit_timer_new): New function.
2419 (gcc_jit_timer_release): New function.
2420 (gcc_jit_context_set_timer): New function.
2421 (gcc_jit_context_get_timer): New function.
2422 (gcc_jit_timer_push): New function.
2423 (gcc_jit_timer_pop): New function.
2424 (gcc_jit_timer_print): New function.
2426 2015-07-23 David Malcolm <dmalcolm@redhat.com>
2428 * jit-playback.c (invoke_driver): Convert local "argvec"
2429 to an auto_argvec, so that it owns copies of the strings,
2430 rather than borrows them, updating ADD_ARG to use xstrdup
2431 and special-casing the NULL terminator to avoid
2432 xstrdup (NULL). Call add_multilib_driver_arguments at the front
2434 (MULTILIB_DEFAULTS): Provide a default definition.
2435 (multilib_defaults_raw): New constant array.
2436 (gcc::jit::playback::context::add_multilib_driver_arguments): New
2439 (gcc::jit::playback::context::add_multilib_driver_arguments): New
2441 * docs/internals/test-hello-world.exe.log.txt: Update.
2442 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2444 2015-07-16 David Malcolm <dmalcolm@redhat.com>
2446 * docs/internals/index.rst (Overview of code structure): Add note
2447 that the implementation is in C++, despite the .c extension.
2448 (Submitting patches): New subsection.
2449 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2451 2015-07-09 Andrew MacLeod <amacleod@redhat.com>
2453 * dummy-frontend.c: Adjust includes for flags.h changes.
2454 * jit-common.h: Likewise.
2455 * jit-playback.c: Likewise.
2457 2015-07-08 David Malcolm <dmalcolm@redhat.com>
2460 * libgccjit.c (gcc_jit_context_new_field): Show name of field in
2461 "unknown size" error message.
2462 (gcc_jit_struct_set_fields): Show name of struct in error message.
2463 (gcc_jit_context_new_global): Show name of global in
2464 "unknown size" error message.
2465 (gcc_jit_function_new_local): Likewise for local.
2467 2015-07-07 Andrew MacLeod <amacleod@redhat.com>
2469 * dummy-frontend.c: Adjust includes.
2470 * jit-common.h: Likewise.
2471 * jit-playback.c: Likewise.
2473 2015-07-07 David Malcolm <dmalcolm@redhat.com>
2476 * jit-recording.h: Within namespace gcc:jit::recording...
2477 (type::has_known_size): New virtual function.
2478 (struct_has_known_size): New function.
2479 * libgccjit.c (gcc_jit_context_new_field): Verify that the type
2481 (gcc_jit_context_new_global): Likewise.
2482 (gcc_jit_function_new_local): Likewise.
2484 2015-07-07 David Malcolm <dmalcolm@redhat.com>
2487 * dummy-frontend.c (jit_langhook_type_for_mode): Ensure that we
2488 handle modes QI, HI, SI, DI, TI.
2490 2015-07-01 David Malcolm <dmalcolm@redhat.com>
2493 * jit-playback.c (jit_mark_addressable): New function.
2494 (gcc::jit::playback::lvalue::get_address): Call
2495 jit_mark_addressable on the underlying tree.
2497 2015-07-01 David Malcolm <dmalcolm@redhat.com>
2499 * docs/topics/types.rst (gcc_jit_context_new_union_type): Add
2501 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2503 2015-07-01 David Malcolm <dmalcolm@redhat.com>
2505 * docs/topics/contexts.rst (gcc_jit_context_set_bool_option):
2506 Clarify lack of lifetime requirements on (const char *) parameter.
2507 * docs/topics/expressions.rst
2508 (gcc_jit_context_new_string_literal): Likewise.
2509 (gcc_jit_context_new_global): Likewise.
2510 * docs/topics/functions.rst (gcc_jit_context_new_param): Likewise.
2511 (gcc_jit_context_new_function): Likewise.
2512 (gcc_jit_function_new_block): Likewise.
2513 (gcc_jit_block_add_comment): Likewise.
2514 * docs/topics/locations.rst (gcc_jit_context_new_location):
2516 * docs/topics/types.rst (gcc_jit_context_new_field): Likewise.
2517 (gcc_jit_context_new_struct_type): Likewise.
2518 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2520 2015-06-30 David Malcolm <dmalcolm@redhat.com>
2522 * docs/cp/topics/functions.rst (Blocks): Add switch statements to
2523 list of ways to terminate a block.
2524 (gccjit::block::end_with_switch): Add function description.
2525 (gccjit::case_): Add class.
2526 (gccjit::context::new_case): Add function description.
2527 * docs/cp/topics/objects.rst: Add "case_" to class hierarchy.
2528 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_3): New.
2529 * docs/topics/functions.rst (Blocks): Add switch statements to
2530 list of ways to terminate a block.
2531 (gcc_jit_block_end_with_switch): Add function description.
2532 (gcc_jit_case): Add type.
2533 (gcc_jit_context_new_case): Add function description.
2534 (gcc_jit_case_as_object): Add function description.
2535 * docs/topics/objects.rst: Add gcc_jit_case to class hierarchy.
2536 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2537 * jit-common.h (gcc::jit::recording::case_): Add forward decl.
2538 (gcc::jit::playback::case_): Add forward decl.
2539 * jit-playback.c (add_case): New function.
2540 (gcc::jit::playback::block::add_switch): New function.
2541 * jit-playback.h (gcc::jit::playback::case_): New struct.
2542 (gcc::jit::playback::block::get_function): New method.
2543 (gcc::jit::playback::block::add_switch): New method.
2544 * jit-recording.c: Within namespace gcc::jit...
2545 (recording::context::new_case): New method.
2546 (recording::function::validate): Update for change to
2547 get_successor_blocks.
2548 (recording::block::end_with_switch): New method.
2549 (recording::block::get_successor_blocks): Update to support an
2550 arbitrary number of successor blocks.
2551 (recording::block::dump_edges_to_dot): Likewise.
2552 (memento_of_new_rvalue_from_const <int>::get_wide_int): New.
2553 (memento_of_new_rvalue_from_const <long>::get_wide_int): New.
2554 (memento_of_new_rvalue_from_const <double>::get_wide_int): New.
2555 (memento_of_new_rvalue_from_const <void *>::get_wide_int): New.
2556 (recording::statement::get_successor_blocks): Update to support an
2557 arbitrary number of successor blocks.
2558 (recording::conditional::get_successor_blocks): Likewise.
2559 (recording::jump::get_successor_blocks): Likewise.
2560 (recording::return_::get_successor_blocks): Likewise.
2561 (recording::case_::write_reproducer): New.
2562 (recording::case_::make_debug_string): New.
2563 (recording::switch_::switch_): New.
2564 (recording::switch_::replay_into): New.
2565 (recording::switch_::get_successor_blocks): New.
2566 (recording::switch_::make_debug_string): New.
2567 (recording::switch_::write_reproducer): New.
2568 * jit-recording.h: Within namespace gcc::jit::recording...
2569 (context::new_case): New.
2570 (rvalue::is_constant): New.
2571 (rvalue::get_wide_int): New.
2572 (block::end_with_switch): New.
2573 (block::get_successor_blocks): Update to support an arbitrary
2574 number of successor blocks.
2575 (memento_of_new_rvalue_from_const::is_constant): New.
2576 (memento_of_new_rvalue_from_const::get_wide_int): New.
2577 (statement::get_successor_blocks): Update to support an arbitrary
2578 number of successor blocks.
2579 (conditional::get_successor_blocks): Likewise.
2580 (jump::get_successor_blocks): Likewise.
2581 (return_::get_successor_blocks): Likewise.
2582 (case_): New subclass of memento.
2583 (switch_): New subclass of statement.
2584 * libgccjit++.h (gccjit::case_): New subclass of gccjit::object.
2585 (gccjit::context::new_case): New method.
2586 (gccjit::block::end_with_switch): New method.
2587 (gccjit::case_::case): New ctors.
2588 (gccjit::case_::get_inner_case): New method.
2589 * libgccjit.c: Include "typed-splay-tree.h"
2590 (struct gcc_jit_case): New.
2591 (gcc_jit_context_new_case): New function.
2592 (gcc_jit_case_as_object): New function.
2593 (valid_dest_for_switch): New function.
2594 (valid_case_for_switch): New function.
2595 (class api_call_validator): New class.
2596 (class case_range_validator): New class.
2597 (case_range_validator::case_range_validator): New.
2598 (case_range_validator::validate): New.
2599 (case_range_validator::case_compare): New.
2600 (case_range_validator::get_wide_int): new.
2601 (gcc_jit_block_end_with_switch): New.
2602 * libgccjit.h: Add gcc_jit_case to class hierarchy comment.
2603 (gcc_jit_case): New typedef.
2604 (gcc_jit_context_new_case): New function.
2605 (gcc_jit_case_as_object): New function.
2606 (gcc_jit_block_end_with_switch): New function.
2607 (LIBGCCJIT_HAVE_SWITCH_STATEMENTS): New.
2608 * libgccjit.map: Add gcc_jit_block_end_with_switch,
2609 gcc_jit_case_as_object and gcc_jit_context_new_case.
2611 2015-06-30 David Malcolm <dmalcolm@redhat.com>
2614 * docs/cp/topics/contexts.rst
2615 (gccjit::context::set_bool_allow_unreachable_blocks): New.
2616 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_2): New.
2617 * docs/topics/contexts.rst (Options): Add notes discussing the
2618 transition from enums to entrypoints for new options.
2619 (gcc_jit_context_set_bool_allow_unreachable_blocks): New.
2620 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2621 * jit-common.h (gcc::jit::inner_bool_option): New enum.
2622 * jit-recording.c: Within namespace gcc::jit...
2623 (recording::context::context): Handle m_inner_bool_options.
2624 (recording::context::set_inner_bool_option): New.
2625 (inner_bool_option_reproducer_strings): New.
2626 (recording::context::log_all_options): Log the "inner" bool
2628 (recording::context::log_inner_bool_option): New.
2629 (recording::context::dump_reproducer_to_file): Write initializers
2630 for "inner" bool options.
2631 (recording::function::validate): Don't check for block
2632 reachability if INNER_BOOL_OPTION_ALLOW_UNREACHABLE_BLOCKS is set.
2633 * jit-recording.h: Within namespace gcc::jit...
2634 (recording::context::set_inner_bool_option): New.
2635 (recording::context::get_inner_bool_option): New.
2636 (recording::context::log_inner_bool_option): New.
2637 (recording::context::m_inner_bool_options): New.
2639 (gccjit::context::set_bool_allow_unreachable_blocks): New.
2641 (gcc_jit_context_set_bool_allow_unreachable_blocks): New.
2642 * libgccjit.h: Add note about options present in the
2643 initial release of libgccjit.
2644 (gcc_jit_context_set_bool_allow_unreachable_blocks): New API
2646 (LIBGCCJIT_HAVE_gcc_jit_context_set_bool_allow_unreachable_blocks):
2648 * libgccjit.map (LIBGCCJIT_ABI_2): New, containing...
2649 (gcc_jit_context_set_bool_allow_unreachable_blocks): ...this new
2652 2015-06-30 David Malcolm <dmalcolm@redhat.com>
2655 * docs/cp/topics/contexts.rst (Additional command-line options):
2657 * docs/topics/compatibility.rst: New file.
2658 * docs/topics/contexts.rst (Additional command-line options): New
2660 * docs/topics/index.rst: Add compatibility.rst.
2661 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2662 * jit-playback.c (make_fake_args): Add call to
2663 append_command_line_options.
2664 * jit-recording.c: Within namespace gcc::jit...
2665 (recording::context::~context): Free the optnames within
2666 m_command_line_options.
2667 (recording::context::set_bool_option): Likewise.
2668 (recording::context::add_command_line_option): New method.
2669 (recording::context::append_command_line_options): New method.
2670 (recording::context::dump_reproducer_to_file): Add command-line
2672 * jit-recording.h: Within namespace gcc::jit...
2673 (recording::context::add_command_line_option): New method.
2674 (recording::context::append_command_line_options): New method.
2675 (recording::context::m_command_line_options): New field.
2676 * libgccjit++.h (gccjit::context::add_command_line_option): New
2678 * libgccjit.c (gcc_jit_context_add_command_line_option): New API
2680 * libgccjit.h (gcc_jit_context_add_command_line_option): New API
2682 (LIBGCCJIT_HAVE_gcc_jit_context_add_command_line_option): New
2684 * libgccjit.map: Put existing symbols within LIBGCCJIT_ABI_0; add
2685 LIBGCCJIT_ABI_1 and gcc_jit_context_add_command_line_option.
2687 2015-06-30 David Malcolm <dmalcolm@redhat.com>
2690 (gcc::jit::recording::context::dump_reproducer_to_file):
2691 Add pragma to generated reproducers to disable -Wunused-variable.
2692 Fix handling of NULL string options.
2694 2015-06-30 David Malcolm <dmalcolm@redhat.com>
2696 * docs/cp/topics/expressions.rst: Remove stray semicolon.
2697 * docs/cp/topics/functions.rst: Remove stray backslash.
2698 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2700 2015-06-25 Andrew MacLeod <amacleod@redhat.com>
2702 * dummy-frontend.c: Remove ipa-ref.h and plugin-api.h from include list.
2703 * jit-playback.c: Likewise.
2705 2015-06-25 Andrew Macleod <amacleod@redhat.com>
2707 * jit-common.h: Don't include alias.h.
2709 2015-06-17 David Malcolm <dmalcolm@redhat.com>
2711 * libgccjit.c (gcc_jit_lvalue_access_field): Verify that the field
2712 is for the correct struct.
2713 (gcc_jit_rvalue_access_field): Likewise.
2715 2015-06-17 Andrew MacLeod <amacleod@redhat.com>
2717 * dummy-frontend.c: Do not include input.h, line-map.h or is-a.h.
2718 * jit-common.h: Likewise.
2719 * jit-playback.c: Likewise.
2721 2015-06-16 David Malcolm <dmalcolm@redhat.com>
2724 * jit-recording.c: Within namespace gcc::jit::recording::
2725 (rvalue::get_debug_string_parens): New function.
2726 (binary_op::make_debug_string): Update to mimic C precedence
2728 (binary_op_precedence): New array.
2729 (binary_op::get_precedence): New function.
2730 (comparison::make_debug_string): Update to mimic C precedence
2732 (comparison_precedence): New array.
2733 (comparison::get_precedence): New function.
2734 (cast::make_debug_string): Update to mimic C precedence rules.
2735 (call::make_debug_string): Likewise.
2736 (call_through_ptr::make_debug_string): Likewise.
2737 (array_access::make_debug_string): Likewise.
2738 (access_field_of_lvalue::make_debug_string): Likewise.
2739 (access_field_rvalue::make_debug_string): Likewise.
2740 (dereference_field_rvalue::make_debug_string): Likewise.
2741 (dereference_rvalue::make_debug_string): Likewise.
2742 (get_address_of_lvalue::make_debug_string): Likewise.
2743 * jit-recording.h: Within namespace gcc::jit::recording::
2744 (precedence): New enum.
2745 (rvalue::rvalue): Initialize field "m_parenthesized_string".
2746 (rvalue::get_debug_string_parens): New method.
2747 (rvalue::get_precedence): New pure virtual function.
2748 (rvalue::m_parenthesized_string): New field.
2749 (param::get_precedence): New function.
2750 (global::get_precedence): New function.
2751 (memento_of_new_rvalue_from_const::get_precedence): New function.
2752 (memento_of_new_string_literal::get_precedence): New function.
2753 (unary_op::get_precedence): New function.
2754 (binary_op::get_precedence): New function.
2755 (comparison::get_precedence): New function.
2756 (cast::get_precedence): New function.
2757 (call::get_precedence): New function.
2758 (call_through_ptr::get_precedence): New function.
2759 (array_access::get_precedence): New function.
2760 (access_field_of_lvalue::get_precedence): New function.
2761 (access_field_rvalue::get_precedence): New function.
2762 (dereference_field_rvalue::get_precedence): New function.
2763 (dereference_rvalue::get_precedence): New function.
2764 (get_address_of_lvalue::get_precedence): New function.
2765 (local::get_precedence): New function.
2767 2015-06-09 Matthias Klose <doko@ubuntu.com>
2769 * Make-lang.in (jit.install-common): Install headers using INSTALL_DATA.
2771 2015-06-08 Andrew MacLeod <amacleod@redhat.com>
2773 * dummy-frontend.c : Adjust include files.
2774 * jit-common.h : Likewise.
2775 * jit-playback.c : Likewise.
2777 2015-06-05 David Malcolm <dmalcolm@redhat.com>
2780 (jit_langhook_post_compilation_parsing_cleanups): Remove.
2781 (LANG_HOOKS_POST_COMPILATION_PARSING_CLEANUPS): Remove
2782 * jit-playback.c (gcc::jit::playback::context::new_global): Add
2783 call to varpool_node::finalize_decl.
2784 (gcc::jit::playback::context::finalize_global_decls): Remove.
2786 (gcc::jit::playback::context::finalize_global_decls): Remove.
2788 2015-06-05 David Malcolm <dmalcolm@redhat.com>
2790 * dummy-frontend.c (jit_langhook_write_globals): Rename to...
2791 (jit_langhook_post_compilation_parsing_cleanups): ...this, and
2792 eliminate calls to finalize_compilation_unit and
2793 write_global_decls_2.
2794 (LANG_HOOKS_WRITE_GLOBALS): Rename to...
2795 (LANG_HOOKS_POST_COMPILATION_PARSING_CLEANUPS): ...this and
2796 redirect from jit_langhook_write_globals to
2797 jit_langhook_post_compilation_parsing_cleanups.
2799 (gcc::jit::playback::context::write_global_decls_1): Rename to...
2800 (gcc::jit::playback::context::finalize_global_decls): ...this.
2801 (gcc::jit::playback::context::write_global_decls_1): Delete.
2803 (gcc::jit::playback::context::write_global_decls_1): Rename to...
2804 (gcc::jit::playback::context::finalize_global_decls): ...this.
2805 (gcc::jit::playback::context::write_global_decls_1): Delete.
2807 2015-06-04 Andrew MacLeod <amacleod@redhat.com>
2809 * dummy-frontend.c: Adjust includes for restructured coretypes.h.
2810 * jit-common.h: Likewise.
2811 * jit-playback.c: Likewise.
2813 2015-05-12 David Malcolm <dmalcolm@redhat.com>
2815 * jit-builtins.c: Include vec.h before target.h.
2817 2015-04-27 Jim Wilson <jim.wilson@linaro.org>
2819 * Make-lang.in (jit.mostlyclean): Remove shared libraries and object
2822 2015-04-09 David Malcolm <dmalcolm@redhat.com>
2825 * docs/cp/topics/expressions.rst (Simple expressions): Fix copy
2826 and paste error in description of gccjit::context::one.
2827 * docs/topics/expressions.rst (Simple expressions): Likewise in
2828 description of gcc_jit_context_one.
2829 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2831 2015-03-13 Uros Bizjak <ubizjak@gmail.com>
2833 * jit-recording.c (dump::write): Also check vasprintf return value.
2834 (recording::context::add_error_va): Ditto.
2835 (recording::string::from_printf): Ditto.
2837 2015-03-13 David Malcolm <dmalcolm@redhat.com>
2839 * docs/internals/index.rst (Packaging notes): New section.
2840 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2842 2015-03-05 David Malcolm <dmalcolm@redhat.com>
2844 * docs/cp/intro/tutorial03.rst: Add missing arguments to
2845 gccjit::block::end_with_conditional call. Add on_true/on_false
2846 comments. Tweak the wording.
2847 * docs/intro/tutorial03.rst: Add missing arguments to
2848 gcc_jit_block_end_with_conditional call. Add some clarifying
2850 * docs/topics/compilation.rst: Tweak the wording to avoid an
2851 ambiguous use of "this".
2852 * docs/topics/contexts.rst: Fix a typo.
2853 * docs/topics/expressions.rst (GCC_JIT_BINARY_OP_MINUS): Remove
2855 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2857 2015-02-24 Thomas Schwinge <thomas@codesourcery.com>
2860 * jit-builtins.c (DEF_FUNCTION_TYPE_VAR_8)
2861 (DEF_FUNCTION_TYPE_VAR_12): Remove macros.
2862 (DEF_FUNCTION_TYPE_VAR_7, DEF_FUNCTION_TYPE_VAR_11): New macros.
2863 * jit-builtins.h (DEF_FUNCTION_TYPE_VAR_8)
2864 (DEF_FUNCTION_TYPE_VAR_12): Remove macros.
2865 (DEF_FUNCTION_TYPE_VAR_7, DEF_FUNCTION_TYPE_VAR_11): New macros.
2867 2015-02-04 David Malcolm <dmalcolm@redhat.com>
2870 * docs/conf.py (html_theme): Change from 'pyramid'
2873 2015-02-04 David Malcolm <dmalcolm@redhat.com>
2875 * docs/topics/contexts.rst (gcc_jit_context_acquire): Fix
2877 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2879 2015-02-03 David Malcolm <dmalcolm@redhat.com>
2881 * jit-logging.h (gcc::jit::log_user::log): Make const.
2882 * jit-recording.c (gcc::jit::recording::context::set_str_option):
2883 Log the new value of the option.
2884 (gcc::jit::recording::context::set_int_option): Likewise.
2885 (gcc::jit::recording::context::set_bool_option): Likewise.
2886 (gcc::jit::recording::context::compile): Log the value of all
2888 (gcc::jit::recording::context::compile_to_file): Likewise.
2889 (gcc::jit::recording::context::log_all_options): New function.
2890 (gcc::jit::recording::context::log_str_option): New function.
2891 (gcc::jit::recording::context::log_int_option): New function.
2892 (gcc::jit::recording::context::log_bool_option): New function.
2893 * jit-recording.h (gcc::jit::recording::context::log_all_options):
2895 (gcc::jit::recording::context::log_str_option): New function.
2896 (gcc::jit::recording::context::log_int_option): New function.
2897 (gcc::jit::recording::context::log_bool_option): New function.
2898 * docs/internals/test-hello-world.exe.log.txt: Update for above
2900 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2902 2015-02-03 David Malcolm <dmalcolm@redhat.com>
2905 * Make-lang.in (jit_OBJS): Add jit/jit-spec.o and gcc.o.
2906 (LIBGCCJIT_FILENAME): Add EXTRA_GCC_OBJS.
2907 * jit-playback.c: Include gcc.h.
2908 (gcc::jit::playback::context::compile): Move mutex acquisition
2909 to before the call to make_fake_args.
2910 (append_arg_from_driver): New function.
2911 (gcc::jit::playback::context::make_fake_args): On the first call,
2912 call into driver_get_configure_time_options to get configure-time
2913 default options and cache them. Add them to the args for
2915 * jit-spec.c: New source file.
2916 * docs/internals/test-hello-world.exe.log.txt: Update to reflect
2918 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2920 2015-02-02 David Malcolm <dmalcolm@redhat.com>
2923 * dummy-frontend.c (jit_langhook_type_for_mode): Support
2924 TYPE_MODE (long_long_integer_type_node).
2926 2015-01-27 David Malcolm <dmalcolm@redhat.com>
2928 * docs/internals/test-hello-world.exe.log.txt: Add example version
2930 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2931 * jit-common.h (gcc::jit::dump::get_file): New accessor.
2932 * jit-logging.c: Include toplev.h.
2933 (gcc::jit::logger::logger): Log the GCC version.
2934 * jit-recording.c: Include toplev.h.
2935 (gcc:jit::recording::context::dump_reproducer_to_file): Log the
2938 2015-01-26 David Malcolm <dmalcolm@redhat.com>
2940 * docs/topics/compilation.rst (gcc_jit_result_get_code): Fix typo.
2941 * docs/topics/contexts.rst (gcc_jit_context_get_last_error): The
2942 error buffer is only valid until the next call to the context.
2943 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2944 * libgccjit.h (gcc_jit_context_get_first_error): Reword the
2945 comment to omit mention of compiling.
2946 (gcc_jit_context_get_last_error): The error buffer is only valid
2947 until the next call to the context.
2949 2015-01-26 David Malcolm <dmalcolm@redhat.com>
2952 * config-lang.in (compilers): Drop "libgccjit.so".
2954 2015-01-23 David Malcolm <dmalcolm@redhat.com>
2957 * jit-playback.c (gcc::jit::playback::context::compile): Construct
2958 toplev instances with init_signals=false.
2960 2015-01-19 David Malcolm <dmalcolm@redhat.com>
2962 * docs/cp/topics/results.rst: Rename to...
2963 * docs/cp/topics/compilation.rst: ...this, and add section on
2964 ahead-of-time compilation.
2965 * docs/cp/topics/index.rst: Update for renaming of results.rst
2967 * docs/examples/emit-alphabet.bf: New file, a sample "brainf"
2969 * docs/examples/tut05-bf.c: New file, implementing a compiler
2971 * docs/internals/test-hello-world.exe.log.txt: Update to reflect
2972 changes to logger output.
2973 * docs/intro/index.rst: Add tutorial05.rst
2974 * docs/intro/tutorial05.rst: New file.
2975 * docs/topics/results.rst: Rename to...
2976 * docs/topics/compilation.rst: ...this, and add section on
2977 ahead-of-time compilation.
2978 * docs/topics/index.rst: Update for renaming of results.rst to
2980 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2981 * jit-playback.c (gcc::jit::playback::context::compile): Convert
2982 return type from result * to void. Move the code to convert to
2983 dso and dlopen the result to a new pure virtual "postprocess"
2985 (gcc::jit::playback::compile_to_memory::compile_to_memory): New
2987 (gcc::jit::playback::compile_to_memory::postprocess): New
2988 function, based on playback::context::compile.
2989 (gcc::jit::playback::compile_to_file::compile_to_file): New
2991 (gcc::jit::playback::compile_to_file::postprocess): New function.
2992 (gcc::jit::playback::compile_to_file::copy_file): New function.
2993 (gcc::jit::playback::context::convert_to_dso): Move internals
2995 (gcc::jit::playback::context::invoke_driver): New method. Add
2996 "-shared" and "-c" options to driver's argv as needed.
2997 * jit-playback.h: Include "timevar.h".
2998 (gcc::jit::playback::context::compile): Convert return type from
3000 (gcc::jit::playback::context::postprocess): New pure virtual
3001 function, making this an abstract base class.
3002 (gcc::jit::playback::context::get_tempdir): New accessor.
3003 (gcc::jit::playback::context::invoke_driver): New function.
3004 (class gcc::jit::playback::compile_to_memory): New subclass of
3006 (class gcc::jit::playback::compile_to_file): Likewise.
3007 * jit-recording.c (gcc::jit::recording::context::compile): Use a
3008 playback::compile_to_memory, and extract its result.
3009 (gcc::jit::recording::context::compile_to_file): New function.
3010 * jit-recording.h (gcc::jit::recording::context::compile_to_file):
3012 * libgccjit++.h (gccjit::context::compile_to_file): New method.
3013 * libgccjit.c (gcc_jit_context_compile): Update log message to
3014 clarify that this is an in-memory compile.
3015 (gcc_jit_context_compile_to_file): New function.
3016 * libgccjit.h (gcc_jit_context): Clarify that you can compile
3017 a context more than once, and that you can compile to a file
3018 as well as to memory.
3019 (gcc_jit_result): Clarify that this is the result of an
3020 in-memory compilation.
3021 (gcc_jit_context_compile): Clarify that you can compile, and that
3022 this is an in-memory compilation.
3023 (enum gcc_jit_output_kind): New enum.
3024 (gcc_jit_context_compile_to_file): New function.
3025 (gcc_jit_context_enable_dump): Clarify comment to cover both forms
3027 * libgccjit.map (gcc_jit_context_compile_to_file): New API
3029 * notes.txt: Update to show the playback::context::postprocess
3032 2015-01-19 David Malcolm <dmalcolm@redhat.com>
3035 (gcc::jit::recording::memento_of_new_string_literal::make_debug_string):
3036 Add missing format string.
3038 2015-01-16 David Malcolm <dmalcolm@redhat.com>
3040 * Make-lang.in (lang_checks_parallelized): Add "check-jit".
3041 (check_jit_parallelize): Set this to an arbitrary value (10).
3043 2015-01-16 Jakub Jelinek <jakub@redhat.com>
3045 * jit-builtins.h (DEF_FUNCTION_TYPE_VAR_5): Fix spelling of
3047 (DEF_FUNCTION_TYPE_VAR_8, DEF_FUNCTION_TYPE_VAR_12): Define and
3049 * jit-builtins.c (DEF_FUNCTION_TYPE_VAR_8, DEF_FUNCTION_TYPE_VAR_12):
3052 2015-01-15 Richard Sandiford <richard.sandiford@arm.com>
3054 Update copyright years in docs/.
3056 2015-01-15 David Malcolm <dmalcolm@redhat.com>
3058 * libgccjit.c (gcc_jit_block_add_assignment_op): Check that the
3059 lvalue and the rvalue are of compatible type.
3061 2015-01-13 David Malcolm <dmalcolm@redhat.com>
3063 * docs/cp/topics/contexts.rst (Debugging): Add
3064 gccjit::context::dump_reproducer_to_file.
3065 * docs/internals/index.rst (Design notes): New section,
3066 discussing input validation and
3067 gcc_jit_context_dump_reproducer_to_file.
3068 * docs/topics/contexts.rst (Debugging): Add
3069 gcc_jit_context_dump_reproducer_to_file.
3070 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3071 * jit-common.h (gcc::jit::dump::get_context): New accessor.
3072 * jit-recording.c: Include "hash-map.h".
3073 Within namespace ::gcc::jit...
3074 (dump::write): Flush each line.
3075 (dump::make_location): Pass false for new param "created_by_user".
3076 (class allocator): New class.
3077 (allocator::~allocator): New function.
3078 (allocator::xstrdup_printf): New function.
3079 (allocator::xstrdup_printf_va): New function.
3080 (class reproducer): New subclass of dump.
3081 (reproducer::reproducer): New function.
3082 (reproducer::write_params): New function.
3083 (reproducer::write_args): New function.
3084 (reproducer::make_identifier): New function.
3085 (reproducer::make_tmp_identifier): New function.
3086 (reproducer::get_identifier): New pair of functions.
3087 (reproducer::get_identifier_as_rvalue): New function.
3088 (reproducer::get_identifier_as_lvalue): New function.
3089 (reproducer::get_identifier_as_type): New function.
3090 (reproducer::xstrdup_printf): New function.
3091 (recording::context::context): Initialize m_toplevel_ctxt.
3092 (recording::context::new_location): Add param created_by_user.
3093 (str_option_reproducer_strings): New table of strings.
3094 (int_option_reproducer_strings): Likewise.
3095 (bool_option_reproducer_strings): Likewise.
3096 (get_type_enum_strings): Likewise.
3097 (names_of_function_kinds): Likewise.
3098 (global_kind_reproducer_strings): Likewise.
3099 (unary_op_reproducer_strings): Likewise.
3100 (binary_op_reproducer_strings): Likewise.
3101 (comparison_reproducer_strings): Likewise.
3102 Within namespace ::gcc::jit::recording::...
3103 (context::dump_reproducer_to_file): New function.
3104 (string::write_reproducer): Likewise.
3105 (location::write_reproducer): Likewise.
3106 (type::access_as_type): Likewise.
3107 (memento_of_get_type::write_reproducer): Likewise.
3108 (memento_of_get_pointer::write_reproducer): Likewise.
3109 (memento_of_get_const::write_reproducer): Likewise.
3110 (memento_of_get_volatile::write_reproducer): Likewise.
3111 (array_type::write_reproducer): Likewise.
3112 (function_type::write_reproducer): Likewise.
3113 (function_type::write_deferred_reproducer): Likewise.
3114 (field::write_reproducer): Likewise.
3115 (struct_::access_as_type): Likewise.
3116 (struct_::write_reproducer): Likewise.
3117 (union_::write_reproducer): Likewise.
3118 (fields::write_reproducer): Likewise.
3119 (rvalue::access_as_rvalue): Likewise.
3120 (lvalue::access_as_rvalue): Likewise.
3121 (lvalue::access_as_lvalue): Likewise.
3122 (param::access_as_rvalue): Likewise.
3123 (param::access_as_lvalue): Likewise.
3124 (param::write_reproducer): Likewise.
3125 (function::write_reproducer): Likewise.
3126 (block::write_reproducer): Likewise.
3127 (global::write_reproducer): Likewise.
3128 (memento_of_new_rvalue_from_const <int>::write_reproducer):
3130 (memento_of_new_rvalue_from_const <long>::write_reproducer):
3132 (memento_of_new_rvalue_from_const <double>::write_reproducer):
3134 (memento_of_new_rvalue_from_const <void *>::write_reproducer):
3136 (memento_of_new_string_literal::write_reproducer): Likewise.
3137 (unary_op::write_reproducer): Likewise.
3138 (binary_op::write_reproducer): Likewise.
3139 (comparison::write_reproducer): Likewise.
3140 (cast::write_reproducer): Likewise.
3141 (call::write_reproducer): Likewise.
3142 (call_through_ptr::write_reproducer): Likewise.
3143 (array_access::write_reproducer): Likewise.
3144 (access_field_of_lvalue::write_reproducer): Likewise.
3145 (access_field_rvalue::write_reproducer): Likewise.
3146 (dereference_field_rvalue::write_reproducer): Likewise.
3147 (dereference_rvalue::write_reproducer): Likewise.
3148 (get_address_of_lvalue::write_reproducer): Likewise.
3149 (local::write_reproducer): Likewise.
3150 (eval::write_reproducer): Likewise.
3151 (assignment::write_reproducer): Likewise.
3152 (assignment_op::write_reproducer): Likewise.
3153 (comment::write_reproducer): Likewise.
3154 (conditional::write_reproducer): Likewise.
3155 (jump::write_reproducer): Likewise.
3156 (return_::write_reproducer): Likewise.
3157 * jit-recording.h (gcc::jit::reproducer): New forward declararion.
3158 Within namespace ::gcc::jit::recording::...
3159 (context::new_location): Add "created_by_user" param.
3160 (context::dump_reproducer_to_file): New method.
3161 (context::m_toplevel_ctxt): New field.
3162 (memento::write_reproducer): New pure virtual function.
3163 (memento::dyn_cast_location): New virtual function.
3164 (string::write_reproducer):
3165 (location::location): Add "created_by_user" param.
3166 (location::dyn_cast_location): New function.
3167 (location::created_by_user): New accessor.
3168 (location::write_reproducer): New function.
3169 (location::m_created_by_user): New field.
3170 (type::access_as_type): New virtual function.
3171 (location::write_reproducer): Likewise.
3172 (type::access_as_type): Likewise.
3173 (memento_of_get_type::write_reproducer): Likewise.
3174 (memento_of_get_pointer::write_reproducer): Likewise.
3175 (memento_of_get_const::write_reproducer): Likewise.
3176 (memento_of_get_volatile::write_reproducer): Likewise.
3177 (array_type::write_reproducer): Likewise.
3178 (function_type::write_reproducer): Likewise.
3179 (function_type::write_deferred_reproducer): Likewise.
3180 (field::write_reproducer): Likewise.
3181 (struct_::access_as_type): Likewise.
3182 (struct_::write_reproducer): Likewise.
3183 (union_::write_reproducer): Likewise.
3184 (union_::m_fields): Remove stray unused field.
3185 (fields::length): New accessor.
3186 (fields::get_field): New accessor.
3187 (fields::write_reproducer): New function.
3188 (rvalue::access_as_rvalue): Likewise.
3189 (lvalue::access_as_rvalue): Likewise.
3190 (lvalue::access_as_lvalue): Likewise.
3191 (param::access_as_rvalue): Likewise.
3192 (param::access_as_lvalue): Likewise.
3193 (param::write_reproducer): Likewise.
3194 (function::write_reproducer): Likewise.
3195 (block::write_reproducer): Likewise.
3196 (global::write_reproducer): Likewise.
3197 (memento_of_new_rvalue_from_const <HOST_TYPE>::write_reproducer):
3199 (memento_of_new_string_literal::write_reproducer): Likewise.
3200 (unary_op::write_reproducer): Likewise.
3201 (binary_op::write_reproducer): Likewise.
3202 (comparison::write_reproducer): Likewise.
3203 (cast::write_reproducer): Likewise.
3204 (call::write_reproducer): Likewise.
3205 (call_through_ptr::write_reproducer): Likewise.
3206 (array_access::write_reproducer): Likewise.
3207 (access_field_of_lvalue::write_reproducer): Likewise.
3208 (access_field_rvalue::write_reproducer): Likewise.
3209 (dereference_field_rvalue::write_reproducer): Likewise.
3210 (dereference_rvalue::write_reproducer): Likewise.
3211 (get_address_of_lvalue::write_reproducer): Likewise.
3212 (local::write_reproducer): Likewise.
3213 (eval::write_reproducer): Likewise.
3214 (assignment::write_reproducer): Likewise.
3215 (assignment_op::write_reproducer): Likewise.
3216 (comment::write_reproducer): Likewise.
3217 (conditional::write_reproducer): Likewise.
3218 (jump::write_reproducer): Likewise.
3219 (return_::write_reproducer): Likewise.
3220 * libgccjit++.h (gccjit::context::dump_reproducer_to_file): New.
3221 * libgccjit.c (gcc_jit_context_new_location): Pass "true" as
3222 param "created_by_user".
3223 (gcc_jit_context_dump_reproducer_to_file): New API entrypoint.
3224 * libgccjit.h (gcc_jit_context_dump_reproducer_to_file): New API
3226 * libgccjit.map (gcc_jit_context_dump_reproducer_to_file): New API
3229 2015-01-12 David Malcolm <dmalcolm@redhat.com>
3231 * jit-recording.c (class gcc::jit::rvalue_usage_validator): New.
3232 (gcc::jit::rvalue_usage_validator::rvalue_usage_validator): New
3234 (gcc::jit::rvalue_usage_validator::visit): New function.
3235 (gcc::jit::recording::rvalue::verify_valid_within_stmt): New
3237 (gcc::jit::recording::rvalue::set_scope): New function.
3238 (gcc::jit::recording::function::function): Call set_scope on each
3239 param, issuing errors for any params that already have a function.
3240 (gcc::jit::recording::block::add_eval): Return the new statement;
3241 update the comment given that some error-checking now happens after
3243 (gcc::jit::recording::block::add_assignment): Likewise.
3244 (gcc::jit::recording::block::add_assignment_op): Likewise.
3245 (gcc::jit::recording::block::add_comment): Likewise.
3246 (gcc::jit::recording::block::end_with_conditional): Likewise.
3247 (gcc::jit::recording::block::end_with_jump): Likewise.
3248 (gcc::jit::recording::block::end_with_return): Likewise.
3249 (gcc::jit::recording::block::validate): Add a comment.
3250 (gcc::jit::recording::unary_op::visit_children): New function.
3251 (gcc::jit::recording::binary_op::visit_children): New function.
3252 (gcc::jit::recording::comparison::visit_children): New function.
3253 (gcc::jit::recording::cast::visit_children): New function.
3254 (gcc::jit::recording::call::visit_children): New function.
3255 (gcc::jit::recording::call_through_ptr::visit_children): New function.
3256 (gcc::jit::recording::array_access::visit_children): New function.
3257 (gcc::jit::recording::access_field_of_lvalue::visit_children): New
3259 (gcc::jit::recording::access_field_rvalue::visit_children): New
3261 (gcc::jit::recording::dereference_field_rvalue::visit_children):
3263 (gcc::jit::recording::dereference_rvalue::visit_children): New
3265 (gcc::jit::recording::get_address_of_lvalue::visit_children): New
3267 * jit-recording.h: Within namespace gcc::jit::recording...
3268 (class rvalue_visitor): New.
3269 (rvalue::rvalue): Initialize m_scope.
3270 (rvalue::get_loc): New accessor.
3271 (rvalue::verify_valid_within_stmt): New function.
3272 (rvalue::visit_children): New pure virtual function.
3273 (rvalue::set_scope): New function.
3274 (rvalue::get_scope): New function.
3275 (rvalue::dyn_cast_param): New function.
3276 (rvalue::m_scope): New field.
3277 (param::visit_children): New empty function.
3278 (param::dyn_cast_param): New function.
3279 (function::get_loc): New function.
3280 (block::add_eval): Return the new statement.
3281 (block::add_assignment): Likewise.
3282 (block::add_assignment_op): Likewise.
3283 (block::add_comment): Likewise.
3284 (block::end_with_conditional): Likewise.
3285 (block::end_with_jump): Likewise.
3286 (block::end_with_return): Likewise.
3287 (global::visit_children): New function.
3288 (memento_of_new_rvalue_from_const<HOST_TYPE>::visit_children):
3290 (memento_of_new_string_literal::visit_children): New function.
3291 (unary_op::visit_children): New function.
3292 (binary_op::visit_children): New function.
3293 (comparison::visit_children): New function.
3294 (cast::visit_children): New function.
3295 (call::visit_children): New function.
3296 (call_through_ptr::visit_children): New function.
3297 (array_access::visit_children): New function.
3298 (access_field_of_lvalue::visit_children): New function.
3299 (access_field_rvalue::visit_children): New function.
3300 (dereference_field_rvalue::visit_children): New function.
3301 (dereference_rvalue::visit_children): New function.
3302 (get_address_of_lvalue::visit_children): New function.
3303 (local::local): Call set_scope.
3304 (local::visit_children): New function.
3305 (statement::get_block): Make public.
3306 * libgccjit.c (RETURN_VAL_IF_FAIL_PRINTF5): New macro.
3307 (RETURN_NULL_IF_FAIL_PRINTF5): New macro.
3308 (gcc_jit_context_new_function): Verify that each param has
3309 not yet been used for creating another function.
3310 (gcc_jit_block_add_eval): After creating the stmt, verify
3311 that the rvalue expression tree is valid to use within it.
3312 (gcc_jit_block_add_assignment): Likewise for the lvalue and
3313 rvalue expression trees.
3314 (gcc_jit_block_add_assignment_op): Likewise.
3315 (gcc_jit_block_end_with_conditional): Likewise for the boolval
3317 (gcc_jit_block_end_with_return): Likewise for the rvalue
3319 (gcc_jit_block_end_with_void_return): Remove return of "void",
3320 now that block::end_with_return is now non-void.
3322 2015-01-12 David Malcolm <dmalcolm@redhat.com>
3324 * jit-playback.c (gcc::jit::playback::context::read_dump_file):
3325 Add missing fclose on error-handling path.
3327 2015-01-12 David Malcolm <dmalcolm@redhat.com>
3329 * docs/cp/topics/expressions.rst (Global variables): Add
3330 enum gcc_jit_global_kind param to gccjit::context::new_global.
3331 * docs/topics/expressions.rst (Global variables): Likewise.
3332 Document the new enum.
3333 * docs/topics/results.rst (Compilation results): Document
3335 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3336 * dummy-frontend.c (jit_langhook_write_globals): Call into the
3337 playback context's write_global_decls_1 and write_global_decls_2
3338 before and after calling symtab->finalize_compilation_unit ().
3339 * jit-playback.c: Include "debug.h".
3340 (gcc::jit::playback::context::new_global): Add "kind" param and
3341 use it to set TREE_PUBLIC, TREE_STATIC and DECL_EXTERNAL on the
3342 underlying VAR_DECL. Call varpool_node::get_create on the
3343 VAR_DECL, and add it to m_globals.
3344 (gcc::jit::playback::context::write_global_decls_1): New function.
3345 (gcc::jit::playback::context::write_global_decls_2): New function.
3346 * jit-playback.h (gcc::jit::playback::context::context): Call
3347 create on m_globals.
3348 (gcc::jit::playback::context::new_global): Add "kind" param.
3349 (gcc::jit::playback::context::write_global_decls_1): New function.
3350 (gcc::jit::playback::context::write_global_decls_2): New function.
3351 (gcc::jit::playback::context::m_globals): New field.
3352 * jit-recording.c (gcc::jit::recording::context::context):
3353 Initialize m_globals.
3354 (gcc::jit::recording::context::new_global): Add param "kind".
3355 Add the new global to m_globals.
3356 (gcc::jit::recording::context::dump_to_file): Dump the globals.
3357 (gcc::jit::recording::global::replay_into): Add field m_kind.
3358 (gcc::jit::recording::global::write_to_dump): New override.
3359 * jit-recording.h (gcc::jit::recording::context::new_global): Add
3361 (gcc::jit::recording::context::m_globals): New field.
3362 (gcc::jit::recording::global::global): Add param kind.
3363 (gcc::jit::recording::global::write_to_dump): New override.
3364 (gcc::jit::recording::global::m_kind): New field.
3365 * jit-result.c (gcc::jit::result::get_global): New function.
3366 * jit-result.h (gcc::jit::result::get_global): New function.
3367 * libgccjit++.h (gccjit::context::new_global): Add "kind" param.
3368 * libgccjit.c (gcc_jit_context_new_global): Likewise.
3369 (gcc_jit_result_get_global): New API entrypoint.
3370 * libgccjit.h (gcc_jit_result_get_global): New API entrypoint.
3371 (enum gcc_jit_global_kind): New enum.
3372 (gcc_jit_context_new_global): API change: add "kind" param.
3373 * libgccjit.map (gcc_jit_result_get_global): New symbol.
3375 2015-01-09 David Malcolm <dmalcolm@redhat.com>
3377 * dummy-frontend.c: Include "fixed-value.h", "alias.h", "flags.h",
3378 "symtab.h", "inchash.h". Move include of "hash-set.h" much
3380 * jit-builtins.c: Remove redundant includes of "opts.h" and
3382 * jit-common.h: Include "hash-set.h", "input.h", "vec.h",
3383 "double-int.h", "alias.h", "flags.h", "symtab.h", "inchash.h".
3384 * jit-playback.c: Include "hashtab.h", "machmode.h", "input.h",
3385 "statistics.h", "vec.h", "double-int.h", "real.h",
3386 "fixed-value.h", "alias.h", "flags.h", "symtab.h", "tree-core.h",
3387 "inchash.h", "fold-const.h". Move include of "hash-set.h" to
3389 * jit-recording.c: Remove redundant includes of "opts.h" and
3392 2015-01-09 David Malcolm <dmalcolm@redhat.com>
3394 * docs/cp/topics/expressions.rst (Simple expressions): Use
3395 ":c:type:" for C types. Document new overload of
3396 gcc::jit::context::new_rvalue.
3397 * docs/topics/expressions.rst (Simple expressions): Use
3398 ":c:type:" for C types. Document new entrypoint
3399 gcc_jit_context_new_rvalue_from_long.
3400 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3401 * jit-playback.c: Within namespace gcc::jit::playback...
3402 (context::new_rvalue_from_int): Eliminate in favor of...
3403 (context::new_rvalue_from_const <int>): ...this.
3404 (context::new_rvalue_from_double): Eliminate in favor of...
3405 (context::new_rvalue_from_const <double>): ...this.
3406 (context::new_rvalue_from_const <long>): New.
3407 (context::new_rvalue_from_ptr): Eliminate in favor of...
3408 (context::new_rvalue_from_const <void *>): ...this.
3409 * jit-playback.h: Within namespace gcc::jit::playback...
3410 (context::new_rvalue_from_int): Eliminate in favor of...
3411 (context::new_rvalue_from_const <HOST_TYPE>): ...this.
3412 (context::new_rvalue_from_double): Likewise.
3413 (context::new_rvalue_from_ptr): Likewise.
3414 * jit-recording.c: Within namespace gcc::jit::recording...
3415 (context::new_rvalue_from_int): Eliminate.
3416 (context::new_rvalue_from_double): Likewise.
3417 (context::new_rvalue_from_ptr): Likewise.
3418 (class memento_of_new_rvalue_from_const <int>):
3419 Add explicit specialization.
3420 (class memento_of_new_rvalue_from_const <long>):
3422 (class memento_of_new_rvalue_from_const <double>):
3424 (class memento_of_new_rvalue_from_const <void *>):
3426 (memento_of_new_rvalue_from_int::replay_into):
3428 (memento_of_new_rvalue_from_const <HOST_TYPE>::replay_into):
3430 (memento_of_new_rvalue_from_double::replay_into):
3432 (memento_of_new_rvalue_from_ptr::replay_into):
3433 ...and this to be deleted.
3434 (memento_of_new_rvalue_from_int::make_debug_string):
3436 (memento_of_new_rvalue_from_const <int>::make_debug_string):
3438 (memento_of_new_rvalue_from_double::make_debug_string):
3440 (memento_of_new_rvalue_from_const <double>::make_debug_string):
3442 (memento_of_new_rvalue_from_ptr::make_debug_string)
3444 (memento_of_new_rvalue_from_const <void *>::make_debug_string):
3446 (memento_of_new_rvalue_from_const <long>::make_debug_string):
3448 * jit-recording.h: Within namespace gcc::jit::recording...
3449 (context::new_rvalue_from_int): Eliminate.
3450 (context::new_rvalue_from_double): Likewise.
3451 (context::new_rvalue_from_ptr): Likewise, all in favor of...
3452 (context::new_rvalue_from_const <HOST_TYPE>): New family of
3454 (class memento_of_new_rvalue_from_int): Eliminate.
3455 (class memento_of_new_rvalue_from_double): Likewise.
3456 (class memento_of_new_rvalue_from_ptr): Likewise.
3457 (class memento_of_new_rvalue_from_const <HOST_TYPE>): New family
3458 of rvalue subclasses.
3459 * libgccjit++.h (gccjit::context::new_rvalue): New overload, for
3461 * libgccjit.c (gcc_jit_context_new_rvalue_from_int): Update for
3462 rewriting of recording::context::new_rvalue_from_int to
3463 recording::context::new_rvalue_from_const <int>.
3464 (gcc_jit_context_new_rvalue_from_long): New API entrypoint.
3465 (gcc_jit_context_new_rvalue_from_double): Update for
3466 rewriting of recording::context::new_rvalue_from_double to
3467 recording::context::new_rvalue_from_const <double>.
3468 (gcc_jit_context_new_rvalue_from_ptr): Update for
3469 rewriting of recording::context::new_rvalue_from_ptr to
3470 recording::context::new_rvalue_from_const <void *>.
3471 * libgccjit.h (gcc_jit_context_new_rvalue_from_long): New API
3473 * libgccjit.map (gcc_jit_context_new_rvalue_from_long): Likewise.
3475 2015-01-09 David Malcolm <dmalcolm@redhat.com>
3478 * docs/internals/test-hello-world.exe.log.txt: Update, the log now
3479 shows tempdir creation/cleanup.
3480 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3481 * jit-logging.h (class gcc::jit::log_user): Add gcc::jit::tempdir
3482 to the list of subclasses in the comment.
3483 * jit-playback.c (gcc::jit::playback::context::context): Add a
3484 comment clarifying when the tempdir gets cleaned up.
3485 (gcc::jit::playback::context::compile): Pass the context's logger,
3486 if any, to the tempdir.
3487 (gcc::jit::playback::context::dlopen_built_dso): When creating the
3488 gcc::jit::result, if GCC_JIT_BOOL_OPTION_DEBUGINFO is set, hand
3489 over ownership of the tempdir to it.
3490 * jit-result.c: Include "jit-tempdir.h".
3491 (gcc::jit::result::result): Add tempdir param, saving it as
3493 (gcc::jit::result::~result): Delete m_tempdir.
3494 * jit-result.h (gcc::jit::result::result): Add tempdir param.
3495 (gcc::jit::result::m_tempdir): New field.
3496 * jit-tempdir.c (gcc::jit::tempdir::tempdir): Add logger param;
3498 (gcc::jit::tempdir::create): Add JIT_LOG_SCOPE to log entry/exit,
3499 and log m_path_template and m_path_tempdir.
3500 (gcc::jit::tempdir::~tempdir): Add JIT_LOG_SCOPE to log
3501 entry/exit, and log the unlink and rmdir calls.
3502 * jit-tempdir.h: Include "jit-logging.h".
3503 (class gcc::jit::tempdir): Make this be a subclass of log_user.
3504 (gcc::jit::tempdir::tempdir): Add logger param.
3505 * notes.txt: Update to show the two possible places where the
3506 tempdir can be cleaned up.
3508 2015-01-08 David Malcolm <dmalcolm@redhat.com>
3510 * libgccjit.h (struct gcc_jit_context): Rewrite the descriptive
3513 2015-01-08 David Malcolm <dmalcolm@redhat.com>
3515 * docs/topics/contexts.rst (Error-handling): Document new
3516 entrypoint gcc_jit_context_get_last_error.
3517 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3518 * jit-recording.c (gcc::jit::recording::context::context):
3519 Initialize new fields "m_last_error_str" and
3520 "m_owns_last_error_str".
3521 (gcc::jit::recording::context::~context): Clean up
3522 m_last_error_str, if needed.
3523 (gcc::jit::recording::context::add_error_va): Update
3524 m_last_error_str and m_owns_last_error_str, freeing the old
3525 value if appropriate.
3526 (gcc::jit::recording::context::get_last_error): New function.
3527 * jit-recording.h (gcc::jit::recording::context::get_last_error):
3529 (gcc::jit::recording::context): New fields m_last_error_str and
3530 m_owns_last_error_str.
3531 * libgccjit.c (gcc_jit_context_get_last_error): New function.
3532 * libgccjit.h (gcc_jit_context_get_last_error): New declaration.
3533 * libgccjit.map (gcc_jit_context_get_last_error): New function.
3535 2015-01-08 David Malcolm <dmalcolm@redhat.com>
3537 * Make-lang.in (jit_OBJS): Add jit/jit-logging.o.
3538 * docs/internals/index.rst (Overview of code structure): Mention
3539 gcc_jit_context_set_logfile, and embed the example logfile.
3540 * docs/internals/test-hello-world.exe.log.txt: New file: example
3542 * docs/topics/contexts.rst (Debugging): Add documentation
3543 for gcc_jit_context_set_logfile.
3544 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3545 * dummy-frontend.c: Include "jit-logging.h".
3546 (jit_langhook_init): Assert that there is an active playback
3547 context. If it has a logger, log entry/exit to this function.
3548 (jit_langhook_write_globals): Likewise.
3549 * jit-common.h (gcc::jit::logger): New forward declaration.
3550 * jit-logging.c: New file.
3551 * jit-logging.h: New file.
3552 * jit-playback.c: Include "jit-logging.h".
3553 (gcc::jit::playback::context::context): Initialize the log_user
3554 base class from the recording context's logger (if any). Use
3555 JIT_LOG_SCOPE to log entry/exit from the function body.
3556 (gcc::jit::playback::context::~context): Use JIT_LOG_SCOPE to
3557 log entry/exit from the function body.
3558 (gcc::jit::playback::build_stmt_list): Likewise.
3559 (gcc::jit::playback::function::postprocess): Likewise.
3560 (gcc::jit::playback::context::compile): Likewise. Log the
3561 entry/exit to toplev::main and toplev::finalize. Log the
3562 fake argv passed to toplev::main.
3563 (gcc::jit::playback::context::acquire_mutex): Use JIT_LOG_SCOPE to
3564 log entry/exit from the function body.
3565 (gcc::jit::playback::context::release_mutex): Likewise.
3566 (gcc::jit::playback::context::make_fake_args): Likewise.
3567 (gcc::jit::playback::context::extract_any_requested_dumps):
3569 (gcc::jit::playback::context::convert_to_dso): Likewise. Also,
3570 log the arguments that the driver is invoked with.
3571 (gcc::jit::playback::context::dlopen_built_dso): Likewise. Pass
3572 the logger to the result object.
3573 (gcc::jit::playback::context::replay): Use JIT_LOG_SCOPE to
3574 log entry/exit from the function body.
3575 (gcc::jit::playback::context::dump_generated_code): Likewise.
3576 (gcc::jit::playback::context::handle_locations): Likewise.
3577 * jit-playback.h (gcc::jit::playback::context): Make this be
3578 a subclass of gcc::jit::log_user.
3579 * jit-recording.c: Include "jit-logging.h".
3580 (gcc::jit::recording::context::context: Initialize the logger to
3581 NULL for root contexts, or to the parent's logger for child
3583 (gcc::jit::recording::context::~context): Use JIT_LOG_SCOPE to
3584 log entry/exit from the function body.
3585 (gcc::jit::recording::context::replay_into): Likewise.
3586 (gcc::jit::recording::context::disassociate_from_playback):
3588 (gcc::jit::recording::context::compile): Likewise.
3589 (recording::context::add_error_va): Likewise. Also, log the
3591 (gcc::jit::recording::context::validate): Use JIT_LOG_SCOPE to
3592 log entry/exit from the function body.
3593 * jit-recording.h: Include "jit-logging.h".
3594 (gcc::jit::recording::context): Make this be a subclass of
3596 * jit-result.c: Include "jit-common.h" and "jit-logging.h".
3597 (gcc::jit::result::result): Add logger param, recording it.
3598 Use JIT_LOG_SCOPE to log entry/exit from the function body.
3599 (gcc::jit::result::~result(): Use JIT_LOG_SCOPE to
3600 log entry/exit from the function body.
3601 (gcc::jit::result::get_code): Likewise.
3602 * jit-result.h (gcc::jit::result): Make this be a subclass of
3604 (gcc::jit::result::result): Add logger parameter.
3605 * libgccjit++.h (gccjit::context::set_logfile): New function.
3606 * libgccjit.c: Include "jit-logging.h".
3607 (gcc_jit_context_acquire): Log the context.
3608 (gcc_jit_context_release): Use JIT_LOG_FUNC to
3609 log entry/exit from the function body, and log the context.
3610 (gcc_jit_context_new_child_context): Likewise, logging both
3612 (gcc_jit_context_new_location): Use JIT_LOG_FUNC to
3613 log entry/exit from the function body.
3614 (gcc_jit_context_get_type): Likewise.
3615 (gcc_jit_context_get_int_type): Likewise.
3616 (gcc_jit_context_new_array_type): Likewise.
3617 (gcc_jit_context_new_field): Likewise.
3618 (gcc_jit_context_new_struct_type): Likewise.
3619 (gcc_jit_context_new_opaque_struct): Likewise.
3620 (gcc_jit_struct_set_fields): Likewise.
3621 (gcc_jit_context_new_union_type): Likewise.
3622 (gcc_jit_context_new_function_ptr_type): Likewise.
3623 (gcc_jit_context_new_param): Likewise.
3624 (gcc_jit_context_new_function): Likewise.
3625 (gcc_jit_context_get_builtin_function): Likewise.
3626 (gcc_jit_function_get_param): Likewise.
3627 (gcc_jit_function_dump_to_dot): Likewise.
3628 (gcc_jit_function_new_block): Likewise.
3629 (gcc_jit_context_new_global): Likewise.
3630 (gcc_jit_context_new_rvalue_from_int): Likewise.
3631 (gcc_jit_context_zero): Likewise.
3632 (gcc_jit_context_one): Likewise.
3633 (gcc_jit_context_new_rvalue_from_double): Likewise.
3634 (gcc_jit_context_new_rvalue_from_ptr): Likewise.
3635 (gcc_jit_context_null): Likewise.
3636 (gcc_jit_context_new_string_literal): Likewise.
3637 (gcc_jit_context_new_unary_op): Likewise.
3638 (gcc_jit_context_new_binary_op): Likewise.
3639 (gcc_jit_context_new_comparison): Likewise.
3640 (gcc_jit_context_new_call): Likewise.
3641 (gcc_jit_context_new_call_through_ptr): Likewise.
3642 (gcc_jit_context_new_cast): Likewise.
3643 (gcc_jit_context_new_array_access): Likewise.
3644 (gcc_jit_lvalue_access_field): Likewise.
3645 (gcc_jit_rvalue_access_field): Likewise.
3646 (gcc_jit_rvalue_dereference_field): Likewise.
3647 (gcc_jit_rvalue_dereference): Likewise.
3648 (gcc_jit_lvalue_get_address): Likewise.
3649 (gcc_jit_function_new_local): Likewise.
3650 (gcc_jit_block_add_eval): Likewise.
3651 (gcc_jit_block_add_assignment): Likewise.
3652 (gcc_jit_block_add_assignment_op): Likewise.
3653 (gcc_jit_block_end_with_conditional): Likewise.
3654 (gcc_jit_block_add_comment): Likewise.
3655 (gcc_jit_block_end_with_jump): Likewise.
3656 (gcc_jit_block_end_with_return): Likewise.
3657 (gcc_jit_block_end_with_void_return): Likewise.
3658 (gcc_jit_context_set_str_option): Likewise.
3659 (gcc_jit_context_set_int_option): Likewise.
3660 (gcc_jit_context_set_bool_option): Likewise.
3661 (gcc_jit_context_enable_dump): Likewise.
3662 (gcc_jit_context_compile): Likewise. Also log the context,
3664 (gcc_jit_context_dump_to_file): Likewise.
3665 (gcc_jit_context_set_logfile): New function.
3666 (gcc_jit_context_get_first_error): Use JIT_LOG_FUNC to
3667 log entry/exit from the function body.
3668 (gcc_jit_result_get_code): Likewise. Also log the fnname)
3669 and the ptr to be returned.
3670 (gcc_jit_result_release): Likewise. Also log the result.
3671 * libgccjit.h: Include <stdio.h>, since we need FILE *.
3672 (gcc_jit_context_set_logfile): New declaration.
3673 * libgccjit.map (gcc_jit_context_set_logfile): New.
3675 2015-01-07 David Malcolm <dmalcolm@redhat.com>
3677 * jit-recording.h (gcc::jit::recording::type::is_void): New
3679 (gcc::jit::recording::memento_of_get_type::is_void): New
3680 function, overriding default implementation.
3681 * libgccjit.c (gcc_jit_rvalue_dereference): Verify that
3682 the underlying type is not "void".
3684 2015-01-07 David Malcolm <dmalcolm@redhat.com>
3686 * docs/topics/expressions.rst (Unary Operations): Add
3687 GCC_JIT_UNARY_OP_ABS.
3688 * jit-playback.c (gcc::jit::playback::context::new_unary_op):
3690 * jit-recording.c (unary_op_strings): Likewise.
3691 * libgccjit.c (gcc_jit_context_new_unary_op): Update checking
3692 of "op" to reflect addition of GCC_JIT_UNARY_OP_ABS.
3693 * libgccjit.h (enum gcc_jit_unary_op): Add GCC_JIT_UNARY_OP_ABS.
3694 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3696 2015-01-07 David Malcolm <dmalcolm@redhat.com>
3698 * jit-recording.h (gcc::jit::recording::memento_of_get_type): Fix
3701 2015-01-07 David Malcolm <dmalcolm@redhat.com>
3703 * TODO.rst (Test suite): Remove item about running C++ testcases.
3704 * docs/internals/index.rst (Working on the JIT library): Add
3705 "c++" to the enabled languages in the suggested "configure"
3706 invocation, and add a description of why this is necessary.
3707 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3709 2015-01-07 David Malcolm <dmalcolm@redhat.com>
3711 * docs/internals/index.rst: Update to reflect that built
3712 testcases are now test-foo.c.exe, rather than test-foo.exe.
3713 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3715 2015-01-05 Jakub Jelinek <jakub@redhat.com>
3717 Update copyright years.
3719 2014-12-19 David Malcolm <dmalcolm@redhat.com>
3721 * jit-playback.c (gcc::jit::playback::context::build_cast): In
3722 case BOOLEAN_TYPE, don't assume that the source expression is
3725 2014-12-19 David Malcolm <dmalcolm@redhat.com>
3727 * jit-recording.c (gcc::jit::recording::context::context): When
3728 copying string options from a parent context, take a copy of the
3729 underlying buffers, rather than simply copying the pointer.
3731 2014-12-19 David Malcolm <dmalcolm@redhat.com>
3733 * jit-recording.c (gcc::jit::recording::context::set_str_option):
3736 2014-12-11 David Malcolm <dmalcolm@redhat.com>
3738 * docs/cp/topics/contexts.rst (gccjit::context::set_str_option):
3739 Document new function.
3740 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3742 2014-12-10 Ulrich Drepper <drepper@gmail.com>
3744 Minor interface cleanups of libgccjit
3745 * jit-playback.c (convert_to_dso): Use auto_vec instead
3746 of automatic array to build up command line.
3747 * jit-recording.c (recording::context::set_str_option):
3748 Make copy of the string.
3749 (recording::context::~context): Free string options.
3750 * jit-recording.h (recording::context): Adjust type
3751 of m_str_options member.
3752 * libgccjit.h: Adjust comment about
3753 gcc_jit_context_set_str_option parameter being used after
3755 Update comment now that all interfaces are copy strings
3757 * libgccjit++.h (gccjit::context): Add set_str_option
3760 2014-12-10 David Malcolm <dmalcolm@redhat.com>
3762 * docs/cp/index.rst: New file.
3763 * docs/cp/intro/index.rst: New file.
3764 * docs/cp/intro/tutorial01.rst: New file.
3765 * docs/cp/intro/tutorial02.rst: New file.
3766 * docs/cp/intro/tutorial03.rst: New file.
3767 * docs/cp/intro/tutorial04.rst: New file.
3768 * docs/cp/topics/contexts.rst: New file.
3769 * docs/cp/topics/expressions.rst: New file.
3770 * docs/cp/topics/functions.rst: New file.
3771 * docs/cp/topics/index.rst: New file.
3772 * docs/cp/topics/locations.rst: New file.
3773 * docs/cp/topics/objects.rst: New file.
3774 * docs/cp/topics/results.rst: New file.
3775 * docs/cp/topics/types.rst: New file.
3776 * docs/examples/tut01-hello-world.cc: New file.
3777 * docs/examples/tut02-square.c: Fix missing newline in output.
3778 * docs/examples/tut02-square.cc: New file.
3779 * docs/examples/tut03-sum-of-squares.cc: New file.
3780 * docs/examples/tut04-toyvm/toyvm.cc: New file.
3781 * docs/index.rst: Move summary to above the table of contents.
3782 Add text about the C vs C++ APIs.
3783 * docs/topics/contexts.rst: Fix a typo.
3785 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3786 * docs/_build/texinfo/factorial1.png: New file.
3787 * docs/_build/texinfo/sum-of-squares1.png: New file.
3789 2014-12-09 David Malcolm <dmalcolm@redhat.com>
3791 * docs/examples/tut04-toyvm/toyvm.c (toyvm_function_compile): Move
3792 logic for determine "funcname" to new function...
3793 (get_function_name): ...here, adding logic to skip any leading
3794 path from the filename.
3795 (toyvm_function_parse): Use the filename for fn_filename, rather
3796 than "name", so that the debugger can locate the source .toy
3798 (toyvm_function_parse): Don't fclose a NULL FILE *.
3800 2014-12-09 David Malcolm <dmalcolm@redhat.com>
3803 * docs/internals/index.rst (Running under valgrind): New
3805 (docs/_build/texinfo/libgccjit.texi): Regenerate.
3807 2014-12-09 David Malcolm <dmalcolm@redhat.com>
3810 * Make-lang.in (jit_OBJS): Add jit/jit-tempdir.o.
3811 * jit-common.h (gcc::jit::tempdir): New forward decl.
3812 * jit-playback.c: Include jit-tempdir.h.
3813 (gcc::jit::playback::context::context): Initialize m_tempdir.
3814 (gcc::jit::playback::context::~context): Move tempdir
3815 cleanup to new file jit-tempdir.c
3816 (make_tempdir_path_template): Move to new file jit-tempdir.c.
3817 (gcc::jit::playback::context::compile): Move tempdir creation
3818 to new tempdir object in new file jit-tempdir.c.
3819 (gcc::jit::playback::context::make_fake_args): Get path from
3820 tempdir object rather than from member data.
3821 (gcc::jit::playback::context::convert_to_dso): Likewise.
3822 (gcc::jit::playback::context::dlopen_built_dso): Likewise.
3823 (gcc::jit::playback::context::dump_generated_code): Likewise.
3824 (gcc::jit::playback::context::get_path_c_file): New function.
3825 (gcc::jit::playback::context::get_path_s_file): New function.
3826 (gcc::jit::playback::context::get_path_so_file): New function.
3827 * jit-playback.h (gcc::jit::playback::context::get_path_c_file):
3829 (gcc::jit::playback::context::get_path_s_file): New function.
3830 (gcc::jit::playback::context::get_path_so_file): New function.
3831 (gcc::jit::playback::context): Move fields "m_path_template",
3832 "m_path_tempdir", "m_path_c_file", "m_path_s_file",
3833 "m_path_so_file" to new jit::tempdir class; add field "m_tempdir".
3834 * jit-tempdir.c: New file.
3835 * jit-tempdir.h: New file.
3837 2014-12-09 David Malcolm <dmalcolm@redhat.com>
3839 * jit-playback.c (gcc::jit::playback::context::compile): Acquire the
3840 mutex here, immediately before using toplev, and release it here, on
3841 each exit path after acquisition.
3842 (jit_mutex): Move this variable here, from jit-recording.c.
3843 (gcc::jit::playback::context::acquire_mutex): New function, based on
3844 code in jit-recording.c.
3845 (gcc::jit::playback::context::release_mutex): Likewise.
3846 * jit-playback.h (gcc::jit::playback::context::acquire_mutex): New
3848 (gcc::jit::playback::context::release_mutex): New function.
3849 * jit-recording.c (jit_mutex): Move this variable to jit-playback.c.
3850 (gcc::jit::recording::context::compile): Move mutex-handling from
3851 here into jit-playback.c's gcc::jit::playback::context::compile.
3852 * notes.txt: Update to show the new locations of ACQUIRE_MUTEX
3855 2014-12-09 David Malcolm <dmalcolm@redhat.com>
3857 * jit-playback.c (gcc::jit::playback::context::compile): Move the
3859 (gcc::jit::playback::context::dlopen_built_dso): ...this new
3861 * jit-playback.h (gcc::jit::playback::context::dlopen_built_dso):
3864 2014-12-09 David Malcolm <dmalcolm@redhat.com>
3867 * docs/topics/contexts.rst (Debugging): Add description of
3868 gcc_jit_context_enable_dump.
3869 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3870 * jit-playback.c: Include context.h.
3871 (class auto_argvec): New class.
3872 (auto_argvec::~auto_argvec): New function.
3873 (gcc::jit::playback::context::compile): Convert fake_args to be
3874 an auto_argvec, so that it can contain dynamically-allocated
3875 strings. Construct a vec of all requested dumps, and pass it to
3876 make_fake_args. Extract requested dumps between the calls to
3877 toplev::main and toplev::finalize.
3878 (gcc::jit::playback::context::make_fake_args): Convert param
3879 "argvec" to be a vec <char *>, and gain a "requested_dumps"
3880 param. Convert to dynamically-allocated arg strings by converting
3881 ADD_ARG to take a copy of the arg, and add ADD_ARG_TAKE_OWNERSHIP
3882 for args that are already a copy. Add args for all requested dumps.
3883 (gcc::jit::playback::context::extract_any_requested_dumps): New
3885 (gcc::jit::playback::context::read_dump_file): New function.
3886 * jit-playback.h (gcc::jit::playback::context::make_fake_args):
3887 Convert param "argvec" to be a vec <char *>, and gain a
3888 "requested_dumps" param.
3889 (gcc::jit::playback::context::extract_any_requested_dumps): New
3891 (gcc::jit::playback::context::read_dump_file): New function.
3892 * jit-recording.c (gcc::jit::recording::context::enable_dump): New
3894 (gcc::jit::recording::context::get_all_requested_dumps): New
3896 * jit-recording.h (gcc::jit::recording::requested_dump): New
3898 (gcc::jit::recording::context::enable_dump): New function.
3899 (gcc::jit::recording::context::get_all_requested_dumps): New
3901 (gcc::jit::recording::context::m_requested_dumps): New field.
3902 * libgccjit.c (gcc_jit_context_enable_dump): New API entrypoint.
3903 * libgccjit.h (gcc_jit_context_enable_dump): New API entrypoint.
3904 * libgccjit.map (gcc_jit_context_enable_dump): New API entrypoint.
3906 2014-12-08 David Malcolm <dmalcolm@redhat.com>
3908 * libgccjit++.h: Indent the forward declarations of the classes to
3909 show the inheritance hierarchy.
3911 2014-12-08 David Malcolm <dmalcolm@redhat.com>
3913 * notes.txt: Show the beginning and ending of
3914 recording::context::compile vs playback::context::compile. Show
3915 the creation and unlinking of the tempdir. Show toplev::finalize.
3916 Move "RELEASE MUTEX" to the correct location. Show
3917 gcc_jit_result_release, and indicate where the
3918 dlopen/dlsym/dlclose occur.
3920 2014-12-01 David Malcolm <dmalcolm@redhat.com>
3922 * docs/examples/tut02-square.c (main): Release the context
3923 earlier, to show that this is possible. Update error-handling
3924 to avoid a double-release of the context, and to avoid
3925 releasing a NULL result.
3926 * docs/intro/tutorial02.rst: Discuss gcc_jit_context_release.
3927 * docs/topics/functions.rst (GCC_JIT_FUNCTION_EXPORTED): Emphasize
3928 * docs/topics/results.rst (gcc_jit_result): Mention that this
3929 controls the lifetimes of machine code functions.
3930 (gcc_jit_result_get_code): Spell out the requirements for this
3931 to succeed, and the lifetime of the result.
3932 (gcc_jit_result_release): Mention that this invalidates any code
3933 that was obtained from the result.
3934 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3936 2014-12-01 David Malcolm <dmalcolm@redhat.com>
3939 * docs/intro/tutorial02.rst: Spell out lifetime of generated code.
3940 Add description of error-handling, taken in part from...
3941 * docs/topics/contexts.rst (Error-handling): Expand, and move some
3942 content to tutorial02.rst.
3943 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3945 2014-12-01 David Malcolm <dmalcolm@redhat.com>
3948 * docs/topics/types.rst (Standard types) Add new enum values to
3949 the table of enum gcc_jit_types: GCC_JIT_TYPE_COMPLEX_FLOAT,
3950 GCC_JIT_TYPE_COMPLEX_DOUBLE, GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE.
3951 Widen the left-hand column so that
3952 GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE will fit.
3953 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3955 * jit-builtins.c: Include stringpool.h and jit-playback.h.
3956 Move everything out of the gcc::jit::recording namespace into
3958 (struct builtin_data): Add fields "fnclass", "attr", and
3960 (DEF_BUILTIN): Update macro so populate the new fields.
3961 (builtins_manager::builtins_manager): Update for move out of
3962 recording namespace. Initialize the m_attributes array.
3963 (builtins_manager::get_builtin_function): Likewise.
3964 (builtins_manager::get_builtin_function_by_id): New function.
3965 (builtins_manager::make_builtin_function): Update for move out of
3966 recording namespace. Add fix for PR jit/64020 by detecting
3967 specific builtin ids and having them ensure that builtins for
3968 other ids are created as necessary.
3969 (builtins_manager::get_type): Update for move out of recording
3971 (builtins_manager::make_type): Likewise. Add some missing
3973 (builtins_manager::make_primitive_type): Update for move out of
3974 recording namespace. Implement the three BT_COMPLEX_ cases and
3976 (builtins_manager::make_fn_type): Update for move out of recording
3978 (builtins_manager::make_ptr_type): Likewise.
3979 (builtins_manager::finish_playback): New function.
3980 (builtins_manager::get_class): New function.
3981 (builtins_manager::implicit_p): New function.
3982 (builtins_manager::get_attrs_tree): Two new functions.
3983 (builtins_manager::make_attrs_tree): New function.
3985 * jit-builtins.h: Move everything out of the gcc::jit::recording
3986 namespace into just gcc::jit.
3987 (enum built_in_attribute): New.
3988 (builtins_manager::builtins_manager): Update decl for namespace
3990 (builtins_manager::get_builtin_function): Likewise.
3991 (builtins_manager::get_class): New.
3992 (builtins_manager::implicit_p): New.
3993 (builtins_manager::get_attrs_tree): Two new functions.
3994 (builtins_manager::make_attrs_tree): New function.
3995 (builtins_manager::finish_playback): New.
3996 (builtins_manager::get_builtin_function_by_id): New.
3997 (builtins_manager::make_builtin_function): Update decl for
3999 (builtins_manager::get_type): Likewise.
4000 (builtins_manager::make_type): Likewise.
4001 (builtins_manager::make_primitive_type): Likewise.
4002 (builtins_manager::make_fn_type): Likewise.
4003 (builtins_manager::make_ptr_type): Likewise.
4004 (builtins_manager): Likewise for fields. Add new field
4007 * jit-common.h (NUM_GCC_JIT_TYPES): Update.
4008 (builtins_manager): Update forward decl to reflect namespace
4011 * jit-playback.c: Include attribs.h and jit-builtins.h.
4012 (gcc::jit::playback::context::get_tree_node_for_type): Add cases
4013 for the new COMPLEX_ types.
4014 (gcc::jit::playback::context::new_function): If creating a
4015 builtin, set the DECL_BUILT_IN_CLASS and attributes on the fndecl,
4016 and call set_builtin_decl.
4017 (gcc::jit::playback::context::replay): If we have a
4018 builtins_manager, call its finish_playback method when we're done.
4021 (gcc::jit::playback::context::get_builtins_manager): New function.
4024 (gcc::jit::recording::context::get_builtins_manager): New function.
4025 (gcc::jit::recording::get_builtin_function): Use
4026 get_builtins_manager, in case we're a child context.
4027 (gcc::jit::recording::memento_of_get_type::dereference): Add the
4029 (gcc::jit::recording::memento_of_get_type::is_int): Likewise.
4030 (gcc::jit::recording::memento_of_get_type::is_float): Likewise.
4031 (gcc::jit::recording::memento_of_get_type::is_bool): Likewise.
4032 (get_type_strings): Likewise.
4035 (gcc::jit::recording::context::get_builtins_manager): New.
4037 * libgccjit.h (enum gcc_jit_types): Add
4038 GCC_JIT_TYPE_COMPLEX_FLOAT, GCC_JIT_TYPE_COMPLEX_DOUBLE,
4039 GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE.
4041 2014-12-01 David Malcolm <dmalcolm@redhat.com>
4044 (gcc::jit::recording::builtins_manager::get_builtin_function):
4045 Check for NULL return from make_builtin_function.
4046 (gcc::jit::recording::builtins_manager::make_builtin_function):
4047 Check for NULL return from get_type.
4049 2014-12-01 David Malcolm <dmalcolm@redhat.com>
4051 * jit-playback.c (gcc::jit::playback::context::compile): Move DSO
4052 creation code into...
4053 (gcc::jit::playback::context::convert_to_dso): New function.
4054 * jit-playback.h (gcc::jit::playback::context::convert_to_dso):
4057 2014-12-01 David Malcolm <dmalcolm@redhat.com>
4059 * jit-playback.c (gcc::jit::playback::context::compile): Use an
4060 auto_vec<const char *> rather than a const char *[20] for the
4061 top-level argv, and move the logic to build it to...
4062 (gcc::jit::playback::context::make_fake_args): New function.
4063 * jit-playback.h (gcc::jit::playback::context::make_fake_args):
4066 2014-12-01 David Malcolm <dmalcolm@redhat.com>
4068 * Make-lang.in (jit_OBJS): Add jit/jit-result.o.
4069 * jit-playback.c: Include new header jit-result.h.
4070 (gcc::jit::result::result): Move to new file jit-result.c.
4071 (gcc::jit::result::~result): Likewise.
4072 (gcc::jit::playback::result): Likewise.
4073 * jit-recording.h (class gcc::jit::result): Move to new
4074 header jit-result.h.
4075 * jit-result.c: New file, to contain...
4076 (gcc::jit::result::result): Move here from jit-playback.c,
4077 removing erroneous "playback" namespace from comment.
4078 (gcc::jit::result::~result): Likewise.
4079 (gcc::jit::playback::result): Likewise.
4080 * jit-result.h: New file, to contain...
4081 (class gcc::jit::result): Move from jit-recording.h.
4082 * libgccjit.c: Include jit-result.h.
4083 (gcc_jit_result_get_code): Update comment to reflect move
4085 (gcc_jit_result_release): Likewise.
4087 2014-12-01 David Malcolm <dmalcolm@redhat.com>
4090 * docs/examples/tut04-toyvm/toyvm.c
4091 (toyvm_compiled_function): New typedef.
4092 (toyvm_compiled_func) Rename to...
4093 (toyvm_compiled_code) ...this.
4094 (struct toyvm_compiled_function): New struct.
4095 (toyvm_function_compile): Return a toyvm_compiled_function *
4096 rather than a toyvm_compiled_func, so that the caller can fully
4097 clean things up. Free "funcname".
4098 (test_script): Update for change to toyvm_function_compile.
4099 Clean up the toyvm_compiled_function.
4101 (docs/intro/tutorial04.rst): Update to reflect the above changes,
4102 and to better spell out the lifetime of the compiled code.
4104 2014-12-01 David Malcolm <dmalcolm@redhat.com>
4108 (gcc::jit::recording::builtins_manager::make_fn_type): Call the
4109 context's new_function_type method, rather than directly creating
4110 a function_type instance.
4112 (gcc::jit::recording::context::new_function_type): New method,
4113 adapted from part of...
4114 (gcc::jit::recording::context::new_function_ptr_type): ...this.
4115 Update to call new_function_type.
4117 (gcc::jit::recording::context::new_function_type): New method.
4119 2014-12-01 David Malcolm <dmalcolm@redhat.com>
4122 * jit-playback.c: Ensure that ctxt_progname is non-NULL.
4124 2014-11-19 David Malcolm <dmalcolm@redhat.com>
4127 * jit-playback.c (gcc::jit::playback::compound_type::set_fields):
4128 Convert param from const vec<playback::field *> & to
4129 const auto_vec<playback::field *> *.
4130 (gcc::jit::playback::context::new_function_type): Convert param
4131 "param_types" from vec<type *> * to const auto_vec<type *> *.
4132 (gcc::jit::playback::context::new_function): Convert param
4133 "params" from vec<param *> * to const auto_vec<param *> *.
4134 (gcc::jit::playback::context::build_call): Convert param "args"
4135 from vec<rvalue *> to const auto_vec<rvalue *> *.
4136 (gcc::jit::playback::context::new_call): Likewise.
4137 (gcc::jit::playback::context::new_call_through_ptr): Likewise.
4138 (wrapper_finalizer): New function.
4139 (gcc::jit::playback::wrapper::operator new): Call the finalizer
4140 variant of ggc_internal_cleared_alloc, supplying
4142 (gcc::jit::playback::function::finalizer): New.
4143 (gcc::jit::playback::block::finalizer): New.
4144 (gcc::jit::playback::source_file::finalizer): New.
4145 (gcc::jit::playback::source_line::finalizer): New.
4148 (gcc::jit::playback::context::new_function_type): Convert param
4149 "param_types" from vec<type *> * to const auto_vec<type *> *.
4150 (gcc::jit::playback::context::new_function): Convert param
4151 "params" from vec<param *> * to const auto_vec<param *> *.
4152 (gcc::jit::playback::context::new_call): Convert param
4153 "args" from vec<rvalue *> to const auto_vec<rvalue *> *.
4154 (gcc::jit::playback::context::new_call_through_ptr): Likewise.
4155 (gcc::jit::playback::context::build_call): Likewise.
4156 (gcc::jit::playback::context): Convert fields "m_functions",
4157 "m_source_files", "m_cached_locations" from vec to auto_vec.
4158 (gcc::jit::playback::wrapper::finalizer): New virtual function.
4159 (gcc::jit::playback::compound_type::set_fields): Convert param fro
4160 const vec<playback::field *> & to
4161 const auto_vec<playback::field *> *.
4162 (gcc::jit::playback::function::finalizer): New.
4163 (gcc::jit::playback::block::finalizer): New.
4164 (gcc::jit::playback::source_file::finalizer): New.
4165 (gcc::jit::playback::source_line::finalizer): New.
4168 (gcc::jit::recording::function_type::replay_into): Convert local
4169 from a vec into an auto_vec.
4170 (gcc::jit::recording::fields::replay_into): Likewise.
4171 (gcc::jit::recording::function::replay_into): Likewise.
4172 (gcc::jit::recording::call::replay_into): Likewise.
4173 (gcc::jit::recording::call_through_ptr::replay_into): Likewise.
4175 * jit-recording.h (gcc::jit::recording::context): Convert fields
4176 "m_mementos", "m_compound_types", "m_functions" from vec<> to
4178 (gcc::jit::recording::function_type::get_param_types): Convert
4179 return type from vec<type *> to const vec<type *> &.
4180 (gcc::jit::recording::function_type): Convert field
4181 "m_param_types" from a vec<> to an auto_vec<>.
4182 (gcc::jit::recording::fields): Likewise for field "m_fields".
4183 (gcc::jit::recording::function::get_params): Convert return type
4184 from vec <param *> to const vec<param *> &.
4185 (gcc::jit::recording::function): Convert fields "m_params",
4186 "m_locals", "m_blocks" from vec<> to auto_vec<>.
4187 (gcc::jit::recording::block): Likewise for field "m_statements".
4188 vec<> to auto_vec<>.
4189 (gcc::jit::recording::call): Likewise for field "m_args".
4190 (gcc::jit::recording::call_through_ptr): Likewise.
4192 2014-11-19 David Malcolm <dmalcolm@redhat.com>
4195 * jit-recording.c (recording::function::validate): Convert
4196 "worklist" from vec<> to autovec<> to fix a leak.
4198 2014-11-11 David Malcolm <dmalcolm@redhat.com>
4200 * ChangeLog.jit: New.
4202 * Make-lang.in: New.
4204 * config-lang.in: New.
4205 * docs/Makefile: New.
4206 * docs/_build/texinfo/Makefile: New.
4207 * docs/_build/texinfo/factorial.png: New.
4208 * docs/_build/texinfo/libgccjit.texi: New.
4209 * docs/_build/texinfo/sum-of-squares.png: New.
4210 * docs/conf.py: New.
4211 * docs/examples/tut01-hello-world.c: New.
4212 * docs/examples/tut02-square.c: New.
4213 * docs/examples/tut03-sum-of-squares.c: New.
4214 * docs/examples/tut04-toyvm/Makefile: New.
4215 * docs/examples/tut04-toyvm/factorial.toy: New.
4216 * docs/examples/tut04-toyvm/fibonacci.toy: New.
4217 * docs/examples/tut04-toyvm/toyvm.c: New.
4218 * docs/index.rst: New.
4219 * docs/internals/index.rst: New.
4220 * docs/intro/factorial.png: New.
4221 * docs/intro/index.rst: New.
4222 * docs/intro/sum-of-squares.png: New.
4223 * docs/intro/tutorial01.rst: New.
4224 * docs/intro/tutorial02.rst: New.
4225 * docs/intro/tutorial03.rst: New.
4226 * docs/intro/tutorial04.rst: New.
4227 * docs/topics/contexts.rst: New.
4228 * docs/topics/expressions.rst: New.
4229 * docs/topics/functions.rst: New.
4230 * docs/topics/index.rst: New.
4231 * docs/topics/locations.rst: New.
4232 * docs/topics/objects.rst: New.
4233 * docs/topics/results.rst: New.
4234 * docs/topics/types.rst: New.
4235 * dummy-frontend.c: New.
4236 * jit-builtins.c: New.
4237 * jit-builtins.h: New.
4238 * jit-common.h: New.
4239 * jit-playback.c: New.
4240 * jit-playback.h: New.
4241 * jit-recording.c: New.
4242 * jit-recording.h: New.
4243 * libgccjit++.h: New.
4246 * libgccjit.map: New.
4249 2013-07-26 David Malcolm <dmalcolm@redhat.com>
4253 Copyright (C) 2013-2024 Free Software Foundation, Inc.
4255 Copying and distribution of this file, with or without modification,
4256 are permitted in any medium without royalty provided the copyright
4257 notice and this notice are preserved.