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