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