1 2024-01-12 Guillaume Gomez <guillaume1.gomez@gmail.com>
2 Antoni Boucher <bouanto@zoho.com>
4 * docs/topics/compatibility.rst: Add documentation for LIBGCCJIT_ABI_26.
5 * docs/topics/functions.rst: Add documentation for new functions.
6 * docs/topics/expressions.rst: Add documentation for new functions.
8 2024-01-12 Guillaume Gomez <guillaume1.gomez@gmail.com>
9 Antoni Boucher <bouanto@zoho.com>
11 * dummy-frontend.cc (handle_alias_attribute): New function.
12 (handle_always_inline_attribute): New function.
13 (handle_cold_attribute): New function.
14 (handle_fnspec_attribute): New function.
15 (handle_format_arg_attribute): New function.
16 (handle_format_attribute): New function.
17 (handle_noinline_attribute): New function.
18 (handle_target_attribute): New function.
19 (handle_used_attribute): New function.
20 (handle_visibility_attribute): New function.
21 (handle_weak_attribute): New function.
22 (handle_alias_ifunc_attribute): New function.
23 * jit-playback.cc (fn_attribute_to_string): New function.
24 (variable_attribute_to_string): New function.
25 (global_new_decl): Add attributes support.
26 (set_variable_attribute): New function.
27 (new_global): Add attributes support.
28 (new_global_initialized): Add attributes support.
29 (new_local): Add attributes support.
30 * jit-playback.h (fn_attribute_to_string): New function.
31 (set_variable_attribute): New function.
32 * jit-recording.cc (recording::lvalue::add_attribute): New function.
33 (recording::function::function): New function.
34 (recording::function::write_to_dump): Add attributes support.
35 (recording::function::add_attribute): New function.
36 (recording::function::add_string_attribute): New function.
37 (recording::function::add_integer_array_attribute): New function.
38 (recording::global::replay_into): Add attributes support.
39 (recording::local::replay_into): Add attributes support.
40 * jit-recording.h: Add attributes support.
41 * libgccjit.cc (gcc_jit_function_add_attribute): New function.
42 (gcc_jit_function_add_string_attribute): New function.
43 (gcc_jit_function_add_integer_array_attribute): New function.
44 (gcc_jit_lvalue_add_attribute): New function.
45 * libgccjit.h (enum gcc_jit_fn_attribute): New enum.
46 (gcc_jit_function_add_attribute): New function.
47 (gcc_jit_function_add_string_attribute): New function.
48 (gcc_jit_function_add_integer_array_attribute): New function.
49 (enum gcc_jit_variable_attribute): New function.
50 (gcc_jit_lvalue_add_string_attribute): New function.
51 * libgccjit.map: Declare new functions.
53 2023-12-06 David Malcolm <dmalcolm@redhat.com>
55 * dummy-frontend.cc (jit_begin_diagnostic): Make diagnostic_info
57 (jit_end_diagnostic): Likewise. Pass to add_diagnostic by
59 * jit-playback.cc (jit::playback::context::add_diagnostic):
60 Convert diagnostic_info to const reference.
61 * jit-playback.h (jit::playback::context::add_diagnostic):
64 2023-12-05 Richard Sandiford <richard.sandiford@arm.com>
66 * dummy-frontend.cc (jit_gnu_attribute_table): Add extra braces
67 to work around PR 16333 in older compilers.
68 (jit_format_attribute_table): Likewise.
70 2023-12-02 Richard Sandiford <richard.sandiford@arm.com>
72 * dummy-frontend.cc (jit_format_attribute_table): Change type to
73 scoped_attribute_specs, using...
74 (jit_format_attributes): ...this as the underlying array.
75 (jit_attribute_table): Change to an array of scoped_attribute_specs
77 (jit_gnu_attributes, jit_gnu_attribute_table): ...these new globals
78 for the original array. Include the format attributes.
79 (LANG_HOOKS_COMMON_ATTRIBUTE_TABLE): Delete.
80 (LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE): Delete.
81 (LANG_HOOKS_ATTRIBUTE_TABLE): Define.
83 2023-11-09 Guillaume Gomez <guillaume1.gomez@gmail.com>
87 2023-11-04 David Malcolm <dmalcolm@redhat.com>
89 * jit-playback.cc: Update for changes to diagnostic_context.
90 * jit-playback.h: Likewise.
92 2023-10-25 Vibhav Pant <vibhavp@gmail.com>
94 * jit-recording.cc (recording::global::write_to_dump): Fix
95 dump of string literal initializers.
97 2023-10-22 Iain Sandoe <iain@sandoe.co.uk>
99 * Make-lang.in: Handle Darwin rpaths.
101 2023-10-02 David Malcolm <dmalcolm@redhat.com>
103 * dummy-frontend.cc (jit_langhook_init): Update for change to
104 diagnostic_context callbacks.
106 2023-08-31 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
108 * jit-playback.cc: Change spelling to macOS.
110 2023-08-29 Guillaume Gomez <guillaume1.gomez@gmail.com>
112 * docs/topics/compatibility.rst: Add documentation for LIBGCCJIT_ABI_25.
113 * docs/topics/types.rst: Add documentation for gcc_jit_type_get_restrict.
115 2023-08-29 Guillaume Gomez <guillaume1.gomez@gmail.com>
117 * jit-playback.cc: Remove trailing whitespace characters.
118 * jit-playback.h: Add get_restrict method.
119 * jit-recording.cc: Add get_restrict methods.
120 * jit-recording.h: Add get_restrict methods.
121 * libgccjit++.h: Add get_restrict methods.
122 * libgccjit.cc: Add gcc_jit_type_get_restrict.
123 * libgccjit.h: Declare gcc_jit_type_get_restrict.
124 * libgccjit.map: Declare gcc_jit_type_get_restrict.
126 2023-02-16 Patrick Palka <ppalka@redhat.com>
128 * jit-dejagnu.h: Mechanically drop static from static inline
129 functions via s/^static inline/inline/g.
130 * jit-recording.h: Likewise.
132 2023-01-07 LIU Hao <lh_mouse@126.com>
135 * jit-w32.h: Define `WIN32_LEAN_AND_MEAN` before <windows.h>.
137 2022-12-21 Martin Liska <mliska@suse.cz>
139 * jit-playback.h: Use unused attribute.
141 2022-12-14 Antoni Boucher <bouanto@zoho.com>
142 Guillaume Gomez <guillaume1.gomez@gmail.com>
145 * jit-recording.h: Add vector_type::is_same_type_as method
147 2022-12-07 Antoni Boucher <bouanto@zoho.com>
148 Guillaume Gomez <guillaume1.gomez@gmail.com>
151 * jit-playback.cc: Fix vector float comparison
152 * jit-playback.h: Update comparison function signature
153 * jit-recording.cc: Update call for "new_comparison" function
154 * jit-recording.h: Fix vector float comparison
156 2022-11-20 Jeff Law <jlaw@ventanamicro.com>
159 * jit-playback.cc (playback::lvale::mark_addressable): Remove
162 2022-11-19 Jonathan Wakely <jwakely@redhat.com>
163 LIU Hao <lh_mouse@126.com>
165 * jit-playback.cc (playback::context::scoped_lock): Define RAII
167 (playback::context::compile): Use scoped_lock to acquire mutex
168 for the active playback context.
169 (jit_mutex): Change to std::mutex.
170 (playback::context::acquire_mutex): Rename to ...
171 (playback::context::lock): ... this.
172 (playback::context::release_mutex): Rename to ...
173 (playback::context::unlock): ... this.
174 * jit-playback.h (playback::context): Rename members and declare
176 * jit-recording.cc (INCLUDE_PTHREAD_H): Remove unused define.
177 * libgccjit.cc (version_mutex): Change to std::mutex.
178 (struct jit_version_info): Use std::lock_guard to acquire and
181 2022-11-14 Martin Liska <mliska@suse.cz>
184 2022-11-09 Martin Liska <mliska@suse.cz>
187 * docs/cp/index.rst: Moved to...
188 * doc/cp/index.rst: ...here.
189 * docs/cp/intro/index.rst: Moved to...
190 * doc/cp/intro/index.rst: ...here.
191 * docs/cp/intro/tutorial01.rst: Moved to...
192 * doc/cp/intro/tutorial01.rst: ...here.
193 * docs/cp/intro/tutorial02.rst: Moved to...
194 * doc/cp/intro/tutorial02.rst: ...here.
195 * docs/cp/intro/tutorial03.rst: Moved to...
196 * doc/cp/intro/tutorial03.rst: ...here.
197 * docs/cp/intro/tutorial04.rst: Moved to...
198 * doc/cp/intro/tutorial04.rst: ...here.
199 * docs/cp/topics/asm.rst: Moved to...
200 * doc/cp/topics/asm.rst: ...here.
201 * docs/cp/topics/compilation.rst: Moved to...
202 * doc/cp/topics/compilation.rst: ...here.
203 * docs/cp/topics/contexts.rst: Moved to...
204 * doc/cp/topics/contexts.rst: ...here.
205 * docs/cp/topics/expressions.rst: Moved to...
206 * doc/cp/topics/expressions.rst: ...here.
207 * docs/cp/topics/functions.rst: Moved to...
208 * doc/cp/topics/functions.rst: ...here.
209 * docs/cp/topics/index.rst: Moved to...
210 * doc/cp/topics/index.rst: ...here.
211 * docs/cp/topics/locations.rst: Moved to...
212 * doc/cp/topics/locations.rst: ...here.
213 * docs/cp/topics/objects.rst: Moved to...
214 * doc/cp/topics/objects.rst: ...here.
215 * docs/cp/topics/types.rst: Moved to...
216 * doc/cp/topics/types.rst: ...here.
217 * docs/examples/emit-alphabet.bf: Moved to...
218 * doc/examples/emit-alphabet.bf: ...here.
219 * docs/examples/tut01-hello-world.c: Moved to...
220 * doc/examples/tut01-hello-world.c: ...here.
221 * docs/examples/tut01-hello-world.cc: Moved to...
222 * doc/examples/tut01-hello-world.cc: ...here.
223 * docs/examples/tut02-square.c: Moved to...
224 * doc/examples/tut02-square.c: ...here.
225 * docs/examples/tut02-square.cc: Moved to...
226 * doc/examples/tut02-square.cc: ...here.
227 * docs/examples/tut03-sum-of-squares.c: Moved to...
228 * doc/examples/tut03-sum-of-squares.c: ...here.
229 * docs/examples/tut03-sum-of-squares.cc: Moved to...
230 * doc/examples/tut03-sum-of-squares.cc: ...here.
231 * docs/examples/tut04-toyvm/Makefile: Moved to...
232 * doc/examples/tut04-toyvm/Makefile: ...here.
233 * docs/examples/tut04-toyvm/factorial.toy: Moved to...
234 * doc/examples/tut04-toyvm/factorial.toy: ...here.
235 * docs/examples/tut04-toyvm/fibonacci.toy: Moved to...
236 * doc/examples/tut04-toyvm/fibonacci.toy: ...here.
237 * docs/examples/tut04-toyvm/toyvm.c: Moved to...
238 * doc/examples/tut04-toyvm/toyvm.c: ...here.
239 * docs/examples/tut04-toyvm/toyvm.cc: Moved to...
240 * doc/examples/tut04-toyvm/toyvm.cc: ...here.
241 * docs/examples/tut05-bf.c: Moved to...
242 * doc/examples/tut05-bf.c: ...here.
243 * docs/index.rst: Moved to...
244 * doc/index.rst: ...here.
245 * docs/internals/index.rst: Moved to...
246 * doc/internals/index.rst: ...here.
247 * docs/internals/test-hello-world.exe.log.txt: Moved to...
248 * doc/internals/test-hello-world.exe.log.txt: ...here.
249 * docs/_build/texinfo/libgccjit-figures/factorial.png: Moved to...
250 * doc/intro/factorial.png: ...here.
251 * docs/intro/index.rst: Moved to...
252 * doc/intro/index.rst: ...here.
253 * docs/_build/texinfo/libgccjit-figures/sum-of-squares.png: Moved to...
254 * doc/intro/sum-of-squares.png: ...here.
255 * docs/intro/tutorial01.rst: Moved to...
256 * doc/intro/tutorial01.rst: ...here.
257 * docs/intro/tutorial02.rst: Moved to...
258 * doc/intro/tutorial02.rst: ...here.
259 * docs/intro/tutorial03.rst: Moved to...
260 * doc/intro/tutorial03.rst: ...here.
261 * docs/intro/tutorial04.rst: Moved to...
262 * doc/intro/tutorial04.rst: ...here.
263 * docs/intro/tutorial05.rst: Moved to...
264 * doc/intro/tutorial05.rst: ...here.
265 * docs/topics/asm.rst: Moved to...
266 * doc/topics/asm.rst: ...here.
267 * docs/topics/compatibility.rst: Moved to...
268 * doc/topics/compatibility.rst: ...here.
269 * docs/topics/compilation.rst: Moved to...
270 * doc/topics/compilation.rst: ...here.
271 * docs/topics/contexts.rst: Moved to...
272 * doc/topics/contexts.rst: ...here.
273 * docs/topics/expressions.rst: Moved to...
274 * doc/topics/expressions.rst: ...here.
275 * docs/topics/function-pointers.rst: Moved to...
276 * doc/topics/function-pointers.rst: ...here.
277 * docs/topics/functions.rst: Moved to...
278 * doc/topics/functions.rst: ...here.
279 * docs/topics/index.rst: Moved to...
280 * doc/topics/index.rst: ...here.
281 * docs/topics/locations.rst: Moved to...
282 * doc/topics/locations.rst: ...here.
283 * docs/topics/objects.rst: Moved to...
284 * doc/topics/objects.rst: ...here.
285 * docs/topics/performance.rst: Moved to...
286 * doc/topics/performance.rst: ...here.
287 * docs/topics/types.rst: Moved to...
288 * doc/topics/types.rst: ...here.
289 * docs/Makefile: Removed.
290 * docs/_build/texinfo/Makefile: Removed.
291 * docs/_build/texinfo/libgccjit-figures/factorial1.png: Removed.
292 * docs/_build/texinfo/libgccjit-figures/sum-of-squares1.png: Removed.
293 * docs/_build/texinfo/libgccjit.texi: Removed.
294 * docs/conf.py: Removed.
295 * docs/intro/factorial.png: Removed.
296 * docs/intro/sum-of-squares.png: Removed.
297 * doc/conf.py: New file.
299 2022-11-14 Martin Liska <mliska@suse.cz>
302 2022-11-14 Martin Liska <mliska@suse.cz>
304 * Make-lang.in: Support --with-sphinx-build.
306 2022-11-14 Martin Liska <mliska@suse.cz>
309 2022-11-14 Martin Liska <mliska@suse.cz>
311 * doc/internals/index.rst: Fix cross manual refs.
312 * doc/topics/contexts.rst: Likewise.
314 2022-11-14 Martin Liska <mliska@suse.cz>
317 2022-11-14 Martin Liska <mliska@suse.cz>
320 Support installation if sphinx-build is missing.
322 2022-11-14 Martin Liska <mliska@suse.cz>
325 2022-11-14 Martin Liska <mliska@suse.cz>
327 * doc/cp/index.rst: Remove trailing .rst in toctree.
328 * doc/cp/intro/index.rst: Likewise.
329 * doc/cp/topics/index.rst: Likewise.
330 * doc/index.rst: Likewise.
331 * doc/intro/index.rst: Likewise.
332 * doc/topics/index.rst: Likewise.
333 * doc/indices-and-tables.rst: New file.
335 2022-11-11 Martin Liska <mliska@suse.cz>
337 * doc/cp/index.rst: Remove trailing .rst in toctree.
338 * doc/cp/intro/index.rst: Likewise.
339 * doc/cp/topics/index.rst: Likewise.
340 * doc/index.rst: Likewise.
341 * doc/intro/index.rst: Likewise.
342 * doc/topics/index.rst: Likewise.
343 * doc/indices-and-tables.rst: New file.
345 2022-11-09 Martin Liska <mliska@suse.cz>
348 Support installation if sphinx-build is missing.
350 2022-11-09 Martin Liska <mliska@suse.cz>
352 * doc/internals/index.rst: Fix cross manual refs.
353 * doc/topics/contexts.rst: Likewise.
355 2022-11-09 Martin Liska <mliska@suse.cz>
357 * Make-lang.in: Support --with-sphinx-build.
359 2022-11-09 Martin Liska <mliska@suse.cz>
362 * docs/cp/index.rst: Moved to...
363 * doc/cp/index.rst: ...here.
364 * docs/cp/intro/index.rst: Moved to...
365 * doc/cp/intro/index.rst: ...here.
366 * docs/cp/intro/tutorial01.rst: Moved to...
367 * doc/cp/intro/tutorial01.rst: ...here.
368 * docs/cp/intro/tutorial02.rst: Moved to...
369 * doc/cp/intro/tutorial02.rst: ...here.
370 * docs/cp/intro/tutorial03.rst: Moved to...
371 * doc/cp/intro/tutorial03.rst: ...here.
372 * docs/cp/intro/tutorial04.rst: Moved to...
373 * doc/cp/intro/tutorial04.rst: ...here.
374 * docs/cp/topics/asm.rst: Moved to...
375 * doc/cp/topics/asm.rst: ...here.
376 * docs/cp/topics/compilation.rst: Moved to...
377 * doc/cp/topics/compilation.rst: ...here.
378 * docs/cp/topics/contexts.rst: Moved to...
379 * doc/cp/topics/contexts.rst: ...here.
380 * docs/cp/topics/expressions.rst: Moved to...
381 * doc/cp/topics/expressions.rst: ...here.
382 * docs/cp/topics/functions.rst: Moved to...
383 * doc/cp/topics/functions.rst: ...here.
384 * docs/cp/topics/index.rst: Moved to...
385 * doc/cp/topics/index.rst: ...here.
386 * docs/cp/topics/locations.rst: Moved to...
387 * doc/cp/topics/locations.rst: ...here.
388 * docs/cp/topics/objects.rst: Moved to...
389 * doc/cp/topics/objects.rst: ...here.
390 * docs/cp/topics/types.rst: Moved to...
391 * doc/cp/topics/types.rst: ...here.
392 * docs/examples/emit-alphabet.bf: Moved to...
393 * doc/examples/emit-alphabet.bf: ...here.
394 * docs/examples/tut01-hello-world.c: Moved to...
395 * doc/examples/tut01-hello-world.c: ...here.
396 * docs/examples/tut01-hello-world.cc: Moved to...
397 * doc/examples/tut01-hello-world.cc: ...here.
398 * docs/examples/tut02-square.c: Moved to...
399 * doc/examples/tut02-square.c: ...here.
400 * docs/examples/tut02-square.cc: Moved to...
401 * doc/examples/tut02-square.cc: ...here.
402 * docs/examples/tut03-sum-of-squares.c: Moved to...
403 * doc/examples/tut03-sum-of-squares.c: ...here.
404 * docs/examples/tut03-sum-of-squares.cc: Moved to...
405 * doc/examples/tut03-sum-of-squares.cc: ...here.
406 * docs/examples/tut04-toyvm/Makefile: Moved to...
407 * doc/examples/tut04-toyvm/Makefile: ...here.
408 * docs/examples/tut04-toyvm/factorial.toy: Moved to...
409 * doc/examples/tut04-toyvm/factorial.toy: ...here.
410 * docs/examples/tut04-toyvm/fibonacci.toy: Moved to...
411 * doc/examples/tut04-toyvm/fibonacci.toy: ...here.
412 * docs/examples/tut04-toyvm/toyvm.c: Moved to...
413 * doc/examples/tut04-toyvm/toyvm.c: ...here.
414 * docs/examples/tut04-toyvm/toyvm.cc: Moved to...
415 * doc/examples/tut04-toyvm/toyvm.cc: ...here.
416 * docs/examples/tut05-bf.c: Moved to...
417 * doc/examples/tut05-bf.c: ...here.
418 * docs/index.rst: Moved to...
419 * doc/index.rst: ...here.
420 * docs/internals/index.rst: Moved to...
421 * doc/internals/index.rst: ...here.
422 * docs/internals/test-hello-world.exe.log.txt: Moved to...
423 * doc/internals/test-hello-world.exe.log.txt: ...here.
424 * docs/_build/texinfo/libgccjit-figures/factorial.png: Moved to...
425 * doc/intro/factorial.png: ...here.
426 * docs/intro/index.rst: Moved to...
427 * doc/intro/index.rst: ...here.
428 * docs/_build/texinfo/libgccjit-figures/sum-of-squares.png: Moved to...
429 * doc/intro/sum-of-squares.png: ...here.
430 * docs/intro/tutorial01.rst: Moved to...
431 * doc/intro/tutorial01.rst: ...here.
432 * docs/intro/tutorial02.rst: Moved to...
433 * doc/intro/tutorial02.rst: ...here.
434 * docs/intro/tutorial03.rst: Moved to...
435 * doc/intro/tutorial03.rst: ...here.
436 * docs/intro/tutorial04.rst: Moved to...
437 * doc/intro/tutorial04.rst: ...here.
438 * docs/intro/tutorial05.rst: Moved to...
439 * doc/intro/tutorial05.rst: ...here.
440 * docs/topics/asm.rst: Moved to...
441 * doc/topics/asm.rst: ...here.
442 * docs/topics/compatibility.rst: Moved to...
443 * doc/topics/compatibility.rst: ...here.
444 * docs/topics/compilation.rst: Moved to...
445 * doc/topics/compilation.rst: ...here.
446 * docs/topics/contexts.rst: Moved to...
447 * doc/topics/contexts.rst: ...here.
448 * docs/topics/expressions.rst: Moved to...
449 * doc/topics/expressions.rst: ...here.
450 * docs/topics/function-pointers.rst: Moved to...
451 * doc/topics/function-pointers.rst: ...here.
452 * docs/topics/functions.rst: Moved to...
453 * doc/topics/functions.rst: ...here.
454 * docs/topics/index.rst: Moved to...
455 * doc/topics/index.rst: ...here.
456 * docs/topics/locations.rst: Moved to...
457 * doc/topics/locations.rst: ...here.
458 * docs/topics/objects.rst: Moved to...
459 * doc/topics/objects.rst: ...here.
460 * docs/topics/performance.rst: Moved to...
461 * doc/topics/performance.rst: ...here.
462 * docs/topics/types.rst: Moved to...
463 * doc/topics/types.rst: ...here.
464 * docs/Makefile: Removed.
465 * docs/_build/texinfo/Makefile: Removed.
466 * docs/_build/texinfo/libgccjit-figures/factorial1.png: Removed.
467 * docs/_build/texinfo/libgccjit-figures/sum-of-squares1.png: Removed.
468 * docs/_build/texinfo/libgccjit.texi: Removed.
469 * docs/conf.py: Removed.
470 * docs/intro/factorial.png: Removed.
471 * docs/intro/sum-of-squares.png: Removed.
472 * doc/conf.py: New file.
474 2022-09-15 Richard Biener <rguenther@suse.de>
476 * dummy-frontend.cc (jit_langhook_init): Do not initialize
479 2022-08-09 Vibhav Pant <vibhavp@gmail.com>
481 * libgccjit.h (LIBGCCJIT_HAVE_gcc_jit_context_new_bitcast): Move
482 definition out of comment.
484 2022-07-28 David Malcolm <dmalcolm@redhat.com>
486 * docs/internals/index.rst: Remove reference to ".c" extensions
489 2022-07-28 Martin Liška <mliska@suse.cz>
491 * docs/cp/intro/tutorial02.rst:
492 Shorten the assembly example so that there is not slider.
493 * docs/cp/intro/tutorial04.rst: Likewise.
494 * docs/intro/tutorial02.rst: Likewise.
495 * docs/intro/tutorial04.rst: Likewise.
496 * docs/topics/contexts.rst: Likewise.
498 2022-07-28 marxin <mliska@suse.cz>
500 * docs/index.rst: Remove reference to module index
501 as we don't emit any.
503 2022-07-28 marxin <mliska@suse.cz>
505 * docs/cp/intro/tutorial02.rst: Use :expr:`type *` for pointers to a type
506 * docs/cp/topics/asm.rst: Likewise.
507 * docs/cp/topics/contexts.rst: Likewise.
508 * docs/cp/topics/expressions.rst: Likewise.
509 * docs/cp/topics/functions.rst: Likewise.
510 * docs/cp/topics/objects.rst: Likewise.
511 * docs/intro/tutorial02.rst: Likewise.
512 * docs/intro/tutorial03.rst: Likewise.
513 * docs/intro/tutorial04.rst: Likewise.
514 * docs/intro/tutorial05.rst: Likewise.
515 * docs/topics/compilation.rst: Likewise.
516 * docs/topics/contexts.rst: Likewise.
517 * docs/topics/objects.rst: Likewise.
519 2022-07-28 marxin <mliska@suse.cz>
521 * docs/cp/intro/tutorial04.rst: Use list-table.
522 * docs/intro/tutorial04.rst: Likewise.
523 * docs/intro/tutorial05.rst: Likewise.
524 * docs/topics/compilation.rst: Likewise.
525 * docs/topics/expressions.rst: Likewise.
526 * docs/topics/types.rst: Likewise.
528 2022-07-28 marxin <mliska@suse.cz>
530 * docs/cp/topics/expressions.rst: Compact so that the generated
531 output is also more compact.
533 2022-07-28 marxin <mliska@suse.cz>
535 * docs/cp/intro/tutorial02.rst: Use proper reference.
536 * docs/cp/topics/contexts.rst: Likewise.
537 * docs/cp/topics/functions.rst: Put `class` directive before a
538 function as it is not allowed declaring a class in a fn.
539 * docs/cp/topics/types.rst: Add template keyword.
540 * docs/examples/tut04-toyvm/toyvm.c (toyvm_function_compile):
541 Add removed comment used for code snippet ending detection.
542 * docs/intro/tutorial04.rst: Fix to match the real comment.
544 2022-07-28 marxin <mliska@suse.cz>
546 * docs/cp/topics/expressions.rst: Use :expr: for basic types.
547 * docs/topics/compilation.rst: Likewise.
548 * docs/topics/expressions.rst: Likewise.
549 * docs/topics/function-pointers.rst: Likewise.
551 2022-07-28 marxin <mliska@suse.cz>
553 * docs/conf.py: Add needs_sphinx = '3.0' where c:type was added.
554 * docs/index.rst: Remove note about it.
555 * docs/topics/compilation.rst: Use enum directive and reference.
556 * docs/topics/contexts.rst: Likewise.
557 * docs/topics/expressions.rst: Likewise.
558 * docs/topics/functions.rst: Likewise.
560 2022-07-14 Jonathan Wakely <jwakely@redhat.com>
562 * jit-recording.h (recording::memento): Define copy constructor
563 and copy assignment operator as deleted.
564 (recording::string): Likewise.
565 (recording::string::c_str): Add const qualifier.
567 2022-06-29 Antoni Boucher <bouanto@zoho.com>
570 * jit-playback.cc: Use the correct return type when folding in
573 2022-06-29 Sergei Trofimovich <siarheit@google.com>
576 * jit-playback.cc: Include <pthread.h> via "system.h" to avoid calloc()
578 * jit-recording.cc: Ditto.
579 * libgccjit.cc: Ditto.
581 2022-06-10 Antoni Boucher <bouanto@zoho.com>
584 * libgccjit.cc: Add support for floating-point types in
585 gcc_jit_type_get_size.
587 2022-06-08 Yang Yujie <yangyujie@loongson.cn>
589 * Make-lang.in: only link objects from $(EXTRA_GCC_OBJS)
590 that's not in $(EXTRA_OBJS) into libgccjit.
592 2022-05-23 David Malcolm <dmalcolm@redhat.com>
594 * jit-recording.h: Add "final" and "override" to all vfunc
595 implementations that were missing them, as appropriate.
597 2022-05-20 David Malcolm <dmalcolm@redhat.com>
599 * jit-playback.h: Replace uses of "FINAL" and "OVERRIDE" with
600 "final" and "override".
601 * jit-recording.cc: Likewise.
602 * jit-recording.h: Likewise.
604 2022-05-16 Martin Liska <mliska@suse.cz>
606 * jit-builtins.cc (find_builtin_by_name): Use ARRAY_SIZE.
607 (get_string_for_type_id): Likewise.
608 * jit-recording.cc (recording::context::context): Likewise.
610 2022-04-14 Iain Sandoe <iain@sandoe.co.uk>
612 * jit-playback.cc (new_bitcast): Cast values returned by tree_to_uhwi
613 to 'long' to match the print format.
615 2022-04-12 Antoni Boucher <bouanto@zoho.com>
618 * docs/_build/texinfo/libgccjit.texi: Regenerate.
619 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_24): New ABI tag.
620 * docs/topics/expressions.rst: Add documentation for the
621 functions gcc_jit_lvalue_set_alignment and
622 gcc_jit_lvalue_get_alignment.
623 * jit-playback.h: New function (set_alignment).
624 * jit-recording.cc: New function (set_alignment).
625 * jit-recording.h: New functions (set_alignment, get_alignment)
626 and new field (m_alignment).
627 * libgccjit.cc: New functions (gcc_jit_lvalue_get_alignment,
628 gcc_jit_lvalue_set_alignment)
629 * libgccjit.h: New functions (gcc_jit_lvalue_get_alignment,
630 gcc_jit_lvalue_set_alignment)
631 * libgccjit.map (LIBGCCJIT_ABI_24): New ABI tag.
633 2022-04-12 Antoni Boucher <bouanto@zoho.com>
636 * docs/_build/texinfo/libgccjit.texi: Regenerate.
637 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_23): New ABI tag.
638 * docs/topics/contexts.rst: Add documentation for the new
639 function gcc_jit_context_set_bool_print_errors_to_stderr.
640 * jit-common.h: New enum value
641 (INNER_BOOL_OPTION_PRINT_ERRORS_TO_STDERR).
642 * jit-recording.cc: Handle the new option
643 INNER_BOOL_OPTION_PRINT_ERRORS_TO_STDERR.
644 * libgccjit.cc: New function
645 (gcc_jit_context_set_bool_print_errors_to_stderr).
646 * libgccjit.h: New function
647 (gcc_jit_context_set_bool_print_errors_to_stderr).
648 * libgccjit.map (LIBGCCJIT_ABI_23): New ABI tag.
650 2022-04-12 Antoni Boucher <bouanto@zoho.com>
653 * docs/_build/texinfo/libgccjit.texi: Regenerate.
654 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_22): New ABI tag.
655 * docs/topics/expressions.rst: Add documentation for the
656 function gcc_jit_lvalue_set_register_name.
657 * jit-playback.h: New function (set_register_name).
658 * jit-recording.cc: New function (set_register_name) and add
659 support for register variables.
660 * jit-recording.h: New field (m_reg_name) and new function
662 * libgccjit.cc: New function (gcc_jit_lvalue_set_register_name).
663 * libgccjit.h: New function (gcc_jit_lvalue_set_register_name).
664 * libgccjit.map (LIBGCCJIT_ABI_22): New ABI tag.
666 2022-04-12 Antoni Boucher <bouanto@zoho.com>
669 * docs/_build/texinfo/libgccjit.texi: Regenerate.
670 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_21): New ABI tag.
671 * docs/topics/expressions.rst: Add documentation for the
672 function gcc_jit_context_new_bitcast.
673 * jit-playback.cc: New function (new_bitcast).
674 * jit-playback.h: New function (new_bitcast).
675 * jit-recording.cc: New functions (new_bitcast,
676 bitcast::replay_into, bitcast::visit_children,
677 bitcast::make_debug_string, bitcast::write_reproducer).
678 * jit-recording.h: New class (bitcast) and new function
679 (new_bitcast, bitcast::replay_into, bitcast::visit_children,
680 bitcast::make_debug_string, bitcast::write_reproducer,
681 bitcast::get_precedence).
682 * libgccjit.cc: New function (gcc_jit_context_new_bitcast)
683 * libgccjit.h: New function (gcc_jit_context_new_bitcast)
684 * libgccjit.map (LIBGCCJIT_ABI_21): New ABI tag.
686 2022-04-12 Antoni Boucher <bouanto@zoho.com>
689 * docs/_build/texinfo/libgccjit.texi: Regenerate
690 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_20): New ABI tag.
691 * docs/topics/types.rst: Add documentation for the new types
692 GCC_JIT_TYPE_UINT8_T, GCC_JIT_TYPE_UINT16_T,
693 GCC_JIT_TYPE_UINT32_T, GCC_JIT_TYPE_UINT64_T,
694 GCC_JIT_TYPE_UINT128_T, GCC_JIT_TYPE_INT8_T, GCC_JIT_TYPE_INT16_T,
695 GCC_JIT_TYPE_INT32_T, GCC_JIT_TYPE_INT64_T, GCC_JIT_TYPE_INT128_T and
696 new functions (gcc_jit_compatible_types, gcc_jit_type_get_size).
697 * jit-builtins.cc: Add support for BT_UINT128.
698 * jit-common.h: Update the value of NUM_GCC_JIT_TYPES.
699 * jit-playback.cc: Add support for the sized integer types.
700 * jit-recording.cc: Add support for the sized integer types.
701 * jit-recording.h: Add support for comparing integer types
702 and new function (is_signed).
703 * libgccjit.cc (gcc_jit_compatible_types): New.
704 (gcc_jit_type_get_size) New.
705 * libgccjit.h: New enum variants for gcc_jit_types
706 (GCC_JIT_TYPE_UINT8_T, GCC_JIT_TYPE_UINT16_T,
707 GCC_JIT_TYPE_UINT32_T, GCC_JIT_TYPE_UINT64_T,
708 GCC_JIT_TYPE_UINT128_T, GCC_JIT_TYPE_INT8_T,
709 GCC_JIT_TYPE_INT16_T, GCC_JIT_TYPE_INT32_T,
710 GCC_JIT_TYPE_INT64_T, GCC_JIT_TYPE_INT128_T) and new functions
711 (gcc_jit_compatible_types, gcc_jit_type_get_size).
712 * libgccjit.map (LIBGCCJIT_ABI_20): New ABI tag.
714 2022-04-06 David Malcolm <dmalcolm@redhat.com>
717 * docs/_build/texinfo/factorial.png: Move to...
718 * docs/_build/texinfo/libgccjit-figures/factorial.png: ...here.
719 * docs/_build/texinfo/factorial1.png: Move to...
720 * docs/_build/texinfo/libgccjit-figures/factorial1.png: ...here.
721 * docs/_build/texinfo/sum-of-squares.png: Move to...
722 * docs/_build/texinfo/libgccjit-figures/sum-of-squares.png: ...here.
723 * docs/_build/texinfo/sum-of-squares1.png: Move to...
724 * docs/_build/texinfo/libgccjit-figures/sum-of-squares1.png: ...here.
726 2022-04-01 David Malcolm <dmalcolm@redhat.com>
728 * docs/topics/expressions.rst: Fix formatting.
729 * docs/topics/types.rst: Likewise.
730 * docs/_build/texinfo/libgccjit.texi: Regenerate
732 2022-04-01 Petter Tomner <tomner@kth.se>
734 * docs/topics/compatibility.rst: Add 19 tag
735 * docs/topics/compilation.rst: Linking
736 * docs/topics/contexts.rst: Linking example
737 * docs/topics/expressions.rst: Fix formatting and dropped 's'
739 2022-03-07 Jakub Jelinek <jakub@redhat.com>
741 * libgccjit.h: Fix up duplicated word issue in a comment.
743 2022-01-17 Martin Liska <mliska@suse.cz>
745 * config-lang.in: Rename .c names to .cc.
746 * docs/_build/texinfo/libgccjit.texi: Likewise.
747 * docs/internals/index.rst: Likewise.
748 * jit-builtins.cc (builtins_manager::make_builtin_function): Likewise.
749 * jit-playback.cc (fold_const_var): Likewise.
750 (playback::context::~context): Likewise.
751 (new_field): Likewise.
752 (new_bitfield): Likewise.
753 (new_compound_type): Likewise.
754 (playback::compound_type::set_fields): Likewise.
755 (global_set_init_rvalue): Likewise.
756 (load_blob_in_ctor): Likewise.
757 (new_global_initialized): Likewise.
759 (new_string_literal): Likewise.
760 (as_truth_value): Likewise.
761 (build_call): Likewise.
762 (playback::context::build_cast): Likewise.
763 (new_array_access): Likewise.
764 (new_field_access): Likewise.
765 (dereference): Likewise.
766 (postprocess): Likewise.
767 (add_jump): Likewise.
768 (add_switch): Likewise.
769 (build_goto_operands): Likewise.
770 (playback::context::read_dump_file): Likewise.
771 (init_types): Likewise.
772 * jit-recording.cc (recording::context::get_int_type): Likewise.
773 * jit-recording.h: Likewise.
774 * libgccjit.cc (compatible_types): Likewise.
775 (gcc_jit_context_acquire): Likewise.
776 (gcc_jit_context_release): Likewise.
777 (gcc_jit_context_new_child_context): Likewise.
778 (gcc_jit_type_as_object): Likewise.
779 (gcc_jit_context_get_type): Likewise.
780 (gcc_jit_context_get_int_type): Likewise.
781 (gcc_jit_type_get_pointer): Likewise.
782 (gcc_jit_type_get_const): Likewise.
783 (gcc_jit_type_get_volatile): Likewise.
784 (gcc_jit_type_dyncast_array): Likewise.
785 (gcc_jit_type_is_bool): Likewise.
786 (gcc_jit_type_is_pointer): Likewise.
787 (gcc_jit_type_is_integral): Likewise.
788 (gcc_jit_type_dyncast_vector): Likewise.
789 (gcc_jit_type_is_struct): Likewise.
790 (gcc_jit_vector_type_get_num_units): Likewise.
791 (gcc_jit_vector_type_get_element_type): Likewise.
792 (gcc_jit_type_unqualified): Likewise.
793 (gcc_jit_type_dyncast_function_ptr_type): Likewise.
794 (gcc_jit_function_type_get_return_type): Likewise.
795 (gcc_jit_function_type_get_param_count): Likewise.
796 (gcc_jit_function_type_get_param_type): Likewise.
797 (gcc_jit_context_new_array_type): Likewise.
798 (gcc_jit_context_new_field): Likewise.
799 (gcc_jit_field_as_object): Likewise.
800 (gcc_jit_context_new_struct_type): Likewise.
801 (gcc_jit_struct_as_type): Likewise.
802 (gcc_jit_struct_set_fields): Likewise.
803 (gcc_jit_struct_get_field_count): Likewise.
804 (gcc_jit_context_new_union_type): Likewise.
805 (gcc_jit_context_new_function_ptr_type): Likewise.
806 (gcc_jit_param_as_rvalue): Likewise.
807 (gcc_jit_context_new_function): Likewise.
808 (gcc_jit_function_get_return_type): Likewise.
809 (gcc_jit_function_dump_to_dot): Likewise.
810 (gcc_jit_block_get_function): Likewise.
811 (gcc_jit_global_set_initializer_rvalue): Likewise.
812 (gcc_jit_rvalue_get_type): Likewise.
813 (gcc_jit_context_new_rvalue_from_int): Likewise.
814 (gcc_jit_context_one): Likewise.
815 (gcc_jit_context_new_rvalue_from_double): Likewise.
816 (gcc_jit_context_null): Likewise.
817 (gcc_jit_context_new_string_literal): Likewise.
818 (valid_binary_op_p): Likewise.
819 (gcc_jit_context_new_binary_op): Likewise.
820 (gcc_jit_context_new_comparison): Likewise.
821 (gcc_jit_context_new_call): Likewise.
822 (is_valid_cast): Likewise.
823 (gcc_jit_context_new_cast): Likewise.
824 (gcc_jit_object_get_context): Likewise.
825 (gcc_jit_object_get_debug_string): Likewise.
826 (gcc_jit_lvalue_access_field): Likewise.
827 (gcc_jit_rvalue_access_field): Likewise.
828 (gcc_jit_rvalue_dereference_field): Likewise.
829 (gcc_jit_rvalue_dereference): Likewise.
830 (gcc_jit_lvalue_get_address): Likewise.
831 (gcc_jit_lvalue_set_tls_model): Likewise.
832 (gcc_jit_lvalue_set_link_section): Likewise.
833 (gcc_jit_function_new_local): Likewise.
834 (gcc_jit_block_add_eval): Likewise.
835 (gcc_jit_block_add_assignment): Likewise.
837 (gcc_jit_block_end_with_conditional): Likewise.
838 (gcc_jit_block_add_comment): Likewise.
839 (gcc_jit_block_end_with_jump): Likewise.
840 (gcc_jit_block_end_with_return): Likewise.
841 (gcc_jit_block_end_with_void_return): Likewise.
842 (case_range_validator::case_range_validator): Likewise.
843 (case_range_validator::validate): Likewise.
844 (case_range_validator::get_wide_int): Likewise.
845 (gcc_jit_block_end_with_switch): Likewise.
846 (gcc_jit_context_set_str_option): Likewise.
847 (gcc_jit_context_set_int_option): Likewise.
848 (gcc_jit_context_set_bool_option): Likewise.
849 (gcc_jit_context_set_bool_allow_unreachable_blocks): Likewise.
850 (gcc_jit_context_set_bool_use_external_driver): Likewise.
851 (gcc_jit_context_add_command_line_option): Likewise.
852 (gcc_jit_context_add_driver_option): Likewise.
853 (gcc_jit_context_enable_dump): Likewise.
854 (gcc_jit_context_compile): Likewise.
855 (gcc_jit_context_compile_to_file): Likewise.
856 (gcc_jit_context_set_logfile): Likewise.
857 (gcc_jit_context_dump_reproducer_to_file): Likewise.
858 (gcc_jit_context_get_first_error): Likewise.
859 (gcc_jit_context_get_last_error): Likewise.
860 (gcc_jit_result_get_code): Likewise.
861 (gcc_jit_result_get_global): Likewise.
862 (gcc_jit_rvalue_set_bool_require_tail_call): Likewise.
863 (gcc_jit_type_get_aligned): Likewise.
864 (gcc_jit_type_get_vector): Likewise.
865 (gcc_jit_function_get_address): Likewise.
866 (gcc_jit_version_patchlevel): Likewise.
867 (gcc_jit_block_add_extended_asm): Likewise.
868 (gcc_jit_extended_asm_as_object): Likewise.
869 (gcc_jit_extended_asm_set_volatile_flag): Likewise.
870 (gcc_jit_extended_asm_set_inline_flag): Likewise.
871 (gcc_jit_extended_asm_add_output_operand): Likewise.
872 (gcc_jit_extended_asm_add_input_operand): Likewise.
873 (gcc_jit_extended_asm_add_clobber): Likewise.
874 * notes.txt: Likewise.
876 2022-01-17 Martin Liska <mliska@suse.cz>
878 * dummy-frontend.c: Moved to...
879 * dummy-frontend.cc: ...here.
880 * jit-builtins.c: Moved to...
881 * jit-builtins.cc: ...here.
882 * jit-logging.c: Moved to...
883 * jit-logging.cc: ...here.
884 * jit-playback.c: Moved to...
885 * jit-playback.cc: ...here.
886 * jit-recording.c: Moved to...
887 * jit-recording.cc: ...here.
888 * jit-result.c: Moved to...
889 * jit-result.cc: ...here.
890 * jit-spec.c: Moved to...
891 * jit-spec.cc: ...here.
892 * jit-tempdir.c: Moved to...
893 * jit-tempdir.cc: ...here.
894 * jit-w32.c: Moved to...
895 * jit-w32.cc: ...here.
896 * libgccjit.c: Moved to...
897 * libgccjit.cc: ...here.
899 2021-12-28 Martin Liska <mliska@suse.cz>
901 * docs/_build/texinfo/libgccjit.texi: Replace http:// with https.
902 * docs/cp/index.rst: Likewise.
903 * docs/cp/intro/index.rst: Likewise.
904 * docs/cp/intro/tutorial01.rst: Likewise.
905 * docs/cp/intro/tutorial02.rst: Likewise.
906 * docs/cp/intro/tutorial03.rst: Likewise.
907 * docs/cp/intro/tutorial04.rst: Likewise.
908 * docs/cp/topics/asm.rst: Likewise.
909 * docs/cp/topics/compilation.rst: Likewise.
910 * docs/cp/topics/contexts.rst: Likewise.
911 * docs/cp/topics/expressions.rst: Likewise.
912 * docs/cp/topics/functions.rst: Likewise.
913 * docs/cp/topics/index.rst: Likewise.
914 * docs/cp/topics/locations.rst: Likewise.
915 * docs/cp/topics/objects.rst: Likewise.
916 * docs/cp/topics/types.rst: Likewise.
917 * docs/index.rst: Likewise.
918 * docs/internals/index.rst: Likewise.
919 * docs/intro/index.rst: Likewise.
920 * docs/intro/tutorial01.rst: Likewise.
921 * docs/intro/tutorial02.rst: Likewise.
922 * docs/intro/tutorial03.rst: Likewise.
923 * docs/intro/tutorial04.rst: Likewise.
924 * docs/intro/tutorial05.rst: Likewise.
925 * docs/topics/asm.rst: Likewise.
926 * docs/topics/compatibility.rst: Likewise.
927 * docs/topics/compilation.rst: Likewise.
928 * docs/topics/contexts.rst: Likewise.
929 * docs/topics/expressions.rst: Likewise.
930 * docs/topics/function-pointers.rst: Likewise.
931 * docs/topics/functions.rst: Likewise.
932 * docs/topics/index.rst: Likewise.
933 * docs/topics/locations.rst: Likewise.
934 * docs/topics/objects.rst: Likewise.
935 * docs/topics/performance.rst: Likewise.
936 * docs/topics/types.rst: Likewise.
938 2021-12-20 Martin Liska <mliska@suse.cz>
940 * libgccjit.c (struct version_info): Rename to jit_version_info.
941 (struct jit_version_info): Likewise.
942 (gcc_jit_version_major): Likewise.
943 (gcc_jit_version_minor): Likewise.
944 (gcc_jit_version_patchlevel): Likewise.
946 2021-12-14 Petter Tomner <tomner@kth.se>
948 * jit-common.h: New enum
949 * jit-playback.c : Folding an setting intitial
950 (global_new_decl) : Handle const global generation
951 (new_global) : New flag
952 (global_set_init_rvalue) : New
954 (new_global_initialized) : Flag
955 (as_truth_value) : Fold
956 (new_unary_op) : Fold
957 (new_binary_op) : Fold
958 (new_comparison) : Fold
959 (new_array_access) : Fold
960 (new_dereference) : Fold
963 (global_set_init_rvalue) : New
967 (new_global_init_rvalue) : New
969 (ctor) : New, inherits rvalue
970 (global_init_rvalue) : New, inherits memento
971 (type::is_union) : New
972 * libgccjit++.h : New entrypoints, see C-header
973 * libgccjit.c : See .h
974 * libgccjit.h : New entrypoints
975 (gcc_jit_context_new_array_constructor) : New
976 (gcc_jit_context_new_struct_constructor) : New
977 (gcc_jit_context_new_union_constructor) : New
978 (gcc_jit_global_set_initializer_rvalue) : New
979 (LIBGCCJIT_HAVE_CTORS) : New feuture macro
980 * libgccjit.map : New entrypoints added to ABI 19
981 * docs/topics/expressions.rst : Updated docs
983 2021-12-12 Antoni Boucher <bouanto@zoho.com>
986 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_18): New ABI
988 * docs/topics/expressions.rst: Add documentation for the
989 function gcc_jit_lvalue_set_link_section.
990 * jit-playback.h: New function (set_link_section).
991 * jit-recording.c: New function (set_link_section) and
992 support for setting the link section.
993 * jit-recording.h: New function (set_link_section) and new
994 field m_link_section.
995 * libgccjit.c: New function (gcc_jit_lvalue_set_link_section).
996 * libgccjit.h: New function (gcc_jit_lvalue_set_link_section).
997 * libgccjit.map (LIBGCCJIT_ABI_18): New ABI tag.
999 2021-12-12 Antoni Boucher <bouanto@zoho.com>
1002 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_17): New ABI
1004 * docs/topics/expressions.rst: Add document for the function
1005 gcc_jit_lvalue_set_tls_model.
1006 * jit-playback.h: New function (set_tls_model).
1007 * jit-recording.c: New function (set_tls_model), new
1008 variables (tls_models and tls_model_enum_strings) and support
1009 for setting the tls model.
1010 * jit-recording.h: New function (set_tls_model) and new
1012 * libgccjit.c: New function (gcc_jit_lvalue_set_tls_model).
1013 * libgccjit.h: New function (gcc_jit_lvalue_set_tls_model)
1014 and new enum (gcc_jit_tls_model).
1015 * libgccjit.map (LIBGCCJIT_ABI_17): New ABI tag.
1017 2021-12-11 Antoni Boucher <bouanto@zoho.com>
1021 * jit-builtins.c: Implement missing types for builtins.
1022 * jit-recording.c:: Allow sending a volatile const void * as
1024 * jit-recording.h: New functions (is_volatile, is_const) and
1025 allow comparing qualified types.
1027 2021-12-10 David Malcolm <dmalcolm@redhat.com>
1030 * jit-playback.c (gcc::jit::playback::context::new_function): Set
1031 DECL_CONTEXT of the result_decl.
1033 2021-11-27 Petter Tomner <tomner@kth.se>
1035 * libgccjit.c: %ld -> %zu
1037 2021-11-24 Martin Liska <mliska@suse.cz>
1039 * jit-playback.c (function): Initialize m_blocks vector.
1041 2021-11-20 Antoni Boucher <bouanto@zoho.com>
1044 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_16): New ABI tag.
1045 * docs/topics/functions.rst: Add documentation for the
1046 functions gcc_jit_function_get_return_type and
1047 gcc_jit_function_get_param_count
1048 * docs/topics/types.rst: Add documentation for the functions
1049 gcc_jit_function_type_get_return_type,
1050 gcc_jit_function_type_get_param_count,
1051 gcc_jit_function_type_get_param_type,
1052 gcc_jit_type_unqualified, gcc_jit_type_dyncast_array,
1053 gcc_jit_type_is_bool,
1054 gcc_jit_type_dyncast_function_ptr_type,
1055 gcc_jit_type_is_integral, gcc_jit_type_is_pointer,
1056 gcc_jit_type_dyncast_vector,
1057 gcc_jit_vector_type_get_element_type,
1058 gcc_jit_vector_type_get_num_units,
1059 gcc_jit_struct_get_field, gcc_jit_type_is_struct,
1060 and gcc_jit_struct_get_field_count
1062 (gcc_jit_function_get_return_type, gcc_jit_function_get_param_count,
1063 gcc_jit_function_type_get_return_type,
1064 gcc_jit_function_type_get_param_count,
1065 gcc_jit_function_type_get_param_type, gcc_jit_type_unqualified,
1066 gcc_jit_type_dyncast_array, gcc_jit_type_is_bool,
1067 gcc_jit_type_dyncast_function_ptr_type, gcc_jit_type_is_integral,
1068 gcc_jit_type_is_pointer, gcc_jit_type_dyncast_vector,
1069 gcc_jit_vector_type_get_element_type,
1070 gcc_jit_vector_type_get_num_units, gcc_jit_struct_get_field,
1071 gcc_jit_type_is_struct, gcc_jit_struct_get_field_count): New
1073 (struct gcc_jit_function_type, struct gcc_jit_vector_type):
1076 (gcc_jit_function_get_return_type, gcc_jit_function_get_param_count,
1077 gcc_jit_function_type_get_return_type,
1078 gcc_jit_function_type_get_param_count,
1079 gcc_jit_function_type_get_param_type, gcc_jit_type_unqualified,
1080 gcc_jit_type_dyncast_array, gcc_jit_type_is_bool,
1081 gcc_jit_type_dyncast_function_ptr_type, gcc_jit_type_is_integral,
1082 gcc_jit_type_is_pointer, gcc_jit_type_dyncast_vector,
1083 gcc_jit_vector_type_get_element_type,
1084 gcc_jit_vector_type_get_num_units, gcc_jit_struct_get_field,
1085 gcc_jit_type_is_struct, gcc_jit_struct_get_field_count): New
1086 function declarations.
1087 (struct gcc_jit_function_type, struct gcc_jit_vector_type):
1089 * jit-recording.h: New functions (is_struct and is_vector)
1090 * libgccjit.map (LIBGCCJIT_ABI_16): New ABI tag.
1092 2021-11-12 David Malcolm <dmalcolm@redhat.com>
1095 * docs/examples/tut04-toyvm/toyvm.c (toyvm_function_compile):
1096 Increase size of buffer.
1097 * docs/examples/tut04-toyvm/toyvm.cc
1098 (compilation_state::create_function): Likewise.
1100 2021-09-10 Petter Tomner <tomner@kth.se>
1102 * jit-playback.c: Moved global var processing to after loc handling.
1103 Setting TYPE_NAME for fundamental types.
1104 Using common functions for finalizing globals.
1105 * jit-playback.h: New method init_types().
1106 Changed get_tree_node_for_type() to method.
1108 2021-08-19 Iain Sandoe <iain@sandoe.co.uk>
1110 * docs/examples/tut04-toyvm/toyvm.c: Include jit-dejagnu.h.
1111 * docs/examples/tut04-toyvm/toyvm.cc: Likewise.
1112 * jit-dejagnu.h: New file, imported from dejagnu-1.6.2 and
1113 patched for this application.
1115 2021-08-18 Iain Sandoe <iain@sandoe.co.uk>
1118 * Make-lang.in: Provide clauses for Darwin hosts.
1120 2021-07-18 Antoni Boucher <bouanto@zoho.com>
1123 * jit-playback.c (convert): Add support to handle truncation and
1124 extension in the convert function.
1126 2021-05-19 Martin Liska <mliska@suse.cz>
1129 * libgccjit.c (gcc_jit_context_new_function): Fix typos.
1131 2021-03-24 Matthias Klose <doko@ubuntu.com>
1133 * Make-lang.in (jit.sphinx.html, jit.sphinx.pdf): Use $(mkinstalldirs),
1134 (jit.install-headers): Depend on installdirs.
1136 2021-02-19 David Malcolm <dmalcolm@redhat.com>
1140 (gcc::jit::builtins_manager::get_builtin_function_by_id):
1141 Update assertion to reject BUILT_IN_NONE.
1142 (gcc::jit::builtins_manager::ensure_optimization_builtins_exist):
1145 (gcc::jit::builtins_manager::ensure_optimization_builtins_exist):
1147 * jit-playback.c (gcc::jit::playback::context::replay): Call it.
1148 Remove redundant conditional on bm.
1150 2021-01-14 David Malcolm <dmalcolm@redhat.com>
1152 * docs/cp/index.rst: Remove "Alpha" warning.
1153 * docs/index.rst: Likewise.
1154 * docs/_build/texinfo/libgccjit.texi: Regenerate
1156 2020-11-25 Martin Sebor <msebor@redhat.com>
1159 * jit-recording.c (recording::function::dump_to_dot): Avoid
1161 (recording::block::dump_to_dot): Same.
1163 2020-11-20 Jakub Jelinek <jakub@redhat.com>
1166 * Make-lang.in (jit.serial): Change from goal to a
1168 (.PHONY): Drop jit.serial and jit.prev.
1169 ($(LIBGCCJIT_FILENAME)): Depend on $(jit.serial) rather than
1172 2020-11-18 Jakub Jelinek <jakub@redhat.com>
1174 * Make-lang.in (jit.serial): New goal.
1175 (.PHONY): Add jit.serial jit.prev.
1176 ($(LIBGCCJIT_FILENAME)): Depend on jit.prev. Call LINK_PROGRESS.
1178 2020-11-12 David Malcolm <dmalcolm@redhat.com>
1181 * docs/cp/topics/asm.rst: New file.
1182 * docs/cp/topics/index.rst (Topic Reference): Add it.
1183 * docs/topics/asm.rst: New file.
1184 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_15): New.
1185 * docs/topics/functions.rst (Statements): Add link to extended
1187 * docs/topics/index.rst (Topic Reference): Add asm.rst.
1188 * docs/topics/objects.rst: Add gcc_jit_extended_asm to ASCII art.
1189 * docs/_build/texinfo/Makefile: Regenerate.
1190 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1191 * jit-common.h (gcc::jit::recording::extended_asm): New forward
1193 (gcc::jit::recording::top_level_asm): Likewise.
1194 * jit-playback.c: Include "stmt.h".
1195 (build_string): New.
1196 (gcc::jit::playback::context::new_string_literal): Disambiguate
1198 (gcc::jit::playback::context::add_top_level_asm): New.
1199 (build_operand_chain): New.
1200 (build_clobbers): New.
1201 (build_goto_operands): New.
1202 (gcc::jit::playback::block::add_extended_asm): New.
1203 * jit-playback.h (gcc::jit::playback::context::add_top_level_asm):
1205 (struct gcc::jit::playback::asm_operand): New struct.
1206 (gcc::jit::playback::block::add_extended_asm): New decl.
1207 * jit-recording.c (gcc::jit::recording::context::dump_to_file):
1208 Dump top-level asms.
1209 (gcc::jit::recording::context::add_top_level_asm): New.
1210 (gcc::jit::recording::block::add_extended_asm): New.
1211 (gcc::jit::recording::block::end_with_extended_asm_goto): New.
1212 (gcc::jit::recording::asm_operand::asm_operand): New.
1213 (gcc::jit::recording::asm_operand::print): New.
1214 (gcc::jit::recording::asm_operand::make_debug_string): New.
1215 (gcc::jit::recording::output_asm_operand::write_reproducer): New.
1216 (gcc::jit::recording::output_asm_operand::print): New.
1217 (gcc::jit::recording::input_asm_operand::write_reproducer): New.
1218 (gcc::jit::recording::input_asm_operand::print): New.
1219 (gcc::jit::recording::extended_asm::add_output_operand): New.
1220 (gcc::jit::recording::extended_asm::add_input_operand): New.
1221 (gcc::jit::recording::extended_asm::add_clobber): New.
1222 (gcc::jit::recording::extended_asm::replay_into): New.
1223 (gcc::jit::recording::extended_asm::make_debug_string): New.
1224 (gcc::jit::recording::extended_asm::write_flags): New.
1225 (gcc::jit::recording::extended_asm::write_clobbers): New.
1226 (gcc::jit::recording::extended_asm_simple::write_reproducer): New.
1227 (gcc::jit::recording::extended_asm::maybe_populate_playback_blocks):
1229 (gcc::jit::recording::extended_asm_goto::extended_asm_goto): New.
1230 (gcc::jit::recording::extended_asm_goto::replay_into): New.
1231 (gcc::jit::recording::extended_asm_goto::write_reproducer): New.
1232 (gcc::jit::recording::extended_asm_goto::get_successor_blocks):
1234 (gcc::jit::recording::extended_asm_goto::maybe_print_gotos): New.
1235 (gcc::jit::recording::extended_asm_goto::maybe_populate_playback_blocks):
1237 (gcc::jit::recording::top_level_asm::top_level_asm): New.
1238 (gcc::jit::recording::top_level_asm::replay_into): New.
1239 (gcc::jit::recording::top_level_asm::make_debug_string): New.
1240 (gcc::jit::recording::top_level_asm::write_to_dump): New.
1241 (gcc::jit::recording::top_level_asm::write_reproducer): New.
1243 (gcc::jit::recording::context::add_top_level_asm): New decl.
1244 (gcc::jit::recording::context::m_top_level_asms): New field.
1245 (gcc::jit::recording::block::add_extended_asm): New decl.
1246 (gcc::jit::recording::block::end_with_extended_asm_goto): New
1248 (gcc::jit::recording::asm_operand): New class.
1249 (gcc::jit::recording::output_asm_operand): New class.
1250 (gcc::jit::recording::input_asm_operand): New class.
1251 (gcc::jit::recording::extended_asm): New class.
1252 (gcc::jit::recording::extended_asm_simple): New class.
1253 (gcc::jit::recording::extended_asm_goto): New class.
1254 (gcc::jit::recording::top_level_asm): New class.
1255 * libgccjit++.h (gccjit::extended_asm): New forward decl.
1256 (gccjit::context::add_top_level_asm): New.
1257 (gccjit::block::add_extended_asm): New.
1258 (gccjit::block::end_with_extended_asm_goto): New.
1259 (gccjit::extended_asm): New class.
1260 (gccjit::extended_asm::extended_asm): New ctors.
1261 (gccjit::extended_asm::set_volatile_flag): New.
1262 (gccjit::extended_asm::set_inline_flag): New.
1263 (gccjit::extended_asm::add_output_operand): New.
1264 (gccjit::extended_asm::add_input_operand): New.
1265 (gccjit::extended_asm::add_clobber): New.
1266 (gccjit::extended_asm::get_inner_extended_asm): New.
1267 * libgccjit.c (struct gcc_jit_extended_asm): New.
1268 (jit_error): Make "loc" param take a gcc::jit::recording::location *
1269 rather than a gcc_jit_location *.
1270 (gcc_jit_block_add_extended_asm): New entrypoint.
1271 (gcc_jit_block_end_with_extended_asm_goto): New entrypoint.
1272 (gcc_jit_extended_asm_as_object): New entrypoint.
1273 (gcc_jit_extended_asm_set_volatile_flag): New entrypoint.
1274 (gcc_jit_extended_asm_set_inline_flag): New entrypoint.
1275 (gcc_jit_extended_asm_add_output_operand): New entrypoint.
1276 (gcc_jit_extended_asm_add_clobber): New entrypoint.
1277 (gcc_jit_context_add_top_level_asm): New entrypoint.
1278 * libgccjit.h: Add gcc_jit_extended_asm to ASCII art.
1279 (gcc_jit_extended_asm): New typedef.
1280 (LIBGCCJIT_HAVE_ASM_STATEMENTS): New define.
1281 (gcc_jit_block_add_extended_asm): New entrypoint.
1282 (gcc_jit_block_end_with_extended_asm_goto): New entrypoint.
1283 (gcc_jit_extended_asm_as_object): New entrypoint.
1284 (gcc_jit_extended_asm_set_volatile_flag): New entrypoint.
1285 (gcc_jit_extended_asm_set_inline_flag): New entrypoint.
1286 (gcc_jit_extended_asm_add_output_operand): New entrypoint.
1287 (gcc_jit_extended_asm_add_input_operand): New entrypoint.
1288 (gcc_jit_extended_asm_add_clobber): New entrypoint.
1289 (gcc_jit_context_add_top_level_asm): New entrypoint.
1290 * libgccjit.map (LIBGCCJIT_ABI_15): New.
1292 2020-11-12 David Malcolm <dmalcolm@redhat.com>
1294 * jit-recording.c (recording::context::new_string): Add "escaped"
1295 param and use it when creating the new recording::string instance.
1296 (recording::string::string): Add "escaped" param and use it to
1297 initialize m_escaped.
1298 (recording::string::make_debug_string): Replace check that first
1299 char is double-quote with use of m_escaped. Fix escaping of
1300 '\t' and '\n'. Set "escaped" on the result.
1301 * jit-recording.h (recording::context::new_string): Add "escaped"
1303 (recording::string::string): Add "escaped" param.
1304 (recording::string::m_escaped): New field.
1306 2020-11-12 David Malcolm <dmalcolm@redhat.com>
1308 * libgccjit.h: Fix typo in comment.
1310 2020-09-14 Andrea Corallo <andrea.corallo@arm.com>
1312 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1314 2020-09-11 Andrea Corallo <andrea.corallo@arm.com>
1316 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_14): New ABI tag.
1317 * docs/topics/expressions.rst (gcc_jit_global_set_initializer):
1318 Document new entry point in section 'Global variables'.
1319 * jit-playback.c (global_new_decl, global_finalize_lvalue): New
1321 (playback::context::new_global): Make use of global_new_decl,
1322 global_finalize_lvalue.
1323 (load_blob_in_ctor): New template function in use by the
1325 (playback::context::new_global_initialized): New method.
1326 * jit-playback.h (class context): Decl 'new_global_initialized',
1327 'global_new_decl', 'global_finalize_lvalue'.
1328 (lvalue::set_initializer): Add implementation.
1329 * jit-recording.c (recording::memento_of_get_pointer::get_size)
1330 (recording::memento_of_get_type::get_size): Add implementation.
1331 (recording::global::write_initializer_reproducer): New function in
1332 use by 'recording::global::write_reproducer'.
1333 (recording::global::replay_into)
1334 (recording::global::write_to_dump)
1335 (recording::global::write_reproducer): Handle
1337 * jit-recording.h (class type): Decl 'get_size' and
1339 * libgccjit++.h (class lvalue): Declare new 'set_initializer'
1341 (class lvalue): Decl 'is_global' and 'set_initializer'.
1342 (class global) Decl 'write_initializer_reproducer'. Add
1343 'm_initializer', 'm_initializer_num_bytes' fields. Implement
1344 'set_initializer'. Add a destructor to free 'm_initializer'.
1345 * libgccjit.c (gcc_jit_global_set_initializer): New function.
1346 * libgccjit.h (gcc_jit_global_set_initializer): New function
1348 * libgccjit.map (LIBGCCJIT_ABI_14): New ABI tag.
1350 2020-08-28 Martin Sebor <msebor@redhat.com>
1352 * jit-recording.c (recording::switch_::make_debug_string): Add argument
1355 2020-08-22 Andrea Corallo <andrea.corallo@arm.com>
1358 (gcc_jit_context_new_rvalue_from_int)
1359 (gcc_jit_context_new_rvalue_from_long)
1360 (gcc_jit_context_new_rvalue_from_double)
1361 (gcc_jit_context_new_rvalue_from_ptr): Update function heading
1364 2020-06-16 Nicolas Bértolo <nicolasbertolo@gmail.com>
1366 * Make-lang.in: Always define version, minor and release
1367 numbers. Create the Windows shared library as
1368 libgccjit-$(LIBGCCJIT_VERSION_NUM).dll.
1370 2020-06-03 David Malcolm <dmalcolm@redhat.com>
1373 * jit-builtins.c (builtins_manager::make_primitive_type):
1374 Implement BT_CONST_VOLATILE_PTR.
1376 2020-06-02 David Malcolm <dmalcolm@redhat.com>
1379 * dummy-frontend.c: Include "options.h", "stringpool.h", and
1381 (ATTR_EXCL): New, copied from lto/lto-lang.c.
1382 (attr_noreturn_exclusions): Likewise.
1383 (attr_returns_twice_exclusions): Likewise.
1384 (attr_const_pure_exclusions): Likewise.
1385 (jit_attribute_table): Likewise, copied from lto_attribute_table.
1386 (jit_format_attribute_table): Likewise, copied from
1387 lto_format_attribute_table.
1388 (handle_noreturn_attribute): New, copied from lto/lto-lang.c.
1389 (handle_leaf_attribute): Likewise.
1390 (handle_const_attribute): Likewise.
1391 (handle_malloc_attribute): Likewise.
1392 (handle_pure_attribute): Likewise.
1393 (handle_novops_attribute): Likewise.
1394 (get_nonnull_operand): Likewise.
1395 (handle_nonnull_attribute): Likewise.
1396 (handle_nothrow_attribute): Likewise.
1397 (handle_sentinel_attribute): Likewise.
1398 (handle_type_generic_attribute): Likewise.
1399 (handle_transaction_pure_attribute): Likewise.
1400 (handle_returns_twice_attribute): Likewise.
1401 (handle_patchable_function_entry_attribute): Likewise.
1402 (ignore_attribute): Likewise.
1403 (handle_format_attribute): Likewise.
1404 (handle_format_arg_attribute): Likewise.
1405 (handle_fnspec_attribute): Likewise.
1406 (LANG_HOOKS_COMMON_ATTRIBUTE_TABLE): Define.
1407 (LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE): Define.
1409 2020-05-28 Nicolas Bértolo <nicolasbertolo@gmail.com>
1411 * Make-lang.in: Remove extra slash. Build libgccjit.dll and its
1412 import library in Windows.
1413 * config-lang.in: Update comment about --enable-host-shared.
1414 * jit-w32.h: New file.
1415 * jit-w32.c: New file.
1416 (print_last_error): New function that prints the error
1417 string corresponding to GetLastError().
1418 (get_TOKEN_USER_current_user): Helper function used for getting
1419 the SID belonging to the current user.
1420 (create_directory_for_current_user): Helper function to create
1421 a directory with permissions such that only the current user can
1423 (win_mkdtemp): Create a temporary directory using Windows APIs.
1424 * jit-playback.c: Do not chmod files in Windows. Use LoadLibrary,
1425 FreeLibrary and GetProcAddress instead of libdl.
1426 * jit-result.h, jit-result.c: Introduce result::handle_t to
1427 abstract over the types used for dynamic library handles.
1428 * jit-tempdir.c: Do not use mkdtemp() in Windows, use
1431 2020-05-27 David Malcolm <dmalcolm@redhat.com>
1434 * dummy-frontend.c (LANG_HOOKS_DEEP_UNSHARING): Define to be true.
1435 * jit-playback.h (gcc::jit::playback::rvalue): Mark tree node with
1438 2020-05-27 Tom Tromey <tromey@gcc.gnu.org>
1441 * docs/conf.py (texinfo_documents): Set description.
1442 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1444 2020-05-26 David Malcolm <dmalcolm@redhat.com>
1447 * docs/topics/functions.rst
1448 (gcc_jit_context_get_builtin_function): Document.
1449 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1450 * dummy-frontend.c (jit_langhook_global_bindings_p): Remove
1452 * jit-builtins.c (type_names): New array.
1453 (get_string_for_type_id): New function.
1454 (gcc::jit::builtins_manager::make_primitive_type): Show name of
1455 type in error messages. Update cases to reflect the order in
1456 builtin-types.def. Implement cases for BT_INT8, BT_INT16,
1457 BT_UINT8, BT_CONST_PTR, BT_VOLATILE_PTR, BT_INT_PTR, BT_FLOAT_PTR,
1458 BT_CONST_DOUBLE_PTR, BT_SIZE, BT_CONST_SIZE.
1460 2020-05-26 David Malcolm <dmalcolm@redhat.com>
1462 * docs/topics/compatibility.rst: Fix underline.
1464 * docs/topics/types.rst: Fix missing blank line.
1465 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1467 2020-05-26 David Malcolm <dmalcolm@redhat.com>
1470 * docs/topics/expressions.rst (Unary Operations): Document that
1471 result_type of gcc_jit_context_new_unary_op must be a numeric type.
1472 (Binary Operations): Likewise for gcc_jit_context_new_binary_op.
1473 (Global variables): Document that "type" of
1474 gcc_jit_context_new_global must be non-`void`.
1475 * docs/topics/function-pointers.rst
1476 (gcc_jit_context_new_function_ptr_type): Document that the
1477 param_types must be non-void, but that return_type may be.
1478 * docs/topics/functions.rst (Params): Document that
1479 gcc_jit_context_new_param's type must be non-void.
1480 (Functions): Likewise for gcc_jit_function_new_local.
1481 * docs/topics/types.rst (gcc_jit_context_new_array_type): Document
1482 that the type must be non-void.
1483 (gcc_jit_context_new_field): Likewise.
1484 * docs/_build/texinfo/Makefile: Regenerate.
1485 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1486 * libgccjit.c (gcc_jit_context_new_array_type): Fail if
1487 element_type is void.
1488 (gcc_jit_context_new_field): Likewise for "type".
1489 (gcc_jit_context_new_function_ptr_type): Likewise for each
1490 element of param_types.
1491 (gcc_jit_context_new_param): Likewise for "type".
1492 (gcc_jit_context_new_global): Likewise.
1493 (gcc_jit_function_new_local): Likewise.
1494 (gcc_jit_type_get_aligned): Likewise.
1496 2020-03-31 Andrea Corallo <andrea.corallo@arm.com>
1497 David Malcolm <dmalcolm@redhat.com>
1499 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_13): New ABI tag
1500 plus add version paragraph.
1501 * libgccjit++.h (namespace gccjit::version): Add new namespace.
1502 * libgccjit.c (gcc_jit_version_major, gcc_jit_version_minor)
1503 (gcc_jit_version_patchlevel): New functions.
1504 * libgccjit.h (LIBGCCJIT_HAVE_gcc_jit_version): New macro.
1505 (gcc_jit_version_major, gcc_jit_version_minor)
1506 (gcc_jit_version_patchlevel): New functions.
1507 * libgccjit.map (LIBGCCJIT_ABI_13) New ABI tag.
1509 2020-03-23 Andrea Corallo <andrea.corallo@arm.com>
1512 (gcc::jit::playback::context m_recording_ctxt): Remove
1513 m_char_array_type_node field.
1515 (playback::context::context) Remove m_char_array_type_node from member
1517 (playback::context::new_string_literal) Fix logic to handle string
1520 2020-01-01 Jakub Jelinek <jakub@redhat.com>
1522 Update copyright years.
1524 2019-11-29 Julian Brown <julian@codesourcery.com>
1526 * jit-builtins.c (BT_DFLOAT32_PTR, BT_DFLOAT64_PTR, BT_DFLOAT128_PTR):
1527 Remove commented-out cases.
1529 2019-11-20 David Malcolm <dmalcolm@redhat.com>
1532 * jit-playback.c (gcc::jit::playback::context::make_fake_args):
1533 Update GCC_JIT_BOOL_OPTION_SELFCHECK_GC for new --param syntax.
1535 2019-08-13 Richard Sandiford <richard.sandiford@arm.com>
1538 * jit-playback.c (new_function): Use set_decl_built_in_function.
1540 2019-07-22 Andrea Corallo <andrea.corallo@arm.com>
1542 * jit-recording.c (unary_op_reproducer_strings): Make it extern.
1543 (binary_op_reproducer_strings): Likewise.
1544 * jit-recording.h (unary_op_reproducer_strings): Likewise.
1545 (binary_op_reproducer_strings): Likewise.
1546 * libgccjit.c (gcc_jit_context_new_unary_op): Check result_type to be a
1548 * libgccjit.c (gcc_jit_context_new_binary_op): Improve error message.
1550 2019-07-04 Andrea Corallo <andrea.corallo@arm.com>
1552 * libgccjit.c (gcc_jit_context_new_binary_op): Check result_type to be a
1555 2019-07-04 Andrea Corallo <andrea.corallo@arm.com>
1557 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_12): New ABI tag.
1558 * docs/topics/types.rst: Add gcc_jit_context_new_bitfield.
1559 * jit-common.h (namespace recording): Add class bitfield.
1561 (DECL_C_BIT_FIELD, SET_DECL_C_BIT_FIELD): Add macros.
1562 (playback::context::new_bitfield): New method.
1563 (playback::compound_type::set_fields): Add bitfield support.
1564 (playback::lvalue::mark_addressable): Was jit_mark_addressable make this
1565 a method of lvalue plus return a bool to communicate success.
1566 (playback::lvalue::get_address): Check for jit_mark_addressable return
1568 * jit-playback.h (new_bitfield): New method.
1569 (class bitfield): New class.
1570 (class lvalue): Add jit_mark_addressable method.
1571 * jit-recording.c (recording::context::new_bitfield): New method.
1572 (recording::bitfield::replay_into): New method.
1573 (recording::bitfield::write_to_dump): Likewise.
1574 (recording::bitfield::make_debug_string): Likewise.
1575 (recording::bitfield::write_reproducer): Likewise.
1576 * jit-recording.h (class context): Add new_bitfield method.
1577 (class field): Make it derivable by class bitfield.
1578 (class bitfield): Add new class.
1579 * libgccjit++.h (class context): Add new_bitfield method.
1580 * libgccjit.c (struct gcc_jit_bitfield): New structure.
1581 (gcc_jit_context_new_bitfield): New function.
1583 (LIBGCCJIT_HAVE_gcc_jit_context_new_bitfield) New macro.
1584 (gcc_jit_context_new_bitfield): New function.
1585 * libgccjit.map (LIBGCCJIT_ABI_12) New ABI tag.
1587 2019-03-21 Jakub Jelinek <jakub@redhat.com>
1589 * jit-recording.c (reproducer::m_set_identifiers): Use false as Lazy
1590 in hash_set template param.
1592 2019-02-05 Andrea Corallo <andrea.corallo@arm.com>
1594 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_11): New ABI tag.
1595 * docs/topics/contexts.rst (Additional driver options): New
1597 * jit-playback.c (invoke_driver): Add call to append_driver_options.
1598 * jit-recording.c: Within namespace gcc::jit...
1599 (recording::context::~context): Free the optnames within
1601 (recording::context::add_driver_option): New method.
1602 (recording::context::append_driver_options): New method.
1603 (recording::context::dump_reproducer_to_file): Add driver
1605 * jit-recording.h: Within namespace gcc::jit...
1606 (recording::context::add_driver_option): New method.
1607 (recording::context::append_driver_options): New method.
1608 (recording::context::m_driver_options): New field.
1609 * libgccjit++.h (gccjit::context::add_driver_option): New
1611 * libgccjit.c (gcc_jit_context_add_driver_option): New API
1613 * libgccjit.h (gcc_jit_context_add_driver_option): New API
1615 (LIBGCCJIT_HAVE_gcc_jit_context_add_driver_option): New
1617 * libgccjit.map (LIBGCCJIT_ABI_11): New ABI tag.
1619 2019-01-01 Jakub Jelinek <jakub@redhat.com>
1621 Update copyright years.
1623 2018-11-15 David Malcolm <dmalcolm@redhat.com>
1626 * dummy-frontend.c (jit_begin_diagnostic): Add diagnostic_t param.
1628 2018-11-13 David Malcolm <dmalcolm@redhat.com>
1630 * jit-playback.c: Replace "source_location" with "location_t".
1632 2018-10-17 David Malcolm <dmalcolm@redhat.com>
1634 * Make-lang.in (selftest-jit): New.
1636 2018-06-28 Martin Liska <mliska@suse.cz>
1638 * jit-playback.c: Include opt-suggestions.h.
1640 2018-06-28 Martin Liska <mliska@suse.cz>
1642 * jit-playback.c (class auto_argvec): Moved to vec.h.
1643 (auto_argvec::~auto_argvec): Likewise.
1644 (compile): Use the renamed name.
1645 (invoke_driver): Likewise.
1647 2018-03-21 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1650 * Make-lang.in ($(LIBGCCJIT_FILENAME)): Add $(EXTRA_GCC_LIBS).
1652 2018-03-09 David Malcolm <dmalcolm@redhat.com>
1653 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
1657 * Make-lang.in (COMMA): New.
1658 (LIBGCCJIT_VERSION_SCRIPT_OPTION): New.
1659 (LIBGCCJIT_SONAME_OPTION): New.
1660 (jit): Move --version-script and -soname linker options to the
1663 2018-01-25 David Malcolm <dmalcolm@redhat.com>
1666 * jit-recording.h (gcc::jit::recording::union_): Remove fields
1667 "m_loc" and "m_name".
1669 2018-01-03 Jakub Jelinek <jakub@redhat.com>
1671 Update copyright years.
1673 2017-12-19 Jakub Jelinek <jakub@redhat.com>
1675 * jit-playback.c (get_type, playback::compile_to_file::copy_file,
1676 playback::context::acquire_mutex): Replace Yoda conditions with
1677 typical order conditions.
1678 * libgccjit.c (gcc_jit_context_new_struct_type,
1679 gcc_jit_struct_set_fields, gcc_jit_context_new_union_type,
1680 gcc_jit_context_new_function, gcc_jit_timer_pop): Likewise.
1681 * jit-builtins.c (matches_builtin): Likewise.
1682 * jit-recording.c (recording::compound_type::set_fields,
1683 recording::fields::write_reproducer, recording::rvalue::set_scope,
1684 recording::function::validate): Likewise.
1685 * jit-logging.c (logger::decref): Likewise.
1687 2017-11-30 Jakub Jelinek <jakub@redhat.com>
1690 (recording::memento_of_new_rvalue_from_const <long>::write_reproducer):
1691 Use ; instead of ;;.
1693 2017-11-28 Jakub Jelinek <jakub@redhat.com>
1695 * jit-playback.c (add_switch): Build SWITCH_EXPR using build2 instead
1696 of build3. Formatting fixes. Adjust funciton comment.
1698 2017-11-23 Tom de Vries <tom@codesourcery.com>
1700 * libgccjit.c (RETURN_NULL_IF_FAIL_NONNULL_NUMERIC_TYPE): Wrap in
1701 JIT_{BEGIN,END}_STMT.
1703 2017-10-31 David Malcolm <dmalcolm@redhat.com>
1705 * docs/internals/index.rst (Running the test suite): Document
1706 PRESERVE_EXECUTABLES.
1707 (Running under valgrind): Add markup to RUN_UNDER_VALGRIND.
1708 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1710 2017-10-04 David Malcolm <dmalcolm@redhat.com>
1712 * docs/cp/topics/expressions.rst (Vector expressions): New
1714 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_10): New ABI tag.
1715 * docs/topics/expressions.rst (Vector expressions): New section.
1716 * docs/topics/types.rst (gcc_jit_type_get_vector): Add link to
1717 gcc_jit_context_new_rvalue_from_vector.
1718 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1719 * jit-common.h (gcc::jit:recording::vector_type): New forward
1722 (gcc::jit::playback::context::new_rvalue_from_vector): New method.
1724 (gcc::jit::playback::context::new_rvalue_from_vector): New method.
1725 * jit-recording.c: In namespace gcc::jit::
1726 (class comma_separated_string): New class.
1727 (comma_separated_string::comma_separated_string): New ctor,
1728 adapted from recording::call::make_debug_string.
1729 (comma_separated_string::~comma_separated_string): New dtor.
1730 In namespace gcc::jit::recording::
1731 (context::new_rvalue_from_vector): New method.
1732 (type::get_vector): Update for renaming of memento_of_get_vector.
1733 (class memento_of_get_vector): Rename to...
1734 (class vector_type): ..this.
1735 (memento_of_new_rvalue_from_vector::memento_of_new_rvalue_from_vector):
1737 (memento_of_new_rvalue_from_vector::replay_into): New method.
1738 (memento_of_new_rvalue_from_vector::visit_children): New method.
1739 (memento_of_new_rvalue_from_vector::make_debug_string): New
1741 (memento_of_new_rvalue_from_vector::write_reproducer): New method.
1742 (call::make_debug_string): Split out arg-printing code into ctor
1743 for comma_separated_string.
1744 * jit-recording.h: In namespace gcc::jit::recording::
1745 (context::new_rvalue_from_vector): New method.
1746 (type::dyn_cast_vector_type): New virtual function.
1747 (class memento_of_get_vector): Rename to...
1748 (class vector_type): ...this.
1749 (vector_type::unqualified): Remove this vfunc override in favor
1751 (vector_type::get_element_type): ...this new method.
1752 (vector_type::get_num_units): New method.
1753 (vector_type::dyn_cast_vector_type): New vfunc override.
1754 (class memento_of_new_rvalue_from_vector): New class.
1755 * libgccjit++.h (gccjit::context::new_rvalue): Add overload for
1757 * libgccjit.c (gcc_jit_context_new_binary_op): Strip off type
1758 qualifications when checking that both operands have same type.
1759 (gcc_jit_context_new_rvalue_from_vector): New API entrypoint.
1761 (LIBGCCJIT_HAVE_gcc_jit_context_new_rvalue_from_vector): New
1763 (gcc_jit_context_new_rvalue_from_vector): New API entrypoint.
1764 * libgccjit.map (LIBGCCJIT_ABI_10): New ABI tag.
1766 2017-09-28 David Malcolm <dmalcolm@redhat.com>
1768 * docs/topics/expressions.rst (Function calls): Add link to
1769 gcc_jit_context_new_function_ptr_type.
1770 (Function pointers): Convert to cross-references to
1771 function-pointers.rst, moving material there.
1772 * docs/topics/function-pointers.rst: New page.
1773 * docs/topics/index.rst: Add function-pointers.rst.
1774 * docs/topics/types.rst (Function pointer types): New section.
1775 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1777 2017-09-28 David Malcolm <dmalcolm@redhat.com>
1780 (gcc::jit::recording::function_type::is_same_type_as): New function.
1781 * jit-recording.h: In namespace gcc::jit::recording::
1782 (type::accepts_writes_from): Use is_same_type_as rather than pointer
1784 (type::is_same_type_as): New virtual function.
1785 (function_type::is_same_type_as): New override.
1787 2017-09-27 David Malcolm <dmalcolm@redhat.com>
1789 * docs/cp/topics/expressions.rst (Function pointers): New section.
1790 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_9): New tag.
1791 * docs/topics/expressions.rst (Function pointers): New section.
1792 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1793 * jit-common.h (class gcc::jit::recording::function_pointer): New
1795 * jit-playback.c (gcc::jit::playback::function::get_address): New
1797 * jit-playback.h (gcc::jit::playback::function::get_address): New
1799 * jit-recording.c: Within namespace gcc::jit::recording...
1800 (function::function): Initialize new field "m_fn_ptr_type".
1801 (function::get_address): New method.
1802 (function_pointer::replay_into): New method.
1803 (function_pointer::visit_children): New method.
1804 (function_pointer::make_debug_string): New method.
1805 (function_pointer::write_reproducer): New method.
1806 * jit-recording.h: Within namespace gcc::jit::recording...
1807 (function::get_address): New method.
1808 (function): Add field "m_fn_ptr_type".
1809 (class function_pointer): New subclass of rvalue.
1810 * libgccjit++.h (gccjit::function::get_address): New method.
1811 * libgccjit.c (gcc_jit_function_get_address): New function.
1812 * libgccjit.h (LIBGCCJIT_HAVE_gcc_jit_function_get_address): New
1814 (gcc_jit_function_get_address): New API entrypoint.
1815 * libgccjit.map (LIBGCCJIT_ABI_9): New tag.
1817 2017-09-14 David Malcolm <dmalcolm@redhat.com>
1820 * jit-builtins.c (matches_builtin): Ignore entries with a NULL
1823 2017-08-18 David Malcolm <dmalcolm@redhat.com>
1825 PR tree-optimization/46805
1826 * dummy-frontend.c (jit_langhook_parse_file): Handle vector types.
1828 2017-08-18 David Malcolm <dmalcolm@redhat.com>
1830 * jit-recording.c (class gcc::jit::reproducer): Rename field
1831 "m_identifiers" to "m_map_memento_to_identifier". Add field
1832 "m_set_identifiers" and struct hash_traits for it.
1833 (gcc::jit::reproducer::reproducer): Update for above.
1834 (convert_to_identifier): New function.
1835 (gcc::jit::reproducer::ensure_identifier_is_unique): New method.
1836 (gcc::jit::reproducer::make_identifier): Avoid appending the %p
1837 unless necessary for uniqueness. Update for field renaming.
1838 (gcc::jit::reproducer::get_identifier): Update for field renaming.
1840 2017-08-09 David Malcolm <dmalcolm@redhat.com>
1842 * docs/cp/topics/types.rst (Vector types): New section.
1843 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_8): New tag.
1844 * docs/topics/types.rst (gcc_jit_context_get_type): Fix typo in
1846 (Vector types): New section.
1847 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1848 * jit-playback.c (gcc::jit::playback::type::get_vector): New
1850 * jit-playback.h (gcc::jit::playback::type::get_vector): New
1852 * jit-recording.c: In namespace gcc::jit::recording::
1853 (type::get_vector): New method.
1854 (memento_of_get_aligned::write_reproducer): Fix typo
1856 (memento_of_get_vector::replay_into): New method.
1857 (memento_of_get_vector::make_debug_string): New method.
1858 (memento_of_get_vector::write_reproducer): New method.
1859 * jit-recording.h: In namespace gcc::jit::recording::
1860 (type::get_vector): New
1862 (class memento_of_get_vector): New class.
1863 * libgccjit++.h (gccjit::type::get_vector): New method.
1864 * libgccjit.c (gcc_jit_type_get_vector): New public entrypoint.
1865 * libgccjit.h (LIBGCCJIT_HAVE_gcc_jit_type_get_vector): New
1867 (gcc_jit_type_get_vector): New decl.
1868 * libgccjit.map (LIBGCCJIT_ABI_8): New ABI tag.
1870 2017-07-05 Richard Sandiford <richard.sandiford@linaro.org>
1871 Alan Hayward <alan.hayward@arm.com>
1872 David Sherwood <david.sherwood@arm.com>
1874 * dummy-frontend.c (jit_langhook_type_for_mode): Remove "enum" before
1877 2017-04-24 David Malcolm <dmalcolm@redhat.com>
1879 * docs/cp/topics/types.rst (gccjit::type::get_const): Remove
1881 (gccjit::type::get_aligned): Add.
1882 * docs/topics/compatibility.rst: Add LIBGCCJIT_ABI_7.
1883 * docs/topics/types.rst: Add gcc_jit_type_get_aligned.
1884 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1885 * jit-playback.c (gcc::jit::playback::type::get_aligned): New
1887 * jit-playback.h (gcc::jit::playback::type::get_aligned): New
1889 * jit-recording.c: Within namespace gcc::jit::recording...
1890 (type::get_aligned): New method.
1891 (memento_of_get_aligned::replay_into): New method.
1892 (memento_of_get_aligned::make_debug_string): New method.
1893 (memento_of_get_aligned::write_reproducer): New method.
1894 * jit-recording.h: Within namespace gcc::jit::recording...
1895 (type::get_aligned): New method.
1896 (type::accepts_writes_from): Strip off qualifications from
1897 this when comparing pointer equality.
1898 (decorated_type): New subclass of type, subsuming the
1899 commonality between memento_of_get_const and
1900 memento_of_get_volatile.
1901 (memento_of_get_const): Make a subclass of decorated_type,
1903 (memento_of_get_volatile): Likewise.
1904 (memento_of_get_aligned): Likewise.
1905 * libgccjit++.h: Within namespace gccjit...
1906 (type::get_const): New method.
1907 (type::get_aligned): New method.
1908 * libgccjit.c (gcc_jit_type_get_aligned): New function.
1909 * libgccjit.h (gcc_jit_type_get_aligned): New decl.
1910 * libgccjit.map (LIBGCCJIT_ABI_7): New
1911 (gcc_jit_type_get_aligned): Add.
1913 2017-01-19 David Malcolm <dmalcolm@redhat.com>
1915 * dummy-frontend.c (jit_langhook_type_for_size): Delete.
1916 (LANG_HOOKS_TYPE_FOR_SIZE): Don't redefine.
1918 2017-01-18 David Malcolm <dmalcolm@redhat.com>
1920 * dummy-frontend.c (jit_langhook_type_for_size): Implement, using
1921 lto's lto_type_for_size.
1923 2017-01-01 Jakub Jelinek <jakub@redhat.com>
1925 Update copyright years.
1927 2016-05-20 David Malcolm <dmalcolm@redhat.com>
1929 * docs/topics/compatibility.rst: Add LIBGCCJIT_ABI_6.
1930 * docs/topics/expressions.rst (Function calls): Add documentation
1931 of gcc_jit_rvalue_set_bool_require_tail_call.
1932 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1933 * jit-common.h (gcc::jit::recording::base_call): Add forward decl.
1934 * jit-playback.c: Within namespace gcc::jit::playback...
1935 (context::build_call) Add "require_tail_call" param and use it
1936 to set CALL_EXPR_MUST_TAIL_CALL.
1937 (context::new_call): Add "require_tail_call" param.
1938 (context::new_call_through_ptr): Likewise.
1939 * jit-playback.h: Within namespace gcc::jit::playback...
1940 (context::new_call: Add "require_tail_call" param.
1941 (context::new_call_through_ptr): Likewise.
1942 (context::build_call): Likewise.
1943 * jit-recording.c: Within namespace gcc::jit::recording...
1944 (base_call::base_call): New constructor.
1945 (base_call::write_reproducer_tail_call): New method.
1946 (call::call): Update for inheritance from base_call.
1947 (call::replay_into): Provide m_require_tail_call to call
1949 (call::write_reproducer): Call write_reproducer_tail_call.
1950 (call_through_ptr::call_through_ptr): Update for inheritance from
1952 (call_through_ptr::replay_into): Provide m_require_tail_call to call
1953 to new_call_through_ptr.
1954 (recording::call_through_ptr::write_reproducer): Call
1955 write_reproducer_tail_call.
1956 * jit-recording.h: Within namespace gcc::jit::recording...
1957 (rvalue::dyn_cast_base_call): New virtual function.
1958 (class base_call): New subclass of class rvalue.
1959 (class call): Inherit from base_call rather than directly from
1960 rvalue, moving get_precedence and m_args to base_call.
1961 (class call_through_ptr): Likewise.
1962 * libgccjit.c (gcc_jit_rvalue_set_bool_require_tail_call): New
1965 (LIBGCCJIT_HAVE_gcc_jit_rvalue_set_bool_require_tail_call): New
1967 (gcc_jit_rvalue_set_bool_require_tail_call): New function.
1968 * libgccjit.map (LIBGCCJIT_ABI_6): New.
1969 (gcc_jit_rvalue_set_bool_require_tail_call): Add.
1971 2016-05-17 David Malcolm <dmalcolm@redhat.com>
1973 * dummy-frontend.c: Include diagnostic.h.
1974 (jit_begin_diagnostic): New function.
1975 (jit_end_diagnostic): New function.
1976 (jit_langhook_init): Register jit_begin_diagnostic
1977 and jit_end_diagnostic with the global_dc.
1978 * jit-playback.c: Include diagnostic.h.
1979 (gcc::jit::playback::context::add_diagnostic): New method.
1980 * jit-playback.h (struct diagnostic_context): Add forward
1982 (gcc::jit::playback::context::add_diagnostic): New method.
1984 2016-05-17 David Malcolm <dmalcolm@redhat.com>
1986 * docs/topics/expressions.rst (Function calls): Document
1987 gcc_jit_context_new_call_through_ptr.
1988 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1990 2016-05-13 David Malcolm <dmalcolm@redhat.com>
1992 * jit-playback.h: Within namespace gcc:jit::playback...
1993 (compile_to_memory::postprocess): Mark with FINAL OVERRIDE.
1994 (compile_to_file::postprocess): Likewise.
1995 (function::finalizer): Likewise.
1996 (block::finalizer): Likewise.
1997 (source_file::finalizer): Likewise.
1998 (source_line::finalizer): Likewise.
1999 * jit-recording.c (gcc::jit::rvalue_usage_validator):: Likewise.
2000 * jit-recording.h: Within namespace gcc::jit::recording...
2001 (string::replay_into): Mark with FINAL OVERRIDE.
2002 (string::make_debug_string): Likewise.
2003 (string::write_reproducer): Likewise.
2004 (location::replay_into): Likewise.
2005 (location::dyn_cast_location): Likewise.
2006 (location::make_debug_string): Likewise.
2007 (location::write_reproducer): Likewise.
2008 (memento_of_get_type::dereference): Likewise.
2009 (memento_of_get_type::accepts_writes_from): Likewise.
2010 (memento_of_get_type::is_int): Likewise.
2011 (memento_of_get_type::is_float): Likewise.
2012 (memento_of_get_type::is_bool): Likewise.
2013 (memento_of_get_type::is_pointer): Likewise.
2014 (memento_of_get_type::is_array): Likewise.
2015 (memento_of_get_type::is_void): Likewise.
2016 (memento_of_get_type::replay_into): Likewise.
2017 (memento_of_get_type::make_debug_string): Likewise.
2018 (memento_of_get_type::write_reproducer): Likewise.
2019 (memento_of_get_pointer::dereference): Likewise.
2020 (memento_of_get_pointer::accepts_writes_from): Likewise.
2021 (memento_of_get_pointer::replay_into): Likewise.
2022 (memento_of_get_pointer::is_int): Likewise.
2023 (memento_of_get_pointer::is_float): Likewise.
2024 (memento_of_get_pointer::is_bool): Likewise.
2025 (memento_of_get_pointer::is_pointer): Likewise.
2026 (memento_of_get_pointer::is_array): Likewise.
2027 (memento_of_get_pointer::make_debug_string): Likewise.
2028 (memento_of_get_pointer::write_reproducer): Likewise.
2029 (memento_of_get_const::dereference): Likewise.
2030 (memento_of_get_const::accepts_writes_from): Likewise.
2031 (memento_of_get_const::unqualified): Likewise.
2032 (memento_of_get_const::is_int): Likewise.
2033 (memento_of_get_const::is_float): Likewise.
2034 (memento_of_get_const::is_bool): Likewise.
2035 (memento_of_get_const::is_pointer): Likewise.
2036 (memento_of_get_const::is_array): Likewise.
2037 (memento_of_get_const::void replay_into): Likewise;
2038 (memento_of_get_const::make_debug_string): Likewise.
2039 (memento_of_get_const::write_reproducer): Likewise.
2040 (memento_of_get_volatile::dereference): Likewise.
2041 (memento_of_get_volatile::unqualified): Likewise.
2042 (memento_of_get_volatile::is_int): Likewise.
2043 (memento_of_get_volatile::is_float): Likewise.
2044 (memento_of_get_volatile::is_bool): Likewise.
2045 (memento_of_get_volatile::is_pointer): Likewise.
2046 (memento_of_get_volatile::is_array): Likewise.
2047 (memento_of_get_volatile::replay_into): Likewise;
2048 (memento_of_get_volatile::make_debug_string): Likewise.
2049 (memento_of_get_volatile::write_reproducer): Likewise.
2050 (array_type::dereference): Likewise.
2051 (array_type::is_int): Likewise.
2052 (array_type::is_float): Likewise.
2053 (array_type::is_bool): Likewise.
2054 (array_type::is_pointer): Likewise.
2055 (array_type::is_array): Likewise.
2056 (array_type::replay_into): Likewise;
2057 (array_type::make_debug_string): Likewise.
2058 (array_type::write_reproducer): Likewise.
2059 (function_type::dereference): Likewise.
2060 (function_type::function_dyn_cast_function_type): Likewise.
2061 (function_type::function_as_a_function_type): Likewise.
2062 (function_type::is_int): Likewise.
2063 (function_type::is_float): Likewise.
2064 (function_type::is_bool): Likewise.
2065 (function_type::is_pointer): Likewise.
2066 (function_type::is_array): Likewise.
2067 (function_type::replay_into): Likewise;
2068 (function_type::make_debug_string): Likewise.
2069 (function_type::write_reproducer): Likewise.
2070 (field::replay_into): Likewise;
2071 (field::write_to_dump): Likewise.
2072 (field::make_debug_string): Likewise.
2073 (field::write_reproducer): Likewise.
2074 (compound_type::dereference): Likewise.
2075 (compound_type::is_int): Likewise.
2076 (compound_type::is_float): Likewise.
2077 (compound_type::is_bool): Likewise.
2078 (compound_type::is_pointer): Likewise.
2079 (compound_type::is_array): Likewise.
2080 (compound_type::has_known_size): Likewise.
2081 (struct_::dyn_cast_struct): Likewise.
2082 (struct_::replay_into): Likewise.
2083 (struct_::access_as_type): Likewise.
2084 (struct_::make_debug_string): Likewise.
2085 (struct_::write_reproducer): Likewise.
2086 (fields::replay_into): Likewise.
2087 (fields::write_to_dump): Likewise.
2088 (fields::make_debug_string): Likewise.
2089 (fields::write_reproducer): Likewise.
2090 (union_::replay_into): Likewise.
2091 (union_::make_debug_string): Likewise.
2092 (union_::write_reproducer): Likewise.
2093 (lvalue::access_as_rvalue): Mark with OVERRIDE.
2094 (param::replay_into): Mark with FINAL OVERRIDE.
2095 (param::visit_children): Likewise.
2096 (param::dyn_cast_param): Likewise.
2097 (param::access_as_rvalue): Likewise.
2098 (param::access_as_lvalue): Likewise.
2099 (param::make_debug_string): Likewise.
2100 (param::write_reproducer): Likewise.
2101 (param::get_precedence): Likewise.
2102 (function::replay_into): Likewise.
2103 (function::write_to_dump): Likewise.
2104 (function::make_debug_string): Likewise.
2105 (function::write_reproducer): Likewise.
2106 (block::write_to_dump): Likewise.
2107 (block::make_debug_string): Likewise.
2108 (block::write_reproducer): Likewise.
2109 (block::replay_into): Likewise.
2110 (global::replay_into): Likewise;
2111 (global::visit_children): Likewise.
2112 (global::write_to_dump): Likewise.
2113 (global::make_debug_string): Likewise.
2114 (global::write_reproducer): Likewise.
2115 (global::get_precedence): Likewise.
2116 (memento_of_new_rvalue_from_const::replay_into): Likewise.
2117 (memento_of_new_rvalue_from_const::visit_children): Likewise.
2118 (memento_of_new_rvalue_from_const::is_constant): Likewise.
2119 (memento_of_new_rvalue_from_const::get_wide_int): Likewise.
2120 (memento_of_new_rvalue_from_const::make_debug_string): Likewise.
2121 (memento_of_new_rvalue_from_const::write_reproducer): Likewise.
2122 (memento_of_new_rvalue_from_const::get_precedence): Likewise.
2123 (memento_of_new_string_literal::replay_into): Likewise.
2124 (memento_of_new_string_literal::visit_children): Likewise.
2125 (memento_of_new_string_literal::make_debug_string): Likewise.
2126 (memento_of_new_string_literal::write_reproducer): Likewise.
2127 (memento_of_new_string_literal::get_precedence): Likewise.
2128 (unary_op::replay_into): Likewise.
2129 (unary_op::visit_children): Likewise.
2130 (unary_op::make_debug_string): Likewise.
2131 (unary_op::write_reproducer): Likewise.
2132 (unary_op::get_precedence): Likewise.
2133 (binary_op::replay_into): Likewise.
2134 (binary_op::visit_children): Likewise.
2135 (binary_op::make_debug_string): Likewise.
2136 (binary_op::write_reproducer): Likewise.
2137 (binary_op::get_precedence): Likewise.
2138 (comparison::replay_into): Likewise.
2139 (comparison::visit_children): Likewise.
2140 (comparison::make_debug_string): Likewise.
2141 (comparison::write_reproducer): Likewise.
2142 (comparison::get_precedence): Likewise.
2143 (cast::replay_into): Likewise.
2144 (cast::visit_children): Likewise.
2145 (cast::make_debug_string): Likewise.
2146 (cast::write_reproducer): Likewise.
2147 (cast::get_precedence): Likewise.
2148 (call::replay_into): Likewise.
2149 (call::visit_children): Likewise.
2150 (call::make_debug_string): Likewise.
2151 (call::write_reproducer): Likewise.
2152 (call::get_precedence): Likewise.
2153 (call_through_ptr::replay_into): Likewise.
2154 (call_through_ptr::visit_children): Likewise.
2155 (call_through_ptr::make_debug_string): Likewise.
2156 (call_through_ptr::write_reproducer): Likewise.
2157 (call_through_ptr::get_precedence): Likewise.
2158 (array_access::replay_into): Likewise.
2159 (array_access::visit_children): Likewise.
2160 (array_access::make_debug_string): Likewise.
2161 (array_access::write_reproducer): Likewise.
2162 (array_access::get_precedence): Likewise.
2163 (access_field_of_lvalue::replay_into): Likewise.
2164 (access_field_of_lvalue::visit_children): Likewise.
2165 (access_field_of_lvalue::make_debug_string): Likewise.
2166 (access_field_of_lvalue::write_reproducer): Likewise.
2167 (access_field_of_lvalue::get_precedence): Likewise.
2168 (access_field_rvalue::replay_into): Likewise.
2169 (access_field_rvalue::visit_children): Likewise.
2170 (access_field_rvalue::make_debug_string): Likewise.
2171 (access_field_rvalue::write_reproducer): Likewise.
2172 (access_field_rvalue::get_precedence): Likewise.
2173 (dereference_field_rvalue::replay_into): Likewise.
2174 (dereference_field_rvalue::visit_children): Likewise.
2175 (dereference_field_rvalue::make_debug_string): Likewise.
2176 (dereference_field_rvalue::write_reproducer): Likewise.
2177 (dereference_field_rvalue::get_precedence): Likewise.
2178 (dereference_rvalue::replay_into): Likewise.
2179 (dereference_rvalue::visit_children): Likewise.
2180 (dereference_rvalue::make_debug_string): Likewise.
2181 (dereference_rvalue::write_reproducer): Likewise.
2182 (dereference_rvalue::get_precedence): Likewise.
2183 (get_address_of_lvalue::replay_into): Likewise.
2184 (get_address_of_lvalue::visit_children): Likewise.
2185 (get_address_of_lvalue::make_debug_string): Likewise.
2186 (get_address_of_lvalue::write_reproducer): Likewise.
2187 (get_address_of_lvalue::get_precedence): Likewise.
2188 (local::replay_into): Likewise.
2189 (local::visit_children): Likewise.
2190 (local::write_to_dump): Likewise.
2191 (local::make_debug_string): Likewise.
2192 (local::write_reproducer): Likewise.
2193 (local::get_precedence): Likewise.
2194 (statement::write_to_dump): Likewise.
2195 (eval::replay_into): Likewise.
2196 (eval::make_debug_string): Likewise.
2197 (eval::write_reproducer): Likewise.
2198 (assignment::replay_into): Likewise.
2199 (assignment::make_debug_string): Likewise.
2200 (assignment::write_reproducer): Likewise.
2201 (assignment_op::replay_into): Likewise.
2202 (assignment_op::make_debug_string): Likewise.
2203 (assignment_op::write_reproducer): Likewise.
2204 (comment::replay_into): Likewise.
2205 (comment::make_debug_string): Likewise.
2206 (comment::write_reproducer): Likewise.
2207 (conditional::replay_into): Likewise.
2208 (conditional::get_successor_blocks): Likewise.
2209 (conditional::make_debug_string): Likewise.
2210 (conditional::write_reproducer): Likewise.
2211 (jump::replay_into): Likewise.
2212 (jump::get_successor_blocks): Likewise.
2213 (jump::make_debug_string): Likewise.
2214 (jump::write_reproducer): Likewise.
2215 (return_::replay_into): Likewise.
2216 (return_::get_successor_blocks): Likewise.
2217 (return_::make_debug_string): Likewise.
2218 (return_::write_reproducer): Likewise.
2219 (case_::replay_into): Likewise.
2220 (case_::write_reproducer): Likewise.
2221 (case_::make_debug_string): Likewise.
2222 (switch_::replay_into): Likewise.
2223 (switch_::get_successor_blocks): Likewise.
2224 (switch_::make_debug_string): Likewise.
2225 (switch_::write_reproducer): Likewise.
2227 2016-02-08 David Malcolm <dmalcolm@redhat.com>
2229 * dummy-frontend.c (jit_langhook_init): Remove
2230 second argument to build_common_tree_nodes to
2233 2016-01-23 Iain Buclaw <ibuclaw@gdcproject.org>
2235 * jit-playback.c: Include pthread.h.
2237 2016-01-19 David Malcolm <dmalcolm@redhat.com>
2240 * jit-playback.c (gcc::jit::playback::compile_to_file::postprocess):
2241 Potentially add the temporary artifact to the tempdir's list of
2242 tempfiles needing additional cleanup.
2243 (gcc::jit::playback::context::extract_any_requested_dumps): Likewise
2245 * jit-tempdir.c (gcc::jit::tempdir::~tempdir): Clean up additional
2247 * jit-tempdir.h (gcc::jit::tempdir::add_temp_file): New method.
2248 (gcc::jit::tempdir::m_tempfiles): New field.
2249 * docs/cp/intro/tutorial04.rst: Update for changes to toyvm.cc.
2250 * docs/examples/tut04-toyvm/toyvm.cc (class compilation_result):
2252 (toyvm_function::compile): Change return type from function ptr
2253 to a compilation_result.
2254 (toyvm_function::get_function_name): New accessor.
2255 (toyvm_function::m_funcname): New field.
2256 (get_function_name): Convert to...
2257 (toyvm_function::make_function_name): ...this new method.
2258 (toyvm_function::parse): Call make_function_name.
2259 (toyvm_function::compile): Convert return type from function ptr
2260 to a compilation_result. Use get_function_name.
2261 (compilation_state::compile): Convert return type from
2262 gcc_jit_result * to a compilation_result.
2263 (test_script): Update for above changes, extracting the code from
2264 the compilation_result.
2266 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2268 2016-01-04 Jakub Jelinek <jakub@redhat.com>
2270 Update copyright years.
2272 2015-11-11 Andrew MacLeod <amacleod@redhat.com>
2274 * dummy-frontend.c: Remove unused header files.
2275 * jit-builtins.c: Likewise.
2276 * jit-playback.c: Likewise.
2277 * jit-recording.c: Likewise.
2278 * jit-spec.c: Likewise.
2279 * libgccjit.c: Likewise.
2281 2015-11-07 Richard Sandiford <richard.sandiford@arm.com>
2283 * jit-builtins.c: Don't undef DEF_BUILTIN.
2285 2015-10-29 Andrew MacLeod <amacleod@redhat.com>
2287 * dummy-frontend.c: Reorder #include's and remove duplicates.
2288 * jit-builtins.c: Likewise.
2289 * jit-playback.c: Likewise.
2290 * jit-recording.c: Likewise.
2291 * libgccjit.c: Likewise.
2293 2015-10-13 Jakub Jelinek <jakub@redhat.com>
2295 * jit-builtins.c (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10,
2296 DEF_FUNCTION_TYPE_11): Define.
2297 * jit-builtins.h (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10,
2298 DEF_FUNCTION_TYPE_11): Define.
2300 2015-09-30 Thomas Schwinge <thomas@codesourcery.com>
2301 Ulrich Drepper <drepper@gmail.com>
2303 * jit-builtins.h: Undefine DEF_FUNCTION_TYPE_VAR_6 after use.
2305 2015-09-30 Matthias Klose <doko@ubuntu.com>
2307 * jit-builtins.h Define DEF_FUNCTION_TYPE_VAR_6,
2308 remove DEF_FUNCTION_TYPE_VAR_11.
2309 * jit-builtins.c (builtins_manager::make_type): Define and handle
2310 DEF_FUNCTION_TYPE_VAR_6, remove DEF_FUNCTION_TYPE_VAR_11.
2312 2015-08-25 David Malcolm <dmalcolm@redhat.com>
2314 * docs/cp/topics/contexts.rst
2315 (gccjit::context::set_bool_use_external_driver): New.
2316 * docs/internals/test-hello-world.exe.log.txt: Update.
2317 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_5): New.
2318 * docs/topics/contexts.rst
2319 (gcc_jit_context_set_bool_use_external_driver): New.
2320 * jit-common.h (enum inner_bool_option): Add
2321 INNER_BOOL_OPTION_USE_EXTERNAL_DRIVER.
2322 * jit-playback.c (gcc_driver_name): New global.
2323 (gcc:jit::playback::context::invoke_driver): Split out second
2325 (gcc::jit::playback::context::invoke_embedded_driver): ...this new
2327 (gcc::jit::playback::context::invoke_external_driver): ...this new
2330 (gcc::jit::playback::context::get_inner_bool_option): New.
2331 (gcc::jit::playback::context::invoke_embedded_driver): New.
2332 (gcc::jit::playback::context::invoke_external_driver): New.
2333 * jit-recording.c (inner_bool_option_reproducer_strings):
2334 Add entry for INNER_BOOL_OPTION_USE_EXTERNAL_DRIVER.
2336 (gccjit::context::set_bool_use_external_driver): New.
2337 * libgccjit.c (gcc_jit_context_set_bool_use_external_driver): New.
2338 * libgccjit.h (gcc_jit_context_set_bool_use_external_driver): New.
2339 (LIBGCCJIT_HAVE_gcc_jit_context_set_bool_use_external_driver):
2341 * libgccjit.map (LIBGCCJIT_ABI_5): New.
2342 * notes.txt: Show invocation of embedded copy of driver.
2343 * docs/internals/test-hello-world.exe.log.txt: Update
2345 2015-08-13 David Malcolm <dmalcolm@redhat.com>
2347 * jit-playback.c (invoke_driver): On OS X, add
2348 "-Wl,-undefined,dynamic_lookup" to the driver arguments.
2350 2015-08-03 David Malcolm <dmalcolm@redhat.com>
2352 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_4): New.
2353 * docs/topics/contexts.rst (GCC_JIT_BOOL_OPTION_DUMP_SUMMARY):
2354 We no longer show a profile.
2355 * docs/topics/index.rst (Topic Reference): Add performance.rst.
2356 * docs/topics/performance.rst: New file.
2357 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2358 * jit-playback.c (gcc::jit::playback::context::compile): Add timer
2359 param when constructing the "toplev" instance.
2360 (gcc::jit::playback::context::acquire_mutex): Add timer param when
2361 constructing auto_timevar instance.
2362 (gcc::jit::playback::context::make_fake_args): If we have a timer,
2363 add "-ftime-report".
2364 (gcc::jit::playback::context::invoke_driver): Add timer param when
2365 constructing auto_timevar instance.
2366 (gcc::jit::playback::context::dlopen_built_dso): Likewise.
2367 * jit-playback.h (gcc::jit::playback::context::get_timer): New accessor.
2368 * jit-recording.c: Include timevar.h.
2369 (gcc::jit::recording::context::context): Initialize field "m_timer".
2370 * jit-recording.h: Add forward declaration of class timer.
2371 (gcc::jit::recording::context::set_timer): New method.
2372 (gcc::jit::recording::context::get_timer): New method.
2373 (gcc::jit::recording::context::m_timer): New field.
2374 * libgccjit++.h (gccjit::timer): New class.
2375 (gccjit::auto_time): New class.
2376 (gccjit::context::set_timer): New method.
2377 (gccjit::context::get_timer): New.
2378 (gccjit::timer::timer): New.
2379 (gccjit::timer::push): New.
2380 (gccjit::timer::pop): New.
2381 (timer::print): New.
2382 (timer::get_inner_timer): New.
2383 (timer::release): New.
2384 (auto_time::auto_time): New.
2385 (auto_time::~auto_time): New.
2386 * libgccjit.c: Include timevar.h.
2387 (struct gcc_jit_timer): New.
2388 (gcc_jit_timer_new): New function.
2389 (gcc_jit_timer_release): New function.
2390 (gcc_jit_context_set_timer): New function.
2391 (gcc_jit_context_get_timer): New function.
2392 (gcc_jit_timer_push): New function.
2393 (gcc_jit_timer_pop): New function.
2394 (gcc_jit_timer_print): New function.
2395 * libgccjit.h (LIBGCCJIT_HAVE_TIMING_API): New macro.
2396 (gcc_jit_timer): New typedef.
2397 (gcc_jit_timer_new): New function.
2398 (gcc_jit_timer_release): New function.
2399 (gcc_jit_context_set_timer): New function.
2400 (gcc_jit_context_get_timer): New function.
2401 (gcc_jit_timer_push): New function.
2402 (gcc_jit_timer_pop): New function.
2403 (gcc_jit_timer_print): New function.
2404 * libgccjit.map (LIBGCCJIT_ABI_4): New.
2405 (gcc_jit_timer_new): New function.
2406 (gcc_jit_timer_release): New function.
2407 (gcc_jit_context_set_timer): New function.
2408 (gcc_jit_context_get_timer): New function.
2409 (gcc_jit_timer_push): New function.
2410 (gcc_jit_timer_pop): New function.
2411 (gcc_jit_timer_print): New function.
2413 2015-07-23 David Malcolm <dmalcolm@redhat.com>
2415 * jit-playback.c (invoke_driver): Convert local "argvec"
2416 to an auto_argvec, so that it owns copies of the strings,
2417 rather than borrows them, updating ADD_ARG to use xstrdup
2418 and special-casing the NULL terminator to avoid
2419 xstrdup (NULL). Call add_multilib_driver_arguments at the front
2421 (MULTILIB_DEFAULTS): Provide a default definition.
2422 (multilib_defaults_raw): New constant array.
2423 (gcc::jit::playback::context::add_multilib_driver_arguments): New
2426 (gcc::jit::playback::context::add_multilib_driver_arguments): New
2428 * docs/internals/test-hello-world.exe.log.txt: Update.
2429 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2431 2015-07-16 David Malcolm <dmalcolm@redhat.com>
2433 * docs/internals/index.rst (Overview of code structure): Add note
2434 that the implementation is in C++, despite the .c extension.
2435 (Submitting patches): New subsection.
2436 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2438 2015-07-09 Andrew MacLeod <amacleod@redhat.com>
2440 * dummy-frontend.c: Adjust includes for flags.h changes.
2441 * jit-common.h: Likewise.
2442 * jit-playback.c: Likewise.
2444 2015-07-08 David Malcolm <dmalcolm@redhat.com>
2447 * libgccjit.c (gcc_jit_context_new_field): Show name of field in
2448 "unknown size" error message.
2449 (gcc_jit_struct_set_fields): Show name of struct in error message.
2450 (gcc_jit_context_new_global): Show name of global in
2451 "unknown size" error message.
2452 (gcc_jit_function_new_local): Likewise for local.
2454 2015-07-07 Andrew MacLeod <amacleod@redhat.com>
2456 * dummy-frontend.c: Adjust includes.
2457 * jit-common.h: Likewise.
2458 * jit-playback.c: Likewise.
2460 2015-07-07 David Malcolm <dmalcolm@redhat.com>
2463 * jit-recording.h: Within namespace gcc:jit::recording...
2464 (type::has_known_size): New virtual function.
2465 (struct_has_known_size): New function.
2466 * libgccjit.c (gcc_jit_context_new_field): Verify that the type
2468 (gcc_jit_context_new_global): Likewise.
2469 (gcc_jit_function_new_local): Likewise.
2471 2015-07-07 David Malcolm <dmalcolm@redhat.com>
2474 * dummy-frontend.c (jit_langhook_type_for_mode): Ensure that we
2475 handle modes QI, HI, SI, DI, TI.
2477 2015-07-01 David Malcolm <dmalcolm@redhat.com>
2480 * jit-playback.c (jit_mark_addressable): New function.
2481 (gcc::jit::playback::lvalue::get_address): Call
2482 jit_mark_addressable on the underlying tree.
2484 2015-07-01 David Malcolm <dmalcolm@redhat.com>
2486 * docs/topics/types.rst (gcc_jit_context_new_union_type): Add
2488 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2490 2015-07-01 David Malcolm <dmalcolm@redhat.com>
2492 * docs/topics/contexts.rst (gcc_jit_context_set_bool_option):
2493 Clarify lack of lifetime requirements on (const char *) parameter.
2494 * docs/topics/expressions.rst
2495 (gcc_jit_context_new_string_literal): Likewise.
2496 (gcc_jit_context_new_global): Likewise.
2497 * docs/topics/functions.rst (gcc_jit_context_new_param): Likewise.
2498 (gcc_jit_context_new_function): Likewise.
2499 (gcc_jit_function_new_block): Likewise.
2500 (gcc_jit_block_add_comment): Likewise.
2501 * docs/topics/locations.rst (gcc_jit_context_new_location):
2503 * docs/topics/types.rst (gcc_jit_context_new_field): Likewise.
2504 (gcc_jit_context_new_struct_type): Likewise.
2505 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2507 2015-06-30 David Malcolm <dmalcolm@redhat.com>
2509 * docs/cp/topics/functions.rst (Blocks): Add switch statements to
2510 list of ways to terminate a block.
2511 (gccjit::block::end_with_switch): Add function description.
2512 (gccjit::case_): Add class.
2513 (gccjit::context::new_case): Add function description.
2514 * docs/cp/topics/objects.rst: Add "case_" to class hierarchy.
2515 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_3): New.
2516 * docs/topics/functions.rst (Blocks): Add switch statements to
2517 list of ways to terminate a block.
2518 (gcc_jit_block_end_with_switch): Add function description.
2519 (gcc_jit_case): Add type.
2520 (gcc_jit_context_new_case): Add function description.
2521 (gcc_jit_case_as_object): Add function description.
2522 * docs/topics/objects.rst: Add gcc_jit_case to class hierarchy.
2523 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2524 * jit-common.h (gcc::jit::recording::case_): Add forward decl.
2525 (gcc::jit::playback::case_): Add forward decl.
2526 * jit-playback.c (add_case): New function.
2527 (gcc::jit::playback::block::add_switch): New function.
2528 * jit-playback.h (gcc::jit::playback::case_): New struct.
2529 (gcc::jit::playback::block::get_function): New method.
2530 (gcc::jit::playback::block::add_switch): New method.
2531 * jit-recording.c: Within namespace gcc::jit...
2532 (recording::context::new_case): New method.
2533 (recording::function::validate): Update for change to
2534 get_successor_blocks.
2535 (recording::block::end_with_switch): New method.
2536 (recording::block::get_successor_blocks): Update to support an
2537 arbitrary number of successor blocks.
2538 (recording::block::dump_edges_to_dot): Likewise.
2539 (memento_of_new_rvalue_from_const <int>::get_wide_int): New.
2540 (memento_of_new_rvalue_from_const <long>::get_wide_int): New.
2541 (memento_of_new_rvalue_from_const <double>::get_wide_int): New.
2542 (memento_of_new_rvalue_from_const <void *>::get_wide_int): New.
2543 (recording::statement::get_successor_blocks): Update to support an
2544 arbitrary number of successor blocks.
2545 (recording::conditional::get_successor_blocks): Likewise.
2546 (recording::jump::get_successor_blocks): Likewise.
2547 (recording::return_::get_successor_blocks): Likewise.
2548 (recording::case_::write_reproducer): New.
2549 (recording::case_::make_debug_string): New.
2550 (recording::switch_::switch_): New.
2551 (recording::switch_::replay_into): New.
2552 (recording::switch_::get_successor_blocks): New.
2553 (recording::switch_::make_debug_string): New.
2554 (recording::switch_::write_reproducer): New.
2555 * jit-recording.h: Within namespace gcc::jit::recording...
2556 (context::new_case): New.
2557 (rvalue::is_constant): New.
2558 (rvalue::get_wide_int): New.
2559 (block::end_with_switch): New.
2560 (block::get_successor_blocks): Update to support an arbitrary
2561 number of successor blocks.
2562 (memento_of_new_rvalue_from_const::is_constant): New.
2563 (memento_of_new_rvalue_from_const::get_wide_int): New.
2564 (statement::get_successor_blocks): Update to support an arbitrary
2565 number of successor blocks.
2566 (conditional::get_successor_blocks): Likewise.
2567 (jump::get_successor_blocks): Likewise.
2568 (return_::get_successor_blocks): Likewise.
2569 (case_): New subclass of memento.
2570 (switch_): New subclass of statement.
2571 * libgccjit++.h (gccjit::case_): New subclass of gccjit::object.
2572 (gccjit::context::new_case): New method.
2573 (gccjit::block::end_with_switch): New method.
2574 (gccjit::case_::case): New ctors.
2575 (gccjit::case_::get_inner_case): New method.
2576 * libgccjit.c: Include "typed-splay-tree.h"
2577 (struct gcc_jit_case): New.
2578 (gcc_jit_context_new_case): New function.
2579 (gcc_jit_case_as_object): New function.
2580 (valid_dest_for_switch): New function.
2581 (valid_case_for_switch): New function.
2582 (class api_call_validator): New class.
2583 (class case_range_validator): New class.
2584 (case_range_validator::case_range_validator): New.
2585 (case_range_validator::validate): New.
2586 (case_range_validator::case_compare): New.
2587 (case_range_validator::get_wide_int): new.
2588 (gcc_jit_block_end_with_switch): New.
2589 * libgccjit.h: Add gcc_jit_case to class hierarchy comment.
2590 (gcc_jit_case): New typedef.
2591 (gcc_jit_context_new_case): New function.
2592 (gcc_jit_case_as_object): New function.
2593 (gcc_jit_block_end_with_switch): New function.
2594 (LIBGCCJIT_HAVE_SWITCH_STATEMENTS): New.
2595 * libgccjit.map: Add gcc_jit_block_end_with_switch,
2596 gcc_jit_case_as_object and gcc_jit_context_new_case.
2598 2015-06-30 David Malcolm <dmalcolm@redhat.com>
2601 * docs/cp/topics/contexts.rst
2602 (gccjit::context::set_bool_allow_unreachable_blocks): New.
2603 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_2): New.
2604 * docs/topics/contexts.rst (Options): Add notes discussing the
2605 transition from enums to entrypoints for new options.
2606 (gcc_jit_context_set_bool_allow_unreachable_blocks): New.
2607 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2608 * jit-common.h (gcc::jit::inner_bool_option): New enum.
2609 * jit-recording.c: Within namespace gcc::jit...
2610 (recording::context::context): Handle m_inner_bool_options.
2611 (recording::context::set_inner_bool_option): New.
2612 (inner_bool_option_reproducer_strings): New.
2613 (recording::context::log_all_options): Log the "inner" bool
2615 (recording::context::log_inner_bool_option): New.
2616 (recording::context::dump_reproducer_to_file): Write initializers
2617 for "inner" bool options.
2618 (recording::function::validate): Don't check for block
2619 reachability if INNER_BOOL_OPTION_ALLOW_UNREACHABLE_BLOCKS is set.
2620 * jit-recording.h: Within namespace gcc::jit...
2621 (recording::context::set_inner_bool_option): New.
2622 (recording::context::get_inner_bool_option): New.
2623 (recording::context::log_inner_bool_option): New.
2624 (recording::context::m_inner_bool_options): New.
2626 (gccjit::context::set_bool_allow_unreachable_blocks): New.
2628 (gcc_jit_context_set_bool_allow_unreachable_blocks): New.
2629 * libgccjit.h: Add note about options present in the
2630 initial release of libgccjit.
2631 (gcc_jit_context_set_bool_allow_unreachable_blocks): New API
2633 (LIBGCCJIT_HAVE_gcc_jit_context_set_bool_allow_unreachable_blocks):
2635 * libgccjit.map (LIBGCCJIT_ABI_2): New, containing...
2636 (gcc_jit_context_set_bool_allow_unreachable_blocks): ...this new
2639 2015-06-30 David Malcolm <dmalcolm@redhat.com>
2642 * docs/cp/topics/contexts.rst (Additional command-line options):
2644 * docs/topics/compatibility.rst: New file.
2645 * docs/topics/contexts.rst (Additional command-line options): New
2647 * docs/topics/index.rst: Add compatibility.rst.
2648 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2649 * jit-playback.c (make_fake_args): Add call to
2650 append_command_line_options.
2651 * jit-recording.c: Within namespace gcc::jit...
2652 (recording::context::~context): Free the optnames within
2653 m_command_line_options.
2654 (recording::context::set_bool_option): Likewise.
2655 (recording::context::add_command_line_option): New method.
2656 (recording::context::append_command_line_options): New method.
2657 (recording::context::dump_reproducer_to_file): Add command-line
2659 * jit-recording.h: Within namespace gcc::jit...
2660 (recording::context::add_command_line_option): New method.
2661 (recording::context::append_command_line_options): New method.
2662 (recording::context::m_command_line_options): New field.
2663 * libgccjit++.h (gccjit::context::add_command_line_option): New
2665 * libgccjit.c (gcc_jit_context_add_command_line_option): New API
2667 * libgccjit.h (gcc_jit_context_add_command_line_option): New API
2669 (LIBGCCJIT_HAVE_gcc_jit_context_add_command_line_option): New
2671 * libgccjit.map: Put existing symbols within LIBGCCJIT_ABI_0; add
2672 LIBGCCJIT_ABI_1 and gcc_jit_context_add_command_line_option.
2674 2015-06-30 David Malcolm <dmalcolm@redhat.com>
2677 (gcc::jit::recording::context::dump_reproducer_to_file):
2678 Add pragma to generated reproducers to disable -Wunused-variable.
2679 Fix handling of NULL string options.
2681 2015-06-30 David Malcolm <dmalcolm@redhat.com>
2683 * docs/cp/topics/expressions.rst: Remove stray semicolon.
2684 * docs/cp/topics/functions.rst: Remove stray backslash.
2685 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2687 2015-06-25 Andrew MacLeod <amacleod@redhat.com>
2689 * dummy-frontend.c: Remove ipa-ref.h and plugin-api.h from include list.
2690 * jit-playback.c: Likewise.
2692 2015-06-25 Andrew Macleod <amacleod@redhat.com>
2694 * jit-common.h: Don't include alias.h.
2696 2015-06-17 David Malcolm <dmalcolm@redhat.com>
2698 * libgccjit.c (gcc_jit_lvalue_access_field): Verify that the field
2699 is for the correct struct.
2700 (gcc_jit_rvalue_access_field): Likewise.
2702 2015-06-17 Andrew MacLeod <amacleod@redhat.com>
2704 * dummy-frontend.c: Do not include input.h, line-map.h or is-a.h.
2705 * jit-common.h: Likewise.
2706 * jit-playback.c: Likewise.
2708 2015-06-16 David Malcolm <dmalcolm@redhat.com>
2711 * jit-recording.c: Within namespace gcc::jit::recording::
2712 (rvalue::get_debug_string_parens): New function.
2713 (binary_op::make_debug_string): Update to mimic C precedence
2715 (binary_op_precedence): New array.
2716 (binary_op::get_precedence): New function.
2717 (comparison::make_debug_string): Update to mimic C precedence
2719 (comparison_precedence): New array.
2720 (comparison::get_precedence): New function.
2721 (cast::make_debug_string): Update to mimic C precedence rules.
2722 (call::make_debug_string): Likewise.
2723 (call_through_ptr::make_debug_string): Likewise.
2724 (array_access::make_debug_string): Likewise.
2725 (access_field_of_lvalue::make_debug_string): Likewise.
2726 (access_field_rvalue::make_debug_string): Likewise.
2727 (dereference_field_rvalue::make_debug_string): Likewise.
2728 (dereference_rvalue::make_debug_string): Likewise.
2729 (get_address_of_lvalue::make_debug_string): Likewise.
2730 * jit-recording.h: Within namespace gcc::jit::recording::
2731 (precedence): New enum.
2732 (rvalue::rvalue): Initialize field "m_parenthesized_string".
2733 (rvalue::get_debug_string_parens): New method.
2734 (rvalue::get_precedence): New pure virtual function.
2735 (rvalue::m_parenthesized_string): New field.
2736 (param::get_precedence): New function.
2737 (global::get_precedence): New function.
2738 (memento_of_new_rvalue_from_const::get_precedence): New function.
2739 (memento_of_new_string_literal::get_precedence): New function.
2740 (unary_op::get_precedence): New function.
2741 (binary_op::get_precedence): New function.
2742 (comparison::get_precedence): New function.
2743 (cast::get_precedence): New function.
2744 (call::get_precedence): New function.
2745 (call_through_ptr::get_precedence): New function.
2746 (array_access::get_precedence): New function.
2747 (access_field_of_lvalue::get_precedence): New function.
2748 (access_field_rvalue::get_precedence): New function.
2749 (dereference_field_rvalue::get_precedence): New function.
2750 (dereference_rvalue::get_precedence): New function.
2751 (get_address_of_lvalue::get_precedence): New function.
2752 (local::get_precedence): New function.
2754 2015-06-09 Matthias Klose <doko@ubuntu.com>
2756 * Make-lang.in (jit.install-common): Install headers using INSTALL_DATA.
2758 2015-06-08 Andrew MacLeod <amacleod@redhat.com>
2760 * dummy-frontend.c : Adjust include files.
2761 * jit-common.h : Likewise.
2762 * jit-playback.c : Likewise.
2764 2015-06-05 David Malcolm <dmalcolm@redhat.com>
2767 (jit_langhook_post_compilation_parsing_cleanups): Remove.
2768 (LANG_HOOKS_POST_COMPILATION_PARSING_CLEANUPS): Remove
2769 * jit-playback.c (gcc::jit::playback::context::new_global): Add
2770 call to varpool_node::finalize_decl.
2771 (gcc::jit::playback::context::finalize_global_decls): Remove.
2773 (gcc::jit::playback::context::finalize_global_decls): Remove.
2775 2015-06-05 David Malcolm <dmalcolm@redhat.com>
2777 * dummy-frontend.c (jit_langhook_write_globals): Rename to...
2778 (jit_langhook_post_compilation_parsing_cleanups): ...this, and
2779 eliminate calls to finalize_compilation_unit and
2780 write_global_decls_2.
2781 (LANG_HOOKS_WRITE_GLOBALS): Rename to...
2782 (LANG_HOOKS_POST_COMPILATION_PARSING_CLEANUPS): ...this and
2783 redirect from jit_langhook_write_globals to
2784 jit_langhook_post_compilation_parsing_cleanups.
2786 (gcc::jit::playback::context::write_global_decls_1): Rename to...
2787 (gcc::jit::playback::context::finalize_global_decls): ...this.
2788 (gcc::jit::playback::context::write_global_decls_1): Delete.
2790 (gcc::jit::playback::context::write_global_decls_1): Rename to...
2791 (gcc::jit::playback::context::finalize_global_decls): ...this.
2792 (gcc::jit::playback::context::write_global_decls_1): Delete.
2794 2015-06-04 Andrew MacLeod <amacleod@redhat.com>
2796 * dummy-frontend.c: Adjust includes for restructured coretypes.h.
2797 * jit-common.h: Likewise.
2798 * jit-playback.c: Likewise.
2800 2015-05-12 David Malcolm <dmalcolm@redhat.com>
2802 * jit-builtins.c: Include vec.h before target.h.
2804 2015-04-27 Jim Wilson <jim.wilson@linaro.org>
2806 * Make-lang.in (jit.mostlyclean): Remove shared libraries and object
2809 2015-04-09 David Malcolm <dmalcolm@redhat.com>
2812 * docs/cp/topics/expressions.rst (Simple expressions): Fix copy
2813 and paste error in description of gccjit::context::one.
2814 * docs/topics/expressions.rst (Simple expressions): Likewise in
2815 description of gcc_jit_context_one.
2816 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2818 2015-03-13 Uros Bizjak <ubizjak@gmail.com>
2820 * jit-recording.c (dump::write): Also check vasprintf return value.
2821 (recording::context::add_error_va): Ditto.
2822 (recording::string::from_printf): Ditto.
2824 2015-03-13 David Malcolm <dmalcolm@redhat.com>
2826 * docs/internals/index.rst (Packaging notes): New section.
2827 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2829 2015-03-05 David Malcolm <dmalcolm@redhat.com>
2831 * docs/cp/intro/tutorial03.rst: Add missing arguments to
2832 gccjit::block::end_with_conditional call. Add on_true/on_false
2833 comments. Tweak the wording.
2834 * docs/intro/tutorial03.rst: Add missing arguments to
2835 gcc_jit_block_end_with_conditional call. Add some clarifying
2837 * docs/topics/compilation.rst: Tweak the wording to avoid an
2838 ambiguous use of "this".
2839 * docs/topics/contexts.rst: Fix a typo.
2840 * docs/topics/expressions.rst (GCC_JIT_BINARY_OP_MINUS): Remove
2842 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2844 2015-02-24 Thomas Schwinge <thomas@codesourcery.com>
2847 * jit-builtins.c (DEF_FUNCTION_TYPE_VAR_8)
2848 (DEF_FUNCTION_TYPE_VAR_12): Remove macros.
2849 (DEF_FUNCTION_TYPE_VAR_7, DEF_FUNCTION_TYPE_VAR_11): New macros.
2850 * jit-builtins.h (DEF_FUNCTION_TYPE_VAR_8)
2851 (DEF_FUNCTION_TYPE_VAR_12): Remove macros.
2852 (DEF_FUNCTION_TYPE_VAR_7, DEF_FUNCTION_TYPE_VAR_11): New macros.
2854 2015-02-04 David Malcolm <dmalcolm@redhat.com>
2857 * docs/conf.py (html_theme): Change from 'pyramid'
2860 2015-02-04 David Malcolm <dmalcolm@redhat.com>
2862 * docs/topics/contexts.rst (gcc_jit_context_acquire): Fix
2864 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2866 2015-02-03 David Malcolm <dmalcolm@redhat.com>
2868 * jit-logging.h (gcc::jit::log_user::log): Make const.
2869 * jit-recording.c (gcc::jit::recording::context::set_str_option):
2870 Log the new value of the option.
2871 (gcc::jit::recording::context::set_int_option): Likewise.
2872 (gcc::jit::recording::context::set_bool_option): Likewise.
2873 (gcc::jit::recording::context::compile): Log the value of all
2875 (gcc::jit::recording::context::compile_to_file): Likewise.
2876 (gcc::jit::recording::context::log_all_options): New function.
2877 (gcc::jit::recording::context::log_str_option): New function.
2878 (gcc::jit::recording::context::log_int_option): New function.
2879 (gcc::jit::recording::context::log_bool_option): New function.
2880 * jit-recording.h (gcc::jit::recording::context::log_all_options):
2882 (gcc::jit::recording::context::log_str_option): New function.
2883 (gcc::jit::recording::context::log_int_option): New function.
2884 (gcc::jit::recording::context::log_bool_option): New function.
2885 * docs/internals/test-hello-world.exe.log.txt: Update for above
2887 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2889 2015-02-03 David Malcolm <dmalcolm@redhat.com>
2892 * Make-lang.in (jit_OBJS): Add jit/jit-spec.o and gcc.o.
2893 (LIBGCCJIT_FILENAME): Add EXTRA_GCC_OBJS.
2894 * jit-playback.c: Include gcc.h.
2895 (gcc::jit::playback::context::compile): Move mutex acquisition
2896 to before the call to make_fake_args.
2897 (append_arg_from_driver): New function.
2898 (gcc::jit::playback::context::make_fake_args): On the first call,
2899 call into driver_get_configure_time_options to get configure-time
2900 default options and cache them. Add them to the args for
2902 * jit-spec.c: New source file.
2903 * docs/internals/test-hello-world.exe.log.txt: Update to reflect
2905 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2907 2015-02-02 David Malcolm <dmalcolm@redhat.com>
2910 * dummy-frontend.c (jit_langhook_type_for_mode): Support
2911 TYPE_MODE (long_long_integer_type_node).
2913 2015-01-27 David Malcolm <dmalcolm@redhat.com>
2915 * docs/internals/test-hello-world.exe.log.txt: Add example version
2917 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2918 * jit-common.h (gcc::jit::dump::get_file): New accessor.
2919 * jit-logging.c: Include toplev.h.
2920 (gcc::jit::logger::logger): Log the GCC version.
2921 * jit-recording.c: Include toplev.h.
2922 (gcc:jit::recording::context::dump_reproducer_to_file): Log the
2925 2015-01-26 David Malcolm <dmalcolm@redhat.com>
2927 * docs/topics/compilation.rst (gcc_jit_result_get_code): Fix typo.
2928 * docs/topics/contexts.rst (gcc_jit_context_get_last_error): The
2929 error buffer is only valid until the next call to the context.
2930 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2931 * libgccjit.h (gcc_jit_context_get_first_error): Reword the
2932 comment to omit mention of compiling.
2933 (gcc_jit_context_get_last_error): The error buffer is only valid
2934 until the next call to the context.
2936 2015-01-26 David Malcolm <dmalcolm@redhat.com>
2939 * config-lang.in (compilers): Drop "libgccjit.so".
2941 2015-01-23 David Malcolm <dmalcolm@redhat.com>
2944 * jit-playback.c (gcc::jit::playback::context::compile): Construct
2945 toplev instances with init_signals=false.
2947 2015-01-19 David Malcolm <dmalcolm@redhat.com>
2949 * docs/cp/topics/results.rst: Rename to...
2950 * docs/cp/topics/compilation.rst: ...this, and add section on
2951 ahead-of-time compilation.
2952 * docs/cp/topics/index.rst: Update for renaming of results.rst
2954 * docs/examples/emit-alphabet.bf: New file, a sample "brainf"
2956 * docs/examples/tut05-bf.c: New file, implementing a compiler
2958 * docs/internals/test-hello-world.exe.log.txt: Update to reflect
2959 changes to logger output.
2960 * docs/intro/index.rst: Add tutorial05.rst
2961 * docs/intro/tutorial05.rst: New file.
2962 * docs/topics/results.rst: Rename to...
2963 * docs/topics/compilation.rst: ...this, and add section on
2964 ahead-of-time compilation.
2965 * docs/topics/index.rst: Update for renaming of results.rst to
2967 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2968 * jit-playback.c (gcc::jit::playback::context::compile): Convert
2969 return type from result * to void. Move the code to convert to
2970 dso and dlopen the result to a new pure virtual "postprocess"
2972 (gcc::jit::playback::compile_to_memory::compile_to_memory): New
2974 (gcc::jit::playback::compile_to_memory::postprocess): New
2975 function, based on playback::context::compile.
2976 (gcc::jit::playback::compile_to_file::compile_to_file): New
2978 (gcc::jit::playback::compile_to_file::postprocess): New function.
2979 (gcc::jit::playback::compile_to_file::copy_file): New function.
2980 (gcc::jit::playback::context::convert_to_dso): Move internals
2982 (gcc::jit::playback::context::invoke_driver): New method. Add
2983 "-shared" and "-c" options to driver's argv as needed.
2984 * jit-playback.h: Include "timevar.h".
2985 (gcc::jit::playback::context::compile): Convert return type from
2987 (gcc::jit::playback::context::postprocess): New pure virtual
2988 function, making this an abstract base class.
2989 (gcc::jit::playback::context::get_tempdir): New accessor.
2990 (gcc::jit::playback::context::invoke_driver): New function.
2991 (class gcc::jit::playback::compile_to_memory): New subclass of
2993 (class gcc::jit::playback::compile_to_file): Likewise.
2994 * jit-recording.c (gcc::jit::recording::context::compile): Use a
2995 playback::compile_to_memory, and extract its result.
2996 (gcc::jit::recording::context::compile_to_file): New function.
2997 * jit-recording.h (gcc::jit::recording::context::compile_to_file):
2999 * libgccjit++.h (gccjit::context::compile_to_file): New method.
3000 * libgccjit.c (gcc_jit_context_compile): Update log message to
3001 clarify that this is an in-memory compile.
3002 (gcc_jit_context_compile_to_file): New function.
3003 * libgccjit.h (gcc_jit_context): Clarify that you can compile
3004 a context more than once, and that you can compile to a file
3005 as well as to memory.
3006 (gcc_jit_result): Clarify that this is the result of an
3007 in-memory compilation.
3008 (gcc_jit_context_compile): Clarify that you can compile, and that
3009 this is an in-memory compilation.
3010 (enum gcc_jit_output_kind): New enum.
3011 (gcc_jit_context_compile_to_file): New function.
3012 (gcc_jit_context_enable_dump): Clarify comment to cover both forms
3014 * libgccjit.map (gcc_jit_context_compile_to_file): New API
3016 * notes.txt: Update to show the playback::context::postprocess
3019 2015-01-19 David Malcolm <dmalcolm@redhat.com>
3022 (gcc::jit::recording::memento_of_new_string_literal::make_debug_string):
3023 Add missing format string.
3025 2015-01-16 David Malcolm <dmalcolm@redhat.com>
3027 * Make-lang.in (lang_checks_parallelized): Add "check-jit".
3028 (check_jit_parallelize): Set this to an arbitrary value (10).
3030 2015-01-16 Jakub Jelinek <jakub@redhat.com>
3032 * jit-builtins.h (DEF_FUNCTION_TYPE_VAR_5): Fix spelling of
3034 (DEF_FUNCTION_TYPE_VAR_8, DEF_FUNCTION_TYPE_VAR_12): Define and
3036 * jit-builtins.c (DEF_FUNCTION_TYPE_VAR_8, DEF_FUNCTION_TYPE_VAR_12):
3039 2015-01-15 Richard Sandiford <richard.sandiford@arm.com>
3041 Update copyright years in docs/.
3043 2015-01-15 David Malcolm <dmalcolm@redhat.com>
3045 * libgccjit.c (gcc_jit_block_add_assignment_op): Check that the
3046 lvalue and the rvalue are of compatible type.
3048 2015-01-13 David Malcolm <dmalcolm@redhat.com>
3050 * docs/cp/topics/contexts.rst (Debugging): Add
3051 gccjit::context::dump_reproducer_to_file.
3052 * docs/internals/index.rst (Design notes): New section,
3053 discussing input validation and
3054 gcc_jit_context_dump_reproducer_to_file.
3055 * docs/topics/contexts.rst (Debugging): Add
3056 gcc_jit_context_dump_reproducer_to_file.
3057 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3058 * jit-common.h (gcc::jit::dump::get_context): New accessor.
3059 * jit-recording.c: Include "hash-map.h".
3060 Within namespace ::gcc::jit...
3061 (dump::write): Flush each line.
3062 (dump::make_location): Pass false for new param "created_by_user".
3063 (class allocator): New class.
3064 (allocator::~allocator): New function.
3065 (allocator::xstrdup_printf): New function.
3066 (allocator::xstrdup_printf_va): New function.
3067 (class reproducer): New subclass of dump.
3068 (reproducer::reproducer): New function.
3069 (reproducer::write_params): New function.
3070 (reproducer::write_args): New function.
3071 (reproducer::make_identifier): New function.
3072 (reproducer::make_tmp_identifier): New function.
3073 (reproducer::get_identifier): New pair of functions.
3074 (reproducer::get_identifier_as_rvalue): New function.
3075 (reproducer::get_identifier_as_lvalue): New function.
3076 (reproducer::get_identifier_as_type): New function.
3077 (reproducer::xstrdup_printf): New function.
3078 (recording::context::context): Initialize m_toplevel_ctxt.
3079 (recording::context::new_location): Add param created_by_user.
3080 (str_option_reproducer_strings): New table of strings.
3081 (int_option_reproducer_strings): Likewise.
3082 (bool_option_reproducer_strings): Likewise.
3083 (get_type_enum_strings): Likewise.
3084 (names_of_function_kinds): Likewise.
3085 (global_kind_reproducer_strings): Likewise.
3086 (unary_op_reproducer_strings): Likewise.
3087 (binary_op_reproducer_strings): Likewise.
3088 (comparison_reproducer_strings): Likewise.
3089 Within namespace ::gcc::jit::recording::...
3090 (context::dump_reproducer_to_file): New function.
3091 (string::write_reproducer): Likewise.
3092 (location::write_reproducer): Likewise.
3093 (type::access_as_type): Likewise.
3094 (memento_of_get_type::write_reproducer): Likewise.
3095 (memento_of_get_pointer::write_reproducer): Likewise.
3096 (memento_of_get_const::write_reproducer): Likewise.
3097 (memento_of_get_volatile::write_reproducer): Likewise.
3098 (array_type::write_reproducer): Likewise.
3099 (function_type::write_reproducer): Likewise.
3100 (function_type::write_deferred_reproducer): Likewise.
3101 (field::write_reproducer): Likewise.
3102 (struct_::access_as_type): Likewise.
3103 (struct_::write_reproducer): Likewise.
3104 (union_::write_reproducer): Likewise.
3105 (fields::write_reproducer): Likewise.
3106 (rvalue::access_as_rvalue): Likewise.
3107 (lvalue::access_as_rvalue): Likewise.
3108 (lvalue::access_as_lvalue): Likewise.
3109 (param::access_as_rvalue): Likewise.
3110 (param::access_as_lvalue): Likewise.
3111 (param::write_reproducer): Likewise.
3112 (function::write_reproducer): Likewise.
3113 (block::write_reproducer): Likewise.
3114 (global::write_reproducer): Likewise.
3115 (memento_of_new_rvalue_from_const <int>::write_reproducer):
3117 (memento_of_new_rvalue_from_const <long>::write_reproducer):
3119 (memento_of_new_rvalue_from_const <double>::write_reproducer):
3121 (memento_of_new_rvalue_from_const <void *>::write_reproducer):
3123 (memento_of_new_string_literal::write_reproducer): Likewise.
3124 (unary_op::write_reproducer): Likewise.
3125 (binary_op::write_reproducer): Likewise.
3126 (comparison::write_reproducer): Likewise.
3127 (cast::write_reproducer): Likewise.
3128 (call::write_reproducer): Likewise.
3129 (call_through_ptr::write_reproducer): Likewise.
3130 (array_access::write_reproducer): Likewise.
3131 (access_field_of_lvalue::write_reproducer): Likewise.
3132 (access_field_rvalue::write_reproducer): Likewise.
3133 (dereference_field_rvalue::write_reproducer): Likewise.
3134 (dereference_rvalue::write_reproducer): Likewise.
3135 (get_address_of_lvalue::write_reproducer): Likewise.
3136 (local::write_reproducer): Likewise.
3137 (eval::write_reproducer): Likewise.
3138 (assignment::write_reproducer): Likewise.
3139 (assignment_op::write_reproducer): Likewise.
3140 (comment::write_reproducer): Likewise.
3141 (conditional::write_reproducer): Likewise.
3142 (jump::write_reproducer): Likewise.
3143 (return_::write_reproducer): Likewise.
3144 * jit-recording.h (gcc::jit::reproducer): New forward declararion.
3145 Within namespace ::gcc::jit::recording::...
3146 (context::new_location): Add "created_by_user" param.
3147 (context::dump_reproducer_to_file): New method.
3148 (context::m_toplevel_ctxt): New field.
3149 (memento::write_reproducer): New pure virtual function.
3150 (memento::dyn_cast_location): New virtual function.
3151 (string::write_reproducer):
3152 (location::location): Add "created_by_user" param.
3153 (location::dyn_cast_location): New function.
3154 (location::created_by_user): New accessor.
3155 (location::write_reproducer): New function.
3156 (location::m_created_by_user): New field.
3157 (type::access_as_type): New virtual function.
3158 (location::write_reproducer): Likewise.
3159 (type::access_as_type): Likewise.
3160 (memento_of_get_type::write_reproducer): Likewise.
3161 (memento_of_get_pointer::write_reproducer): Likewise.
3162 (memento_of_get_const::write_reproducer): Likewise.
3163 (memento_of_get_volatile::write_reproducer): Likewise.
3164 (array_type::write_reproducer): Likewise.
3165 (function_type::write_reproducer): Likewise.
3166 (function_type::write_deferred_reproducer): Likewise.
3167 (field::write_reproducer): Likewise.
3168 (struct_::access_as_type): Likewise.
3169 (struct_::write_reproducer): Likewise.
3170 (union_::write_reproducer): Likewise.
3171 (union_::m_fields): Remove stray unused field.
3172 (fields::length): New accessor.
3173 (fields::get_field): New accessor.
3174 (fields::write_reproducer): New function.
3175 (rvalue::access_as_rvalue): Likewise.
3176 (lvalue::access_as_rvalue): Likewise.
3177 (lvalue::access_as_lvalue): Likewise.
3178 (param::access_as_rvalue): Likewise.
3179 (param::access_as_lvalue): Likewise.
3180 (param::write_reproducer): Likewise.
3181 (function::write_reproducer): Likewise.
3182 (block::write_reproducer): Likewise.
3183 (global::write_reproducer): Likewise.
3184 (memento_of_new_rvalue_from_const <HOST_TYPE>::write_reproducer):
3186 (memento_of_new_string_literal::write_reproducer): Likewise.
3187 (unary_op::write_reproducer): Likewise.
3188 (binary_op::write_reproducer): Likewise.
3189 (comparison::write_reproducer): Likewise.
3190 (cast::write_reproducer): Likewise.
3191 (call::write_reproducer): Likewise.
3192 (call_through_ptr::write_reproducer): Likewise.
3193 (array_access::write_reproducer): Likewise.
3194 (access_field_of_lvalue::write_reproducer): Likewise.
3195 (access_field_rvalue::write_reproducer): Likewise.
3196 (dereference_field_rvalue::write_reproducer): Likewise.
3197 (dereference_rvalue::write_reproducer): Likewise.
3198 (get_address_of_lvalue::write_reproducer): Likewise.
3199 (local::write_reproducer): Likewise.
3200 (eval::write_reproducer): Likewise.
3201 (assignment::write_reproducer): Likewise.
3202 (assignment_op::write_reproducer): Likewise.
3203 (comment::write_reproducer): Likewise.
3204 (conditional::write_reproducer): Likewise.
3205 (jump::write_reproducer): Likewise.
3206 (return_::write_reproducer): Likewise.
3207 * libgccjit++.h (gccjit::context::dump_reproducer_to_file): New.
3208 * libgccjit.c (gcc_jit_context_new_location): Pass "true" as
3209 param "created_by_user".
3210 (gcc_jit_context_dump_reproducer_to_file): New API entrypoint.
3211 * libgccjit.h (gcc_jit_context_dump_reproducer_to_file): New API
3213 * libgccjit.map (gcc_jit_context_dump_reproducer_to_file): New API
3216 2015-01-12 David Malcolm <dmalcolm@redhat.com>
3218 * jit-recording.c (class gcc::jit::rvalue_usage_validator): New.
3219 (gcc::jit::rvalue_usage_validator::rvalue_usage_validator): New
3221 (gcc::jit::rvalue_usage_validator::visit): New function.
3222 (gcc::jit::recording::rvalue::verify_valid_within_stmt): New
3224 (gcc::jit::recording::rvalue::set_scope): New function.
3225 (gcc::jit::recording::function::function): Call set_scope on each
3226 param, issuing errors for any params that already have a function.
3227 (gcc::jit::recording::block::add_eval): Return the new statement;
3228 update the comment given that some error-checking now happens after
3230 (gcc::jit::recording::block::add_assignment): Likewise.
3231 (gcc::jit::recording::block::add_assignment_op): Likewise.
3232 (gcc::jit::recording::block::add_comment): Likewise.
3233 (gcc::jit::recording::block::end_with_conditional): Likewise.
3234 (gcc::jit::recording::block::end_with_jump): Likewise.
3235 (gcc::jit::recording::block::end_with_return): Likewise.
3236 (gcc::jit::recording::block::validate): Add a comment.
3237 (gcc::jit::recording::unary_op::visit_children): New function.
3238 (gcc::jit::recording::binary_op::visit_children): New function.
3239 (gcc::jit::recording::comparison::visit_children): New function.
3240 (gcc::jit::recording::cast::visit_children): New function.
3241 (gcc::jit::recording::call::visit_children): New function.
3242 (gcc::jit::recording::call_through_ptr::visit_children): New function.
3243 (gcc::jit::recording::array_access::visit_children): New function.
3244 (gcc::jit::recording::access_field_of_lvalue::visit_children): New
3246 (gcc::jit::recording::access_field_rvalue::visit_children): New
3248 (gcc::jit::recording::dereference_field_rvalue::visit_children):
3250 (gcc::jit::recording::dereference_rvalue::visit_children): New
3252 (gcc::jit::recording::get_address_of_lvalue::visit_children): New
3254 * jit-recording.h: Within namespace gcc::jit::recording...
3255 (class rvalue_visitor): New.
3256 (rvalue::rvalue): Initialize m_scope.
3257 (rvalue::get_loc): New accessor.
3258 (rvalue::verify_valid_within_stmt): New function.
3259 (rvalue::visit_children): New pure virtual function.
3260 (rvalue::set_scope): New function.
3261 (rvalue::get_scope): New function.
3262 (rvalue::dyn_cast_param): New function.
3263 (rvalue::m_scope): New field.
3264 (param::visit_children): New empty function.
3265 (param::dyn_cast_param): New function.
3266 (function::get_loc): New function.
3267 (block::add_eval): Return the new statement.
3268 (block::add_assignment): Likewise.
3269 (block::add_assignment_op): Likewise.
3270 (block::add_comment): Likewise.
3271 (block::end_with_conditional): Likewise.
3272 (block::end_with_jump): Likewise.
3273 (block::end_with_return): Likewise.
3274 (global::visit_children): New function.
3275 (memento_of_new_rvalue_from_const<HOST_TYPE>::visit_children):
3277 (memento_of_new_string_literal::visit_children): New function.
3278 (unary_op::visit_children): New function.
3279 (binary_op::visit_children): New function.
3280 (comparison::visit_children): New function.
3281 (cast::visit_children): New function.
3282 (call::visit_children): New function.
3283 (call_through_ptr::visit_children): New function.
3284 (array_access::visit_children): New function.
3285 (access_field_of_lvalue::visit_children): New function.
3286 (access_field_rvalue::visit_children): New function.
3287 (dereference_field_rvalue::visit_children): New function.
3288 (dereference_rvalue::visit_children): New function.
3289 (get_address_of_lvalue::visit_children): New function.
3290 (local::local): Call set_scope.
3291 (local::visit_children): New function.
3292 (statement::get_block): Make public.
3293 * libgccjit.c (RETURN_VAL_IF_FAIL_PRINTF5): New macro.
3294 (RETURN_NULL_IF_FAIL_PRINTF5): New macro.
3295 (gcc_jit_context_new_function): Verify that each param has
3296 not yet been used for creating another function.
3297 (gcc_jit_block_add_eval): After creating the stmt, verify
3298 that the rvalue expression tree is valid to use within it.
3299 (gcc_jit_block_add_assignment): Likewise for the lvalue and
3300 rvalue expression trees.
3301 (gcc_jit_block_add_assignment_op): Likewise.
3302 (gcc_jit_block_end_with_conditional): Likewise for the boolval
3304 (gcc_jit_block_end_with_return): Likewise for the rvalue
3306 (gcc_jit_block_end_with_void_return): Remove return of "void",
3307 now that block::end_with_return is now non-void.
3309 2015-01-12 David Malcolm <dmalcolm@redhat.com>
3311 * jit-playback.c (gcc::jit::playback::context::read_dump_file):
3312 Add missing fclose on error-handling path.
3314 2015-01-12 David Malcolm <dmalcolm@redhat.com>
3316 * docs/cp/topics/expressions.rst (Global variables): Add
3317 enum gcc_jit_global_kind param to gccjit::context::new_global.
3318 * docs/topics/expressions.rst (Global variables): Likewise.
3319 Document the new enum.
3320 * docs/topics/results.rst (Compilation results): Document
3322 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3323 * dummy-frontend.c (jit_langhook_write_globals): Call into the
3324 playback context's write_global_decls_1 and write_global_decls_2
3325 before and after calling symtab->finalize_compilation_unit ().
3326 * jit-playback.c: Include "debug.h".
3327 (gcc::jit::playback::context::new_global): Add "kind" param and
3328 use it to set TREE_PUBLIC, TREE_STATIC and DECL_EXTERNAL on the
3329 underlying VAR_DECL. Call varpool_node::get_create on the
3330 VAR_DECL, and add it to m_globals.
3331 (gcc::jit::playback::context::write_global_decls_1): New function.
3332 (gcc::jit::playback::context::write_global_decls_2): New function.
3333 * jit-playback.h (gcc::jit::playback::context::context): Call
3334 create on m_globals.
3335 (gcc::jit::playback::context::new_global): Add "kind" param.
3336 (gcc::jit::playback::context::write_global_decls_1): New function.
3337 (gcc::jit::playback::context::write_global_decls_2): New function.
3338 (gcc::jit::playback::context::m_globals): New field.
3339 * jit-recording.c (gcc::jit::recording::context::context):
3340 Initialize m_globals.
3341 (gcc::jit::recording::context::new_global): Add param "kind".
3342 Add the new global to m_globals.
3343 (gcc::jit::recording::context::dump_to_file): Dump the globals.
3344 (gcc::jit::recording::global::replay_into): Add field m_kind.
3345 (gcc::jit::recording::global::write_to_dump): New override.
3346 * jit-recording.h (gcc::jit::recording::context::new_global): Add
3348 (gcc::jit::recording::context::m_globals): New field.
3349 (gcc::jit::recording::global::global): Add param kind.
3350 (gcc::jit::recording::global::write_to_dump): New override.
3351 (gcc::jit::recording::global::m_kind): New field.
3352 * jit-result.c (gcc::jit::result::get_global): New function.
3353 * jit-result.h (gcc::jit::result::get_global): New function.
3354 * libgccjit++.h (gccjit::context::new_global): Add "kind" param.
3355 * libgccjit.c (gcc_jit_context_new_global): Likewise.
3356 (gcc_jit_result_get_global): New API entrypoint.
3357 * libgccjit.h (gcc_jit_result_get_global): New API entrypoint.
3358 (enum gcc_jit_global_kind): New enum.
3359 (gcc_jit_context_new_global): API change: add "kind" param.
3360 * libgccjit.map (gcc_jit_result_get_global): New symbol.
3362 2015-01-09 David Malcolm <dmalcolm@redhat.com>
3364 * dummy-frontend.c: Include "fixed-value.h", "alias.h", "flags.h",
3365 "symtab.h", "inchash.h". Move include of "hash-set.h" much
3367 * jit-builtins.c: Remove redundant includes of "opts.h" and
3369 * jit-common.h: Include "hash-set.h", "input.h", "vec.h",
3370 "double-int.h", "alias.h", "flags.h", "symtab.h", "inchash.h".
3371 * jit-playback.c: Include "hashtab.h", "machmode.h", "input.h",
3372 "statistics.h", "vec.h", "double-int.h", "real.h",
3373 "fixed-value.h", "alias.h", "flags.h", "symtab.h", "tree-core.h",
3374 "inchash.h", "fold-const.h". Move include of "hash-set.h" to
3376 * jit-recording.c: Remove redundant includes of "opts.h" and
3379 2015-01-09 David Malcolm <dmalcolm@redhat.com>
3381 * docs/cp/topics/expressions.rst (Simple expressions): Use
3382 ":c:type:" for C types. Document new overload of
3383 gcc::jit::context::new_rvalue.
3384 * docs/topics/expressions.rst (Simple expressions): Use
3385 ":c:type:" for C types. Document new entrypoint
3386 gcc_jit_context_new_rvalue_from_long.
3387 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3388 * jit-playback.c: Within namespace gcc::jit::playback...
3389 (context::new_rvalue_from_int): Eliminate in favor of...
3390 (context::new_rvalue_from_const <int>): ...this.
3391 (context::new_rvalue_from_double): Eliminate in favor of...
3392 (context::new_rvalue_from_const <double>): ...this.
3393 (context::new_rvalue_from_const <long>): New.
3394 (context::new_rvalue_from_ptr): Eliminate in favor of...
3395 (context::new_rvalue_from_const <void *>): ...this.
3396 * jit-playback.h: Within namespace gcc::jit::playback...
3397 (context::new_rvalue_from_int): Eliminate in favor of...
3398 (context::new_rvalue_from_const <HOST_TYPE>): ...this.
3399 (context::new_rvalue_from_double): Likewise.
3400 (context::new_rvalue_from_ptr): Likewise.
3401 * jit-recording.c: Within namespace gcc::jit::recording...
3402 (context::new_rvalue_from_int): Eliminate.
3403 (context::new_rvalue_from_double): Likewise.
3404 (context::new_rvalue_from_ptr): Likewise.
3405 (class memento_of_new_rvalue_from_const <int>):
3406 Add explicit specialization.
3407 (class memento_of_new_rvalue_from_const <long>):
3409 (class memento_of_new_rvalue_from_const <double>):
3411 (class memento_of_new_rvalue_from_const <void *>):
3413 (memento_of_new_rvalue_from_int::replay_into):
3415 (memento_of_new_rvalue_from_const <HOST_TYPE>::replay_into):
3417 (memento_of_new_rvalue_from_double::replay_into):
3419 (memento_of_new_rvalue_from_ptr::replay_into):
3420 ...and this to be deleted.
3421 (memento_of_new_rvalue_from_int::make_debug_string):
3423 (memento_of_new_rvalue_from_const <int>::make_debug_string):
3425 (memento_of_new_rvalue_from_double::make_debug_string):
3427 (memento_of_new_rvalue_from_const <double>::make_debug_string):
3429 (memento_of_new_rvalue_from_ptr::make_debug_string)
3431 (memento_of_new_rvalue_from_const <void *>::make_debug_string):
3433 (memento_of_new_rvalue_from_const <long>::make_debug_string):
3435 * jit-recording.h: Within namespace gcc::jit::recording...
3436 (context::new_rvalue_from_int): Eliminate.
3437 (context::new_rvalue_from_double): Likewise.
3438 (context::new_rvalue_from_ptr): Likewise, all in favor of...
3439 (context::new_rvalue_from_const <HOST_TYPE>): New family of
3441 (class memento_of_new_rvalue_from_int): Eliminate.
3442 (class memento_of_new_rvalue_from_double): Likewise.
3443 (class memento_of_new_rvalue_from_ptr): Likewise.
3444 (class memento_of_new_rvalue_from_const <HOST_TYPE>): New family
3445 of rvalue subclasses.
3446 * libgccjit++.h (gccjit::context::new_rvalue): New overload, for
3448 * libgccjit.c (gcc_jit_context_new_rvalue_from_int): Update for
3449 rewriting of recording::context::new_rvalue_from_int to
3450 recording::context::new_rvalue_from_const <int>.
3451 (gcc_jit_context_new_rvalue_from_long): New API entrypoint.
3452 (gcc_jit_context_new_rvalue_from_double): Update for
3453 rewriting of recording::context::new_rvalue_from_double to
3454 recording::context::new_rvalue_from_const <double>.
3455 (gcc_jit_context_new_rvalue_from_ptr): Update for
3456 rewriting of recording::context::new_rvalue_from_ptr to
3457 recording::context::new_rvalue_from_const <void *>.
3458 * libgccjit.h (gcc_jit_context_new_rvalue_from_long): New API
3460 * libgccjit.map (gcc_jit_context_new_rvalue_from_long): Likewise.
3462 2015-01-09 David Malcolm <dmalcolm@redhat.com>
3465 * docs/internals/test-hello-world.exe.log.txt: Update, the log now
3466 shows tempdir creation/cleanup.
3467 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3468 * jit-logging.h (class gcc::jit::log_user): Add gcc::jit::tempdir
3469 to the list of subclasses in the comment.
3470 * jit-playback.c (gcc::jit::playback::context::context): Add a
3471 comment clarifying when the tempdir gets cleaned up.
3472 (gcc::jit::playback::context::compile): Pass the context's logger,
3473 if any, to the tempdir.
3474 (gcc::jit::playback::context::dlopen_built_dso): When creating the
3475 gcc::jit::result, if GCC_JIT_BOOL_OPTION_DEBUGINFO is set, hand
3476 over ownership of the tempdir to it.
3477 * jit-result.c: Include "jit-tempdir.h".
3478 (gcc::jit::result::result): Add tempdir param, saving it as
3480 (gcc::jit::result::~result): Delete m_tempdir.
3481 * jit-result.h (gcc::jit::result::result): Add tempdir param.
3482 (gcc::jit::result::m_tempdir): New field.
3483 * jit-tempdir.c (gcc::jit::tempdir::tempdir): Add logger param;
3485 (gcc::jit::tempdir::create): Add JIT_LOG_SCOPE to log entry/exit,
3486 and log m_path_template and m_path_tempdir.
3487 (gcc::jit::tempdir::~tempdir): Add JIT_LOG_SCOPE to log
3488 entry/exit, and log the unlink and rmdir calls.
3489 * jit-tempdir.h: Include "jit-logging.h".
3490 (class gcc::jit::tempdir): Make this be a subclass of log_user.
3491 (gcc::jit::tempdir::tempdir): Add logger param.
3492 * notes.txt: Update to show the two possible places where the
3493 tempdir can be cleaned up.
3495 2015-01-08 David Malcolm <dmalcolm@redhat.com>
3497 * libgccjit.h (struct gcc_jit_context): Rewrite the descriptive
3500 2015-01-08 David Malcolm <dmalcolm@redhat.com>
3502 * docs/topics/contexts.rst (Error-handling): Document new
3503 entrypoint gcc_jit_context_get_last_error.
3504 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3505 * jit-recording.c (gcc::jit::recording::context::context):
3506 Initialize new fields "m_last_error_str" and
3507 "m_owns_last_error_str".
3508 (gcc::jit::recording::context::~context): Clean up
3509 m_last_error_str, if needed.
3510 (gcc::jit::recording::context::add_error_va): Update
3511 m_last_error_str and m_owns_last_error_str, freeing the old
3512 value if appropriate.
3513 (gcc::jit::recording::context::get_last_error): New function.
3514 * jit-recording.h (gcc::jit::recording::context::get_last_error):
3516 (gcc::jit::recording::context): New fields m_last_error_str and
3517 m_owns_last_error_str.
3518 * libgccjit.c (gcc_jit_context_get_last_error): New function.
3519 * libgccjit.h (gcc_jit_context_get_last_error): New declaration.
3520 * libgccjit.map (gcc_jit_context_get_last_error): New function.
3522 2015-01-08 David Malcolm <dmalcolm@redhat.com>
3524 * Make-lang.in (jit_OBJS): Add jit/jit-logging.o.
3525 * docs/internals/index.rst (Overview of code structure): Mention
3526 gcc_jit_context_set_logfile, and embed the example logfile.
3527 * docs/internals/test-hello-world.exe.log.txt: New file: example
3529 * docs/topics/contexts.rst (Debugging): Add documentation
3530 for gcc_jit_context_set_logfile.
3531 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3532 * dummy-frontend.c: Include "jit-logging.h".
3533 (jit_langhook_init): Assert that there is an active playback
3534 context. If it has a logger, log entry/exit to this function.
3535 (jit_langhook_write_globals): Likewise.
3536 * jit-common.h (gcc::jit::logger): New forward declaration.
3537 * jit-logging.c: New file.
3538 * jit-logging.h: New file.
3539 * jit-playback.c: Include "jit-logging.h".
3540 (gcc::jit::playback::context::context): Initialize the log_user
3541 base class from the recording context's logger (if any). Use
3542 JIT_LOG_SCOPE to log entry/exit from the function body.
3543 (gcc::jit::playback::context::~context): Use JIT_LOG_SCOPE to
3544 log entry/exit from the function body.
3545 (gcc::jit::playback::build_stmt_list): Likewise.
3546 (gcc::jit::playback::function::postprocess): Likewise.
3547 (gcc::jit::playback::context::compile): Likewise. Log the
3548 entry/exit to toplev::main and toplev::finalize. Log the
3549 fake argv passed to toplev::main.
3550 (gcc::jit::playback::context::acquire_mutex): Use JIT_LOG_SCOPE to
3551 log entry/exit from the function body.
3552 (gcc::jit::playback::context::release_mutex): Likewise.
3553 (gcc::jit::playback::context::make_fake_args): Likewise.
3554 (gcc::jit::playback::context::extract_any_requested_dumps):
3556 (gcc::jit::playback::context::convert_to_dso): Likewise. Also,
3557 log the arguments that the driver is invoked with.
3558 (gcc::jit::playback::context::dlopen_built_dso): Likewise. Pass
3559 the logger to the result object.
3560 (gcc::jit::playback::context::replay): Use JIT_LOG_SCOPE to
3561 log entry/exit from the function body.
3562 (gcc::jit::playback::context::dump_generated_code): Likewise.
3563 (gcc::jit::playback::context::handle_locations): Likewise.
3564 * jit-playback.h (gcc::jit::playback::context): Make this be
3565 a subclass of gcc::jit::log_user.
3566 * jit-recording.c: Include "jit-logging.h".
3567 (gcc::jit::recording::context::context: Initialize the logger to
3568 NULL for root contexts, or to the parent's logger for child
3570 (gcc::jit::recording::context::~context): Use JIT_LOG_SCOPE to
3571 log entry/exit from the function body.
3572 (gcc::jit::recording::context::replay_into): Likewise.
3573 (gcc::jit::recording::context::disassociate_from_playback):
3575 (gcc::jit::recording::context::compile): Likewise.
3576 (recording::context::add_error_va): Likewise. Also, log the
3578 (gcc::jit::recording::context::validate): Use JIT_LOG_SCOPE to
3579 log entry/exit from the function body.
3580 * jit-recording.h: Include "jit-logging.h".
3581 (gcc::jit::recording::context): Make this be a subclass of
3583 * jit-result.c: Include "jit-common.h" and "jit-logging.h".
3584 (gcc::jit::result::result): Add logger param, recording it.
3585 Use JIT_LOG_SCOPE to log entry/exit from the function body.
3586 (gcc::jit::result::~result(): Use JIT_LOG_SCOPE to
3587 log entry/exit from the function body.
3588 (gcc::jit::result::get_code): Likewise.
3589 * jit-result.h (gcc::jit::result): Make this be a subclass of
3591 (gcc::jit::result::result): Add logger parameter.
3592 * libgccjit++.h (gccjit::context::set_logfile): New function.
3593 * libgccjit.c: Include "jit-logging.h".
3594 (gcc_jit_context_acquire): Log the context.
3595 (gcc_jit_context_release): Use JIT_LOG_FUNC to
3596 log entry/exit from the function body, and log the context.
3597 (gcc_jit_context_new_child_context): Likewise, logging both
3599 (gcc_jit_context_new_location): Use JIT_LOG_FUNC to
3600 log entry/exit from the function body.
3601 (gcc_jit_context_get_type): Likewise.
3602 (gcc_jit_context_get_int_type): Likewise.
3603 (gcc_jit_context_new_array_type): Likewise.
3604 (gcc_jit_context_new_field): Likewise.
3605 (gcc_jit_context_new_struct_type): Likewise.
3606 (gcc_jit_context_new_opaque_struct): Likewise.
3607 (gcc_jit_struct_set_fields): Likewise.
3608 (gcc_jit_context_new_union_type): Likewise.
3609 (gcc_jit_context_new_function_ptr_type): Likewise.
3610 (gcc_jit_context_new_param): Likewise.
3611 (gcc_jit_context_new_function): Likewise.
3612 (gcc_jit_context_get_builtin_function): Likewise.
3613 (gcc_jit_function_get_param): Likewise.
3614 (gcc_jit_function_dump_to_dot): Likewise.
3615 (gcc_jit_function_new_block): Likewise.
3616 (gcc_jit_context_new_global): Likewise.
3617 (gcc_jit_context_new_rvalue_from_int): Likewise.
3618 (gcc_jit_context_zero): Likewise.
3619 (gcc_jit_context_one): Likewise.
3620 (gcc_jit_context_new_rvalue_from_double): Likewise.
3621 (gcc_jit_context_new_rvalue_from_ptr): Likewise.
3622 (gcc_jit_context_null): Likewise.
3623 (gcc_jit_context_new_string_literal): Likewise.
3624 (gcc_jit_context_new_unary_op): Likewise.
3625 (gcc_jit_context_new_binary_op): Likewise.
3626 (gcc_jit_context_new_comparison): Likewise.
3627 (gcc_jit_context_new_call): Likewise.
3628 (gcc_jit_context_new_call_through_ptr): Likewise.
3629 (gcc_jit_context_new_cast): Likewise.
3630 (gcc_jit_context_new_array_access): Likewise.
3631 (gcc_jit_lvalue_access_field): Likewise.
3632 (gcc_jit_rvalue_access_field): Likewise.
3633 (gcc_jit_rvalue_dereference_field): Likewise.
3634 (gcc_jit_rvalue_dereference): Likewise.
3635 (gcc_jit_lvalue_get_address): Likewise.
3636 (gcc_jit_function_new_local): Likewise.
3637 (gcc_jit_block_add_eval): Likewise.
3638 (gcc_jit_block_add_assignment): Likewise.
3639 (gcc_jit_block_add_assignment_op): Likewise.
3640 (gcc_jit_block_end_with_conditional): Likewise.
3641 (gcc_jit_block_add_comment): Likewise.
3642 (gcc_jit_block_end_with_jump): Likewise.
3643 (gcc_jit_block_end_with_return): Likewise.
3644 (gcc_jit_block_end_with_void_return): Likewise.
3645 (gcc_jit_context_set_str_option): Likewise.
3646 (gcc_jit_context_set_int_option): Likewise.
3647 (gcc_jit_context_set_bool_option): Likewise.
3648 (gcc_jit_context_enable_dump): Likewise.
3649 (gcc_jit_context_compile): Likewise. Also log the context,
3651 (gcc_jit_context_dump_to_file): Likewise.
3652 (gcc_jit_context_set_logfile): New function.
3653 (gcc_jit_context_get_first_error): Use JIT_LOG_FUNC to
3654 log entry/exit from the function body.
3655 (gcc_jit_result_get_code): Likewise. Also log the fnname)
3656 and the ptr to be returned.
3657 (gcc_jit_result_release): Likewise. Also log the result.
3658 * libgccjit.h: Include <stdio.h>, since we need FILE *.
3659 (gcc_jit_context_set_logfile): New declaration.
3660 * libgccjit.map (gcc_jit_context_set_logfile): New.
3662 2015-01-07 David Malcolm <dmalcolm@redhat.com>
3664 * jit-recording.h (gcc::jit::recording::type::is_void): New
3666 (gcc::jit::recording::memento_of_get_type::is_void): New
3667 function, overriding default implementation.
3668 * libgccjit.c (gcc_jit_rvalue_dereference): Verify that
3669 the underlying type is not "void".
3671 2015-01-07 David Malcolm <dmalcolm@redhat.com>
3673 * docs/topics/expressions.rst (Unary Operations): Add
3674 GCC_JIT_UNARY_OP_ABS.
3675 * jit-playback.c (gcc::jit::playback::context::new_unary_op):
3677 * jit-recording.c (unary_op_strings): Likewise.
3678 * libgccjit.c (gcc_jit_context_new_unary_op): Update checking
3679 of "op" to reflect addition of GCC_JIT_UNARY_OP_ABS.
3680 * libgccjit.h (enum gcc_jit_unary_op): Add GCC_JIT_UNARY_OP_ABS.
3681 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3683 2015-01-07 David Malcolm <dmalcolm@redhat.com>
3685 * jit-recording.h (gcc::jit::recording::memento_of_get_type): Fix
3688 2015-01-07 David Malcolm <dmalcolm@redhat.com>
3690 * TODO.rst (Test suite): Remove item about running C++ testcases.
3691 * docs/internals/index.rst (Working on the JIT library): Add
3692 "c++" to the enabled languages in the suggested "configure"
3693 invocation, and add a description of why this is necessary.
3694 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3696 2015-01-07 David Malcolm <dmalcolm@redhat.com>
3698 * docs/internals/index.rst: Update to reflect that built
3699 testcases are now test-foo.c.exe, rather than test-foo.exe.
3700 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3702 2015-01-05 Jakub Jelinek <jakub@redhat.com>
3704 Update copyright years.
3706 2014-12-19 David Malcolm <dmalcolm@redhat.com>
3708 * jit-playback.c (gcc::jit::playback::context::build_cast): In
3709 case BOOLEAN_TYPE, don't assume that the source expression is
3712 2014-12-19 David Malcolm <dmalcolm@redhat.com>
3714 * jit-recording.c (gcc::jit::recording::context::context): When
3715 copying string options from a parent context, take a copy of the
3716 underlying buffers, rather than simply copying the pointer.
3718 2014-12-19 David Malcolm <dmalcolm@redhat.com>
3720 * jit-recording.c (gcc::jit::recording::context::set_str_option):
3723 2014-12-11 David Malcolm <dmalcolm@redhat.com>
3725 * docs/cp/topics/contexts.rst (gccjit::context::set_str_option):
3726 Document new function.
3727 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3729 2014-12-10 Ulrich Drepper <drepper@gmail.com>
3731 Minor interface cleanups of libgccjit
3732 * jit-playback.c (convert_to_dso): Use auto_vec instead
3733 of automatic array to build up command line.
3734 * jit-recording.c (recording::context::set_str_option):
3735 Make copy of the string.
3736 (recording::context::~context): Free string options.
3737 * jit-recording.h (recording::context): Adjust type
3738 of m_str_options member.
3739 * libgccjit.h: Adjust comment about
3740 gcc_jit_context_set_str_option parameter being used after
3742 Update comment now that all interfaces are copy strings
3744 * libgccjit++.h (gccjit::context): Add set_str_option
3747 2014-12-10 David Malcolm <dmalcolm@redhat.com>
3749 * docs/cp/index.rst: New file.
3750 * docs/cp/intro/index.rst: New file.
3751 * docs/cp/intro/tutorial01.rst: New file.
3752 * docs/cp/intro/tutorial02.rst: New file.
3753 * docs/cp/intro/tutorial03.rst: New file.
3754 * docs/cp/intro/tutorial04.rst: New file.
3755 * docs/cp/topics/contexts.rst: New file.
3756 * docs/cp/topics/expressions.rst: New file.
3757 * docs/cp/topics/functions.rst: New file.
3758 * docs/cp/topics/index.rst: New file.
3759 * docs/cp/topics/locations.rst: New file.
3760 * docs/cp/topics/objects.rst: New file.
3761 * docs/cp/topics/results.rst: New file.
3762 * docs/cp/topics/types.rst: New file.
3763 * docs/examples/tut01-hello-world.cc: New file.
3764 * docs/examples/tut02-square.c: Fix missing newline in output.
3765 * docs/examples/tut02-square.cc: New file.
3766 * docs/examples/tut03-sum-of-squares.cc: New file.
3767 * docs/examples/tut04-toyvm/toyvm.cc: New file.
3768 * docs/index.rst: Move summary to above the table of contents.
3769 Add text about the C vs C++ APIs.
3770 * docs/topics/contexts.rst: Fix a typo.
3772 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3773 * docs/_build/texinfo/factorial1.png: New file.
3774 * docs/_build/texinfo/sum-of-squares1.png: New file.
3776 2014-12-09 David Malcolm <dmalcolm@redhat.com>
3778 * docs/examples/tut04-toyvm/toyvm.c (toyvm_function_compile): Move
3779 logic for determine "funcname" to new function...
3780 (get_function_name): ...here, adding logic to skip any leading
3781 path from the filename.
3782 (toyvm_function_parse): Use the filename for fn_filename, rather
3783 than "name", so that the debugger can locate the source .toy
3785 (toyvm_function_parse): Don't fclose a NULL FILE *.
3787 2014-12-09 David Malcolm <dmalcolm@redhat.com>
3790 * docs/internals/index.rst (Running under valgrind): New
3792 (docs/_build/texinfo/libgccjit.texi): Regenerate.
3794 2014-12-09 David Malcolm <dmalcolm@redhat.com>
3797 * Make-lang.in (jit_OBJS): Add jit/jit-tempdir.o.
3798 * jit-common.h (gcc::jit::tempdir): New forward decl.
3799 * jit-playback.c: Include jit-tempdir.h.
3800 (gcc::jit::playback::context::context): Initialize m_tempdir.
3801 (gcc::jit::playback::context::~context): Move tempdir
3802 cleanup to new file jit-tempdir.c
3803 (make_tempdir_path_template): Move to new file jit-tempdir.c.
3804 (gcc::jit::playback::context::compile): Move tempdir creation
3805 to new tempdir object in new file jit-tempdir.c.
3806 (gcc::jit::playback::context::make_fake_args): Get path from
3807 tempdir object rather than from member data.
3808 (gcc::jit::playback::context::convert_to_dso): Likewise.
3809 (gcc::jit::playback::context::dlopen_built_dso): Likewise.
3810 (gcc::jit::playback::context::dump_generated_code): Likewise.
3811 (gcc::jit::playback::context::get_path_c_file): New function.
3812 (gcc::jit::playback::context::get_path_s_file): New function.
3813 (gcc::jit::playback::context::get_path_so_file): New function.
3814 * jit-playback.h (gcc::jit::playback::context::get_path_c_file):
3816 (gcc::jit::playback::context::get_path_s_file): New function.
3817 (gcc::jit::playback::context::get_path_so_file): New function.
3818 (gcc::jit::playback::context): Move fields "m_path_template",
3819 "m_path_tempdir", "m_path_c_file", "m_path_s_file",
3820 "m_path_so_file" to new jit::tempdir class; add field "m_tempdir".
3821 * jit-tempdir.c: New file.
3822 * jit-tempdir.h: New file.
3824 2014-12-09 David Malcolm <dmalcolm@redhat.com>
3826 * jit-playback.c (gcc::jit::playback::context::compile): Acquire the
3827 mutex here, immediately before using toplev, and release it here, on
3828 each exit path after acquisition.
3829 (jit_mutex): Move this variable here, from jit-recording.c.
3830 (gcc::jit::playback::context::acquire_mutex): New function, based on
3831 code in jit-recording.c.
3832 (gcc::jit::playback::context::release_mutex): Likewise.
3833 * jit-playback.h (gcc::jit::playback::context::acquire_mutex): New
3835 (gcc::jit::playback::context::release_mutex): New function.
3836 * jit-recording.c (jit_mutex): Move this variable to jit-playback.c.
3837 (gcc::jit::recording::context::compile): Move mutex-handling from
3838 here into jit-playback.c's gcc::jit::playback::context::compile.
3839 * notes.txt: Update to show the new locations of ACQUIRE_MUTEX
3842 2014-12-09 David Malcolm <dmalcolm@redhat.com>
3844 * jit-playback.c (gcc::jit::playback::context::compile): Move the
3846 (gcc::jit::playback::context::dlopen_built_dso): ...this new
3848 * jit-playback.h (gcc::jit::playback::context::dlopen_built_dso):
3851 2014-12-09 David Malcolm <dmalcolm@redhat.com>
3854 * docs/topics/contexts.rst (Debugging): Add description of
3855 gcc_jit_context_enable_dump.
3856 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3857 * jit-playback.c: Include context.h.
3858 (class auto_argvec): New class.
3859 (auto_argvec::~auto_argvec): New function.
3860 (gcc::jit::playback::context::compile): Convert fake_args to be
3861 an auto_argvec, so that it can contain dynamically-allocated
3862 strings. Construct a vec of all requested dumps, and pass it to
3863 make_fake_args. Extract requested dumps between the calls to
3864 toplev::main and toplev::finalize.
3865 (gcc::jit::playback::context::make_fake_args): Convert param
3866 "argvec" to be a vec <char *>, and gain a "requested_dumps"
3867 param. Convert to dynamically-allocated arg strings by converting
3868 ADD_ARG to take a copy of the arg, and add ADD_ARG_TAKE_OWNERSHIP
3869 for args that are already a copy. Add args for all requested dumps.
3870 (gcc::jit::playback::context::extract_any_requested_dumps): New
3872 (gcc::jit::playback::context::read_dump_file): New function.
3873 * jit-playback.h (gcc::jit::playback::context::make_fake_args):
3874 Convert param "argvec" to be a vec <char *>, and gain a
3875 "requested_dumps" param.
3876 (gcc::jit::playback::context::extract_any_requested_dumps): New
3878 (gcc::jit::playback::context::read_dump_file): New function.
3879 * jit-recording.c (gcc::jit::recording::context::enable_dump): New
3881 (gcc::jit::recording::context::get_all_requested_dumps): New
3883 * jit-recording.h (gcc::jit::recording::requested_dump): New
3885 (gcc::jit::recording::context::enable_dump): New function.
3886 (gcc::jit::recording::context::get_all_requested_dumps): New
3888 (gcc::jit::recording::context::m_requested_dumps): New field.
3889 * libgccjit.c (gcc_jit_context_enable_dump): New API entrypoint.
3890 * libgccjit.h (gcc_jit_context_enable_dump): New API entrypoint.
3891 * libgccjit.map (gcc_jit_context_enable_dump): New API entrypoint.
3893 2014-12-08 David Malcolm <dmalcolm@redhat.com>
3895 * libgccjit++.h: Indent the forward declarations of the classes to
3896 show the inheritance hierarchy.
3898 2014-12-08 David Malcolm <dmalcolm@redhat.com>
3900 * notes.txt: Show the beginning and ending of
3901 recording::context::compile vs playback::context::compile. Show
3902 the creation and unlinking of the tempdir. Show toplev::finalize.
3903 Move "RELEASE MUTEX" to the correct location. Show
3904 gcc_jit_result_release, and indicate where the
3905 dlopen/dlsym/dlclose occur.
3907 2014-12-01 David Malcolm <dmalcolm@redhat.com>
3909 * docs/examples/tut02-square.c (main): Release the context
3910 earlier, to show that this is possible. Update error-handling
3911 to avoid a double-release of the context, and to avoid
3912 releasing a NULL result.
3913 * docs/intro/tutorial02.rst: Discuss gcc_jit_context_release.
3914 * docs/topics/functions.rst (GCC_JIT_FUNCTION_EXPORTED): Emphasize
3915 * docs/topics/results.rst (gcc_jit_result): Mention that this
3916 controls the lifetimes of machine code functions.
3917 (gcc_jit_result_get_code): Spell out the requirements for this
3918 to succeed, and the lifetime of the result.
3919 (gcc_jit_result_release): Mention that this invalidates any code
3920 that was obtained from the result.
3921 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3923 2014-12-01 David Malcolm <dmalcolm@redhat.com>
3926 * docs/intro/tutorial02.rst: Spell out lifetime of generated code.
3927 Add description of error-handling, taken in part from...
3928 * docs/topics/contexts.rst (Error-handling): Expand, and move some
3929 content to tutorial02.rst.
3930 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3932 2014-12-01 David Malcolm <dmalcolm@redhat.com>
3935 * docs/topics/types.rst (Standard types) Add new enum values to
3936 the table of enum gcc_jit_types: GCC_JIT_TYPE_COMPLEX_FLOAT,
3937 GCC_JIT_TYPE_COMPLEX_DOUBLE, GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE.
3938 Widen the left-hand column so that
3939 GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE will fit.
3940 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3942 * jit-builtins.c: Include stringpool.h and jit-playback.h.
3943 Move everything out of the gcc::jit::recording namespace into
3945 (struct builtin_data): Add fields "fnclass", "attr", and
3947 (DEF_BUILTIN): Update macro so populate the new fields.
3948 (builtins_manager::builtins_manager): Update for move out of
3949 recording namespace. Initialize the m_attributes array.
3950 (builtins_manager::get_builtin_function): Likewise.
3951 (builtins_manager::get_builtin_function_by_id): New function.
3952 (builtins_manager::make_builtin_function): Update for move out of
3953 recording namespace. Add fix for PR jit/64020 by detecting
3954 specific builtin ids and having them ensure that builtins for
3955 other ids are created as necessary.
3956 (builtins_manager::get_type): Update for move out of recording
3958 (builtins_manager::make_type): Likewise. Add some missing
3960 (builtins_manager::make_primitive_type): Update for move out of
3961 recording namespace. Implement the three BT_COMPLEX_ cases and
3963 (builtins_manager::make_fn_type): Update for move out of recording
3965 (builtins_manager::make_ptr_type): Likewise.
3966 (builtins_manager::finish_playback): New function.
3967 (builtins_manager::get_class): New function.
3968 (builtins_manager::implicit_p): New function.
3969 (builtins_manager::get_attrs_tree): Two new functions.
3970 (builtins_manager::make_attrs_tree): New function.
3972 * jit-builtins.h: Move everything out of the gcc::jit::recording
3973 namespace into just gcc::jit.
3974 (enum built_in_attribute): New.
3975 (builtins_manager::builtins_manager): Update decl for namespace
3977 (builtins_manager::get_builtin_function): Likewise.
3978 (builtins_manager::get_class): New.
3979 (builtins_manager::implicit_p): New.
3980 (builtins_manager::get_attrs_tree): Two new functions.
3981 (builtins_manager::make_attrs_tree): New function.
3982 (builtins_manager::finish_playback): New.
3983 (builtins_manager::get_builtin_function_by_id): New.
3984 (builtins_manager::make_builtin_function): Update decl for
3986 (builtins_manager::get_type): Likewise.
3987 (builtins_manager::make_type): Likewise.
3988 (builtins_manager::make_primitive_type): Likewise.
3989 (builtins_manager::make_fn_type): Likewise.
3990 (builtins_manager::make_ptr_type): Likewise.
3991 (builtins_manager): Likewise for fields. Add new field
3994 * jit-common.h (NUM_GCC_JIT_TYPES): Update.
3995 (builtins_manager): Update forward decl to reflect namespace
3998 * jit-playback.c: Include attribs.h and jit-builtins.h.
3999 (gcc::jit::playback::context::get_tree_node_for_type): Add cases
4000 for the new COMPLEX_ types.
4001 (gcc::jit::playback::context::new_function): If creating a
4002 builtin, set the DECL_BUILT_IN_CLASS and attributes on the fndecl,
4003 and call set_builtin_decl.
4004 (gcc::jit::playback::context::replay): If we have a
4005 builtins_manager, call its finish_playback method when we're done.
4008 (gcc::jit::playback::context::get_builtins_manager): New function.
4011 (gcc::jit::recording::context::get_builtins_manager): New function.
4012 (gcc::jit::recording::get_builtin_function): Use
4013 get_builtins_manager, in case we're a child context.
4014 (gcc::jit::recording::memento_of_get_type::dereference): Add the
4016 (gcc::jit::recording::memento_of_get_type::is_int): Likewise.
4017 (gcc::jit::recording::memento_of_get_type::is_float): Likewise.
4018 (gcc::jit::recording::memento_of_get_type::is_bool): Likewise.
4019 (get_type_strings): Likewise.
4022 (gcc::jit::recording::context::get_builtins_manager): New.
4024 * libgccjit.h (enum gcc_jit_types): Add
4025 GCC_JIT_TYPE_COMPLEX_FLOAT, GCC_JIT_TYPE_COMPLEX_DOUBLE,
4026 GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE.
4028 2014-12-01 David Malcolm <dmalcolm@redhat.com>
4031 (gcc::jit::recording::builtins_manager::get_builtin_function):
4032 Check for NULL return from make_builtin_function.
4033 (gcc::jit::recording::builtins_manager::make_builtin_function):
4034 Check for NULL return from get_type.
4036 2014-12-01 David Malcolm <dmalcolm@redhat.com>
4038 * jit-playback.c (gcc::jit::playback::context::compile): Move DSO
4039 creation code into...
4040 (gcc::jit::playback::context::convert_to_dso): New function.
4041 * jit-playback.h (gcc::jit::playback::context::convert_to_dso):
4044 2014-12-01 David Malcolm <dmalcolm@redhat.com>
4046 * jit-playback.c (gcc::jit::playback::context::compile): Use an
4047 auto_vec<const char *> rather than a const char *[20] for the
4048 top-level argv, and move the logic to build it to...
4049 (gcc::jit::playback::context::make_fake_args): New function.
4050 * jit-playback.h (gcc::jit::playback::context::make_fake_args):
4053 2014-12-01 David Malcolm <dmalcolm@redhat.com>
4055 * Make-lang.in (jit_OBJS): Add jit/jit-result.o.
4056 * jit-playback.c: Include new header jit-result.h.
4057 (gcc::jit::result::result): Move to new file jit-result.c.
4058 (gcc::jit::result::~result): Likewise.
4059 (gcc::jit::playback::result): Likewise.
4060 * jit-recording.h (class gcc::jit::result): Move to new
4061 header jit-result.h.
4062 * jit-result.c: New file, to contain...
4063 (gcc::jit::result::result): Move here from jit-playback.c,
4064 removing erroneous "playback" namespace from comment.
4065 (gcc::jit::result::~result): Likewise.
4066 (gcc::jit::playback::result): Likewise.
4067 * jit-result.h: New file, to contain...
4068 (class gcc::jit::result): Move from jit-recording.h.
4069 * libgccjit.c: Include jit-result.h.
4070 (gcc_jit_result_get_code): Update comment to reflect move
4072 (gcc_jit_result_release): Likewise.
4074 2014-12-01 David Malcolm <dmalcolm@redhat.com>
4077 * docs/examples/tut04-toyvm/toyvm.c
4078 (toyvm_compiled_function): New typedef.
4079 (toyvm_compiled_func) Rename to...
4080 (toyvm_compiled_code) ...this.
4081 (struct toyvm_compiled_function): New struct.
4082 (toyvm_function_compile): Return a toyvm_compiled_function *
4083 rather than a toyvm_compiled_func, so that the caller can fully
4084 clean things up. Free "funcname".
4085 (test_script): Update for change to toyvm_function_compile.
4086 Clean up the toyvm_compiled_function.
4088 (docs/intro/tutorial04.rst): Update to reflect the above changes,
4089 and to better spell out the lifetime of the compiled code.
4091 2014-12-01 David Malcolm <dmalcolm@redhat.com>
4095 (gcc::jit::recording::builtins_manager::make_fn_type): Call the
4096 context's new_function_type method, rather than directly creating
4097 a function_type instance.
4099 (gcc::jit::recording::context::new_function_type): New method,
4100 adapted from part of...
4101 (gcc::jit::recording::context::new_function_ptr_type): ...this.
4102 Update to call new_function_type.
4104 (gcc::jit::recording::context::new_function_type): New method.
4106 2014-12-01 David Malcolm <dmalcolm@redhat.com>
4109 * jit-playback.c: Ensure that ctxt_progname is non-NULL.
4111 2014-11-19 David Malcolm <dmalcolm@redhat.com>
4114 * jit-playback.c (gcc::jit::playback::compound_type::set_fields):
4115 Convert param from const vec<playback::field *> & to
4116 const auto_vec<playback::field *> *.
4117 (gcc::jit::playback::context::new_function_type): Convert param
4118 "param_types" from vec<type *> * to const auto_vec<type *> *.
4119 (gcc::jit::playback::context::new_function): Convert param
4120 "params" from vec<param *> * to const auto_vec<param *> *.
4121 (gcc::jit::playback::context::build_call): Convert param "args"
4122 from vec<rvalue *> to const auto_vec<rvalue *> *.
4123 (gcc::jit::playback::context::new_call): Likewise.
4124 (gcc::jit::playback::context::new_call_through_ptr): Likewise.
4125 (wrapper_finalizer): New function.
4126 (gcc::jit::playback::wrapper::operator new): Call the finalizer
4127 variant of ggc_internal_cleared_alloc, supplying
4129 (gcc::jit::playback::function::finalizer): New.
4130 (gcc::jit::playback::block::finalizer): New.
4131 (gcc::jit::playback::source_file::finalizer): New.
4132 (gcc::jit::playback::source_line::finalizer): New.
4135 (gcc::jit::playback::context::new_function_type): Convert param
4136 "param_types" from vec<type *> * to const auto_vec<type *> *.
4137 (gcc::jit::playback::context::new_function): Convert param
4138 "params" from vec<param *> * to const auto_vec<param *> *.
4139 (gcc::jit::playback::context::new_call): Convert param
4140 "args" from vec<rvalue *> to const auto_vec<rvalue *> *.
4141 (gcc::jit::playback::context::new_call_through_ptr): Likewise.
4142 (gcc::jit::playback::context::build_call): Likewise.
4143 (gcc::jit::playback::context): Convert fields "m_functions",
4144 "m_source_files", "m_cached_locations" from vec to auto_vec.
4145 (gcc::jit::playback::wrapper::finalizer): New virtual function.
4146 (gcc::jit::playback::compound_type::set_fields): Convert param fro
4147 const vec<playback::field *> & to
4148 const auto_vec<playback::field *> *.
4149 (gcc::jit::playback::function::finalizer): New.
4150 (gcc::jit::playback::block::finalizer): New.
4151 (gcc::jit::playback::source_file::finalizer): New.
4152 (gcc::jit::playback::source_line::finalizer): New.
4155 (gcc::jit::recording::function_type::replay_into): Convert local
4156 from a vec into an auto_vec.
4157 (gcc::jit::recording::fields::replay_into): Likewise.
4158 (gcc::jit::recording::function::replay_into): Likewise.
4159 (gcc::jit::recording::call::replay_into): Likewise.
4160 (gcc::jit::recording::call_through_ptr::replay_into): Likewise.
4162 * jit-recording.h (gcc::jit::recording::context): Convert fields
4163 "m_mementos", "m_compound_types", "m_functions" from vec<> to
4165 (gcc::jit::recording::function_type::get_param_types): Convert
4166 return type from vec<type *> to const vec<type *> &.
4167 (gcc::jit::recording::function_type): Convert field
4168 "m_param_types" from a vec<> to an auto_vec<>.
4169 (gcc::jit::recording::fields): Likewise for field "m_fields".
4170 (gcc::jit::recording::function::get_params): Convert return type
4171 from vec <param *> to const vec<param *> &.
4172 (gcc::jit::recording::function): Convert fields "m_params",
4173 "m_locals", "m_blocks" from vec<> to auto_vec<>.
4174 (gcc::jit::recording::block): Likewise for field "m_statements".
4175 vec<> to auto_vec<>.
4176 (gcc::jit::recording::call): Likewise for field "m_args".
4177 (gcc::jit::recording::call_through_ptr): Likewise.
4179 2014-11-19 David Malcolm <dmalcolm@redhat.com>
4182 * jit-recording.c (recording::function::validate): Convert
4183 "worklist" from vec<> to autovec<> to fix a leak.
4185 2014-11-11 David Malcolm <dmalcolm@redhat.com>
4187 * ChangeLog.jit: New.
4189 * Make-lang.in: New.
4191 * config-lang.in: New.
4192 * docs/Makefile: New.
4193 * docs/_build/texinfo/Makefile: New.
4194 * docs/_build/texinfo/factorial.png: New.
4195 * docs/_build/texinfo/libgccjit.texi: New.
4196 * docs/_build/texinfo/sum-of-squares.png: New.
4197 * docs/conf.py: New.
4198 * docs/examples/tut01-hello-world.c: New.
4199 * docs/examples/tut02-square.c: New.
4200 * docs/examples/tut03-sum-of-squares.c: New.
4201 * docs/examples/tut04-toyvm/Makefile: New.
4202 * docs/examples/tut04-toyvm/factorial.toy: New.
4203 * docs/examples/tut04-toyvm/fibonacci.toy: New.
4204 * docs/examples/tut04-toyvm/toyvm.c: New.
4205 * docs/index.rst: New.
4206 * docs/internals/index.rst: New.
4207 * docs/intro/factorial.png: New.
4208 * docs/intro/index.rst: New.
4209 * docs/intro/sum-of-squares.png: New.
4210 * docs/intro/tutorial01.rst: New.
4211 * docs/intro/tutorial02.rst: New.
4212 * docs/intro/tutorial03.rst: New.
4213 * docs/intro/tutorial04.rst: New.
4214 * docs/topics/contexts.rst: New.
4215 * docs/topics/expressions.rst: New.
4216 * docs/topics/functions.rst: New.
4217 * docs/topics/index.rst: New.
4218 * docs/topics/locations.rst: New.
4219 * docs/topics/objects.rst: New.
4220 * docs/topics/results.rst: New.
4221 * docs/topics/types.rst: New.
4222 * dummy-frontend.c: New.
4223 * jit-builtins.c: New.
4224 * jit-builtins.h: New.
4225 * jit-common.h: New.
4226 * jit-playback.c: New.
4227 * jit-playback.h: New.
4228 * jit-recording.c: New.
4229 * jit-recording.h: New.
4230 * libgccjit++.h: New.
4233 * libgccjit.map: New.
4236 2013-07-26 David Malcolm <dmalcolm@redhat.com>
4240 Copyright (C) 2013-2024 Free Software Foundation, Inc.
4242 Copying and distribution of this file, with or without modification,
4243 are permitted in any medium without royalty provided the copyright
4244 notice and this notice are preserved.