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