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