]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/jit/ChangeLog
re PR c++/65790 (compilation error : receive std::index_sequence)
[thirdparty/gcc.git] / gcc / jit / ChangeLog
CommitLineData
58c5ad40
DM
12015-07-08 David Malcolm <dmalcolm@redhat.com>
2
3 PR jit/66783
4 * libgccjit.c (gcc_jit_context_new_field): Show name of field in
5 "unknown size" error message.
6 (gcc_jit_struct_set_fields): Show name of struct in error message.
7 (gcc_jit_context_new_global): Show name of global in
8 "unknown size" error message.
9 (gcc_jit_function_new_local): Likewise for local.
10
c7131fb2
AM
112015-07-07 Andrew MacLeod <amacleod@redhat.com>
12
13 * dummy-frontend.c: Adjust includes.
14 * jit-common.h: Likewise.
15 * jit-playback.c: Likewise.
16
3457d39e
DM
172015-07-07 David Malcolm <dmalcolm@redhat.com>
18
19 PR jit/66783
20 * jit-recording.h: Within namespace gcc:jit::recording...
21 (type::has_known_size): New virtual function.
22 (struct_has_known_size): New function.
23 * libgccjit.c (gcc_jit_context_new_field): Verify that the type
24 has a known size.
25 (gcc_jit_context_new_global): Likewise.
26 (gcc_jit_function_new_local): Likewise.
27
bada4bed
DM
282015-07-07 David Malcolm <dmalcolm@redhat.com>
29
30 PR jit/66779
31 * dummy-frontend.c (jit_langhook_type_for_mode): Ensure that we
32 handle modes QI, HI, SI, DI, TI.
33
e09abfa4
DM
342015-07-01 David Malcolm <dmalcolm@redhat.com>
35
36 PR jit/66700
37 * jit-playback.c (jit_mark_addressable): New function.
38 (gcc::jit::playback::lvalue::get_address): Call
39 jit_mark_addressable on the underlying tree.
40
e807aeaa
DM
412015-07-01 David Malcolm <dmalcolm@redhat.com>
42
43 * docs/topics/types.rst (gcc_jit_context_new_union_type): Add
44 documentation.
45 * docs/_build/texinfo/libgccjit.texi: Regenerate.
46
c575221a
DM
472015-07-01 David Malcolm <dmalcolm@redhat.com>
48
49 * docs/topics/contexts.rst (gcc_jit_context_set_bool_option):
50 Clarify lack of lifetime requirements on (const char *) parameter.
51 * docs/topics/expressions.rst
52 (gcc_jit_context_new_string_literal): Likewise.
53 (gcc_jit_context_new_global): Likewise.
54 * docs/topics/functions.rst (gcc_jit_context_new_param): Likewise.
55 (gcc_jit_context_new_function): Likewise.
56 (gcc_jit_function_new_block): Likewise.
57 (gcc_jit_block_add_comment): Likewise.
58 * docs/topics/locations.rst (gcc_jit_context_new_location):
59 Likewise.
60 * docs/topics/types.rst (gcc_jit_context_new_field): Likewise.
61 (gcc_jit_context_new_struct_type): Likewise.
62 * docs/_build/texinfo/libgccjit.texi: Regenerate.
63
ec5d0088
DM
642015-06-30 David Malcolm <dmalcolm@redhat.com>
65
66 * docs/cp/topics/functions.rst (Blocks): Add switch statements to
67 list of ways to terminate a block.
68 (gccjit::block::end_with_switch): Add function description.
69 (gccjit::case_): Add class.
70 (gccjit::context::new_case): Add function description.
71 * docs/cp/topics/objects.rst: Add "case_" to class hierarchy.
72 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_3): New.
73 * docs/topics/functions.rst (Blocks): Add switch statements to
74 list of ways to terminate a block.
75 (gcc_jit_block_end_with_switch): Add function description.
76 (gcc_jit_case): Add type.
77 (gcc_jit_context_new_case): Add function description.
78 (gcc_jit_case_as_object): Add function description.
79 * docs/topics/objects.rst: Add gcc_jit_case to class hierarchy.
80 * docs/_build/texinfo/libgccjit.texi: Regenerate.
81 * jit-common.h (gcc::jit::recording::case_): Add forward decl.
82 (gcc::jit::playback::case_): Add forward decl.
83 * jit-playback.c (add_case): New function.
84 (gcc::jit::playback::block::add_switch): New function.
85 * jit-playback.h (gcc::jit::playback::case_): New struct.
86 (gcc::jit::playback::block::get_function): New method.
87 (gcc::jit::playback::block::add_switch): New method.
88 * jit-recording.c: Within namespace gcc::jit...
89 (recording::context::new_case): New method.
90 (recording::function::validate): Update for change to
91 get_successor_blocks.
92 (recording::block::end_with_switch): New method.
93 (recording::block::get_successor_blocks): Update to support an
94 arbitrary number of successor blocks.
95 (recording::block::dump_edges_to_dot): Likewise.
96 (memento_of_new_rvalue_from_const <int>::get_wide_int): New.
97 (memento_of_new_rvalue_from_const <long>::get_wide_int): New.
98 (memento_of_new_rvalue_from_const <double>::get_wide_int): New.
99 (memento_of_new_rvalue_from_const <void *>::get_wide_int): New.
100 (recording::statement::get_successor_blocks): Update to support an
101 arbitrary number of successor blocks.
102 (recording::conditional::get_successor_blocks): Likewise.
103 (recording::jump::get_successor_blocks): Likewise.
104 (recording::return_::get_successor_blocks): Likewise.
105 (recording::case_::write_reproducer): New.
106 (recording::case_::make_debug_string): New.
107 (recording::switch_::switch_): New.
108 (recording::switch_::replay_into): New.
109 (recording::switch_::get_successor_blocks): New.
110 (recording::switch_::make_debug_string): New.
111 (recording::switch_::write_reproducer): New.
112 * jit-recording.h: Within namespace gcc::jit::recording...
113 (context::new_case): New.
114 (rvalue::is_constant): New.
115 (rvalue::get_wide_int): New.
116 (block::end_with_switch): New.
117 (block::get_successor_blocks): Update to support an arbitrary
118 number of successor blocks.
119 (memento_of_new_rvalue_from_const::is_constant): New.
120 (memento_of_new_rvalue_from_const::get_wide_int): New.
121 (statement::get_successor_blocks): Update to support an arbitrary
122 number of successor blocks.
123 (conditional::get_successor_blocks): Likewise.
124 (jump::get_successor_blocks): Likewise.
125 (return_::get_successor_blocks): Likewise.
126 (case_): New subclass of memento.
127 (switch_): New subclass of statement.
128 * libgccjit++.h (gccjit::case_): New subclass of gccjit::object.
129 (gccjit::context::new_case): New method.
130 (gccjit::block::end_with_switch): New method.
131 (gccjit::case_::case): New ctors.
132 (gccjit::case_::get_inner_case): New method.
133 * libgccjit.c: Include "typed-splay-tree.h"
134 (struct gcc_jit_case): New.
135 (gcc_jit_context_new_case): New function.
136 (gcc_jit_case_as_object): New function.
137 (valid_dest_for_switch): New function.
138 (valid_case_for_switch): New function.
139 (class api_call_validator): New class.
140 (class case_range_validator): New class.
141 (case_range_validator::case_range_validator): New.
142 (case_range_validator::validate): New.
143 (case_range_validator::case_compare): New.
144 (case_range_validator::get_wide_int): new.
145 (gcc_jit_block_end_with_switch): New.
146 * libgccjit.h: Add gcc_jit_case to class hierarchy comment.
147 (gcc_jit_case): New typedef.
148 (gcc_jit_context_new_case): New function.
149 (gcc_jit_case_as_object): New function.
150 (gcc_jit_block_end_with_switch): New function.
151 (LIBGCCJIT_HAVE_SWITCH_STATEMENTS): New.
152 * libgccjit.map: Add gcc_jit_block_end_with_switch,
153 gcc_jit_case_as_object and gcc_jit_context_new_case.
154
6a3603e3
DM
1552015-06-30 David Malcolm <dmalcolm@redhat.com>
156
157 PR jit/66546
158 * docs/cp/topics/contexts.rst
159 (gccjit::context::set_bool_allow_unreachable_blocks): New.
160 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_2): New.
161 * docs/topics/contexts.rst (Options): Add notes discussing the
162 transition from enums to entrypoints for new options.
163 (gcc_jit_context_set_bool_allow_unreachable_blocks): New.
164 * docs/_build/texinfo/libgccjit.texi: Regenerate.
165 * jit-common.h (gcc::jit::inner_bool_option): New enum.
166 * jit-recording.c: Within namespace gcc::jit...
167 (recording::context::context): Handle m_inner_bool_options.
168 (recording::context::set_inner_bool_option): New.
169 (inner_bool_option_reproducer_strings): New.
170 (recording::context::log_all_options): Log the "inner" bool
171 options.
172 (recording::context::log_inner_bool_option): New.
173 (recording::context::dump_reproducer_to_file): Write initializers
174 for "inner" bool options.
175 (recording::function::validate): Don't check for block
176 reachability if INNER_BOOL_OPTION_ALLOW_UNREACHABLE_BLOCKS is set.
177 * jit-recording.h: Within namespace gcc::jit...
178 (recording::context::set_inner_bool_option): New.
179 (recording::context::get_inner_bool_option): New.
180 (recording::context::log_inner_bool_option): New.
181 (recording::context::m_inner_bool_options): New.
182 * libgccjit++.h
183 (gccjit::context::set_bool_allow_unreachable_blocks): New.
184 * libgccjit.c
185 (gcc_jit_context_set_bool_allow_unreachable_blocks): New.
186 * libgccjit.h: Add note about options present in the
187 initial release of libgccjit.
188 (gcc_jit_context_set_bool_allow_unreachable_blocks): New API
189 entrypoint.
190 (LIBGCCJIT_HAVE_gcc_jit_context_set_bool_allow_unreachable_blocks):
191 New macro.
192 * libgccjit.map (LIBGCCJIT_ABI_2): New, containing...
193 (gcc_jit_context_set_bool_allow_unreachable_blocks): ...this new
194 entrypoint.
195
fa22c20d
DM
1962015-06-30 David Malcolm <dmalcolm@redhat.com>
197
198 PR jit/66628
199 * docs/cp/topics/contexts.rst (Additional command-line options):
200 New section.
201 * docs/topics/compatibility.rst: New file.
202 * docs/topics/contexts.rst (Additional command-line options): New
203 section.
204 * docs/topics/index.rst: Add compatibility.rst.
205 * docs/_build/texinfo/libgccjit.texi: Regenerate.
206 * jit-playback.c (make_fake_args): Add call to
207 append_command_line_options.
208 * jit-recording.c: Within namespace gcc::jit...
209 (recording::context::~context): Free the optnames within
210 m_command_line_options.
211 (recording::context::set_bool_option): Likewise.
212 (recording::context::add_command_line_option): New method.
213 (recording::context::append_command_line_options): New method.
214 (recording::context::dump_reproducer_to_file): Add command-line
215 options.
216 * jit-recording.h: Within namespace gcc::jit...
217 (recording::context::add_command_line_option): New method.
218 (recording::context::append_command_line_options): New method.
219 (recording::context::m_command_line_options): New field.
220 * libgccjit++.h (gccjit::context::add_command_line_option): New
221 method.
222 * libgccjit.c (gcc_jit_context_add_command_line_option): New API
223 entrypoint.
224 * libgccjit.h (gcc_jit_context_add_command_line_option): New API
225 entrypoint.
226 (LIBGCCJIT_HAVE_gcc_jit_context_add_command_line_option): New
227 macro.
228 * libgccjit.map: Put existing symbols within LIBGCCJIT_ABI_0; add
229 LIBGCCJIT_ABI_1 and gcc_jit_context_add_command_line_option.
230
a6314e15
DM
2312015-06-30 David Malcolm <dmalcolm@redhat.com>
232
233 * jit-recording.c
234 (gcc::jit::recording::context::dump_reproducer_to_file):
235 Add pragma to generated reproducers to disable -Wunused-variable.
236 Fix handling of NULL string options.
237
adb6d84b
DM
2382015-06-30 David Malcolm <dmalcolm@redhat.com>
239
240 * docs/cp/topics/expressions.rst: Remove stray semicolon.
241 * docs/cp/topics/functions.rst: Remove stray backslash.
242 * docs/_build/texinfo/libgccjit.texi: Regenerate.
243
f0889939
AM
2442015-06-25 Andrew MacLeod <amacleod@redhat.com>
245
246 * dummy-frontend.c: Remove ipa-ref.h and plugin-api.h from include list.
247 * jit-playback.c: Likewise.
248
9cad7a76
AM
2492015-06-25 Andrew Macleod <amacleod@redhat.com>
250
251 * jit-common.h: Don't include alias.h.
252
41571b55
DM
2532015-06-17 David Malcolm <dmalcolm@redhat.com>
254
255 * libgccjit.c (gcc_jit_lvalue_access_field): Verify that the field
256 is for the correct struct.
257 (gcc_jit_rvalue_access_field): Likewise.
258
abb226c9
AM
2592015-06-17 Andrew MacLeod <amacleod@redhat.com>
260
261 * dummy-frontend.c: Do not include input.h, line-map.h or is-a.h.
262 * jit-common.h: Likewise.
263 * jit-playback.c: Likewise.
264
bd93aa1a
DM
2652015-06-16 David Malcolm <dmalcolm@redhat.com>
266
267 PR jit/66539
268 * jit-recording.c: Within namespace gcc::jit::recording::
269 (rvalue::get_debug_string_parens): New function.
270 (binary_op::make_debug_string): Update to mimic C precedence
271 rules.
272 (binary_op_precedence): New array.
273 (binary_op::get_precedence): New function.
274 (comparison::make_debug_string): Update to mimic C precedence
275 rules.
276 (comparison_precedence): New array.
277 (comparison::get_precedence): New function.
278 (cast::make_debug_string): Update to mimic C precedence rules.
279 (call::make_debug_string): Likewise.
280 (call_through_ptr::make_debug_string): Likewise.
281 (array_access::make_debug_string): Likewise.
282 (access_field_of_lvalue::make_debug_string): Likewise.
283 (access_field_rvalue::make_debug_string): Likewise.
284 (dereference_field_rvalue::make_debug_string): Likewise.
285 (dereference_rvalue::make_debug_string): Likewise.
286 (get_address_of_lvalue::make_debug_string): Likewise.
287 * jit-recording.h: Within namespace gcc::jit::recording::
288 (precedence): New enum.
289 (rvalue::rvalue): Initialize field "m_parenthesized_string".
290 (rvalue::get_debug_string_parens): New method.
291 (rvalue::get_precedence): New pure virtual function.
292 (rvalue::m_parenthesized_string): New field.
293 (param::get_precedence): New function.
294 (global::get_precedence): New function.
295 (memento_of_new_rvalue_from_const::get_precedence): New function.
296 (memento_of_new_string_literal::get_precedence): New function.
297 (unary_op::get_precedence): New function.
298 (binary_op::get_precedence): New function.
299 (comparison::get_precedence): New function.
300 (cast::get_precedence): New function.
301 (call::get_precedence): New function.
302 (call_through_ptr::get_precedence): New function.
303 (array_access::get_precedence): New function.
304 (access_field_of_lvalue::get_precedence): New function.
305 (access_field_rvalue::get_precedence): New function.
306 (dereference_field_rvalue::get_precedence): New function.
307 (dereference_rvalue::get_precedence): New function.
308 (get_address_of_lvalue::get_precedence): New function.
309 (local::get_precedence): New function.
310
83c1b80e
MK
3112015-06-09 Matthias Klose <doko@ubuntu.com>
312
313 * Make-lang.in (jit.install-common): Install headers using INSTALL_DATA.
314
13fdf2e2
AM
3152015-06-08 Andrew MacLeod <amacleod@redhat.com>
316
317 * dummy-frontend.c : Adjust include files.
318 * jit-common.h : Likewise.
319 * jit-playback.c : Likewise.
320
e4753451
DM
3212015-06-05 David Malcolm <dmalcolm@redhat.com>
322
323 * dummy-frontend.c
324 (jit_langhook_post_compilation_parsing_cleanups): Remove.
325 (LANG_HOOKS_POST_COMPILATION_PARSING_CLEANUPS): Remove
326 * jit-playback.c (gcc::jit::playback::context::new_global): Add
327 call to varpool_node::finalize_decl.
328 (gcc::jit::playback::context::finalize_global_decls): Remove.
329 * jit-playback.h
330 (gcc::jit::playback::context::finalize_global_decls): Remove.
331
e7547bc6
DM
3322015-06-05 David Malcolm <dmalcolm@redhat.com>
333
334 * dummy-frontend.c (jit_langhook_write_globals): Rename to...
335 (jit_langhook_post_compilation_parsing_cleanups): ...this, and
336 eliminate calls to finalize_compilation_unit and
337 write_global_decls_2.
338 (LANG_HOOKS_WRITE_GLOBALS): Rename to...
339 (LANG_HOOKS_POST_COMPILATION_PARSING_CLEANUPS): ...this and
340 redirect from jit_langhook_write_globals to
341 jit_langhook_post_compilation_parsing_cleanups.
342 * jit-playback.c
343 (gcc::jit::playback::context::write_global_decls_1): Rename to...
344 (gcc::jit::playback::context::finalize_global_decls): ...this.
345 (gcc::jit::playback::context::write_global_decls_1): Delete.
346 * jit-playback.h
347 (gcc::jit::playback::context::write_global_decls_1): Rename to...
348 (gcc::jit::playback::context::finalize_global_decls): ...this.
349 (gcc::jit::playback::context::write_global_decls_1): Delete.
350
ecb9f223
AM
3512015-06-04 Andrew MacLeod <amacleod@redhat.com>
352
353 * dummy-frontend.c: Adjust includes for restructured coretypes.h.
354 * jit-common.h: Likewise.
355 * jit-playback.c: Likewise.
356
2637afb7
DM
3572015-05-12 David Malcolm <dmalcolm@redhat.com>
358
359 * jit-builtins.c: Include vec.h before target.h.
360
46bf0b0a
JW
3612015-04-27 Jim Wilson <jim.wilson@linaro.org>
362
363 * Make-lang.in (jit.mostlyclean): Remove shared libraries and object
364 files.
365
51c5c6b5
DM
3662015-04-09 David Malcolm <dmalcolm@redhat.com>
367
368 PR jit/65691
369 * docs/cp/topics/expressions.rst (Simple expressions): Fix copy
370 and paste error in description of gccjit::context::one.
371 * docs/topics/expressions.rst (Simple expressions): Likewise in
372 description of gcc_jit_context_one.
373 * docs/_build/texinfo/libgccjit.texi: Regenerate.
374
f40fd895
UB
3752015-03-13 Uros Bizjak <ubizjak@gmail.com>
376
377 * jit-recording.c (dump::write): Also check vasprintf return value.
378 (recording::context::add_error_va): Ditto.
379 (recording::string::from_printf): Ditto.
380
18eb0d13
DM
3812015-03-13 David Malcolm <dmalcolm@redhat.com>
382
383 * docs/internals/index.rst (Packaging notes): New section.
384 * docs/_build/texinfo/libgccjit.texi: Regenerate.
385
7ef96183
DM
3862015-03-05 David Malcolm <dmalcolm@redhat.com>
387
388 * docs/cp/intro/tutorial03.rst: Add missing arguments to
389 gccjit::block::end_with_conditional call. Add on_true/on_false
390 comments. Tweak the wording.
391 * docs/intro/tutorial03.rst: Add missing arguments to
392 gcc_jit_block_end_with_conditional call. Add some clarifying
393 comments.
394 * docs/topics/compilation.rst: Tweak the wording to avoid an
395 ambiguous use of "this".
396 * docs/topics/contexts.rst: Fix a typo.
397 * docs/topics/expressions.rst (GCC_JIT_BINARY_OP_MINUS): Remove
398 a stray backtick.
399 * docs/_build/texinfo/libgccjit.texi: Regenerate.
400
56a9f6bc
TS
4012015-02-24 Thomas Schwinge <thomas@codesourcery.com>
402
403 PR libgomp/64625
404 * jit-builtins.c (DEF_FUNCTION_TYPE_VAR_8)
405 (DEF_FUNCTION_TYPE_VAR_12): Remove macros.
406 (DEF_FUNCTION_TYPE_VAR_7, DEF_FUNCTION_TYPE_VAR_11): New macros.
407 * jit-builtins.h (DEF_FUNCTION_TYPE_VAR_8)
408 (DEF_FUNCTION_TYPE_VAR_12): Remove macros.
409 (DEF_FUNCTION_TYPE_VAR_7, DEF_FUNCTION_TYPE_VAR_11): New macros.
410
a4be4e91
DM
4112015-02-04 David Malcolm <dmalcolm@redhat.com>
412
413 PR jit/64257
414 * docs/conf.py (html_theme): Change from 'pyramid'
415 to 'sphinxdoc'.
416
f435bff3
DM
4172015-02-04 David Malcolm <dmalcolm@redhat.com>
418
419 * docs/topics/contexts.rst (gcc_jit_context_acquire): Fix
420 typo.
421 * docs/_build/texinfo/libgccjit.texi: Regenerate.
422
0ed4f017
DM
4232015-02-03 David Malcolm <dmalcolm@redhat.com>
424
425 * jit-logging.h (gcc::jit::log_user::log): Make const.
426 * jit-recording.c (gcc::jit::recording::context::set_str_option):
427 Log the new value of the option.
428 (gcc::jit::recording::context::set_int_option): Likewise.
429 (gcc::jit::recording::context::set_bool_option): Likewise.
430 (gcc::jit::recording::context::compile): Log the value of all
431 options.
432 (gcc::jit::recording::context::compile_to_file): Likewise.
433 (gcc::jit::recording::context::log_all_options): New function.
434 (gcc::jit::recording::context::log_str_option): New function.
435 (gcc::jit::recording::context::log_int_option): New function.
436 (gcc::jit::recording::context::log_bool_option): New function.
437 * jit-recording.h (gcc::jit::recording::context::log_all_options):
438 New function.
439 (gcc::jit::recording::context::log_str_option): New function.
440 (gcc::jit::recording::context::log_int_option): New function.
441 (gcc::jit::recording::context::log_bool_option): New function.
442 * docs/internals/test-hello-world.exe.log.txt: Update for above
443 changes.
444 * docs/_build/texinfo/libgccjit.texi: Regenerate.
445
2cb844ce
DM
4462015-02-03 David Malcolm <dmalcolm@redhat.com>
447
448 PR jit/64810
449 * Make-lang.in (jit_OBJS): Add jit/jit-spec.o and gcc.o.
450 (LIBGCCJIT_FILENAME): Add EXTRA_GCC_OBJS.
451 * jit-playback.c: Include gcc.h.
452 (gcc::jit::playback::context::compile): Move mutex acquisition
453 to before the call to make_fake_args.
454 (append_arg_from_driver): New function.
455 (gcc::jit::playback::context::make_fake_args): On the first call,
456 call into driver_get_configure_time_options to get configure-time
457 default options and cache them. Add them to the args for
458 toplev::main.
459 * jit-spec.c: New source file.
460 * docs/internals/test-hello-world.exe.log.txt: Update to reflect
461 above changes.
462 * docs/_build/texinfo/libgccjit.texi: Regenerate.
463
16a71c50
DM
4642015-02-02 David Malcolm <dmalcolm@redhat.com>
465
466 PR jit/64810
467 * dummy-frontend.c (jit_langhook_type_for_mode): Support
468 TYPE_MODE (long_long_integer_type_node).
469
53c04ec9
DM
4702015-01-27 David Malcolm <dmalcolm@redhat.com>
471
472 * docs/internals/test-hello-world.exe.log.txt: Add example version
473 lines.
474 * docs/_build/texinfo/libgccjit.texi: Regenerate.
475 * jit-common.h (gcc::jit::dump::get_file): New accessor.
476 * jit-logging.c: Include toplev.h.
477 (gcc::jit::logger::logger): Log the GCC version.
478 * jit-recording.c: Include toplev.h.
479 (gcc:jit::recording::context::dump_reproducer_to_file): Log the
480 GCC version.
481
dc44ee3a
DM
4822015-01-26 David Malcolm <dmalcolm@redhat.com>
483
484 * docs/topics/compilation.rst (gcc_jit_result_get_code): Fix typo.
485 * docs/topics/contexts.rst (gcc_jit_context_get_last_error): The
486 error buffer is only valid until the next call to the context.
487 * docs/_build/texinfo/libgccjit.texi: Regenerate.
488 * libgccjit.h (gcc_jit_context_get_first_error): Reword the
489 comment to omit mention of compiling.
490 (gcc_jit_context_get_last_error): The error buffer is only valid
491 until the next call to the context.
492
3349605d
DM
4932015-01-26 David Malcolm <dmalcolm@redhat.com>
494
495 PR jit/64708
496 * config-lang.in (compilers): Drop "libgccjit.so".
497
6fc2d0f3
DM
4982015-01-23 David Malcolm <dmalcolm@redhat.com>
499
500 PR jit/64721
501 * jit-playback.c (gcc::jit::playback::context::compile): Construct
502 toplev instances with init_signals=false.
503
fdce7209
DM
5042015-01-19 David Malcolm <dmalcolm@redhat.com>
505
506 * docs/cp/topics/results.rst: Rename to...
507 * docs/cp/topics/compilation.rst: ...this, and add section on
508 ahead-of-time compilation.
509 * docs/cp/topics/index.rst: Update for renaming of results.rst
510 to compilation.rst.
511 * docs/examples/emit-alphabet.bf: New file, a sample "brainf"
512 script.
513 * docs/examples/tut05-bf.c: New file, implementing a compiler
514 for "brainf".
515 * docs/internals/test-hello-world.exe.log.txt: Update to reflect
516 changes to logger output.
517 * docs/intro/index.rst: Add tutorial05.rst
518 * docs/intro/tutorial05.rst: New file.
519 * docs/topics/results.rst: Rename to...
520 * docs/topics/compilation.rst: ...this, and add section on
521 ahead-of-time compilation.
522 * docs/topics/index.rst: Update for renaming of results.rst to
523 compilation.rst.
524 * docs/_build/texinfo/libgccjit.texi: Regenerate.
525 * jit-playback.c (gcc::jit::playback::context::compile): Convert
526 return type from result * to void. Move the code to convert to
527 dso and dlopen the result to a new pure virtual "postprocess"
528 method.
529 (gcc::jit::playback::compile_to_memory::compile_to_memory): New
530 function.
531 (gcc::jit::playback::compile_to_memory::postprocess): New
532 function, based on playback::context::compile.
533 (gcc::jit::playback::compile_to_file::compile_to_file): New
534 function.
535 (gcc::jit::playback::compile_to_file::postprocess): New function.
536 (gcc::jit::playback::compile_to_file::copy_file): New function.
537 (gcc::jit::playback::context::convert_to_dso): Move internals
538 to...
539 (gcc::jit::playback::context::invoke_driver): New method. Add
540 "-shared" and "-c" options to driver's argv as needed.
541 * jit-playback.h: Include "timevar.h".
542 (gcc::jit::playback::context::compile): Convert return type from
543 result * to void.
544 (gcc::jit::playback::context::postprocess): New pure virtual
545 function, making this an abstract base class.
546 (gcc::jit::playback::context::get_tempdir): New accessor.
547 (gcc::jit::playback::context::invoke_driver): New function.
548 (class gcc::jit::playback::compile_to_memory): New subclass of
549 playback::context.
550 (class gcc::jit::playback::compile_to_file): Likewise.
551 * jit-recording.c (gcc::jit::recording::context::compile): Use a
552 playback::compile_to_memory, and extract its result.
553 (gcc::jit::recording::context::compile_to_file): New function.
554 * jit-recording.h (gcc::jit::recording::context::compile_to_file):
555 New function.
556 * libgccjit++.h (gccjit::context::compile_to_file): New method.
557 * libgccjit.c (gcc_jit_context_compile): Update log message to
558 clarify that this is an in-memory compile.
559 (gcc_jit_context_compile_to_file): New function.
560 * libgccjit.h (gcc_jit_context): Clarify that you can compile
561 a context more than once, and that you can compile to a file
562 as well as to memory.
563 (gcc_jit_result): Clarify that this is the result of an
564 in-memory compilation.
565 (gcc_jit_context_compile): Clarify that you can compile, and that
566 this is an in-memory compilation.
567 (enum gcc_jit_output_kind): New enum.
568 (gcc_jit_context_compile_to_file): New function.
569 (gcc_jit_context_enable_dump): Clarify comment to cover both forms
570 of compilation.
571 * libgccjit.map (gcc_jit_context_compile_to_file): New API
572 entrypoint.
573 * notes.txt: Update to show the playback::context::postprocess
574 virtual function.
575
450e225b
DM
5762015-01-19 David Malcolm <dmalcolm@redhat.com>
577
578 * jit-recording.c
579 (gcc::jit::recording::memento_of_new_string_literal::make_debug_string):
580 Add missing format string.
581
499de348
DM
5822015-01-16 David Malcolm <dmalcolm@redhat.com>
583
584 * Make-lang.in (lang_checks_parallelized): Add "check-jit".
585 (check_jit_parallelize): Set this to an arbitrary value (10).
586
e989e68d
JJ
5872015-01-16 Jakub Jelinek <jakub@redhat.com>
588
589 * jit-builtins.h (DEF_FUNCTION_TYPE_VAR_5): Fix spelling of
590 last argument.
591 (DEF_FUNCTION_TYPE_VAR_8, DEF_FUNCTION_TYPE_VAR_12): Define and
592 undef afterwards.
593 * jit-builtins.c (DEF_FUNCTION_TYPE_VAR_8, DEF_FUNCTION_TYPE_VAR_12):
594 Likewise.
595
179ed8f5
RS
5962015-01-15 Richard Sandiford <richard.sandiford@arm.com>
597
598 Update copyright years in docs/.
599
96a87981
DM
6002015-01-15 David Malcolm <dmalcolm@redhat.com>
601
602 * libgccjit.c (gcc_jit_block_add_assignment_op): Check that the
603 lvalue and the rvalue are of compatible type.
604
86d0ac88
DM
6052015-01-13 David Malcolm <dmalcolm@redhat.com>
606
607 * docs/cp/topics/contexts.rst (Debugging): Add
608 gccjit::context::dump_reproducer_to_file.
609 * docs/internals/index.rst (Design notes): New section,
610 discussing input validation and
611 gcc_jit_context_dump_reproducer_to_file.
612 * docs/topics/contexts.rst (Debugging): Add
613 gcc_jit_context_dump_reproducer_to_file.
614 * docs/_build/texinfo/libgccjit.texi: Regenerate.
615 * jit-common.h (gcc::jit::dump::get_context): New accessor.
616 * jit-recording.c: Include "hash-map.h".
617 Within namespace ::gcc::jit...
618 (dump::write): Flush each line.
619 (dump::make_location): Pass false for new param "created_by_user".
620 (class allocator): New class.
621 (allocator::~allocator): New function.
622 (allocator::xstrdup_printf): New function.
623 (allocator::xstrdup_printf_va): New function.
624 (class reproducer): New subclass of dump.
625 (reproducer::reproducer): New function.
626 (reproducer::write_params): New function.
627 (reproducer::write_args): New function.
628 (reproducer::make_identifier): New function.
629 (reproducer::make_tmp_identifier): New function.
630 (reproducer::get_identifier): New pair of functions.
631 (reproducer::get_identifier_as_rvalue): New function.
632 (reproducer::get_identifier_as_lvalue): New function.
633 (reproducer::get_identifier_as_type): New function.
634 (reproducer::xstrdup_printf): New function.
635 (recording::context::context): Initialize m_toplevel_ctxt.
636 (recording::context::new_location): Add param created_by_user.
637 (str_option_reproducer_strings): New table of strings.
638 (int_option_reproducer_strings): Likewise.
639 (bool_option_reproducer_strings): Likewise.
640 (get_type_enum_strings): Likewise.
641 (names_of_function_kinds): Likewise.
642 (global_kind_reproducer_strings): Likewise.
643 (unary_op_reproducer_strings): Likewise.
644 (binary_op_reproducer_strings): Likewise.
645 (comparison_reproducer_strings): Likewise.
646 Within namespace ::gcc::jit::recording::...
647 (context::dump_reproducer_to_file): New function.
648 (string::write_reproducer): Likewise.
649 (location::write_reproducer): Likewise.
650 (type::access_as_type): Likewise.
651 (memento_of_get_type::write_reproducer): Likewise.
652 (memento_of_get_pointer::write_reproducer): Likewise.
653 (memento_of_get_const::write_reproducer): Likewise.
654 (memento_of_get_volatile::write_reproducer): Likewise.
655 (array_type::write_reproducer): Likewise.
656 (function_type::write_reproducer): Likewise.
657 (function_type::write_deferred_reproducer): Likewise.
658 (field::write_reproducer): Likewise.
659 (struct_::access_as_type): Likewise.
660 (struct_::write_reproducer): Likewise.
661 (union_::write_reproducer): Likewise.
662 (fields::write_reproducer): Likewise.
663 (rvalue::access_as_rvalue): Likewise.
664 (lvalue::access_as_rvalue): Likewise.
665 (lvalue::access_as_lvalue): Likewise.
666 (param::access_as_rvalue): Likewise.
667 (param::access_as_lvalue): Likewise.
668 (param::write_reproducer): Likewise.
669 (function::write_reproducer): Likewise.
670 (block::write_reproducer): Likewise.
671 (global::write_reproducer): Likewise.
672 (memento_of_new_rvalue_from_const <int>::write_reproducer):
673 Likewise.
674 (memento_of_new_rvalue_from_const <long>::write_reproducer):
675 Likewise.
676 (memento_of_new_rvalue_from_const <double>::write_reproducer):
677 Likewise.
678 (memento_of_new_rvalue_from_const <void *>::write_reproducer):
679 Likewise.
680 (memento_of_new_string_literal::write_reproducer): Likewise.
681 (unary_op::write_reproducer): Likewise.
682 (binary_op::write_reproducer): Likewise.
683 (comparison::write_reproducer): Likewise.
684 (cast::write_reproducer): Likewise.
685 (call::write_reproducer): Likewise.
686 (call_through_ptr::write_reproducer): Likewise.
687 (array_access::write_reproducer): Likewise.
688 (access_field_of_lvalue::write_reproducer): Likewise.
689 (access_field_rvalue::write_reproducer): Likewise.
690 (dereference_field_rvalue::write_reproducer): Likewise.
691 (dereference_rvalue::write_reproducer): Likewise.
692 (get_address_of_lvalue::write_reproducer): Likewise.
693 (local::write_reproducer): Likewise.
694 (eval::write_reproducer): Likewise.
695 (assignment::write_reproducer): Likewise.
696 (assignment_op::write_reproducer): Likewise.
697 (comment::write_reproducer): Likewise.
698 (conditional::write_reproducer): Likewise.
699 (jump::write_reproducer): Likewise.
700 (return_::write_reproducer): Likewise.
701 * jit-recording.h (gcc::jit::reproducer): New forward declararion.
702 Within namespace ::gcc::jit::recording::...
703 (context::new_location): Add "created_by_user" param.
704 (context::dump_reproducer_to_file): New method.
705 (context::m_toplevel_ctxt): New field.
706 (memento::write_reproducer): New pure virtual function.
707 (memento::dyn_cast_location): New virtual function.
708 (string::write_reproducer):
709 (location::location): Add "created_by_user" param.
710 (location::dyn_cast_location): New function.
711 (location::created_by_user): New accessor.
712 (location::write_reproducer): New function.
713 (location::m_created_by_user): New field.
714 (type::access_as_type): New virtual function.
715 (location::write_reproducer): Likewise.
716 (type::access_as_type): Likewise.
717 (memento_of_get_type::write_reproducer): Likewise.
718 (memento_of_get_pointer::write_reproducer): Likewise.
719 (memento_of_get_const::write_reproducer): Likewise.
720 (memento_of_get_volatile::write_reproducer): Likewise.
721 (array_type::write_reproducer): Likewise.
722 (function_type::write_reproducer): Likewise.
723 (function_type::write_deferred_reproducer): Likewise.
724 (field::write_reproducer): Likewise.
725 (struct_::access_as_type): Likewise.
726 (struct_::write_reproducer): Likewise.
727 (union_::write_reproducer): Likewise.
728 (union_::m_fields): Remove stray unused field.
729 (fields::length): New accessor.
730 (fields::get_field): New accessor.
731 (fields::write_reproducer): New function.
732 (rvalue::access_as_rvalue): Likewise.
733 (lvalue::access_as_rvalue): Likewise.
734 (lvalue::access_as_lvalue): Likewise.
735 (param::access_as_rvalue): Likewise.
736 (param::access_as_lvalue): Likewise.
737 (param::write_reproducer): Likewise.
738 (function::write_reproducer): Likewise.
739 (block::write_reproducer): Likewise.
740 (global::write_reproducer): Likewise.
741 (memento_of_new_rvalue_from_const <HOST_TYPE>::write_reproducer):
742 Likewise.
743 (memento_of_new_string_literal::write_reproducer): Likewise.
744 (unary_op::write_reproducer): Likewise.
745 (binary_op::write_reproducer): Likewise.
746 (comparison::write_reproducer): Likewise.
747 (cast::write_reproducer): Likewise.
748 (call::write_reproducer): Likewise.
749 (call_through_ptr::write_reproducer): Likewise.
750 (array_access::write_reproducer): Likewise.
751 (access_field_of_lvalue::write_reproducer): Likewise.
752 (access_field_rvalue::write_reproducer): Likewise.
753 (dereference_field_rvalue::write_reproducer): Likewise.
754 (dereference_rvalue::write_reproducer): Likewise.
755 (get_address_of_lvalue::write_reproducer): Likewise.
756 (local::write_reproducer): Likewise.
757 (eval::write_reproducer): Likewise.
758 (assignment::write_reproducer): Likewise.
759 (assignment_op::write_reproducer): Likewise.
760 (comment::write_reproducer): Likewise.
761 (conditional::write_reproducer): Likewise.
762 (jump::write_reproducer): Likewise.
763 (return_::write_reproducer): Likewise.
764 * libgccjit++.h (gccjit::context::dump_reproducer_to_file): New.
765 * libgccjit.c (gcc_jit_context_new_location): Pass "true" as
766 param "created_by_user".
767 (gcc_jit_context_dump_reproducer_to_file): New API entrypoint.
768 * libgccjit.h (gcc_jit_context_dump_reproducer_to_file): New API
769 entrypoint.
770 * libgccjit.map (gcc_jit_context_dump_reproducer_to_file): New API
771 entrypoint.
772
f6f2b019
DM
7732015-01-12 David Malcolm <dmalcolm@redhat.com>
774
775 * jit-recording.c (class gcc::jit::rvalue_usage_validator): New.
776 (gcc::jit::rvalue_usage_validator::rvalue_usage_validator): New
777 ctor.
778 (gcc::jit::rvalue_usage_validator::visit): New function.
779 (gcc::jit::recording::rvalue::verify_valid_within_stmt): New
780 function.
781 (gcc::jit::recording::rvalue::set_scope): New function.
782 (gcc::jit::recording::function::function): Call set_scope on each
783 param, issuing errors for any params that already have a function.
784 (gcc::jit::recording::block::add_eval): Return the new statement;
785 update the comment given that some error-checking now happens after
786 this returns.
787 (gcc::jit::recording::block::add_assignment): Likewise.
788 (gcc::jit::recording::block::add_assignment_op): Likewise.
789 (gcc::jit::recording::block::add_comment): Likewise.
790 (gcc::jit::recording::block::end_with_conditional): Likewise.
791 (gcc::jit::recording::block::end_with_jump): Likewise.
792 (gcc::jit::recording::block::end_with_return): Likewise.
793 (gcc::jit::recording::block::validate): Add a comment.
794 (gcc::jit::recording::unary_op::visit_children): New function.
795 (gcc::jit::recording::binary_op::visit_children): New function.
796 (gcc::jit::recording::comparison::visit_children): New function.
797 (gcc::jit::recording::cast::visit_children): New function.
798 (gcc::jit::recording::call::visit_children): New function.
799 (gcc::jit::recording::call_through_ptr::visit_children): New function.
800 (gcc::jit::recording::array_access::visit_children): New function.
801 (gcc::jit::recording::access_field_of_lvalue::visit_children): New
802 function.
803 (gcc::jit::recording::access_field_rvalue::visit_children): New
804 function.
805 (gcc::jit::recording::dereference_field_rvalue::visit_children):
806 New function.
807 (gcc::jit::recording::dereference_rvalue::visit_children): New
808 function.
809 (gcc::jit::recording::get_address_of_lvalue::visit_children): New
810 function.
811 * jit-recording.h: Within namespace gcc::jit::recording...
812 (class rvalue_visitor): New.
813 (rvalue::rvalue): Initialize m_scope.
814 (rvalue::get_loc): New accessor.
815 (rvalue::verify_valid_within_stmt): New function.
816 (rvalue::visit_children): New pure virtual function.
817 (rvalue::set_scope): New function.
818 (rvalue::get_scope): New function.
819 (rvalue::dyn_cast_param): New function.
820 (rvalue::m_scope): New field.
821 (param::visit_children): New empty function.
822 (param::dyn_cast_param): New function.
823 (function::get_loc): New function.
824 (block::add_eval): Return the new statement.
825 (block::add_assignment): Likewise.
826 (block::add_assignment_op): Likewise.
827 (block::add_comment): Likewise.
828 (block::end_with_conditional): Likewise.
829 (block::end_with_jump): Likewise.
830 (block::end_with_return): Likewise.
831 (global::visit_children): New function.
832 (memento_of_new_rvalue_from_const<HOST_TYPE>::visit_children):
833 New function.
834 (memento_of_new_string_literal::visit_children): New function.
835 (unary_op::visit_children): New function.
836 (binary_op::visit_children): New function.
837 (comparison::visit_children): New function.
838 (cast::visit_children): New function.
839 (call::visit_children): New function.
840 (call_through_ptr::visit_children): New function.
841 (array_access::visit_children): New function.
842 (access_field_of_lvalue::visit_children): New function.
843 (access_field_rvalue::visit_children): New function.
844 (dereference_field_rvalue::visit_children): New function.
845 (dereference_rvalue::visit_children): New function.
846 (get_address_of_lvalue::visit_children): New function.
847 (local::local): Call set_scope.
848 (local::visit_children): New function.
849 (statement::get_block): Make public.
850 * libgccjit.c (RETURN_VAL_IF_FAIL_PRINTF5): New macro.
851 (RETURN_NULL_IF_FAIL_PRINTF5): New macro.
852 (gcc_jit_context_new_function): Verify that each param has
853 not yet been used for creating another function.
854 (gcc_jit_block_add_eval): After creating the stmt, verify
855 that the rvalue expression tree is valid to use within it.
856 (gcc_jit_block_add_assignment): Likewise for the lvalue and
857 rvalue expression trees.
858 (gcc_jit_block_add_assignment_op): Likewise.
859 (gcc_jit_block_end_with_conditional): Likewise for the boolval
860 expression tree.
861 (gcc_jit_block_end_with_return): Likewise for the rvalue
862 expression tree.
863 (gcc_jit_block_end_with_void_return): Remove return of "void",
864 now that block::end_with_return is now non-void.
865
1c35cc2c
DM
8662015-01-12 David Malcolm <dmalcolm@redhat.com>
867
868 * jit-playback.c (gcc::jit::playback::context::read_dump_file):
869 Add missing fclose on error-handling path.
870
791cfef8
DM
8712015-01-12 David Malcolm <dmalcolm@redhat.com>
872
873 * docs/cp/topics/expressions.rst (Global variables): Add
874 enum gcc_jit_global_kind param to gccjit::context::new_global.
875 * docs/topics/expressions.rst (Global variables): Likewise.
876 Document the new enum.
877 * docs/topics/results.rst (Compilation results): Document
878 globals-handling.
879 * docs/_build/texinfo/libgccjit.texi: Regenerate.
880 * dummy-frontend.c (jit_langhook_write_globals): Call into the
881 playback context's write_global_decls_1 and write_global_decls_2
882 before and after calling symtab->finalize_compilation_unit ().
883 * jit-playback.c: Include "debug.h".
884 (gcc::jit::playback::context::new_global): Add "kind" param and
885 use it to set TREE_PUBLIC, TREE_STATIC and DECL_EXTERNAL on the
886 underlying VAR_DECL. Call varpool_node::get_create on the
887 VAR_DECL, and add it to m_globals.
888 (gcc::jit::playback::context::write_global_decls_1): New function.
889 (gcc::jit::playback::context::write_global_decls_2): New function.
890 * jit-playback.h (gcc::jit::playback::context::context): Call
891 create on m_globals.
892 (gcc::jit::playback::context::new_global): Add "kind" param.
893 (gcc::jit::playback::context::write_global_decls_1): New function.
894 (gcc::jit::playback::context::write_global_decls_2): New function.
895 (gcc::jit::playback::context::m_globals): New field.
896 * jit-recording.c (gcc::jit::recording::context::context):
897 Initialize m_globals.
898 (gcc::jit::recording::context::new_global): Add param "kind".
899 Add the new global to m_globals.
900 (gcc::jit::recording::context::dump_to_file): Dump the globals.
901 (gcc::jit::recording::global::replay_into): Add field m_kind.
902 (gcc::jit::recording::global::write_to_dump): New override.
903 * jit-recording.h (gcc::jit::recording::context::new_global): Add
904 param "kind".
905 (gcc::jit::recording::context::m_globals): New field.
906 (gcc::jit::recording::global::global): Add param kind.
907 (gcc::jit::recording::global::write_to_dump): New override.
908 (gcc::jit::recording::global::m_kind): New field.
909 * jit-result.c (gcc::jit::result::get_global): New function.
910 * jit-result.h (gcc::jit::result::get_global): New function.
911 * libgccjit++.h (gccjit::context::new_global): Add "kind" param.
912 * libgccjit.c (gcc_jit_context_new_global): Likewise.
913 (gcc_jit_result_get_global): New API entrypoint.
914 * libgccjit.h (gcc_jit_result_get_global): New API entrypoint.
915 (enum gcc_jit_global_kind): New enum.
916 (gcc_jit_context_new_global): API change: add "kind" param.
917 * libgccjit.map (gcc_jit_result_get_global): New symbol.
918
860e981c
DM
9192015-01-09 David Malcolm <dmalcolm@redhat.com>
920
921 * dummy-frontend.c: Include "fixed-value.h", "alias.h", "flags.h",
922 "symtab.h", "inchash.h". Move include of "hash-set.h" much
923 earlier.
924 * jit-builtins.c: Remove redundant includes of "opts.h" and
925 "tree.h".
926 * jit-common.h: Include "hash-set.h", "input.h", "vec.h",
927 "double-int.h", "alias.h", "flags.h", "symtab.h", "inchash.h".
928 * jit-playback.c: Include "hashtab.h", "machmode.h", "input.h",
929 "statistics.h", "vec.h", "double-int.h", "real.h",
930 "fixed-value.h", "alias.h", "flags.h", "symtab.h", "tree-core.h",
931 "inchash.h", "fold-const.h". Move include of "hash-set.h" to
932 earlier.
933 * jit-recording.c: Remove redundant includes of "opts.h" and
934 "tree.h".
935
ccce3b2a
DM
9362015-01-09 David Malcolm <dmalcolm@redhat.com>
937
938 * docs/cp/topics/expressions.rst (Simple expressions): Use
939 ":c:type:" for C types. Document new overload of
940 gcc::jit::context::new_rvalue.
941 * docs/topics/expressions.rst (Simple expressions): Use
942 ":c:type:" for C types. Document new entrypoint
943 gcc_jit_context_new_rvalue_from_long.
944 * docs/_build/texinfo/libgccjit.texi: Regenerate.
945 * jit-playback.c: Within namespace gcc::jit::playback...
946 (context::new_rvalue_from_int): Eliminate in favor of...
947 (context::new_rvalue_from_const <int>): ...this.
948 (context::new_rvalue_from_double): Eliminate in favor of...
949 (context::new_rvalue_from_const <double>): ...this.
950 (context::new_rvalue_from_const <long>): New.
951 (context::new_rvalue_from_ptr): Eliminate in favor of...
952 (context::new_rvalue_from_const <void *>): ...this.
953 * jit-playback.h: Within namespace gcc::jit::playback...
954 (context::new_rvalue_from_int): Eliminate in favor of...
955 (context::new_rvalue_from_const <HOST_TYPE>): ...this.
956 (context::new_rvalue_from_double): Likewise.
957 (context::new_rvalue_from_ptr): Likewise.
958 * jit-recording.c: Within namespace gcc::jit::recording...
959 (context::new_rvalue_from_int): Eliminate.
960 (context::new_rvalue_from_double): Likewise.
961 (context::new_rvalue_from_ptr): Likewise.
962 (class memento_of_new_rvalue_from_const <int>):
963 Add explicit specialization.
964 (class memento_of_new_rvalue_from_const <long>):
965 Likewise.
966 (class memento_of_new_rvalue_from_const <double>):
967 Likewise.
968 (class memento_of_new_rvalue_from_const <void *>):
969 Likewise.
970 (memento_of_new_rvalue_from_int::replay_into):
971 Generalize into...
972 (memento_of_new_rvalue_from_const <HOST_TYPE>::replay_into):
973 ...this...
974 (memento_of_new_rvalue_from_double::replay_into):
975 ...allowing this...
976 (memento_of_new_rvalue_from_ptr::replay_into):
977 ...and this to be deleted.
978 (memento_of_new_rvalue_from_int::make_debug_string):
979 Convert to...
980 (memento_of_new_rvalue_from_const <int>::make_debug_string):
981 ...this.
982 (memento_of_new_rvalue_from_double::make_debug_string):
983 Convert to...
984 (memento_of_new_rvalue_from_const <double>::make_debug_string):
985 ...this.
986 (memento_of_new_rvalue_from_ptr::make_debug_string)
987 Convert to...
988 (memento_of_new_rvalue_from_const <void *>::make_debug_string):
989 ...this.
990 (memento_of_new_rvalue_from_const <long>::make_debug_string):
991 New function.
992 * jit-recording.h: Within namespace gcc::jit::recording...
993 (context::new_rvalue_from_int): Eliminate.
994 (context::new_rvalue_from_double): Likewise.
995 (context::new_rvalue_from_ptr): Likewise, all in favor of...
996 (context::new_rvalue_from_const <HOST_TYPE>): New family of
997 methods.
998 (class memento_of_new_rvalue_from_int): Eliminate.
999 (class memento_of_new_rvalue_from_double): Likewise.
1000 (class memento_of_new_rvalue_from_ptr): Likewise.
1001 (class memento_of_new_rvalue_from_const <HOST_TYPE>): New family
1002 of rvalue subclasses.
1003 * libgccjit++.h (gccjit::context::new_rvalue): New overload, for
1004 "long".
1005 * libgccjit.c (gcc_jit_context_new_rvalue_from_int): Update for
1006 rewriting of recording::context::new_rvalue_from_int to
1007 recording::context::new_rvalue_from_const <int>.
1008 (gcc_jit_context_new_rvalue_from_long): New API entrypoint.
1009 (gcc_jit_context_new_rvalue_from_double): Update for
1010 rewriting of recording::context::new_rvalue_from_double to
1011 recording::context::new_rvalue_from_const <double>.
1012 (gcc_jit_context_new_rvalue_from_ptr): Update for
1013 rewriting of recording::context::new_rvalue_from_ptr to
1014 recording::context::new_rvalue_from_const <void *>.
1015 * libgccjit.h (gcc_jit_context_new_rvalue_from_long): New API
1016 entrypoint.
1017 * libgccjit.map (gcc_jit_context_new_rvalue_from_long): Likewise.
1018
d2286af3
DM
10192015-01-09 David Malcolm <dmalcolm@redhat.com>
1020
1021 PR jit/64206
1022 * docs/internals/test-hello-world.exe.log.txt: Update, the log now
1023 shows tempdir creation/cleanup.
1024 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1025 * jit-logging.h (class gcc::jit::log_user): Add gcc::jit::tempdir
1026 to the list of subclasses in the comment.
1027 * jit-playback.c (gcc::jit::playback::context::context): Add a
1028 comment clarifying when the tempdir gets cleaned up.
1029 (gcc::jit::playback::context::compile): Pass the context's logger,
1030 if any, to the tempdir.
1031 (gcc::jit::playback::context::dlopen_built_dso): When creating the
1032 gcc::jit::result, if GCC_JIT_BOOL_OPTION_DEBUGINFO is set, hand
1033 over ownership of the tempdir to it.
1034 * jit-result.c: Include "jit-tempdir.h".
1035 (gcc::jit::result::result): Add tempdir param, saving it as
1036 m_tempdir.
1037 (gcc::jit::result::~result): Delete m_tempdir.
1038 * jit-result.h (gcc::jit::result::result): Add tempdir param.
1039 (gcc::jit::result::m_tempdir): New field.
1040 * jit-tempdir.c (gcc::jit::tempdir::tempdir): Add logger param;
1041 add JIT_LOG_SCOPE.
1042 (gcc::jit::tempdir::create): Add JIT_LOG_SCOPE to log entry/exit,
1043 and log m_path_template and m_path_tempdir.
1044 (gcc::jit::tempdir::~tempdir): Add JIT_LOG_SCOPE to log
1045 entry/exit, and log the unlink and rmdir calls.
1046 * jit-tempdir.h: Include "jit-logging.h".
1047 (class gcc::jit::tempdir): Make this be a subclass of log_user.
1048 (gcc::jit::tempdir::tempdir): Add logger param.
1049 * notes.txt: Update to show the two possible places where the
1050 tempdir can be cleaned up.
1051
7c8db13e
DM
10522015-01-08 David Malcolm <dmalcolm@redhat.com>
1053
1054 * libgccjit.h (struct gcc_jit_context): Rewrite the descriptive
1055 comment.
1056
303e1d56
DM
10572015-01-08 David Malcolm <dmalcolm@redhat.com>
1058
1059 * docs/topics/contexts.rst (Error-handling): Document new
1060 entrypoint gcc_jit_context_get_last_error.
1061 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1062 * jit-recording.c (gcc::jit::recording::context::context):
1063 Initialize new fields "m_last_error_str" and
1064 "m_owns_last_error_str".
1065 (gcc::jit::recording::context::~context): Clean up
1066 m_last_error_str, if needed.
1067 (gcc::jit::recording::context::add_error_va): Update
1068 m_last_error_str and m_owns_last_error_str, freeing the old
1069 value if appropriate.
1070 (gcc::jit::recording::context::get_last_error): New function.
1071 * jit-recording.h (gcc::jit::recording::context::get_last_error):
1072 New function.
1073 (gcc::jit::recording::context): New fields m_last_error_str and
1074 m_owns_last_error_str.
1075 * libgccjit.c (gcc_jit_context_get_last_error): New function.
1076 * libgccjit.h (gcc_jit_context_get_last_error): New declaration.
1077 * libgccjit.map (gcc_jit_context_get_last_error): New function.
1078
eb4c16eb
DM
10792015-01-08 David Malcolm <dmalcolm@redhat.com>
1080
1081 * Make-lang.in (jit_OBJS): Add jit/jit-logging.o.
1082 * docs/internals/index.rst (Overview of code structure): Mention
1083 gcc_jit_context_set_logfile, and embed the example logfile.
1084 * docs/internals/test-hello-world.exe.log.txt: New file: example
1085 of a logfile.
1086 * docs/topics/contexts.rst (Debugging): Add documentation
1087 for gcc_jit_context_set_logfile.
1088 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1089 * dummy-frontend.c: Include "jit-logging.h".
1090 (jit_langhook_init): Assert that there is an active playback
1091 context. If it has a logger, log entry/exit to this function.
1092 (jit_langhook_write_globals): Likewise.
1093 * jit-common.h (gcc::jit::logger): New forward declaration.
1094 * jit-logging.c: New file.
1095 * jit-logging.h: New file.
1096 * jit-playback.c: Include "jit-logging.h".
1097 (gcc::jit::playback::context::context): Initialize the log_user
1098 base class from the recording context's logger (if any). Use
1099 JIT_LOG_SCOPE to log entry/exit from the function body.
1100 (gcc::jit::playback::context::~context): Use JIT_LOG_SCOPE to
1101 log entry/exit from the function body.
1102 (gcc::jit::playback::build_stmt_list): Likewise.
1103 (gcc::jit::playback::function::postprocess): Likewise.
1104 (gcc::jit::playback::context::compile): Likewise. Log the
1105 entry/exit to toplev::main and toplev::finalize. Log the
1106 fake argv passed to toplev::main.
1107 (gcc::jit::playback::context::acquire_mutex): Use JIT_LOG_SCOPE to
1108 log entry/exit from the function body.
1109 (gcc::jit::playback::context::release_mutex): Likewise.
1110 (gcc::jit::playback::context::make_fake_args): Likewise.
1111 (gcc::jit::playback::context::extract_any_requested_dumps):
1112 Likewise.
1113 (gcc::jit::playback::context::convert_to_dso): Likewise. Also,
1114 log the arguments that the driver is invoked with.
1115 (gcc::jit::playback::context::dlopen_built_dso): Likewise. Pass
1116 the logger to the result object.
1117 (gcc::jit::playback::context::replay): Use JIT_LOG_SCOPE to
1118 log entry/exit from the function body.
1119 (gcc::jit::playback::context::dump_generated_code): Likewise.
1120 (gcc::jit::playback::context::handle_locations): Likewise.
1121 * jit-playback.h (gcc::jit::playback::context): Make this be
1122 a subclass of gcc::jit::log_user.
1123 * jit-recording.c: Include "jit-logging.h".
1124 (gcc::jit::recording::context::context: Initialize the logger to
1125 NULL for root contexts, or to the parent's logger for child
1126 contexts.
1127 (gcc::jit::recording::context::~context): Use JIT_LOG_SCOPE to
1128 log entry/exit from the function body.
1129 (gcc::jit::recording::context::replay_into): Likewise.
1130 (gcc::jit::recording::context::disassociate_from_playback):
1131 Likewise.
1132 (gcc::jit::recording::context::compile): Likewise.
1133 (recording::context::add_error_va): Likewise. Also, log the
1134 error.
1135 (gcc::jit::recording::context::validate): Use JIT_LOG_SCOPE to
1136 log entry/exit from the function body.
1137 * jit-recording.h: Include "jit-logging.h".
1138 (gcc::jit::recording::context): Make this be a subclass of
1139 gcc::jit::log_user.
1140 * jit-result.c: Include "jit-common.h" and "jit-logging.h".
1141 (gcc::jit::result::result): Add logger param, recording it.
1142 Use JIT_LOG_SCOPE to log entry/exit from the function body.
1143 (gcc::jit::result::~result(): Use JIT_LOG_SCOPE to
1144 log entry/exit from the function body.
1145 (gcc::jit::result::get_code): Likewise.
1146 * jit-result.h (gcc::jit::result): Make this be a subclass of
1147 gcc::jit::log_user.
1148 (gcc::jit::result::result): Add logger parameter.
1149 * libgccjit++.h (gccjit::context::set_logfile): New function.
1150 * libgccjit.c: Include "jit-logging.h".
1151 (gcc_jit_context_acquire): Log the context.
1152 (gcc_jit_context_release): Use JIT_LOG_FUNC to
1153 log entry/exit from the function body, and log the context.
1154 (gcc_jit_context_new_child_context): Likewise, logging both
1155 contexts.
1156 (gcc_jit_context_new_location): Use JIT_LOG_FUNC to
1157 log entry/exit from the function body.
1158 (gcc_jit_context_get_type): Likewise.
1159 (gcc_jit_context_get_int_type): Likewise.
1160 (gcc_jit_context_new_array_type): Likewise.
1161 (gcc_jit_context_new_field): Likewise.
1162 (gcc_jit_context_new_struct_type): Likewise.
1163 (gcc_jit_context_new_opaque_struct): Likewise.
1164 (gcc_jit_struct_set_fields): Likewise.
1165 (gcc_jit_context_new_union_type): Likewise.
1166 (gcc_jit_context_new_function_ptr_type): Likewise.
1167 (gcc_jit_context_new_param): Likewise.
1168 (gcc_jit_context_new_function): Likewise.
1169 (gcc_jit_context_get_builtin_function): Likewise.
1170 (gcc_jit_function_get_param): Likewise.
1171 (gcc_jit_function_dump_to_dot): Likewise.
1172 (gcc_jit_function_new_block): Likewise.
1173 (gcc_jit_context_new_global): Likewise.
1174 (gcc_jit_context_new_rvalue_from_int): Likewise.
1175 (gcc_jit_context_zero): Likewise.
1176 (gcc_jit_context_one): Likewise.
1177 (gcc_jit_context_new_rvalue_from_double): Likewise.
1178 (gcc_jit_context_new_rvalue_from_ptr): Likewise.
1179 (gcc_jit_context_null): Likewise.
1180 (gcc_jit_context_new_string_literal): Likewise.
1181 (gcc_jit_context_new_unary_op): Likewise.
1182 (gcc_jit_context_new_binary_op): Likewise.
1183 (gcc_jit_context_new_comparison): Likewise.
1184 (gcc_jit_context_new_call): Likewise.
1185 (gcc_jit_context_new_call_through_ptr): Likewise.
1186 (gcc_jit_context_new_cast): Likewise.
1187 (gcc_jit_context_new_array_access): Likewise.
1188 (gcc_jit_lvalue_access_field): Likewise.
1189 (gcc_jit_rvalue_access_field): Likewise.
1190 (gcc_jit_rvalue_dereference_field): Likewise.
1191 (gcc_jit_rvalue_dereference): Likewise.
1192 (gcc_jit_lvalue_get_address): Likewise.
1193 (gcc_jit_function_new_local): Likewise.
1194 (gcc_jit_block_add_eval): Likewise.
1195 (gcc_jit_block_add_assignment): Likewise.
1196 (gcc_jit_block_add_assignment_op): Likewise.
1197 (gcc_jit_block_end_with_conditional): Likewise.
1198 (gcc_jit_block_add_comment): Likewise.
1199 (gcc_jit_block_end_with_jump): Likewise.
1200 (gcc_jit_block_end_with_return): Likewise.
1201 (gcc_jit_block_end_with_void_return): Likewise.
1202 (gcc_jit_context_set_str_option): Likewise.
1203 (gcc_jit_context_set_int_option): Likewise.
1204 (gcc_jit_context_set_bool_option): Likewise.
1205 (gcc_jit_context_enable_dump): Likewise.
1206 (gcc_jit_context_compile): Likewise. Also log the context,
1207 and the result.
1208 (gcc_jit_context_dump_to_file): Likewise.
1209 (gcc_jit_context_set_logfile): New function.
1210 (gcc_jit_context_get_first_error): Use JIT_LOG_FUNC to
1211 log entry/exit from the function body.
1212 (gcc_jit_result_get_code): Likewise. Also log the fnname)
1213 and the ptr to be returned.
1214 (gcc_jit_result_release): Likewise. Also log the result.
1215 * libgccjit.h: Include <stdio.h>, since we need FILE *.
1216 (gcc_jit_context_set_logfile): New declaration.
1217 * libgccjit.map (gcc_jit_context_set_logfile): New.
1218
c211cd23
DM
12192015-01-07 David Malcolm <dmalcolm@redhat.com>
1220
1221 * jit-recording.h (gcc::jit::recording::type::is_void): New
1222 virtual function.
1223 (gcc::jit::recording::memento_of_get_type::is_void): New
1224 function, overriding default implementation.
1225 * libgccjit.c (gcc_jit_rvalue_dereference): Verify that
1226 the underlying type is not "void".
1227
18146f45
DM
12282015-01-07 David Malcolm <dmalcolm@redhat.com>
1229
1230 * docs/topics/expressions.rst (Unary Operations): Add
1231 GCC_JIT_UNARY_OP_ABS.
1232 * jit-playback.c (gcc::jit::playback::context::new_unary_op):
1233 Likewise.
1234 * jit-recording.c (unary_op_strings): Likewise.
1235 * libgccjit.c (gcc_jit_context_new_unary_op): Update checking
1236 of "op" to reflect addition of GCC_JIT_UNARY_OP_ABS.
1237 * libgccjit.h (enum gcc_jit_unary_op): Add GCC_JIT_UNARY_OP_ABS.
1238 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1239
11af98ff
DM
12402015-01-07 David Malcolm <dmalcolm@redhat.com>
1241
1242 * jit-recording.h (gcc::jit::recording::memento_of_get_type): Fix
1243 typo in comment.
1244
433d16df
DM
12452015-01-07 David Malcolm <dmalcolm@redhat.com>
1246
1247 * TODO.rst (Test suite): Remove item about running C++ testcases.
1248 * docs/internals/index.rst (Working on the JIT library): Add
1249 "c++" to the enabled languages in the suggested "configure"
1250 invocation, and add a description of why this is necessary.
1251 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1252
50bb6c8e
DM
12532015-01-07 David Malcolm <dmalcolm@redhat.com>
1254
1255 * docs/internals/index.rst: Update to reflect that built
1256 testcases are now test-foo.c.exe, rather than test-foo.exe.
1257 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1258
1e3b6a3d
JJ
12592015-01-05 Jakub Jelinek <jakub@redhat.com>
1260
1261 Update copyright years.
1262
e8af59bc
DM
12632014-12-19 David Malcolm <dmalcolm@redhat.com>
1264
1265 * jit-playback.c (gcc::jit::playback::context::build_cast): In
1266 case BOOLEAN_TYPE, don't assume that the source expression is
1267 of type "int".
1268
5afd44e3
DM
12692014-12-19 David Malcolm <dmalcolm@redhat.com>
1270
1271 * jit-recording.c (gcc::jit::recording::context::context): When
1272 copying string options from a parent context, take a copy of the
1273 underlying buffers, rather than simply copying the pointer.
1274
1f0858d7
DM
12752014-12-19 David Malcolm <dmalcolm@redhat.com>
1276
1277 * jit-recording.c (gcc::jit::recording::context::set_str_option):
1278 Handle NULL.
1279
35291c7d
DM
12802014-12-11 David Malcolm <dmalcolm@redhat.com>
1281
1282 * docs/cp/topics/contexts.rst (gccjit::context::set_str_option):
1283 Document new function.
1284 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1285
7b31ff5e
DM
12862014-12-10 Ulrich Drepper <drepper@gmail.com>
1287
1288 Minor interface cleanups of libgccjit
1289 * jit-playback.c (convert_to_dso): Use auto_vec instead
1290 of automatic array to build up command line.
1291 * jit-recording.c (recording::context::set_str_option):
1292 Make copy of the string.
1293 (recording::context::~context): Free string options.
1294 * jit-recording.h (recording::context): Adjust type
1295 of m_str_options member.
1296 * libgccjit.h: Adjust comment about
1297 gcc_jit_context_set_str_option parameter being used after
1298 the call.
1299 Update comment now that all interfaces are copy strings
1300 if necessary.
1301 * libgccjit++.h (gccjit::context): Add set_str_option
1302 member function.
1303
29df5715
DM
13042014-12-10 David Malcolm <dmalcolm@redhat.com>
1305
1306 * docs/cp/index.rst: New file.
1307 * docs/cp/intro/index.rst: New file.
1308 * docs/cp/intro/tutorial01.rst: New file.
1309 * docs/cp/intro/tutorial02.rst: New file.
1310 * docs/cp/intro/tutorial03.rst: New file.
1311 * docs/cp/intro/tutorial04.rst: New file.
1312 * docs/cp/topics/contexts.rst: New file.
1313 * docs/cp/topics/expressions.rst: New file.
1314 * docs/cp/topics/functions.rst: New file.
1315 * docs/cp/topics/index.rst: New file.
1316 * docs/cp/topics/locations.rst: New file.
1317 * docs/cp/topics/objects.rst: New file.
1318 * docs/cp/topics/results.rst: New file.
1319 * docs/cp/topics/types.rst: New file.
1320 * docs/examples/tut01-hello-world.cc: New file.
1321 * docs/examples/tut02-square.c: Fix missing newline in output.
1322 * docs/examples/tut02-square.cc: New file.
1323 * docs/examples/tut03-sum-of-squares.cc: New file.
1324 * docs/examples/tut04-toyvm/toyvm.cc: New file.
1325 * docs/index.rst: Move summary to above the table of contents.
1326 Add text about the C vs C++ APIs.
1327 * docs/topics/contexts.rst: Fix a typo.
1328
1329 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1330 * docs/_build/texinfo/factorial1.png: New file.
1331 * docs/_build/texinfo/sum-of-squares1.png: New file.
1332
5cd614ce
DM
13332014-12-09 David Malcolm <dmalcolm@redhat.com>
1334
1335 * docs/examples/tut04-toyvm/toyvm.c (toyvm_function_compile): Move
1336 logic for determine "funcname" to new function...
1337 (get_function_name): ...here, adding logic to skip any leading
1338 path from the filename.
1339 (toyvm_function_parse): Use the filename for fn_filename, rather
1340 than "name", so that the debugger can locate the source .toy
1341 file.
1342 (toyvm_function_parse): Don't fclose a NULL FILE *.
1343
2712de78
DM
13442014-12-09 David Malcolm <dmalcolm@redhat.com>
1345
1346 PR jit/63854
1347 * docs/internals/index.rst (Running under valgrind): New
1348 subsection.
1349 (docs/_build/texinfo/libgccjit.texi): Regenerate.
1350
d1e5f2c7
DM
13512014-12-09 David Malcolm <dmalcolm@redhat.com>
1352
1353 PR jit/64206
1354 * Make-lang.in (jit_OBJS): Add jit/jit-tempdir.o.
1355 * jit-common.h (gcc::jit::tempdir): New forward decl.
1356 * jit-playback.c: Include jit-tempdir.h.
1357 (gcc::jit::playback::context::context): Initialize m_tempdir.
1358 (gcc::jit::playback::context::~context): Move tempdir
1359 cleanup to new file jit-tempdir.c
1360 (make_tempdir_path_template): Move to new file jit-tempdir.c.
1361 (gcc::jit::playback::context::compile): Move tempdir creation
1362 to new tempdir object in new file jit-tempdir.c.
1363 (gcc::jit::playback::context::make_fake_args): Get path from
1364 tempdir object rather than from member data.
1365 (gcc::jit::playback::context::convert_to_dso): Likewise.
1366 (gcc::jit::playback::context::dlopen_built_dso): Likewise.
1367 (gcc::jit::playback::context::dump_generated_code): Likewise.
1368 (gcc::jit::playback::context::get_path_c_file): New function.
1369 (gcc::jit::playback::context::get_path_s_file): New function.
1370 (gcc::jit::playback::context::get_path_so_file): New function.
1371 * jit-playback.h (gcc::jit::playback::context::get_path_c_file):
1372 New function.
1373 (gcc::jit::playback::context::get_path_s_file): New function.
1374 (gcc::jit::playback::context::get_path_so_file): New function.
1375 (gcc::jit::playback::context): Move fields "m_path_template",
1376 "m_path_tempdir", "m_path_c_file", "m_path_s_file",
1377 "m_path_so_file" to new jit::tempdir class; add field "m_tempdir".
1378 * jit-tempdir.c: New file.
1379 * jit-tempdir.h: New file.
1380
38771e4e
DM
13812014-12-09 David Malcolm <dmalcolm@redhat.com>
1382
1383 * jit-playback.c (gcc::jit::playback::context::compile): Acquire the
1384 mutex here, immediately before using toplev, and release it here, on
1385 each exit path after acquisition.
1386 (jit_mutex): Move this variable here, from jit-recording.c.
1387 (gcc::jit::playback::context::acquire_mutex): New function, based on
1388 code in jit-recording.c.
1389 (gcc::jit::playback::context::release_mutex): Likewise.
1390 * jit-playback.h (gcc::jit::playback::context::acquire_mutex): New
1391 function.
1392 (gcc::jit::playback::context::release_mutex): New function.
1393 * jit-recording.c (jit_mutex): Move this variable to jit-playback.c.
1394 (gcc::jit::recording::context::compile): Move mutex-handling from
1395 here into jit-playback.c's gcc::jit::playback::context::compile.
1396 * notes.txt: Update to show the new locations of ACQUIRE_MUTEX
1397 and RELEASE_MUTEX.
1398
38f4f641
DM
13992014-12-09 David Malcolm <dmalcolm@redhat.com>
1400
1401 * jit-playback.c (gcc::jit::playback::context::compile): Move the
1402 dlopen code into...
1403 (gcc::jit::playback::context::dlopen_built_dso): ...this new
1404 function.
1405 * jit-playback.h (gcc::jit::playback::context::dlopen_built_dso):
1406 New function.
1407
82e0c914
DM
14082014-12-09 David Malcolm <dmalcolm@redhat.com>
1409
1410 PR jit/64166
1411 * docs/topics/contexts.rst (Debugging): Add description of
1412 gcc_jit_context_enable_dump.
1413 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1414 * jit-playback.c: Include context.h.
1415 (class auto_argvec): New class.
1416 (auto_argvec::~auto_argvec): New function.
1417 (gcc::jit::playback::context::compile): Convert fake_args to be
1418 an auto_argvec, so that it can contain dynamically-allocated
1419 strings. Construct a vec of all requested dumps, and pass it to
1420 make_fake_args. Extract requested dumps between the calls to
1421 toplev::main and toplev::finalize.
1422 (gcc::jit::playback::context::make_fake_args): Convert param
1423 "argvec" to be a vec <char *>, and gain a "requested_dumps"
1424 param. Convert to dynamically-allocated arg strings by converting
1425 ADD_ARG to take a copy of the arg, and add ADD_ARG_TAKE_OWNERSHIP
1426 for args that are already a copy. Add args for all requested dumps.
1427 (gcc::jit::playback::context::extract_any_requested_dumps): New
1428 function.
1429 (gcc::jit::playback::context::read_dump_file): New function.
1430 * jit-playback.h (gcc::jit::playback::context::make_fake_args):
1431 Convert param "argvec" to be a vec <char *>, and gain a
1432 "requested_dumps" param.
1433 (gcc::jit::playback::context::extract_any_requested_dumps): New
1434 function.
1435 (gcc::jit::playback::context::read_dump_file): New function.
1436 * jit-recording.c (gcc::jit::recording::context::enable_dump): New
1437 function.
1438 (gcc::jit::recording::context::get_all_requested_dumps): New
1439 function.
1440 * jit-recording.h (gcc::jit::recording::requested_dump): New
1441 struct.
1442 (gcc::jit::recording::context::enable_dump): New function.
1443 (gcc::jit::recording::context::get_all_requested_dumps): New
1444 function.
1445 (gcc::jit::recording::context::m_requested_dumps): New field.
1446 * libgccjit.c (gcc_jit_context_enable_dump): New API entrypoint.
1447 * libgccjit.h (gcc_jit_context_enable_dump): New API entrypoint.
1448 * libgccjit.map (gcc_jit_context_enable_dump): New API entrypoint.
1449
53b730ff
DM
14502014-12-08 David Malcolm <dmalcolm@redhat.com>
1451
1452 * libgccjit++.h: Indent the forward declarations of the classes to
1453 show the inheritance hierarchy.
1454
0f379445
DM
14552014-12-08 David Malcolm <dmalcolm@redhat.com>
1456
1457 * notes.txt: Show the beginning and ending of
1458 recording::context::compile vs playback::context::compile. Show
1459 the creation and unlinking of the tempdir. Show toplev::finalize.
1460 Move "RELEASE MUTEX" to the correct location. Show
1461 gcc_jit_result_release, and indicate where the
1462 dlopen/dlsym/dlclose occur.
1463
81ba15f1
DM
14642014-12-01 David Malcolm <dmalcolm@redhat.com>
1465
1466 * docs/examples/tut02-square.c (main): Release the context
1467 earlier, to show that this is possible. Update error-handling
1468 to avoid a double-release of the context, and to avoid
1469 releasing a NULL result.
1470 * docs/intro/tutorial02.rst: Discuss gcc_jit_context_release.
1471 * docs/topics/functions.rst (GCC_JIT_FUNCTION_EXPORTED): Emphasize
1472 * docs/topics/results.rst (gcc_jit_result): Mention that this
1473 controls the lifetimes of machine code functions.
1474 (gcc_jit_result_get_code): Spell out the requirements for this
1475 to succeed, and the lifetime of the result.
1476 (gcc_jit_result_release): Mention that this invalidates any code
1477 that was obtained from the result.
1478 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1479
e250f0dc
DM
14802014-12-01 David Malcolm <dmalcolm@redhat.com>
1481
1482 PR jit/64018
1483 * docs/intro/tutorial02.rst: Spell out lifetime of generated code.
1484 Add description of error-handling, taken in part from...
1485 * docs/topics/contexts.rst (Error-handling): Expand, and move some
1486 content to tutorial02.rst.
1487 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1488
eeafb319
DM
14892014-12-01 David Malcolm <dmalcolm@redhat.com>
1490
1491 PR jit/64020
1492 * docs/topics/types.rst (Standard types) Add new enum values to
1493 the table of enum gcc_jit_types: GCC_JIT_TYPE_COMPLEX_FLOAT,
1494 GCC_JIT_TYPE_COMPLEX_DOUBLE, GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE.
1495 Widen the left-hand column so that
1496 GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE will fit.
1497 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1498
1499 * jit-builtins.c: Include stringpool.h and jit-playback.h.
1500 Move everything out of the gcc::jit::recording namespace into
1501 just gcc::jit.
1502 (struct builtin_data): Add fields "fnclass", "attr", and
1503 "implicit_p".
1504 (DEF_BUILTIN): Update macro so populate the new fields.
1505 (builtins_manager::builtins_manager): Update for move out of
1506 recording namespace. Initialize the m_attributes array.
1507 (builtins_manager::get_builtin_function): Likewise.
1508 (builtins_manager::get_builtin_function_by_id): New function.
1509 (builtins_manager::make_builtin_function): Update for move out of
1510 recording namespace. Add fix for PR jit/64020 by detecting
1511 specific builtin ids and having them ensure that builtins for
1512 other ids are created as necessary.
1513 (builtins_manager::get_type): Update for move out of recording
1514 namespace.
1515 (builtins_manager::make_type): Likewise. Add some missing
1516 #undefs.
1517 (builtins_manager::make_primitive_type): Update for move out of
1518 recording namespace. Implement the three BT_COMPLEX_ cases and
1519 BT_DOUBLE_PTR.
1520 (builtins_manager::make_fn_type): Update for move out of recording
1521 namespace.
1522 (builtins_manager::make_ptr_type): Likewise.
1523 (builtins_manager::finish_playback): New function.
1524 (builtins_manager::get_class): New function.
1525 (builtins_manager::implicit_p): New function.
1526 (builtins_manager::get_attrs_tree): Two new functions.
1527 (builtins_manager::make_attrs_tree): New function.
1528
1529 * jit-builtins.h: Move everything out of the gcc::jit::recording
1530 namespace into just gcc::jit.
1531 (enum built_in_attribute): New.
1532 (builtins_manager::builtins_manager): Update decl for namespace
1533 change.
1534 (builtins_manager::get_builtin_function): Likewise.
1535 (builtins_manager::get_class): New.
1536 (builtins_manager::implicit_p): New.
1537 (builtins_manager::get_attrs_tree): Two new functions.
1538 (builtins_manager::make_attrs_tree): New function.
1539 (builtins_manager::finish_playback): New.
1540 (builtins_manager::get_builtin_function_by_id): New.
1541 (builtins_manager::make_builtin_function): Update decl for
1542 namespace change.
1543 (builtins_manager::get_type): Likewise.
1544 (builtins_manager::make_type): Likewise.
1545 (builtins_manager::make_primitive_type): Likewise.
1546 (builtins_manager::make_fn_type): Likewise.
1547 (builtins_manager::make_ptr_type): Likewise.
1548 (builtins_manager): Likewise for fields. Add new field
1549 "m_attributes".
1550
1551 * jit-common.h (NUM_GCC_JIT_TYPES): Update.
1552 (builtins_manager): Update forward decl to reflect namespace
1553 change.
1554
1555 * jit-playback.c: Include attribs.h and jit-builtins.h.
1556 (gcc::jit::playback::context::get_tree_node_for_type): Add cases
1557 for the new COMPLEX_ types.
1558 (gcc::jit::playback::context::new_function): If creating a
1559 builtin, set the DECL_BUILT_IN_CLASS and attributes on the fndecl,
1560 and call set_builtin_decl.
1561 (gcc::jit::playback::context::replay): If we have a
1562 builtins_manager, call its finish_playback method when we're done.
1563
1564 * jit-playback.h:
1565 (gcc::jit::playback::context::get_builtins_manager): New function.
1566
1567 * jit-recording.c
1568 (gcc::jit::recording::context::get_builtins_manager): New function.
1569 (gcc::jit::recording::get_builtin_function): Use
1570 get_builtins_manager, in case we're a child context.
1571 (gcc::jit::recording::memento_of_get_type::dereference): Add the
1572 COMPLEX_ types.
1573 (gcc::jit::recording::memento_of_get_type::is_int): Likewise.
1574 (gcc::jit::recording::memento_of_get_type::is_float): Likewise.
1575 (gcc::jit::recording::memento_of_get_type::is_bool): Likewise.
1576 (get_type_strings): Likewise.
1577
1578 * jit-recording.h
1579 (gcc::jit::recording::context::get_builtins_manager): New.
1580
1581 * libgccjit.h (enum gcc_jit_types): Add
1582 GCC_JIT_TYPE_COMPLEX_FLOAT, GCC_JIT_TYPE_COMPLEX_DOUBLE,
1583 GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE.
1584
23844fd7
DM
15852014-12-01 David Malcolm <dmalcolm@redhat.com>
1586
1587 * jit-builtins.c
1588 (gcc::jit::recording::builtins_manager::get_builtin_function):
1589 Check for NULL return from make_builtin_function.
1590 (gcc::jit::recording::builtins_manager::make_builtin_function):
1591 Check for NULL return from get_type.
1592
c6760a13
DM
15932014-12-01 David Malcolm <dmalcolm@redhat.com>
1594
1595 * jit-playback.c (gcc::jit::playback::context::compile): Move DSO
1596 creation code into...
1597 (gcc::jit::playback::context::convert_to_dso): New function.
1598 * jit-playback.h (gcc::jit::playback::context::convert_to_dso):
1599 New function.
1600
8f50ee3c
DM
16012014-12-01 David Malcolm <dmalcolm@redhat.com>
1602
1603 * jit-playback.c (gcc::jit::playback::context::compile): Use an
1604 auto_vec<const char *> rather than a const char *[20] for the
1605 top-level argv, and move the logic to build it to...
1606 (gcc::jit::playback::context::make_fake_args): New function.
1607 * jit-playback.h (gcc::jit::playback::context::make_fake_args):
1608 New function.
1609
56dea35f
DM
16102014-12-01 David Malcolm <dmalcolm@redhat.com>
1611
1612 * Make-lang.in (jit_OBJS): Add jit/jit-result.o.
1613 * jit-playback.c: Include new header jit-result.h.
1614 (gcc::jit::result::result): Move to new file jit-result.c.
1615 (gcc::jit::result::~result): Likewise.
1616 (gcc::jit::playback::result): Likewise.
1617 * jit-recording.h (class gcc::jit::result): Move to new
1618 header jit-result.h.
1619 * jit-result.c: New file, to contain...
1620 (gcc::jit::result::result): Move here from jit-playback.c,
1621 removing erroneous "playback" namespace from comment.
1622 (gcc::jit::result::~result): Likewise.
1623 (gcc::jit::playback::result): Likewise.
1624 * jit-result.h: New file, to contain...
1625 (class gcc::jit::result): Move from jit-recording.h.
1626 * libgccjit.c: Include jit-result.h.
1627 (gcc_jit_result_get_code): Update comment to reflect move
1628 of implementation.
1629 (gcc_jit_result_release): Likewise.
1630
52b9468f
DM
16312014-12-01 David Malcolm <dmalcolm@redhat.com>
1632
1633 PR jit/63854
1634 * docs/examples/tut04-toyvm/toyvm.c
1635 (toyvm_compiled_function): New typedef.
1636 (toyvm_compiled_func) Rename to...
1637 (toyvm_compiled_code) ...this.
1638 (struct toyvm_compiled_function): New struct.
1639 (toyvm_function_compile): Return a toyvm_compiled_function *
1640 rather than a toyvm_compiled_func, so that the caller can fully
1641 clean things up. Free "funcname".
1642 (test_script): Update for change to toyvm_function_compile.
1643 Clean up the toyvm_compiled_function.
1644 (main): Likewise.
1645 (docs/intro/tutorial04.rst): Update to reflect the above changes,
1646 and to better spell out the lifetime of the compiled code.
1647
c8d19a69
DM
16482014-12-01 David Malcolm <dmalcolm@redhat.com>
1649
1650 PR jit/63854
1651 * jit-builtins.c
1652 (gcc::jit::recording::builtins_manager::make_fn_type): Call the
1653 context's new_function_type method, rather than directly creating
1654 a function_type instance.
1655 * jit-recording.c
1656 (gcc::jit::recording::context::new_function_type): New method,
1657 adapted from part of...
1658 (gcc::jit::recording::context::new_function_ptr_type): ...this.
1659 Update to call new_function_type.
1660 * jit-recording.h
1661 (gcc::jit::recording::context::new_function_type): New method.
1662
c985705a
DM
16632014-12-01 David Malcolm <dmalcolm@redhat.com>
1664
1665 PR jit/63969
1666 * jit-playback.c: Ensure that ctxt_progname is non-NULL.
1667
b957b2e0
DM
16682014-11-19 David Malcolm <dmalcolm@redhat.com>
1669
1670 PR jit/63854
1671 * jit-playback.c (gcc::jit::playback::compound_type::set_fields):
1672 Convert param from const vec<playback::field *> & to
1673 const auto_vec<playback::field *> *.
1674 (gcc::jit::playback::context::new_function_type): Convert param
1675 "param_types" from vec<type *> * to const auto_vec<type *> *.
1676 (gcc::jit::playback::context::new_function): Convert param
1677 "params" from vec<param *> * to const auto_vec<param *> *.
1678 (gcc::jit::playback::context::build_call): Convert param "args"
1679 from vec<rvalue *> to const auto_vec<rvalue *> *.
1680 (gcc::jit::playback::context::new_call): Likewise.
1681 (gcc::jit::playback::context::new_call_through_ptr): Likewise.
1682 (wrapper_finalizer): New function.
1683 (gcc::jit::playback::wrapper::operator new): Call the finalizer
1684 variant of ggc_internal_cleared_alloc, supplying
1685 wrapper_finalizer.
1686 (gcc::jit::playback::function::finalizer): New.
1687 (gcc::jit::playback::block::finalizer): New.
1688 (gcc::jit::playback::source_file::finalizer): New.
1689 (gcc::jit::playback::source_line::finalizer): New.
1690
1691 * jit-playback.h
1692 (gcc::jit::playback::context::new_function_type): Convert param
1693 "param_types" from vec<type *> * to const auto_vec<type *> *.
1694 (gcc::jit::playback::context::new_function): Convert param
1695 "params" from vec<param *> * to const auto_vec<param *> *.
1696 (gcc::jit::playback::context::new_call): Convert param
1697 "args" from vec<rvalue *> to const auto_vec<rvalue *> *.
1698 (gcc::jit::playback::context::new_call_through_ptr): Likewise.
1699 (gcc::jit::playback::context::build_call): Likewise.
1700 (gcc::jit::playback::context): Convert fields "m_functions",
1701 "m_source_files", "m_cached_locations" from vec to auto_vec.
1702 (gcc::jit::playback::wrapper::finalizer): New virtual function.
1703 (gcc::jit::playback::compound_type::set_fields): Convert param fro
1704 const vec<playback::field *> & to
1705 const auto_vec<playback::field *> *.
1706 (gcc::jit::playback::function::finalizer): New.
1707 (gcc::jit::playback::block::finalizer): New.
1708 (gcc::jit::playback::source_file::finalizer): New.
1709 (gcc::jit::playback::source_line::finalizer): New.
1710
1711 * jit-recording.c
1712 (gcc::jit::recording::function_type::replay_into): Convert local
1713 from a vec into an auto_vec.
1714 (gcc::jit::recording::fields::replay_into): Likewise.
1715 (gcc::jit::recording::function::replay_into): Likewise.
1716 (gcc::jit::recording::call::replay_into): Likewise.
1717 (gcc::jit::recording::call_through_ptr::replay_into): Likewise.
1718
1719 * jit-recording.h (gcc::jit::recording::context): Convert fields
1720 "m_mementos", "m_compound_types", "m_functions" from vec<> to
1721 auto_vec <>.
1722 (gcc::jit::recording::function_type::get_param_types): Convert
1723 return type from vec<type *> to const vec<type *> &.
1724 (gcc::jit::recording::function_type): Convert field
1725 "m_param_types" from a vec<> to an auto_vec<>.
1726 (gcc::jit::recording::fields): Likewise for field "m_fields".
1727 (gcc::jit::recording::function::get_params): Convert return type
1728 from vec <param *> to const vec<param *> &.
1729 (gcc::jit::recording::function): Convert fields "m_params",
1730 "m_locals", "m_blocks" from vec<> to auto_vec<>.
1731 (gcc::jit::recording::block): Likewise for field "m_statements".
1732 vec<> to auto_vec<>.
1733 (gcc::jit::recording::call): Likewise for field "m_args".
1734 (gcc::jit::recording::call_through_ptr): Likewise.
1735
79cafc7a
DM
17362014-11-19 David Malcolm <dmalcolm@redhat.com>
1737
1738 PR jit/63854
1739 * jit-recording.c (recording::function::validate): Convert
1740 "worklist" from vec<> to autovec<> to fix a leak.
1741
35485da9
DM
17422014-11-11 David Malcolm <dmalcolm@redhat.com>
1743
1744 * ChangeLog.jit: New.
1745 * ChangeLog: New.
1746 * Make-lang.in: New.
1747 * TODO.rst: New.
1748 * config-lang.in: New.
1749 * docs/Makefile: New.
1750 * docs/_build/texinfo/Makefile: New.
1751 * docs/_build/texinfo/factorial.png: New.
1752 * docs/_build/texinfo/libgccjit.texi: New.
1753 * docs/_build/texinfo/sum-of-squares.png: New.
1754 * docs/conf.py: New.
1755 * docs/examples/tut01-hello-world.c: New.
1756 * docs/examples/tut02-square.c: New.
1757 * docs/examples/tut03-sum-of-squares.c: New.
1758 * docs/examples/tut04-toyvm/Makefile: New.
1759 * docs/examples/tut04-toyvm/factorial.toy: New.
1760 * docs/examples/tut04-toyvm/fibonacci.toy: New.
1761 * docs/examples/tut04-toyvm/toyvm.c: New.
1762 * docs/index.rst: New.
1763 * docs/internals/index.rst: New.
1764 * docs/intro/factorial.png: New.
1765 * docs/intro/index.rst: New.
1766 * docs/intro/sum-of-squares.png: New.
1767 * docs/intro/tutorial01.rst: New.
1768 * docs/intro/tutorial02.rst: New.
1769 * docs/intro/tutorial03.rst: New.
1770 * docs/intro/tutorial04.rst: New.
1771 * docs/topics/contexts.rst: New.
1772 * docs/topics/expressions.rst: New.
1773 * docs/topics/functions.rst: New.
1774 * docs/topics/index.rst: New.
1775 * docs/topics/locations.rst: New.
1776 * docs/topics/objects.rst: New.
1777 * docs/topics/results.rst: New.
1778 * docs/topics/types.rst: New.
1779 * dummy-frontend.c: New.
1780 * jit-builtins.c: New.
1781 * jit-builtins.h: New.
1782 * jit-common.h: New.
1783 * jit-playback.c: New.
1784 * jit-playback.h: New.
1785 * jit-recording.c: New.
1786 * jit-recording.h: New.
1787 * libgccjit++.h: New.
1788 * libgccjit.c: New.
1789 * libgccjit.h: New.
1790 * libgccjit.map: New.
1791 * notes.txt: New.
1792
17932013-07-26 David Malcolm <dmalcolm@redhat.com>
1794
1795 * Initial creation
1796
1e3b6a3d 1797Copyright (C) 2013-2015 Free Software Foundation, Inc.
35485da9
DM
1798
1799Copying and distribution of this file, with or without modification,
1800are permitted in any medium without royalty provided the copyright
1801notice and this notice are preserved.