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