libgccjit++.h: use indentation to show inheritance
[official-gcc.git] / gcc / jit / ChangeLog
blobafe1e66b493740122597166625b8889f7535f80d
1 2014-12-08  David Malcolm  <dmalcolm@redhat.com>
3         * libgccjit++.h: Indent the forward declarations of the classes to
4         show the inheritance hierarchy.
6 2014-12-08  David Malcolm  <dmalcolm@redhat.com>
8         * notes.txt: Show the beginning and ending of
9         recording::context::compile vs playback::context::compile.  Show
10         the creation and unlinking of the tempdir.  Show toplev::finalize.
11         Move "RELEASE MUTEX" to the correct location.  Show
12         gcc_jit_result_release, and indicate where the
13         dlopen/dlsym/dlclose occur.
15 2014-12-01  David Malcolm  <dmalcolm@redhat.com>
17         * docs/examples/tut02-square.c (main): Release the context
18         earlier, to show that this is possible.  Update error-handling
19         to avoid a double-release of the context, and to avoid
20         releasing a NULL result.
21         * docs/intro/tutorial02.rst: Discuss gcc_jit_context_release.
22         * docs/topics/functions.rst (GCC_JIT_FUNCTION_EXPORTED): Emphasize
23         * docs/topics/results.rst (gcc_jit_result): Mention that this
24         controls the lifetimes of machine code functions.
25         (gcc_jit_result_get_code): Spell out the requirements for this
26         to succeed, and the lifetime of the result.
27         (gcc_jit_result_release): Mention that this invalidates any code
28         that was obtained from the result.
29         * docs/_build/texinfo/libgccjit.texi: Regenerate.
31 2014-12-01  David Malcolm  <dmalcolm@redhat.com>
33         PR jit/64018
34         * docs/intro/tutorial02.rst: Spell out lifetime of generated code.
35         Add description of error-handling, taken in part from...
36         * docs/topics/contexts.rst (Error-handling): Expand, and move some
37         content to tutorial02.rst.
38         * docs/_build/texinfo/libgccjit.texi: Regenerate.
40 2014-12-01  David Malcolm  <dmalcolm@redhat.com>
42         PR jit/64020
43         * docs/topics/types.rst (Standard types) Add new enum values to
44         the table of enum gcc_jit_types: GCC_JIT_TYPE_COMPLEX_FLOAT,
45         GCC_JIT_TYPE_COMPLEX_DOUBLE, GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE.
46         Widen the left-hand column so that
47         GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE will fit.
48         * docs/_build/texinfo/libgccjit.texi: Regenerate.
50         * jit-builtins.c: Include stringpool.h and jit-playback.h.
51         Move everything out of the gcc::jit::recording namespace into
52         just gcc::jit.
53         (struct builtin_data): Add fields "fnclass", "attr", and
54         "implicit_p".
55         (DEF_BUILTIN): Update macro so populate the new fields.
56         (builtins_manager::builtins_manager): Update for move out of
57         recording namespace.  Initialize the m_attributes array.
58         (builtins_manager::get_builtin_function): Likewise.
59         (builtins_manager::get_builtin_function_by_id): New function.
60         (builtins_manager::make_builtin_function): Update for move out of
61         recording namespace.  Add fix for PR jit/64020 by detecting
62         specific builtin ids and having them ensure that builtins for
63         other ids are created as necessary.
64         (builtins_manager::get_type): Update for move out of recording
65         namespace.
66         (builtins_manager::make_type): Likewise.  Add some missing
67         #undefs.
68         (builtins_manager::make_primitive_type): Update for move out of
69         recording namespace.  Implement the three BT_COMPLEX_ cases and
70         BT_DOUBLE_PTR.
71         (builtins_manager::make_fn_type): Update for move out of recording
72         namespace.
73         (builtins_manager::make_ptr_type): Likewise.
74         (builtins_manager::finish_playback): New function.
75         (builtins_manager::get_class): New function.
76         (builtins_manager::implicit_p): New function.
77         (builtins_manager::get_attrs_tree): Two new functions.
78         (builtins_manager::make_attrs_tree): New function.
80         * jit-builtins.h: Move everything out of the gcc::jit::recording
81         namespace into just gcc::jit.
82         (enum built_in_attribute): New.
83         (builtins_manager::builtins_manager): Update decl for namespace
84         change.
85         (builtins_manager::get_builtin_function): Likewise.
86         (builtins_manager::get_class): New.
87         (builtins_manager::implicit_p): New.
88         (builtins_manager::get_attrs_tree): Two new functions.
89         (builtins_manager::make_attrs_tree): New function.
90         (builtins_manager::finish_playback): New.
91         (builtins_manager::get_builtin_function_by_id): New.
92         (builtins_manager::make_builtin_function): Update decl for
93         namespace change.
94         (builtins_manager::get_type): Likewise.
95         (builtins_manager::make_type): Likewise.
96         (builtins_manager::make_primitive_type): Likewise.
97         (builtins_manager::make_fn_type): Likewise.
98         (builtins_manager::make_ptr_type): Likewise.
99         (builtins_manager): Likewise for fields.  Add new field
100         "m_attributes".
102         * jit-common.h (NUM_GCC_JIT_TYPES): Update.
103         (builtins_manager): Update forward decl to reflect namespace
104         change.
106         * jit-playback.c: Include attribs.h and jit-builtins.h.
107         (gcc::jit::playback::context::get_tree_node_for_type): Add cases
108         for the new COMPLEX_ types.
109         (gcc::jit::playback::context::new_function): If creating a
110         builtin, set the DECL_BUILT_IN_CLASS and attributes on the fndecl,
111         and call set_builtin_decl.
112         (gcc::jit::playback::context::replay): If we have a
113         builtins_manager, call its finish_playback method when we're done.
115         * jit-playback.h:
116         (gcc::jit::playback::context::get_builtins_manager): New function.
118         * jit-recording.c
119         (gcc::jit::recording::context::get_builtins_manager): New function.
120         (gcc::jit::recording::get_builtin_function): Use
121         get_builtins_manager, in case we're a child context.
122         (gcc::jit::recording::memento_of_get_type::dereference): Add the
123         COMPLEX_ types.
124         (gcc::jit::recording::memento_of_get_type::is_int): Likewise.
125         (gcc::jit::recording::memento_of_get_type::is_float): Likewise.
126         (gcc::jit::recording::memento_of_get_type::is_bool): Likewise.
127         (get_type_strings): Likewise.
129         * jit-recording.h
130         (gcc::jit::recording::context::get_builtins_manager): New.
132         * libgccjit.h (enum gcc_jit_types): Add
133         GCC_JIT_TYPE_COMPLEX_FLOAT, GCC_JIT_TYPE_COMPLEX_DOUBLE,
134         GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE.
136 2014-12-01  David Malcolm  <dmalcolm@redhat.com>
138         * jit-builtins.c
139         (gcc::jit::recording::builtins_manager::get_builtin_function):
140         Check for NULL return from make_builtin_function.
141         (gcc::jit::recording::builtins_manager::make_builtin_function):
142         Check for NULL return from get_type.
144 2014-12-01  David Malcolm  <dmalcolm@redhat.com>
146         * jit-playback.c (gcc::jit::playback::context::compile): Move DSO
147         creation code into...
148         (gcc::jit::playback::context::convert_to_dso): New function.
149         * jit-playback.h (gcc::jit::playback::context::convert_to_dso):
150         New function.
152 2014-12-01  David Malcolm  <dmalcolm@redhat.com>
154         * jit-playback.c (gcc::jit::playback::context::compile): Use an
155         auto_vec<const char *> rather than a const char *[20] for the
156         top-level argv, and move the logic to build it to...
157         (gcc::jit::playback::context::make_fake_args): New function.
158         * jit-playback.h (gcc::jit::playback::context::make_fake_args):
159         New function.
161 2014-12-01  David Malcolm  <dmalcolm@redhat.com>
163         * Make-lang.in (jit_OBJS): Add jit/jit-result.o.
164         * jit-playback.c: Include new header jit-result.h.
165         (gcc::jit::result::result): Move to new file jit-result.c.
166         (gcc::jit::result::~result): Likewise.
167         (gcc::jit::playback::result): Likewise.
168         * jit-recording.h (class gcc::jit::result): Move to new
169         header jit-result.h.
170         * jit-result.c: New file, to contain...
171         (gcc::jit::result::result): Move here from jit-playback.c,
172         removing erroneous "playback" namespace from comment.
173         (gcc::jit::result::~result): Likewise.
174         (gcc::jit::playback::result): Likewise.
175         * jit-result.h: New file, to contain...
176         (class gcc::jit::result): Move from jit-recording.h.
177         * libgccjit.c: Include jit-result.h.
178         (gcc_jit_result_get_code): Update comment to reflect move
179         of implementation.
180         (gcc_jit_result_release): Likewise.
182 2014-12-01  David Malcolm  <dmalcolm@redhat.com>
184         PR jit/63854
185         * docs/examples/tut04-toyvm/toyvm.c
186         (toyvm_compiled_function): New typedef.
187         (toyvm_compiled_func) Rename to...
188         (toyvm_compiled_code) ...this.
189         (struct toyvm_compiled_function): New struct.
190         (toyvm_function_compile): Return a toyvm_compiled_function *
191         rather than a toyvm_compiled_func, so that the caller can fully
192         clean things up.  Free "funcname".
193         (test_script): Update for change to toyvm_function_compile.
194         Clean up the toyvm_compiled_function.
195         (main): Likewise.
196         (docs/intro/tutorial04.rst): Update to reflect the above changes,
197         and to better spell out the lifetime of the compiled code.
199 2014-12-01  David Malcolm  <dmalcolm@redhat.com>
201         PR jit/63854
202         * jit-builtins.c
203         (gcc::jit::recording::builtins_manager::make_fn_type): Call the
204         context's new_function_type method, rather than directly creating
205         a function_type instance.
206         * jit-recording.c
207         (gcc::jit::recording::context::new_function_type): New method,
208         adapted from part of...
209         (gcc::jit::recording::context::new_function_ptr_type): ...this.
210         Update to call new_function_type.
211         * jit-recording.h
212         (gcc::jit::recording::context::new_function_type): New method.
214 2014-12-01  David Malcolm  <dmalcolm@redhat.com>
216         PR jit/63969
217         * jit-playback.c: Ensure that ctxt_progname is non-NULL.
219 2014-11-19  David Malcolm  <dmalcolm@redhat.com>
221         PR jit/63854
222         * jit-playback.c (gcc::jit::playback::compound_type::set_fields):
223         Convert param from const vec<playback::field *> & to
224         const auto_vec<playback::field *> *.
225         (gcc::jit::playback::context::new_function_type): Convert param
226         "param_types" from vec<type *> * to const auto_vec<type *> *.
227         (gcc::jit::playback::context::new_function): Convert param
228         "params" from vec<param *> * to const auto_vec<param *> *.
229         (gcc::jit::playback::context::build_call): Convert param "args"
230         from vec<rvalue *> to const auto_vec<rvalue *> *.
231         (gcc::jit::playback::context::new_call): Likewise.
232         (gcc::jit::playback::context::new_call_through_ptr): Likewise.
233         (wrapper_finalizer): New function.
234         (gcc::jit::playback::wrapper::operator new): Call the finalizer
235         variant of ggc_internal_cleared_alloc, supplying
236         wrapper_finalizer.
237         (gcc::jit::playback::function::finalizer): New.
238         (gcc::jit::playback::block::finalizer): New.
239         (gcc::jit::playback::source_file::finalizer): New.
240         (gcc::jit::playback::source_line::finalizer): New.
242         * jit-playback.h
243         (gcc::jit::playback::context::new_function_type): Convert param
244         "param_types" from vec<type *> * to const auto_vec<type *> *.
245         (gcc::jit::playback::context::new_function): Convert param
246         "params" from vec<param *> * to const auto_vec<param *> *.
247         (gcc::jit::playback::context::new_call): Convert param
248         "args" from vec<rvalue *> to const auto_vec<rvalue *> *.
249         (gcc::jit::playback::context::new_call_through_ptr): Likewise.
250         (gcc::jit::playback::context::build_call): Likewise.
251         (gcc::jit::playback::context): Convert fields "m_functions",
252         "m_source_files", "m_cached_locations" from vec to auto_vec.
253         (gcc::jit::playback::wrapper::finalizer): New virtual function.
254         (gcc::jit::playback::compound_type::set_fields): Convert param fro
255         const vec<playback::field *> & to
256         const auto_vec<playback::field *> *.
257         (gcc::jit::playback::function::finalizer): New.
258         (gcc::jit::playback::block::finalizer): New.
259         (gcc::jit::playback::source_file::finalizer): New.
260         (gcc::jit::playback::source_line::finalizer): New.
262         * jit-recording.c
263         (gcc::jit::recording::function_type::replay_into): Convert local
264         from a vec into an auto_vec.
265         (gcc::jit::recording::fields::replay_into): Likewise.
266         (gcc::jit::recording::function::replay_into): Likewise.
267         (gcc::jit::recording::call::replay_into): Likewise.
268         (gcc::jit::recording::call_through_ptr::replay_into): Likewise.
270         * jit-recording.h (gcc::jit::recording::context): Convert fields
271         "m_mementos", "m_compound_types", "m_functions" from vec<> to
272         auto_vec <>.
273         (gcc::jit::recording::function_type::get_param_types): Convert
274         return type from vec<type *> to const vec<type *> &.
275         (gcc::jit::recording::function_type): Convert field
276         "m_param_types" from a vec<> to an auto_vec<>.
277         (gcc::jit::recording::fields): Likewise for field "m_fields".
278         (gcc::jit::recording::function::get_params): Convert return type
279         from vec <param *> to const vec<param *> &.
280         (gcc::jit::recording::function): Convert fields "m_params",
281         "m_locals", "m_blocks" from vec<> to auto_vec<>.
282         (gcc::jit::recording::block): Likewise for field "m_statements".
283         vec<> to auto_vec<>.
284         (gcc::jit::recording::call): Likewise for field "m_args".
285         (gcc::jit::recording::call_through_ptr): Likewise.
287 2014-11-19  David Malcolm  <dmalcolm@redhat.com>
289         PR jit/63854
290         * jit-recording.c (recording::function::validate): Convert
291         "worklist" from vec<> to autovec<> to fix a leak.
293 2014-11-11  David Malcolm  <dmalcolm@redhat.com>
295         * ChangeLog.jit: New.
296         * ChangeLog: New.
297         * Make-lang.in: New.
298         * TODO.rst: New.
299         * config-lang.in: New.
300         * docs/Makefile: New.
301         * docs/_build/texinfo/Makefile: New.
302         * docs/_build/texinfo/factorial.png: New.
303         * docs/_build/texinfo/libgccjit.texi: New.
304         * docs/_build/texinfo/sum-of-squares.png: New.
305         * docs/conf.py: New.
306         * docs/examples/tut01-hello-world.c: New.
307         * docs/examples/tut02-square.c: New.
308         * docs/examples/tut03-sum-of-squares.c: New.
309         * docs/examples/tut04-toyvm/Makefile: New.
310         * docs/examples/tut04-toyvm/factorial.toy: New.
311         * docs/examples/tut04-toyvm/fibonacci.toy: New.
312         * docs/examples/tut04-toyvm/toyvm.c: New.
313         * docs/index.rst: New.
314         * docs/internals/index.rst: New.
315         * docs/intro/factorial.png: New.
316         * docs/intro/index.rst: New.
317         * docs/intro/sum-of-squares.png: New.
318         * docs/intro/tutorial01.rst: New.
319         * docs/intro/tutorial02.rst: New.
320         * docs/intro/tutorial03.rst: New.
321         * docs/intro/tutorial04.rst: New.
322         * docs/topics/contexts.rst: New.
323         * docs/topics/expressions.rst: New.
324         * docs/topics/functions.rst: New.
325         * docs/topics/index.rst: New.
326         * docs/topics/locations.rst: New.
327         * docs/topics/objects.rst: New.
328         * docs/topics/results.rst: New.
329         * docs/topics/types.rst: New.
330         * dummy-frontend.c: New.
331         * jit-builtins.c: New.
332         * jit-builtins.h: New.
333         * jit-common.h: New.
334         * jit-playback.c: New.
335         * jit-playback.h: New.
336         * jit-recording.c: New.
337         * jit-recording.h: New.
338         * libgccjit++.h: New.
339         * libgccjit.c: New.
340         * libgccjit.h: New.
341         * libgccjit.map: New.
342         * notes.txt: New.
344 2013-07-26  David Malcolm  <dmalcolm@redhat.com>
346         * Initial creation
348 Copyright (C) 2013-2014 Free Software Foundation, Inc.
350 Copying and distribution of this file, with or without modification,
351 are permitted in any medium without royalty provided the copyright
352 notice and this notice are preserved.