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