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