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