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