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