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