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