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