1 2016-01-04 Jakub Jelinek <jakub@redhat.com>
3 Update copyright years.
5 2015-11-11 Andrew MacLeod <amacleod@redhat.com>
7 * dummy-frontend.c: Remove unused header files.
8 * jit-builtins.c: Likewise.
9 * jit-playback.c: Likewise.
10 * jit-recording.c: Likewise.
11 * jit-spec.c: Likewise.
12 * libgccjit.c: Likewise.
14 2015-11-07 Richard Sandiford <richard.sandiford@arm.com>
16 * jit-builtins.c: Don't undef DEF_BUILTIN.
18 2015-10-29 Andrew MacLeod <amacleod@redhat.com>
20 * dummy-frontend.c: Reorder #include's and remove duplicates.
21 * jit-builtins.c: Likewise.
22 * jit-playback.c: Likewise.
23 * jit-recording.c: Likewise.
24 * libgccjit.c: Likewise.
26 2015-10-13 Jakub Jelinek <jakub@redhat.com>
28 * jit-builtins.c (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10,
29 DEF_FUNCTION_TYPE_11): Define.
30 * jit-builtins.h (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10,
31 DEF_FUNCTION_TYPE_11): Define.
33 2015-09-30 Thomas Schwinge <thomas@codesourcery.com>
34 Ulrich Drepper <drepper@gmail.com>
36 * jit-builtins.h: Undefine DEF_FUNCTION_TYPE_VAR_6 after use.
38 2015-09-30 Matthias Klose <doko@ubuntu.com>
40 * jit-builtins.h Define DEF_FUNCTION_TYPE_VAR_6,
41 remove DEF_FUNCTION_TYPE_VAR_11.
42 * jit-builtins.c (builtins_manager::make_type): Define and handle
43 DEF_FUNCTION_TYPE_VAR_6, remove DEF_FUNCTION_TYPE_VAR_11.
45 2015-08-25 David Malcolm <dmalcolm@redhat.com>
47 * docs/cp/topics/contexts.rst
48 (gccjit::context::set_bool_use_external_driver): New.
49 * docs/internals/test-hello-world.exe.log.txt: Update.
50 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_5): New.
51 * docs/topics/contexts.rst
52 (gcc_jit_context_set_bool_use_external_driver): New.
53 * jit-common.h (enum inner_bool_option): Add
54 INNER_BOOL_OPTION_USE_EXTERNAL_DRIVER.
55 * jit-playback.c (gcc_driver_name): New global.
56 (gcc:jit::playback::context::invoke_driver): Split out second
58 (gcc::jit::playback::context::invoke_embedded_driver): ...this new
60 (gcc::jit::playback::context::invoke_external_driver): ...this new
63 (gcc::jit::playback::context::get_inner_bool_option): New.
64 (gcc::jit::playback::context::invoke_embedded_driver): New.
65 (gcc::jit::playback::context::invoke_external_driver): New.
66 * jit-recording.c (inner_bool_option_reproducer_strings):
67 Add entry for INNER_BOOL_OPTION_USE_EXTERNAL_DRIVER.
69 (gccjit::context::set_bool_use_external_driver): New.
70 * libgccjit.c (gcc_jit_context_set_bool_use_external_driver): New.
71 * libgccjit.h (gcc_jit_context_set_bool_use_external_driver): New.
72 (LIBGCCJIT_HAVE_gcc_jit_context_set_bool_use_external_driver):
74 * libgccjit.map (LIBGCCJIT_ABI_5): New.
75 * notes.txt: Show invocation of embedded copy of driver.
76 * docs/internals/test-hello-world.exe.log.txt: Update
78 2015-08-13 David Malcolm <dmalcolm@redhat.com>
80 * jit-playback.c (invoke_driver): On OS X, add
81 "-Wl,-undefined,dynamic_lookup" to the driver arguments.
83 2015-08-03 David Malcolm <dmalcolm@redhat.com>
85 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_4): New.
86 * docs/topics/contexts.rst (GCC_JIT_BOOL_OPTION_DUMP_SUMMARY):
87 We no longer show a profile.
88 * docs/topics/index.rst (Topic Reference): Add performance.rst.
89 * docs/topics/performance.rst: New file.
90 * docs/_build/texinfo/libgccjit.texi: Regenerate.
91 * jit-playback.c (gcc::jit::playback::context::compile): Add timer
92 param when constructing the "toplev" instance.
93 (gcc::jit::playback::context::acquire_mutex): Add timer param when
94 constructing auto_timevar instance.
95 (gcc::jit::playback::context::make_fake_args): If we have a timer,
97 (gcc::jit::playback::context::invoke_driver): Add timer param when
98 constructing auto_timevar instance.
99 (gcc::jit::playback::context::dlopen_built_dso): Likewise.
100 * jit-playback.h (gcc::jit::playback::context::get_timer): New accessor.
101 * jit-recording.c: Include timevar.h.
102 (gcc::jit::recording::context::context): Initialize field "m_timer".
103 * jit-recording.h: Add forward declaration of class timer.
104 (gcc::jit::recording::context::set_timer): New method.
105 (gcc::jit::recording::context::get_timer): New method.
106 (gcc::jit::recording::context::m_timer): New field.
107 * libgccjit++.h (gccjit::timer): New class.
108 (gccjit::auto_time): New class.
109 (gccjit::context::set_timer): New method.
110 (gccjit::context::get_timer): New.
111 (gccjit::timer::timer): New.
112 (gccjit::timer::push): New.
113 (gccjit::timer::pop): New.
115 (timer::get_inner_timer): New.
116 (timer::release): New.
117 (auto_time::auto_time): New.
118 (auto_time::~auto_time): New.
119 * libgccjit.c: Include timevar.h.
120 (struct gcc_jit_timer): New.
121 (gcc_jit_timer_new): New function.
122 (gcc_jit_timer_release): New function.
123 (gcc_jit_context_set_timer): New function.
124 (gcc_jit_context_get_timer): New function.
125 (gcc_jit_timer_push): New function.
126 (gcc_jit_timer_pop): New function.
127 (gcc_jit_timer_print): New function.
128 * libgccjit.h (LIBGCCJIT_HAVE_TIMING_API): New macro.
129 (gcc_jit_timer): New typedef.
130 (gcc_jit_timer_new): New function.
131 (gcc_jit_timer_release): New function.
132 (gcc_jit_context_set_timer): New function.
133 (gcc_jit_context_get_timer): New function.
134 (gcc_jit_timer_push): New function.
135 (gcc_jit_timer_pop): New function.
136 (gcc_jit_timer_print): New function.
137 * libgccjit.map (LIBGCCJIT_ABI_4): New.
138 (gcc_jit_timer_new): New function.
139 (gcc_jit_timer_release): New function.
140 (gcc_jit_context_set_timer): New function.
141 (gcc_jit_context_get_timer): New function.
142 (gcc_jit_timer_push): New function.
143 (gcc_jit_timer_pop): New function.
144 (gcc_jit_timer_print): New function.
146 2015-07-23 David Malcolm <dmalcolm@redhat.com>
148 * jit-playback.c (invoke_driver): Convert local "argvec"
149 to an auto_argvec, so that it owns copies of the strings,
150 rather than borrows them, updating ADD_ARG to use xstrdup
151 and special-casing the NULL terminator to avoid
152 xstrdup (NULL). Call add_multilib_driver_arguments at the front
154 (MULTILIB_DEFAULTS): Provide a default definition.
155 (multilib_defaults_raw): New constant array.
156 (gcc::jit::playback::context::add_multilib_driver_arguments): New
159 (gcc::jit::playback::context::add_multilib_driver_arguments): New
161 * docs/internals/test-hello-world.exe.log.txt: Update.
162 * docs/_build/texinfo/libgccjit.texi: Regenerate.
164 2015-07-16 David Malcolm <dmalcolm@redhat.com>
166 * docs/internals/index.rst (Overview of code structure): Add note
167 that the implementation is in C++, despite the .c extension.
168 (Submitting patches): New subsection.
169 * docs/_build/texinfo/libgccjit.texi: Regenerate.
171 2015-07-09 Andrew MacLeod <amacleod@redhat.com>
173 * dummy-frontend.c: Adjust includes for flags.h changes.
174 * jit-common.h: Likewise.
175 * jit-playback.c: Likewise.
177 2015-07-08 David Malcolm <dmalcolm@redhat.com>
180 * libgccjit.c (gcc_jit_context_new_field): Show name of field in
181 "unknown size" error message.
182 (gcc_jit_struct_set_fields): Show name of struct in error message.
183 (gcc_jit_context_new_global): Show name of global in
184 "unknown size" error message.
185 (gcc_jit_function_new_local): Likewise for local.
187 2015-07-07 Andrew MacLeod <amacleod@redhat.com>
189 * dummy-frontend.c: Adjust includes.
190 * jit-common.h: Likewise.
191 * jit-playback.c: Likewise.
193 2015-07-07 David Malcolm <dmalcolm@redhat.com>
196 * jit-recording.h: Within namespace gcc:jit::recording...
197 (type::has_known_size): New virtual function.
198 (struct_has_known_size): New function.
199 * libgccjit.c (gcc_jit_context_new_field): Verify that the type
201 (gcc_jit_context_new_global): Likewise.
202 (gcc_jit_function_new_local): Likewise.
204 2015-07-07 David Malcolm <dmalcolm@redhat.com>
207 * dummy-frontend.c (jit_langhook_type_for_mode): Ensure that we
208 handle modes QI, HI, SI, DI, TI.
210 2015-07-01 David Malcolm <dmalcolm@redhat.com>
213 * jit-playback.c (jit_mark_addressable): New function.
214 (gcc::jit::playback::lvalue::get_address): Call
215 jit_mark_addressable on the underlying tree.
217 2015-07-01 David Malcolm <dmalcolm@redhat.com>
219 * docs/topics/types.rst (gcc_jit_context_new_union_type): Add
221 * docs/_build/texinfo/libgccjit.texi: Regenerate.
223 2015-07-01 David Malcolm <dmalcolm@redhat.com>
225 * docs/topics/contexts.rst (gcc_jit_context_set_bool_option):
226 Clarify lack of lifetime requirements on (const char *) parameter.
227 * docs/topics/expressions.rst
228 (gcc_jit_context_new_string_literal): Likewise.
229 (gcc_jit_context_new_global): Likewise.
230 * docs/topics/functions.rst (gcc_jit_context_new_param): Likewise.
231 (gcc_jit_context_new_function): Likewise.
232 (gcc_jit_function_new_block): Likewise.
233 (gcc_jit_block_add_comment): Likewise.
234 * docs/topics/locations.rst (gcc_jit_context_new_location):
236 * docs/topics/types.rst (gcc_jit_context_new_field): Likewise.
237 (gcc_jit_context_new_struct_type): Likewise.
238 * docs/_build/texinfo/libgccjit.texi: Regenerate.
240 2015-06-30 David Malcolm <dmalcolm@redhat.com>
242 * docs/cp/topics/functions.rst (Blocks): Add switch statements to
243 list of ways to terminate a block.
244 (gccjit::block::end_with_switch): Add function description.
245 (gccjit::case_): Add class.
246 (gccjit::context::new_case): Add function description.
247 * docs/cp/topics/objects.rst: Add "case_" to class hierarchy.
248 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_3): New.
249 * docs/topics/functions.rst (Blocks): Add switch statements to
250 list of ways to terminate a block.
251 (gcc_jit_block_end_with_switch): Add function description.
252 (gcc_jit_case): Add type.
253 (gcc_jit_context_new_case): Add function description.
254 (gcc_jit_case_as_object): Add function description.
255 * docs/topics/objects.rst: Add gcc_jit_case to class hierarchy.
256 * docs/_build/texinfo/libgccjit.texi: Regenerate.
257 * jit-common.h (gcc::jit::recording::case_): Add forward decl.
258 (gcc::jit::playback::case_): Add forward decl.
259 * jit-playback.c (add_case): New function.
260 (gcc::jit::playback::block::add_switch): New function.
261 * jit-playback.h (gcc::jit::playback::case_): New struct.
262 (gcc::jit::playback::block::get_function): New method.
263 (gcc::jit::playback::block::add_switch): New method.
264 * jit-recording.c: Within namespace gcc::jit...
265 (recording::context::new_case): New method.
266 (recording::function::validate): Update for change to
267 get_successor_blocks.
268 (recording::block::end_with_switch): New method.
269 (recording::block::get_successor_blocks): Update to support an
270 arbitrary number of successor blocks.
271 (recording::block::dump_edges_to_dot): Likewise.
272 (memento_of_new_rvalue_from_const <int>::get_wide_int): New.
273 (memento_of_new_rvalue_from_const <long>::get_wide_int): New.
274 (memento_of_new_rvalue_from_const <double>::get_wide_int): New.
275 (memento_of_new_rvalue_from_const <void *>::get_wide_int): New.
276 (recording::statement::get_successor_blocks): Update to support an
277 arbitrary number of successor blocks.
278 (recording::conditional::get_successor_blocks): Likewise.
279 (recording::jump::get_successor_blocks): Likewise.
280 (recording::return_::get_successor_blocks): Likewise.
281 (recording::case_::write_reproducer): New.
282 (recording::case_::make_debug_string): New.
283 (recording::switch_::switch_): New.
284 (recording::switch_::replay_into): New.
285 (recording::switch_::get_successor_blocks): New.
286 (recording::switch_::make_debug_string): New.
287 (recording::switch_::write_reproducer): New.
288 * jit-recording.h: Within namespace gcc::jit::recording...
289 (context::new_case): New.
290 (rvalue::is_constant): New.
291 (rvalue::get_wide_int): New.
292 (block::end_with_switch): New.
293 (block::get_successor_blocks): Update to support an arbitrary
294 number of successor blocks.
295 (memento_of_new_rvalue_from_const::is_constant): New.
296 (memento_of_new_rvalue_from_const::get_wide_int): New.
297 (statement::get_successor_blocks): Update to support an arbitrary
298 number of successor blocks.
299 (conditional::get_successor_blocks): Likewise.
300 (jump::get_successor_blocks): Likewise.
301 (return_::get_successor_blocks): Likewise.
302 (case_): New subclass of memento.
303 (switch_): New subclass of statement.
304 * libgccjit++.h (gccjit::case_): New subclass of gccjit::object.
305 (gccjit::context::new_case): New method.
306 (gccjit::block::end_with_switch): New method.
307 (gccjit::case_::case): New ctors.
308 (gccjit::case_::get_inner_case): New method.
309 * libgccjit.c: Include "typed-splay-tree.h"
310 (struct gcc_jit_case): New.
311 (gcc_jit_context_new_case): New function.
312 (gcc_jit_case_as_object): New function.
313 (valid_dest_for_switch): New function.
314 (valid_case_for_switch): New function.
315 (class api_call_validator): New class.
316 (class case_range_validator): New class.
317 (case_range_validator::case_range_validator): New.
318 (case_range_validator::validate): New.
319 (case_range_validator::case_compare): New.
320 (case_range_validator::get_wide_int): new.
321 (gcc_jit_block_end_with_switch): New.
322 * libgccjit.h: Add gcc_jit_case to class hierarchy comment.
323 (gcc_jit_case): New typedef.
324 (gcc_jit_context_new_case): New function.
325 (gcc_jit_case_as_object): New function.
326 (gcc_jit_block_end_with_switch): New function.
327 (LIBGCCJIT_HAVE_SWITCH_STATEMENTS): New.
328 * libgccjit.map: Add gcc_jit_block_end_with_switch,
329 gcc_jit_case_as_object and gcc_jit_context_new_case.
331 2015-06-30 David Malcolm <dmalcolm@redhat.com>
334 * docs/cp/topics/contexts.rst
335 (gccjit::context::set_bool_allow_unreachable_blocks): New.
336 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_2): New.
337 * docs/topics/contexts.rst (Options): Add notes discussing the
338 transition from enums to entrypoints for new options.
339 (gcc_jit_context_set_bool_allow_unreachable_blocks): New.
340 * docs/_build/texinfo/libgccjit.texi: Regenerate.
341 * jit-common.h (gcc::jit::inner_bool_option): New enum.
342 * jit-recording.c: Within namespace gcc::jit...
343 (recording::context::context): Handle m_inner_bool_options.
344 (recording::context::set_inner_bool_option): New.
345 (inner_bool_option_reproducer_strings): New.
346 (recording::context::log_all_options): Log the "inner" bool
348 (recording::context::log_inner_bool_option): New.
349 (recording::context::dump_reproducer_to_file): Write initializers
350 for "inner" bool options.
351 (recording::function::validate): Don't check for block
352 reachability if INNER_BOOL_OPTION_ALLOW_UNREACHABLE_BLOCKS is set.
353 * jit-recording.h: Within namespace gcc::jit...
354 (recording::context::set_inner_bool_option): New.
355 (recording::context::get_inner_bool_option): New.
356 (recording::context::log_inner_bool_option): New.
357 (recording::context::m_inner_bool_options): New.
359 (gccjit::context::set_bool_allow_unreachable_blocks): New.
361 (gcc_jit_context_set_bool_allow_unreachable_blocks): New.
362 * libgccjit.h: Add note about options present in the
363 initial release of libgccjit.
364 (gcc_jit_context_set_bool_allow_unreachable_blocks): New API
366 (LIBGCCJIT_HAVE_gcc_jit_context_set_bool_allow_unreachable_blocks):
368 * libgccjit.map (LIBGCCJIT_ABI_2): New, containing...
369 (gcc_jit_context_set_bool_allow_unreachable_blocks): ...this new
372 2015-06-30 David Malcolm <dmalcolm@redhat.com>
375 * docs/cp/topics/contexts.rst (Additional command-line options):
377 * docs/topics/compatibility.rst: New file.
378 * docs/topics/contexts.rst (Additional command-line options): New
380 * docs/topics/index.rst: Add compatibility.rst.
381 * docs/_build/texinfo/libgccjit.texi: Regenerate.
382 * jit-playback.c (make_fake_args): Add call to
383 append_command_line_options.
384 * jit-recording.c: Within namespace gcc::jit...
385 (recording::context::~context): Free the optnames within
386 m_command_line_options.
387 (recording::context::set_bool_option): Likewise.
388 (recording::context::add_command_line_option): New method.
389 (recording::context::append_command_line_options): New method.
390 (recording::context::dump_reproducer_to_file): Add command-line
392 * jit-recording.h: Within namespace gcc::jit...
393 (recording::context::add_command_line_option): New method.
394 (recording::context::append_command_line_options): New method.
395 (recording::context::m_command_line_options): New field.
396 * libgccjit++.h (gccjit::context::add_command_line_option): New
398 * libgccjit.c (gcc_jit_context_add_command_line_option): New API
400 * libgccjit.h (gcc_jit_context_add_command_line_option): New API
402 (LIBGCCJIT_HAVE_gcc_jit_context_add_command_line_option): New
404 * libgccjit.map: Put existing symbols within LIBGCCJIT_ABI_0; add
405 LIBGCCJIT_ABI_1 and gcc_jit_context_add_command_line_option.
407 2015-06-30 David Malcolm <dmalcolm@redhat.com>
410 (gcc::jit::recording::context::dump_reproducer_to_file):
411 Add pragma to generated reproducers to disable -Wunused-variable.
412 Fix handling of NULL string options.
414 2015-06-30 David Malcolm <dmalcolm@redhat.com>
416 * docs/cp/topics/expressions.rst: Remove stray semicolon.
417 * docs/cp/topics/functions.rst: Remove stray backslash.
418 * docs/_build/texinfo/libgccjit.texi: Regenerate.
420 2015-06-25 Andrew MacLeod <amacleod@redhat.com>
422 * dummy-frontend.c: Remove ipa-ref.h and plugin-api.h from include list.
423 * jit-playback.c: Likewise.
425 2015-06-25 Andrew Macleod <amacleod@redhat.com>
427 * jit-common.h: Don't include alias.h.
429 2015-06-17 David Malcolm <dmalcolm@redhat.com>
431 * libgccjit.c (gcc_jit_lvalue_access_field): Verify that the field
432 is for the correct struct.
433 (gcc_jit_rvalue_access_field): Likewise.
435 2015-06-17 Andrew MacLeod <amacleod@redhat.com>
437 * dummy-frontend.c: Do not include input.h, line-map.h or is-a.h.
438 * jit-common.h: Likewise.
439 * jit-playback.c: Likewise.
441 2015-06-16 David Malcolm <dmalcolm@redhat.com>
444 * jit-recording.c: Within namespace gcc::jit::recording::
445 (rvalue::get_debug_string_parens): New function.
446 (binary_op::make_debug_string): Update to mimic C precedence
448 (binary_op_precedence): New array.
449 (binary_op::get_precedence): New function.
450 (comparison::make_debug_string): Update to mimic C precedence
452 (comparison_precedence): New array.
453 (comparison::get_precedence): New function.
454 (cast::make_debug_string): Update to mimic C precedence rules.
455 (call::make_debug_string): Likewise.
456 (call_through_ptr::make_debug_string): Likewise.
457 (array_access::make_debug_string): Likewise.
458 (access_field_of_lvalue::make_debug_string): Likewise.
459 (access_field_rvalue::make_debug_string): Likewise.
460 (dereference_field_rvalue::make_debug_string): Likewise.
461 (dereference_rvalue::make_debug_string): Likewise.
462 (get_address_of_lvalue::make_debug_string): Likewise.
463 * jit-recording.h: Within namespace gcc::jit::recording::
464 (precedence): New enum.
465 (rvalue::rvalue): Initialize field "m_parenthesized_string".
466 (rvalue::get_debug_string_parens): New method.
467 (rvalue::get_precedence): New pure virtual function.
468 (rvalue::m_parenthesized_string): New field.
469 (param::get_precedence): New function.
470 (global::get_precedence): New function.
471 (memento_of_new_rvalue_from_const::get_precedence): New function.
472 (memento_of_new_string_literal::get_precedence): New function.
473 (unary_op::get_precedence): New function.
474 (binary_op::get_precedence): New function.
475 (comparison::get_precedence): New function.
476 (cast::get_precedence): New function.
477 (call::get_precedence): New function.
478 (call_through_ptr::get_precedence): New function.
479 (array_access::get_precedence): New function.
480 (access_field_of_lvalue::get_precedence): New function.
481 (access_field_rvalue::get_precedence): New function.
482 (dereference_field_rvalue::get_precedence): New function.
483 (dereference_rvalue::get_precedence): New function.
484 (get_address_of_lvalue::get_precedence): New function.
485 (local::get_precedence): New function.
487 2015-06-09 Matthias Klose <doko@ubuntu.com>
489 * Make-lang.in (jit.install-common): Install headers using INSTALL_DATA.
491 2015-06-08 Andrew MacLeod <amacleod@redhat.com>
493 * dummy-frontend.c : Adjust include files.
494 * jit-common.h : Likewise.
495 * jit-playback.c : Likewise.
497 2015-06-05 David Malcolm <dmalcolm@redhat.com>
500 (jit_langhook_post_compilation_parsing_cleanups): Remove.
501 (LANG_HOOKS_POST_COMPILATION_PARSING_CLEANUPS): Remove
502 * jit-playback.c (gcc::jit::playback::context::new_global): Add
503 call to varpool_node::finalize_decl.
504 (gcc::jit::playback::context::finalize_global_decls): Remove.
506 (gcc::jit::playback::context::finalize_global_decls): Remove.
508 2015-06-05 David Malcolm <dmalcolm@redhat.com>
510 * dummy-frontend.c (jit_langhook_write_globals): Rename to...
511 (jit_langhook_post_compilation_parsing_cleanups): ...this, and
512 eliminate calls to finalize_compilation_unit and
513 write_global_decls_2.
514 (LANG_HOOKS_WRITE_GLOBALS): Rename to...
515 (LANG_HOOKS_POST_COMPILATION_PARSING_CLEANUPS): ...this and
516 redirect from jit_langhook_write_globals to
517 jit_langhook_post_compilation_parsing_cleanups.
519 (gcc::jit::playback::context::write_global_decls_1): Rename to...
520 (gcc::jit::playback::context::finalize_global_decls): ...this.
521 (gcc::jit::playback::context::write_global_decls_1): Delete.
523 (gcc::jit::playback::context::write_global_decls_1): Rename to...
524 (gcc::jit::playback::context::finalize_global_decls): ...this.
525 (gcc::jit::playback::context::write_global_decls_1): Delete.
527 2015-06-04 Andrew MacLeod <amacleod@redhat.com>
529 * dummy-frontend.c: Adjust includes for restructured coretypes.h.
530 * jit-common.h: Likewise.
531 * jit-playback.c: Likewise.
533 2015-05-12 David Malcolm <dmalcolm@redhat.com>
535 * jit-builtins.c: Include vec.h before target.h.
537 2015-04-27 Jim Wilson <jim.wilson@linaro.org>
539 * Make-lang.in (jit.mostlyclean): Remove shared libraries and object
542 2015-04-09 David Malcolm <dmalcolm@redhat.com>
545 * docs/cp/topics/expressions.rst (Simple expressions): Fix copy
546 and paste error in description of gccjit::context::one.
547 * docs/topics/expressions.rst (Simple expressions): Likewise in
548 description of gcc_jit_context_one.
549 * docs/_build/texinfo/libgccjit.texi: Regenerate.
551 2015-03-13 Uros Bizjak <ubizjak@gmail.com>
553 * jit-recording.c (dump::write): Also check vasprintf return value.
554 (recording::context::add_error_va): Ditto.
555 (recording::string::from_printf): Ditto.
557 2015-03-13 David Malcolm <dmalcolm@redhat.com>
559 * docs/internals/index.rst (Packaging notes): New section.
560 * docs/_build/texinfo/libgccjit.texi: Regenerate.
562 2015-03-05 David Malcolm <dmalcolm@redhat.com>
564 * docs/cp/intro/tutorial03.rst: Add missing arguments to
565 gccjit::block::end_with_conditional call. Add on_true/on_false
566 comments. Tweak the wording.
567 * docs/intro/tutorial03.rst: Add missing arguments to
568 gcc_jit_block_end_with_conditional call. Add some clarifying
570 * docs/topics/compilation.rst: Tweak the wording to avoid an
571 ambiguous use of "this".
572 * docs/topics/contexts.rst: Fix a typo.
573 * docs/topics/expressions.rst (GCC_JIT_BINARY_OP_MINUS): Remove
575 * docs/_build/texinfo/libgccjit.texi: Regenerate.
577 2015-02-24 Thomas Schwinge <thomas@codesourcery.com>
580 * jit-builtins.c (DEF_FUNCTION_TYPE_VAR_8)
581 (DEF_FUNCTION_TYPE_VAR_12): Remove macros.
582 (DEF_FUNCTION_TYPE_VAR_7, DEF_FUNCTION_TYPE_VAR_11): New macros.
583 * jit-builtins.h (DEF_FUNCTION_TYPE_VAR_8)
584 (DEF_FUNCTION_TYPE_VAR_12): Remove macros.
585 (DEF_FUNCTION_TYPE_VAR_7, DEF_FUNCTION_TYPE_VAR_11): New macros.
587 2015-02-04 David Malcolm <dmalcolm@redhat.com>
590 * docs/conf.py (html_theme): Change from 'pyramid'
593 2015-02-04 David Malcolm <dmalcolm@redhat.com>
595 * docs/topics/contexts.rst (gcc_jit_context_acquire): Fix
597 * docs/_build/texinfo/libgccjit.texi: Regenerate.
599 2015-02-03 David Malcolm <dmalcolm@redhat.com>
601 * jit-logging.h (gcc::jit::log_user::log): Make const.
602 * jit-recording.c (gcc::jit::recording::context::set_str_option):
603 Log the new value of the option.
604 (gcc::jit::recording::context::set_int_option): Likewise.
605 (gcc::jit::recording::context::set_bool_option): Likewise.
606 (gcc::jit::recording::context::compile): Log the value of all
608 (gcc::jit::recording::context::compile_to_file): Likewise.
609 (gcc::jit::recording::context::log_all_options): New function.
610 (gcc::jit::recording::context::log_str_option): New function.
611 (gcc::jit::recording::context::log_int_option): New function.
612 (gcc::jit::recording::context::log_bool_option): New function.
613 * jit-recording.h (gcc::jit::recording::context::log_all_options):
615 (gcc::jit::recording::context::log_str_option): New function.
616 (gcc::jit::recording::context::log_int_option): New function.
617 (gcc::jit::recording::context::log_bool_option): New function.
618 * docs/internals/test-hello-world.exe.log.txt: Update for above
620 * docs/_build/texinfo/libgccjit.texi: Regenerate.
622 2015-02-03 David Malcolm <dmalcolm@redhat.com>
625 * Make-lang.in (jit_OBJS): Add jit/jit-spec.o and gcc.o.
626 (LIBGCCJIT_FILENAME): Add EXTRA_GCC_OBJS.
627 * jit-playback.c: Include gcc.h.
628 (gcc::jit::playback::context::compile): Move mutex acquisition
629 to before the call to make_fake_args.
630 (append_arg_from_driver): New function.
631 (gcc::jit::playback::context::make_fake_args): On the first call,
632 call into driver_get_configure_time_options to get configure-time
633 default options and cache them. Add them to the args for
635 * jit-spec.c: New source file.
636 * docs/internals/test-hello-world.exe.log.txt: Update to reflect
638 * docs/_build/texinfo/libgccjit.texi: Regenerate.
640 2015-02-02 David Malcolm <dmalcolm@redhat.com>
643 * dummy-frontend.c (jit_langhook_type_for_mode): Support
644 TYPE_MODE (long_long_integer_type_node).
646 2015-01-27 David Malcolm <dmalcolm@redhat.com>
648 * docs/internals/test-hello-world.exe.log.txt: Add example version
650 * docs/_build/texinfo/libgccjit.texi: Regenerate.
651 * jit-common.h (gcc::jit::dump::get_file): New accessor.
652 * jit-logging.c: Include toplev.h.
653 (gcc::jit::logger::logger): Log the GCC version.
654 * jit-recording.c: Include toplev.h.
655 (gcc:jit::recording::context::dump_reproducer_to_file): Log the
658 2015-01-26 David Malcolm <dmalcolm@redhat.com>
660 * docs/topics/compilation.rst (gcc_jit_result_get_code): Fix typo.
661 * docs/topics/contexts.rst (gcc_jit_context_get_last_error): The
662 error buffer is only valid until the next call to the context.
663 * docs/_build/texinfo/libgccjit.texi: Regenerate.
664 * libgccjit.h (gcc_jit_context_get_first_error): Reword the
665 comment to omit mention of compiling.
666 (gcc_jit_context_get_last_error): The error buffer is only valid
667 until the next call to the context.
669 2015-01-26 David Malcolm <dmalcolm@redhat.com>
672 * config-lang.in (compilers): Drop "libgccjit.so".
674 2015-01-23 David Malcolm <dmalcolm@redhat.com>
677 * jit-playback.c (gcc::jit::playback::context::compile): Construct
678 toplev instances with init_signals=false.
680 2015-01-19 David Malcolm <dmalcolm@redhat.com>
682 * docs/cp/topics/results.rst: Rename to...
683 * docs/cp/topics/compilation.rst: ...this, and add section on
684 ahead-of-time compilation.
685 * docs/cp/topics/index.rst: Update for renaming of results.rst
687 * docs/examples/emit-alphabet.bf: New file, a sample "brainf"
689 * docs/examples/tut05-bf.c: New file, implementing a compiler
691 * docs/internals/test-hello-world.exe.log.txt: Update to reflect
692 changes to logger output.
693 * docs/intro/index.rst: Add tutorial05.rst
694 * docs/intro/tutorial05.rst: New file.
695 * docs/topics/results.rst: Rename to...
696 * docs/topics/compilation.rst: ...this, and add section on
697 ahead-of-time compilation.
698 * docs/topics/index.rst: Update for renaming of results.rst to
700 * docs/_build/texinfo/libgccjit.texi: Regenerate.
701 * jit-playback.c (gcc::jit::playback::context::compile): Convert
702 return type from result * to void. Move the code to convert to
703 dso and dlopen the result to a new pure virtual "postprocess"
705 (gcc::jit::playback::compile_to_memory::compile_to_memory): New
707 (gcc::jit::playback::compile_to_memory::postprocess): New
708 function, based on playback::context::compile.
709 (gcc::jit::playback::compile_to_file::compile_to_file): New
711 (gcc::jit::playback::compile_to_file::postprocess): New function.
712 (gcc::jit::playback::compile_to_file::copy_file): New function.
713 (gcc::jit::playback::context::convert_to_dso): Move internals
715 (gcc::jit::playback::context::invoke_driver): New method. Add
716 "-shared" and "-c" options to driver's argv as needed.
717 * jit-playback.h: Include "timevar.h".
718 (gcc::jit::playback::context::compile): Convert return type from
720 (gcc::jit::playback::context::postprocess): New pure virtual
721 function, making this an abstract base class.
722 (gcc::jit::playback::context::get_tempdir): New accessor.
723 (gcc::jit::playback::context::invoke_driver): New function.
724 (class gcc::jit::playback::compile_to_memory): New subclass of
726 (class gcc::jit::playback::compile_to_file): Likewise.
727 * jit-recording.c (gcc::jit::recording::context::compile): Use a
728 playback::compile_to_memory, and extract its result.
729 (gcc::jit::recording::context::compile_to_file): New function.
730 * jit-recording.h (gcc::jit::recording::context::compile_to_file):
732 * libgccjit++.h (gccjit::context::compile_to_file): New method.
733 * libgccjit.c (gcc_jit_context_compile): Update log message to
734 clarify that this is an in-memory compile.
735 (gcc_jit_context_compile_to_file): New function.
736 * libgccjit.h (gcc_jit_context): Clarify that you can compile
737 a context more than once, and that you can compile to a file
738 as well as to memory.
739 (gcc_jit_result): Clarify that this is the result of an
740 in-memory compilation.
741 (gcc_jit_context_compile): Clarify that you can compile, and that
742 this is an in-memory compilation.
743 (enum gcc_jit_output_kind): New enum.
744 (gcc_jit_context_compile_to_file): New function.
745 (gcc_jit_context_enable_dump): Clarify comment to cover both forms
747 * libgccjit.map (gcc_jit_context_compile_to_file): New API
749 * notes.txt: Update to show the playback::context::postprocess
752 2015-01-19 David Malcolm <dmalcolm@redhat.com>
755 (gcc::jit::recording::memento_of_new_string_literal::make_debug_string):
756 Add missing format string.
758 2015-01-16 David Malcolm <dmalcolm@redhat.com>
760 * Make-lang.in (lang_checks_parallelized): Add "check-jit".
761 (check_jit_parallelize): Set this to an arbitrary value (10).
763 2015-01-16 Jakub Jelinek <jakub@redhat.com>
765 * jit-builtins.h (DEF_FUNCTION_TYPE_VAR_5): Fix spelling of
767 (DEF_FUNCTION_TYPE_VAR_8, DEF_FUNCTION_TYPE_VAR_12): Define and
769 * jit-builtins.c (DEF_FUNCTION_TYPE_VAR_8, DEF_FUNCTION_TYPE_VAR_12):
772 2015-01-15 Richard Sandiford <richard.sandiford@arm.com>
774 Update copyright years in docs/.
776 2015-01-15 David Malcolm <dmalcolm@redhat.com>
778 * libgccjit.c (gcc_jit_block_add_assignment_op): Check that the
779 lvalue and the rvalue are of compatible type.
781 2015-01-13 David Malcolm <dmalcolm@redhat.com>
783 * docs/cp/topics/contexts.rst (Debugging): Add
784 gccjit::context::dump_reproducer_to_file.
785 * docs/internals/index.rst (Design notes): New section,
786 discussing input validation and
787 gcc_jit_context_dump_reproducer_to_file.
788 * docs/topics/contexts.rst (Debugging): Add
789 gcc_jit_context_dump_reproducer_to_file.
790 * docs/_build/texinfo/libgccjit.texi: Regenerate.
791 * jit-common.h (gcc::jit::dump::get_context): New accessor.
792 * jit-recording.c: Include "hash-map.h".
793 Within namespace ::gcc::jit...
794 (dump::write): Flush each line.
795 (dump::make_location): Pass false for new param "created_by_user".
796 (class allocator): New class.
797 (allocator::~allocator): New function.
798 (allocator::xstrdup_printf): New function.
799 (allocator::xstrdup_printf_va): New function.
800 (class reproducer): New subclass of dump.
801 (reproducer::reproducer): New function.
802 (reproducer::write_params): New function.
803 (reproducer::write_args): New function.
804 (reproducer::make_identifier): New function.
805 (reproducer::make_tmp_identifier): New function.
806 (reproducer::get_identifier): New pair of functions.
807 (reproducer::get_identifier_as_rvalue): New function.
808 (reproducer::get_identifier_as_lvalue): New function.
809 (reproducer::get_identifier_as_type): New function.
810 (reproducer::xstrdup_printf): New function.
811 (recording::context::context): Initialize m_toplevel_ctxt.
812 (recording::context::new_location): Add param created_by_user.
813 (str_option_reproducer_strings): New table of strings.
814 (int_option_reproducer_strings): Likewise.
815 (bool_option_reproducer_strings): Likewise.
816 (get_type_enum_strings): Likewise.
817 (names_of_function_kinds): Likewise.
818 (global_kind_reproducer_strings): Likewise.
819 (unary_op_reproducer_strings): Likewise.
820 (binary_op_reproducer_strings): Likewise.
821 (comparison_reproducer_strings): Likewise.
822 Within namespace ::gcc::jit::recording::...
823 (context::dump_reproducer_to_file): New function.
824 (string::write_reproducer): Likewise.
825 (location::write_reproducer): Likewise.
826 (type::access_as_type): Likewise.
827 (memento_of_get_type::write_reproducer): Likewise.
828 (memento_of_get_pointer::write_reproducer): Likewise.
829 (memento_of_get_const::write_reproducer): Likewise.
830 (memento_of_get_volatile::write_reproducer): Likewise.
831 (array_type::write_reproducer): Likewise.
832 (function_type::write_reproducer): Likewise.
833 (function_type::write_deferred_reproducer): Likewise.
834 (field::write_reproducer): Likewise.
835 (struct_::access_as_type): Likewise.
836 (struct_::write_reproducer): Likewise.
837 (union_::write_reproducer): Likewise.
838 (fields::write_reproducer): Likewise.
839 (rvalue::access_as_rvalue): Likewise.
840 (lvalue::access_as_rvalue): Likewise.
841 (lvalue::access_as_lvalue): Likewise.
842 (param::access_as_rvalue): Likewise.
843 (param::access_as_lvalue): Likewise.
844 (param::write_reproducer): Likewise.
845 (function::write_reproducer): Likewise.
846 (block::write_reproducer): Likewise.
847 (global::write_reproducer): Likewise.
848 (memento_of_new_rvalue_from_const <int>::write_reproducer):
850 (memento_of_new_rvalue_from_const <long>::write_reproducer):
852 (memento_of_new_rvalue_from_const <double>::write_reproducer):
854 (memento_of_new_rvalue_from_const <void *>::write_reproducer):
856 (memento_of_new_string_literal::write_reproducer): Likewise.
857 (unary_op::write_reproducer): Likewise.
858 (binary_op::write_reproducer): Likewise.
859 (comparison::write_reproducer): Likewise.
860 (cast::write_reproducer): Likewise.
861 (call::write_reproducer): Likewise.
862 (call_through_ptr::write_reproducer): Likewise.
863 (array_access::write_reproducer): Likewise.
864 (access_field_of_lvalue::write_reproducer): Likewise.
865 (access_field_rvalue::write_reproducer): Likewise.
866 (dereference_field_rvalue::write_reproducer): Likewise.
867 (dereference_rvalue::write_reproducer): Likewise.
868 (get_address_of_lvalue::write_reproducer): Likewise.
869 (local::write_reproducer): Likewise.
870 (eval::write_reproducer): Likewise.
871 (assignment::write_reproducer): Likewise.
872 (assignment_op::write_reproducer): Likewise.
873 (comment::write_reproducer): Likewise.
874 (conditional::write_reproducer): Likewise.
875 (jump::write_reproducer): Likewise.
876 (return_::write_reproducer): Likewise.
877 * jit-recording.h (gcc::jit::reproducer): New forward declararion.
878 Within namespace ::gcc::jit::recording::...
879 (context::new_location): Add "created_by_user" param.
880 (context::dump_reproducer_to_file): New method.
881 (context::m_toplevel_ctxt): New field.
882 (memento::write_reproducer): New pure virtual function.
883 (memento::dyn_cast_location): New virtual function.
884 (string::write_reproducer):
885 (location::location): Add "created_by_user" param.
886 (location::dyn_cast_location): New function.
887 (location::created_by_user): New accessor.
888 (location::write_reproducer): New function.
889 (location::m_created_by_user): New field.
890 (type::access_as_type): New virtual function.
891 (location::write_reproducer): Likewise.
892 (type::access_as_type): Likewise.
893 (memento_of_get_type::write_reproducer): Likewise.
894 (memento_of_get_pointer::write_reproducer): Likewise.
895 (memento_of_get_const::write_reproducer): Likewise.
896 (memento_of_get_volatile::write_reproducer): Likewise.
897 (array_type::write_reproducer): Likewise.
898 (function_type::write_reproducer): Likewise.
899 (function_type::write_deferred_reproducer): Likewise.
900 (field::write_reproducer): Likewise.
901 (struct_::access_as_type): Likewise.
902 (struct_::write_reproducer): Likewise.
903 (union_::write_reproducer): Likewise.
904 (union_::m_fields): Remove stray unused field.
905 (fields::length): New accessor.
906 (fields::get_field): New accessor.
907 (fields::write_reproducer): New function.
908 (rvalue::access_as_rvalue): Likewise.
909 (lvalue::access_as_rvalue): Likewise.
910 (lvalue::access_as_lvalue): Likewise.
911 (param::access_as_rvalue): Likewise.
912 (param::access_as_lvalue): Likewise.
913 (param::write_reproducer): Likewise.
914 (function::write_reproducer): Likewise.
915 (block::write_reproducer): Likewise.
916 (global::write_reproducer): Likewise.
917 (memento_of_new_rvalue_from_const <HOST_TYPE>::write_reproducer):
919 (memento_of_new_string_literal::write_reproducer): Likewise.
920 (unary_op::write_reproducer): Likewise.
921 (binary_op::write_reproducer): Likewise.
922 (comparison::write_reproducer): Likewise.
923 (cast::write_reproducer): Likewise.
924 (call::write_reproducer): Likewise.
925 (call_through_ptr::write_reproducer): Likewise.
926 (array_access::write_reproducer): Likewise.
927 (access_field_of_lvalue::write_reproducer): Likewise.
928 (access_field_rvalue::write_reproducer): Likewise.
929 (dereference_field_rvalue::write_reproducer): Likewise.
930 (dereference_rvalue::write_reproducer): Likewise.
931 (get_address_of_lvalue::write_reproducer): Likewise.
932 (local::write_reproducer): Likewise.
933 (eval::write_reproducer): Likewise.
934 (assignment::write_reproducer): Likewise.
935 (assignment_op::write_reproducer): Likewise.
936 (comment::write_reproducer): Likewise.
937 (conditional::write_reproducer): Likewise.
938 (jump::write_reproducer): Likewise.
939 (return_::write_reproducer): Likewise.
940 * libgccjit++.h (gccjit::context::dump_reproducer_to_file): New.
941 * libgccjit.c (gcc_jit_context_new_location): Pass "true" as
942 param "created_by_user".
943 (gcc_jit_context_dump_reproducer_to_file): New API entrypoint.
944 * libgccjit.h (gcc_jit_context_dump_reproducer_to_file): New API
946 * libgccjit.map (gcc_jit_context_dump_reproducer_to_file): New API
949 2015-01-12 David Malcolm <dmalcolm@redhat.com>
951 * jit-recording.c (class gcc::jit::rvalue_usage_validator): New.
952 (gcc::jit::rvalue_usage_validator::rvalue_usage_validator): New
954 (gcc::jit::rvalue_usage_validator::visit): New function.
955 (gcc::jit::recording::rvalue::verify_valid_within_stmt): New
957 (gcc::jit::recording::rvalue::set_scope): New function.
958 (gcc::jit::recording::function::function): Call set_scope on each
959 param, issuing errors for any params that already have a function.
960 (gcc::jit::recording::block::add_eval): Return the new statement;
961 update the comment given that some error-checking now happens after
963 (gcc::jit::recording::block::add_assignment): Likewise.
964 (gcc::jit::recording::block::add_assignment_op): Likewise.
965 (gcc::jit::recording::block::add_comment): Likewise.
966 (gcc::jit::recording::block::end_with_conditional): Likewise.
967 (gcc::jit::recording::block::end_with_jump): Likewise.
968 (gcc::jit::recording::block::end_with_return): Likewise.
969 (gcc::jit::recording::block::validate): Add a comment.
970 (gcc::jit::recording::unary_op::visit_children): New function.
971 (gcc::jit::recording::binary_op::visit_children): New function.
972 (gcc::jit::recording::comparison::visit_children): New function.
973 (gcc::jit::recording::cast::visit_children): New function.
974 (gcc::jit::recording::call::visit_children): New function.
975 (gcc::jit::recording::call_through_ptr::visit_children): New function.
976 (gcc::jit::recording::array_access::visit_children): New function.
977 (gcc::jit::recording::access_field_of_lvalue::visit_children): New
979 (gcc::jit::recording::access_field_rvalue::visit_children): New
981 (gcc::jit::recording::dereference_field_rvalue::visit_children):
983 (gcc::jit::recording::dereference_rvalue::visit_children): New
985 (gcc::jit::recording::get_address_of_lvalue::visit_children): New
987 * jit-recording.h: Within namespace gcc::jit::recording...
988 (class rvalue_visitor): New.
989 (rvalue::rvalue): Initialize m_scope.
990 (rvalue::get_loc): New accessor.
991 (rvalue::verify_valid_within_stmt): New function.
992 (rvalue::visit_children): New pure virtual function.
993 (rvalue::set_scope): New function.
994 (rvalue::get_scope): New function.
995 (rvalue::dyn_cast_param): New function.
996 (rvalue::m_scope): New field.
997 (param::visit_children): New empty function.
998 (param::dyn_cast_param): New function.
999 (function::get_loc): New function.
1000 (block::add_eval): Return the new statement.
1001 (block::add_assignment): Likewise.
1002 (block::add_assignment_op): Likewise.
1003 (block::add_comment): Likewise.
1004 (block::end_with_conditional): Likewise.
1005 (block::end_with_jump): Likewise.
1006 (block::end_with_return): Likewise.
1007 (global::visit_children): New function.
1008 (memento_of_new_rvalue_from_const<HOST_TYPE>::visit_children):
1010 (memento_of_new_string_literal::visit_children): New function.
1011 (unary_op::visit_children): New function.
1012 (binary_op::visit_children): New function.
1013 (comparison::visit_children): New function.
1014 (cast::visit_children): New function.
1015 (call::visit_children): New function.
1016 (call_through_ptr::visit_children): New function.
1017 (array_access::visit_children): New function.
1018 (access_field_of_lvalue::visit_children): New function.
1019 (access_field_rvalue::visit_children): New function.
1020 (dereference_field_rvalue::visit_children): New function.
1021 (dereference_rvalue::visit_children): New function.
1022 (get_address_of_lvalue::visit_children): New function.
1023 (local::local): Call set_scope.
1024 (local::visit_children): New function.
1025 (statement::get_block): Make public.
1026 * libgccjit.c (RETURN_VAL_IF_FAIL_PRINTF5): New macro.
1027 (RETURN_NULL_IF_FAIL_PRINTF5): New macro.
1028 (gcc_jit_context_new_function): Verify that each param has
1029 not yet been used for creating another function.
1030 (gcc_jit_block_add_eval): After creating the stmt, verify
1031 that the rvalue expression tree is valid to use within it.
1032 (gcc_jit_block_add_assignment): Likewise for the lvalue and
1033 rvalue expression trees.
1034 (gcc_jit_block_add_assignment_op): Likewise.
1035 (gcc_jit_block_end_with_conditional): Likewise for the boolval
1037 (gcc_jit_block_end_with_return): Likewise for the rvalue
1039 (gcc_jit_block_end_with_void_return): Remove return of "void",
1040 now that block::end_with_return is now non-void.
1042 2015-01-12 David Malcolm <dmalcolm@redhat.com>
1044 * jit-playback.c (gcc::jit::playback::context::read_dump_file):
1045 Add missing fclose on error-handling path.
1047 2015-01-12 David Malcolm <dmalcolm@redhat.com>
1049 * docs/cp/topics/expressions.rst (Global variables): Add
1050 enum gcc_jit_global_kind param to gccjit::context::new_global.
1051 * docs/topics/expressions.rst (Global variables): Likewise.
1052 Document the new enum.
1053 * docs/topics/results.rst (Compilation results): Document
1055 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1056 * dummy-frontend.c (jit_langhook_write_globals): Call into the
1057 playback context's write_global_decls_1 and write_global_decls_2
1058 before and after calling symtab->finalize_compilation_unit ().
1059 * jit-playback.c: Include "debug.h".
1060 (gcc::jit::playback::context::new_global): Add "kind" param and
1061 use it to set TREE_PUBLIC, TREE_STATIC and DECL_EXTERNAL on the
1062 underlying VAR_DECL. Call varpool_node::get_create on the
1063 VAR_DECL, and add it to m_globals.
1064 (gcc::jit::playback::context::write_global_decls_1): New function.
1065 (gcc::jit::playback::context::write_global_decls_2): New function.
1066 * jit-playback.h (gcc::jit::playback::context::context): Call
1067 create on m_globals.
1068 (gcc::jit::playback::context::new_global): Add "kind" param.
1069 (gcc::jit::playback::context::write_global_decls_1): New function.
1070 (gcc::jit::playback::context::write_global_decls_2): New function.
1071 (gcc::jit::playback::context::m_globals): New field.
1072 * jit-recording.c (gcc::jit::recording::context::context):
1073 Initialize m_globals.
1074 (gcc::jit::recording::context::new_global): Add param "kind".
1075 Add the new global to m_globals.
1076 (gcc::jit::recording::context::dump_to_file): Dump the globals.
1077 (gcc::jit::recording::global::replay_into): Add field m_kind.
1078 (gcc::jit::recording::global::write_to_dump): New override.
1079 * jit-recording.h (gcc::jit::recording::context::new_global): Add
1081 (gcc::jit::recording::context::m_globals): New field.
1082 (gcc::jit::recording::global::global): Add param kind.
1083 (gcc::jit::recording::global::write_to_dump): New override.
1084 (gcc::jit::recording::global::m_kind): New field.
1085 * jit-result.c (gcc::jit::result::get_global): New function.
1086 * jit-result.h (gcc::jit::result::get_global): New function.
1087 * libgccjit++.h (gccjit::context::new_global): Add "kind" param.
1088 * libgccjit.c (gcc_jit_context_new_global): Likewise.
1089 (gcc_jit_result_get_global): New API entrypoint.
1090 * libgccjit.h (gcc_jit_result_get_global): New API entrypoint.
1091 (enum gcc_jit_global_kind): New enum.
1092 (gcc_jit_context_new_global): API change: add "kind" param.
1093 * libgccjit.map (gcc_jit_result_get_global): New symbol.
1095 2015-01-09 David Malcolm <dmalcolm@redhat.com>
1097 * dummy-frontend.c: Include "fixed-value.h", "alias.h", "flags.h",
1098 "symtab.h", "inchash.h". Move include of "hash-set.h" much
1100 * jit-builtins.c: Remove redundant includes of "opts.h" and
1102 * jit-common.h: Include "hash-set.h", "input.h", "vec.h",
1103 "double-int.h", "alias.h", "flags.h", "symtab.h", "inchash.h".
1104 * jit-playback.c: Include "hashtab.h", "machmode.h", "input.h",
1105 "statistics.h", "vec.h", "double-int.h", "real.h",
1106 "fixed-value.h", "alias.h", "flags.h", "symtab.h", "tree-core.h",
1107 "inchash.h", "fold-const.h". Move include of "hash-set.h" to
1109 * jit-recording.c: Remove redundant includes of "opts.h" and
1112 2015-01-09 David Malcolm <dmalcolm@redhat.com>
1114 * docs/cp/topics/expressions.rst (Simple expressions): Use
1115 ":c:type:" for C types. Document new overload of
1116 gcc::jit::context::new_rvalue.
1117 * docs/topics/expressions.rst (Simple expressions): Use
1118 ":c:type:" for C types. Document new entrypoint
1119 gcc_jit_context_new_rvalue_from_long.
1120 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1121 * jit-playback.c: Within namespace gcc::jit::playback...
1122 (context::new_rvalue_from_int): Eliminate in favor of...
1123 (context::new_rvalue_from_const <int>): ...this.
1124 (context::new_rvalue_from_double): Eliminate in favor of...
1125 (context::new_rvalue_from_const <double>): ...this.
1126 (context::new_rvalue_from_const <long>): New.
1127 (context::new_rvalue_from_ptr): Eliminate in favor of...
1128 (context::new_rvalue_from_const <void *>): ...this.
1129 * jit-playback.h: Within namespace gcc::jit::playback...
1130 (context::new_rvalue_from_int): Eliminate in favor of...
1131 (context::new_rvalue_from_const <HOST_TYPE>): ...this.
1132 (context::new_rvalue_from_double): Likewise.
1133 (context::new_rvalue_from_ptr): Likewise.
1134 * jit-recording.c: Within namespace gcc::jit::recording...
1135 (context::new_rvalue_from_int): Eliminate.
1136 (context::new_rvalue_from_double): Likewise.
1137 (context::new_rvalue_from_ptr): Likewise.
1138 (class memento_of_new_rvalue_from_const <int>):
1139 Add explicit specialization.
1140 (class memento_of_new_rvalue_from_const <long>):
1142 (class memento_of_new_rvalue_from_const <double>):
1144 (class memento_of_new_rvalue_from_const <void *>):
1146 (memento_of_new_rvalue_from_int::replay_into):
1148 (memento_of_new_rvalue_from_const <HOST_TYPE>::replay_into):
1150 (memento_of_new_rvalue_from_double::replay_into):
1152 (memento_of_new_rvalue_from_ptr::replay_into):
1153 ...and this to be deleted.
1154 (memento_of_new_rvalue_from_int::make_debug_string):
1156 (memento_of_new_rvalue_from_const <int>::make_debug_string):
1158 (memento_of_new_rvalue_from_double::make_debug_string):
1160 (memento_of_new_rvalue_from_const <double>::make_debug_string):
1162 (memento_of_new_rvalue_from_ptr::make_debug_string)
1164 (memento_of_new_rvalue_from_const <void *>::make_debug_string):
1166 (memento_of_new_rvalue_from_const <long>::make_debug_string):
1168 * jit-recording.h: Within namespace gcc::jit::recording...
1169 (context::new_rvalue_from_int): Eliminate.
1170 (context::new_rvalue_from_double): Likewise.
1171 (context::new_rvalue_from_ptr): Likewise, all in favor of...
1172 (context::new_rvalue_from_const <HOST_TYPE>): New family of
1174 (class memento_of_new_rvalue_from_int): Eliminate.
1175 (class memento_of_new_rvalue_from_double): Likewise.
1176 (class memento_of_new_rvalue_from_ptr): Likewise.
1177 (class memento_of_new_rvalue_from_const <HOST_TYPE>): New family
1178 of rvalue subclasses.
1179 * libgccjit++.h (gccjit::context::new_rvalue): New overload, for
1181 * libgccjit.c (gcc_jit_context_new_rvalue_from_int): Update for
1182 rewriting of recording::context::new_rvalue_from_int to
1183 recording::context::new_rvalue_from_const <int>.
1184 (gcc_jit_context_new_rvalue_from_long): New API entrypoint.
1185 (gcc_jit_context_new_rvalue_from_double): Update for
1186 rewriting of recording::context::new_rvalue_from_double to
1187 recording::context::new_rvalue_from_const <double>.
1188 (gcc_jit_context_new_rvalue_from_ptr): Update for
1189 rewriting of recording::context::new_rvalue_from_ptr to
1190 recording::context::new_rvalue_from_const <void *>.
1191 * libgccjit.h (gcc_jit_context_new_rvalue_from_long): New API
1193 * libgccjit.map (gcc_jit_context_new_rvalue_from_long): Likewise.
1195 2015-01-09 David Malcolm <dmalcolm@redhat.com>
1198 * docs/internals/test-hello-world.exe.log.txt: Update, the log now
1199 shows tempdir creation/cleanup.
1200 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1201 * jit-logging.h (class gcc::jit::log_user): Add gcc::jit::tempdir
1202 to the list of subclasses in the comment.
1203 * jit-playback.c (gcc::jit::playback::context::context): Add a
1204 comment clarifying when the tempdir gets cleaned up.
1205 (gcc::jit::playback::context::compile): Pass the context's logger,
1206 if any, to the tempdir.
1207 (gcc::jit::playback::context::dlopen_built_dso): When creating the
1208 gcc::jit::result, if GCC_JIT_BOOL_OPTION_DEBUGINFO is set, hand
1209 over ownership of the tempdir to it.
1210 * jit-result.c: Include "jit-tempdir.h".
1211 (gcc::jit::result::result): Add tempdir param, saving it as
1213 (gcc::jit::result::~result): Delete m_tempdir.
1214 * jit-result.h (gcc::jit::result::result): Add tempdir param.
1215 (gcc::jit::result::m_tempdir): New field.
1216 * jit-tempdir.c (gcc::jit::tempdir::tempdir): Add logger param;
1218 (gcc::jit::tempdir::create): Add JIT_LOG_SCOPE to log entry/exit,
1219 and log m_path_template and m_path_tempdir.
1220 (gcc::jit::tempdir::~tempdir): Add JIT_LOG_SCOPE to log
1221 entry/exit, and log the unlink and rmdir calls.
1222 * jit-tempdir.h: Include "jit-logging.h".
1223 (class gcc::jit::tempdir): Make this be a subclass of log_user.
1224 (gcc::jit::tempdir::tempdir): Add logger param.
1225 * notes.txt: Update to show the two possible places where the
1226 tempdir can be cleaned up.
1228 2015-01-08 David Malcolm <dmalcolm@redhat.com>
1230 * libgccjit.h (struct gcc_jit_context): Rewrite the descriptive
1233 2015-01-08 David Malcolm <dmalcolm@redhat.com>
1235 * docs/topics/contexts.rst (Error-handling): Document new
1236 entrypoint gcc_jit_context_get_last_error.
1237 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1238 * jit-recording.c (gcc::jit::recording::context::context):
1239 Initialize new fields "m_last_error_str" and
1240 "m_owns_last_error_str".
1241 (gcc::jit::recording::context::~context): Clean up
1242 m_last_error_str, if needed.
1243 (gcc::jit::recording::context::add_error_va): Update
1244 m_last_error_str and m_owns_last_error_str, freeing the old
1245 value if appropriate.
1246 (gcc::jit::recording::context::get_last_error): New function.
1247 * jit-recording.h (gcc::jit::recording::context::get_last_error):
1249 (gcc::jit::recording::context): New fields m_last_error_str and
1250 m_owns_last_error_str.
1251 * libgccjit.c (gcc_jit_context_get_last_error): New function.
1252 * libgccjit.h (gcc_jit_context_get_last_error): New declaration.
1253 * libgccjit.map (gcc_jit_context_get_last_error): New function.
1255 2015-01-08 David Malcolm <dmalcolm@redhat.com>
1257 * Make-lang.in (jit_OBJS): Add jit/jit-logging.o.
1258 * docs/internals/index.rst (Overview of code structure): Mention
1259 gcc_jit_context_set_logfile, and embed the example logfile.
1260 * docs/internals/test-hello-world.exe.log.txt: New file: example
1262 * docs/topics/contexts.rst (Debugging): Add documentation
1263 for gcc_jit_context_set_logfile.
1264 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1265 * dummy-frontend.c: Include "jit-logging.h".
1266 (jit_langhook_init): Assert that there is an active playback
1267 context. If it has a logger, log entry/exit to this function.
1268 (jit_langhook_write_globals): Likewise.
1269 * jit-common.h (gcc::jit::logger): New forward declaration.
1270 * jit-logging.c: New file.
1271 * jit-logging.h: New file.
1272 * jit-playback.c: Include "jit-logging.h".
1273 (gcc::jit::playback::context::context): Initialize the log_user
1274 base class from the recording context's logger (if any). Use
1275 JIT_LOG_SCOPE to log entry/exit from the function body.
1276 (gcc::jit::playback::context::~context): Use JIT_LOG_SCOPE to
1277 log entry/exit from the function body.
1278 (gcc::jit::playback::build_stmt_list): Likewise.
1279 (gcc::jit::playback::function::postprocess): Likewise.
1280 (gcc::jit::playback::context::compile): Likewise. Log the
1281 entry/exit to toplev::main and toplev::finalize. Log the
1282 fake argv passed to toplev::main.
1283 (gcc::jit::playback::context::acquire_mutex): Use JIT_LOG_SCOPE to
1284 log entry/exit from the function body.
1285 (gcc::jit::playback::context::release_mutex): Likewise.
1286 (gcc::jit::playback::context::make_fake_args): Likewise.
1287 (gcc::jit::playback::context::extract_any_requested_dumps):
1289 (gcc::jit::playback::context::convert_to_dso): Likewise. Also,
1290 log the arguments that the driver is invoked with.
1291 (gcc::jit::playback::context::dlopen_built_dso): Likewise. Pass
1292 the logger to the result object.
1293 (gcc::jit::playback::context::replay): Use JIT_LOG_SCOPE to
1294 log entry/exit from the function body.
1295 (gcc::jit::playback::context::dump_generated_code): Likewise.
1296 (gcc::jit::playback::context::handle_locations): Likewise.
1297 * jit-playback.h (gcc::jit::playback::context): Make this be
1298 a subclass of gcc::jit::log_user.
1299 * jit-recording.c: Include "jit-logging.h".
1300 (gcc::jit::recording::context::context: Initialize the logger to
1301 NULL for root contexts, or to the parent's logger for child
1303 (gcc::jit::recording::context::~context): Use JIT_LOG_SCOPE to
1304 log entry/exit from the function body.
1305 (gcc::jit::recording::context::replay_into): Likewise.
1306 (gcc::jit::recording::context::disassociate_from_playback):
1308 (gcc::jit::recording::context::compile): Likewise.
1309 (recording::context::add_error_va): Likewise. Also, log the
1311 (gcc::jit::recording::context::validate): Use JIT_LOG_SCOPE to
1312 log entry/exit from the function body.
1313 * jit-recording.h: Include "jit-logging.h".
1314 (gcc::jit::recording::context): Make this be a subclass of
1316 * jit-result.c: Include "jit-common.h" and "jit-logging.h".
1317 (gcc::jit::result::result): Add logger param, recording it.
1318 Use JIT_LOG_SCOPE to log entry/exit from the function body.
1319 (gcc::jit::result::~result(): Use JIT_LOG_SCOPE to
1320 log entry/exit from the function body.
1321 (gcc::jit::result::get_code): Likewise.
1322 * jit-result.h (gcc::jit::result): Make this be a subclass of
1324 (gcc::jit::result::result): Add logger parameter.
1325 * libgccjit++.h (gccjit::context::set_logfile): New function.
1326 * libgccjit.c: Include "jit-logging.h".
1327 (gcc_jit_context_acquire): Log the context.
1328 (gcc_jit_context_release): Use JIT_LOG_FUNC to
1329 log entry/exit from the function body, and log the context.
1330 (gcc_jit_context_new_child_context): Likewise, logging both
1332 (gcc_jit_context_new_location): Use JIT_LOG_FUNC to
1333 log entry/exit from the function body.
1334 (gcc_jit_context_get_type): Likewise.
1335 (gcc_jit_context_get_int_type): Likewise.
1336 (gcc_jit_context_new_array_type): Likewise.
1337 (gcc_jit_context_new_field): Likewise.
1338 (gcc_jit_context_new_struct_type): Likewise.
1339 (gcc_jit_context_new_opaque_struct): Likewise.
1340 (gcc_jit_struct_set_fields): Likewise.
1341 (gcc_jit_context_new_union_type): Likewise.
1342 (gcc_jit_context_new_function_ptr_type): Likewise.
1343 (gcc_jit_context_new_param): Likewise.
1344 (gcc_jit_context_new_function): Likewise.
1345 (gcc_jit_context_get_builtin_function): Likewise.
1346 (gcc_jit_function_get_param): Likewise.
1347 (gcc_jit_function_dump_to_dot): Likewise.
1348 (gcc_jit_function_new_block): Likewise.
1349 (gcc_jit_context_new_global): Likewise.
1350 (gcc_jit_context_new_rvalue_from_int): Likewise.
1351 (gcc_jit_context_zero): Likewise.
1352 (gcc_jit_context_one): Likewise.
1353 (gcc_jit_context_new_rvalue_from_double): Likewise.
1354 (gcc_jit_context_new_rvalue_from_ptr): Likewise.
1355 (gcc_jit_context_null): Likewise.
1356 (gcc_jit_context_new_string_literal): Likewise.
1357 (gcc_jit_context_new_unary_op): Likewise.
1358 (gcc_jit_context_new_binary_op): Likewise.
1359 (gcc_jit_context_new_comparison): Likewise.
1360 (gcc_jit_context_new_call): Likewise.
1361 (gcc_jit_context_new_call_through_ptr): Likewise.
1362 (gcc_jit_context_new_cast): Likewise.
1363 (gcc_jit_context_new_array_access): Likewise.
1364 (gcc_jit_lvalue_access_field): Likewise.
1365 (gcc_jit_rvalue_access_field): Likewise.
1366 (gcc_jit_rvalue_dereference_field): Likewise.
1367 (gcc_jit_rvalue_dereference): Likewise.
1368 (gcc_jit_lvalue_get_address): Likewise.
1369 (gcc_jit_function_new_local): Likewise.
1370 (gcc_jit_block_add_eval): Likewise.
1371 (gcc_jit_block_add_assignment): Likewise.
1372 (gcc_jit_block_add_assignment_op): Likewise.
1373 (gcc_jit_block_end_with_conditional): Likewise.
1374 (gcc_jit_block_add_comment): Likewise.
1375 (gcc_jit_block_end_with_jump): Likewise.
1376 (gcc_jit_block_end_with_return): Likewise.
1377 (gcc_jit_block_end_with_void_return): Likewise.
1378 (gcc_jit_context_set_str_option): Likewise.
1379 (gcc_jit_context_set_int_option): Likewise.
1380 (gcc_jit_context_set_bool_option): Likewise.
1381 (gcc_jit_context_enable_dump): Likewise.
1382 (gcc_jit_context_compile): Likewise. Also log the context,
1384 (gcc_jit_context_dump_to_file): Likewise.
1385 (gcc_jit_context_set_logfile): New function.
1386 (gcc_jit_context_get_first_error): Use JIT_LOG_FUNC to
1387 log entry/exit from the function body.
1388 (gcc_jit_result_get_code): Likewise. Also log the fnname)
1389 and the ptr to be returned.
1390 (gcc_jit_result_release): Likewise. Also log the result.
1391 * libgccjit.h: Include <stdio.h>, since we need FILE *.
1392 (gcc_jit_context_set_logfile): New declaration.
1393 * libgccjit.map (gcc_jit_context_set_logfile): New.
1395 2015-01-07 David Malcolm <dmalcolm@redhat.com>
1397 * jit-recording.h (gcc::jit::recording::type::is_void): New
1399 (gcc::jit::recording::memento_of_get_type::is_void): New
1400 function, overriding default implementation.
1401 * libgccjit.c (gcc_jit_rvalue_dereference): Verify that
1402 the underlying type is not "void".
1404 2015-01-07 David Malcolm <dmalcolm@redhat.com>
1406 * docs/topics/expressions.rst (Unary Operations): Add
1407 GCC_JIT_UNARY_OP_ABS.
1408 * jit-playback.c (gcc::jit::playback::context::new_unary_op):
1410 * jit-recording.c (unary_op_strings): Likewise.
1411 * libgccjit.c (gcc_jit_context_new_unary_op): Update checking
1412 of "op" to reflect addition of GCC_JIT_UNARY_OP_ABS.
1413 * libgccjit.h (enum gcc_jit_unary_op): Add GCC_JIT_UNARY_OP_ABS.
1414 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1416 2015-01-07 David Malcolm <dmalcolm@redhat.com>
1418 * jit-recording.h (gcc::jit::recording::memento_of_get_type): Fix
1421 2015-01-07 David Malcolm <dmalcolm@redhat.com>
1423 * TODO.rst (Test suite): Remove item about running C++ testcases.
1424 * docs/internals/index.rst (Working on the JIT library): Add
1425 "c++" to the enabled languages in the suggested "configure"
1426 invocation, and add a description of why this is necessary.
1427 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1429 2015-01-07 David Malcolm <dmalcolm@redhat.com>
1431 * docs/internals/index.rst: Update to reflect that built
1432 testcases are now test-foo.c.exe, rather than test-foo.exe.
1433 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1435 2015-01-05 Jakub Jelinek <jakub@redhat.com>
1437 Update copyright years.
1439 2014-12-19 David Malcolm <dmalcolm@redhat.com>
1441 * jit-playback.c (gcc::jit::playback::context::build_cast): In
1442 case BOOLEAN_TYPE, don't assume that the source expression is
1445 2014-12-19 David Malcolm <dmalcolm@redhat.com>
1447 * jit-recording.c (gcc::jit::recording::context::context): When
1448 copying string options from a parent context, take a copy of the
1449 underlying buffers, rather than simply copying the pointer.
1451 2014-12-19 David Malcolm <dmalcolm@redhat.com>
1453 * jit-recording.c (gcc::jit::recording::context::set_str_option):
1456 2014-12-11 David Malcolm <dmalcolm@redhat.com>
1458 * docs/cp/topics/contexts.rst (gccjit::context::set_str_option):
1459 Document new function.
1460 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1462 2014-12-10 Ulrich Drepper <drepper@gmail.com>
1464 Minor interface cleanups of libgccjit
1465 * jit-playback.c (convert_to_dso): Use auto_vec instead
1466 of automatic array to build up command line.
1467 * jit-recording.c (recording::context::set_str_option):
1468 Make copy of the string.
1469 (recording::context::~context): Free string options.
1470 * jit-recording.h (recording::context): Adjust type
1471 of m_str_options member.
1472 * libgccjit.h: Adjust comment about
1473 gcc_jit_context_set_str_option parameter being used after
1475 Update comment now that all interfaces are copy strings
1477 * libgccjit++.h (gccjit::context): Add set_str_option
1480 2014-12-10 David Malcolm <dmalcolm@redhat.com>
1482 * docs/cp/index.rst: New file.
1483 * docs/cp/intro/index.rst: New file.
1484 * docs/cp/intro/tutorial01.rst: New file.
1485 * docs/cp/intro/tutorial02.rst: New file.
1486 * docs/cp/intro/tutorial03.rst: New file.
1487 * docs/cp/intro/tutorial04.rst: New file.
1488 * docs/cp/topics/contexts.rst: New file.
1489 * docs/cp/topics/expressions.rst: New file.
1490 * docs/cp/topics/functions.rst: New file.
1491 * docs/cp/topics/index.rst: New file.
1492 * docs/cp/topics/locations.rst: New file.
1493 * docs/cp/topics/objects.rst: New file.
1494 * docs/cp/topics/results.rst: New file.
1495 * docs/cp/topics/types.rst: New file.
1496 * docs/examples/tut01-hello-world.cc: New file.
1497 * docs/examples/tut02-square.c: Fix missing newline in output.
1498 * docs/examples/tut02-square.cc: New file.
1499 * docs/examples/tut03-sum-of-squares.cc: New file.
1500 * docs/examples/tut04-toyvm/toyvm.cc: New file.
1501 * docs/index.rst: Move summary to above the table of contents.
1502 Add text about the C vs C++ APIs.
1503 * docs/topics/contexts.rst: Fix a typo.
1505 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1506 * docs/_build/texinfo/factorial1.png: New file.
1507 * docs/_build/texinfo/sum-of-squares1.png: New file.
1509 2014-12-09 David Malcolm <dmalcolm@redhat.com>
1511 * docs/examples/tut04-toyvm/toyvm.c (toyvm_function_compile): Move
1512 logic for determine "funcname" to new function...
1513 (get_function_name): ...here, adding logic to skip any leading
1514 path from the filename.
1515 (toyvm_function_parse): Use the filename for fn_filename, rather
1516 than "name", so that the debugger can locate the source .toy
1518 (toyvm_function_parse): Don't fclose a NULL FILE *.
1520 2014-12-09 David Malcolm <dmalcolm@redhat.com>
1523 * docs/internals/index.rst (Running under valgrind): New
1525 (docs/_build/texinfo/libgccjit.texi): Regenerate.
1527 2014-12-09 David Malcolm <dmalcolm@redhat.com>
1530 * Make-lang.in (jit_OBJS): Add jit/jit-tempdir.o.
1531 * jit-common.h (gcc::jit::tempdir): New forward decl.
1532 * jit-playback.c: Include jit-tempdir.h.
1533 (gcc::jit::playback::context::context): Initialize m_tempdir.
1534 (gcc::jit::playback::context::~context): Move tempdir
1535 cleanup to new file jit-tempdir.c
1536 (make_tempdir_path_template): Move to new file jit-tempdir.c.
1537 (gcc::jit::playback::context::compile): Move tempdir creation
1538 to new tempdir object in new file jit-tempdir.c.
1539 (gcc::jit::playback::context::make_fake_args): Get path from
1540 tempdir object rather than from member data.
1541 (gcc::jit::playback::context::convert_to_dso): Likewise.
1542 (gcc::jit::playback::context::dlopen_built_dso): Likewise.
1543 (gcc::jit::playback::context::dump_generated_code): Likewise.
1544 (gcc::jit::playback::context::get_path_c_file): New function.
1545 (gcc::jit::playback::context::get_path_s_file): New function.
1546 (gcc::jit::playback::context::get_path_so_file): New function.
1547 * jit-playback.h (gcc::jit::playback::context::get_path_c_file):
1549 (gcc::jit::playback::context::get_path_s_file): New function.
1550 (gcc::jit::playback::context::get_path_so_file): New function.
1551 (gcc::jit::playback::context): Move fields "m_path_template",
1552 "m_path_tempdir", "m_path_c_file", "m_path_s_file",
1553 "m_path_so_file" to new jit::tempdir class; add field "m_tempdir".
1554 * jit-tempdir.c: New file.
1555 * jit-tempdir.h: New file.
1557 2014-12-09 David Malcolm <dmalcolm@redhat.com>
1559 * jit-playback.c (gcc::jit::playback::context::compile): Acquire the
1560 mutex here, immediately before using toplev, and release it here, on
1561 each exit path after acquisition.
1562 (jit_mutex): Move this variable here, from jit-recording.c.
1563 (gcc::jit::playback::context::acquire_mutex): New function, based on
1564 code in jit-recording.c.
1565 (gcc::jit::playback::context::release_mutex): Likewise.
1566 * jit-playback.h (gcc::jit::playback::context::acquire_mutex): New
1568 (gcc::jit::playback::context::release_mutex): New function.
1569 * jit-recording.c (jit_mutex): Move this variable to jit-playback.c.
1570 (gcc::jit::recording::context::compile): Move mutex-handling from
1571 here into jit-playback.c's gcc::jit::playback::context::compile.
1572 * notes.txt: Update to show the new locations of ACQUIRE_MUTEX
1575 2014-12-09 David Malcolm <dmalcolm@redhat.com>
1577 * jit-playback.c (gcc::jit::playback::context::compile): Move the
1579 (gcc::jit::playback::context::dlopen_built_dso): ...this new
1581 * jit-playback.h (gcc::jit::playback::context::dlopen_built_dso):
1584 2014-12-09 David Malcolm <dmalcolm@redhat.com>
1587 * docs/topics/contexts.rst (Debugging): Add description of
1588 gcc_jit_context_enable_dump.
1589 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1590 * jit-playback.c: Include context.h.
1591 (class auto_argvec): New class.
1592 (auto_argvec::~auto_argvec): New function.
1593 (gcc::jit::playback::context::compile): Convert fake_args to be
1594 an auto_argvec, so that it can contain dynamically-allocated
1595 strings. Construct a vec of all requested dumps, and pass it to
1596 make_fake_args. Extract requested dumps between the calls to
1597 toplev::main and toplev::finalize.
1598 (gcc::jit::playback::context::make_fake_args): Convert param
1599 "argvec" to be a vec <char *>, and gain a "requested_dumps"
1600 param. Convert to dynamically-allocated arg strings by converting
1601 ADD_ARG to take a copy of the arg, and add ADD_ARG_TAKE_OWNERSHIP
1602 for args that are already a copy. Add args for all requested dumps.
1603 (gcc::jit::playback::context::extract_any_requested_dumps): New
1605 (gcc::jit::playback::context::read_dump_file): New function.
1606 * jit-playback.h (gcc::jit::playback::context::make_fake_args):
1607 Convert param "argvec" to be a vec <char *>, and gain a
1608 "requested_dumps" param.
1609 (gcc::jit::playback::context::extract_any_requested_dumps): New
1611 (gcc::jit::playback::context::read_dump_file): New function.
1612 * jit-recording.c (gcc::jit::recording::context::enable_dump): New
1614 (gcc::jit::recording::context::get_all_requested_dumps): New
1616 * jit-recording.h (gcc::jit::recording::requested_dump): New
1618 (gcc::jit::recording::context::enable_dump): New function.
1619 (gcc::jit::recording::context::get_all_requested_dumps): New
1621 (gcc::jit::recording::context::m_requested_dumps): New field.
1622 * libgccjit.c (gcc_jit_context_enable_dump): New API entrypoint.
1623 * libgccjit.h (gcc_jit_context_enable_dump): New API entrypoint.
1624 * libgccjit.map (gcc_jit_context_enable_dump): New API entrypoint.
1626 2014-12-08 David Malcolm <dmalcolm@redhat.com>
1628 * libgccjit++.h: Indent the forward declarations of the classes to
1629 show the inheritance hierarchy.
1631 2014-12-08 David Malcolm <dmalcolm@redhat.com>
1633 * notes.txt: Show the beginning and ending of
1634 recording::context::compile vs playback::context::compile. Show
1635 the creation and unlinking of the tempdir. Show toplev::finalize.
1636 Move "RELEASE MUTEX" to the correct location. Show
1637 gcc_jit_result_release, and indicate where the
1638 dlopen/dlsym/dlclose occur.
1640 2014-12-01 David Malcolm <dmalcolm@redhat.com>
1642 * docs/examples/tut02-square.c (main): Release the context
1643 earlier, to show that this is possible. Update error-handling
1644 to avoid a double-release of the context, and to avoid
1645 releasing a NULL result.
1646 * docs/intro/tutorial02.rst: Discuss gcc_jit_context_release.
1647 * docs/topics/functions.rst (GCC_JIT_FUNCTION_EXPORTED): Emphasize
1648 * docs/topics/results.rst (gcc_jit_result): Mention that this
1649 controls the lifetimes of machine code functions.
1650 (gcc_jit_result_get_code): Spell out the requirements for this
1651 to succeed, and the lifetime of the result.
1652 (gcc_jit_result_release): Mention that this invalidates any code
1653 that was obtained from the result.
1654 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1656 2014-12-01 David Malcolm <dmalcolm@redhat.com>
1659 * docs/intro/tutorial02.rst: Spell out lifetime of generated code.
1660 Add description of error-handling, taken in part from...
1661 * docs/topics/contexts.rst (Error-handling): Expand, and move some
1662 content to tutorial02.rst.
1663 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1665 2014-12-01 David Malcolm <dmalcolm@redhat.com>
1668 * docs/topics/types.rst (Standard types) Add new enum values to
1669 the table of enum gcc_jit_types: GCC_JIT_TYPE_COMPLEX_FLOAT,
1670 GCC_JIT_TYPE_COMPLEX_DOUBLE, GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE.
1671 Widen the left-hand column so that
1672 GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE will fit.
1673 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1675 * jit-builtins.c: Include stringpool.h and jit-playback.h.
1676 Move everything out of the gcc::jit::recording namespace into
1678 (struct builtin_data): Add fields "fnclass", "attr", and
1680 (DEF_BUILTIN): Update macro so populate the new fields.
1681 (builtins_manager::builtins_manager): Update for move out of
1682 recording namespace. Initialize the m_attributes array.
1683 (builtins_manager::get_builtin_function): Likewise.
1684 (builtins_manager::get_builtin_function_by_id): New function.
1685 (builtins_manager::make_builtin_function): Update for move out of
1686 recording namespace. Add fix for PR jit/64020 by detecting
1687 specific builtin ids and having them ensure that builtins for
1688 other ids are created as necessary.
1689 (builtins_manager::get_type): Update for move out of recording
1691 (builtins_manager::make_type): Likewise. Add some missing
1693 (builtins_manager::make_primitive_type): Update for move out of
1694 recording namespace. Implement the three BT_COMPLEX_ cases and
1696 (builtins_manager::make_fn_type): Update for move out of recording
1698 (builtins_manager::make_ptr_type): Likewise.
1699 (builtins_manager::finish_playback): New function.
1700 (builtins_manager::get_class): New function.
1701 (builtins_manager::implicit_p): New function.
1702 (builtins_manager::get_attrs_tree): Two new functions.
1703 (builtins_manager::make_attrs_tree): New function.
1705 * jit-builtins.h: Move everything out of the gcc::jit::recording
1706 namespace into just gcc::jit.
1707 (enum built_in_attribute): New.
1708 (builtins_manager::builtins_manager): Update decl for namespace
1710 (builtins_manager::get_builtin_function): Likewise.
1711 (builtins_manager::get_class): New.
1712 (builtins_manager::implicit_p): New.
1713 (builtins_manager::get_attrs_tree): Two new functions.
1714 (builtins_manager::make_attrs_tree): New function.
1715 (builtins_manager::finish_playback): New.
1716 (builtins_manager::get_builtin_function_by_id): New.
1717 (builtins_manager::make_builtin_function): Update decl for
1719 (builtins_manager::get_type): Likewise.
1720 (builtins_manager::make_type): Likewise.
1721 (builtins_manager::make_primitive_type): Likewise.
1722 (builtins_manager::make_fn_type): Likewise.
1723 (builtins_manager::make_ptr_type): Likewise.
1724 (builtins_manager): Likewise for fields. Add new field
1727 * jit-common.h (NUM_GCC_JIT_TYPES): Update.
1728 (builtins_manager): Update forward decl to reflect namespace
1731 * jit-playback.c: Include attribs.h and jit-builtins.h.
1732 (gcc::jit::playback::context::get_tree_node_for_type): Add cases
1733 for the new COMPLEX_ types.
1734 (gcc::jit::playback::context::new_function): If creating a
1735 builtin, set the DECL_BUILT_IN_CLASS and attributes on the fndecl,
1736 and call set_builtin_decl.
1737 (gcc::jit::playback::context::replay): If we have a
1738 builtins_manager, call its finish_playback method when we're done.
1741 (gcc::jit::playback::context::get_builtins_manager): New function.
1744 (gcc::jit::recording::context::get_builtins_manager): New function.
1745 (gcc::jit::recording::get_builtin_function): Use
1746 get_builtins_manager, in case we're a child context.
1747 (gcc::jit::recording::memento_of_get_type::dereference): Add the
1749 (gcc::jit::recording::memento_of_get_type::is_int): Likewise.
1750 (gcc::jit::recording::memento_of_get_type::is_float): Likewise.
1751 (gcc::jit::recording::memento_of_get_type::is_bool): Likewise.
1752 (get_type_strings): Likewise.
1755 (gcc::jit::recording::context::get_builtins_manager): New.
1757 * libgccjit.h (enum gcc_jit_types): Add
1758 GCC_JIT_TYPE_COMPLEX_FLOAT, GCC_JIT_TYPE_COMPLEX_DOUBLE,
1759 GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE.
1761 2014-12-01 David Malcolm <dmalcolm@redhat.com>
1764 (gcc::jit::recording::builtins_manager::get_builtin_function):
1765 Check for NULL return from make_builtin_function.
1766 (gcc::jit::recording::builtins_manager::make_builtin_function):
1767 Check for NULL return from get_type.
1769 2014-12-01 David Malcolm <dmalcolm@redhat.com>
1771 * jit-playback.c (gcc::jit::playback::context::compile): Move DSO
1772 creation code into...
1773 (gcc::jit::playback::context::convert_to_dso): New function.
1774 * jit-playback.h (gcc::jit::playback::context::convert_to_dso):
1777 2014-12-01 David Malcolm <dmalcolm@redhat.com>
1779 * jit-playback.c (gcc::jit::playback::context::compile): Use an
1780 auto_vec<const char *> rather than a const char *[20] for the
1781 top-level argv, and move the logic to build it to...
1782 (gcc::jit::playback::context::make_fake_args): New function.
1783 * jit-playback.h (gcc::jit::playback::context::make_fake_args):
1786 2014-12-01 David Malcolm <dmalcolm@redhat.com>
1788 * Make-lang.in (jit_OBJS): Add jit/jit-result.o.
1789 * jit-playback.c: Include new header jit-result.h.
1790 (gcc::jit::result::result): Move to new file jit-result.c.
1791 (gcc::jit::result::~result): Likewise.
1792 (gcc::jit::playback::result): Likewise.
1793 * jit-recording.h (class gcc::jit::result): Move to new
1794 header jit-result.h.
1795 * jit-result.c: New file, to contain...
1796 (gcc::jit::result::result): Move here from jit-playback.c,
1797 removing erroneous "playback" namespace from comment.
1798 (gcc::jit::result::~result): Likewise.
1799 (gcc::jit::playback::result): Likewise.
1800 * jit-result.h: New file, to contain...
1801 (class gcc::jit::result): Move from jit-recording.h.
1802 * libgccjit.c: Include jit-result.h.
1803 (gcc_jit_result_get_code): Update comment to reflect move
1805 (gcc_jit_result_release): Likewise.
1807 2014-12-01 David Malcolm <dmalcolm@redhat.com>
1810 * docs/examples/tut04-toyvm/toyvm.c
1811 (toyvm_compiled_function): New typedef.
1812 (toyvm_compiled_func) Rename to...
1813 (toyvm_compiled_code) ...this.
1814 (struct toyvm_compiled_function): New struct.
1815 (toyvm_function_compile): Return a toyvm_compiled_function *
1816 rather than a toyvm_compiled_func, so that the caller can fully
1817 clean things up. Free "funcname".
1818 (test_script): Update for change to toyvm_function_compile.
1819 Clean up the toyvm_compiled_function.
1821 (docs/intro/tutorial04.rst): Update to reflect the above changes,
1822 and to better spell out the lifetime of the compiled code.
1824 2014-12-01 David Malcolm <dmalcolm@redhat.com>
1828 (gcc::jit::recording::builtins_manager::make_fn_type): Call the
1829 context's new_function_type method, rather than directly creating
1830 a function_type instance.
1832 (gcc::jit::recording::context::new_function_type): New method,
1833 adapted from part of...
1834 (gcc::jit::recording::context::new_function_ptr_type): ...this.
1835 Update to call new_function_type.
1837 (gcc::jit::recording::context::new_function_type): New method.
1839 2014-12-01 David Malcolm <dmalcolm@redhat.com>
1842 * jit-playback.c: Ensure that ctxt_progname is non-NULL.
1844 2014-11-19 David Malcolm <dmalcolm@redhat.com>
1847 * jit-playback.c (gcc::jit::playback::compound_type::set_fields):
1848 Convert param from const vec<playback::field *> & to
1849 const auto_vec<playback::field *> *.
1850 (gcc::jit::playback::context::new_function_type): Convert param
1851 "param_types" from vec<type *> * to const auto_vec<type *> *.
1852 (gcc::jit::playback::context::new_function): Convert param
1853 "params" from vec<param *> * to const auto_vec<param *> *.
1854 (gcc::jit::playback::context::build_call): Convert param "args"
1855 from vec<rvalue *> to const auto_vec<rvalue *> *.
1856 (gcc::jit::playback::context::new_call): Likewise.
1857 (gcc::jit::playback::context::new_call_through_ptr): Likewise.
1858 (wrapper_finalizer): New function.
1859 (gcc::jit::playback::wrapper::operator new): Call the finalizer
1860 variant of ggc_internal_cleared_alloc, supplying
1862 (gcc::jit::playback::function::finalizer): New.
1863 (gcc::jit::playback::block::finalizer): New.
1864 (gcc::jit::playback::source_file::finalizer): New.
1865 (gcc::jit::playback::source_line::finalizer): New.
1868 (gcc::jit::playback::context::new_function_type): Convert param
1869 "param_types" from vec<type *> * to const auto_vec<type *> *.
1870 (gcc::jit::playback::context::new_function): Convert param
1871 "params" from vec<param *> * to const auto_vec<param *> *.
1872 (gcc::jit::playback::context::new_call): Convert param
1873 "args" from vec<rvalue *> to const auto_vec<rvalue *> *.
1874 (gcc::jit::playback::context::new_call_through_ptr): Likewise.
1875 (gcc::jit::playback::context::build_call): Likewise.
1876 (gcc::jit::playback::context): Convert fields "m_functions",
1877 "m_source_files", "m_cached_locations" from vec to auto_vec.
1878 (gcc::jit::playback::wrapper::finalizer): New virtual function.
1879 (gcc::jit::playback::compound_type::set_fields): Convert param fro
1880 const vec<playback::field *> & to
1881 const auto_vec<playback::field *> *.
1882 (gcc::jit::playback::function::finalizer): New.
1883 (gcc::jit::playback::block::finalizer): New.
1884 (gcc::jit::playback::source_file::finalizer): New.
1885 (gcc::jit::playback::source_line::finalizer): New.
1888 (gcc::jit::recording::function_type::replay_into): Convert local
1889 from a vec into an auto_vec.
1890 (gcc::jit::recording::fields::replay_into): Likewise.
1891 (gcc::jit::recording::function::replay_into): Likewise.
1892 (gcc::jit::recording::call::replay_into): Likewise.
1893 (gcc::jit::recording::call_through_ptr::replay_into): Likewise.
1895 * jit-recording.h (gcc::jit::recording::context): Convert fields
1896 "m_mementos", "m_compound_types", "m_functions" from vec<> to
1898 (gcc::jit::recording::function_type::get_param_types): Convert
1899 return type from vec<type *> to const vec<type *> &.
1900 (gcc::jit::recording::function_type): Convert field
1901 "m_param_types" from a vec<> to an auto_vec<>.
1902 (gcc::jit::recording::fields): Likewise for field "m_fields".
1903 (gcc::jit::recording::function::get_params): Convert return type
1904 from vec <param *> to const vec<param *> &.
1905 (gcc::jit::recording::function): Convert fields "m_params",
1906 "m_locals", "m_blocks" from vec<> to auto_vec<>.
1907 (gcc::jit::recording::block): Likewise for field "m_statements".
1908 vec<> to auto_vec<>.
1909 (gcc::jit::recording::call): Likewise for field "m_args".
1910 (gcc::jit::recording::call_through_ptr): Likewise.
1912 2014-11-19 David Malcolm <dmalcolm@redhat.com>
1915 * jit-recording.c (recording::function::validate): Convert
1916 "worklist" from vec<> to autovec<> to fix a leak.
1918 2014-11-11 David Malcolm <dmalcolm@redhat.com>
1920 * ChangeLog.jit: New.
1922 * Make-lang.in: New.
1924 * config-lang.in: New.
1925 * docs/Makefile: New.
1926 * docs/_build/texinfo/Makefile: New.
1927 * docs/_build/texinfo/factorial.png: New.
1928 * docs/_build/texinfo/libgccjit.texi: New.
1929 * docs/_build/texinfo/sum-of-squares.png: New.
1930 * docs/conf.py: New.
1931 * docs/examples/tut01-hello-world.c: New.
1932 * docs/examples/tut02-square.c: New.
1933 * docs/examples/tut03-sum-of-squares.c: New.
1934 * docs/examples/tut04-toyvm/Makefile: New.
1935 * docs/examples/tut04-toyvm/factorial.toy: New.
1936 * docs/examples/tut04-toyvm/fibonacci.toy: New.
1937 * docs/examples/tut04-toyvm/toyvm.c: New.
1938 * docs/index.rst: New.
1939 * docs/internals/index.rst: New.
1940 * docs/intro/factorial.png: New.
1941 * docs/intro/index.rst: New.
1942 * docs/intro/sum-of-squares.png: New.
1943 * docs/intro/tutorial01.rst: New.
1944 * docs/intro/tutorial02.rst: New.
1945 * docs/intro/tutorial03.rst: New.
1946 * docs/intro/tutorial04.rst: New.
1947 * docs/topics/contexts.rst: New.
1948 * docs/topics/expressions.rst: New.
1949 * docs/topics/functions.rst: New.
1950 * docs/topics/index.rst: New.
1951 * docs/topics/locations.rst: New.
1952 * docs/topics/objects.rst: New.
1953 * docs/topics/results.rst: New.
1954 * docs/topics/types.rst: New.
1955 * dummy-frontend.c: New.
1956 * jit-builtins.c: New.
1957 * jit-builtins.h: New.
1958 * jit-common.h: New.
1959 * jit-playback.c: New.
1960 * jit-playback.h: New.
1961 * jit-recording.c: New.
1962 * jit-recording.h: New.
1963 * libgccjit++.h: New.
1966 * libgccjit.map: New.
1969 2013-07-26 David Malcolm <dmalcolm@redhat.com>
1973 Copyright (C) 2013-2016 Free Software Foundation, Inc.
1975 Copying and distribution of this file, with or without modification,
1976 are permitted in any medium without royalty provided the copyright
1977 notice and this notice are preserved.