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