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