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