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