]> git.ipfire.org Git - thirdparty/gcc.git/blame_incremental - gcc/jit/ChangeLog
libstdc++: Implement ranges::shift_left/right from P2440R1
[thirdparty/gcc.git] / gcc / jit / ChangeLog
... / ...
CommitLineData
12025-04-28 David Malcolm <dmalcolm@redhat.com>
2
3 * dummy-frontend.cc: Drop include of "make-unique.h".
4 Replace uses of ::make_unique with std::make_unique.
5
62025-03-29 Iain Sandoe <iain@sandoe.co.uk>
7
8 * libgccjit.exports: Add symbols for ABI 28 to 34.
9
102025-03-13 Matthias Klose <doko@ubuntu.com>
11
12 * Make-lang.in (LIBGCCJIT_VERSION_NUM): Move to ../Makefile.in.
13
142025-02-13 David Malcolm <dmalcolm@redhat.com>
15
16 PR other/116613
17 * dummy-frontend.cc
18 (jit_diagnostic_listener::on_report_diagnostic): Add
19 "final override".
20
212025-02-07 Richard Biener <rguenther@suse.de>
22
23 PR jit/118780
24 * jit-playback.cc: Define INCLUDE_DLFCN_H.
25 * jit-result.cc: Likewise.
26
272025-01-24 David Malcolm <dmalcolm@redhat.com>
28
29 PR jit/117886
30 * jit-recording.cc (reproducer::get_identifier_as_rvalue): Handle
31 null memento.
32 (reproducer::get_identifier_as_lvalue): Likewise.
33 (reproducer::get_identifier_as_type): Likewise.
34 (recording::ctor::write_reproducer): Use get_identifier_as_rvalue
35 rather than get_identifier when writing out gcc_jit_rvalue *
36 expressions.
37
382025-01-22 David Malcolm <dmalcolm@redhat.com>
39
40 * dummy-frontend.cc (tree_type_to_jit_type): For POINTER_TYPE,
41 bail out if the inner call to tree_type_to_jit_type fails.
42 Don't abort on unknown types.
43 (jit_langhook_pushdecl): Replace gcc_unreachable with return of
44 NULL_TREE.
45
462024-11-22 Andrew Pinski <quic_apinski@quicinc.com>
47
48 PR bootstrap/117737
49 * dummy-frontend.cc (INCLUDE_MEMORY): Remove.
50 * jit-playback.cc (INCLUDE_MEMORY): Remove.
51 * jit-recording.cc (INCLUDE_MEMORY): Remove.
52
532024-11-20 Antoni Boucher <bouanto@zoho.com>
54
55 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_34): New ABI tag.
56 * docs/topics/contexts.rst: Document gcc_jit_context_set_output_ident.
57 * jit-playback.cc (set_output_ident): New method.
58 * jit-playback.h (set_output_ident): New method.
59 * jit-recording.cc (recording::context::set_output_ident,
60 recording::output_ident::output_ident,
61 recording::output_ident::~output_ident,
62 recording::output_ident::replay_into,
63 recording::output_ident::make_debug_string,
64 recording::output_ident::write_reproducer): New methods.
65 * jit-recording.h (class output_ident): New class.
66 * libgccjit.cc (gcc_jit_context_set_output_ident): New function.
67 * libgccjit.h (gcc_jit_context_set_output_ident): New function.
68 * libgccjit.map: New function.
69
702024-01-18 Antoni Boucher <bouanto@zoho.com>
71
72 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_33): New ABI tag.
73 * docs/topics/functions.rst: Document gcc_jit_function_new_temp.
74 * jit-playback.cc (new_local): Add support for temporary
75 variables.
76 * jit-recording.cc (recording::function::new_temp): New method.
77 (recording::local::write_reproducer): Support temporary
78 variables.
79 * jit-recording.h (new_temp): New method.
80 * libgccjit.cc (gcc_jit_function_new_temp): New function.
81 * libgccjit.h (gcc_jit_function_new_temp): New function.
82 * libgccjit.map: New function.
83
842024-11-20 Antoni Boucher <bouanto@zoho.com>
85
86 PR jit/108762
87 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_32): New ABI tag.
88 * docs/topics/functions.rst: Add documentation for the function
89 gcc_jit_context_get_target_builtin_function.
90 * dummy-frontend.cc: Include headers target.h, jit-recording.h,
91 print-tree.h, unordered_map and string, new variables (target_builtins,
92 target_function_types, and target_builtins_ctxt), new function
93 (tree_type_to_jit_type).
94 * jit-builtins.cc: Specify that the function types are not from
95 target builtins.
96 * jit-playback.cc: New argument is_target_builtin to new_function.
97 * jit-playback.h: New argument is_target_builtin to
98 new_function.
99 * jit-recording.cc: New argument is_target_builtin to
100 new_function_type, function_type constructor and function
101 constructor, new function
102 (get_target_builtin_function).
103 * jit-recording.h: Include headers string and unordered_map, new
104 variable target_function_types, new argument is_target_builtin
105 to new_function_type, function_type and function, new functions
106 (get_target_builtin_function, copy).
107 * libgccjit.cc: New function
108 (gcc_jit_context_get_target_builtin_function).
109 * libgccjit.h: New function
110 (gcc_jit_context_get_target_builtin_function).
111 * libgccjit.map: New functions
112 (gcc_jit_context_get_target_builtin_function).
113
1142024-11-20 Antoni Boucher <bouanto@zoho.com>
115
116 * jit-common.h: Add forward declaration of memento_of_get_aligned.
117 * jit-recording.h (type::is_same_type_as): Compare integer
118 types.
119 (dyn_cast_aligned_type): New method.
120 (type::is_aligned, memento_of_get_aligned::is_same_type_as,
121 memento_of_get_aligned::is_aligned): new methods.
122
1232024-11-20 Antoni Boucher <bouanto@zoho.com>
124
125 * docs/topics/contexts.rst: Add documentation for new option.
126 * jit-recording.cc (recording::context::get_str_option): New
127 method.
128 * jit-recording.h (get_str_option): New method.
129 * libgccjit.cc (gcc_jit_context_new_function): Allow special
130 characters in function names.
131 * libgccjit.h (enum gcc_jit_str_option): New option.
132
1332024-11-20 Antoni Boucher <bouanto@zoho.com>
134
135 PR jit/112602
136 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_31): New ABI tag.
137 * docs/topics/expressions.rst: Document
138 gcc_jit_context_new_rvalue_vector_perm and
139 gcc_jit_context_new_vector_access.
140 * jit-playback.cc (playback::context::new_rvalue_vector_perm,
141 common_mark_addressable_vec,
142 gnu_vector_type_p,
143 lvalue_p,
144 convert_vector_to_array_for_subscript,
145 new_vector_access): new functions.
146 * jit-playback.h (new_rvalue_vector_perm, new_vector_access):
147 New functions.
148 * jit-recording.cc (recording::context::new_rvalue_vector_perm,
149 recording::context::new_vector_access,
150 memento_of_new_rvalue_vector_perm,
151 recording::memento_of_new_rvalue_vector_perm::replay_into,
152 recording::memento_of_new_rvalue_vector_perm::visit_children,
153 recording::memento_of_new_rvalue_vector_perm::make_debug_string,
154 recording::memento_of_new_rvalue_vector_perm::write_reproducer,
155 recording::vector_access::replay_into,
156 recording::vector_access::visit_children,
157 recording::vector_access::make_debug_string,
158 recording::vector_access::write_reproducer): New methods.
159 * jit-recording.h (class memento_of_new_rvalue_vector_perm,
160 class vector_access): New classes.
161 * libgccjit.cc (gcc_jit_context_new_vector_access,
162 gcc_jit_context_new_rvalue_vector_perm): New functions.
163 * libgccjit.h (gcc_jit_context_new_rvalue_vector_perm,
164 gcc_jit_context_new_vector_access): New functions.
165 * libgccjit.map: New functions.
166
1672024-11-20 Antoni Boucher <bouanto@zoho.com>
168
169 PR jit/113343
170 * jit-playback.cc (new_rvalue_from_const): Fix to have the
171 correct value when cross-compiling.
172
1732024-11-20 Antoni Boucher <bouanto@zoho.com>
174
175 * libgccjit.cc (RETURN_IF_FAIL_PRINTF3): New macro.
176 (gcc_jit_block_add_assignment_op): Add numeric checks.
177
1782024-11-20 Antoni Boucher <bouanto@zoho.com>
179
180 * dummy-frontend.cc (jit_langhook_init): Send flag_signed_char
181 argument to build_common_tree_nodes.
182
1832024-11-04 Antoni Boucher <bouanto@zoho.com>
184
185 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_30): New ABI tag.
186 * docs/topics/expressions.rst: Document gcc_jit_context_convert_vector.
187 * jit-playback.cc (convert_vector): New method.
188 * jit-playback.h: New method.
189 * jit-recording.cc (recording::context::new_convert_vector,
190 recording::convert_vector::replay_into,
191 recording::convert_vector::visit_children,
192 recording::convert_vector::make_debug_string,
193 recording::convert_vector::write_reproducer): New methods.
194 * jit-recording.h (class convert_vector): New class.
195 (context::new_convert_vector): New method.
196 * libgccjit.cc (gcc_jit_context_convert_vector): New function.
197 * libgccjit.h (gcc_jit_context_convert_vector): New function.
198 * libgccjit.map: New function.
199
2002024-11-04 Antoni Boucher <bouanto@zoho.com>
201
202 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_29): New ABI tag.
203 * docs/topics/expressions.rst: Document gcc_jit_global_set_readonly.
204 * jit-playback.cc (global_new_decl, new_global,
205 new_global_initialized): New parameter readonly.
206 * jit-playback.h (global_new_decl, new_global,
207 new_global_initialized): New parameter readonly.
208 * jit-recording.cc (recording::global::replay_into): Use
209 m_readonly.
210 (recording::global::write_reproducer): Dump reproducer for
211 gcc_jit_global_set_readonly.
212 * jit-recording.h (get_readonly, set_readonly): New methods.
213 (m_readonly): New attribute.
214 * libgccjit.cc (gcc_jit_global_set_readonly): New function.
215 (gcc_jit_block_add_assignment): Check that we don't assign to a
216 readonly variable.
217 * libgccjit.h (gcc_jit_global_set_readonly): New function.
218 (LIBGCCJIT_HAVE_gcc_jit_global_set_readonly): New define.
219 * libgccjit.map: New function.
220
2212024-11-04 Antoni Boucher <bouanto@zoho.com>
222
223 * jit-builtins.cc (ensure_optimization_builtins_exist): Add
224 missing builtins.
225
2262024-10-29 David Malcolm <dmalcolm@redhat.com>
227
228 PR other/116613
229 * dummy-frontend.cc: Include "make-unique.h".
230 (class jit_diagnostic_listener): New.
231 (jit_begin_diagnostic): Update comment.
232 (jit_end_diagnostic): Drop call to add_diagnostic.
233 (jit_langhook_init): Set the output format to a new
234 jit_diagnostic_listener.
235 * jit-playback.cc (playback::context::add_diagnostic): Add "text"
236 param and use that rather than trying to get the text from a
237 pretty_printer.
238 * jit-playback.h (playback::context::add_diagnostic): Add "text"
239 param.
240
2412024-10-25 Jakub Jelinek <jakub@redhat.com>
242
243 * docs/examples/tut04-toyvm/toyvm.cc: Remove trailing whitespace.
244
2452024-10-24 David Malcolm <dmalcolm@redhat.com>
246 Gaius Mulley <gaiusmod2@gmail.com>
247
248 PR other/116613
249 * dummy-frontend.cc: Add #define INCLUDE_MEMORY.
250 * jit-playback.cc: Likewise.
251 * jit-recording.cc: Likewise.
252
2532024-09-20 David Malcolm <dmalcolm@redhat.com>
254
255 PR other/116613
256 * dummy-frontend.cc: Include "diagnostic-format-text.h".
257 (jit_begin_diagnostic): Convert first param from
258 diagnostic_context * to diagnostic_text_output_format &
259 (jit_end_diagnostic): Likewise. Update accordingly.
260 (jit_langhook_init): Update for renamings.
261
2622024-09-18 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
263
264 * libgccjit.h: Include <sys/types.h>
265
2662024-09-09 David Malcolm <dmalcolm@redhat.com>
267
268 PR other/116613
269 * jit-playback.cc (add_diagnostic): Rename diagnostic_context's
270 "printer" field to "m_printer".
271
2722024-09-02 Richard Sandiford <richard.sandiford@arm.com>
273
274 * jit-playback.cc (playback::block::add_extended_asm): Rename
275 ASM_INPUT_P to ASM_BASIC_P.
276
2772024-07-24 David Malcolm <dmalcolm@redhat.com>
278
279 * jit-playback.cc (jit::playback_context::compile) Add a trailing
280 null to argvec.
281
2822024-07-05 Antoni Boucher <bouanto@zoho.com>
283
284 * jit-common.h: Add array_type class.
285 * jit-recording.h (type::dyn_cast_array_type,
286 memento_of_get_aligned::dyn_cast_array_type,
287 array_type::dyn_cast_array_type, array_type::is_same_type_as):
288 New methods.
289
2902024-07-05 Antoni Boucher <bouanto@zoho.com>
291
292 PR jit/112574
293 * docs/topics/types.rst: Document GCC_JIT_TYPE_BFLOAT16.
294 * jit-common.h: Update NUM_GCC_JIT_TYPES.
295 * jit-playback.cc (get_tree_node_for_type): Support bfloat16.
296 * jit-recording.cc (recording::memento_of_get_type::get_size,
297 recording::memento_of_get_type::dereference,
298 recording::memento_of_get_type::is_int,
299 recording::memento_of_get_type::is_signed,
300 recording::memento_of_get_type::is_float,
301 recording::memento_of_get_type::is_bool): Support bfloat16.
302 * libgccjit.h (enum gcc_jit_types): Add GCC_JIT_TYPE_BFLOAT16.
303
3042024-06-29 Iain Sandoe <iain@sandoe.co.uk>
305
306 * jit-recording.cc
307 (recording::memento_of_typeinfo::make_debug_string): Default the value
308 of ident.
309 (recording::memento_of_typeinfo::write_reproducer): Default the value
310 of type.
311
3122024-06-27 Antoni Boucher <bouanto@zoho.com>
313
314 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_28): New ABI tag.
315 * docs/topics/expressions.rst: Document gcc_jit_context_new_alignof.
316 * jit-playback.cc (new_alignof): New method.
317 * jit-playback.h: New method.
318 * jit-recording.cc (recording::context::new_alignof): New
319 method.
320 (recording::memento_of_sizeof::replay_into,
321 recording::memento_of_typeinfo::replay_into,
322 recording::memento_of_sizeof::make_debug_string,
323 recording::memento_of_typeinfo::make_debug_string,
324 recording::memento_of_sizeof::write_reproducer,
325 recording::memento_of_typeinfo::write_reproducer): Rename.
326 * jit-recording.h (enum type_info_type): New enum.
327 (class memento_of_sizeof class memento_of_typeinfo): Rename.
328 * libgccjit.cc (gcc_jit_context_new_alignof): New function.
329 * libgccjit.h (gcc_jit_context_new_alignof): New function.
330 * libgccjit.map: New function.
331
3322024-06-25 Kewen Lin <linkw@linux.ibm.com>
333
334 * jit-recording.cc (recording::memento_of_get_type::get_size): Update
335 macros {FLOAT,DOUBLE,LONG_DOUBLE}_TYPE_SIZE by calling
336 targetm.c.mode_for_floating_type with
337 TI_{FLOAT,DOUBLE,LONG_DOUBLE}_TYPE.
338
3392024-06-12 David Malcolm <dmalcolm@redhat.com>
340
341 * jit-recording.cc (recording::function::dump_to_dot): Update for
342 fields of pretty_printer becoming private.
343
3442024-06-11 Andrew Pinski <quic_apinski@quicinc.com>
345
346 PR jit/115442
347 * jit-recording.cc: Define INCLUDE_SSTREAM before including
348 system.h and don't directly incldue sstream.
349
3502024-04-09 Jakub Jelinek <jakub@redhat.com>
351
352 * docs/topics/expressions.rst (Constructor expressions): Fix
353 duplicated words; have have -> have.
354
3552024-04-02 Iain Sandoe <iain@sandoe.co.uk>
356
357 * Make-lang.in: Implement exports list, and use a shared
358 libgcc.
359 * libgccjit.exports: New file.
360
3612024-03-29 Guillaume Gomez <guillaume1.gomez@gmail.com>
362
363 * libgccjit.cc (gcc_jit_type_get_size): Add pointer support
364
3652024-02-10 Jakub Jelinek <jakub@redhat.com>
366
367 * jit-playback.cc (new_bitcast): Use HOST_WIDE_INT_PRINT_DEC instead
368 of "%ld" and casts to long.
369
3702024-02-02 Antoni Boucher <bouanto@zoho.com>
371
372 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_27): New ABI tag.
373 * docs/topics/expressions.rst: Document gcc_jit_context_new_sizeof.
374 * jit-playback.cc (new_sizeof): New method.
375 * jit-playback.h (new_sizeof): New method.
376 * jit-recording.cc (recording::context::new_sizeof,
377 recording::memento_of_sizeof::replay_into,
378 recording::memento_of_sizeof::make_debug_string,
379 recording::memento_of_sizeof::write_reproducer): New methods.
380 * jit-recording.h (class memento_of_sizeof): New class.
381 * libgccjit.cc (gcc_jit_context_new_sizeof): New function.
382 * libgccjit.h (gcc_jit_context_new_sizeof): New function.
383 * libgccjit.map: New function.
384
3852024-01-19 Antoni Boucher <bouanto@zoho.com>
386
387 * jit-builtins.cc (ensure_optimization_builtins_exist): Add
388 popcount builtins.
389
3902024-01-19 Antoni Boucher <bouanto@zoho.com>
391
392 * jit-recording.h (is_numeric_vector, vector_type::new_int): New
393 functions.
394 * libgccjit.cc (gcc_jit_context_new_unary_op,
395 gcc_jit_context_new_binary_op): add checks for
396 is_numeric_vector.
397
3982024-01-12 Guillaume Gomez <guillaume1.gomez@gmail.com>
399 Antoni Boucher <bouanto@zoho.com>
400
401 * docs/topics/compatibility.rst: Add documentation for LIBGCCJIT_ABI_26.
402 * docs/topics/functions.rst: Add documentation for new functions.
403 * docs/topics/expressions.rst: Add documentation for new functions.
404
4052024-01-12 Guillaume Gomez <guillaume1.gomez@gmail.com>
406 Antoni Boucher <bouanto@zoho.com>
407
408 * dummy-frontend.cc (handle_alias_attribute): New function.
409 (handle_always_inline_attribute): New function.
410 (handle_cold_attribute): New function.
411 (handle_fnspec_attribute): New function.
412 (handle_format_arg_attribute): New function.
413 (handle_format_attribute): New function.
414 (handle_noinline_attribute): New function.
415 (handle_target_attribute): New function.
416 (handle_used_attribute): New function.
417 (handle_visibility_attribute): New function.
418 (handle_weak_attribute): New function.
419 (handle_alias_ifunc_attribute): New function.
420 * jit-playback.cc (fn_attribute_to_string): New function.
421 (variable_attribute_to_string): New function.
422 (global_new_decl): Add attributes support.
423 (set_variable_attribute): New function.
424 (new_global): Add attributes support.
425 (new_global_initialized): Add attributes support.
426 (new_local): Add attributes support.
427 * jit-playback.h (fn_attribute_to_string): New function.
428 (set_variable_attribute): New function.
429 * jit-recording.cc (recording::lvalue::add_attribute): New function.
430 (recording::function::function): New function.
431 (recording::function::write_to_dump): Add attributes support.
432 (recording::function::add_attribute): New function.
433 (recording::function::add_string_attribute): New function.
434 (recording::function::add_integer_array_attribute): New function.
435 (recording::global::replay_into): Add attributes support.
436 (recording::local::replay_into): Add attributes support.
437 * jit-recording.h: Add attributes support.
438 * libgccjit.cc (gcc_jit_function_add_attribute): New function.
439 (gcc_jit_function_add_string_attribute): New function.
440 (gcc_jit_function_add_integer_array_attribute): New function.
441 (gcc_jit_lvalue_add_attribute): New function.
442 * libgccjit.h (enum gcc_jit_fn_attribute): New enum.
443 (gcc_jit_function_add_attribute): New function.
444 (gcc_jit_function_add_string_attribute): New function.
445 (gcc_jit_function_add_integer_array_attribute): New function.
446 (enum gcc_jit_variable_attribute): New function.
447 (gcc_jit_lvalue_add_string_attribute): New function.
448 * libgccjit.map: Declare new functions.
449
4502023-12-06 David Malcolm <dmalcolm@redhat.com>
451
452 * dummy-frontend.cc (jit_begin_diagnostic): Make diagnostic_info
453 param const.
454 (jit_end_diagnostic): Likewise. Pass to add_diagnostic by
455 reference.
456 * jit-playback.cc (jit::playback::context::add_diagnostic):
457 Convert diagnostic_info to const reference.
458 * jit-playback.h (jit::playback::context::add_diagnostic):
459 Likewise.
460
4612023-12-05 Richard Sandiford <richard.sandiford@arm.com>
462
463 * dummy-frontend.cc (jit_gnu_attribute_table): Add extra braces
464 to work around PR 16333 in older compilers.
465 (jit_format_attribute_table): Likewise.
466
4672023-12-02 Richard Sandiford <richard.sandiford@arm.com>
468
469 * dummy-frontend.cc (jit_format_attribute_table): Change type to
470 scoped_attribute_specs, using...
471 (jit_format_attributes): ...this as the underlying array.
472 (jit_attribute_table): Change to an array of scoped_attribute_specs
473 pointers, using...
474 (jit_gnu_attributes, jit_gnu_attribute_table): ...these new globals
475 for the original array. Include the format attributes.
476 (LANG_HOOKS_COMMON_ATTRIBUTE_TABLE): Delete.
477 (LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE): Delete.
478 (LANG_HOOKS_ATTRIBUTE_TABLE): Define.
479
4802023-11-09 Guillaume Gomez <guillaume1.gomez@gmail.com>
481
482 * libgccjit++.h:
483
4842023-11-04 David Malcolm <dmalcolm@redhat.com>
485
486 * jit-playback.cc: Update for changes to diagnostic_context.
487 * jit-playback.h: Likewise.
488
4892023-10-25 Vibhav Pant <vibhavp@gmail.com>
490
491 * jit-recording.cc (recording::global::write_to_dump): Fix
492 dump of string literal initializers.
493
4942023-10-22 Iain Sandoe <iain@sandoe.co.uk>
495
496 * Make-lang.in: Handle Darwin rpaths.
497
4982023-10-02 David Malcolm <dmalcolm@redhat.com>
499
500 * dummy-frontend.cc (jit_langhook_init): Update for change to
501 diagnostic_context callbacks.
502
5032023-08-31 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
504
505 * jit-playback.cc: Change spelling to macOS.
506
5072023-08-29 Guillaume Gomez <guillaume1.gomez@gmail.com>
508
509 * docs/topics/compatibility.rst: Add documentation for LIBGCCJIT_ABI_25.
510 * docs/topics/types.rst: Add documentation for gcc_jit_type_get_restrict.
511
5122023-08-29 Guillaume Gomez <guillaume1.gomez@gmail.com>
513
514 * jit-playback.cc: Remove trailing whitespace characters.
515 * jit-playback.h: Add get_restrict method.
516 * jit-recording.cc: Add get_restrict methods.
517 * jit-recording.h: Add get_restrict methods.
518 * libgccjit++.h: Add get_restrict methods.
519 * libgccjit.cc: Add gcc_jit_type_get_restrict.
520 * libgccjit.h: Declare gcc_jit_type_get_restrict.
521 * libgccjit.map: Declare gcc_jit_type_get_restrict.
522
5232023-02-16 Patrick Palka <ppalka@redhat.com>
524
525 * jit-dejagnu.h: Mechanically drop static from static inline
526 functions via s/^static inline/inline/g.
527 * jit-recording.h: Likewise.
528
5292023-01-07 LIU Hao <lh_mouse@126.com>
530
531 PR middle-end/108300
532 * jit-w32.h: Define `WIN32_LEAN_AND_MEAN` before <windows.h>.
533
5342022-12-21 Martin Liska <mliska@suse.cz>
535
536 * jit-playback.h: Use unused attribute.
537
5382022-12-14 Antoni Boucher <bouanto@zoho.com>
539 Guillaume Gomez <guillaume1.gomez@gmail.com>
540
541 PR jit/108078
542 * jit-recording.h: Add vector_type::is_same_type_as method
543
5442022-12-07 Antoni Boucher <bouanto@zoho.com>
545 Guillaume Gomez <guillaume1.gomez@gmail.com>
546
547 PR jit/107770
548 * jit-playback.cc: Fix vector float comparison
549 * jit-playback.h: Update comparison function signature
550 * jit-recording.cc: Update call for "new_comparison" function
551 * jit-recording.h: Fix vector float comparison
552
5532022-11-20 Jeff Law <jlaw@ventanamicro.com>
554
555 PR other/104044
556 * jit-playback.cc (playback::lvale::mark_addressable): Remove
557 extraeous semicolon
558
5592022-11-19 Jonathan Wakely <jwakely@redhat.com>
560 LIU Hao <lh_mouse@126.com>
561
562 * jit-playback.cc (playback::context::scoped_lock): Define RAII
563 lock type.
564 (playback::context::compile): Use scoped_lock to acquire mutex
565 for the active playback context.
566 (jit_mutex): Change to std::mutex.
567 (playback::context::acquire_mutex): Rename to ...
568 (playback::context::lock): ... this.
569 (playback::context::release_mutex): Rename to ...
570 (playback::context::unlock): ... this.
571 * jit-playback.h (playback::context): Rename members and declare
572 scoped_lock.
573 * jit-recording.cc (INCLUDE_PTHREAD_H): Remove unused define.
574 * libgccjit.cc (version_mutex): Change to std::mutex.
575 (struct jit_version_info): Use std::lock_guard to acquire and
576 release mutex.
577
5782022-11-14 Martin Liska <mliska@suse.cz>
579
580 Revert:
581 2022-11-09 Martin Liska <mliska@suse.cz>
582
583 * Make-lang.in:
584 * docs/cp/index.rst: Moved to...
585 * doc/cp/index.rst: ...here.
586 * docs/cp/intro/index.rst: Moved to...
587 * doc/cp/intro/index.rst: ...here.
588 * docs/cp/intro/tutorial01.rst: Moved to...
589 * doc/cp/intro/tutorial01.rst: ...here.
590 * docs/cp/intro/tutorial02.rst: Moved to...
591 * doc/cp/intro/tutorial02.rst: ...here.
592 * docs/cp/intro/tutorial03.rst: Moved to...
593 * doc/cp/intro/tutorial03.rst: ...here.
594 * docs/cp/intro/tutorial04.rst: Moved to...
595 * doc/cp/intro/tutorial04.rst: ...here.
596 * docs/cp/topics/asm.rst: Moved to...
597 * doc/cp/topics/asm.rst: ...here.
598 * docs/cp/topics/compilation.rst: Moved to...
599 * doc/cp/topics/compilation.rst: ...here.
600 * docs/cp/topics/contexts.rst: Moved to...
601 * doc/cp/topics/contexts.rst: ...here.
602 * docs/cp/topics/expressions.rst: Moved to...
603 * doc/cp/topics/expressions.rst: ...here.
604 * docs/cp/topics/functions.rst: Moved to...
605 * doc/cp/topics/functions.rst: ...here.
606 * docs/cp/topics/index.rst: Moved to...
607 * doc/cp/topics/index.rst: ...here.
608 * docs/cp/topics/locations.rst: Moved to...
609 * doc/cp/topics/locations.rst: ...here.
610 * docs/cp/topics/objects.rst: Moved to...
611 * doc/cp/topics/objects.rst: ...here.
612 * docs/cp/topics/types.rst: Moved to...
613 * doc/cp/topics/types.rst: ...here.
614 * docs/examples/emit-alphabet.bf: Moved to...
615 * doc/examples/emit-alphabet.bf: ...here.
616 * docs/examples/tut01-hello-world.c: Moved to...
617 * doc/examples/tut01-hello-world.c: ...here.
618 * docs/examples/tut01-hello-world.cc: Moved to...
619 * doc/examples/tut01-hello-world.cc: ...here.
620 * docs/examples/tut02-square.c: Moved to...
621 * doc/examples/tut02-square.c: ...here.
622 * docs/examples/tut02-square.cc: Moved to...
623 * doc/examples/tut02-square.cc: ...here.
624 * docs/examples/tut03-sum-of-squares.c: Moved to...
625 * doc/examples/tut03-sum-of-squares.c: ...here.
626 * docs/examples/tut03-sum-of-squares.cc: Moved to...
627 * doc/examples/tut03-sum-of-squares.cc: ...here.
628 * docs/examples/tut04-toyvm/Makefile: Moved to...
629 * doc/examples/tut04-toyvm/Makefile: ...here.
630 * docs/examples/tut04-toyvm/factorial.toy: Moved to...
631 * doc/examples/tut04-toyvm/factorial.toy: ...here.
632 * docs/examples/tut04-toyvm/fibonacci.toy: Moved to...
633 * doc/examples/tut04-toyvm/fibonacci.toy: ...here.
634 * docs/examples/tut04-toyvm/toyvm.c: Moved to...
635 * doc/examples/tut04-toyvm/toyvm.c: ...here.
636 * docs/examples/tut04-toyvm/toyvm.cc: Moved to...
637 * doc/examples/tut04-toyvm/toyvm.cc: ...here.
638 * docs/examples/tut05-bf.c: Moved to...
639 * doc/examples/tut05-bf.c: ...here.
640 * docs/index.rst: Moved to...
641 * doc/index.rst: ...here.
642 * docs/internals/index.rst: Moved to...
643 * doc/internals/index.rst: ...here.
644 * docs/internals/test-hello-world.exe.log.txt: Moved to...
645 * doc/internals/test-hello-world.exe.log.txt: ...here.
646 * docs/_build/texinfo/libgccjit-figures/factorial.png: Moved to...
647 * doc/intro/factorial.png: ...here.
648 * docs/intro/index.rst: Moved to...
649 * doc/intro/index.rst: ...here.
650 * docs/_build/texinfo/libgccjit-figures/sum-of-squares.png: Moved to...
651 * doc/intro/sum-of-squares.png: ...here.
652 * docs/intro/tutorial01.rst: Moved to...
653 * doc/intro/tutorial01.rst: ...here.
654 * docs/intro/tutorial02.rst: Moved to...
655 * doc/intro/tutorial02.rst: ...here.
656 * docs/intro/tutorial03.rst: Moved to...
657 * doc/intro/tutorial03.rst: ...here.
658 * docs/intro/tutorial04.rst: Moved to...
659 * doc/intro/tutorial04.rst: ...here.
660 * docs/intro/tutorial05.rst: Moved to...
661 * doc/intro/tutorial05.rst: ...here.
662 * docs/topics/asm.rst: Moved to...
663 * doc/topics/asm.rst: ...here.
664 * docs/topics/compatibility.rst: Moved to...
665 * doc/topics/compatibility.rst: ...here.
666 * docs/topics/compilation.rst: Moved to...
667 * doc/topics/compilation.rst: ...here.
668 * docs/topics/contexts.rst: Moved to...
669 * doc/topics/contexts.rst: ...here.
670 * docs/topics/expressions.rst: Moved to...
671 * doc/topics/expressions.rst: ...here.
672 * docs/topics/function-pointers.rst: Moved to...
673 * doc/topics/function-pointers.rst: ...here.
674 * docs/topics/functions.rst: Moved to...
675 * doc/topics/functions.rst: ...here.
676 * docs/topics/index.rst: Moved to...
677 * doc/topics/index.rst: ...here.
678 * docs/topics/locations.rst: Moved to...
679 * doc/topics/locations.rst: ...here.
680 * docs/topics/objects.rst: Moved to...
681 * doc/topics/objects.rst: ...here.
682 * docs/topics/performance.rst: Moved to...
683 * doc/topics/performance.rst: ...here.
684 * docs/topics/types.rst: Moved to...
685 * doc/topics/types.rst: ...here.
686 * docs/Makefile: Removed.
687 * docs/_build/texinfo/Makefile: Removed.
688 * docs/_build/texinfo/libgccjit-figures/factorial1.png: Removed.
689 * docs/_build/texinfo/libgccjit-figures/sum-of-squares1.png: Removed.
690 * docs/_build/texinfo/libgccjit.texi: Removed.
691 * docs/conf.py: Removed.
692 * docs/intro/factorial.png: Removed.
693 * docs/intro/sum-of-squares.png: Removed.
694 * doc/conf.py: New file.
695
6962022-11-14 Martin Liska <mliska@suse.cz>
697
698 Revert:
699 2022-11-14 Martin Liska <mliska@suse.cz>
700
701 * Make-lang.in: Support --with-sphinx-build.
702
7032022-11-14 Martin Liska <mliska@suse.cz>
704
705 Revert:
706 2022-11-14 Martin Liska <mliska@suse.cz>
707
708 * doc/internals/index.rst: Fix cross manual refs.
709 * doc/topics/contexts.rst: Likewise.
710
7112022-11-14 Martin Liska <mliska@suse.cz>
712
713 Revert:
714 2022-11-14 Martin Liska <mliska@suse.cz>
715
716 * Make-lang.in:
717 Support installation if sphinx-build is missing.
718
7192022-11-14 Martin Liska <mliska@suse.cz>
720
721 Revert:
722 2022-11-14 Martin Liska <mliska@suse.cz>
723
724 * doc/cp/index.rst: Remove trailing .rst in toctree.
725 * doc/cp/intro/index.rst: Likewise.
726 * doc/cp/topics/index.rst: Likewise.
727 * doc/index.rst: Likewise.
728 * doc/intro/index.rst: Likewise.
729 * doc/topics/index.rst: Likewise.
730 * doc/indices-and-tables.rst: New file.
731
7322022-11-11 Martin Liska <mliska@suse.cz>
733
734 * doc/cp/index.rst: Remove trailing .rst in toctree.
735 * doc/cp/intro/index.rst: Likewise.
736 * doc/cp/topics/index.rst: Likewise.
737 * doc/index.rst: Likewise.
738 * doc/intro/index.rst: Likewise.
739 * doc/topics/index.rst: Likewise.
740 * doc/indices-and-tables.rst: New file.
741
7422022-11-09 Martin Liska <mliska@suse.cz>
743
744 * Make-lang.in:
745 Support installation if sphinx-build is missing.
746
7472022-11-09 Martin Liska <mliska@suse.cz>
748
749 * doc/internals/index.rst: Fix cross manual refs.
750 * doc/topics/contexts.rst: Likewise.
751
7522022-11-09 Martin Liska <mliska@suse.cz>
753
754 * Make-lang.in: Support --with-sphinx-build.
755
7562022-11-09 Martin Liska <mliska@suse.cz>
757
758 * Make-lang.in:
759 * docs/cp/index.rst: Moved to...
760 * doc/cp/index.rst: ...here.
761 * docs/cp/intro/index.rst: Moved to...
762 * doc/cp/intro/index.rst: ...here.
763 * docs/cp/intro/tutorial01.rst: Moved to...
764 * doc/cp/intro/tutorial01.rst: ...here.
765 * docs/cp/intro/tutorial02.rst: Moved to...
766 * doc/cp/intro/tutorial02.rst: ...here.
767 * docs/cp/intro/tutorial03.rst: Moved to...
768 * doc/cp/intro/tutorial03.rst: ...here.
769 * docs/cp/intro/tutorial04.rst: Moved to...
770 * doc/cp/intro/tutorial04.rst: ...here.
771 * docs/cp/topics/asm.rst: Moved to...
772 * doc/cp/topics/asm.rst: ...here.
773 * docs/cp/topics/compilation.rst: Moved to...
774 * doc/cp/topics/compilation.rst: ...here.
775 * docs/cp/topics/contexts.rst: Moved to...
776 * doc/cp/topics/contexts.rst: ...here.
777 * docs/cp/topics/expressions.rst: Moved to...
778 * doc/cp/topics/expressions.rst: ...here.
779 * docs/cp/topics/functions.rst: Moved to...
780 * doc/cp/topics/functions.rst: ...here.
781 * docs/cp/topics/index.rst: Moved to...
782 * doc/cp/topics/index.rst: ...here.
783 * docs/cp/topics/locations.rst: Moved to...
784 * doc/cp/topics/locations.rst: ...here.
785 * docs/cp/topics/objects.rst: Moved to...
786 * doc/cp/topics/objects.rst: ...here.
787 * docs/cp/topics/types.rst: Moved to...
788 * doc/cp/topics/types.rst: ...here.
789 * docs/examples/emit-alphabet.bf: Moved to...
790 * doc/examples/emit-alphabet.bf: ...here.
791 * docs/examples/tut01-hello-world.c: Moved to...
792 * doc/examples/tut01-hello-world.c: ...here.
793 * docs/examples/tut01-hello-world.cc: Moved to...
794 * doc/examples/tut01-hello-world.cc: ...here.
795 * docs/examples/tut02-square.c: Moved to...
796 * doc/examples/tut02-square.c: ...here.
797 * docs/examples/tut02-square.cc: Moved to...
798 * doc/examples/tut02-square.cc: ...here.
799 * docs/examples/tut03-sum-of-squares.c: Moved to...
800 * doc/examples/tut03-sum-of-squares.c: ...here.
801 * docs/examples/tut03-sum-of-squares.cc: Moved to...
802 * doc/examples/tut03-sum-of-squares.cc: ...here.
803 * docs/examples/tut04-toyvm/Makefile: Moved to...
804 * doc/examples/tut04-toyvm/Makefile: ...here.
805 * docs/examples/tut04-toyvm/factorial.toy: Moved to...
806 * doc/examples/tut04-toyvm/factorial.toy: ...here.
807 * docs/examples/tut04-toyvm/fibonacci.toy: Moved to...
808 * doc/examples/tut04-toyvm/fibonacci.toy: ...here.
809 * docs/examples/tut04-toyvm/toyvm.c: Moved to...
810 * doc/examples/tut04-toyvm/toyvm.c: ...here.
811 * docs/examples/tut04-toyvm/toyvm.cc: Moved to...
812 * doc/examples/tut04-toyvm/toyvm.cc: ...here.
813 * docs/examples/tut05-bf.c: Moved to...
814 * doc/examples/tut05-bf.c: ...here.
815 * docs/index.rst: Moved to...
816 * doc/index.rst: ...here.
817 * docs/internals/index.rst: Moved to...
818 * doc/internals/index.rst: ...here.
819 * docs/internals/test-hello-world.exe.log.txt: Moved to...
820 * doc/internals/test-hello-world.exe.log.txt: ...here.
821 * docs/_build/texinfo/libgccjit-figures/factorial.png: Moved to...
822 * doc/intro/factorial.png: ...here.
823 * docs/intro/index.rst: Moved to...
824 * doc/intro/index.rst: ...here.
825 * docs/_build/texinfo/libgccjit-figures/sum-of-squares.png: Moved to...
826 * doc/intro/sum-of-squares.png: ...here.
827 * docs/intro/tutorial01.rst: Moved to...
828 * doc/intro/tutorial01.rst: ...here.
829 * docs/intro/tutorial02.rst: Moved to...
830 * doc/intro/tutorial02.rst: ...here.
831 * docs/intro/tutorial03.rst: Moved to...
832 * doc/intro/tutorial03.rst: ...here.
833 * docs/intro/tutorial04.rst: Moved to...
834 * doc/intro/tutorial04.rst: ...here.
835 * docs/intro/tutorial05.rst: Moved to...
836 * doc/intro/tutorial05.rst: ...here.
837 * docs/topics/asm.rst: Moved to...
838 * doc/topics/asm.rst: ...here.
839 * docs/topics/compatibility.rst: Moved to...
840 * doc/topics/compatibility.rst: ...here.
841 * docs/topics/compilation.rst: Moved to...
842 * doc/topics/compilation.rst: ...here.
843 * docs/topics/contexts.rst: Moved to...
844 * doc/topics/contexts.rst: ...here.
845 * docs/topics/expressions.rst: Moved to...
846 * doc/topics/expressions.rst: ...here.
847 * docs/topics/function-pointers.rst: Moved to...
848 * doc/topics/function-pointers.rst: ...here.
849 * docs/topics/functions.rst: Moved to...
850 * doc/topics/functions.rst: ...here.
851 * docs/topics/index.rst: Moved to...
852 * doc/topics/index.rst: ...here.
853 * docs/topics/locations.rst: Moved to...
854 * doc/topics/locations.rst: ...here.
855 * docs/topics/objects.rst: Moved to...
856 * doc/topics/objects.rst: ...here.
857 * docs/topics/performance.rst: Moved to...
858 * doc/topics/performance.rst: ...here.
859 * docs/topics/types.rst: Moved to...
860 * doc/topics/types.rst: ...here.
861 * docs/Makefile: Removed.
862 * docs/_build/texinfo/Makefile: Removed.
863 * docs/_build/texinfo/libgccjit-figures/factorial1.png: Removed.
864 * docs/_build/texinfo/libgccjit-figures/sum-of-squares1.png: Removed.
865 * docs/_build/texinfo/libgccjit.texi: Removed.
866 * docs/conf.py: Removed.
867 * docs/intro/factorial.png: Removed.
868 * docs/intro/sum-of-squares.png: Removed.
869 * doc/conf.py: New file.
870
8712022-09-15 Richard Biener <rguenther@suse.de>
872
873 * dummy-frontend.cc (jit_langhook_init): Do not initialize
874 void_list_node.
875
8762022-08-09 Vibhav Pant <vibhavp@gmail.com>
877
878 * libgccjit.h (LIBGCCJIT_HAVE_gcc_jit_context_new_bitcast): Move
879 definition out of comment.
880
8812022-07-28 David Malcolm <dmalcolm@redhat.com>
882
883 * docs/internals/index.rst: Remove reference to ".c" extensions
884 of source files.
885
8862022-07-28 Martin Liška <mliska@suse.cz>
887
888 * docs/cp/intro/tutorial02.rst:
889 Shorten the assembly example so that there is not slider.
890 * docs/cp/intro/tutorial04.rst: Likewise.
891 * docs/intro/tutorial02.rst: Likewise.
892 * docs/intro/tutorial04.rst: Likewise.
893 * docs/topics/contexts.rst: Likewise.
894
8952022-07-28 marxin <mliska@suse.cz>
896
897 * docs/index.rst: Remove reference to module index
898 as we don't emit any.
899
9002022-07-28 marxin <mliska@suse.cz>
901
902 * docs/cp/intro/tutorial02.rst: Use :expr:`type *` for pointers to a type
903 * docs/cp/topics/asm.rst: Likewise.
904 * docs/cp/topics/contexts.rst: Likewise.
905 * docs/cp/topics/expressions.rst: Likewise.
906 * docs/cp/topics/functions.rst: Likewise.
907 * docs/cp/topics/objects.rst: Likewise.
908 * docs/intro/tutorial02.rst: Likewise.
909 * docs/intro/tutorial03.rst: Likewise.
910 * docs/intro/tutorial04.rst: Likewise.
911 * docs/intro/tutorial05.rst: Likewise.
912 * docs/topics/compilation.rst: Likewise.
913 * docs/topics/contexts.rst: Likewise.
914 * docs/topics/objects.rst: Likewise.
915
9162022-07-28 marxin <mliska@suse.cz>
917
918 * docs/cp/intro/tutorial04.rst: Use list-table.
919 * docs/intro/tutorial04.rst: Likewise.
920 * docs/intro/tutorial05.rst: Likewise.
921 * docs/topics/compilation.rst: Likewise.
922 * docs/topics/expressions.rst: Likewise.
923 * docs/topics/types.rst: Likewise.
924
9252022-07-28 marxin <mliska@suse.cz>
926
927 * docs/cp/topics/expressions.rst: Compact so that the generated
928 output is also more compact.
929
9302022-07-28 marxin <mliska@suse.cz>
931
932 * docs/cp/intro/tutorial02.rst: Use proper reference.
933 * docs/cp/topics/contexts.rst: Likewise.
934 * docs/cp/topics/functions.rst: Put `class` directive before a
935 function as it is not allowed declaring a class in a fn.
936 * docs/cp/topics/types.rst: Add template keyword.
937 * docs/examples/tut04-toyvm/toyvm.c (toyvm_function_compile):
938 Add removed comment used for code snippet ending detection.
939 * docs/intro/tutorial04.rst: Fix to match the real comment.
940
9412022-07-28 marxin <mliska@suse.cz>
942
943 * docs/cp/topics/expressions.rst: Use :expr: for basic types.
944 * docs/topics/compilation.rst: Likewise.
945 * docs/topics/expressions.rst: Likewise.
946 * docs/topics/function-pointers.rst: Likewise.
947
9482022-07-28 marxin <mliska@suse.cz>
949
950 * docs/conf.py: Add needs_sphinx = '3.0' where c:type was added.
951 * docs/index.rst: Remove note about it.
952 * docs/topics/compilation.rst: Use enum directive and reference.
953 * docs/topics/contexts.rst: Likewise.
954 * docs/topics/expressions.rst: Likewise.
955 * docs/topics/functions.rst: Likewise.
956
9572022-07-14 Jonathan Wakely <jwakely@redhat.com>
958
959 * jit-recording.h (recording::memento): Define copy constructor
960 and copy assignment operator as deleted.
961 (recording::string): Likewise.
962 (recording::string::c_str): Add const qualifier.
963
9642022-06-29 Antoni Boucher <bouanto@zoho.com>
965
966 PR jit/105812
967 * jit-playback.cc: Use the correct return type when folding in
968 as_truth_value.
969
9702022-06-29 Sergei Trofimovich <siarheit@google.com>
971
972 PR c++/106102
973 * jit-playback.cc: Include <pthread.h> via "system.h" to avoid calloc()
974 poisoning.
975 * jit-recording.cc: Ditto.
976 * libgccjit.cc: Ditto.
977
9782022-06-10 Antoni Boucher <bouanto@zoho.com>
979
980 PR jit/105829
981 * libgccjit.cc: Add support for floating-point types in
982 gcc_jit_type_get_size.
983
9842022-06-08 Yang Yujie <yangyujie@loongson.cn>
985
986 * Make-lang.in: only link objects from $(EXTRA_GCC_OBJS)
987 that's not in $(EXTRA_OBJS) into libgccjit.
988
9892022-05-23 David Malcolm <dmalcolm@redhat.com>
990
991 * jit-recording.h: Add "final" and "override" to all vfunc
992 implementations that were missing them, as appropriate.
993
9942022-05-20 David Malcolm <dmalcolm@redhat.com>
995
996 * jit-playback.h: Replace uses of "FINAL" and "OVERRIDE" with
997 "final" and "override".
998 * jit-recording.cc: Likewise.
999 * jit-recording.h: Likewise.
1000
10012022-05-16 Martin Liska <mliska@suse.cz>
1002
1003 * jit-builtins.cc (find_builtin_by_name): Use ARRAY_SIZE.
1004 (get_string_for_type_id): Likewise.
1005 * jit-recording.cc (recording::context::context): Likewise.
1006
10072022-04-14 Iain Sandoe <iain@sandoe.co.uk>
1008
1009 * jit-playback.cc (new_bitcast): Cast values returned by tree_to_uhwi
1010 to 'long' to match the print format.
1011
10122022-04-12 Antoni Boucher <bouanto@zoho.com>
1013
1014 PR jit/104293
1015 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1016 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_24): New ABI tag.
1017 * docs/topics/expressions.rst: Add documentation for the
1018 functions gcc_jit_lvalue_set_alignment and
1019 gcc_jit_lvalue_get_alignment.
1020 * jit-playback.h: New function (set_alignment).
1021 * jit-recording.cc: New function (set_alignment).
1022 * jit-recording.h: New functions (set_alignment, get_alignment)
1023 and new field (m_alignment).
1024 * libgccjit.cc: New functions (gcc_jit_lvalue_get_alignment,
1025 gcc_jit_lvalue_set_alignment)
1026 * libgccjit.h: New functions (gcc_jit_lvalue_get_alignment,
1027 gcc_jit_lvalue_set_alignment)
1028 * libgccjit.map (LIBGCCJIT_ABI_24): New ABI tag.
1029
10302022-04-12 Antoni Boucher <bouanto@zoho.com>
1031
1032 PR jit/104073
1033 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1034 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_23): New ABI tag.
1035 * docs/topics/contexts.rst: Add documentation for the new
1036 function gcc_jit_context_set_bool_print_errors_to_stderr.
1037 * jit-common.h: New enum value
1038 (INNER_BOOL_OPTION_PRINT_ERRORS_TO_STDERR).
1039 * jit-recording.cc: Handle the new option
1040 INNER_BOOL_OPTION_PRINT_ERRORS_TO_STDERR.
1041 * libgccjit.cc: New function
1042 (gcc_jit_context_set_bool_print_errors_to_stderr).
1043 * libgccjit.h: New function
1044 (gcc_jit_context_set_bool_print_errors_to_stderr).
1045 * libgccjit.map (LIBGCCJIT_ABI_23): New ABI tag.
1046
10472022-04-12 Antoni Boucher <bouanto@zoho.com>
1048
1049 PR jit/104072
1050 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1051 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_22): New ABI tag.
1052 * docs/topics/expressions.rst: Add documentation for the
1053 function gcc_jit_lvalue_set_register_name.
1054 * jit-playback.h: New function (set_register_name).
1055 * jit-recording.cc: New function (set_register_name) and add
1056 support for register variables.
1057 * jit-recording.h: New field (m_reg_name) and new function
1058 (set_register_name).
1059 * libgccjit.cc: New function (gcc_jit_lvalue_set_register_name).
1060 * libgccjit.h: New function (gcc_jit_lvalue_set_register_name).
1061 * libgccjit.map (LIBGCCJIT_ABI_22): New ABI tag.
1062
10632022-04-12 Antoni Boucher <bouanto@zoho.com>
1064
1065 PR jit/104071
1066 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1067 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_21): New ABI tag.
1068 * docs/topics/expressions.rst: Add documentation for the
1069 function gcc_jit_context_new_bitcast.
1070 * jit-playback.cc: New function (new_bitcast).
1071 * jit-playback.h: New function (new_bitcast).
1072 * jit-recording.cc: New functions (new_bitcast,
1073 bitcast::replay_into, bitcast::visit_children,
1074 bitcast::make_debug_string, bitcast::write_reproducer).
1075 * jit-recording.h: New class (bitcast) and new function
1076 (new_bitcast, bitcast::replay_into, bitcast::visit_children,
1077 bitcast::make_debug_string, bitcast::write_reproducer,
1078 bitcast::get_precedence).
1079 * libgccjit.cc: New function (gcc_jit_context_new_bitcast)
1080 * libgccjit.h: New function (gcc_jit_context_new_bitcast)
1081 * libgccjit.map (LIBGCCJIT_ABI_21): New ABI tag.
1082
10832022-04-12 Antoni Boucher <bouanto@zoho.com>
1084
1085 PR target/95325
1086 * docs/_build/texinfo/libgccjit.texi: Regenerate
1087 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_20): New ABI tag.
1088 * docs/topics/types.rst: Add documentation for the new types
1089 GCC_JIT_TYPE_UINT8_T, GCC_JIT_TYPE_UINT16_T,
1090 GCC_JIT_TYPE_UINT32_T, GCC_JIT_TYPE_UINT64_T,
1091 GCC_JIT_TYPE_UINT128_T, GCC_JIT_TYPE_INT8_T, GCC_JIT_TYPE_INT16_T,
1092 GCC_JIT_TYPE_INT32_T, GCC_JIT_TYPE_INT64_T, GCC_JIT_TYPE_INT128_T and
1093 new functions (gcc_jit_compatible_types, gcc_jit_type_get_size).
1094 * jit-builtins.cc: Add support for BT_UINT128.
1095 * jit-common.h: Update the value of NUM_GCC_JIT_TYPES.
1096 * jit-playback.cc: Add support for the sized integer types.
1097 * jit-recording.cc: Add support for the sized integer types.
1098 * jit-recording.h: Add support for comparing integer types
1099 and new function (is_signed).
1100 * libgccjit.cc (gcc_jit_compatible_types): New.
1101 (gcc_jit_type_get_size) New.
1102 * libgccjit.h: New enum variants for gcc_jit_types
1103 (GCC_JIT_TYPE_UINT8_T, GCC_JIT_TYPE_UINT16_T,
1104 GCC_JIT_TYPE_UINT32_T, GCC_JIT_TYPE_UINT64_T,
1105 GCC_JIT_TYPE_UINT128_T, GCC_JIT_TYPE_INT8_T,
1106 GCC_JIT_TYPE_INT16_T, GCC_JIT_TYPE_INT32_T,
1107 GCC_JIT_TYPE_INT64_T, GCC_JIT_TYPE_INT128_T) and new functions
1108 (gcc_jit_compatible_types, gcc_jit_type_get_size).
1109 * libgccjit.map (LIBGCCJIT_ABI_20): New ABI tag.
1110
11112022-04-06 David Malcolm <dmalcolm@redhat.com>
1112
1113 PR jit/102824
1114 * docs/_build/texinfo/factorial.png: Move to...
1115 * docs/_build/texinfo/libgccjit-figures/factorial.png: ...here.
1116 * docs/_build/texinfo/factorial1.png: Move to...
1117 * docs/_build/texinfo/libgccjit-figures/factorial1.png: ...here.
1118 * docs/_build/texinfo/sum-of-squares.png: Move to...
1119 * docs/_build/texinfo/libgccjit-figures/sum-of-squares.png: ...here.
1120 * docs/_build/texinfo/sum-of-squares1.png: Move to...
1121 * docs/_build/texinfo/libgccjit-figures/sum-of-squares1.png: ...here.
1122
11232022-04-01 David Malcolm <dmalcolm@redhat.com>
1124
1125 * docs/topics/expressions.rst: Fix formatting.
1126 * docs/topics/types.rst: Likewise.
1127 * docs/_build/texinfo/libgccjit.texi: Regenerate
1128
11292022-04-01 Petter Tomner <tomner@kth.se>
1130
1131 * docs/topics/compatibility.rst: Add 19 tag
1132 * docs/topics/compilation.rst: Linking
1133 * docs/topics/contexts.rst: Linking example
1134 * docs/topics/expressions.rst: Fix formatting and dropped 's'
1135
11362022-03-07 Jakub Jelinek <jakub@redhat.com>
1137
1138 * libgccjit.h: Fix up duplicated word issue in a comment.
1139
11402022-01-17 Martin Liska <mliska@suse.cz>
1141
1142 * config-lang.in: Rename .c names to .cc.
1143 * docs/_build/texinfo/libgccjit.texi: Likewise.
1144 * docs/internals/index.rst: Likewise.
1145 * jit-builtins.cc (builtins_manager::make_builtin_function): Likewise.
1146 * jit-playback.cc (fold_const_var): Likewise.
1147 (playback::context::~context): Likewise.
1148 (new_field): Likewise.
1149 (new_bitfield): Likewise.
1150 (new_compound_type): Likewise.
1151 (playback::compound_type::set_fields): Likewise.
1152 (global_set_init_rvalue): Likewise.
1153 (load_blob_in_ctor): Likewise.
1154 (new_global_initialized): Likewise.
1155 (double>): Likewise.
1156 (new_string_literal): Likewise.
1157 (as_truth_value): Likewise.
1158 (build_call): Likewise.
1159 (playback::context::build_cast): Likewise.
1160 (new_array_access): Likewise.
1161 (new_field_access): Likewise.
1162 (dereference): Likewise.
1163 (postprocess): Likewise.
1164 (add_jump): Likewise.
1165 (add_switch): Likewise.
1166 (build_goto_operands): Likewise.
1167 (playback::context::read_dump_file): Likewise.
1168 (init_types): Likewise.
1169 * jit-recording.cc (recording::context::get_int_type): Likewise.
1170 * jit-recording.h: Likewise.
1171 * libgccjit.cc (compatible_types): Likewise.
1172 (gcc_jit_context_acquire): Likewise.
1173 (gcc_jit_context_release): Likewise.
1174 (gcc_jit_context_new_child_context): Likewise.
1175 (gcc_jit_type_as_object): Likewise.
1176 (gcc_jit_context_get_type): Likewise.
1177 (gcc_jit_context_get_int_type): Likewise.
1178 (gcc_jit_type_get_pointer): Likewise.
1179 (gcc_jit_type_get_const): Likewise.
1180 (gcc_jit_type_get_volatile): Likewise.
1181 (gcc_jit_type_dyncast_array): Likewise.
1182 (gcc_jit_type_is_bool): Likewise.
1183 (gcc_jit_type_is_pointer): Likewise.
1184 (gcc_jit_type_is_integral): Likewise.
1185 (gcc_jit_type_dyncast_vector): Likewise.
1186 (gcc_jit_type_is_struct): Likewise.
1187 (gcc_jit_vector_type_get_num_units): Likewise.
1188 (gcc_jit_vector_type_get_element_type): Likewise.
1189 (gcc_jit_type_unqualified): Likewise.
1190 (gcc_jit_type_dyncast_function_ptr_type): Likewise.
1191 (gcc_jit_function_type_get_return_type): Likewise.
1192 (gcc_jit_function_type_get_param_count): Likewise.
1193 (gcc_jit_function_type_get_param_type): Likewise.
1194 (gcc_jit_context_new_array_type): Likewise.
1195 (gcc_jit_context_new_field): Likewise.
1196 (gcc_jit_field_as_object): Likewise.
1197 (gcc_jit_context_new_struct_type): Likewise.
1198 (gcc_jit_struct_as_type): Likewise.
1199 (gcc_jit_struct_set_fields): Likewise.
1200 (gcc_jit_struct_get_field_count): Likewise.
1201 (gcc_jit_context_new_union_type): Likewise.
1202 (gcc_jit_context_new_function_ptr_type): Likewise.
1203 (gcc_jit_param_as_rvalue): Likewise.
1204 (gcc_jit_context_new_function): Likewise.
1205 (gcc_jit_function_get_return_type): Likewise.
1206 (gcc_jit_function_dump_to_dot): Likewise.
1207 (gcc_jit_block_get_function): Likewise.
1208 (gcc_jit_global_set_initializer_rvalue): Likewise.
1209 (gcc_jit_rvalue_get_type): Likewise.
1210 (gcc_jit_context_new_rvalue_from_int): Likewise.
1211 (gcc_jit_context_one): Likewise.
1212 (gcc_jit_context_new_rvalue_from_double): Likewise.
1213 (gcc_jit_context_null): Likewise.
1214 (gcc_jit_context_new_string_literal): Likewise.
1215 (valid_binary_op_p): Likewise.
1216 (gcc_jit_context_new_binary_op): Likewise.
1217 (gcc_jit_context_new_comparison): Likewise.
1218 (gcc_jit_context_new_call): Likewise.
1219 (is_valid_cast): Likewise.
1220 (gcc_jit_context_new_cast): Likewise.
1221 (gcc_jit_object_get_context): Likewise.
1222 (gcc_jit_object_get_debug_string): Likewise.
1223 (gcc_jit_lvalue_access_field): Likewise.
1224 (gcc_jit_rvalue_access_field): Likewise.
1225 (gcc_jit_rvalue_dereference_field): Likewise.
1226 (gcc_jit_rvalue_dereference): Likewise.
1227 (gcc_jit_lvalue_get_address): Likewise.
1228 (gcc_jit_lvalue_set_tls_model): Likewise.
1229 (gcc_jit_lvalue_set_link_section): Likewise.
1230 (gcc_jit_function_new_local): Likewise.
1231 (gcc_jit_block_add_eval): Likewise.
1232 (gcc_jit_block_add_assignment): Likewise.
1233 (is_bool): Likewise.
1234 (gcc_jit_block_end_with_conditional): Likewise.
1235 (gcc_jit_block_add_comment): Likewise.
1236 (gcc_jit_block_end_with_jump): Likewise.
1237 (gcc_jit_block_end_with_return): Likewise.
1238 (gcc_jit_block_end_with_void_return): Likewise.
1239 (case_range_validator::case_range_validator): Likewise.
1240 (case_range_validator::validate): Likewise.
1241 (case_range_validator::get_wide_int): Likewise.
1242 (gcc_jit_block_end_with_switch): Likewise.
1243 (gcc_jit_context_set_str_option): Likewise.
1244 (gcc_jit_context_set_int_option): Likewise.
1245 (gcc_jit_context_set_bool_option): Likewise.
1246 (gcc_jit_context_set_bool_allow_unreachable_blocks): Likewise.
1247 (gcc_jit_context_set_bool_use_external_driver): Likewise.
1248 (gcc_jit_context_add_command_line_option): Likewise.
1249 (gcc_jit_context_add_driver_option): Likewise.
1250 (gcc_jit_context_enable_dump): Likewise.
1251 (gcc_jit_context_compile): Likewise.
1252 (gcc_jit_context_compile_to_file): Likewise.
1253 (gcc_jit_context_set_logfile): Likewise.
1254 (gcc_jit_context_dump_reproducer_to_file): Likewise.
1255 (gcc_jit_context_get_first_error): Likewise.
1256 (gcc_jit_context_get_last_error): Likewise.
1257 (gcc_jit_result_get_code): Likewise.
1258 (gcc_jit_result_get_global): Likewise.
1259 (gcc_jit_rvalue_set_bool_require_tail_call): Likewise.
1260 (gcc_jit_type_get_aligned): Likewise.
1261 (gcc_jit_type_get_vector): Likewise.
1262 (gcc_jit_function_get_address): Likewise.
1263 (gcc_jit_version_patchlevel): Likewise.
1264 (gcc_jit_block_add_extended_asm): Likewise.
1265 (gcc_jit_extended_asm_as_object): Likewise.
1266 (gcc_jit_extended_asm_set_volatile_flag): Likewise.
1267 (gcc_jit_extended_asm_set_inline_flag): Likewise.
1268 (gcc_jit_extended_asm_add_output_operand): Likewise.
1269 (gcc_jit_extended_asm_add_input_operand): Likewise.
1270 (gcc_jit_extended_asm_add_clobber): Likewise.
1271 * notes.txt: Likewise.
1272
12732022-01-17 Martin Liska <mliska@suse.cz>
1274
1275 * dummy-frontend.c: Moved to...
1276 * dummy-frontend.cc: ...here.
1277 * jit-builtins.c: Moved to...
1278 * jit-builtins.cc: ...here.
1279 * jit-logging.c: Moved to...
1280 * jit-logging.cc: ...here.
1281 * jit-playback.c: Moved to...
1282 * jit-playback.cc: ...here.
1283 * jit-recording.c: Moved to...
1284 * jit-recording.cc: ...here.
1285 * jit-result.c: Moved to...
1286 * jit-result.cc: ...here.
1287 * jit-spec.c: Moved to...
1288 * jit-spec.cc: ...here.
1289 * jit-tempdir.c: Moved to...
1290 * jit-tempdir.cc: ...here.
1291 * jit-w32.c: Moved to...
1292 * jit-w32.cc: ...here.
1293 * libgccjit.c: Moved to...
1294 * libgccjit.cc: ...here.
1295
12962021-12-28 Martin Liska <mliska@suse.cz>
1297
1298 * docs/_build/texinfo/libgccjit.texi: Replace http:// with https.
1299 * docs/cp/index.rst: Likewise.
1300 * docs/cp/intro/index.rst: Likewise.
1301 * docs/cp/intro/tutorial01.rst: Likewise.
1302 * docs/cp/intro/tutorial02.rst: Likewise.
1303 * docs/cp/intro/tutorial03.rst: Likewise.
1304 * docs/cp/intro/tutorial04.rst: Likewise.
1305 * docs/cp/topics/asm.rst: Likewise.
1306 * docs/cp/topics/compilation.rst: Likewise.
1307 * docs/cp/topics/contexts.rst: Likewise.
1308 * docs/cp/topics/expressions.rst: Likewise.
1309 * docs/cp/topics/functions.rst: Likewise.
1310 * docs/cp/topics/index.rst: Likewise.
1311 * docs/cp/topics/locations.rst: Likewise.
1312 * docs/cp/topics/objects.rst: Likewise.
1313 * docs/cp/topics/types.rst: Likewise.
1314 * docs/index.rst: Likewise.
1315 * docs/internals/index.rst: Likewise.
1316 * docs/intro/index.rst: Likewise.
1317 * docs/intro/tutorial01.rst: Likewise.
1318 * docs/intro/tutorial02.rst: Likewise.
1319 * docs/intro/tutorial03.rst: Likewise.
1320 * docs/intro/tutorial04.rst: Likewise.
1321 * docs/intro/tutorial05.rst: Likewise.
1322 * docs/topics/asm.rst: Likewise.
1323 * docs/topics/compatibility.rst: Likewise.
1324 * docs/topics/compilation.rst: Likewise.
1325 * docs/topics/contexts.rst: Likewise.
1326 * docs/topics/expressions.rst: Likewise.
1327 * docs/topics/function-pointers.rst: Likewise.
1328 * docs/topics/functions.rst: Likewise.
1329 * docs/topics/index.rst: Likewise.
1330 * docs/topics/locations.rst: Likewise.
1331 * docs/topics/objects.rst: Likewise.
1332 * docs/topics/performance.rst: Likewise.
1333 * docs/topics/types.rst: Likewise.
1334
13352021-12-20 Martin Liska <mliska@suse.cz>
1336
1337 * libgccjit.c (struct version_info): Rename to jit_version_info.
1338 (struct jit_version_info): Likewise.
1339 (gcc_jit_version_major): Likewise.
1340 (gcc_jit_version_minor): Likewise.
1341 (gcc_jit_version_patchlevel): Likewise.
1342
13432021-12-14 Petter Tomner <tomner@kth.se>
1344
1345 * jit-common.h: New enum
1346 * jit-playback.c : Folding an setting intitial
1347 (global_new_decl) : Handle const global generation
1348 (new_global) : New flag
1349 (global_set_init_rvalue) : New
1350 (new_ctor) : New
1351 (new_global_initialized) : Flag
1352 (as_truth_value) : Fold
1353 (new_unary_op) : Fold
1354 (new_binary_op) : Fold
1355 (new_comparison) : Fold
1356 (new_array_access) : Fold
1357 (new_dereference) : Fold
1358 (get_address) : Fold
1359 * jit-playback.h :
1360 (global_set_init_rvalue) : New
1361 (new_ctor) : New
1362 * jit-recording.c :
1363 * jit-recording.h :
1364 (new_global_init_rvalue) : New
1365 (new_ctor) : New
1366 (ctor) : New, inherits rvalue
1367 (global_init_rvalue) : New, inherits memento
1368 (type::is_union) : New
1369 * libgccjit++.h : New entrypoints, see C-header
1370 * libgccjit.c : See .h
1371 * libgccjit.h : New entrypoints
1372 (gcc_jit_context_new_array_constructor) : New
1373 (gcc_jit_context_new_struct_constructor) : New
1374 (gcc_jit_context_new_union_constructor) : New
1375 (gcc_jit_global_set_initializer_rvalue) : New
1376 (LIBGCCJIT_HAVE_CTORS) : New feuture macro
1377 * libgccjit.map : New entrypoints added to ABI 19
1378 * docs/topics/expressions.rst : Updated docs
1379
13802021-12-12 Antoni Boucher <bouanto@zoho.com>
1381
1382 PR target/100688
1383 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_18): New ABI
1384 tag.
1385 * docs/topics/expressions.rst: Add documentation for the
1386 function gcc_jit_lvalue_set_link_section.
1387 * jit-playback.h: New function (set_link_section).
1388 * jit-recording.c: New function (set_link_section) and
1389 support for setting the link section.
1390 * jit-recording.h: New function (set_link_section) and new
1391 field m_link_section.
1392 * libgccjit.c: New function (gcc_jit_lvalue_set_link_section).
1393 * libgccjit.h: New function (gcc_jit_lvalue_set_link_section).
1394 * libgccjit.map (LIBGCCJIT_ABI_18): New ABI tag.
1395
13962021-12-12 Antoni Boucher <bouanto@zoho.com>
1397
1398 PR target/95415
1399 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_17): New ABI
1400 tag.
1401 * docs/topics/expressions.rst: Add document for the function
1402 gcc_jit_lvalue_set_tls_model.
1403 * jit-playback.h: New function (set_tls_model).
1404 * jit-recording.c: New function (set_tls_model), new
1405 variables (tls_models and tls_model_enum_strings) and support
1406 for setting the tls model.
1407 * jit-recording.h: New function (set_tls_model) and new
1408 field m_tls_model.
1409 * libgccjit.c: New function (gcc_jit_lvalue_set_tls_model).
1410 * libgccjit.h: New function (gcc_jit_lvalue_set_tls_model)
1411 and new enum (gcc_jit_tls_model).
1412 * libgccjit.map (LIBGCCJIT_ABI_17): New ABI tag.
1413
14142021-12-11 Antoni Boucher <bouanto@zoho.com>
1415
1416 PR target/96066
1417 PR target/96067
1418 * jit-builtins.c: Implement missing types for builtins.
1419 * jit-recording.c:: Allow sending a volatile const void * as
1420 argument.
1421 * jit-recording.h: New functions (is_volatile, is_const) and
1422 allow comparing qualified types.
1423
14242021-12-10 David Malcolm <dmalcolm@redhat.com>
1425
1426 PR jit/103562
1427 * jit-playback.c (gcc::jit::playback::context::new_function): Set
1428 DECL_CONTEXT of the result_decl.
1429
14302021-11-27 Petter Tomner <tomner@kth.se>
1431
1432 * libgccjit.c: %ld -> %zu
1433
14342021-11-24 Martin Liska <mliska@suse.cz>
1435
1436 * jit-playback.c (function): Initialize m_blocks vector.
1437
14382021-11-20 Antoni Boucher <bouanto@zoho.com>
1439
1440 PR target/96889
1441 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_16): New ABI tag.
1442 * docs/topics/functions.rst: Add documentation for the
1443 functions gcc_jit_function_get_return_type and
1444 gcc_jit_function_get_param_count
1445 * docs/topics/types.rst: Add documentation for the functions
1446 gcc_jit_function_type_get_return_type,
1447 gcc_jit_function_type_get_param_count,
1448 gcc_jit_function_type_get_param_type,
1449 gcc_jit_type_unqualified, gcc_jit_type_dyncast_array,
1450 gcc_jit_type_is_bool,
1451 gcc_jit_type_dyncast_function_ptr_type,
1452 gcc_jit_type_is_integral, gcc_jit_type_is_pointer,
1453 gcc_jit_type_dyncast_vector,
1454 gcc_jit_vector_type_get_element_type,
1455 gcc_jit_vector_type_get_num_units,
1456 gcc_jit_struct_get_field, gcc_jit_type_is_struct,
1457 and gcc_jit_struct_get_field_count
1458 * libgccjit.c:
1459 (gcc_jit_function_get_return_type, gcc_jit_function_get_param_count,
1460 gcc_jit_function_type_get_return_type,
1461 gcc_jit_function_type_get_param_count,
1462 gcc_jit_function_type_get_param_type, gcc_jit_type_unqualified,
1463 gcc_jit_type_dyncast_array, gcc_jit_type_is_bool,
1464 gcc_jit_type_dyncast_function_ptr_type, gcc_jit_type_is_integral,
1465 gcc_jit_type_is_pointer, gcc_jit_type_dyncast_vector,
1466 gcc_jit_vector_type_get_element_type,
1467 gcc_jit_vector_type_get_num_units, gcc_jit_struct_get_field,
1468 gcc_jit_type_is_struct, gcc_jit_struct_get_field_count): New
1469 functions.
1470 (struct gcc_jit_function_type, struct gcc_jit_vector_type):
1471 New types.
1472 * libgccjit.h:
1473 (gcc_jit_function_get_return_type, gcc_jit_function_get_param_count,
1474 gcc_jit_function_type_get_return_type,
1475 gcc_jit_function_type_get_param_count,
1476 gcc_jit_function_type_get_param_type, gcc_jit_type_unqualified,
1477 gcc_jit_type_dyncast_array, gcc_jit_type_is_bool,
1478 gcc_jit_type_dyncast_function_ptr_type, gcc_jit_type_is_integral,
1479 gcc_jit_type_is_pointer, gcc_jit_type_dyncast_vector,
1480 gcc_jit_vector_type_get_element_type,
1481 gcc_jit_vector_type_get_num_units, gcc_jit_struct_get_field,
1482 gcc_jit_type_is_struct, gcc_jit_struct_get_field_count): New
1483 function declarations.
1484 (struct gcc_jit_function_type, struct gcc_jit_vector_type):
1485 New types.
1486 * jit-recording.h: New functions (is_struct and is_vector)
1487 * libgccjit.map (LIBGCCJIT_ABI_16): New ABI tag.
1488
14892021-11-12 David Malcolm <dmalcolm@redhat.com>
1490
1491 PR jit/103199
1492 * docs/examples/tut04-toyvm/toyvm.c (toyvm_function_compile):
1493 Increase size of buffer.
1494 * docs/examples/tut04-toyvm/toyvm.cc
1495 (compilation_state::create_function): Likewise.
1496
14972021-09-10 Petter Tomner <tomner@kth.se>
1498
1499 * jit-playback.c: Moved global var processing to after loc handling.
1500 Setting TYPE_NAME for fundamental types.
1501 Using common functions for finalizing globals.
1502 * jit-playback.h: New method init_types().
1503 Changed get_tree_node_for_type() to method.
1504
15052021-08-19 Iain Sandoe <iain@sandoe.co.uk>
1506
1507 * docs/examples/tut04-toyvm/toyvm.c: Include jit-dejagnu.h.
1508 * docs/examples/tut04-toyvm/toyvm.cc: Likewise.
1509 * jit-dejagnu.h: New file, imported from dejagnu-1.6.2 and
1510 patched for this application.
1511
15122021-08-18 Iain Sandoe <iain@sandoe.co.uk>
1513
1514 PR jit/100613
1515 * Make-lang.in: Provide clauses for Darwin hosts.
1516
15172021-07-18 Antoni Boucher <bouanto@zoho.com>
1518
1519 PR target/95498
1520 * jit-playback.c (convert): Add support to handle truncation and
1521 extension in the convert function.
1522
15232021-05-19 Martin Liska <mliska@suse.cz>
1524
1525 PR testsuite/100658
1526 * libgccjit.c (gcc_jit_context_new_function): Fix typos.
1527
15282021-03-24 Matthias Klose <doko@ubuntu.com>
1529
1530 * Make-lang.in (jit.sphinx.html, jit.sphinx.pdf): Use $(mkinstalldirs),
1531 (jit.install-headers): Depend on installdirs.
1532
15332021-02-19 David Malcolm <dmalcolm@redhat.com>
1534
1535 PR jit/99126
1536 * jit-builtins.c
1537 (gcc::jit::builtins_manager::get_builtin_function_by_id):
1538 Update assertion to reject BUILT_IN_NONE.
1539 (gcc::jit::builtins_manager::ensure_optimization_builtins_exist):
1540 New.
1541 * jit-builtins.h
1542 (gcc::jit::builtins_manager::ensure_optimization_builtins_exist):
1543 New decl.
1544 * jit-playback.c (gcc::jit::playback::context::replay): Call it.
1545 Remove redundant conditional on bm.
1546
15472021-01-14 David Malcolm <dmalcolm@redhat.com>
1548
1549 * docs/cp/index.rst: Remove "Alpha" warning.
1550 * docs/index.rst: Likewise.
1551 * docs/_build/texinfo/libgccjit.texi: Regenerate
1552
15532020-11-25 Martin Sebor <msebor@redhat.com>
1554
1555 PR bootstrap/94982
1556 * jit-recording.c (recording::function::dump_to_dot): Avoid
1557 -Wformat-diag.
1558 (recording::block::dump_to_dot): Same.
1559
15602020-11-20 Jakub Jelinek <jakub@redhat.com>
1561
1562 PR other/97911
1563 * Make-lang.in (jit.serial): Change from goal to a
1564 variable.
1565 (.PHONY): Drop jit.serial and jit.prev.
1566 ($(LIBGCCJIT_FILENAME)): Depend on $(jit.serial) rather than
1567 jit.serial.
1568
15692020-11-18 Jakub Jelinek <jakub@redhat.com>
1570
1571 * Make-lang.in (jit.serial): New goal.
1572 (.PHONY): Add jit.serial jit.prev.
1573 ($(LIBGCCJIT_FILENAME)): Depend on jit.prev. Call LINK_PROGRESS.
1574
15752020-11-12 David Malcolm <dmalcolm@redhat.com>
1576
1577 PR jit/87291
1578 * docs/cp/topics/asm.rst: New file.
1579 * docs/cp/topics/index.rst (Topic Reference): Add it.
1580 * docs/topics/asm.rst: New file.
1581 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_15): New.
1582 * docs/topics/functions.rst (Statements): Add link to extended
1583 asm.
1584 * docs/topics/index.rst (Topic Reference): Add asm.rst.
1585 * docs/topics/objects.rst: Add gcc_jit_extended_asm to ASCII art.
1586 * docs/_build/texinfo/Makefile: Regenerate.
1587 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1588 * jit-common.h (gcc::jit::recording::extended_asm): New forward
1589 decl.
1590 (gcc::jit::recording::top_level_asm): Likewise.
1591 * jit-playback.c: Include "stmt.h".
1592 (build_string): New.
1593 (gcc::jit::playback::context::new_string_literal): Disambiguate
1594 build_string call.
1595 (gcc::jit::playback::context::add_top_level_asm): New.
1596 (build_operand_chain): New.
1597 (build_clobbers): New.
1598 (build_goto_operands): New.
1599 (gcc::jit::playback::block::add_extended_asm): New.
1600 * jit-playback.h (gcc::jit::playback::context::add_top_level_asm):
1601 New decl.
1602 (struct gcc::jit::playback::asm_operand): New struct.
1603 (gcc::jit::playback::block::add_extended_asm): New decl.
1604 * jit-recording.c (gcc::jit::recording::context::dump_to_file):
1605 Dump top-level asms.
1606 (gcc::jit::recording::context::add_top_level_asm): New.
1607 (gcc::jit::recording::block::add_extended_asm): New.
1608 (gcc::jit::recording::block::end_with_extended_asm_goto): New.
1609 (gcc::jit::recording::asm_operand::asm_operand): New.
1610 (gcc::jit::recording::asm_operand::print): New.
1611 (gcc::jit::recording::asm_operand::make_debug_string): New.
1612 (gcc::jit::recording::output_asm_operand::write_reproducer): New.
1613 (gcc::jit::recording::output_asm_operand::print): New.
1614 (gcc::jit::recording::input_asm_operand::write_reproducer): New.
1615 (gcc::jit::recording::input_asm_operand::print): New.
1616 (gcc::jit::recording::extended_asm::add_output_operand): New.
1617 (gcc::jit::recording::extended_asm::add_input_operand): New.
1618 (gcc::jit::recording::extended_asm::add_clobber): New.
1619 (gcc::jit::recording::extended_asm::replay_into): New.
1620 (gcc::jit::recording::extended_asm::make_debug_string): New.
1621 (gcc::jit::recording::extended_asm::write_flags): New.
1622 (gcc::jit::recording::extended_asm::write_clobbers): New.
1623 (gcc::jit::recording::extended_asm_simple::write_reproducer): New.
1624 (gcc::jit::recording::extended_asm::maybe_populate_playback_blocks):
1625 New.
1626 (gcc::jit::recording::extended_asm_goto::extended_asm_goto): New.
1627 (gcc::jit::recording::extended_asm_goto::replay_into): New.
1628 (gcc::jit::recording::extended_asm_goto::write_reproducer): New.
1629 (gcc::jit::recording::extended_asm_goto::get_successor_blocks):
1630 New.
1631 (gcc::jit::recording::extended_asm_goto::maybe_print_gotos): New.
1632 (gcc::jit::recording::extended_asm_goto::maybe_populate_playback_blocks):
1633 New.
1634 (gcc::jit::recording::top_level_asm::top_level_asm): New.
1635 (gcc::jit::recording::top_level_asm::replay_into): New.
1636 (gcc::jit::recording::top_level_asm::make_debug_string): New.
1637 (gcc::jit::recording::top_level_asm::write_to_dump): New.
1638 (gcc::jit::recording::top_level_asm::write_reproducer): New.
1639 * jit-recording.h
1640 (gcc::jit::recording::context::add_top_level_asm): New decl.
1641 (gcc::jit::recording::context::m_top_level_asms): New field.
1642 (gcc::jit::recording::block::add_extended_asm): New decl.
1643 (gcc::jit::recording::block::end_with_extended_asm_goto): New
1644 decl.
1645 (gcc::jit::recording::asm_operand): New class.
1646 (gcc::jit::recording::output_asm_operand): New class.
1647 (gcc::jit::recording::input_asm_operand): New class.
1648 (gcc::jit::recording::extended_asm): New class.
1649 (gcc::jit::recording::extended_asm_simple): New class.
1650 (gcc::jit::recording::extended_asm_goto): New class.
1651 (gcc::jit::recording::top_level_asm): New class.
1652 * libgccjit++.h (gccjit::extended_asm): New forward decl.
1653 (gccjit::context::add_top_level_asm): New.
1654 (gccjit::block::add_extended_asm): New.
1655 (gccjit::block::end_with_extended_asm_goto): New.
1656 (gccjit::extended_asm): New class.
1657 (gccjit::extended_asm::extended_asm): New ctors.
1658 (gccjit::extended_asm::set_volatile_flag): New.
1659 (gccjit::extended_asm::set_inline_flag): New.
1660 (gccjit::extended_asm::add_output_operand): New.
1661 (gccjit::extended_asm::add_input_operand): New.
1662 (gccjit::extended_asm::add_clobber): New.
1663 (gccjit::extended_asm::get_inner_extended_asm): New.
1664 * libgccjit.c (struct gcc_jit_extended_asm): New.
1665 (jit_error): Make "loc" param take a gcc::jit::recording::location *
1666 rather than a gcc_jit_location *.
1667 (gcc_jit_block_add_extended_asm): New entrypoint.
1668 (gcc_jit_block_end_with_extended_asm_goto): New entrypoint.
1669 (gcc_jit_extended_asm_as_object): New entrypoint.
1670 (gcc_jit_extended_asm_set_volatile_flag): New entrypoint.
1671 (gcc_jit_extended_asm_set_inline_flag): New entrypoint.
1672 (gcc_jit_extended_asm_add_output_operand): New entrypoint.
1673 (gcc_jit_extended_asm_add_clobber): New entrypoint.
1674 (gcc_jit_context_add_top_level_asm): New entrypoint.
1675 * libgccjit.h: Add gcc_jit_extended_asm to ASCII art.
1676 (gcc_jit_extended_asm): New typedef.
1677 (LIBGCCJIT_HAVE_ASM_STATEMENTS): New define.
1678 (gcc_jit_block_add_extended_asm): New entrypoint.
1679 (gcc_jit_block_end_with_extended_asm_goto): New entrypoint.
1680 (gcc_jit_extended_asm_as_object): New entrypoint.
1681 (gcc_jit_extended_asm_set_volatile_flag): New entrypoint.
1682 (gcc_jit_extended_asm_set_inline_flag): New entrypoint.
1683 (gcc_jit_extended_asm_add_output_operand): New entrypoint.
1684 (gcc_jit_extended_asm_add_input_operand): New entrypoint.
1685 (gcc_jit_extended_asm_add_clobber): New entrypoint.
1686 (gcc_jit_context_add_top_level_asm): New entrypoint.
1687 * libgccjit.map (LIBGCCJIT_ABI_15): New.
1688
16892020-11-12 David Malcolm <dmalcolm@redhat.com>
1690
1691 * jit-recording.c (recording::context::new_string): Add "escaped"
1692 param and use it when creating the new recording::string instance.
1693 (recording::string::string): Add "escaped" param and use it to
1694 initialize m_escaped.
1695 (recording::string::make_debug_string): Replace check that first
1696 char is double-quote with use of m_escaped. Fix escaping of
1697 '\t' and '\n'. Set "escaped" on the result.
1698 * jit-recording.h (recording::context::new_string): Add "escaped"
1699 param.
1700 (recording::string::string): Add "escaped" param.
1701 (recording::string::m_escaped): New field.
1702
17032020-11-12 David Malcolm <dmalcolm@redhat.com>
1704
1705 * libgccjit.h: Fix typo in comment.
1706
17072020-09-14 Andrea Corallo <andrea.corallo@arm.com>
1708
1709 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1710
17112020-09-11 Andrea Corallo <andrea.corallo@arm.com>
1712
1713 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_14): New ABI tag.
1714 * docs/topics/expressions.rst (gcc_jit_global_set_initializer):
1715 Document new entry point in section 'Global variables'.
1716 * jit-playback.c (global_new_decl, global_finalize_lvalue): New
1717 method.
1718 (playback::context::new_global): Make use of global_new_decl,
1719 global_finalize_lvalue.
1720 (load_blob_in_ctor): New template function in use by the
1721 following.
1722 (playback::context::new_global_initialized): New method.
1723 * jit-playback.h (class context): Decl 'new_global_initialized',
1724 'global_new_decl', 'global_finalize_lvalue'.
1725 (lvalue::set_initializer): Add implementation.
1726 * jit-recording.c (recording::memento_of_get_pointer::get_size)
1727 (recording::memento_of_get_type::get_size): Add implementation.
1728 (recording::global::write_initializer_reproducer): New function in
1729 use by 'recording::global::write_reproducer'.
1730 (recording::global::replay_into)
1731 (recording::global::write_to_dump)
1732 (recording::global::write_reproducer): Handle
1733 initialized case.
1734 * jit-recording.h (class type): Decl 'get_size' and
1735 'num_elements'.
1736 * libgccjit++.h (class lvalue): Declare new 'set_initializer'
1737 method.
1738 (class lvalue): Decl 'is_global' and 'set_initializer'.
1739 (class global) Decl 'write_initializer_reproducer'. Add
1740 'm_initializer', 'm_initializer_num_bytes' fields. Implement
1741 'set_initializer'. Add a destructor to free 'm_initializer'.
1742 * libgccjit.c (gcc_jit_global_set_initializer): New function.
1743 * libgccjit.h (gcc_jit_global_set_initializer): New function
1744 declaration.
1745 * libgccjit.map (LIBGCCJIT_ABI_14): New ABI tag.
1746
17472020-08-28 Martin Sebor <msebor@redhat.com>
1748
1749 * jit-recording.c (recording::switch_::make_debug_string): Add argument
1750 to a call.
1751
17522020-08-22 Andrea Corallo <andrea.corallo@arm.com>
1753
1754 * libgccjit.c:
1755 (gcc_jit_context_new_rvalue_from_int)
1756 (gcc_jit_context_new_rvalue_from_long)
1757 (gcc_jit_context_new_rvalue_from_double)
1758 (gcc_jit_context_new_rvalue_from_ptr): Update function heading
1759 comments.
1760
17612020-06-16 Nicolas Bértolo <nicolasbertolo@gmail.com>
1762
1763 * Make-lang.in: Always define version, minor and release
1764 numbers. Create the Windows shared library as
1765 libgccjit-$(LIBGCCJIT_VERSION_NUM).dll.
1766
17672020-06-03 David Malcolm <dmalcolm@redhat.com>
1768
1769 PR jit/95306
1770 * jit-builtins.c (builtins_manager::make_primitive_type):
1771 Implement BT_CONST_VOLATILE_PTR.
1772
17732020-06-02 David Malcolm <dmalcolm@redhat.com>
1774
1775 PR jit/95426
1776 * dummy-frontend.c: Include "options.h", "stringpool.h", and
1777 "attribs.h".
1778 (ATTR_EXCL): New, copied from lto/lto-lang.c.
1779 (attr_noreturn_exclusions): Likewise.
1780 (attr_returns_twice_exclusions): Likewise.
1781 (attr_const_pure_exclusions): Likewise.
1782 (jit_attribute_table): Likewise, copied from lto_attribute_table.
1783 (jit_format_attribute_table): Likewise, copied from
1784 lto_format_attribute_table.
1785 (handle_noreturn_attribute): New, copied from lto/lto-lang.c.
1786 (handle_leaf_attribute): Likewise.
1787 (handle_const_attribute): Likewise.
1788 (handle_malloc_attribute): Likewise.
1789 (handle_pure_attribute): Likewise.
1790 (handle_novops_attribute): Likewise.
1791 (get_nonnull_operand): Likewise.
1792 (handle_nonnull_attribute): Likewise.
1793 (handle_nothrow_attribute): Likewise.
1794 (handle_sentinel_attribute): Likewise.
1795 (handle_type_generic_attribute): Likewise.
1796 (handle_transaction_pure_attribute): Likewise.
1797 (handle_returns_twice_attribute): Likewise.
1798 (handle_patchable_function_entry_attribute): Likewise.
1799 (ignore_attribute): Likewise.
1800 (handle_format_attribute): Likewise.
1801 (handle_format_arg_attribute): Likewise.
1802 (handle_fnspec_attribute): Likewise.
1803 (LANG_HOOKS_COMMON_ATTRIBUTE_TABLE): Define.
1804 (LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE): Define.
1805
18062020-05-28 Nicolas Bértolo <nicolasbertolo@gmail.com>
1807
1808 * Make-lang.in: Remove extra slash. Build libgccjit.dll and its
1809 import library in Windows.
1810 * config-lang.in: Update comment about --enable-host-shared.
1811 * jit-w32.h: New file.
1812 * jit-w32.c: New file.
1813 (print_last_error): New function that prints the error
1814 string corresponding to GetLastError().
1815 (get_TOKEN_USER_current_user): Helper function used for getting
1816 the SID belonging to the current user.
1817 (create_directory_for_current_user): Helper function to create
1818 a directory with permissions such that only the current user can
1819 access it.
1820 (win_mkdtemp): Create a temporary directory using Windows APIs.
1821 * jit-playback.c: Do not chmod files in Windows. Use LoadLibrary,
1822 FreeLibrary and GetProcAddress instead of libdl.
1823 * jit-result.h, jit-result.c: Introduce result::handle_t to
1824 abstract over the types used for dynamic library handles.
1825 * jit-tempdir.c: Do not use mkdtemp() in Windows, use
1826 win_mkdtemp().
1827
18282020-05-27 David Malcolm <dmalcolm@redhat.com>
1829
1830 PR jit/95314
1831 * dummy-frontend.c (LANG_HOOKS_DEEP_UNSHARING): Define to be true.
1832 * jit-playback.h (gcc::jit::playback::rvalue): Mark tree node with
1833 TREE_VISITED.
1834
18352020-05-27 Tom Tromey <tromey@gcc.gnu.org>
1836
1837 PR jit/91330
1838 * docs/conf.py (texinfo_documents): Set description.
1839 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1840
18412020-05-26 David Malcolm <dmalcolm@redhat.com>
1842
1843 PR jit/95306
1844 * docs/topics/functions.rst
1845 (gcc_jit_context_get_builtin_function): Document.
1846 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1847 * dummy-frontend.c (jit_langhook_global_bindings_p): Remove
1848 gcc_unreachable.
1849 * jit-builtins.c (type_names): New array.
1850 (get_string_for_type_id): New function.
1851 (gcc::jit::builtins_manager::make_primitive_type): Show name of
1852 type in error messages. Update cases to reflect the order in
1853 builtin-types.def. Implement cases for BT_INT8, BT_INT16,
1854 BT_UINT8, BT_CONST_PTR, BT_VOLATILE_PTR, BT_INT_PTR, BT_FLOAT_PTR,
1855 BT_CONST_DOUBLE_PTR, BT_SIZE, BT_CONST_SIZE.
1856
18572020-05-26 David Malcolm <dmalcolm@redhat.com>
1858
1859 * docs/topics/compatibility.rst: Fix underline.
1860 Fix missing labels.
1861 * docs/topics/types.rst: Fix missing blank line.
1862 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1863
18642020-05-26 David Malcolm <dmalcolm@redhat.com>
1865
1866 PR jit/95296
1867 * docs/topics/expressions.rst (Unary Operations): Document that
1868 result_type of gcc_jit_context_new_unary_op must be a numeric type.
1869 (Binary Operations): Likewise for gcc_jit_context_new_binary_op.
1870 (Global variables): Document that "type" of
1871 gcc_jit_context_new_global must be non-`void`.
1872 * docs/topics/function-pointers.rst
1873 (gcc_jit_context_new_function_ptr_type): Document that the
1874 param_types must be non-void, but that return_type may be.
1875 * docs/topics/functions.rst (Params): Document that
1876 gcc_jit_context_new_param's type must be non-void.
1877 (Functions): Likewise for gcc_jit_function_new_local.
1878 * docs/topics/types.rst (gcc_jit_context_new_array_type): Document
1879 that the type must be non-void.
1880 (gcc_jit_context_new_field): Likewise.
1881 * docs/_build/texinfo/Makefile: Regenerate.
1882 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1883 * libgccjit.c (gcc_jit_context_new_array_type): Fail if
1884 element_type is void.
1885 (gcc_jit_context_new_field): Likewise for "type".
1886 (gcc_jit_context_new_function_ptr_type): Likewise for each
1887 element of param_types.
1888 (gcc_jit_context_new_param): Likewise for "type".
1889 (gcc_jit_context_new_global): Likewise.
1890 (gcc_jit_function_new_local): Likewise.
1891 (gcc_jit_type_get_aligned): Likewise.
1892
18932020-03-31 Andrea Corallo <andrea.corallo@arm.com>
1894 David Malcolm <dmalcolm@redhat.com>
1895
1896 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_13): New ABI tag
1897 plus add version paragraph.
1898 * libgccjit++.h (namespace gccjit::version): Add new namespace.
1899 * libgccjit.c (gcc_jit_version_major, gcc_jit_version_minor)
1900 (gcc_jit_version_patchlevel): New functions.
1901 * libgccjit.h (LIBGCCJIT_HAVE_gcc_jit_version): New macro.
1902 (gcc_jit_version_major, gcc_jit_version_minor)
1903 (gcc_jit_version_patchlevel): New functions.
1904 * libgccjit.map (LIBGCCJIT_ABI_13) New ABI tag.
1905
19062020-03-23 Andrea Corallo <andrea.corallo@arm.com>
1907
1908 * jit-playback.h
1909 (gcc::jit::playback::context m_recording_ctxt): Remove
1910 m_char_array_type_node field.
1911 * jit-playback.c
1912 (playback::context::context) Remove m_char_array_type_node from member
1913 initializer list.
1914 (playback::context::new_string_literal) Fix logic to handle string
1915 length > 200.
1916
19172020-01-01 Jakub Jelinek <jakub@redhat.com>
1918
1919 Update copyright years.
1920
19212019-11-29 Julian Brown <julian@codesourcery.com>
1922
1923 * jit-builtins.c (BT_DFLOAT32_PTR, BT_DFLOAT64_PTR, BT_DFLOAT128_PTR):
1924 Remove commented-out cases.
1925
19262019-11-20 David Malcolm <dmalcolm@redhat.com>
1927
1928 PR jit/92483
1929 * jit-playback.c (gcc::jit::playback::context::make_fake_args):
1930 Update GCC_JIT_BOOL_OPTION_SELFCHECK_GC for new --param syntax.
1931
19322019-08-13 Richard Sandiford <richard.sandiford@arm.com>
1933
1934 PR middle-end/91421
1935 * jit-playback.c (new_function): Use set_decl_built_in_function.
1936
19372019-07-22 Andrea Corallo <andrea.corallo@arm.com>
1938
1939 * jit-recording.c (unary_op_reproducer_strings): Make it extern.
1940 (binary_op_reproducer_strings): Likewise.
1941 * jit-recording.h (unary_op_reproducer_strings): Likewise.
1942 (binary_op_reproducer_strings): Likewise.
1943 * libgccjit.c (gcc_jit_context_new_unary_op): Check result_type to be a
1944 numeric type.
1945 * libgccjit.c (gcc_jit_context_new_binary_op): Improve error message.
1946
19472019-07-04 Andrea Corallo <andrea.corallo@arm.com>
1948
1949 * libgccjit.c (gcc_jit_context_new_binary_op): Check result_type to be a
1950 numeric type.
1951
19522019-07-04 Andrea Corallo <andrea.corallo@arm.com>
1953
1954 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_12): New ABI tag.
1955 * docs/topics/types.rst: Add gcc_jit_context_new_bitfield.
1956 * jit-common.h (namespace recording): Add class bitfield.
1957 * jit-playback.c:
1958 (DECL_C_BIT_FIELD, SET_DECL_C_BIT_FIELD): Add macros.
1959 (playback::context::new_bitfield): New method.
1960 (playback::compound_type::set_fields): Add bitfield support.
1961 (playback::lvalue::mark_addressable): Was jit_mark_addressable make this
1962 a method of lvalue plus return a bool to communicate success.
1963 (playback::lvalue::get_address): Check for jit_mark_addressable return
1964 value.
1965 * jit-playback.h (new_bitfield): New method.
1966 (class bitfield): New class.
1967 (class lvalue): Add jit_mark_addressable method.
1968 * jit-recording.c (recording::context::new_bitfield): New method.
1969 (recording::bitfield::replay_into): New method.
1970 (recording::bitfield::write_to_dump): Likewise.
1971 (recording::bitfield::make_debug_string): Likewise.
1972 (recording::bitfield::write_reproducer): Likewise.
1973 * jit-recording.h (class context): Add new_bitfield method.
1974 (class field): Make it derivable by class bitfield.
1975 (class bitfield): Add new class.
1976 * libgccjit++.h (class context): Add new_bitfield method.
1977 * libgccjit.c (struct gcc_jit_bitfield): New structure.
1978 (gcc_jit_context_new_bitfield): New function.
1979 * libgccjit.h
1980 (LIBGCCJIT_HAVE_gcc_jit_context_new_bitfield) New macro.
1981 (gcc_jit_context_new_bitfield): New function.
1982 * libgccjit.map (LIBGCCJIT_ABI_12) New ABI tag.
1983
19842019-03-21 Jakub Jelinek <jakub@redhat.com>
1985
1986 * jit-recording.c (reproducer::m_set_identifiers): Use false as Lazy
1987 in hash_set template param.
1988
19892019-02-05 Andrea Corallo <andrea.corallo@arm.com>
1990
1991 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_11): New ABI tag.
1992 * docs/topics/contexts.rst (Additional driver options): New
1993 section.
1994 * jit-playback.c (invoke_driver): Add call to append_driver_options.
1995 * jit-recording.c: Within namespace gcc::jit...
1996 (recording::context::~context): Free the optnames within
1997 m_driver_options.
1998 (recording::context::add_driver_option): New method.
1999 (recording::context::append_driver_options): New method.
2000 (recording::context::dump_reproducer_to_file): Add driver
2001 options.
2002 * jit-recording.h: Within namespace gcc::jit...
2003 (recording::context::add_driver_option): New method.
2004 (recording::context::append_driver_options): New method.
2005 (recording::context::m_driver_options): New field.
2006 * libgccjit++.h (gccjit::context::add_driver_option): New
2007 method.
2008 * libgccjit.c (gcc_jit_context_add_driver_option): New API
2009 entrypoint.
2010 * libgccjit.h (gcc_jit_context_add_driver_option): New API
2011 entrypoint.
2012 (LIBGCCJIT_HAVE_gcc_jit_context_add_driver_option): New
2013 macro.
2014 * libgccjit.map (LIBGCCJIT_ABI_11): New ABI tag.
2015
20162019-01-01 Jakub Jelinek <jakub@redhat.com>
2017
2018 Update copyright years.
2019
20202018-11-15 David Malcolm <dmalcolm@redhat.com>
2021
2022 PR other/19165
2023 * dummy-frontend.c (jit_begin_diagnostic): Add diagnostic_t param.
2024
20252018-11-13 David Malcolm <dmalcolm@redhat.com>
2026
2027 * jit-playback.c: Replace "source_location" with "location_t".
2028
20292018-10-17 David Malcolm <dmalcolm@redhat.com>
2030
2031 * Make-lang.in (selftest-jit): New.
2032
20332018-06-28 Martin Liska <mliska@suse.cz>
2034
2035 * jit-playback.c: Include opt-suggestions.h.
2036
20372018-06-28 Martin Liska <mliska@suse.cz>
2038
2039 * jit-playback.c (class auto_argvec): Moved to vec.h.
2040 (auto_argvec::~auto_argvec): Likewise.
2041 (compile): Use the renamed name.
2042 (invoke_driver): Likewise.
2043
20442018-03-21 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2045
2046 PR jit/84288
2047 * Make-lang.in ($(LIBGCCJIT_FILENAME)): Add $(EXTRA_GCC_LIBS).
2048
20492018-03-09 David Malcolm <dmalcolm@redhat.com>
2050 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
2051
2052 PR jit/64089
2053 PR jit/84288
2054 * Make-lang.in (COMMA): New.
2055 (LIBGCCJIT_VERSION_SCRIPT_OPTION): New.
2056 (LIBGCCJIT_SONAME_OPTION): New.
2057 (jit): Move --version-script and -soname linker options to the
2058 above.
2059
20602018-01-25 David Malcolm <dmalcolm@redhat.com>
2061
2062 PR jit/81672
2063 * jit-recording.h (gcc::jit::recording::union_): Remove fields
2064 "m_loc" and "m_name".
2065
20662018-01-03 Jakub Jelinek <jakub@redhat.com>
2067
2068 Update copyright years.
2069
20702017-12-19 Jakub Jelinek <jakub@redhat.com>
2071
2072 * jit-playback.c (get_type, playback::compile_to_file::copy_file,
2073 playback::context::acquire_mutex): Replace Yoda conditions with
2074 typical order conditions.
2075 * libgccjit.c (gcc_jit_context_new_struct_type,
2076 gcc_jit_struct_set_fields, gcc_jit_context_new_union_type,
2077 gcc_jit_context_new_function, gcc_jit_timer_pop): Likewise.
2078 * jit-builtins.c (matches_builtin): Likewise.
2079 * jit-recording.c (recording::compound_type::set_fields,
2080 recording::fields::write_reproducer, recording::rvalue::set_scope,
2081 recording::function::validate): Likewise.
2082 * jit-logging.c (logger::decref): Likewise.
2083
20842017-11-30 Jakub Jelinek <jakub@redhat.com>
2085
2086 * jit-recording.c
2087 (recording::memento_of_new_rvalue_from_const <long>::write_reproducer):
2088 Use ; instead of ;;.
2089
20902017-11-28 Jakub Jelinek <jakub@redhat.com>
2091
2092 * jit-playback.c (add_switch): Build SWITCH_EXPR using build2 instead
2093 of build3. Formatting fixes. Adjust funciton comment.
2094
20952017-11-23 Tom de Vries <tom@codesourcery.com>
2096
2097 * libgccjit.c (RETURN_NULL_IF_FAIL_NONNULL_NUMERIC_TYPE): Wrap in
2098 JIT_{BEGIN,END}_STMT.
2099
21002017-10-31 David Malcolm <dmalcolm@redhat.com>
2101
2102 * docs/internals/index.rst (Running the test suite): Document
2103 PRESERVE_EXECUTABLES.
2104 (Running under valgrind): Add markup to RUN_UNDER_VALGRIND.
2105 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2106
21072017-10-04 David Malcolm <dmalcolm@redhat.com>
2108
2109 * docs/cp/topics/expressions.rst (Vector expressions): New
2110 section.
2111 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_10): New ABI tag.
2112 * docs/topics/expressions.rst (Vector expressions): New section.
2113 * docs/topics/types.rst (gcc_jit_type_get_vector): Add link to
2114 gcc_jit_context_new_rvalue_from_vector.
2115 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2116 * jit-common.h (gcc::jit:recording::vector_type): New forward
2117 decl.
2118 * jit-playback.c
2119 (gcc::jit::playback::context::new_rvalue_from_vector): New method.
2120 * jit-playback.h
2121 (gcc::jit::playback::context::new_rvalue_from_vector): New method.
2122 * jit-recording.c: In namespace gcc::jit::
2123 (class comma_separated_string): New class.
2124 (comma_separated_string::comma_separated_string): New ctor,
2125 adapted from recording::call::make_debug_string.
2126 (comma_separated_string::~comma_separated_string): New dtor.
2127 In namespace gcc::jit::recording::
2128 (context::new_rvalue_from_vector): New method.
2129 (type::get_vector): Update for renaming of memento_of_get_vector.
2130 (class memento_of_get_vector): Rename to...
2131 (class vector_type): ..this.
2132 (memento_of_new_rvalue_from_vector::memento_of_new_rvalue_from_vector):
2133 New ctor.
2134 (memento_of_new_rvalue_from_vector::replay_into): New method.
2135 (memento_of_new_rvalue_from_vector::visit_children): New method.
2136 (memento_of_new_rvalue_from_vector::make_debug_string): New
2137 method.
2138 (memento_of_new_rvalue_from_vector::write_reproducer): New method.
2139 (call::make_debug_string): Split out arg-printing code into ctor
2140 for comma_separated_string.
2141 * jit-recording.h: In namespace gcc::jit::recording::
2142 (context::new_rvalue_from_vector): New method.
2143 (type::dyn_cast_vector_type): New virtual function.
2144 (class memento_of_get_vector): Rename to...
2145 (class vector_type): ...this.
2146 (vector_type::unqualified): Remove this vfunc override in favor
2147 of...
2148 (vector_type::get_element_type): ...this new method.
2149 (vector_type::get_num_units): New method.
2150 (vector_type::dyn_cast_vector_type): New vfunc override.
2151 (class memento_of_new_rvalue_from_vector): New class.
2152 * libgccjit++.h (gccjit::context::new_rvalue): Add overload for
2153 vector of rvalue.
2154 * libgccjit.c (gcc_jit_context_new_binary_op): Strip off type
2155 qualifications when checking that both operands have same type.
2156 (gcc_jit_context_new_rvalue_from_vector): New API entrypoint.
2157 * libgccjit.h
2158 (LIBGCCJIT_HAVE_gcc_jit_context_new_rvalue_from_vector): New
2159 macro.
2160 (gcc_jit_context_new_rvalue_from_vector): New API entrypoint.
2161 * libgccjit.map (LIBGCCJIT_ABI_10): New ABI tag.
2162
21632017-09-28 David Malcolm <dmalcolm@redhat.com>
2164
2165 * docs/topics/expressions.rst (Function calls): Add link to
2166 gcc_jit_context_new_function_ptr_type.
2167 (Function pointers): Convert to cross-references to
2168 function-pointers.rst, moving material there.
2169 * docs/topics/function-pointers.rst: New page.
2170 * docs/topics/index.rst: Add function-pointers.rst.
2171 * docs/topics/types.rst (Function pointer types): New section.
2172 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2173
21742017-09-28 David Malcolm <dmalcolm@redhat.com>
2175
2176 * jit-recording.c
2177 (gcc::jit::recording::function_type::is_same_type_as): New function.
2178 * jit-recording.h: In namespace gcc::jit::recording::
2179 (type::accepts_writes_from): Use is_same_type_as rather than pointer
2180 equality.
2181 (type::is_same_type_as): New virtual function.
2182 (function_type::is_same_type_as): New override.
2183
21842017-09-27 David Malcolm <dmalcolm@redhat.com>
2185
2186 * docs/cp/topics/expressions.rst (Function pointers): New section.
2187 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_9): New tag.
2188 * docs/topics/expressions.rst (Function pointers): New section.
2189 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2190 * jit-common.h (class gcc::jit::recording::function_pointer): New
2191 forward decl.
2192 * jit-playback.c (gcc::jit::playback::function::get_address): New
2193 method.
2194 * jit-playback.h (gcc::jit::playback::function::get_address): New
2195 method decl.
2196 * jit-recording.c: Within namespace gcc::jit::recording...
2197 (function::function): Initialize new field "m_fn_ptr_type".
2198 (function::get_address): New method.
2199 (function_pointer::replay_into): New method.
2200 (function_pointer::visit_children): New method.
2201 (function_pointer::make_debug_string): New method.
2202 (function_pointer::write_reproducer): New method.
2203 * jit-recording.h: Within namespace gcc::jit::recording...
2204 (function::get_address): New method.
2205 (function): Add field "m_fn_ptr_type".
2206 (class function_pointer): New subclass of rvalue.
2207 * libgccjit++.h (gccjit::function::get_address): New method.
2208 * libgccjit.c (gcc_jit_function_get_address): New function.
2209 * libgccjit.h (LIBGCCJIT_HAVE_gcc_jit_function_get_address): New
2210 macro.
2211 (gcc_jit_function_get_address): New API entrypoint.
2212 * libgccjit.map (LIBGCCJIT_ABI_9): New tag.
2213
22142017-09-14 David Malcolm <dmalcolm@redhat.com>
2215
2216 PR jit/82174
2217 * jit-builtins.c (matches_builtin): Ignore entries with a NULL
2218 name.
2219
22202017-08-18 David Malcolm <dmalcolm@redhat.com>
2221
2222 PR tree-optimization/46805
2223 * dummy-frontend.c (jit_langhook_parse_file): Handle vector types.
2224
22252017-08-18 David Malcolm <dmalcolm@redhat.com>
2226
2227 * jit-recording.c (class gcc::jit::reproducer): Rename field
2228 "m_identifiers" to "m_map_memento_to_identifier". Add field
2229 "m_set_identifiers" and struct hash_traits for it.
2230 (gcc::jit::reproducer::reproducer): Update for above.
2231 (convert_to_identifier): New function.
2232 (gcc::jit::reproducer::ensure_identifier_is_unique): New method.
2233 (gcc::jit::reproducer::make_identifier): Avoid appending the %p
2234 unless necessary for uniqueness. Update for field renaming.
2235 (gcc::jit::reproducer::get_identifier): Update for field renaming.
2236
22372017-08-09 David Malcolm <dmalcolm@redhat.com>
2238
2239 * docs/cp/topics/types.rst (Vector types): New section.
2240 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_8): New tag.
2241 * docs/topics/types.rst (gcc_jit_context_get_type): Fix typo in
2242 example.
2243 (Vector types): New section.
2244 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2245 * jit-playback.c (gcc::jit::playback::type::get_vector): New
2246 method.
2247 * jit-playback.h (gcc::jit::playback::type::get_vector): New
2248 method.
2249 * jit-recording.c: In namespace gcc::jit::recording::
2250 (type::get_vector): New method.
2251 (memento_of_get_aligned::write_reproducer): Fix typo
2252 in leading comment.
2253 (memento_of_get_vector::replay_into): New method.
2254 (memento_of_get_vector::make_debug_string): New method.
2255 (memento_of_get_vector::write_reproducer): New method.
2256 * jit-recording.h: In namespace gcc::jit::recording::
2257 (type::get_vector): New
2258 method.
2259 (class memento_of_get_vector): New class.
2260 * libgccjit++.h (gccjit::type::get_vector): New method.
2261 * libgccjit.c (gcc_jit_type_get_vector): New public entrypoint.
2262 * libgccjit.h (LIBGCCJIT_HAVE_gcc_jit_type_get_vector): New
2263 define.
2264 (gcc_jit_type_get_vector): New decl.
2265 * libgccjit.map (LIBGCCJIT_ABI_8): New ABI tag.
2266
22672017-07-05 Richard Sandiford <richard.sandiford@linaro.org>
2268 Alan Hayward <alan.hayward@arm.com>
2269 David Sherwood <david.sherwood@arm.com>
2270
2271 * dummy-frontend.c (jit_langhook_type_for_mode): Remove "enum" before
2272 "machine_mode".
2273
22742017-04-24 David Malcolm <dmalcolm@redhat.com>
2275
2276 * docs/cp/topics/types.rst (gccjit::type::get_const): Remove
2277 comment.
2278 (gccjit::type::get_aligned): Add.
2279 * docs/topics/compatibility.rst: Add LIBGCCJIT_ABI_7.
2280 * docs/topics/types.rst: Add gcc_jit_type_get_aligned.
2281 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2282 * jit-playback.c (gcc::jit::playback::type::get_aligned): New
2283 method.
2284 * jit-playback.h (gcc::jit::playback::type::get_aligned): New
2285 method.
2286 * jit-recording.c: Within namespace gcc::jit::recording...
2287 (type::get_aligned): New method.
2288 (memento_of_get_aligned::replay_into): New method.
2289 (memento_of_get_aligned::make_debug_string): New method.
2290 (memento_of_get_aligned::write_reproducer): New method.
2291 * jit-recording.h: Within namespace gcc::jit::recording...
2292 (type::get_aligned): New method.
2293 (type::accepts_writes_from): Strip off qualifications from
2294 this when comparing pointer equality.
2295 (decorated_type): New subclass of type, subsuming the
2296 commonality between memento_of_get_const and
2297 memento_of_get_volatile.
2298 (memento_of_get_const): Make a subclass of decorated_type,
2299 rather than type.
2300 (memento_of_get_volatile): Likewise.
2301 (memento_of_get_aligned): Likewise.
2302 * libgccjit++.h: Within namespace gccjit...
2303 (type::get_const): New method.
2304 (type::get_aligned): New method.
2305 * libgccjit.c (gcc_jit_type_get_aligned): New function.
2306 * libgccjit.h (gcc_jit_type_get_aligned): New decl.
2307 * libgccjit.map (LIBGCCJIT_ABI_7): New
2308 (gcc_jit_type_get_aligned): Add.
2309
23102017-01-19 David Malcolm <dmalcolm@redhat.com>
2311
2312 * dummy-frontend.c (jit_langhook_type_for_size): Delete.
2313 (LANG_HOOKS_TYPE_FOR_SIZE): Don't redefine.
2314
23152017-01-18 David Malcolm <dmalcolm@redhat.com>
2316
2317 * dummy-frontend.c (jit_langhook_type_for_size): Implement, using
2318 lto's lto_type_for_size.
2319
23202017-01-01 Jakub Jelinek <jakub@redhat.com>
2321
2322 Update copyright years.
2323
23242016-05-20 David Malcolm <dmalcolm@redhat.com>
2325
2326 * docs/topics/compatibility.rst: Add LIBGCCJIT_ABI_6.
2327 * docs/topics/expressions.rst (Function calls): Add documentation
2328 of gcc_jit_rvalue_set_bool_require_tail_call.
2329 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2330 * jit-common.h (gcc::jit::recording::base_call): Add forward decl.
2331 * jit-playback.c: Within namespace gcc::jit::playback...
2332 (context::build_call) Add "require_tail_call" param and use it
2333 to set CALL_EXPR_MUST_TAIL_CALL.
2334 (context::new_call): Add "require_tail_call" param.
2335 (context::new_call_through_ptr): Likewise.
2336 * jit-playback.h: Within namespace gcc::jit::playback...
2337 (context::new_call: Add "require_tail_call" param.
2338 (context::new_call_through_ptr): Likewise.
2339 (context::build_call): Likewise.
2340 * jit-recording.c: Within namespace gcc::jit::recording...
2341 (base_call::base_call): New constructor.
2342 (base_call::write_reproducer_tail_call): New method.
2343 (call::call): Update for inheritance from base_call.
2344 (call::replay_into): Provide m_require_tail_call to call
2345 to new_call.
2346 (call::write_reproducer): Call write_reproducer_tail_call.
2347 (call_through_ptr::call_through_ptr): Update for inheritance from
2348 base_call.
2349 (call_through_ptr::replay_into): Provide m_require_tail_call to call
2350 to new_call_through_ptr.
2351 (recording::call_through_ptr::write_reproducer): Call
2352 write_reproducer_tail_call.
2353 * jit-recording.h: Within namespace gcc::jit::recording...
2354 (rvalue::dyn_cast_base_call): New virtual function.
2355 (class base_call): New subclass of class rvalue.
2356 (class call): Inherit from base_call rather than directly from
2357 rvalue, moving get_precedence and m_args to base_call.
2358 (class call_through_ptr): Likewise.
2359 * libgccjit.c (gcc_jit_rvalue_set_bool_require_tail_call): New
2360 function.
2361 * libgccjit.h
2362 (LIBGCCJIT_HAVE_gcc_jit_rvalue_set_bool_require_tail_call): New
2363 macro.
2364 (gcc_jit_rvalue_set_bool_require_tail_call): New function.
2365 * libgccjit.map (LIBGCCJIT_ABI_6): New.
2366 (gcc_jit_rvalue_set_bool_require_tail_call): Add.
2367
23682016-05-17 David Malcolm <dmalcolm@redhat.com>
2369
2370 * dummy-frontend.c: Include diagnostic.h.
2371 (jit_begin_diagnostic): New function.
2372 (jit_end_diagnostic): New function.
2373 (jit_langhook_init): Register jit_begin_diagnostic
2374 and jit_end_diagnostic with the global_dc.
2375 * jit-playback.c: Include diagnostic.h.
2376 (gcc::jit::playback::context::add_diagnostic): New method.
2377 * jit-playback.h (struct diagnostic_context): Add forward
2378 declaration.
2379 (gcc::jit::playback::context::add_diagnostic): New method.
2380
23812016-05-17 David Malcolm <dmalcolm@redhat.com>
2382
2383 * docs/topics/expressions.rst (Function calls): Document
2384 gcc_jit_context_new_call_through_ptr.
2385 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2386
23872016-05-13 David Malcolm <dmalcolm@redhat.com>
2388
2389 * jit-playback.h: Within namespace gcc:jit::playback...
2390 (compile_to_memory::postprocess): Mark with FINAL OVERRIDE.
2391 (compile_to_file::postprocess): Likewise.
2392 (function::finalizer): Likewise.
2393 (block::finalizer): Likewise.
2394 (source_file::finalizer): Likewise.
2395 (source_line::finalizer): Likewise.
2396 * jit-recording.c (gcc::jit::rvalue_usage_validator):: Likewise.
2397 * jit-recording.h: Within namespace gcc::jit::recording...
2398 (string::replay_into): Mark with FINAL OVERRIDE.
2399 (string::make_debug_string): Likewise.
2400 (string::write_reproducer): Likewise.
2401 (location::replay_into): Likewise.
2402 (location::dyn_cast_location): Likewise.
2403 (location::make_debug_string): Likewise.
2404 (location::write_reproducer): Likewise.
2405 (memento_of_get_type::dereference): Likewise.
2406 (memento_of_get_type::accepts_writes_from): Likewise.
2407 (memento_of_get_type::is_int): Likewise.
2408 (memento_of_get_type::is_float): Likewise.
2409 (memento_of_get_type::is_bool): Likewise.
2410 (memento_of_get_type::is_pointer): Likewise.
2411 (memento_of_get_type::is_array): Likewise.
2412 (memento_of_get_type::is_void): Likewise.
2413 (memento_of_get_type::replay_into): Likewise.
2414 (memento_of_get_type::make_debug_string): Likewise.
2415 (memento_of_get_type::write_reproducer): Likewise.
2416 (memento_of_get_pointer::dereference): Likewise.
2417 (memento_of_get_pointer::accepts_writes_from): Likewise.
2418 (memento_of_get_pointer::replay_into): Likewise.
2419 (memento_of_get_pointer::is_int): Likewise.
2420 (memento_of_get_pointer::is_float): Likewise.
2421 (memento_of_get_pointer::is_bool): Likewise.
2422 (memento_of_get_pointer::is_pointer): Likewise.
2423 (memento_of_get_pointer::is_array): Likewise.
2424 (memento_of_get_pointer::make_debug_string): Likewise.
2425 (memento_of_get_pointer::write_reproducer): Likewise.
2426 (memento_of_get_const::dereference): Likewise.
2427 (memento_of_get_const::accepts_writes_from): Likewise.
2428 (memento_of_get_const::unqualified): Likewise.
2429 (memento_of_get_const::is_int): Likewise.
2430 (memento_of_get_const::is_float): Likewise.
2431 (memento_of_get_const::is_bool): Likewise.
2432 (memento_of_get_const::is_pointer): Likewise.
2433 (memento_of_get_const::is_array): Likewise.
2434 (memento_of_get_const::void replay_into): Likewise;
2435 (memento_of_get_const::make_debug_string): Likewise.
2436 (memento_of_get_const::write_reproducer): Likewise.
2437 (memento_of_get_volatile::dereference): Likewise.
2438 (memento_of_get_volatile::unqualified): Likewise.
2439 (memento_of_get_volatile::is_int): Likewise.
2440 (memento_of_get_volatile::is_float): Likewise.
2441 (memento_of_get_volatile::is_bool): Likewise.
2442 (memento_of_get_volatile::is_pointer): Likewise.
2443 (memento_of_get_volatile::is_array): Likewise.
2444 (memento_of_get_volatile::replay_into): Likewise;
2445 (memento_of_get_volatile::make_debug_string): Likewise.
2446 (memento_of_get_volatile::write_reproducer): Likewise.
2447 (array_type::dereference): Likewise.
2448 (array_type::is_int): Likewise.
2449 (array_type::is_float): Likewise.
2450 (array_type::is_bool): Likewise.
2451 (array_type::is_pointer): Likewise.
2452 (array_type::is_array): Likewise.
2453 (array_type::replay_into): Likewise;
2454 (array_type::make_debug_string): Likewise.
2455 (array_type::write_reproducer): Likewise.
2456 (function_type::dereference): Likewise.
2457 (function_type::function_dyn_cast_function_type): Likewise.
2458 (function_type::function_as_a_function_type): Likewise.
2459 (function_type::is_int): Likewise.
2460 (function_type::is_float): Likewise.
2461 (function_type::is_bool): Likewise.
2462 (function_type::is_pointer): Likewise.
2463 (function_type::is_array): Likewise.
2464 (function_type::replay_into): Likewise;
2465 (function_type::make_debug_string): Likewise.
2466 (function_type::write_reproducer): Likewise.
2467 (field::replay_into): Likewise;
2468 (field::write_to_dump): Likewise.
2469 (field::make_debug_string): Likewise.
2470 (field::write_reproducer): Likewise.
2471 (compound_type::dereference): Likewise.
2472 (compound_type::is_int): Likewise.
2473 (compound_type::is_float): Likewise.
2474 (compound_type::is_bool): Likewise.
2475 (compound_type::is_pointer): Likewise.
2476 (compound_type::is_array): Likewise.
2477 (compound_type::has_known_size): Likewise.
2478 (struct_::dyn_cast_struct): Likewise.
2479 (struct_::replay_into): Likewise.
2480 (struct_::access_as_type): Likewise.
2481 (struct_::make_debug_string): Likewise.
2482 (struct_::write_reproducer): Likewise.
2483 (fields::replay_into): Likewise.
2484 (fields::write_to_dump): Likewise.
2485 (fields::make_debug_string): Likewise.
2486 (fields::write_reproducer): Likewise.
2487 (union_::replay_into): Likewise.
2488 (union_::make_debug_string): Likewise.
2489 (union_::write_reproducer): Likewise.
2490 (lvalue::access_as_rvalue): Mark with OVERRIDE.
2491 (param::replay_into): Mark with FINAL OVERRIDE.
2492 (param::visit_children): Likewise.
2493 (param::dyn_cast_param): Likewise.
2494 (param::access_as_rvalue): Likewise.
2495 (param::access_as_lvalue): Likewise.
2496 (param::make_debug_string): Likewise.
2497 (param::write_reproducer): Likewise.
2498 (param::get_precedence): Likewise.
2499 (function::replay_into): Likewise.
2500 (function::write_to_dump): Likewise.
2501 (function::make_debug_string): Likewise.
2502 (function::write_reproducer): Likewise.
2503 (block::write_to_dump): Likewise.
2504 (block::make_debug_string): Likewise.
2505 (block::write_reproducer): Likewise.
2506 (block::replay_into): Likewise.
2507 (global::replay_into): Likewise;
2508 (global::visit_children): Likewise.
2509 (global::write_to_dump): Likewise.
2510 (global::make_debug_string): Likewise.
2511 (global::write_reproducer): Likewise.
2512 (global::get_precedence): Likewise.
2513 (memento_of_new_rvalue_from_const::replay_into): Likewise.
2514 (memento_of_new_rvalue_from_const::visit_children): Likewise.
2515 (memento_of_new_rvalue_from_const::is_constant): Likewise.
2516 (memento_of_new_rvalue_from_const::get_wide_int): Likewise.
2517 (memento_of_new_rvalue_from_const::make_debug_string): Likewise.
2518 (memento_of_new_rvalue_from_const::write_reproducer): Likewise.
2519 (memento_of_new_rvalue_from_const::get_precedence): Likewise.
2520 (memento_of_new_string_literal::replay_into): Likewise.
2521 (memento_of_new_string_literal::visit_children): Likewise.
2522 (memento_of_new_string_literal::make_debug_string): Likewise.
2523 (memento_of_new_string_literal::write_reproducer): Likewise.
2524 (memento_of_new_string_literal::get_precedence): Likewise.
2525 (unary_op::replay_into): Likewise.
2526 (unary_op::visit_children): Likewise.
2527 (unary_op::make_debug_string): Likewise.
2528 (unary_op::write_reproducer): Likewise.
2529 (unary_op::get_precedence): Likewise.
2530 (binary_op::replay_into): Likewise.
2531 (binary_op::visit_children): Likewise.
2532 (binary_op::make_debug_string): Likewise.
2533 (binary_op::write_reproducer): Likewise.
2534 (binary_op::get_precedence): Likewise.
2535 (comparison::replay_into): Likewise.
2536 (comparison::visit_children): Likewise.
2537 (comparison::make_debug_string): Likewise.
2538 (comparison::write_reproducer): Likewise.
2539 (comparison::get_precedence): Likewise.
2540 (cast::replay_into): Likewise.
2541 (cast::visit_children): Likewise.
2542 (cast::make_debug_string): Likewise.
2543 (cast::write_reproducer): Likewise.
2544 (cast::get_precedence): Likewise.
2545 (call::replay_into): Likewise.
2546 (call::visit_children): Likewise.
2547 (call::make_debug_string): Likewise.
2548 (call::write_reproducer): Likewise.
2549 (call::get_precedence): Likewise.
2550 (call_through_ptr::replay_into): Likewise.
2551 (call_through_ptr::visit_children): Likewise.
2552 (call_through_ptr::make_debug_string): Likewise.
2553 (call_through_ptr::write_reproducer): Likewise.
2554 (call_through_ptr::get_precedence): Likewise.
2555 (array_access::replay_into): Likewise.
2556 (array_access::visit_children): Likewise.
2557 (array_access::make_debug_string): Likewise.
2558 (array_access::write_reproducer): Likewise.
2559 (array_access::get_precedence): Likewise.
2560 (access_field_of_lvalue::replay_into): Likewise.
2561 (access_field_of_lvalue::visit_children): Likewise.
2562 (access_field_of_lvalue::make_debug_string): Likewise.
2563 (access_field_of_lvalue::write_reproducer): Likewise.
2564 (access_field_of_lvalue::get_precedence): Likewise.
2565 (access_field_rvalue::replay_into): Likewise.
2566 (access_field_rvalue::visit_children): Likewise.
2567 (access_field_rvalue::make_debug_string): Likewise.
2568 (access_field_rvalue::write_reproducer): Likewise.
2569 (access_field_rvalue::get_precedence): Likewise.
2570 (dereference_field_rvalue::replay_into): Likewise.
2571 (dereference_field_rvalue::visit_children): Likewise.
2572 (dereference_field_rvalue::make_debug_string): Likewise.
2573 (dereference_field_rvalue::write_reproducer): Likewise.
2574 (dereference_field_rvalue::get_precedence): Likewise.
2575 (dereference_rvalue::replay_into): Likewise.
2576 (dereference_rvalue::visit_children): Likewise.
2577 (dereference_rvalue::make_debug_string): Likewise.
2578 (dereference_rvalue::write_reproducer): Likewise.
2579 (dereference_rvalue::get_precedence): Likewise.
2580 (get_address_of_lvalue::replay_into): Likewise.
2581 (get_address_of_lvalue::visit_children): Likewise.
2582 (get_address_of_lvalue::make_debug_string): Likewise.
2583 (get_address_of_lvalue::write_reproducer): Likewise.
2584 (get_address_of_lvalue::get_precedence): Likewise.
2585 (local::replay_into): Likewise.
2586 (local::visit_children): Likewise.
2587 (local::write_to_dump): Likewise.
2588 (local::make_debug_string): Likewise.
2589 (local::write_reproducer): Likewise.
2590 (local::get_precedence): Likewise.
2591 (statement::write_to_dump): Likewise.
2592 (eval::replay_into): Likewise.
2593 (eval::make_debug_string): Likewise.
2594 (eval::write_reproducer): Likewise.
2595 (assignment::replay_into): Likewise.
2596 (assignment::make_debug_string): Likewise.
2597 (assignment::write_reproducer): Likewise.
2598 (assignment_op::replay_into): Likewise.
2599 (assignment_op::make_debug_string): Likewise.
2600 (assignment_op::write_reproducer): Likewise.
2601 (comment::replay_into): Likewise.
2602 (comment::make_debug_string): Likewise.
2603 (comment::write_reproducer): Likewise.
2604 (conditional::replay_into): Likewise.
2605 (conditional::get_successor_blocks): Likewise.
2606 (conditional::make_debug_string): Likewise.
2607 (conditional::write_reproducer): Likewise.
2608 (jump::replay_into): Likewise.
2609 (jump::get_successor_blocks): Likewise.
2610 (jump::make_debug_string): Likewise.
2611 (jump::write_reproducer): Likewise.
2612 (return_::replay_into): Likewise.
2613 (return_::get_successor_blocks): Likewise.
2614 (return_::make_debug_string): Likewise.
2615 (return_::write_reproducer): Likewise.
2616 (case_::replay_into): Likewise.
2617 (case_::write_reproducer): Likewise.
2618 (case_::make_debug_string): Likewise.
2619 (switch_::replay_into): Likewise.
2620 (switch_::get_successor_blocks): Likewise.
2621 (switch_::make_debug_string): Likewise.
2622 (switch_::write_reproducer): Likewise.
2623
26242016-02-08 David Malcolm <dmalcolm@redhat.com>
2625
2626 * dummy-frontend.c (jit_langhook_init): Remove
2627 second argument to build_common_tree_nodes to
2628 track r233218.
2629
26302016-01-23 Iain Buclaw <ibuclaw@gdcproject.org>
2631
2632 * jit-playback.c: Include pthread.h.
2633
26342016-01-19 David Malcolm <dmalcolm@redhat.com>
2635
2636 PR jit/69144
2637 * jit-playback.c (gcc::jit::playback::compile_to_file::postprocess):
2638 Potentially add the temporary artifact to the tempdir's list of
2639 tempfiles needing additional cleanup.
2640 (gcc::jit::playback::context::extract_any_requested_dumps): Likewise
2641 for the dumpfile.
2642 * jit-tempdir.c (gcc::jit::tempdir::~tempdir): Clean up additional
2643 tempfiles.
2644 * jit-tempdir.h (gcc::jit::tempdir::add_temp_file): New method.
2645 (gcc::jit::tempdir::m_tempfiles): New field.
2646 * docs/cp/intro/tutorial04.rst: Update for changes to toyvm.cc.
2647 * docs/examples/tut04-toyvm/toyvm.cc (class compilation_result):
2648 New.
2649 (toyvm_function::compile): Change return type from function ptr
2650 to a compilation_result.
2651 (toyvm_function::get_function_name): New accessor.
2652 (toyvm_function::m_funcname): New field.
2653 (get_function_name): Convert to...
2654 (toyvm_function::make_function_name): ...this new method.
2655 (toyvm_function::parse): Call make_function_name.
2656 (toyvm_function::compile): Convert return type from function ptr
2657 to a compilation_result. Use get_function_name.
2658 (compilation_state::compile): Convert return type from
2659 gcc_jit_result * to a compilation_result.
2660 (test_script): Update for above changes, extracting the code from
2661 the compilation_result.
2662 (main): Likewise.
2663 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2664
26652016-01-04 Jakub Jelinek <jakub@redhat.com>
2666
2667 Update copyright years.
2668
26692015-11-11 Andrew MacLeod <amacleod@redhat.com>
2670
2671 * dummy-frontend.c: Remove unused header files.
2672 * jit-builtins.c: Likewise.
2673 * jit-playback.c: Likewise.
2674 * jit-recording.c: Likewise.
2675 * jit-spec.c: Likewise.
2676 * libgccjit.c: Likewise.
2677
26782015-11-07 Richard Sandiford <richard.sandiford@arm.com>
2679
2680 * jit-builtins.c: Don't undef DEF_BUILTIN.
2681
26822015-10-29 Andrew MacLeod <amacleod@redhat.com>
2683
2684 * dummy-frontend.c: Reorder #include's and remove duplicates.
2685 * jit-builtins.c: Likewise.
2686 * jit-playback.c: Likewise.
2687 * jit-recording.c: Likewise.
2688 * libgccjit.c: Likewise.
2689
26902015-10-13 Jakub Jelinek <jakub@redhat.com>
2691
2692 * jit-builtins.c (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10,
2693 DEF_FUNCTION_TYPE_11): Define.
2694 * jit-builtins.h (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10,
2695 DEF_FUNCTION_TYPE_11): Define.
2696
26972015-09-30 Thomas Schwinge <thomas@codesourcery.com>
2698 Ulrich Drepper <drepper@gmail.com>
2699
2700 * jit-builtins.h: Undefine DEF_FUNCTION_TYPE_VAR_6 after use.
2701
27022015-09-30 Matthias Klose <doko@ubuntu.com>
2703
2704 * jit-builtins.h Define DEF_FUNCTION_TYPE_VAR_6,
2705 remove DEF_FUNCTION_TYPE_VAR_11.
2706 * jit-builtins.c (builtins_manager::make_type): Define and handle
2707 DEF_FUNCTION_TYPE_VAR_6, remove DEF_FUNCTION_TYPE_VAR_11.
2708
27092015-08-25 David Malcolm <dmalcolm@redhat.com>
2710
2711 * docs/cp/topics/contexts.rst
2712 (gccjit::context::set_bool_use_external_driver): New.
2713 * docs/internals/test-hello-world.exe.log.txt: Update.
2714 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_5): New.
2715 * docs/topics/contexts.rst
2716 (gcc_jit_context_set_bool_use_external_driver): New.
2717 * jit-common.h (enum inner_bool_option): Add
2718 INNER_BOOL_OPTION_USE_EXTERNAL_DRIVER.
2719 * jit-playback.c (gcc_driver_name): New global.
2720 (gcc:jit::playback::context::invoke_driver): Split out second
2721 half into...
2722 (gcc::jit::playback::context::invoke_embedded_driver): ...this new
2723 function, and...
2724 (gcc::jit::playback::context::invoke_external_driver): ...this new
2725 function.
2726 * jit-playback.h
2727 (gcc::jit::playback::context::get_inner_bool_option): New.
2728 (gcc::jit::playback::context::invoke_embedded_driver): New.
2729 (gcc::jit::playback::context::invoke_external_driver): New.
2730 * jit-recording.c (inner_bool_option_reproducer_strings):
2731 Add entry for INNER_BOOL_OPTION_USE_EXTERNAL_DRIVER.
2732 * libgccjit++.h
2733 (gccjit::context::set_bool_use_external_driver): New.
2734 * libgccjit.c (gcc_jit_context_set_bool_use_external_driver): New.
2735 * libgccjit.h (gcc_jit_context_set_bool_use_external_driver): New.
2736 (LIBGCCJIT_HAVE_gcc_jit_context_set_bool_use_external_driver):
2737 New.
2738 * libgccjit.map (LIBGCCJIT_ABI_5): New.
2739 * notes.txt: Show invocation of embedded copy of driver.
2740 * docs/internals/test-hello-world.exe.log.txt: Update
2741
27422015-08-13 David Malcolm <dmalcolm@redhat.com>
2743
2744 * jit-playback.c (invoke_driver): On OS X, add
2745 "-Wl,-undefined,dynamic_lookup" to the driver arguments.
2746
27472015-08-03 David Malcolm <dmalcolm@redhat.com>
2748
2749 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_4): New.
2750 * docs/topics/contexts.rst (GCC_JIT_BOOL_OPTION_DUMP_SUMMARY):
2751 We no longer show a profile.
2752 * docs/topics/index.rst (Topic Reference): Add performance.rst.
2753 * docs/topics/performance.rst: New file.
2754 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2755 * jit-playback.c (gcc::jit::playback::context::compile): Add timer
2756 param when constructing the "toplev" instance.
2757 (gcc::jit::playback::context::acquire_mutex): Add timer param when
2758 constructing auto_timevar instance.
2759 (gcc::jit::playback::context::make_fake_args): If we have a timer,
2760 add "-ftime-report".
2761 (gcc::jit::playback::context::invoke_driver): Add timer param when
2762 constructing auto_timevar instance.
2763 (gcc::jit::playback::context::dlopen_built_dso): Likewise.
2764 * jit-playback.h (gcc::jit::playback::context::get_timer): New accessor.
2765 * jit-recording.c: Include timevar.h.
2766 (gcc::jit::recording::context::context): Initialize field "m_timer".
2767 * jit-recording.h: Add forward declaration of class timer.
2768 (gcc::jit::recording::context::set_timer): New method.
2769 (gcc::jit::recording::context::get_timer): New method.
2770 (gcc::jit::recording::context::m_timer): New field.
2771 * libgccjit++.h (gccjit::timer): New class.
2772 (gccjit::auto_time): New class.
2773 (gccjit::context::set_timer): New method.
2774 (gccjit::context::get_timer): New.
2775 (gccjit::timer::timer): New.
2776 (gccjit::timer::push): New.
2777 (gccjit::timer::pop): New.
2778 (timer::print): New.
2779 (timer::get_inner_timer): New.
2780 (timer::release): New.
2781 (auto_time::auto_time): New.
2782 (auto_time::~auto_time): New.
2783 * libgccjit.c: Include timevar.h.
2784 (struct gcc_jit_timer): New.
2785 (gcc_jit_timer_new): New function.
2786 (gcc_jit_timer_release): New function.
2787 (gcc_jit_context_set_timer): New function.
2788 (gcc_jit_context_get_timer): New function.
2789 (gcc_jit_timer_push): New function.
2790 (gcc_jit_timer_pop): New function.
2791 (gcc_jit_timer_print): New function.
2792 * libgccjit.h (LIBGCCJIT_HAVE_TIMING_API): New macro.
2793 (gcc_jit_timer): New typedef.
2794 (gcc_jit_timer_new): New function.
2795 (gcc_jit_timer_release): New function.
2796 (gcc_jit_context_set_timer): New function.
2797 (gcc_jit_context_get_timer): New function.
2798 (gcc_jit_timer_push): New function.
2799 (gcc_jit_timer_pop): New function.
2800 (gcc_jit_timer_print): New function.
2801 * libgccjit.map (LIBGCCJIT_ABI_4): New.
2802 (gcc_jit_timer_new): New function.
2803 (gcc_jit_timer_release): New function.
2804 (gcc_jit_context_set_timer): New function.
2805 (gcc_jit_context_get_timer): New function.
2806 (gcc_jit_timer_push): New function.
2807 (gcc_jit_timer_pop): New function.
2808 (gcc_jit_timer_print): New function.
2809
28102015-07-23 David Malcolm <dmalcolm@redhat.com>
2811
2812 * jit-playback.c (invoke_driver): Convert local "argvec"
2813 to an auto_argvec, so that it owns copies of the strings,
2814 rather than borrows them, updating ADD_ARG to use xstrdup
2815 and special-casing the NULL terminator to avoid
2816 xstrdup (NULL). Call add_multilib_driver_arguments at the front
2817 of the arguments.
2818 (MULTILIB_DEFAULTS): Provide a default definition.
2819 (multilib_defaults_raw): New constant array.
2820 (gcc::jit::playback::context::add_multilib_driver_arguments): New
2821 method.
2822 * jit-playback.h
2823 (gcc::jit::playback::context::add_multilib_driver_arguments): New
2824 method.
2825 * docs/internals/test-hello-world.exe.log.txt: Update.
2826 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2827
28282015-07-16 David Malcolm <dmalcolm@redhat.com>
2829
2830 * docs/internals/index.rst (Overview of code structure): Add note
2831 that the implementation is in C++, despite the .c extension.
2832 (Submitting patches): New subsection.
2833 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2834
28352015-07-09 Andrew MacLeod <amacleod@redhat.com>
2836
2837 * dummy-frontend.c: Adjust includes for flags.h changes.
2838 * jit-common.h: Likewise.
2839 * jit-playback.c: Likewise.
2840
28412015-07-08 David Malcolm <dmalcolm@redhat.com>
2842
2843 PR jit/66783
2844 * libgccjit.c (gcc_jit_context_new_field): Show name of field in
2845 "unknown size" error message.
2846 (gcc_jit_struct_set_fields): Show name of struct in error message.
2847 (gcc_jit_context_new_global): Show name of global in
2848 "unknown size" error message.
2849 (gcc_jit_function_new_local): Likewise for local.
2850
28512015-07-07 Andrew MacLeod <amacleod@redhat.com>
2852
2853 * dummy-frontend.c: Adjust includes.
2854 * jit-common.h: Likewise.
2855 * jit-playback.c: Likewise.
2856
28572015-07-07 David Malcolm <dmalcolm@redhat.com>
2858
2859 PR jit/66783
2860 * jit-recording.h: Within namespace gcc:jit::recording...
2861 (type::has_known_size): New virtual function.
2862 (struct_has_known_size): New function.
2863 * libgccjit.c (gcc_jit_context_new_field): Verify that the type
2864 has a known size.
2865 (gcc_jit_context_new_global): Likewise.
2866 (gcc_jit_function_new_local): Likewise.
2867
28682015-07-07 David Malcolm <dmalcolm@redhat.com>
2869
2870 PR jit/66779
2871 * dummy-frontend.c (jit_langhook_type_for_mode): Ensure that we
2872 handle modes QI, HI, SI, DI, TI.
2873
28742015-07-01 David Malcolm <dmalcolm@redhat.com>
2875
2876 PR jit/66700
2877 * jit-playback.c (jit_mark_addressable): New function.
2878 (gcc::jit::playback::lvalue::get_address): Call
2879 jit_mark_addressable on the underlying tree.
2880
28812015-07-01 David Malcolm <dmalcolm@redhat.com>
2882
2883 * docs/topics/types.rst (gcc_jit_context_new_union_type): Add
2884 documentation.
2885 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2886
28872015-07-01 David Malcolm <dmalcolm@redhat.com>
2888
2889 * docs/topics/contexts.rst (gcc_jit_context_set_bool_option):
2890 Clarify lack of lifetime requirements on (const char *) parameter.
2891 * docs/topics/expressions.rst
2892 (gcc_jit_context_new_string_literal): Likewise.
2893 (gcc_jit_context_new_global): Likewise.
2894 * docs/topics/functions.rst (gcc_jit_context_new_param): Likewise.
2895 (gcc_jit_context_new_function): Likewise.
2896 (gcc_jit_function_new_block): Likewise.
2897 (gcc_jit_block_add_comment): Likewise.
2898 * docs/topics/locations.rst (gcc_jit_context_new_location):
2899 Likewise.
2900 * docs/topics/types.rst (gcc_jit_context_new_field): Likewise.
2901 (gcc_jit_context_new_struct_type): Likewise.
2902 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2903
29042015-06-30 David Malcolm <dmalcolm@redhat.com>
2905
2906 * docs/cp/topics/functions.rst (Blocks): Add switch statements to
2907 list of ways to terminate a block.
2908 (gccjit::block::end_with_switch): Add function description.
2909 (gccjit::case_): Add class.
2910 (gccjit::context::new_case): Add function description.
2911 * docs/cp/topics/objects.rst: Add "case_" to class hierarchy.
2912 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_3): New.
2913 * docs/topics/functions.rst (Blocks): Add switch statements to
2914 list of ways to terminate a block.
2915 (gcc_jit_block_end_with_switch): Add function description.
2916 (gcc_jit_case): Add type.
2917 (gcc_jit_context_new_case): Add function description.
2918 (gcc_jit_case_as_object): Add function description.
2919 * docs/topics/objects.rst: Add gcc_jit_case to class hierarchy.
2920 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2921 * jit-common.h (gcc::jit::recording::case_): Add forward decl.
2922 (gcc::jit::playback::case_): Add forward decl.
2923 * jit-playback.c (add_case): New function.
2924 (gcc::jit::playback::block::add_switch): New function.
2925 * jit-playback.h (gcc::jit::playback::case_): New struct.
2926 (gcc::jit::playback::block::get_function): New method.
2927 (gcc::jit::playback::block::add_switch): New method.
2928 * jit-recording.c: Within namespace gcc::jit...
2929 (recording::context::new_case): New method.
2930 (recording::function::validate): Update for change to
2931 get_successor_blocks.
2932 (recording::block::end_with_switch): New method.
2933 (recording::block::get_successor_blocks): Update to support an
2934 arbitrary number of successor blocks.
2935 (recording::block::dump_edges_to_dot): Likewise.
2936 (memento_of_new_rvalue_from_const <int>::get_wide_int): New.
2937 (memento_of_new_rvalue_from_const <long>::get_wide_int): New.
2938 (memento_of_new_rvalue_from_const <double>::get_wide_int): New.
2939 (memento_of_new_rvalue_from_const <void *>::get_wide_int): New.
2940 (recording::statement::get_successor_blocks): Update to support an
2941 arbitrary number of successor blocks.
2942 (recording::conditional::get_successor_blocks): Likewise.
2943 (recording::jump::get_successor_blocks): Likewise.
2944 (recording::return_::get_successor_blocks): Likewise.
2945 (recording::case_::write_reproducer): New.
2946 (recording::case_::make_debug_string): New.
2947 (recording::switch_::switch_): New.
2948 (recording::switch_::replay_into): New.
2949 (recording::switch_::get_successor_blocks): New.
2950 (recording::switch_::make_debug_string): New.
2951 (recording::switch_::write_reproducer): New.
2952 * jit-recording.h: Within namespace gcc::jit::recording...
2953 (context::new_case): New.
2954 (rvalue::is_constant): New.
2955 (rvalue::get_wide_int): New.
2956 (block::end_with_switch): New.
2957 (block::get_successor_blocks): Update to support an arbitrary
2958 number of successor blocks.
2959 (memento_of_new_rvalue_from_const::is_constant): New.
2960 (memento_of_new_rvalue_from_const::get_wide_int): New.
2961 (statement::get_successor_blocks): Update to support an arbitrary
2962 number of successor blocks.
2963 (conditional::get_successor_blocks): Likewise.
2964 (jump::get_successor_blocks): Likewise.
2965 (return_::get_successor_blocks): Likewise.
2966 (case_): New subclass of memento.
2967 (switch_): New subclass of statement.
2968 * libgccjit++.h (gccjit::case_): New subclass of gccjit::object.
2969 (gccjit::context::new_case): New method.
2970 (gccjit::block::end_with_switch): New method.
2971 (gccjit::case_::case): New ctors.
2972 (gccjit::case_::get_inner_case): New method.
2973 * libgccjit.c: Include "typed-splay-tree.h"
2974 (struct gcc_jit_case): New.
2975 (gcc_jit_context_new_case): New function.
2976 (gcc_jit_case_as_object): New function.
2977 (valid_dest_for_switch): New function.
2978 (valid_case_for_switch): New function.
2979 (class api_call_validator): New class.
2980 (class case_range_validator): New class.
2981 (case_range_validator::case_range_validator): New.
2982 (case_range_validator::validate): New.
2983 (case_range_validator::case_compare): New.
2984 (case_range_validator::get_wide_int): new.
2985 (gcc_jit_block_end_with_switch): New.
2986 * libgccjit.h: Add gcc_jit_case to class hierarchy comment.
2987 (gcc_jit_case): New typedef.
2988 (gcc_jit_context_new_case): New function.
2989 (gcc_jit_case_as_object): New function.
2990 (gcc_jit_block_end_with_switch): New function.
2991 (LIBGCCJIT_HAVE_SWITCH_STATEMENTS): New.
2992 * libgccjit.map: Add gcc_jit_block_end_with_switch,
2993 gcc_jit_case_as_object and gcc_jit_context_new_case.
2994
29952015-06-30 David Malcolm <dmalcolm@redhat.com>
2996
2997 PR jit/66546
2998 * docs/cp/topics/contexts.rst
2999 (gccjit::context::set_bool_allow_unreachable_blocks): New.
3000 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_2): New.
3001 * docs/topics/contexts.rst (Options): Add notes discussing the
3002 transition from enums to entrypoints for new options.
3003 (gcc_jit_context_set_bool_allow_unreachable_blocks): New.
3004 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3005 * jit-common.h (gcc::jit::inner_bool_option): New enum.
3006 * jit-recording.c: Within namespace gcc::jit...
3007 (recording::context::context): Handle m_inner_bool_options.
3008 (recording::context::set_inner_bool_option): New.
3009 (inner_bool_option_reproducer_strings): New.
3010 (recording::context::log_all_options): Log the "inner" bool
3011 options.
3012 (recording::context::log_inner_bool_option): New.
3013 (recording::context::dump_reproducer_to_file): Write initializers
3014 for "inner" bool options.
3015 (recording::function::validate): Don't check for block
3016 reachability if INNER_BOOL_OPTION_ALLOW_UNREACHABLE_BLOCKS is set.
3017 * jit-recording.h: Within namespace gcc::jit...
3018 (recording::context::set_inner_bool_option): New.
3019 (recording::context::get_inner_bool_option): New.
3020 (recording::context::log_inner_bool_option): New.
3021 (recording::context::m_inner_bool_options): New.
3022 * libgccjit++.h
3023 (gccjit::context::set_bool_allow_unreachable_blocks): New.
3024 * libgccjit.c
3025 (gcc_jit_context_set_bool_allow_unreachable_blocks): New.
3026 * libgccjit.h: Add note about options present in the
3027 initial release of libgccjit.
3028 (gcc_jit_context_set_bool_allow_unreachable_blocks): New API
3029 entrypoint.
3030 (LIBGCCJIT_HAVE_gcc_jit_context_set_bool_allow_unreachable_blocks):
3031 New macro.
3032 * libgccjit.map (LIBGCCJIT_ABI_2): New, containing...
3033 (gcc_jit_context_set_bool_allow_unreachable_blocks): ...this new
3034 entrypoint.
3035
30362015-06-30 David Malcolm <dmalcolm@redhat.com>
3037
3038 PR jit/66628
3039 * docs/cp/topics/contexts.rst (Additional command-line options):
3040 New section.
3041 * docs/topics/compatibility.rst: New file.
3042 * docs/topics/contexts.rst (Additional command-line options): New
3043 section.
3044 * docs/topics/index.rst: Add compatibility.rst.
3045 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3046 * jit-playback.c (make_fake_args): Add call to
3047 append_command_line_options.
3048 * jit-recording.c: Within namespace gcc::jit...
3049 (recording::context::~context): Free the optnames within
3050 m_command_line_options.
3051 (recording::context::set_bool_option): Likewise.
3052 (recording::context::add_command_line_option): New method.
3053 (recording::context::append_command_line_options): New method.
3054 (recording::context::dump_reproducer_to_file): Add command-line
3055 options.
3056 * jit-recording.h: Within namespace gcc::jit...
3057 (recording::context::add_command_line_option): New method.
3058 (recording::context::append_command_line_options): New method.
3059 (recording::context::m_command_line_options): New field.
3060 * libgccjit++.h (gccjit::context::add_command_line_option): New
3061 method.
3062 * libgccjit.c (gcc_jit_context_add_command_line_option): New API
3063 entrypoint.
3064 * libgccjit.h (gcc_jit_context_add_command_line_option): New API
3065 entrypoint.
3066 (LIBGCCJIT_HAVE_gcc_jit_context_add_command_line_option): New
3067 macro.
3068 * libgccjit.map: Put existing symbols within LIBGCCJIT_ABI_0; add
3069 LIBGCCJIT_ABI_1 and gcc_jit_context_add_command_line_option.
3070
30712015-06-30 David Malcolm <dmalcolm@redhat.com>
3072
3073 * jit-recording.c
3074 (gcc::jit::recording::context::dump_reproducer_to_file):
3075 Add pragma to generated reproducers to disable -Wunused-variable.
3076 Fix handling of NULL string options.
3077
30782015-06-30 David Malcolm <dmalcolm@redhat.com>
3079
3080 * docs/cp/topics/expressions.rst: Remove stray semicolon.
3081 * docs/cp/topics/functions.rst: Remove stray backslash.
3082 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3083
30842015-06-25 Andrew MacLeod <amacleod@redhat.com>
3085
3086 * dummy-frontend.c: Remove ipa-ref.h and plugin-api.h from include list.
3087 * jit-playback.c: Likewise.
3088
30892015-06-25 Andrew Macleod <amacleod@redhat.com>
3090
3091 * jit-common.h: Don't include alias.h.
3092
30932015-06-17 David Malcolm <dmalcolm@redhat.com>
3094
3095 * libgccjit.c (gcc_jit_lvalue_access_field): Verify that the field
3096 is for the correct struct.
3097 (gcc_jit_rvalue_access_field): Likewise.
3098
30992015-06-17 Andrew MacLeod <amacleod@redhat.com>
3100
3101 * dummy-frontend.c: Do not include input.h, line-map.h or is-a.h.
3102 * jit-common.h: Likewise.
3103 * jit-playback.c: Likewise.
3104
31052015-06-16 David Malcolm <dmalcolm@redhat.com>
3106
3107 PR jit/66539
3108 * jit-recording.c: Within namespace gcc::jit::recording::
3109 (rvalue::get_debug_string_parens): New function.
3110 (binary_op::make_debug_string): Update to mimic C precedence
3111 rules.
3112 (binary_op_precedence): New array.
3113 (binary_op::get_precedence): New function.
3114 (comparison::make_debug_string): Update to mimic C precedence
3115 rules.
3116 (comparison_precedence): New array.
3117 (comparison::get_precedence): New function.
3118 (cast::make_debug_string): Update to mimic C precedence rules.
3119 (call::make_debug_string): Likewise.
3120 (call_through_ptr::make_debug_string): Likewise.
3121 (array_access::make_debug_string): Likewise.
3122 (access_field_of_lvalue::make_debug_string): Likewise.
3123 (access_field_rvalue::make_debug_string): Likewise.
3124 (dereference_field_rvalue::make_debug_string): Likewise.
3125 (dereference_rvalue::make_debug_string): Likewise.
3126 (get_address_of_lvalue::make_debug_string): Likewise.
3127 * jit-recording.h: Within namespace gcc::jit::recording::
3128 (precedence): New enum.
3129 (rvalue::rvalue): Initialize field "m_parenthesized_string".
3130 (rvalue::get_debug_string_parens): New method.
3131 (rvalue::get_precedence): New pure virtual function.
3132 (rvalue::m_parenthesized_string): New field.
3133 (param::get_precedence): New function.
3134 (global::get_precedence): New function.
3135 (memento_of_new_rvalue_from_const::get_precedence): New function.
3136 (memento_of_new_string_literal::get_precedence): New function.
3137 (unary_op::get_precedence): New function.
3138 (binary_op::get_precedence): New function.
3139 (comparison::get_precedence): New function.
3140 (cast::get_precedence): New function.
3141 (call::get_precedence): New function.
3142 (call_through_ptr::get_precedence): New function.
3143 (array_access::get_precedence): New function.
3144 (access_field_of_lvalue::get_precedence): New function.
3145 (access_field_rvalue::get_precedence): New function.
3146 (dereference_field_rvalue::get_precedence): New function.
3147 (dereference_rvalue::get_precedence): New function.
3148 (get_address_of_lvalue::get_precedence): New function.
3149 (local::get_precedence): New function.
3150
31512015-06-09 Matthias Klose <doko@ubuntu.com>
3152
3153 * Make-lang.in (jit.install-common): Install headers using INSTALL_DATA.
3154
31552015-06-08 Andrew MacLeod <amacleod@redhat.com>
3156
3157 * dummy-frontend.c : Adjust include files.
3158 * jit-common.h : Likewise.
3159 * jit-playback.c : Likewise.
3160
31612015-06-05 David Malcolm <dmalcolm@redhat.com>
3162
3163 * dummy-frontend.c
3164 (jit_langhook_post_compilation_parsing_cleanups): Remove.
3165 (LANG_HOOKS_POST_COMPILATION_PARSING_CLEANUPS): Remove
3166 * jit-playback.c (gcc::jit::playback::context::new_global): Add
3167 call to varpool_node::finalize_decl.
3168 (gcc::jit::playback::context::finalize_global_decls): Remove.
3169 * jit-playback.h
3170 (gcc::jit::playback::context::finalize_global_decls): Remove.
3171
31722015-06-05 David Malcolm <dmalcolm@redhat.com>
3173
3174 * dummy-frontend.c (jit_langhook_write_globals): Rename to...
3175 (jit_langhook_post_compilation_parsing_cleanups): ...this, and
3176 eliminate calls to finalize_compilation_unit and
3177 write_global_decls_2.
3178 (LANG_HOOKS_WRITE_GLOBALS): Rename to...
3179 (LANG_HOOKS_POST_COMPILATION_PARSING_CLEANUPS): ...this and
3180 redirect from jit_langhook_write_globals to
3181 jit_langhook_post_compilation_parsing_cleanups.
3182 * jit-playback.c
3183 (gcc::jit::playback::context::write_global_decls_1): Rename to...
3184 (gcc::jit::playback::context::finalize_global_decls): ...this.
3185 (gcc::jit::playback::context::write_global_decls_1): Delete.
3186 * jit-playback.h
3187 (gcc::jit::playback::context::write_global_decls_1): Rename to...
3188 (gcc::jit::playback::context::finalize_global_decls): ...this.
3189 (gcc::jit::playback::context::write_global_decls_1): Delete.
3190
31912015-06-04 Andrew MacLeod <amacleod@redhat.com>
3192
3193 * dummy-frontend.c: Adjust includes for restructured coretypes.h.
3194 * jit-common.h: Likewise.
3195 * jit-playback.c: Likewise.
3196
31972015-05-12 David Malcolm <dmalcolm@redhat.com>
3198
3199 * jit-builtins.c: Include vec.h before target.h.
3200
32012015-04-27 Jim Wilson <jim.wilson@linaro.org>
3202
3203 * Make-lang.in (jit.mostlyclean): Remove shared libraries and object
3204 files.
3205
32062015-04-09 David Malcolm <dmalcolm@redhat.com>
3207
3208 PR jit/65691
3209 * docs/cp/topics/expressions.rst (Simple expressions): Fix copy
3210 and paste error in description of gccjit::context::one.
3211 * docs/topics/expressions.rst (Simple expressions): Likewise in
3212 description of gcc_jit_context_one.
3213 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3214
32152015-03-13 Uros Bizjak <ubizjak@gmail.com>
3216
3217 * jit-recording.c (dump::write): Also check vasprintf return value.
3218 (recording::context::add_error_va): Ditto.
3219 (recording::string::from_printf): Ditto.
3220
32212015-03-13 David Malcolm <dmalcolm@redhat.com>
3222
3223 * docs/internals/index.rst (Packaging notes): New section.
3224 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3225
32262015-03-05 David Malcolm <dmalcolm@redhat.com>
3227
3228 * docs/cp/intro/tutorial03.rst: Add missing arguments to
3229 gccjit::block::end_with_conditional call. Add on_true/on_false
3230 comments. Tweak the wording.
3231 * docs/intro/tutorial03.rst: Add missing arguments to
3232 gcc_jit_block_end_with_conditional call. Add some clarifying
3233 comments.
3234 * docs/topics/compilation.rst: Tweak the wording to avoid an
3235 ambiguous use of "this".
3236 * docs/topics/contexts.rst: Fix a typo.
3237 * docs/topics/expressions.rst (GCC_JIT_BINARY_OP_MINUS): Remove
3238 a stray backtick.
3239 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3240
32412015-02-24 Thomas Schwinge <thomas@codesourcery.com>
3242
3243 PR libgomp/64625
3244 * jit-builtins.c (DEF_FUNCTION_TYPE_VAR_8)
3245 (DEF_FUNCTION_TYPE_VAR_12): Remove macros.
3246 (DEF_FUNCTION_TYPE_VAR_7, DEF_FUNCTION_TYPE_VAR_11): New macros.
3247 * jit-builtins.h (DEF_FUNCTION_TYPE_VAR_8)
3248 (DEF_FUNCTION_TYPE_VAR_12): Remove macros.
3249 (DEF_FUNCTION_TYPE_VAR_7, DEF_FUNCTION_TYPE_VAR_11): New macros.
3250
32512015-02-04 David Malcolm <dmalcolm@redhat.com>
3252
3253 PR jit/64257
3254 * docs/conf.py (html_theme): Change from 'pyramid'
3255 to 'sphinxdoc'.
3256
32572015-02-04 David Malcolm <dmalcolm@redhat.com>
3258
3259 * docs/topics/contexts.rst (gcc_jit_context_acquire): Fix
3260 typo.
3261 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3262
32632015-02-03 David Malcolm <dmalcolm@redhat.com>
3264
3265 * jit-logging.h (gcc::jit::log_user::log): Make const.
3266 * jit-recording.c (gcc::jit::recording::context::set_str_option):
3267 Log the new value of the option.
3268 (gcc::jit::recording::context::set_int_option): Likewise.
3269 (gcc::jit::recording::context::set_bool_option): Likewise.
3270 (gcc::jit::recording::context::compile): Log the value of all
3271 options.
3272 (gcc::jit::recording::context::compile_to_file): Likewise.
3273 (gcc::jit::recording::context::log_all_options): New function.
3274 (gcc::jit::recording::context::log_str_option): New function.
3275 (gcc::jit::recording::context::log_int_option): New function.
3276 (gcc::jit::recording::context::log_bool_option): New function.
3277 * jit-recording.h (gcc::jit::recording::context::log_all_options):
3278 New function.
3279 (gcc::jit::recording::context::log_str_option): New function.
3280 (gcc::jit::recording::context::log_int_option): New function.
3281 (gcc::jit::recording::context::log_bool_option): New function.
3282 * docs/internals/test-hello-world.exe.log.txt: Update for above
3283 changes.
3284 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3285
32862015-02-03 David Malcolm <dmalcolm@redhat.com>
3287
3288 PR jit/64810
3289 * Make-lang.in (jit_OBJS): Add jit/jit-spec.o and gcc.o.
3290 (LIBGCCJIT_FILENAME): Add EXTRA_GCC_OBJS.
3291 * jit-playback.c: Include gcc.h.
3292 (gcc::jit::playback::context::compile): Move mutex acquisition
3293 to before the call to make_fake_args.
3294 (append_arg_from_driver): New function.
3295 (gcc::jit::playback::context::make_fake_args): On the first call,
3296 call into driver_get_configure_time_options to get configure-time
3297 default options and cache them. Add them to the args for
3298 toplev::main.
3299 * jit-spec.c: New source file.
3300 * docs/internals/test-hello-world.exe.log.txt: Update to reflect
3301 above changes.
3302 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3303
33042015-02-02 David Malcolm <dmalcolm@redhat.com>
3305
3306 PR jit/64810
3307 * dummy-frontend.c (jit_langhook_type_for_mode): Support
3308 TYPE_MODE (long_long_integer_type_node).
3309
33102015-01-27 David Malcolm <dmalcolm@redhat.com>
3311
3312 * docs/internals/test-hello-world.exe.log.txt: Add example version
3313 lines.
3314 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3315 * jit-common.h (gcc::jit::dump::get_file): New accessor.
3316 * jit-logging.c: Include toplev.h.
3317 (gcc::jit::logger::logger): Log the GCC version.
3318 * jit-recording.c: Include toplev.h.
3319 (gcc:jit::recording::context::dump_reproducer_to_file): Log the
3320 GCC version.
3321
33222015-01-26 David Malcolm <dmalcolm@redhat.com>
3323
3324 * docs/topics/compilation.rst (gcc_jit_result_get_code): Fix typo.
3325 * docs/topics/contexts.rst (gcc_jit_context_get_last_error): The
3326 error buffer is only valid until the next call to the context.
3327 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3328 * libgccjit.h (gcc_jit_context_get_first_error): Reword the
3329 comment to omit mention of compiling.
3330 (gcc_jit_context_get_last_error): The error buffer is only valid
3331 until the next call to the context.
3332
33332015-01-26 David Malcolm <dmalcolm@redhat.com>
3334
3335 PR jit/64708
3336 * config-lang.in (compilers): Drop "libgccjit.so".
3337
33382015-01-23 David Malcolm <dmalcolm@redhat.com>
3339
3340 PR jit/64721
3341 * jit-playback.c (gcc::jit::playback::context::compile): Construct
3342 toplev instances with init_signals=false.
3343
33442015-01-19 David Malcolm <dmalcolm@redhat.com>
3345
3346 * docs/cp/topics/results.rst: Rename to...
3347 * docs/cp/topics/compilation.rst: ...this, and add section on
3348 ahead-of-time compilation.
3349 * docs/cp/topics/index.rst: Update for renaming of results.rst
3350 to compilation.rst.
3351 * docs/examples/emit-alphabet.bf: New file, a sample "brainf"
3352 script.
3353 * docs/examples/tut05-bf.c: New file, implementing a compiler
3354 for "brainf".
3355 * docs/internals/test-hello-world.exe.log.txt: Update to reflect
3356 changes to logger output.
3357 * docs/intro/index.rst: Add tutorial05.rst
3358 * docs/intro/tutorial05.rst: New file.
3359 * docs/topics/results.rst: Rename to...
3360 * docs/topics/compilation.rst: ...this, and add section on
3361 ahead-of-time compilation.
3362 * docs/topics/index.rst: Update for renaming of results.rst to
3363 compilation.rst.
3364 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3365 * jit-playback.c (gcc::jit::playback::context::compile): Convert
3366 return type from result * to void. Move the code to convert to
3367 dso and dlopen the result to a new pure virtual "postprocess"
3368 method.
3369 (gcc::jit::playback::compile_to_memory::compile_to_memory): New
3370 function.
3371 (gcc::jit::playback::compile_to_memory::postprocess): New
3372 function, based on playback::context::compile.
3373 (gcc::jit::playback::compile_to_file::compile_to_file): New
3374 function.
3375 (gcc::jit::playback::compile_to_file::postprocess): New function.
3376 (gcc::jit::playback::compile_to_file::copy_file): New function.
3377 (gcc::jit::playback::context::convert_to_dso): Move internals
3378 to...
3379 (gcc::jit::playback::context::invoke_driver): New method. Add
3380 "-shared" and "-c" options to driver's argv as needed.
3381 * jit-playback.h: Include "timevar.h".
3382 (gcc::jit::playback::context::compile): Convert return type from
3383 result * to void.
3384 (gcc::jit::playback::context::postprocess): New pure virtual
3385 function, making this an abstract base class.
3386 (gcc::jit::playback::context::get_tempdir): New accessor.
3387 (gcc::jit::playback::context::invoke_driver): New function.
3388 (class gcc::jit::playback::compile_to_memory): New subclass of
3389 playback::context.
3390 (class gcc::jit::playback::compile_to_file): Likewise.
3391 * jit-recording.c (gcc::jit::recording::context::compile): Use a
3392 playback::compile_to_memory, and extract its result.
3393 (gcc::jit::recording::context::compile_to_file): New function.
3394 * jit-recording.h (gcc::jit::recording::context::compile_to_file):
3395 New function.
3396 * libgccjit++.h (gccjit::context::compile_to_file): New method.
3397 * libgccjit.c (gcc_jit_context_compile): Update log message to
3398 clarify that this is an in-memory compile.
3399 (gcc_jit_context_compile_to_file): New function.
3400 * libgccjit.h (gcc_jit_context): Clarify that you can compile
3401 a context more than once, and that you can compile to a file
3402 as well as to memory.
3403 (gcc_jit_result): Clarify that this is the result of an
3404 in-memory compilation.
3405 (gcc_jit_context_compile): Clarify that you can compile, and that
3406 this is an in-memory compilation.
3407 (enum gcc_jit_output_kind): New enum.
3408 (gcc_jit_context_compile_to_file): New function.
3409 (gcc_jit_context_enable_dump): Clarify comment to cover both forms
3410 of compilation.
3411 * libgccjit.map (gcc_jit_context_compile_to_file): New API
3412 entrypoint.
3413 * notes.txt: Update to show the playback::context::postprocess
3414 virtual function.
3415
34162015-01-19 David Malcolm <dmalcolm@redhat.com>
3417
3418 * jit-recording.c
3419 (gcc::jit::recording::memento_of_new_string_literal::make_debug_string):
3420 Add missing format string.
3421
34222015-01-16 David Malcolm <dmalcolm@redhat.com>
3423
3424 * Make-lang.in (lang_checks_parallelized): Add "check-jit".
3425 (check_jit_parallelize): Set this to an arbitrary value (10).
3426
34272015-01-16 Jakub Jelinek <jakub@redhat.com>
3428
3429 * jit-builtins.h (DEF_FUNCTION_TYPE_VAR_5): Fix spelling of
3430 last argument.
3431 (DEF_FUNCTION_TYPE_VAR_8, DEF_FUNCTION_TYPE_VAR_12): Define and
3432 undef afterwards.
3433 * jit-builtins.c (DEF_FUNCTION_TYPE_VAR_8, DEF_FUNCTION_TYPE_VAR_12):
3434 Likewise.
3435
34362015-01-15 Richard Sandiford <richard.sandiford@arm.com>
3437
3438 Update copyright years in docs/.
3439
34402015-01-15 David Malcolm <dmalcolm@redhat.com>
3441
3442 * libgccjit.c (gcc_jit_block_add_assignment_op): Check that the
3443 lvalue and the rvalue are of compatible type.
3444
34452015-01-13 David Malcolm <dmalcolm@redhat.com>
3446
3447 * docs/cp/topics/contexts.rst (Debugging): Add
3448 gccjit::context::dump_reproducer_to_file.
3449 * docs/internals/index.rst (Design notes): New section,
3450 discussing input validation and
3451 gcc_jit_context_dump_reproducer_to_file.
3452 * docs/topics/contexts.rst (Debugging): Add
3453 gcc_jit_context_dump_reproducer_to_file.
3454 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3455 * jit-common.h (gcc::jit::dump::get_context): New accessor.
3456 * jit-recording.c: Include "hash-map.h".
3457 Within namespace ::gcc::jit...
3458 (dump::write): Flush each line.
3459 (dump::make_location): Pass false for new param "created_by_user".
3460 (class allocator): New class.
3461 (allocator::~allocator): New function.
3462 (allocator::xstrdup_printf): New function.
3463 (allocator::xstrdup_printf_va): New function.
3464 (class reproducer): New subclass of dump.
3465 (reproducer::reproducer): New function.
3466 (reproducer::write_params): New function.
3467 (reproducer::write_args): New function.
3468 (reproducer::make_identifier): New function.
3469 (reproducer::make_tmp_identifier): New function.
3470 (reproducer::get_identifier): New pair of functions.
3471 (reproducer::get_identifier_as_rvalue): New function.
3472 (reproducer::get_identifier_as_lvalue): New function.
3473 (reproducer::get_identifier_as_type): New function.
3474 (reproducer::xstrdup_printf): New function.
3475 (recording::context::context): Initialize m_toplevel_ctxt.
3476 (recording::context::new_location): Add param created_by_user.
3477 (str_option_reproducer_strings): New table of strings.
3478 (int_option_reproducer_strings): Likewise.
3479 (bool_option_reproducer_strings): Likewise.
3480 (get_type_enum_strings): Likewise.
3481 (names_of_function_kinds): Likewise.
3482 (global_kind_reproducer_strings): Likewise.
3483 (unary_op_reproducer_strings): Likewise.
3484 (binary_op_reproducer_strings): Likewise.
3485 (comparison_reproducer_strings): Likewise.
3486 Within namespace ::gcc::jit::recording::...
3487 (context::dump_reproducer_to_file): New function.
3488 (string::write_reproducer): Likewise.
3489 (location::write_reproducer): Likewise.
3490 (type::access_as_type): Likewise.
3491 (memento_of_get_type::write_reproducer): Likewise.
3492 (memento_of_get_pointer::write_reproducer): Likewise.
3493 (memento_of_get_const::write_reproducer): Likewise.
3494 (memento_of_get_volatile::write_reproducer): Likewise.
3495 (array_type::write_reproducer): Likewise.
3496 (function_type::write_reproducer): Likewise.
3497 (function_type::write_deferred_reproducer): Likewise.
3498 (field::write_reproducer): Likewise.
3499 (struct_::access_as_type): Likewise.
3500 (struct_::write_reproducer): Likewise.
3501 (union_::write_reproducer): Likewise.
3502 (fields::write_reproducer): Likewise.
3503 (rvalue::access_as_rvalue): Likewise.
3504 (lvalue::access_as_rvalue): Likewise.
3505 (lvalue::access_as_lvalue): Likewise.
3506 (param::access_as_rvalue): Likewise.
3507 (param::access_as_lvalue): Likewise.
3508 (param::write_reproducer): Likewise.
3509 (function::write_reproducer): Likewise.
3510 (block::write_reproducer): Likewise.
3511 (global::write_reproducer): Likewise.
3512 (memento_of_new_rvalue_from_const <int>::write_reproducer):
3513 Likewise.
3514 (memento_of_new_rvalue_from_const <long>::write_reproducer):
3515 Likewise.
3516 (memento_of_new_rvalue_from_const <double>::write_reproducer):
3517 Likewise.
3518 (memento_of_new_rvalue_from_const <void *>::write_reproducer):
3519 Likewise.
3520 (memento_of_new_string_literal::write_reproducer): Likewise.
3521 (unary_op::write_reproducer): Likewise.
3522 (binary_op::write_reproducer): Likewise.
3523 (comparison::write_reproducer): Likewise.
3524 (cast::write_reproducer): Likewise.
3525 (call::write_reproducer): Likewise.
3526 (call_through_ptr::write_reproducer): Likewise.
3527 (array_access::write_reproducer): Likewise.
3528 (access_field_of_lvalue::write_reproducer): Likewise.
3529 (access_field_rvalue::write_reproducer): Likewise.
3530 (dereference_field_rvalue::write_reproducer): Likewise.
3531 (dereference_rvalue::write_reproducer): Likewise.
3532 (get_address_of_lvalue::write_reproducer): Likewise.
3533 (local::write_reproducer): Likewise.
3534 (eval::write_reproducer): Likewise.
3535 (assignment::write_reproducer): Likewise.
3536 (assignment_op::write_reproducer): Likewise.
3537 (comment::write_reproducer): Likewise.
3538 (conditional::write_reproducer): Likewise.
3539 (jump::write_reproducer): Likewise.
3540 (return_::write_reproducer): Likewise.
3541 * jit-recording.h (gcc::jit::reproducer): New forward declararion.
3542 Within namespace ::gcc::jit::recording::...
3543 (context::new_location): Add "created_by_user" param.
3544 (context::dump_reproducer_to_file): New method.
3545 (context::m_toplevel_ctxt): New field.
3546 (memento::write_reproducer): New pure virtual function.
3547 (memento::dyn_cast_location): New virtual function.
3548 (string::write_reproducer):
3549 (location::location): Add "created_by_user" param.
3550 (location::dyn_cast_location): New function.
3551 (location::created_by_user): New accessor.
3552 (location::write_reproducer): New function.
3553 (location::m_created_by_user): New field.
3554 (type::access_as_type): New virtual function.
3555 (location::write_reproducer): Likewise.
3556 (type::access_as_type): Likewise.
3557 (memento_of_get_type::write_reproducer): Likewise.
3558 (memento_of_get_pointer::write_reproducer): Likewise.
3559 (memento_of_get_const::write_reproducer): Likewise.
3560 (memento_of_get_volatile::write_reproducer): Likewise.
3561 (array_type::write_reproducer): Likewise.
3562 (function_type::write_reproducer): Likewise.
3563 (function_type::write_deferred_reproducer): Likewise.
3564 (field::write_reproducer): Likewise.
3565 (struct_::access_as_type): Likewise.
3566 (struct_::write_reproducer): Likewise.
3567 (union_::write_reproducer): Likewise.
3568 (union_::m_fields): Remove stray unused field.
3569 (fields::length): New accessor.
3570 (fields::get_field): New accessor.
3571 (fields::write_reproducer): New function.
3572 (rvalue::access_as_rvalue): Likewise.
3573 (lvalue::access_as_rvalue): Likewise.
3574 (lvalue::access_as_lvalue): Likewise.
3575 (param::access_as_rvalue): Likewise.
3576 (param::access_as_lvalue): Likewise.
3577 (param::write_reproducer): Likewise.
3578 (function::write_reproducer): Likewise.
3579 (block::write_reproducer): Likewise.
3580 (global::write_reproducer): Likewise.
3581 (memento_of_new_rvalue_from_const <HOST_TYPE>::write_reproducer):
3582 Likewise.
3583 (memento_of_new_string_literal::write_reproducer): Likewise.
3584 (unary_op::write_reproducer): Likewise.
3585 (binary_op::write_reproducer): Likewise.
3586 (comparison::write_reproducer): Likewise.
3587 (cast::write_reproducer): Likewise.
3588 (call::write_reproducer): Likewise.
3589 (call_through_ptr::write_reproducer): Likewise.
3590 (array_access::write_reproducer): Likewise.
3591 (access_field_of_lvalue::write_reproducer): Likewise.
3592 (access_field_rvalue::write_reproducer): Likewise.
3593 (dereference_field_rvalue::write_reproducer): Likewise.
3594 (dereference_rvalue::write_reproducer): Likewise.
3595 (get_address_of_lvalue::write_reproducer): Likewise.
3596 (local::write_reproducer): Likewise.
3597 (eval::write_reproducer): Likewise.
3598 (assignment::write_reproducer): Likewise.
3599 (assignment_op::write_reproducer): Likewise.
3600 (comment::write_reproducer): Likewise.
3601 (conditional::write_reproducer): Likewise.
3602 (jump::write_reproducer): Likewise.
3603 (return_::write_reproducer): Likewise.
3604 * libgccjit++.h (gccjit::context::dump_reproducer_to_file): New.
3605 * libgccjit.c (gcc_jit_context_new_location): Pass "true" as
3606 param "created_by_user".
3607 (gcc_jit_context_dump_reproducer_to_file): New API entrypoint.
3608 * libgccjit.h (gcc_jit_context_dump_reproducer_to_file): New API
3609 entrypoint.
3610 * libgccjit.map (gcc_jit_context_dump_reproducer_to_file): New API
3611 entrypoint.
3612
36132015-01-12 David Malcolm <dmalcolm@redhat.com>
3614
3615 * jit-recording.c (class gcc::jit::rvalue_usage_validator): New.
3616 (gcc::jit::rvalue_usage_validator::rvalue_usage_validator): New
3617 ctor.
3618 (gcc::jit::rvalue_usage_validator::visit): New function.
3619 (gcc::jit::recording::rvalue::verify_valid_within_stmt): New
3620 function.
3621 (gcc::jit::recording::rvalue::set_scope): New function.
3622 (gcc::jit::recording::function::function): Call set_scope on each
3623 param, issuing errors for any params that already have a function.
3624 (gcc::jit::recording::block::add_eval): Return the new statement;
3625 update the comment given that some error-checking now happens after
3626 this returns.
3627 (gcc::jit::recording::block::add_assignment): Likewise.
3628 (gcc::jit::recording::block::add_assignment_op): Likewise.
3629 (gcc::jit::recording::block::add_comment): Likewise.
3630 (gcc::jit::recording::block::end_with_conditional): Likewise.
3631 (gcc::jit::recording::block::end_with_jump): Likewise.
3632 (gcc::jit::recording::block::end_with_return): Likewise.
3633 (gcc::jit::recording::block::validate): Add a comment.
3634 (gcc::jit::recording::unary_op::visit_children): New function.
3635 (gcc::jit::recording::binary_op::visit_children): New function.
3636 (gcc::jit::recording::comparison::visit_children): New function.
3637 (gcc::jit::recording::cast::visit_children): New function.
3638 (gcc::jit::recording::call::visit_children): New function.
3639 (gcc::jit::recording::call_through_ptr::visit_children): New function.
3640 (gcc::jit::recording::array_access::visit_children): New function.
3641 (gcc::jit::recording::access_field_of_lvalue::visit_children): New
3642 function.
3643 (gcc::jit::recording::access_field_rvalue::visit_children): New
3644 function.
3645 (gcc::jit::recording::dereference_field_rvalue::visit_children):
3646 New function.
3647 (gcc::jit::recording::dereference_rvalue::visit_children): New
3648 function.
3649 (gcc::jit::recording::get_address_of_lvalue::visit_children): New
3650 function.
3651 * jit-recording.h: Within namespace gcc::jit::recording...
3652 (class rvalue_visitor): New.
3653 (rvalue::rvalue): Initialize m_scope.
3654 (rvalue::get_loc): New accessor.
3655 (rvalue::verify_valid_within_stmt): New function.
3656 (rvalue::visit_children): New pure virtual function.
3657 (rvalue::set_scope): New function.
3658 (rvalue::get_scope): New function.
3659 (rvalue::dyn_cast_param): New function.
3660 (rvalue::m_scope): New field.
3661 (param::visit_children): New empty function.
3662 (param::dyn_cast_param): New function.
3663 (function::get_loc): New function.
3664 (block::add_eval): Return the new statement.
3665 (block::add_assignment): Likewise.
3666 (block::add_assignment_op): Likewise.
3667 (block::add_comment): Likewise.
3668 (block::end_with_conditional): Likewise.
3669 (block::end_with_jump): Likewise.
3670 (block::end_with_return): Likewise.
3671 (global::visit_children): New function.
3672 (memento_of_new_rvalue_from_const<HOST_TYPE>::visit_children):
3673 New function.
3674 (memento_of_new_string_literal::visit_children): New function.
3675 (unary_op::visit_children): New function.
3676 (binary_op::visit_children): New function.
3677 (comparison::visit_children): New function.
3678 (cast::visit_children): New function.
3679 (call::visit_children): New function.
3680 (call_through_ptr::visit_children): New function.
3681 (array_access::visit_children): New function.
3682 (access_field_of_lvalue::visit_children): New function.
3683 (access_field_rvalue::visit_children): New function.
3684 (dereference_field_rvalue::visit_children): New function.
3685 (dereference_rvalue::visit_children): New function.
3686 (get_address_of_lvalue::visit_children): New function.
3687 (local::local): Call set_scope.
3688 (local::visit_children): New function.
3689 (statement::get_block): Make public.
3690 * libgccjit.c (RETURN_VAL_IF_FAIL_PRINTF5): New macro.
3691 (RETURN_NULL_IF_FAIL_PRINTF5): New macro.
3692 (gcc_jit_context_new_function): Verify that each param has
3693 not yet been used for creating another function.
3694 (gcc_jit_block_add_eval): After creating the stmt, verify
3695 that the rvalue expression tree is valid to use within it.
3696 (gcc_jit_block_add_assignment): Likewise for the lvalue and
3697 rvalue expression trees.
3698 (gcc_jit_block_add_assignment_op): Likewise.
3699 (gcc_jit_block_end_with_conditional): Likewise for the boolval
3700 expression tree.
3701 (gcc_jit_block_end_with_return): Likewise for the rvalue
3702 expression tree.
3703 (gcc_jit_block_end_with_void_return): Remove return of "void",
3704 now that block::end_with_return is now non-void.
3705
37062015-01-12 David Malcolm <dmalcolm@redhat.com>
3707
3708 * jit-playback.c (gcc::jit::playback::context::read_dump_file):
3709 Add missing fclose on error-handling path.
3710
37112015-01-12 David Malcolm <dmalcolm@redhat.com>
3712
3713 * docs/cp/topics/expressions.rst (Global variables): Add
3714 enum gcc_jit_global_kind param to gccjit::context::new_global.
3715 * docs/topics/expressions.rst (Global variables): Likewise.
3716 Document the new enum.
3717 * docs/topics/results.rst (Compilation results): Document
3718 globals-handling.
3719 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3720 * dummy-frontend.c (jit_langhook_write_globals): Call into the
3721 playback context's write_global_decls_1 and write_global_decls_2
3722 before and after calling symtab->finalize_compilation_unit ().
3723 * jit-playback.c: Include "debug.h".
3724 (gcc::jit::playback::context::new_global): Add "kind" param and
3725 use it to set TREE_PUBLIC, TREE_STATIC and DECL_EXTERNAL on the
3726 underlying VAR_DECL. Call varpool_node::get_create on the
3727 VAR_DECL, and add it to m_globals.
3728 (gcc::jit::playback::context::write_global_decls_1): New function.
3729 (gcc::jit::playback::context::write_global_decls_2): New function.
3730 * jit-playback.h (gcc::jit::playback::context::context): Call
3731 create on m_globals.
3732 (gcc::jit::playback::context::new_global): Add "kind" param.
3733 (gcc::jit::playback::context::write_global_decls_1): New function.
3734 (gcc::jit::playback::context::write_global_decls_2): New function.
3735 (gcc::jit::playback::context::m_globals): New field.
3736 * jit-recording.c (gcc::jit::recording::context::context):
3737 Initialize m_globals.
3738 (gcc::jit::recording::context::new_global): Add param "kind".
3739 Add the new global to m_globals.
3740 (gcc::jit::recording::context::dump_to_file): Dump the globals.
3741 (gcc::jit::recording::global::replay_into): Add field m_kind.
3742 (gcc::jit::recording::global::write_to_dump): New override.
3743 * jit-recording.h (gcc::jit::recording::context::new_global): Add
3744 param "kind".
3745 (gcc::jit::recording::context::m_globals): New field.
3746 (gcc::jit::recording::global::global): Add param kind.
3747 (gcc::jit::recording::global::write_to_dump): New override.
3748 (gcc::jit::recording::global::m_kind): New field.
3749 * jit-result.c (gcc::jit::result::get_global): New function.
3750 * jit-result.h (gcc::jit::result::get_global): New function.
3751 * libgccjit++.h (gccjit::context::new_global): Add "kind" param.
3752 * libgccjit.c (gcc_jit_context_new_global): Likewise.
3753 (gcc_jit_result_get_global): New API entrypoint.
3754 * libgccjit.h (gcc_jit_result_get_global): New API entrypoint.
3755 (enum gcc_jit_global_kind): New enum.
3756 (gcc_jit_context_new_global): API change: add "kind" param.
3757 * libgccjit.map (gcc_jit_result_get_global): New symbol.
3758
37592015-01-09 David Malcolm <dmalcolm@redhat.com>
3760
3761 * dummy-frontend.c: Include "fixed-value.h", "alias.h", "flags.h",
3762 "symtab.h", "inchash.h". Move include of "hash-set.h" much
3763 earlier.
3764 * jit-builtins.c: Remove redundant includes of "opts.h" and
3765 "tree.h".
3766 * jit-common.h: Include "hash-set.h", "input.h", "vec.h",
3767 "double-int.h", "alias.h", "flags.h", "symtab.h", "inchash.h".
3768 * jit-playback.c: Include "hashtab.h", "machmode.h", "input.h",
3769 "statistics.h", "vec.h", "double-int.h", "real.h",
3770 "fixed-value.h", "alias.h", "flags.h", "symtab.h", "tree-core.h",
3771 "inchash.h", "fold-const.h". Move include of "hash-set.h" to
3772 earlier.
3773 * jit-recording.c: Remove redundant includes of "opts.h" and
3774 "tree.h".
3775
37762015-01-09 David Malcolm <dmalcolm@redhat.com>
3777
3778 * docs/cp/topics/expressions.rst (Simple expressions): Use
3779 ":c:type:" for C types. Document new overload of
3780 gcc::jit::context::new_rvalue.
3781 * docs/topics/expressions.rst (Simple expressions): Use
3782 ":c:type:" for C types. Document new entrypoint
3783 gcc_jit_context_new_rvalue_from_long.
3784 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3785 * jit-playback.c: Within namespace gcc::jit::playback...
3786 (context::new_rvalue_from_int): Eliminate in favor of...
3787 (context::new_rvalue_from_const <int>): ...this.
3788 (context::new_rvalue_from_double): Eliminate in favor of...
3789 (context::new_rvalue_from_const <double>): ...this.
3790 (context::new_rvalue_from_const <long>): New.
3791 (context::new_rvalue_from_ptr): Eliminate in favor of...
3792 (context::new_rvalue_from_const <void *>): ...this.
3793 * jit-playback.h: Within namespace gcc::jit::playback...
3794 (context::new_rvalue_from_int): Eliminate in favor of...
3795 (context::new_rvalue_from_const <HOST_TYPE>): ...this.
3796 (context::new_rvalue_from_double): Likewise.
3797 (context::new_rvalue_from_ptr): Likewise.
3798 * jit-recording.c: Within namespace gcc::jit::recording...
3799 (context::new_rvalue_from_int): Eliminate.
3800 (context::new_rvalue_from_double): Likewise.
3801 (context::new_rvalue_from_ptr): Likewise.
3802 (class memento_of_new_rvalue_from_const <int>):
3803 Add explicit specialization.
3804 (class memento_of_new_rvalue_from_const <long>):
3805 Likewise.
3806 (class memento_of_new_rvalue_from_const <double>):
3807 Likewise.
3808 (class memento_of_new_rvalue_from_const <void *>):
3809 Likewise.
3810 (memento_of_new_rvalue_from_int::replay_into):
3811 Generalize into...
3812 (memento_of_new_rvalue_from_const <HOST_TYPE>::replay_into):
3813 ...this...
3814 (memento_of_new_rvalue_from_double::replay_into):
3815 ...allowing this...
3816 (memento_of_new_rvalue_from_ptr::replay_into):
3817 ...and this to be deleted.
3818 (memento_of_new_rvalue_from_int::make_debug_string):
3819 Convert to...
3820 (memento_of_new_rvalue_from_const <int>::make_debug_string):
3821 ...this.
3822 (memento_of_new_rvalue_from_double::make_debug_string):
3823 Convert to...
3824 (memento_of_new_rvalue_from_const <double>::make_debug_string):
3825 ...this.
3826 (memento_of_new_rvalue_from_ptr::make_debug_string)
3827 Convert to...
3828 (memento_of_new_rvalue_from_const <void *>::make_debug_string):
3829 ...this.
3830 (memento_of_new_rvalue_from_const <long>::make_debug_string):
3831 New function.
3832 * jit-recording.h: Within namespace gcc::jit::recording...
3833 (context::new_rvalue_from_int): Eliminate.
3834 (context::new_rvalue_from_double): Likewise.
3835 (context::new_rvalue_from_ptr): Likewise, all in favor of...
3836 (context::new_rvalue_from_const <HOST_TYPE>): New family of
3837 methods.
3838 (class memento_of_new_rvalue_from_int): Eliminate.
3839 (class memento_of_new_rvalue_from_double): Likewise.
3840 (class memento_of_new_rvalue_from_ptr): Likewise.
3841 (class memento_of_new_rvalue_from_const <HOST_TYPE>): New family
3842 of rvalue subclasses.
3843 * libgccjit++.h (gccjit::context::new_rvalue): New overload, for
3844 "long".
3845 * libgccjit.c (gcc_jit_context_new_rvalue_from_int): Update for
3846 rewriting of recording::context::new_rvalue_from_int to
3847 recording::context::new_rvalue_from_const <int>.
3848 (gcc_jit_context_new_rvalue_from_long): New API entrypoint.
3849 (gcc_jit_context_new_rvalue_from_double): Update for
3850 rewriting of recording::context::new_rvalue_from_double to
3851 recording::context::new_rvalue_from_const <double>.
3852 (gcc_jit_context_new_rvalue_from_ptr): Update for
3853 rewriting of recording::context::new_rvalue_from_ptr to
3854 recording::context::new_rvalue_from_const <void *>.
3855 * libgccjit.h (gcc_jit_context_new_rvalue_from_long): New API
3856 entrypoint.
3857 * libgccjit.map (gcc_jit_context_new_rvalue_from_long): Likewise.
3858
38592015-01-09 David Malcolm <dmalcolm@redhat.com>
3860
3861 PR jit/64206
3862 * docs/internals/test-hello-world.exe.log.txt: Update, the log now
3863 shows tempdir creation/cleanup.
3864 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3865 * jit-logging.h (class gcc::jit::log_user): Add gcc::jit::tempdir
3866 to the list of subclasses in the comment.
3867 * jit-playback.c (gcc::jit::playback::context::context): Add a
3868 comment clarifying when the tempdir gets cleaned up.
3869 (gcc::jit::playback::context::compile): Pass the context's logger,
3870 if any, to the tempdir.
3871 (gcc::jit::playback::context::dlopen_built_dso): When creating the
3872 gcc::jit::result, if GCC_JIT_BOOL_OPTION_DEBUGINFO is set, hand
3873 over ownership of the tempdir to it.
3874 * jit-result.c: Include "jit-tempdir.h".
3875 (gcc::jit::result::result): Add tempdir param, saving it as
3876 m_tempdir.
3877 (gcc::jit::result::~result): Delete m_tempdir.
3878 * jit-result.h (gcc::jit::result::result): Add tempdir param.
3879 (gcc::jit::result::m_tempdir): New field.
3880 * jit-tempdir.c (gcc::jit::tempdir::tempdir): Add logger param;
3881 add JIT_LOG_SCOPE.
3882 (gcc::jit::tempdir::create): Add JIT_LOG_SCOPE to log entry/exit,
3883 and log m_path_template and m_path_tempdir.
3884 (gcc::jit::tempdir::~tempdir): Add JIT_LOG_SCOPE to log
3885 entry/exit, and log the unlink and rmdir calls.
3886 * jit-tempdir.h: Include "jit-logging.h".
3887 (class gcc::jit::tempdir): Make this be a subclass of log_user.
3888 (gcc::jit::tempdir::tempdir): Add logger param.
3889 * notes.txt: Update to show the two possible places where the
3890 tempdir can be cleaned up.
3891
38922015-01-08 David Malcolm <dmalcolm@redhat.com>
3893
3894 * libgccjit.h (struct gcc_jit_context): Rewrite the descriptive
3895 comment.
3896
38972015-01-08 David Malcolm <dmalcolm@redhat.com>
3898
3899 * docs/topics/contexts.rst (Error-handling): Document new
3900 entrypoint gcc_jit_context_get_last_error.
3901 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3902 * jit-recording.c (gcc::jit::recording::context::context):
3903 Initialize new fields "m_last_error_str" and
3904 "m_owns_last_error_str".
3905 (gcc::jit::recording::context::~context): Clean up
3906 m_last_error_str, if needed.
3907 (gcc::jit::recording::context::add_error_va): Update
3908 m_last_error_str and m_owns_last_error_str, freeing the old
3909 value if appropriate.
3910 (gcc::jit::recording::context::get_last_error): New function.
3911 * jit-recording.h (gcc::jit::recording::context::get_last_error):
3912 New function.
3913 (gcc::jit::recording::context): New fields m_last_error_str and
3914 m_owns_last_error_str.
3915 * libgccjit.c (gcc_jit_context_get_last_error): New function.
3916 * libgccjit.h (gcc_jit_context_get_last_error): New declaration.
3917 * libgccjit.map (gcc_jit_context_get_last_error): New function.
3918
39192015-01-08 David Malcolm <dmalcolm@redhat.com>
3920
3921 * Make-lang.in (jit_OBJS): Add jit/jit-logging.o.
3922 * docs/internals/index.rst (Overview of code structure): Mention
3923 gcc_jit_context_set_logfile, and embed the example logfile.
3924 * docs/internals/test-hello-world.exe.log.txt: New file: example
3925 of a logfile.
3926 * docs/topics/contexts.rst (Debugging): Add documentation
3927 for gcc_jit_context_set_logfile.
3928 * docs/_build/texinfo/libgccjit.texi: Regenerate.
3929 * dummy-frontend.c: Include "jit-logging.h".
3930 (jit_langhook_init): Assert that there is an active playback
3931 context. If it has a logger, log entry/exit to this function.
3932 (jit_langhook_write_globals): Likewise.
3933 * jit-common.h (gcc::jit::logger): New forward declaration.
3934 * jit-logging.c: New file.
3935 * jit-logging.h: New file.
3936 * jit-playback.c: Include "jit-logging.h".
3937 (gcc::jit::playback::context::context): Initialize the log_user
3938 base class from the recording context's logger (if any). Use
3939 JIT_LOG_SCOPE to log entry/exit from the function body.
3940 (gcc::jit::playback::context::~context): Use JIT_LOG_SCOPE to
3941 log entry/exit from the function body.
3942 (gcc::jit::playback::build_stmt_list): Likewise.
3943 (gcc::jit::playback::function::postprocess): Likewise.
3944 (gcc::jit::playback::context::compile): Likewise. Log the
3945 entry/exit to toplev::main and toplev::finalize. Log the
3946 fake argv passed to toplev::main.
3947 (gcc::jit::playback::context::acquire_mutex): Use JIT_LOG_SCOPE to
3948 log entry/exit from the function body.
3949 (gcc::jit::playback::context::release_mutex): Likewise.
3950 (gcc::jit::playback::context::make_fake_args): Likewise.
3951 (gcc::jit::playback::context::extract_any_requested_dumps):
3952 Likewise.
3953 (gcc::jit::playback::context::convert_to_dso): Likewise. Also,
3954 log the arguments that the driver is invoked with.
3955 (gcc::jit::playback::context::dlopen_built_dso): Likewise. Pass
3956 the logger to the result object.
3957 (gcc::jit::playback::context::replay): Use JIT_LOG_SCOPE to
3958 log entry/exit from the function body.
3959 (gcc::jit::playback::context::dump_generated_code): Likewise.
3960 (gcc::jit::playback::context::handle_locations): Likewise.
3961 * jit-playback.h (gcc::jit::playback::context): Make this be
3962 a subclass of gcc::jit::log_user.
3963 * jit-recording.c: Include "jit-logging.h".
3964 (gcc::jit::recording::context::context: Initialize the logger to
3965 NULL for root contexts, or to the parent's logger for child
3966 contexts.
3967 (gcc::jit::recording::context::~context): Use JIT_LOG_SCOPE to
3968 log entry/exit from the function body.
3969 (gcc::jit::recording::context::replay_into): Likewise.
3970 (gcc::jit::recording::context::disassociate_from_playback):
3971 Likewise.
3972 (gcc::jit::recording::context::compile): Likewise.
3973 (recording::context::add_error_va): Likewise. Also, log the
3974 error.
3975 (gcc::jit::recording::context::validate): Use JIT_LOG_SCOPE to
3976 log entry/exit from the function body.
3977 * jit-recording.h: Include "jit-logging.h".
3978 (gcc::jit::recording::context): Make this be a subclass of
3979 gcc::jit::log_user.
3980 * jit-result.c: Include "jit-common.h" and "jit-logging.h".
3981 (gcc::jit::result::result): Add logger param, recording it.
3982 Use JIT_LOG_SCOPE to log entry/exit from the function body.
3983 (gcc::jit::result::~result(): Use JIT_LOG_SCOPE to
3984 log entry/exit from the function body.
3985 (gcc::jit::result::get_code): Likewise.
3986 * jit-result.h (gcc::jit::result): Make this be a subclass of
3987 gcc::jit::log_user.
3988 (gcc::jit::result::result): Add logger parameter.
3989 * libgccjit++.h (gccjit::context::set_logfile): New function.
3990 * libgccjit.c: Include "jit-logging.h".
3991 (gcc_jit_context_acquire): Log the context.
3992 (gcc_jit_context_release): Use JIT_LOG_FUNC to
3993 log entry/exit from the function body, and log the context.
3994 (gcc_jit_context_new_child_context): Likewise, logging both
3995 contexts.
3996 (gcc_jit_context_new_location): Use JIT_LOG_FUNC to
3997 log entry/exit from the function body.
3998 (gcc_jit_context_get_type): Likewise.
3999 (gcc_jit_context_get_int_type): Likewise.
4000 (gcc_jit_context_new_array_type): Likewise.
4001 (gcc_jit_context_new_field): Likewise.
4002 (gcc_jit_context_new_struct_type): Likewise.
4003 (gcc_jit_context_new_opaque_struct): Likewise.
4004 (gcc_jit_struct_set_fields): Likewise.
4005 (gcc_jit_context_new_union_type): Likewise.
4006 (gcc_jit_context_new_function_ptr_type): Likewise.
4007 (gcc_jit_context_new_param): Likewise.
4008 (gcc_jit_context_new_function): Likewise.
4009 (gcc_jit_context_get_builtin_function): Likewise.
4010 (gcc_jit_function_get_param): Likewise.
4011 (gcc_jit_function_dump_to_dot): Likewise.
4012 (gcc_jit_function_new_block): Likewise.
4013 (gcc_jit_context_new_global): Likewise.
4014 (gcc_jit_context_new_rvalue_from_int): Likewise.
4015 (gcc_jit_context_zero): Likewise.
4016 (gcc_jit_context_one): Likewise.
4017 (gcc_jit_context_new_rvalue_from_double): Likewise.
4018 (gcc_jit_context_new_rvalue_from_ptr): Likewise.
4019 (gcc_jit_context_null): Likewise.
4020 (gcc_jit_context_new_string_literal): Likewise.
4021 (gcc_jit_context_new_unary_op): Likewise.
4022 (gcc_jit_context_new_binary_op): Likewise.
4023 (gcc_jit_context_new_comparison): Likewise.
4024 (gcc_jit_context_new_call): Likewise.
4025 (gcc_jit_context_new_call_through_ptr): Likewise.
4026 (gcc_jit_context_new_cast): Likewise.
4027 (gcc_jit_context_new_array_access): Likewise.
4028 (gcc_jit_lvalue_access_field): Likewise.
4029 (gcc_jit_rvalue_access_field): Likewise.
4030 (gcc_jit_rvalue_dereference_field): Likewise.
4031 (gcc_jit_rvalue_dereference): Likewise.
4032 (gcc_jit_lvalue_get_address): Likewise.
4033 (gcc_jit_function_new_local): Likewise.
4034 (gcc_jit_block_add_eval): Likewise.
4035 (gcc_jit_block_add_assignment): Likewise.
4036 (gcc_jit_block_add_assignment_op): Likewise.
4037 (gcc_jit_block_end_with_conditional): Likewise.
4038 (gcc_jit_block_add_comment): Likewise.
4039 (gcc_jit_block_end_with_jump): Likewise.
4040 (gcc_jit_block_end_with_return): Likewise.
4041 (gcc_jit_block_end_with_void_return): Likewise.
4042 (gcc_jit_context_set_str_option): Likewise.
4043 (gcc_jit_context_set_int_option): Likewise.
4044 (gcc_jit_context_set_bool_option): Likewise.
4045 (gcc_jit_context_enable_dump): Likewise.
4046 (gcc_jit_context_compile): Likewise. Also log the context,
4047 and the result.
4048 (gcc_jit_context_dump_to_file): Likewise.
4049 (gcc_jit_context_set_logfile): New function.
4050 (gcc_jit_context_get_first_error): Use JIT_LOG_FUNC to
4051 log entry/exit from the function body.
4052 (gcc_jit_result_get_code): Likewise. Also log the fnname)
4053 and the ptr to be returned.
4054 (gcc_jit_result_release): Likewise. Also log the result.
4055 * libgccjit.h: Include <stdio.h>, since we need FILE *.
4056 (gcc_jit_context_set_logfile): New declaration.
4057 * libgccjit.map (gcc_jit_context_set_logfile): New.
4058
40592015-01-07 David Malcolm <dmalcolm@redhat.com>
4060
4061 * jit-recording.h (gcc::jit::recording::type::is_void): New
4062 virtual function.
4063 (gcc::jit::recording::memento_of_get_type::is_void): New
4064 function, overriding default implementation.
4065 * libgccjit.c (gcc_jit_rvalue_dereference): Verify that
4066 the underlying type is not "void".
4067
40682015-01-07 David Malcolm <dmalcolm@redhat.com>
4069
4070 * docs/topics/expressions.rst (Unary Operations): Add
4071 GCC_JIT_UNARY_OP_ABS.
4072 * jit-playback.c (gcc::jit::playback::context::new_unary_op):
4073 Likewise.
4074 * jit-recording.c (unary_op_strings): Likewise.
4075 * libgccjit.c (gcc_jit_context_new_unary_op): Update checking
4076 of "op" to reflect addition of GCC_JIT_UNARY_OP_ABS.
4077 * libgccjit.h (enum gcc_jit_unary_op): Add GCC_JIT_UNARY_OP_ABS.
4078 * docs/_build/texinfo/libgccjit.texi: Regenerate.
4079
40802015-01-07 David Malcolm <dmalcolm@redhat.com>
4081
4082 * jit-recording.h (gcc::jit::recording::memento_of_get_type): Fix
4083 typo in comment.
4084
40852015-01-07 David Malcolm <dmalcolm@redhat.com>
4086
4087 * TODO.rst (Test suite): Remove item about running C++ testcases.
4088 * docs/internals/index.rst (Working on the JIT library): Add
4089 "c++" to the enabled languages in the suggested "configure"
4090 invocation, and add a description of why this is necessary.
4091 * docs/_build/texinfo/libgccjit.texi: Regenerate.
4092
40932015-01-07 David Malcolm <dmalcolm@redhat.com>
4094
4095 * docs/internals/index.rst: Update to reflect that built
4096 testcases are now test-foo.c.exe, rather than test-foo.exe.
4097 * docs/_build/texinfo/libgccjit.texi: Regenerate.
4098
40992015-01-05 Jakub Jelinek <jakub@redhat.com>
4100
4101 Update copyright years.
4102
41032014-12-19 David Malcolm <dmalcolm@redhat.com>
4104
4105 * jit-playback.c (gcc::jit::playback::context::build_cast): In
4106 case BOOLEAN_TYPE, don't assume that the source expression is
4107 of type "int".
4108
41092014-12-19 David Malcolm <dmalcolm@redhat.com>
4110
4111 * jit-recording.c (gcc::jit::recording::context::context): When
4112 copying string options from a parent context, take a copy of the
4113 underlying buffers, rather than simply copying the pointer.
4114
41152014-12-19 David Malcolm <dmalcolm@redhat.com>
4116
4117 * jit-recording.c (gcc::jit::recording::context::set_str_option):
4118 Handle NULL.
4119
41202014-12-11 David Malcolm <dmalcolm@redhat.com>
4121
4122 * docs/cp/topics/contexts.rst (gccjit::context::set_str_option):
4123 Document new function.
4124 * docs/_build/texinfo/libgccjit.texi: Regenerate.
4125
41262014-12-10 Ulrich Drepper <drepper@gmail.com>
4127
4128 Minor interface cleanups of libgccjit
4129 * jit-playback.c (convert_to_dso): Use auto_vec instead
4130 of automatic array to build up command line.
4131 * jit-recording.c (recording::context::set_str_option):
4132 Make copy of the string.
4133 (recording::context::~context): Free string options.
4134 * jit-recording.h (recording::context): Adjust type
4135 of m_str_options member.
4136 * libgccjit.h: Adjust comment about
4137 gcc_jit_context_set_str_option parameter being used after
4138 the call.
4139 Update comment now that all interfaces are copy strings
4140 if necessary.
4141 * libgccjit++.h (gccjit::context): Add set_str_option
4142 member function.
4143
41442014-12-10 David Malcolm <dmalcolm@redhat.com>
4145
4146 * docs/cp/index.rst: New file.
4147 * docs/cp/intro/index.rst: New file.
4148 * docs/cp/intro/tutorial01.rst: New file.
4149 * docs/cp/intro/tutorial02.rst: New file.
4150 * docs/cp/intro/tutorial03.rst: New file.
4151 * docs/cp/intro/tutorial04.rst: New file.
4152 * docs/cp/topics/contexts.rst: New file.
4153 * docs/cp/topics/expressions.rst: New file.
4154 * docs/cp/topics/functions.rst: New file.
4155 * docs/cp/topics/index.rst: New file.
4156 * docs/cp/topics/locations.rst: New file.
4157 * docs/cp/topics/objects.rst: New file.
4158 * docs/cp/topics/results.rst: New file.
4159 * docs/cp/topics/types.rst: New file.
4160 * docs/examples/tut01-hello-world.cc: New file.
4161 * docs/examples/tut02-square.c: Fix missing newline in output.
4162 * docs/examples/tut02-square.cc: New file.
4163 * docs/examples/tut03-sum-of-squares.cc: New file.
4164 * docs/examples/tut04-toyvm/toyvm.cc: New file.
4165 * docs/index.rst: Move summary to above the table of contents.
4166 Add text about the C vs C++ APIs.
4167 * docs/topics/contexts.rst: Fix a typo.
4168
4169 * docs/_build/texinfo/libgccjit.texi: Regenerate.
4170 * docs/_build/texinfo/factorial1.png: New file.
4171 * docs/_build/texinfo/sum-of-squares1.png: New file.
4172
41732014-12-09 David Malcolm <dmalcolm@redhat.com>
4174
4175 * docs/examples/tut04-toyvm/toyvm.c (toyvm_function_compile): Move
4176 logic for determine "funcname" to new function...
4177 (get_function_name): ...here, adding logic to skip any leading
4178 path from the filename.
4179 (toyvm_function_parse): Use the filename for fn_filename, rather
4180 than "name", so that the debugger can locate the source .toy
4181 file.
4182 (toyvm_function_parse): Don't fclose a NULL FILE *.
4183
41842014-12-09 David Malcolm <dmalcolm@redhat.com>
4185
4186 PR jit/63854
4187 * docs/internals/index.rst (Running under valgrind): New
4188 subsection.
4189 (docs/_build/texinfo/libgccjit.texi): Regenerate.
4190
41912014-12-09 David Malcolm <dmalcolm@redhat.com>
4192
4193 PR jit/64206
4194 * Make-lang.in (jit_OBJS): Add jit/jit-tempdir.o.
4195 * jit-common.h (gcc::jit::tempdir): New forward decl.
4196 * jit-playback.c: Include jit-tempdir.h.
4197 (gcc::jit::playback::context::context): Initialize m_tempdir.
4198 (gcc::jit::playback::context::~context): Move tempdir
4199 cleanup to new file jit-tempdir.c
4200 (make_tempdir_path_template): Move to new file jit-tempdir.c.
4201 (gcc::jit::playback::context::compile): Move tempdir creation
4202 to new tempdir object in new file jit-tempdir.c.
4203 (gcc::jit::playback::context::make_fake_args): Get path from
4204 tempdir object rather than from member data.
4205 (gcc::jit::playback::context::convert_to_dso): Likewise.
4206 (gcc::jit::playback::context::dlopen_built_dso): Likewise.
4207 (gcc::jit::playback::context::dump_generated_code): Likewise.
4208 (gcc::jit::playback::context::get_path_c_file): New function.
4209 (gcc::jit::playback::context::get_path_s_file): New function.
4210 (gcc::jit::playback::context::get_path_so_file): New function.
4211 * jit-playback.h (gcc::jit::playback::context::get_path_c_file):
4212 New function.
4213 (gcc::jit::playback::context::get_path_s_file): New function.
4214 (gcc::jit::playback::context::get_path_so_file): New function.
4215 (gcc::jit::playback::context): Move fields "m_path_template",
4216 "m_path_tempdir", "m_path_c_file", "m_path_s_file",
4217 "m_path_so_file" to new jit::tempdir class; add field "m_tempdir".
4218 * jit-tempdir.c: New file.
4219 * jit-tempdir.h: New file.
4220
42212014-12-09 David Malcolm <dmalcolm@redhat.com>
4222
4223 * jit-playback.c (gcc::jit::playback::context::compile): Acquire the
4224 mutex here, immediately before using toplev, and release it here, on
4225 each exit path after acquisition.
4226 (jit_mutex): Move this variable here, from jit-recording.c.
4227 (gcc::jit::playback::context::acquire_mutex): New function, based on
4228 code in jit-recording.c.
4229 (gcc::jit::playback::context::release_mutex): Likewise.
4230 * jit-playback.h (gcc::jit::playback::context::acquire_mutex): New
4231 function.
4232 (gcc::jit::playback::context::release_mutex): New function.
4233 * jit-recording.c (jit_mutex): Move this variable to jit-playback.c.
4234 (gcc::jit::recording::context::compile): Move mutex-handling from
4235 here into jit-playback.c's gcc::jit::playback::context::compile.
4236 * notes.txt: Update to show the new locations of ACQUIRE_MUTEX
4237 and RELEASE_MUTEX.
4238
42392014-12-09 David Malcolm <dmalcolm@redhat.com>
4240
4241 * jit-playback.c (gcc::jit::playback::context::compile): Move the
4242 dlopen code into...
4243 (gcc::jit::playback::context::dlopen_built_dso): ...this new
4244 function.
4245 * jit-playback.h (gcc::jit::playback::context::dlopen_built_dso):
4246 New function.
4247
42482014-12-09 David Malcolm <dmalcolm@redhat.com>
4249
4250 PR jit/64166
4251 * docs/topics/contexts.rst (Debugging): Add description of
4252 gcc_jit_context_enable_dump.
4253 * docs/_build/texinfo/libgccjit.texi: Regenerate.
4254 * jit-playback.c: Include context.h.
4255 (class auto_argvec): New class.
4256 (auto_argvec::~auto_argvec): New function.
4257 (gcc::jit::playback::context::compile): Convert fake_args to be
4258 an auto_argvec, so that it can contain dynamically-allocated
4259 strings. Construct a vec of all requested dumps, and pass it to
4260 make_fake_args. Extract requested dumps between the calls to
4261 toplev::main and toplev::finalize.
4262 (gcc::jit::playback::context::make_fake_args): Convert param
4263 "argvec" to be a vec <char *>, and gain a "requested_dumps"
4264 param. Convert to dynamically-allocated arg strings by converting
4265 ADD_ARG to take a copy of the arg, and add ADD_ARG_TAKE_OWNERSHIP
4266 for args that are already a copy. Add args for all requested dumps.
4267 (gcc::jit::playback::context::extract_any_requested_dumps): New
4268 function.
4269 (gcc::jit::playback::context::read_dump_file): New function.
4270 * jit-playback.h (gcc::jit::playback::context::make_fake_args):
4271 Convert param "argvec" to be a vec <char *>, and gain a
4272 "requested_dumps" param.
4273 (gcc::jit::playback::context::extract_any_requested_dumps): New
4274 function.
4275 (gcc::jit::playback::context::read_dump_file): New function.
4276 * jit-recording.c (gcc::jit::recording::context::enable_dump): New
4277 function.
4278 (gcc::jit::recording::context::get_all_requested_dumps): New
4279 function.
4280 * jit-recording.h (gcc::jit::recording::requested_dump): New
4281 struct.
4282 (gcc::jit::recording::context::enable_dump): New function.
4283 (gcc::jit::recording::context::get_all_requested_dumps): New
4284 function.
4285 (gcc::jit::recording::context::m_requested_dumps): New field.
4286 * libgccjit.c (gcc_jit_context_enable_dump): New API entrypoint.
4287 * libgccjit.h (gcc_jit_context_enable_dump): New API entrypoint.
4288 * libgccjit.map (gcc_jit_context_enable_dump): New API entrypoint.
4289
42902014-12-08 David Malcolm <dmalcolm@redhat.com>
4291
4292 * libgccjit++.h: Indent the forward declarations of the classes to
4293 show the inheritance hierarchy.
4294
42952014-12-08 David Malcolm <dmalcolm@redhat.com>
4296
4297 * notes.txt: Show the beginning and ending of
4298 recording::context::compile vs playback::context::compile. Show
4299 the creation and unlinking of the tempdir. Show toplev::finalize.
4300 Move "RELEASE MUTEX" to the correct location. Show
4301 gcc_jit_result_release, and indicate where the
4302 dlopen/dlsym/dlclose occur.
4303
43042014-12-01 David Malcolm <dmalcolm@redhat.com>
4305
4306 * docs/examples/tut02-square.c (main): Release the context
4307 earlier, to show that this is possible. Update error-handling
4308 to avoid a double-release of the context, and to avoid
4309 releasing a NULL result.
4310 * docs/intro/tutorial02.rst: Discuss gcc_jit_context_release.
4311 * docs/topics/functions.rst (GCC_JIT_FUNCTION_EXPORTED): Emphasize
4312 * docs/topics/results.rst (gcc_jit_result): Mention that this
4313 controls the lifetimes of machine code functions.
4314 (gcc_jit_result_get_code): Spell out the requirements for this
4315 to succeed, and the lifetime of the result.
4316 (gcc_jit_result_release): Mention that this invalidates any code
4317 that was obtained from the result.
4318 * docs/_build/texinfo/libgccjit.texi: Regenerate.
4319
43202014-12-01 David Malcolm <dmalcolm@redhat.com>
4321
4322 PR jit/64018
4323 * docs/intro/tutorial02.rst: Spell out lifetime of generated code.
4324 Add description of error-handling, taken in part from...
4325 * docs/topics/contexts.rst (Error-handling): Expand, and move some
4326 content to tutorial02.rst.
4327 * docs/_build/texinfo/libgccjit.texi: Regenerate.
4328
43292014-12-01 David Malcolm <dmalcolm@redhat.com>
4330
4331 PR jit/64020
4332 * docs/topics/types.rst (Standard types) Add new enum values to
4333 the table of enum gcc_jit_types: GCC_JIT_TYPE_COMPLEX_FLOAT,
4334 GCC_JIT_TYPE_COMPLEX_DOUBLE, GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE.
4335 Widen the left-hand column so that
4336 GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE will fit.
4337 * docs/_build/texinfo/libgccjit.texi: Regenerate.
4338
4339 * jit-builtins.c: Include stringpool.h and jit-playback.h.
4340 Move everything out of the gcc::jit::recording namespace into
4341 just gcc::jit.
4342 (struct builtin_data): Add fields "fnclass", "attr", and
4343 "implicit_p".
4344 (DEF_BUILTIN): Update macro so populate the new fields.
4345 (builtins_manager::builtins_manager): Update for move out of
4346 recording namespace. Initialize the m_attributes array.
4347 (builtins_manager::get_builtin_function): Likewise.
4348 (builtins_manager::get_builtin_function_by_id): New function.
4349 (builtins_manager::make_builtin_function): Update for move out of
4350 recording namespace. Add fix for PR jit/64020 by detecting
4351 specific builtin ids and having them ensure that builtins for
4352 other ids are created as necessary.
4353 (builtins_manager::get_type): Update for move out of recording
4354 namespace.
4355 (builtins_manager::make_type): Likewise. Add some missing
4356 #undefs.
4357 (builtins_manager::make_primitive_type): Update for move out of
4358 recording namespace. Implement the three BT_COMPLEX_ cases and
4359 BT_DOUBLE_PTR.
4360 (builtins_manager::make_fn_type): Update for move out of recording
4361 namespace.
4362 (builtins_manager::make_ptr_type): Likewise.
4363 (builtins_manager::finish_playback): New function.
4364 (builtins_manager::get_class): New function.
4365 (builtins_manager::implicit_p): New function.
4366 (builtins_manager::get_attrs_tree): Two new functions.
4367 (builtins_manager::make_attrs_tree): New function.
4368
4369 * jit-builtins.h: Move everything out of the gcc::jit::recording
4370 namespace into just gcc::jit.
4371 (enum built_in_attribute): New.
4372 (builtins_manager::builtins_manager): Update decl for namespace
4373 change.
4374 (builtins_manager::get_builtin_function): Likewise.
4375 (builtins_manager::get_class): New.
4376 (builtins_manager::implicit_p): New.
4377 (builtins_manager::get_attrs_tree): Two new functions.
4378 (builtins_manager::make_attrs_tree): New function.
4379 (builtins_manager::finish_playback): New.
4380 (builtins_manager::get_builtin_function_by_id): New.
4381 (builtins_manager::make_builtin_function): Update decl for
4382 namespace change.
4383 (builtins_manager::get_type): Likewise.
4384 (builtins_manager::make_type): Likewise.
4385 (builtins_manager::make_primitive_type): Likewise.
4386 (builtins_manager::make_fn_type): Likewise.
4387 (builtins_manager::make_ptr_type): Likewise.
4388 (builtins_manager): Likewise for fields. Add new field
4389 "m_attributes".
4390
4391 * jit-common.h (NUM_GCC_JIT_TYPES): Update.
4392 (builtins_manager): Update forward decl to reflect namespace
4393 change.
4394
4395 * jit-playback.c: Include attribs.h and jit-builtins.h.
4396 (gcc::jit::playback::context::get_tree_node_for_type): Add cases
4397 for the new COMPLEX_ types.
4398 (gcc::jit::playback::context::new_function): If creating a
4399 builtin, set the DECL_BUILT_IN_CLASS and attributes on the fndecl,
4400 and call set_builtin_decl.
4401 (gcc::jit::playback::context::replay): If we have a
4402 builtins_manager, call its finish_playback method when we're done.
4403
4404 * jit-playback.h:
4405 (gcc::jit::playback::context::get_builtins_manager): New function.
4406
4407 * jit-recording.c
4408 (gcc::jit::recording::context::get_builtins_manager): New function.
4409 (gcc::jit::recording::get_builtin_function): Use
4410 get_builtins_manager, in case we're a child context.
4411 (gcc::jit::recording::memento_of_get_type::dereference): Add the
4412 COMPLEX_ types.
4413 (gcc::jit::recording::memento_of_get_type::is_int): Likewise.
4414 (gcc::jit::recording::memento_of_get_type::is_float): Likewise.
4415 (gcc::jit::recording::memento_of_get_type::is_bool): Likewise.
4416 (get_type_strings): Likewise.
4417
4418 * jit-recording.h
4419 (gcc::jit::recording::context::get_builtins_manager): New.
4420
4421 * libgccjit.h (enum gcc_jit_types): Add
4422 GCC_JIT_TYPE_COMPLEX_FLOAT, GCC_JIT_TYPE_COMPLEX_DOUBLE,
4423 GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE.
4424
44252014-12-01 David Malcolm <dmalcolm@redhat.com>
4426
4427 * jit-builtins.c
4428 (gcc::jit::recording::builtins_manager::get_builtin_function):
4429 Check for NULL return from make_builtin_function.
4430 (gcc::jit::recording::builtins_manager::make_builtin_function):
4431 Check for NULL return from get_type.
4432
44332014-12-01 David Malcolm <dmalcolm@redhat.com>
4434
4435 * jit-playback.c (gcc::jit::playback::context::compile): Move DSO
4436 creation code into...
4437 (gcc::jit::playback::context::convert_to_dso): New function.
4438 * jit-playback.h (gcc::jit::playback::context::convert_to_dso):
4439 New function.
4440
44412014-12-01 David Malcolm <dmalcolm@redhat.com>
4442
4443 * jit-playback.c (gcc::jit::playback::context::compile): Use an
4444 auto_vec<const char *> rather than a const char *[20] for the
4445 top-level argv, and move the logic to build it to...
4446 (gcc::jit::playback::context::make_fake_args): New function.
4447 * jit-playback.h (gcc::jit::playback::context::make_fake_args):
4448 New function.
4449
44502014-12-01 David Malcolm <dmalcolm@redhat.com>
4451
4452 * Make-lang.in (jit_OBJS): Add jit/jit-result.o.
4453 * jit-playback.c: Include new header jit-result.h.
4454 (gcc::jit::result::result): Move to new file jit-result.c.
4455 (gcc::jit::result::~result): Likewise.
4456 (gcc::jit::playback::result): Likewise.
4457 * jit-recording.h (class gcc::jit::result): Move to new
4458 header jit-result.h.
4459 * jit-result.c: New file, to contain...
4460 (gcc::jit::result::result): Move here from jit-playback.c,
4461 removing erroneous "playback" namespace from comment.
4462 (gcc::jit::result::~result): Likewise.
4463 (gcc::jit::playback::result): Likewise.
4464 * jit-result.h: New file, to contain...
4465 (class gcc::jit::result): Move from jit-recording.h.
4466 * libgccjit.c: Include jit-result.h.
4467 (gcc_jit_result_get_code): Update comment to reflect move
4468 of implementation.
4469 (gcc_jit_result_release): Likewise.
4470
44712014-12-01 David Malcolm <dmalcolm@redhat.com>
4472
4473 PR jit/63854
4474 * docs/examples/tut04-toyvm/toyvm.c
4475 (toyvm_compiled_function): New typedef.
4476 (toyvm_compiled_func) Rename to...
4477 (toyvm_compiled_code) ...this.
4478 (struct toyvm_compiled_function): New struct.
4479 (toyvm_function_compile): Return a toyvm_compiled_function *
4480 rather than a toyvm_compiled_func, so that the caller can fully
4481 clean things up. Free "funcname".
4482 (test_script): Update for change to toyvm_function_compile.
4483 Clean up the toyvm_compiled_function.
4484 (main): Likewise.
4485 (docs/intro/tutorial04.rst): Update to reflect the above changes,
4486 and to better spell out the lifetime of the compiled code.
4487
44882014-12-01 David Malcolm <dmalcolm@redhat.com>
4489
4490 PR jit/63854
4491 * jit-builtins.c
4492 (gcc::jit::recording::builtins_manager::make_fn_type): Call the
4493 context's new_function_type method, rather than directly creating
4494 a function_type instance.
4495 * jit-recording.c
4496 (gcc::jit::recording::context::new_function_type): New method,
4497 adapted from part of...
4498 (gcc::jit::recording::context::new_function_ptr_type): ...this.
4499 Update to call new_function_type.
4500 * jit-recording.h
4501 (gcc::jit::recording::context::new_function_type): New method.
4502
45032014-12-01 David Malcolm <dmalcolm@redhat.com>
4504
4505 PR jit/63969
4506 * jit-playback.c: Ensure that ctxt_progname is non-NULL.
4507
45082014-11-19 David Malcolm <dmalcolm@redhat.com>
4509
4510 PR jit/63854
4511 * jit-playback.c (gcc::jit::playback::compound_type::set_fields):
4512 Convert param from const vec<playback::field *> & to
4513 const auto_vec<playback::field *> *.
4514 (gcc::jit::playback::context::new_function_type): Convert param
4515 "param_types" from vec<type *> * to const auto_vec<type *> *.
4516 (gcc::jit::playback::context::new_function): Convert param
4517 "params" from vec<param *> * to const auto_vec<param *> *.
4518 (gcc::jit::playback::context::build_call): Convert param "args"
4519 from vec<rvalue *> to const auto_vec<rvalue *> *.
4520 (gcc::jit::playback::context::new_call): Likewise.
4521 (gcc::jit::playback::context::new_call_through_ptr): Likewise.
4522 (wrapper_finalizer): New function.
4523 (gcc::jit::playback::wrapper::operator new): Call the finalizer
4524 variant of ggc_internal_cleared_alloc, supplying
4525 wrapper_finalizer.
4526 (gcc::jit::playback::function::finalizer): New.
4527 (gcc::jit::playback::block::finalizer): New.
4528 (gcc::jit::playback::source_file::finalizer): New.
4529 (gcc::jit::playback::source_line::finalizer): New.
4530
4531 * jit-playback.h
4532 (gcc::jit::playback::context::new_function_type): Convert param
4533 "param_types" from vec<type *> * to const auto_vec<type *> *.
4534 (gcc::jit::playback::context::new_function): Convert param
4535 "params" from vec<param *> * to const auto_vec<param *> *.
4536 (gcc::jit::playback::context::new_call): Convert param
4537 "args" from vec<rvalue *> to const auto_vec<rvalue *> *.
4538 (gcc::jit::playback::context::new_call_through_ptr): Likewise.
4539 (gcc::jit::playback::context::build_call): Likewise.
4540 (gcc::jit::playback::context): Convert fields "m_functions",
4541 "m_source_files", "m_cached_locations" from vec to auto_vec.
4542 (gcc::jit::playback::wrapper::finalizer): New virtual function.
4543 (gcc::jit::playback::compound_type::set_fields): Convert param fro
4544 const vec<playback::field *> & to
4545 const auto_vec<playback::field *> *.
4546 (gcc::jit::playback::function::finalizer): New.
4547 (gcc::jit::playback::block::finalizer): New.
4548 (gcc::jit::playback::source_file::finalizer): New.
4549 (gcc::jit::playback::source_line::finalizer): New.
4550
4551 * jit-recording.c
4552 (gcc::jit::recording::function_type::replay_into): Convert local
4553 from a vec into an auto_vec.
4554 (gcc::jit::recording::fields::replay_into): Likewise.
4555 (gcc::jit::recording::function::replay_into): Likewise.
4556 (gcc::jit::recording::call::replay_into): Likewise.
4557 (gcc::jit::recording::call_through_ptr::replay_into): Likewise.
4558
4559 * jit-recording.h (gcc::jit::recording::context): Convert fields
4560 "m_mementos", "m_compound_types", "m_functions" from vec<> to
4561 auto_vec <>.
4562 (gcc::jit::recording::function_type::get_param_types): Convert
4563 return type from vec<type *> to const vec<type *> &.
4564 (gcc::jit::recording::function_type): Convert field
4565 "m_param_types" from a vec<> to an auto_vec<>.
4566 (gcc::jit::recording::fields): Likewise for field "m_fields".
4567 (gcc::jit::recording::function::get_params): Convert return type
4568 from vec <param *> to const vec<param *> &.
4569 (gcc::jit::recording::function): Convert fields "m_params",
4570 "m_locals", "m_blocks" from vec<> to auto_vec<>.
4571 (gcc::jit::recording::block): Likewise for field "m_statements".
4572 vec<> to auto_vec<>.
4573 (gcc::jit::recording::call): Likewise for field "m_args".
4574 (gcc::jit::recording::call_through_ptr): Likewise.
4575
45762014-11-19 David Malcolm <dmalcolm@redhat.com>
4577
4578 PR jit/63854
4579 * jit-recording.c (recording::function::validate): Convert
4580 "worklist" from vec<> to autovec<> to fix a leak.
4581
45822014-11-11 David Malcolm <dmalcolm@redhat.com>
4583
4584 * ChangeLog.jit: New.
4585 * ChangeLog: New.
4586 * Make-lang.in: New.
4587 * TODO.rst: New.
4588 * config-lang.in: New.
4589 * docs/Makefile: New.
4590 * docs/_build/texinfo/Makefile: New.
4591 * docs/_build/texinfo/factorial.png: New.
4592 * docs/_build/texinfo/libgccjit.texi: New.
4593 * docs/_build/texinfo/sum-of-squares.png: New.
4594 * docs/conf.py: New.
4595 * docs/examples/tut01-hello-world.c: New.
4596 * docs/examples/tut02-square.c: New.
4597 * docs/examples/tut03-sum-of-squares.c: New.
4598 * docs/examples/tut04-toyvm/Makefile: New.
4599 * docs/examples/tut04-toyvm/factorial.toy: New.
4600 * docs/examples/tut04-toyvm/fibonacci.toy: New.
4601 * docs/examples/tut04-toyvm/toyvm.c: New.
4602 * docs/index.rst: New.
4603 * docs/internals/index.rst: New.
4604 * docs/intro/factorial.png: New.
4605 * docs/intro/index.rst: New.
4606 * docs/intro/sum-of-squares.png: New.
4607 * docs/intro/tutorial01.rst: New.
4608 * docs/intro/tutorial02.rst: New.
4609 * docs/intro/tutorial03.rst: New.
4610 * docs/intro/tutorial04.rst: New.
4611 * docs/topics/contexts.rst: New.
4612 * docs/topics/expressions.rst: New.
4613 * docs/topics/functions.rst: New.
4614 * docs/topics/index.rst: New.
4615 * docs/topics/locations.rst: New.
4616 * docs/topics/objects.rst: New.
4617 * docs/topics/results.rst: New.
4618 * docs/topics/types.rst: New.
4619 * dummy-frontend.c: New.
4620 * jit-builtins.c: New.
4621 * jit-builtins.h: New.
4622 * jit-common.h: New.
4623 * jit-playback.c: New.
4624 * jit-playback.h: New.
4625 * jit-recording.c: New.
4626 * jit-recording.h: New.
4627 * libgccjit++.h: New.
4628 * libgccjit.c: New.
4629 * libgccjit.h: New.
4630 * libgccjit.map: New.
4631 * notes.txt: New.
4632
46332013-07-26 David Malcolm <dmalcolm@redhat.com>
4634
4635 * Initial creation
4636\f
4637Copyright (C) 2013-2025 Free Software Foundation, Inc.
4638
4639Copying and distribution of this file, with or without modification,
4640are permitted in any medium without royalty provided the copyright
4641notice and this notice are preserved.