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