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