PR c++/85662
[official-gcc.git] / gcc / jit / ChangeLog.jit
blobf887e0fc35ce5d288e73fe7e071257658bd4941e
1 2014-11-10  David Malcolm  <dmalcolm@redhat.com>
3         * docs/_build/texinfo/libgccjit.texi: Regenerate.
5 2014-11-10  David Malcolm  <dmalcolm@redhat.com>
7         * dummy-frontend.c: Add includes now needed since r216805 by
8         cgraph.h: hash-map.h, is-a.h, plugin-api.h, vec.h, hashtab.h,
9         hash-set.h, machmode.h, tm.h, hard-reg-set.h, function.h,
10         ipa-ref.h, dumpfile.h.
11         * jit-playback.c: Likewise.
13 2014-11-05  David Malcolm  <dmalcolm@redhat.com>
15         * jit-playback.c (gcc::jit::playback::context::handle_locations):
16         Drop the disabled debugging code.
18 2014-11-05  David Malcolm  <dmalcolm@redhat.com>
20         * docs/topics/expressions.rst (Type-coercion): Casts between
21         pointer types are valid.
22         * libgccjit.c: Document that gcc_jit_context et al are actually
23         subclasses of the gcc::jit::recording classes.
24         (RETURN_VAL_IF_FAIL): Add top-level descriptive comment.
25         (RETURN_IF_NOT_VALID_BLOCK): Likewise.
26         (RETURN_NULL_IF_NOT_VALID_BLOCK): Likewise.
27         (jit_error): Likewise.
28         (compatible_types): Likewise.
29         (gcc_jit_context_acquire): Likewise.
30         (gcc_jit_context_release): Likewise.
31         (gcc_jit_context_new_child_context): Likewise.
32         (gcc_jit_context_new_location): Likewise.
33         (gcc_jit_location_as_object): Likewise.
34         (gcc_jit_type_as_object): Likewise.
35         (gcc_jit_context_get_type): Likewise.
36         (gcc_jit_context_get_int_type): Likewise.
37         (gcc_jit_type_get_pointer): Likewise.
38         (gcc_jit_type_get_const): Likewise.
39         (gcc_jit_type_get_volatile): Likewise.
40         (gcc_jit_context_new_array_type): Likewise.  Also document that
41         LOC can be NULL.  Fail with an error on negative size.
42         (gcc_jit_context_new_field): Add top-level descriptive comment and
43         document that LOC can be NULL.
44         (gcc_jit_field_as_object): Add top-level descriptive comment.
45         (gcc_jit_context_new_struct_type): Likewise.  Also document that
46         LOC can be NULL.
47         (gcc_jit_context_new_opaque_struct): Likewise.
48         (gcc_jit_struct_as_type): Add top-level descriptive comment.
49         (gcc_jit_struct_set_fields): Likewise.  Also document that LOC can
50         be NULL.
51         (gcc_jit_context_new_union_type): Likewise.
52         (gcc_jit_context_new_function_ptr_type): Likewise.
53         (gcc_jit_context_new_param): Likewise.
54         (gcc_jit_param_as_object): Add top-level descriptive comment.
55         (gcc_jit_param_as_lvalue): Likewise.
56         (gcc_jit_param_as_rvalue): Likewise.
57         (gcc_jit_context_new_function): Likewise.  Also document that LOC
58         can be NULL.
59         (gcc_jit_context_get_builtin_function): Add top-level descriptive
60         comment.
61         (gcc_jit_function_as_object): Likewise.
62         (gcc_jit_function_get_param): Likewise.
63         (gcc_jit_function_dump_to_dot): Likewise.
64         (gcc_jit_function_new_block): Likewise.
65         (gcc_jit_block_as_object): Likewise.
66         (gcc_jit_block_get_function): Likewise.
67         (gcc_jit_context_new_global): Likewise.  Also document that LOC
68         can be NULL.
69         (gcc_jit_lvalue_as_object): Add top-level descriptive comment.
70         (gcc_jit_lvalue_as_rvalue): Likewise.
71         (gcc_jit_rvalue_as_object): Likewise.
72         (gcc_jit_rvalue_get_type): Likewise.
73         (RETURN_NULL_IF_FAIL_NONNULL_NUMERIC_TYPE): Likewise.
74         (gcc_jit_context_new_rvalue_from_int): Likewise.
75         (gcc_jit_context_zero): Likewise.
76         (gcc_jit_context_one): Likewise.
77         (gcc_jit_context_new_rvalue_from_double): Likewise.
78         (gcc_jit_context_new_rvalue_from_ptr): Likewise.
79         (gcc_jit_context_null): Likewise.
80         (gcc_jit_context_new_string_literal): Likewise.
81         (gcc_jit_context_new_unary_op): Likewise.  Also document that LOC
82         can be NULL.
83         (gcc_jit_context_new_binary_op): Likewise.
84         (gcc_jit_context_new_comparison): Likewise.
85         (gcc_jit_context_new_call): Likewise.
86         (gcc_jit_context_new_call_through_ptr): Likewise.
87         (is_valid_cast): Add top-level descriptive comment.
88         (gcc_jit_context_new_cast): Likewise.  Also document that LOC can
89         be NULL.
90         (gcc_jit_context_new_array_access): Likewise.
91         (gcc_jit_object_get_context): Add top-level descriptive comment.
92         (gcc_jit_object_get_debug_string): Likewise.
93         (gcc_jit_lvalue_access_field): Likewise.  Also document that LOC can
94         be NULL.
95         (gcc_jit_rvalue_access_field): Likewise.
96         (gcc_jit_rvalue_dereference_field): Likewise.
97         (gcc_jit_rvalue_dereference): Likewise.
98         (gcc_jit_lvalue_get_address): Likewise.
99         (gcc_jit_function_new_local): Likewise.
100         (gcc_jit_block_add_eval): Likewise.
101         (gcc_jit_block_add_assignment): Likewise.
102         (gcc_jit_block_add_assignment_op): Likewise.
103         (is_bool): Add top-level descriptive comment.
104         (gcc_jit_block_end_with_conditional): Likewise.  Also document
105         that LOC can be NULL.
106         (gcc_jit_block_add_comment): Likewise.
107         (gcc_jit_block_end_with_jump): Likewise.
108         (gcc_jit_block_end_with_return): Likewise.
109         (gcc_jit_block_end_with_void_return): Likewise.
110         (gcc_jit_context_set_str_option): Add top-level descriptive
111         comment.
112         (gcc_jit_context_set_int_option): Likewise.
113         (gcc_jit_context_set_bool_option): Likewise.
114         (gcc_jit_context_compile): Likewise.
115         (gcc_jit_context_dump_to_file): Likewise.
116         (gcc_jit_context_get_first_error): Likewise.
117         (gcc_jit_result_get_code): Likewise.
118         (gcc_jit_result_release): Likewise.
120         * libgccjit.h (gcc_jit_context_acquire): Remove FIXME from
121         comment.
122         (gcc_jit_context_get_int_type): Add comment.
123         (gcc_jit_context_new_field): Likewise.
124         (gcc_jit_context_new_struct_type): Likewise.
125         (gcc_jit_context_new_opaque_struct): Likewise.
126         (gcc_jit_struct_as_type): Likewise.
127         (gcc_jit_context_new_param): Likewise.
128         (gcc_jit_param_as_lvalue): Likewise.
129         (gcc_jit_param_as_rvalue): Likewise.
130         (enum gcc_jit_function_kind): Likewise.
131         (gcc_jit_context_new_function): Likewise.
132         (gcc_jit_context_get_builtin_function): Likewise.
133         (gcc_jit_function_get_param): Likewise.
135 2014-11-05  David Malcolm  <dmalcolm@redhat.com>
137         * libgccjit.c (gcc_jit_context_get_type): Verify that "type"
138         is valid immediately, rather than relying on called code.
139         (gcc_jit_context_new_function): Likewise for "kind".
140         (gcc_jit_context_new_unary_op): Likewise for "op".
141         (valid_binary_op_p): New.
142         (gcc_jit_context_new_binary_op): Verify that "op" is valid
143         immediately, rather than relying on called code.
144         (gcc_jit_context_new_comparison): Likewise.
145         (gcc_jit_block_add_assignment_op): Likewise.
147 2014-11-05  David Malcolm  <dmalcolm@redhat.com>
149         * libgccjit.c: Include safe-ctype.h from libiberty.
150         (IS_ASCII_ALPHA): Delete.
151         (IS_ASCII_DIGIT): Delete.
152         (IS_ASCII_ALNUM): Delete.
153         (gcc_jit_context_new_function): Replace use of IS_ASCII_ALPHA and
154         IS_ASCII_ALNUM with ISALPHA and ISALNUM respectively, from
155         libiberty.
157 2014-10-30  David Malcolm  <dmalcolm@redhat.com>
159         * dummy-frontend.c (jit_langhook_init): Remove some dead code.
161 2014-10-27  David Malcolm  <dmalcolm@redhat.com>
163         * dummy-frontend.c: Drop includes of tree-iterator.h,
164         tree-ssa-alias.h, gimple-expr.h, gimple.h, gimple-pretty-print.h.
165         * jit-playback.c: Drop includes of debug.h, langhooks.h,
166         langhooks-def.h, tree-iterator.h, gimple-expr.h, tree-ssa-alias.h,
167         gimple.h, gimple-pretty-print.h, diagnostic-core.h, dumpfile.h.
169 2014-10-21  David Malcolm  <dmalcolm@redhat.com>
171         * jit-recording.c: Include tm.h.  Don't include function.h.
173 2014-10-21  David Malcolm  <dmalcolm@redhat.com>
175         * docs/_build/texinfo/libgccjit.texi: Regenerate.
177 2014-10-21  David Malcolm  <dmalcolm@redhat.com>
179         * docs/intro/index.rst: Drop install.rst.  Add tutorial04.rst.
180         * docs/intro/install.rst: Rename to...
181         * docs/intro/tutorial01.rst: ...this, renaming old tutorial01.rst to...
182         * docs/intro/tutorial02.rst: ...this, renaming old tutorial02.rst to...
183         * docs/intro/tutorial03.rst: ...this, renaming old tutorial03.rst to...
184         * docs/intro/tutorial04.rst: ...this.
185         * docs/examples/install-hello-world.c: Rename to...
186         * docs/examples/tut01-hello-world.c: ...this.
187         * docs/examples/tut01-square.c: Rename to...
188         * docs/examples/tut02-square.c: ...this.
189         * docs/examples/tut02-sum-of-squares.c: Rename to...
190         * docs/examples/tut03-sum-of-squares.c: ...this.
191         * docs/examples/tut03-toyvm: Rename directory to...
192         * docs/examples/tut04-toyvm: ...this.
193         * docs/examples/tut04-toyvm/toyvm.c (PATH_TO_SCRIPTS): Update
194         for directory renaming.
196 2014-10-21  David Malcolm  <dmalcolm@redhat.com>
198         * docs/intro/install.rst ("Installation via packages"): Drop
199         this section.
200         ("Installation from source"): Drop this section, moving parts
201         of it to https://gcc.gnu.org/wiki/JIT and some others to
202         docs/internals/index.rst.
203         ("Hello world"): This section becomes the only remaining part
204         of this file.  Eliminate references to pkg-config.
206         * docs/internals/index.rst
207         ("Using a working copy without installing every time"): Rewrite
208         as...
209         ("Working on the JIT library"): ...new section, aimed at
210         contributors (and myself) working from a build directory,
211         eliminating references to installation.  Add description
212         of pertinent configuration options.
213         ("Running the test suite"): Add setting of LIBRARY_PATH to
214         description of how to run a built binary outside of the test
215         suite.
216         ("Environment variables"): New section, describing pertinent
217         environment variables.
219 2014-10-20  David Malcolm  <dmalcolm@redhat.com>
221         * jit-recording.c (gcc::jit::dump::dump): Handle fopen failures
222         by emitting an error on the context.
223         (gcc::jit::dump::~dump): Likewise for fclose failures.
224         (gcc::jit::dump::write): Don't attempt further work if the fopen
225         failed.  Handle fwrite failures by emitting an error on the
226         context.
228 2014-10-20  David Malcolm  <dmalcolm@redhat.com>
230         * Make-lang.in (jit.install-common): Drop installation of
231         libgccjit.pc.
232         * config-lang.in (outputs): Drop jit/libgccjit.pc.
233         * libgccjit.pc.in: Delete.
235 2014-10-17  David Malcolm  <dmalcolm@redhat.com>
237         * Make-lang.in (jit): Add $(FULL_DRIVER_NAME) as a dependency, so
238         that the symlink is created for testing.
240         * jit-playback.c (gcc::jit::playback::context::compile): Add
241         "-fno-use-linker-plugin" when invoking the driver.  Update error
242         messages to talk about the "gcc driver" rather than the
243         "gcc harness".  To ease troubleshooting, add error messages giving
244         the driver name and PATH to the error-handling code that fires
245         when the driver can't be found.
247 2014-10-07  David Malcolm  <dmalcolm@redhat.com>
249         * docs/_build/texinfo/libgccjit.texi: Regenerate.
251 2014-10-07  David Malcolm  <dmalcolm@redhat.com>
253         * docs/internals/index.rst (Overview of code structure): Directly
254         include the comment from jit-common.h as rst, rather than as a
255         quoted C++ comment.
256         * jit-common.h: Convert the summary format to valid reStructured
257         text for inclusion by docs/internals/index.rst.
258         * notes.txt: Clarify where libgccjit.c, jit-recording.c and
259         jit-playback.c fit into the high-level diagram.
261 2014-10-07  David Malcolm  <dmalcolm@redhat.com>
263         * Make-lang.in (jit_OBJS): Drop jit/internal-api.o.
264         Add jit/jit-recording.o and jit/jit-playback.o.
266         * internal-api.c: Delete, moving content to new files jit-recording.c
267         and jit-playback.c.
268         * internal-api.h: Delete, moving content to new files
269         jit-common.h, jit-playback.h, jit-recording.h.
270         * jit-common.h: New file, containing the forward decls of classes
271         formerly in internal-api.h.
272         * jit-recording.c: New file, containing the gcc::jit::recording
273         code formerly in internal-api.c, and gcc::jit::dump.
274         * jit-recording.h: New file, containing the gcc::jit::recording
275         prototypes formerly in internal-api.h.
276         * jit-playback.c: New file, containing the gcc::jit::playback
277         code formerly in internal-api.c.
278         * jit-playback.h: New file, containing the gcc::jit::playback
279         prototypes formerly in internal-api.h.
281         * dummy-frontend.c: Don't include "internal-api.h".  Add includes
282         of jit-common.h and jit-playback.h.
283         * jit-builtins.h: Replace include of internal-api.h with
284         jit-common.h.
285         * jit-builtins.c: Replace include of internal-api.h with
286         jit-common.h.  Add include of jit-recording.h.
287         * libgccjit.c: Likewise.
289         * docs/internals/index.rst (Overview of code structure): Update
290         to reflect the above changes.
292 2014-10-07  David Malcolm  <dmalcolm@redhat.com>
294         * docs/internals/index.rst
295         (Using a working copy without installing): Rename to...
296         (Using a working copy without installing every time): ...this, and
297         update to reflect the need to have installed the driver binary
298         when running directly from a build directory.
299         (Running the test suite): Add PATH setting to the example.
300         * docs/intro/install.rst ("Hello world"): Likewise.
301         * internal-api.c: Include new autogenerated header
302         "gcc-driver-name.h".
303         (gcc::jit::playback::context::compile): Rather than looking for a
304         "gcc" on the path, look for GCC_DRIVER_NAME from gcc-driver-name.h,
305         as created by the configure script, so that we are using one for
306         the correct target.
308 2014-10-02  David Malcolm  <dmalcolm@redhat.com>
310         * Make-lang.in (jit.info): Implement.
311         (jit.install-info): Implement.
312         (jit.dvi): Implement.
313         (jit.pdf): Implement in terms of new target "jit.texinfo.pdf".
314         (jit.install-pdf): Likewise for new target
315         "jit.texinfo.install-pdf".
316         (jit.install-html): Implement in terms of
317         "jit.$(doc_build_sys).install-html" to redirect to new targets
318         "jit.sphinx.install-html" or "jit.texinfo.install-html".
319         (jit.html): Implement in terms of "jit.$(doc_build_sys).html" to
320         redirect to new targets "jit.sphinx.html" or "jit.texinfo.html".
321         (JIT_TEXI_FILES): New variable.
322         (jit.texinfo.html): New target.
323         (jit.texinfo.install-html): New target.
324         (jit.texinfo.pdf): New target.
325         (jit.texinfo.install-pdf): New target.
326         (SPHINX_BUILD_DIR): New variable.
327         (jit.sphinx.html): New target.
328         (jit_htmldir): New variable.
329         (jit.sphinx.install-html): New target.
330         (jit.sphinx.pdf): New target.
332 2014-09-26  David Malcolm  <dmalcolm@redhat.com>
334         * internal-api.h (gcc::jit::recording::context): Convert field
335         "m_first_error_str" from a fixed-size buffer to a pointer, and add
336         a field "m_owns_first_error_str" to determine if we're responsible
337         for freeing it.
338         * internal-api.c (gcc::jit::recording::context::context): Update
339         initializations in ctor for above change.
340         (gcc::jit::recording::context::~context): Free m_first_error_str
341         if we own it.
342         (gcc::jit::recording::context::add_error_va): When capturing the
343         first error message on a context, rather than copying "errmsg" to
344         a fixed-size buffer and truncating if oversize, simply store the
345         pointer to the error message, and flag whether we need to free it.
346         (gcc::jit::recording::context::get_first_error): Update for change
347         of "m_first_error_str" from an internal buffer to a pointer.
349 2014-09-25  David Malcolm  <dmalcolm@redhat.com>
351         * internal-api.c (gcc::jit::playback::context::compile): Use
352         pex_one rather than system when invoking "gcc" to go from a .s
353         file to a .so file.
355 2014-09-25  David Malcolm  <dmalcolm@redhat.com>
357         * internal-api.c (make_tempdir_path_template): New.
358         (gcc::jit::playback::context::compile): Call
359         make_tempdir_path_template to make m_path_template, rather than
360         hardcoding "/tmp/" within "/tmp/libgccjit-XXXXXX".
362 2014-09-24  David Malcolm  <dmalcolm@redhat.com>
364         * docs/internals/index.rst ("Overview of code structure"): Add
365         more descriptive text, including various fragments of
366         internal-api.h as appropriate.
367         * internal-api.h: Add marker comments for use by "literalinclude"
368         directives in docs/internals/index.rst.
370 2014-09-24  David Malcolm  <dmalcolm@redhat.com>
372         * dummy-frontend.c (my_walker): Rename to...
373         (my_ggc_walker): ...this.
374         (my_root_tab): Rename to...
375         (jit_root_tab): ...this.
376         (jit_langhook_init): Update for renaming of "my_root_tab" to
377         "jit_root_tab".
378         * internal-api.c: Add descriptive API comments to functions
379         throughout.
380         (mutex): Rename to...
381         (jit_mutex): ...this.
382         (gcc::jit::recording::context::compile): Update for renaming of
383         "mutex" to "jit_mutex".
384         * internal-api.h: Add descriptive API comments to functions
385         throughout.  Add indentation to forward declarations of classes
386         to indicate inheritance.
387         * jit-builtins.c: Likewise.
389 2014-09-24  David Malcolm  <dmalcolm@redhat.com>
391         * internal-api.c (gcc::jit::dump::write): Eliminate fixed-size
392         buffer "buf" by replacing call to vsnprintf with one to vasprintf
393         and a free, emitting an error on the dump's context if a malloc
394         failure occurs.
395         (gcc::jit::recording::context::add_error_va): Likewise, using
396         a precanned message if the malloc inside vasprinf fails.  Split
397         local "buf" into "malloced_msg" and "errmsg" to ensure that we
398         free the message iff we're using one malloc-ed by vasprintf.
399         (gcc::jit::recording::string::from_printf): Eliminate fixed-size
400         buffer "buf" by replacing call to vsnprintf with one to vasprintf
401         and a free, emitting an error on the relevant context if a malloc
402         failure occurs.
404 2014-09-24  David Malcolm  <dmalcolm@redhat.com>
406         * dummy-frontend.c: Update copyright year.  Follow standard for
407         initial includes by removing redundant include of "ansidecl.h".
408         * internal-api.c: Follow standard for initial includes by removing
409         redundant include of "ansidecl.h".
410         * jit-builtins.c: Likewise.
411         * libgccjit.c: Likewise.
413 2014-09-24  David Malcolm  <dmalcolm@redhat.com>
415         * ChangeLog.jit: Add copyright footer.
416         * Make-lang.in: Update copyright.
417         * config-lang.in: Update copyright.
418         * docs/examples/install-hello-world.c: Add copyright header.
419         * docs/examples/tut01-square.c: Likewise.
420         * docs/examples/tut02-sum-of-squares.c: Likewise.
421         * docs/examples/tut03-toyvm/toyvm.c: Likewise.
422         * internal-api.c: Likewise.
423         * internal-api.h: Likewise.
424         * libgccjit++.h: Likewise.
425         * libgccjit.c: Likewise.
426         * libgccjit.h: Likewise.
427         * libgccjit.map: Likewise.
429 2014-09-23  David Malcolm  <dmalcolm@redhat.com>
431         * TODO.rst (API): Shift operators are done.
432         * docs/topics/expressions.rst (Binary): Add shift operators.
433         * internal-api.c (binary_op_strings): Likewise.
434         (gcc::jit::playback::context::new_binary_op): Likewise.
435         * libgccjit.h (enum gcc_jit_binary_op): Likewise.
437 2014-09-23  David Malcolm  <dmalcolm@redhat.com>
439         * TODO.rst: Rename "Initial Release" section to "API", and
440         remove completed items: builtins, docs, pkgconfig file, fuzz
441         testing.  Move ability to name contexts and stmt_list per block
442         ideas to a new "Nice to have" section and note that it might be
443         better to go straight to gimple.
444         Move code coverage to "Test suite" section.
445         Add a "Probably not needed" section, moving some items to it.
446         Note that we're still missing shift operators.
447         Add idea that we could warn about unused objects in a context.
449 2014-09-23  David Malcolm  <dmalcolm@redhat.com>
451         * docs/examples/tut03-toyvm/toyvm.c: Include <dejagnu.h>.
452         Add missing typedef of compilation_state.
453         (toyvm_function_parse): Add "name param.
454         (test): New.
455         (CHECK_NON_NULL): New, from harness.h
456         (CHECK_VALUE): Likewise.
457         (test_script): New.
458         (PATH_TO_SCRIPTS): New define.
459         (test_suite): New.
460         (main): If called with no args, run the test suite.
462 2014-09-23  David Malcolm  <dmalcolm@redhat.com>
464         * docs/conf.py (__read_file): New helper function, for
465         extracting...
466         (gcc_BASEVER): New variable, read from "BASE-VER" in gcc src dir.
467         (gcc_DEVPHASE): Likewise, from file "DEV-PHASE".
468         (gcc_DATESTAMP): Likewise, from file "DATESTAMP".
469         (gcc_REVISION): Likewise, from file "REVISION" (if present).
470         (version): Rather than hardcoding this variable, extract from file
471         BASE-VER, via gcc_BASEVER local.
472         (release): Likewise, building it up from the files read above.
473         * docs/_build/texinfo/libgccjit.texi: Regenerate.
475 2014-09-22  David Malcolm  <dmalcolm@redhat.com>
477         * docs/intro/tutorial01.rst: Remove stray "FIXME".
478         * docs/_build/texinfo/libgccjit.texi: Regenerate.
480 2014-09-22  David Malcolm  <dmalcolm@redhat.com>
482         * docs/index.rst: Add internals/index.rst.
483         * docs/internals/index.rst: New.
484         * notes.txt: Update to reflect renaming of toplev_main to
485         toplev::main.
487 2014-09-22  David Malcolm  <dmalcolm@redhat.com>
489         * docs/_build/texinfo/libgccjit.texi: Regenerate.
490         * docs/intro/install.rst: Reduce width of listing.
491         * docs/intro/tutorial01.rst: Use <libgccjit.h> rather than
492         "libgccjit.h" when including the header.
493         * docs/intro/tutorial02.rst: Likewise.
494         * docs/intro/tutorial03.rst: Clarify various sections; show
495         effect of reducing optimization level down from 3 to 2.
496         ("Putting it all together"): Move to above...
497         ("Behind the curtain: optimizing away stack manipulation"):
498         ...this, and rename this to...
499         ("Behind the curtain: How does our code get optimized?"): ...and
500         add more detail, and discussion of elimination of tail recursion.
502 2014-09-19  David Malcolm  <dmalcolm@redhat.com>
504         * TODO.rst: Add detection of uninitialized variables, since
505         this bit me when developing "toyvm".
507         * docs/examples/tut03-toyvm/Makefile: New.
508         * docs/examples/tut03-toyvm/factorial.toy: New.
509         * docs/examples/tut03-toyvm/fibonacci.toy: New.
510         * docs/examples/tut03-toyvm/toyvm.c: New.
512         * docs/intro/index.rst: Add tutorial03.rst.
513         * docs/intro/tutorial01.rst: Fix example of how to dump
514         generated machine code.
515         * docs/intro/tutorial03.rst: New.
516         * docs/intro/factorial.png: New.
518         * docs/_build/texinfo/libgccjit.texi: Regenerate.
519         * docs/_build/texinfo/factorial.png: New (copied by sphinx from
520         docs/intro/factorial.png).
522 2014-09-18  David Malcolm  <dmalcolm@redhat.com>
524         * Make-lang.in (jit.install-common): Install libgccjit.pc to
525         "$(DESTDIR)/$(libdir)/pkgconfig".
526         * config-lang.in (outputs): Define this, adding jit/libgccjit.pc
527         so that it makes it into AC_CONFIG_FILES and is thus generated from
528         jit/libgccjit.pc.in at configure time.
529         * docs/intro/install.rst ("Hello world"): Add discussion about the
530         use of pkg-config when building against an install in
531         a non-standard location.
532         * docs/_build/texinfo/libgccjit.texi: Regenerate.
533         * libgccjit.pc.in: New.
535 2014-09-18  David Malcolm  <dmalcolm@redhat.com>
537         * docs/index.rst: Split index out into two new files...
538         * docs/intro/index.rst: New file.
539         * docs/topics/index.rst: New file.
540         * docs/_build/texinfo/libgccjit.texi: Regenerate.
542 2014-09-18  David Malcolm  <dmalcolm@redhat.com>
544         * docs/_build/texinfo/Makefile: New file, generated by Sphinx, by
545         running "make texinfo" in docs directory.
546         * docs/_build/texinfo/libgccjit.texi: Likewise.
547         * docs/_build/texinfo/sum-of-squares.png: Likewise.
549 2014-09-18  David Malcolm  <dmalcolm@redhat.com>
551         * docs/conf.py (Options for HTML output): Update html_theme from
552         "default" to "pyramid".
554 2014-09-18  David Malcolm  <dmalcolm@redhat.com>
556         * docs/intro/install.rst: Markup fixes.
557         * docs/intro/tutorial01.rst: Likewise.
558         * docs/intro/tutorial02.rst: Likewise.
559         * docs/topics/contexts.rst: Likewise.
560         * docs/topics/expressions.rst: Likewise.
561         * docs/topics/functions.rst: Likewise.
562         * docs/topics/locations.rst: Likewise.
563         * docs/topics/types.rst: Likewise.
565 2014-09-18  David Malcolm  <dmalcolm@redhat.com>
567         * docs/examples/install-hello-world.c (main): Fix missing
568         "return".
569         * docs/examples/tut01-square.c (main): Likewise.
570         * docs/examples/tut02-sum-of-squares.c (main): Likewise.
572 2014-09-17  David Malcolm  <dmalcolm@redhat.com>
574         * docs/Makefile: New file.
575         * docs/conf.py: New file.
576         * docs/examples/install-hello-world.c: New file.
577         * docs/examples/tut01-square.c: New file.
578         * docs/examples/tut02-sum-of-squares.c: New file.
579         * docs/index.rst: New file.
580         * docs/intro/install.rst: New file.
581         * docs/intro/sum-of-squares.png: New file.
582         * docs/intro/tutorial01.rst: New file.
583         * docs/intro/tutorial02.rst: New file.
584         * docs/topics/contexts.rst: New file.
585         * docs/topics/expressions.rst: New file.
586         * docs/topics/functions.rst: New file.
587         * docs/topics/locations.rst: New file.
588         * docs/topics/objects.rst: New file.
589         * docs/topics/results.rst: New file.
590         * docs/topics/types.rst: New file.
592 2014-09-11  David Malcolm  <dmalcolm@redhat.com>
594         * TODO.rst (Initial Release): Update for addition of myself as
595         maintainer.
597 2014-09-10  David Malcolm  <dmalcolm@redhat.com>
599         * TODO.rst (Test suite): Multithreaded test is done.
601 2014-09-10  David Malcolm  <dmalcolm@redhat.com>
603         * dummy-frontend.c: Fix up for the header file flattening on
604         trunk by adding includes of signop.h, tree-core.h, stor-layout.h,
605         tree-ssa-alias.h, gimple-expr.h.
606         (jit_langhook_write_globals): Update call to
607         finalize_compilation_unit to symtab->finalize_compilation_unit to
608         track change made on trunk in r214422.
610         * internal-api.c: Fix up for the header file flattening on trunk
611         by adding includes of gimple-expr.h, tree-ssa-alias.h,
612         stringpool.h, stor-layout.h, print-tree.h, gimplify.h.
613         (new_rvalue_from_int): Update call to real_from_integer.
614         (gcc::jit::playback::wrapper::operator new): Use
615         ggc_internal_cleared_alloc rather than
616         ggc_internal_cleared_alloc_stat.
617         (gcc::jit::playback::function::postprocess): Update call to
618         cgraph_finalize_function tocgraph_node::finalize_function.
619         (gcc::jit::playback::block::add_comment): Update call to
620         ggc_internal_alloc_stat to ggc_internal_alloc.
622 2014-08-08  David Malcolm  <dmalcolm@redhat.com>
624         * libgccjit.h (gcc_jit_context_new_union_type): New entrypoint.
625         (gcc_jit_lvalue_access_field): Rename first param from "struct_"
626         to "struct_or_union".
627         (gcc_jit_rvalue_access_field): Likewise.
629         * libgccjit.c (gcc_jit_context_new_union_type): New entrypoint.
631         * libgccjit.map (gcc_jit_context_new_union_type): New entrypoint.
633         * internal-api.h (gcc::jit::recording::compound_type): New class
634         (gcc::jit::recording::union): New class.
635         (gcc::jit::playback::struct_): Rename this class to...
636         (gcc::jit::playback::compound_type): ...this.
637         (gcc::jit::recording::context::new_union_type): New method.
638         (gcc::jit::recording::context): Rename field "m_structs" to
639         "m_compound_types", generalizing from a vec <struct_ *> to a
640         vec<compound_type *>.
641         (gcc::jit::recording::field): Update field m_container from
642         struct * to container_type *.
643         (gcc::jit::recording::field::get_container): Generalize from
644         struct_ * to container_type *.
645         (gcc::jit::recording::field::set_container): Likewise.
646         (gcc::jit::recording::compound_type): New subclass of type, to
647         be a superclass of existing class struct_ and new class union_.
648         (gcc::jit::recording::struct_::get_name): Move to...
649         (gcc::jit::recording::compound_type::get_name): ...here.
650         (gcc::jit::recording::struct_::get_loc): Move to...
651         (gcc::jit::recording::compound_type::get_loc): ...here.
652         (gcc::jit::recording::struct_::set_fields): Move to...
653         (gcc::jit::recording::compound_type::set_fields): ...here.
654         (gcc::jit::recording::struct_::dereference): Move to...
655         (gcc::jit::recording::compound_type::dereference): ...here.
656         (gcc::jit::recording::struct_::is_int): Move to...
657         (gcc::jit::recording::compound_type::is_int): ...here.
658         (gcc::jit::recording::struct_::is_float): Move to...
659         (gcc::jit::recording::compound_type::is_float): ...here.
660         (gcc::jit::recording::struct_::is_bool): Move to...
661         (gcc::jit::recording::compound_type::is_bool): ...here.
662         (gcc::jit::recording::struct_::is_pointer): Move to...
663         (gcc::jit::recording::compound_type::is_pointer): ...here.
664         (gcc::jit::recording::struct_::is_array): Move to...
665         (gcc::jit::recording::compound_type::is_array): ...here.
666         (gcc::jit::recording::struct_::playback_struct): Move to...
667         (gcc::jit::recording::compound_type::playback_compound_type):
668         ...here, renaming and updating return type.
669         (gcc::jit::recording::struct_): Inherit from compound_type,
670         rather than just type.
671         (gcc::jit::recording::fields): Update to work on compound_type *
672         rather than struct_ *, renaming "m_struct" to "m_struct_or_union".
673         (gcc::jit::recording::union): New subclass of compound_type.
674         (gcc::jit::playback::context::new_struct_type): Generalize by
675         renaming to...
676         (gcc::jit::playback::context::new_compound_type): ...this, and
677         and an "is_struct" bool param.
678         (gcc::jit::playback::struct_): Generalize by renaming class to...
679         (gcc::jit::playback::compound_type): ...this.
681         * internal-api.c (gcc::jit::recording::context::context): Rename
682         field "m_structs" to "m_compound_types".
683         (gcc::jit::recording::context::new_struct_type): Likewise.
684         (gcc::jit::recording::context::new_union_type): New method.
685         (gcc::jit::recording::context::dump_to_file): Field "m_structs"
686         is renamed "m_compound_types" and changes type from struct_ *
687         to compound_type *.
688         (gcc::jit::recording::compound_type::compound_type): New ctor,
689         built from old body of gcc::jit::recording::struct_::struct_.
690         (gcc::jit::recording::struct_::set_fields): Move class to...
691         (gcc::jit::recording::compound_type::set_fields): ... here.
692         (gcc::jit::recording::struct_::dereference): Move class to...
693         (gcc::jit::recording::compound_type::dereference): ...here.
694         (gcc::jit::recording::struct_::struct_): Reimplement by calling
695         base class ctor.
696         (gcc::jit::recording::struct_::replay_into): The playback hook
697         is now "new_compound_type" and adds a bool, with true for
698         "is_struct" (vs a union).
699         (gcc::jit::recording::struct_::make_debug_string): "m_name" is
700         now moved to base class and private, so use an accessor.
701         (gcc::jit::recording::union_::union_): New function.
702         (gcc::jit::recording::union_::replay_into): New function.
703         (gcc::jit::recording::union_::make_debug_string): New function.
704         (gcc::jit::recording::fields::fields): Update first param from
705         struct_ * to compound_type *, and rename field "m_struct" to
706         "m_struct_or_union".
707         (gcc::jit::recording::fields::replay_into): "m_struct" is now
708         "m_struct_or_union" and has a playback_compound_type rather
709         than a playback_struct.
710         (gcc::jit::recording::fields::write_to_dump): Update for
711         renaming of m_struct to m_struct_or_union.
712         (gcc::jit::playback::context::new_struct_type): Rename method
713         to...
714         (gcc::jit::playback::context::new_compound_type): this,
715         generalizing so that it can make unions as well as structs; the
716         underlying playback type is now called "compound_type".
717         (gcc::jit::playback::struct_::set_fields): This method's class has
718         changed name, so this is now...
719         (gcc::jit::playback::compound_type::set_fields): ...this method.
721         * TODO.rst: Unions are done.
723 2014-08-08  David Malcolm  <dmalcolm@redhat.com>
725         * TODO.rst: Function ptrs are done.
726         * internal-api.c
727         (gcc::jit::recording::context::new_function_ptr_type): New method.
728         (gcc::jit::recording::context::new_call_through_ptr): New method.
729         (gcc::jit::recording::memento_of_get_pointer::make_debug_string):
730         Add special-case handling of function pointer types.
731         (gcc::jit::recording::function_type::make_debug_string_with_ptr):
732         New method.
733         (gcc::jit::recording::function_type::make_debug_string):
734         Reimplement in terms of...
735         (gcc::jit::recording::function_type::make_debug_string_with): New
736         method, based on make_debug_string, but allowing for arbitrary
737         text between the return type and the parameters.
738         (gcc::jit::recording::call_through_ptr::call_through_ptr): New
739         method.
740         (gcc::jit::recording::call_through_ptr::replay_into): New method.
741         (gcc::jit::recording::call_through_ptr::make_debug_string): New
742         method.
743         (gcc::jit::playback::context::new_call): Reimplement in terms of...
744         (gcc::jit::playback::context::build_call): New method, using parts
745         of old implementation of new_call, so that we can share this
746         with...
747         (gcc::jit::playback::context::new_call_through_ptr): New method.
748         * internal-api.h
749         (gcc::jit::recording::context::new_function_ptr_type): New method.
750         (gcc::jit::recording::context::new_call_through_ptr): New method.
751         (gcc::jit::recording::type::dyn_cast_function_type): New method.
752         (gcc::jit::recording::function_type::dyn_cast_function_type): New
753         method.
754         (gcc::jit::recording::function_type::make_debug_string_with_ptr):
755         New method.
756         (gcc::jit::recording::function_type::make_debug_string_with): New
757         method.
758         (gcc::jit::recording::call_through_ptr): New subclass of rvalue.
759         (gcc::jit::playback::context::new_call_through_ptr): New method.
760         (gcc::jit::playback::context::build_call): New method.
761         * libgccjit.c (gcc_jit_context_new_function_ptr_type): New
762         function.
763         (gcc_jit_context_new_call_through_ptr): New function.
764         * libgccjit.h (gcc_jit_context_new_function_ptr_type): New
765         function.
766         (gcc_jit_context_new_call_through_ptr): New function.
767         * libgccjit.map (gcc_jit_context_new_call_through_ptr): New function.
768         (gcc_jit_context_new_function_ptr_type): New function.
770 2014-07-25  David Malcolm  <dmalcolm@redhat.com>
772         * TODO.rst (error-checking): Remove various items that either
773         already were implemented, or are implemented by this commit.
774         * internal-api.h (gcc::jit::recording::type::is_numeric): New.
775         * libgccjit.c (RETURN_NULL_IF_FAIL_NONNULL_NUMERIC_TYPE): New macro.
776         (gcc_jit_context_new_rvalue_from_int): Verify that numeric_type is
777         indeed numeric.
778         (gcc_jit_context_zero): Likewise.
779         (gcc_jit_context_one): Likewise.
780         (gcc_jit_context_new_rvalue_from_double): Likewise.
781         (gcc_jit_context_new_array_access): Likewise for type of "index".
783 2014-07-14  David Malcolm  <dmalcolm@redhat.com>
785         * internal-api.c (gcc::jit::recording::context::new_array_type):
786         Reject attempts to create an array of a struct if the fields of
787         the struct haven't yet been set.
788         * internal-api.h (gcc::jit::recording::type::dyn_cast_struct): New
789         virtual function.
790         (gcc::jit::recording::struct_::dyn_cast_struct): New, overriding
791         for this subclass.
792         (gcc::jit::recording::struct_::get_name): New.
794 2014-05-07  David Malcolm  <dmalcolm@redhat.com>
796         * Make-lang.in (LIBGCCJIT_LINKER_NAME): New.
797         (LIBGCCJIT_VERSION_NUM): New.
798         (LIBGCCJIT_MINOR_NUM): New.
799         (LIBGCCJIT_RELEASE_NUM): New.
800         (LIBGCCJIT_SONAME): New.
801         (LIBGCCJIT_FILENAME): New.
802         (LIBGCCJIT_LINKER_NAME_SYMLINK): New.
803         (LIBGCCJIT_SONAME_SYMLINK): New.
804         (jit): Add symlink targets.
805         (libgccjit.so): Convert to...
806         (LIBGCCJIT_FILENAME): ...and add a soname.
807         (jit.install-common): Install the library with a soname, and
808         symlinks.  Install libgccjit++.h.
810 2014-04-25  David Malcolm  <dmalcolm@redhat.com>
812         * internal-api.c (gcc::jit::playback::context::compile): Put
813         any output of dlerror through the add_error method, rather
814         than merely printing it to stderr, so that the error is also
815         recorded on the context.
817 2014-03-19  Tom Tromey  <tromey@redhat.com>
819         * internal-api.c (compile): Use auto_timevar.
821 2014-03-19  Tom Tromey  <tromey@redhat.com>
823         * internal-api.c (compile): Use toplev, not toplev_options.
824         Simplify.
826 2014-03-19  David Malcolm  <dmalcolm@redhat.com>
828         * internal-api.c (gcc::jit::recording::context::add_error_va):
829         Rename local "progname" to "ctxt_progname" to avoid shadowing
830         the related global, for clarity.
831         (gcc::jit::playback::context::compile): Likewise.
833 2014-03-19  David Malcolm  <dmalcolm@redhat.com>
835         * internal-api.c (gcc::jit::recording::memento_of_get_pointer::
836         accepts_writes_from): Accept writes from pointers, but not arrays.
838         * internal-api.h (gcc::jit::recording::type::is_pointer): New.
839         (gcc::jit::recording::type::is_array): New.
840         (gcc::jit::recording::memento_of_get_type::accepts_writes_from):
841         Allow (void *) to accept writes of pointers, but not arrays.
842         (gcc::jit::recording::memento_of_get_type::is_pointer): New.
843         (gcc::jit::recording::memento_of_get_type::is_array): New.
844         (gcc::jit::recording::memento_of_get_pointer::is_pointer): New.
845         (gcc::jit::recording::memento_of_get_pointer::is_array): New.
846         (gcc::jit::recording::memento_of_get_const::is_pointer): New.
847         (gcc::jit::recording::memento_of_get_const::is_array): New.
848         (gcc::jit::recording::memento_of_get_volatile::is_pointer): New.
849         (gcc::jit::recording::memento_of_get_volatile::is_array): New.
850         (gcc::jit::recording::array_type::is_pointer): New.
851         (gcc::jit::recording::array_type::is_array): New.
852         (gcc::jit::recording::function_type::is_pointer): New.
853         (gcc::jit::recording::function_type::is_array): New.
854         (gcc::jit::recording::struct_::is_pointer): New.
855         (gcc::jit::recording::struct_::is_array): New.
857         * libgccjit.c (gcc_jit_context_new_rvalue_from_ptr): Require the
858         pointer_type to be a pointer, not an array.
859         (gcc_jit_context_null): Likewise.
860         (is_valid_cast): Require pointer casts to be between pointer types,
861         not arrays.
862         (gcc_jit_context_new_array_access): Update error message from "not
863         a pointer" to "not a pointer or array".
864         (gcc_jit_rvalue_dereference_field): Require the pointer arg to be
865         of pointer type, not an array.
866         (gcc_jit_rvalue_dereference): Likewise.
868 2014-03-14  David Malcolm  <dmalcolm@redhat.com>
870         * libgccjit.c (is_valid_cast): Permit casts between pointer types.
872         * internal-api.c (convert): Report more information if this ever
873         occurs, and make the error occur on the playback context, so that
874         it makes the gcc_jit_result be NULL.
875         (gcc::jit::playback::context::build_cast): Handle pointers.  Report
876         more information if an unhandlable cast reaches here.
878 2014-03-13  David Malcolm  <dmalcolm@redhat.com>
880         * libgccjit.c (is_valid_cast): New.
881         (gcc_jit_context_new_cast): Check for compatible types.
883         * internal-api.c (gcc::jit::recording::memento_of_get_type::
884         is_int): New.
885         (gcc::jit::recording::memento_of_get_type::is_float): New.
886         (gcc::jit::recording::memento_of_get_type::is_bool): New.
888         * internal-api.h (gcc::jit::recording::type::is_int): New.
889         (gcc::jit::recording::type::is_float): New.
890         (gcc::jit::recording::type::is_bool): New.
892         (gcc::jit::recording::memento_of_get_type::is_int): New.
893         (gcc::jit::recording::memento_of_get_type::is_float): New.
894         (gcc::jit::recording::memento_of_get_type::is_bool): New.
896         (gcc::jit::recording::memento_of_get_pointer::is_int): New.
897         (gcc::jit::recording::memento_of_get_pointer::is_float): New.
898         (gcc::jit::recording::memento_of_get_pointer::is_bool): New.
900         (gcc::jit::recording::memento_of_get_const::is_int): New.
901         (gcc::jit::recording::memento_of_get_const::is_float): New.
902         (gcc::jit::recording::memento_of_get_const::is_bool): New.
904         (gcc::jit::recording::memento_of_get_volatile::is_int): New.
905         (gcc::jit::recording::memento_of_get_volatile::is_float): New.
906         (gcc::jit::recording::memento_of_get_volatile::is_bool): New.
908         (gcc::jit::recording::array_type::is_int): New.
909         (gcc::jit::recording::array_type::is_float): New.
910         (gcc::jit::recording::array_type::is_bool): New.
912         (gcc::jit::recording::function_type::is_int): New.
913         (gcc::jit::recording::function_type::is_float): New.
914         (gcc::jit::recording::function_type::is_bool): New.
916         (gcc::jit::recording::struct_::is_int): New.
917         (gcc::jit::recording::struct_::is_float): New.
918         (gcc::jit::recording::struct_::is_bool): New.
920 2014-03-13  David Malcolm  <dmalcolm@redhat.com>
922         * internal-api.c (gcc::jit::recording::context::set_str_option):
923         Provide NULL recording::location to add_error.
924         (gcc::jit::recording::context::set_int_option): Likewise.
925         (gcc::jit::recording::context::set_bool_option): Likewise.
926         (gcc::jit::playback::context::compile): Likewise.
927         (gcc::jit::recording::context::add_error): Add recording::location
928         param.
929         (gcc::jit::recording::context::add_error_va): Likewise; print it
930         when present; add "error: " to stderr messages.
931         (gcc::jit::recording::location::replay_into): Provide
932         recording::location to the playback::location.
934         (gcc::jit::recording::function::validate): Add locations to the
935         add_error invocations.
936         (gcc::jit::recording::block::validate): Likewise.
937         (gcc::jit::playback::context::get_type): Likewise.
938         (gcc::jit::playback::context::new_unary_op): Likewise.
939         (gcc::jit::playback::context::new_binary_op): Likewise.
940         (gcc::jit::playback::context::new_comparison): Likewise.
942         (gcc::jit::recording::block::get_loc): New.
943         (gcc::jit::recording::block::get_first_statement): New.
945         (gcc::jit::playback::context::build_cast): Pass in higher-level
946         arguments in the hope of eventually providing better error
947         messages when a cast isn't possible.
948         (gcc::jit::playback::context::new_cast): As above.
950         (gcc::jit::playback::context::add_error): Add playback::location
951         parameter, using it to provide the corresponding
952         recording::location (if any) when reporting the error to the
953         recording::context.
954         (gcc::jit::playback::context::add_error_va): Likewise.
955         (gcc::jit::playback::context::new_location): Likewise.
956         (gcc::jit::playback::source_line::get_location): Likewise.
957         (gcc::jit::playback::location::location): Likewise.
959         * internal-api.h (gcc::jit::recording::context::add_error): Add
960         recording::location param.
961         (gcc::jit::recording::context::add_error_va): Likewise.
963         (gcc::jit::recording::context::errors_occurred): Also consider
964         errors that occur on a parent or ancestor context, recursively.
966         (gcc::jit::recording::block::get_loc): New.
967         (gcc::jit::recording::block::get_first_statement): New.
968         (gcc::jit::recording::statement::get_loc): New.
970         (gcc::jit::playback::context::new_location): Add recording::location
971         parameter.
973         (gcc::jit::playback::context::add_error): Add playback::location
974         parameter.
975         (gcc::jit::playback::context::add_error_va): Likewise.
977         (gcc::jit::playback::context::build_cast): Pass in higher-level
978         arguments in the hope of eventually providing better error
979         messages when a cast isn't possible.
981         (gcc::jit::playback::source_line::get_location): Add
982         recording::location parameter.
983         (gcc::jit::playback::location::location): Likewise.
984         (gcc::jit::playback::location::get_recording_loc): New.
985         (gcc::jit::playback::location::m_recording_loc): New.
987         * jit-builtins.c (gcc::jit::builtins_manager::get_builtin_function):
988         Provide NULL recording::location to add_error.
989         (gcc::jit::builtins_manager::make_primitive_type): Likewise.
991         * libgccjit.c (RETURN_VAL_IF_FAIL): Add location argument.
992         (RETURN_VAL_IF_FAIL_PRINTF1): Likewise.
993         (RETURN_VAL_IF_FAIL_PRINTF2): Likewise.
994         (RETURN_VAL_IF_FAIL_PRINTF3): Likewise.
995         (RETURN_VAL_IF_FAIL_PRINTF4): Likewise.
996         (RETURN_VAL_IF_FAIL_PRINTF6): Likewise.
997         (RETURN_NULL_IF_FAIL): Likewise.
998         (RETURN_NULL_IF_FAIL_PRINTF1): Likewise.
999         (RETURN_NULL_IF_FAIL_PRINTF2): Likewise.
1000         (RETURN_NULL_IF_FAIL_PRINTF3): Likewise.
1001         (RETURN_NULL_IF_FAIL_PRINTF4): Likewise.
1002         (RETURN_NULL_IF_FAIL_PRINTF6): Likewise.
1003         (RETURN_IF_FAIL): Likewise.
1004         (RETURN_IF_FAIL_PRINTF1): Likewise.
1005         (RETURN_IF_FAIL_PRINTF2): Likewise.
1006         (RETURN_IF_FAIL_PRINTF4): Likewise.
1007         (RETURN_IF_NOT_VALID_BLOCK): Likewise.
1008         (RETURN_NULL_IF_NOT_VALID_BLOCK): Likewise.
1010         (jit_error): Likewise.
1012         (gcc_jit_location_as_object): Provided location argument to
1013         error-handling macros.
1014         (gcc_jit_type_as_object): Likewise.
1015         (gcc_jit_context_get_type): Likewise.
1016         (gcc_jit_context_get_int_type): Likewise.
1017         (gcc_jit_type_get_pointer): Likewise.
1018         (gcc_jit_type_get_const): Likewise.
1019         (gcc_jit_type_get_volatile): Likewise.
1020         (gcc_jit_context_new_array_type): Likewise.
1021         (gcc_jit_context_new_field): Likewise.
1022         (gcc_jit_context_new_struct_type): Likewise.
1023         (gcc_jit_context_new_opaque_struct): Likewise.
1024         (gcc_jit_struct_as_type): Likewise.
1025         (gcc_jit_struct_set_fields): Likewise.
1026         (gcc_jit_context_new_param): Likewise.
1027         (gcc_jit_param_as_object): Likewise.
1028         (gcc_jit_param_as_lvalue): Likewise.
1029         (gcc_jit_param_as_rvalue): Likewise.
1030         (gcc_jit_context_new_function): Likewise.
1031         (gcc_jit_context_get_builtin_function): Likewise.
1032         (gcc_jit_function_as_object): Likewise.
1033         (gcc_jit_function_get_param): Likewise.
1034         (gcc_jit_function_dump_to_dot): Likewise.
1035         (gcc_jit_function_new_block): Likewise.
1036         (gcc_jit_block_as_object): Likewise.
1037         (gcc_jit_block_get_function): Likewise.
1038         (gcc_jit_context_new_global): Likewise.
1039         (gcc_jit_lvalue_as_object): Likewise.
1040         (gcc_jit_lvalue_as_rvalue): Likewise.
1041         (gcc_jit_rvalue_as_object): Likewise.
1042         (gcc_jit_rvalue_get_type): Likewise.
1043         (gcc_jit_context_new_rvalue_from_int): Likewise.
1044         (gcc_jit_context_zero): Likewise.
1045         (gcc_jit_context_one): Likewise.
1046         (gcc_jit_context_new_rvalue_from_double): Likewise.
1047         (gcc_jit_context_new_rvalue_from_ptr): Likewise.
1048         (gcc_jit_context_null): Likewise.
1049         (gcc_jit_context_new_string_literal): Likewise.
1050         (gcc_jit_context_new_unary_op): Likewise.
1051         (gcc_jit_context_new_binary_op): Likewise.
1052         (gcc_jit_context_new_comparison): Likewise.
1053         (gcc_jit_context_new_call): Likewise.
1054         (gcc_jit_context_new_cast): Likewise.
1055         (gcc_jit_context_new_array_access): Likewise.
1056         (gcc_jit_object_get_context): Likewise.
1057         (gcc_jit_object_get_debug_string): Likewise.
1058         (gcc_jit_lvalue_access_field): Likewise.
1059         (gcc_jit_rvalue_access_field): Likewise.
1060         (gcc_jit_rvalue_dereference_field): Likewise.
1061         (gcc_jit_rvalue_dereference_field): Likewise.
1062         (gcc_jit_rvalue_dereference): Likewise.
1063         (gcc_jit_lvalue_get_address): Likewise.
1064         (gcc_jit_function_new_local): Likewise.
1065         (gcc_jit_block_add_eval): Likewise.
1066         (gcc_jit_block_add_assignment): Likewise.
1067         (gcc_jit_block_add_assignment_op): Likewise.
1068         (gcc_jit_block_end_with_conditional): Likewise.
1069         (gcc_jit_block_add_comment): Likewise.
1070         (gcc_jit_block_end_with_jump): Likewise.
1071         (gcc_jit_block_end_with_return): Likewise.
1072         (gcc_jit_block_end_with_void_return): Likewise.
1073         (gcc_jit_context_set_str_option): Likewise.
1074         (gcc_jit_context_set_int_option): Likewise.
1075         (gcc_jit_context_set_bool_option): Likewise.
1076         (gcc_jit_context_compile): Likewise.
1077         (gcc_jit_context_dump_to_file): Likewise.
1078         (gcc_jit_context_get_first_error): Likewise.
1079         (gcc_jit_result_get_code): Likewise.
1080         (gcc_jit_result_get_code): Likewise.
1081         (gcc_jit_result_release): Likewise.
1083 2014-03-10  David Malcolm  <dmalcolm@redhat.com>
1085         * libgccjit++.h (gccjit::context::new_rvalue): Make these
1086         methods const.
1087         (gccjit::context::zero): Likewise.
1088         (gccjit::context::one): Likewise.
1089         (gccjit::function::get_param): Likewise.
1091 2014-03-10  David Malcolm  <dmalcolm@redhat.com>
1093         * libgccjit++.h (gccjit::error): New class, for exceptions.
1094         (gccjit::context::get_inner_context): New accessor, so that we
1095         can...
1096         (gccjit::context::m_inner_ctxt): Make private.
1097         (gccjit::context::context): Throw a gccjit::error if a NULL
1098         context is passed in.
1099         (gccjit::context::compile): Throw a gccjit::error if a NULL
1100         result is returned from the C API, which indicates an error.
1101         (gccjit::object::object): Throw a gccjit::error if a NULL
1102         object is passed in, since that indicates that an error has
1103         occurred.
1104         (gccjit::location::location): In the default ctor, call the
1105         base class default ctor rather than passing in a NULL to the
1106         single-argument ctor, since the latter now indicates an error
1107         has occurred at the C API level.
1108         (gccjit::field::field): Likewise.
1109         (gccjit::type::type): Likewise.
1110         (gccjit::function::function): Likewise.
1111         (gccjit::block::block): Likewise.
1112         (gccjit::rvalue::rvalue): Likewise.
1114 2014-03-07  David Malcolm  <dmalcolm@redhat.com>
1116         * libgccjit.h (enum gcc_jit_function_kind): Add
1117         GCC_JIT_FUNCTION_ALWAYS_INLINE.
1118         * internal-api.c (gcc::jit::recording::function::write_to_dump):
1119         Handle GCC_JIT_FUNCTION_ALWAYS_INLINE.
1120         (gcc::jit::playback::context::new_function): Likewise.
1121         (gcc::jit::playback::context::postprocess): Handle
1122         GCC_JIT_FUNCTION_INTERNAL and GCC_JIT_FUNCTION_ALWAYS_INLINE by
1123         clearing DECL_EXTERNAL and TREE_PUBLIC.  Doing so fixes the
1124         "undefined symbol" bug seen with GCC_JIT_FUNCTION_INTERNAL.
1125         * TODO.rst: Update.
1127 2014-03-07  David Malcolm  <dmalcolm@redhat.com>
1129         * libgccjit++.h (gccjit::context::new_global): New.
1131 2014-03-07  David Malcolm  <dmalcolm@redhat.com>
1133         * internal-api.c (gcc::jit::playback::context::handle_locations):
1134         Add a disabled call to line_table_dump, in case it's handy for
1135         debugging in the future.
1136         (gcc::jit::playback::context::set_tree_location): Assert that
1137         the location is non-NULL.
1138         (gcc::jit::playback::location::location): Initialize m_src_loc
1139         to UNKNOWN_LOCATION.  This field should always be overwritten by
1140         handle_locations before use, but given recent issues with bogus
1141         locations it seems safer to initialize it.
1143 2014-03-06  David Malcolm  <dmalcolm@redhat.com>
1145         * internal-api.c (gcc::jit::recording::context::
1146         disassociate_from_playback): Recursively visit parent contexts.
1148 2014-03-05  David Malcolm  <dmalcolm@redhat.com>
1150         * libgccjit.h (gcc_jit_function_dump_to_dot): New.
1151         * libgccjit.map (gcc_jit_function_dump_to_dot): New.
1152         * libgccjit++.h (gccjit::function::dump_to_dot): New.
1153         * libgccjit.c (gcc_jit_function_dump_to_dot): New.
1154         * internal-api.h (gcc::jit::recording::function::dump_to_dot): New.
1155         (gcc::jit::recording::block::block): Add m_index member.
1156         (gcc::jit::recording::block::dump_to_dot): New.
1157         (gcc::jit::recording::block::dump_edges_to_dot): New.
1158         * internal-api.c (gcc::jit::recording::function::new_block): Give
1159         each block an index.
1160         (gcc::jit::recording::function::dump_to_dot): New.
1161         (gcc::jit::recording::block::dump_to_dot): New.
1162         (gcc::jit::recording::block::dump_edges_to_dot): New.
1164 2014-03-04  David Malcolm  <dmalcolm@redhat.com>
1166         * internal-api.c (gcc::jit::recording::memento_of_get_pointer::
1167         accepts_writes_from): Avoid segfaulting when the argument is not
1168         of pointer type.
1169         * internal-api.h (gcc::jit::recording::accepts_writes_from): Add
1170         an assertion.
1171         * libgccjit.c (gcc_jit_context_new_comparison): Strip away const
1172         and volatile when comparing input types.
1174 2014-03-04  David Malcolm  <dmalcolm@redhat.com>
1176         * libgccjit.h (gcc_jit_type_get_volatile): New.
1177         * libgccjit.map (gcc_jit_type_get_volatile): New.
1178         * libgccjit.c (gcc_jit_type_get_volatile): New.
1179         * libgccjit++.h (gccjit::type::get_volatile): New.
1180         * internal-api.c (gcc::jit::recording::type::get_volatile): New.
1181         (gcc::jit::recording::memento_of_get_volatile::replay_into): New.
1182         (gcc::jit::recording::memento_of_get_volatile::make_debug_string): New.
1183         * internal-api.h (gcc::jit::recording::type::get_volatile): New.
1184         (gcc::jit::recording::type::accepts_writes_from): Strip off
1185         qualifiers such as "const" and "volatile" from the source type.
1186         (gcc::jit::recording::memento_of_get_volatile): New class.
1187         (gcc::jit::playback::type::get_volatile): New.
1188         * TODO.rst: Update.
1190 2014-03-03  David Malcolm  <dmalcolm@redhat.com>
1192         * libgccjit++.h (gccjit::function::operator()): Add overload for
1193         a call with 3 arguments.
1194         (gccjit::block::add_call): Likewise for 4 arguments.
1195         (gccjit::rvalue::cast_to): New method.
1196         (gccjit::rvalue::operator[]): New methods.
1198 2014-02-28  David Malcolm  <dmalcolm@redhat.com>
1200         * libgccjit.c (gcc_jit_context_new_binary_op): Check that the
1201         operands have the same type.
1202         (gcc_jit_context_new_comparison): Likewise.
1204 2014-02-28  David Malcolm  <dmalcolm@redhat.com>
1206         * libgccjit.h (gcc_jit_context_new_cast): New.
1207         * libgccjit.map (gcc_jit_context_new_cast): New.
1208         * libgccjit++.h (gccjit::context::new_cast): New method.
1209         * libgccjit.c (gcc_jit_context_new_cast): New.
1211         * internal-api.h (gcc::jit::recording::context::new_cast): New method.
1212         (gcc::jit::recording::cast): New subclass of rvalue.
1213         (gcc::jit::playback::context::new_cast): New method.
1214         (gcc::jit::playback::context::build_cast): New method.
1216         * internal-api.c (convert): New.
1217         (gcc::jit::recording::context::new_cast): New.
1218         (gcc::jit::recording::cast::replay_into): New.
1219         (gcc::jit::recording::cast::make_debug_string): New.
1220         (gcc::jit::playback::context::build_cast): New.
1221         (gcc::jit::playback::context::new_cast): New.
1223         * TODO.rst: Update.
1225 2014-02-28  David Malcolm  <dmalcolm@redhat.com>
1227         * libgccjit.h (gcc_jit_block_get_function): New.
1228         * libgccjit.map (gcc_jit_block_get_function): New.
1229         * libgccjit++.h (gccjit::block::get_function): New method.
1230         * libgccjit.c (gcc_jit_block_get_function): New.
1232 2014-02-27  David Malcolm  <dmalcolm@redhat.com>
1234         * libgccjit.h (gcc_jit_label): Delete in favor of...
1235         (gcc_jit_block): New type.
1236         (gcc_jit_loop): Delete.
1238         (gcc_jit_function_new_forward_label): Delete in favor of...
1239         (gcc_jit_function_new_block): New.
1241         (gcc_jit_label_as_object): Delete in favor of...
1242         (gcc_jit_block_as_object): New.
1244         (gcc_jit_function_add_eval): Delete in favor of...
1245         (gcc_jit_block_add_eval): New.
1247         (gcc_jit_function_add_assignment): Delete in favor of...
1248         (gcc_jit_block_add_assignment): New.
1250         (gcc_jit_function_add_assignment_op): Delete in favor of...
1251         (gcc_jit_block_add_assignment_op): New.
1253         (gcc_jit_function_add_comment): Delete in favor of...
1254         (gcc_jit_block_add_comment): New.
1256         (gcc_jit_label_as_object): Delete in favor of...
1257         (gcc_jit_block_as_object): New.
1259         (gcc_jit_function_add_conditional): Delete in favor of...
1260         (gcc_jit_block_end_with_conditional): New.
1262         (gcc_jit_function_add_jump): Delete in favor of...
1263         (gcc_jit_block_end_with_jump): New.
1265         (gcc_jit_function_add_return): Delete in favor of...
1266         (gcc_jit_block_end_with_return): New.
1268         (gcc_jit_function_add_void_return): Delete in favor of...
1269         (gcc_jit_block_end_with_void_return): New.
1271         (gcc_jit_function_new_loop): Delete.
1272         (gcc_jit_function_new_loop_over_range): Delete.
1273         (gcc_jit_loop_as_object): Delete.
1274         (gcc_jit_loop_end): Delete.
1276         * libgccjit.map (gcc_jit_function_add_assignment): Delete in favor of...
1277         (gcc_jit_block_add_assignment): New.
1279         (gcc_jit_function_add_assignment_op): Delete in favor of...
1280         (gcc_jit_block_add_assignment_op): New.
1282         (gcc_jit_function_add_comment): Delete in favor of...
1283         (gcc_jit_block_add_comment): New.
1285         (gcc_jit_function_add_eval): Delete in favor of...
1286         (gcc_jit_block_add_eval): New.
1288         (gcc_jit_label_as_object): Delete in favor of...
1289         (gcc_jit_block_as_object): New.
1291         (gcc_jit_function_add_conditional): Delete in favor of...
1292         (gcc_jit_block_end_with_conditional): New.
1294         (gcc_jit_function_add_jump): Delete in favor of...
1295         (gcc_jit_block_end_with_jump): New.
1297         (gcc_jit_function_add_return): Delete in favor of...
1298         (gcc_jit_block_end_with_return): New.
1300         (gcc_jit_function_add_void_return): Delete in favor of...
1301         (gcc_jit_block_end_with_void_return): New.
1303         (gcc_jit_function_add_label): Delete in favor of...
1304         (gcc_jit_function_new_block): New.
1305         (gcc_jit_function_new_forward_label): Delete.
1306         (gcc_jit_function_place_forward_label): Delete.
1308         (gcc_jit_function_new_loop): Delete.
1309         (gcc_jit_function_new_loop_over_range): Delete.
1310         (gcc_jit_loop_as_object): Delete.
1311         (gcc_jit_loop_end): Delete.
1313         * libgccjit.c (gcc_jit_label): Delete in favor of...
1314         (gcc_jit_block): New type.
1315         (gcc_jit_loop): Delete.
1317         (RETURN_IF_NOT_FUNC_DEFINITION): Delete in favor of...
1318         (RETURN_IF_NOT_VALID_BLOCK): New macro.
1319         (RETURN_NULL_IF_NOT_FUNC_DEFINITION): Delete in favor of...
1320         (RETURN_NULL_IF_NOT_VALID_BLOCK): New macro.
1322         (gcc_jit_function_new_forward_label): Delete in favor of...
1323         (gcc_jit_function_new_block): New.
1325         (gcc_jit_label_as_object): Delete in favor of...
1326         (gcc_jit_block_as_object): New.
1328         (gcc_jit_rvalue_dereference_field): Ensure that field has been
1329         placed.
1331         (gcc_jit_function_add_label): Delete
1332         (gcc_jit_function_place_forward_label): Delete.
1334         (gcc_jit_function_add_eval): Delete in favor of...
1335         (gcc_jit_block_add_eval): New.
1337         (gcc_jit_function_add_assignment): Delete in favor of...
1338         (gcc_jit_block_add_assignment): New.
1340         (gcc_jit_function_add_assignment_op): Delete in favor of...
1341         (gcc_jit_block_add_assignment_op): New.
1343         (gcc_jit_function_add_conditional): Delete in favor of...
1344         (gcc_jit_block_end_with_conditional): New.
1346         (gcc_jit_function_add_comment): Delete in favor of...
1347         (gcc_jit_block_add_comment): New.
1349         (gcc_jit_function_add_jump): Delete in favor of...
1350         (gcc_jit_block_end_with_jump): New.
1352         (gcc_jit_function_add_return): Delete in favor of...
1353         (gcc_jit_block_end_with_return): New.
1355         (gcc_jit_function_add_void_return): Delete in favor of...
1356         (gcc_jit_block_end_with_void_return): New.
1358         (gcc_jit_function_new_loop): Delete.
1359         (gcc_jit_function_new_loop_over_range): Delete.
1360         (gcc_jit_loop_as_object): Delete.
1361         (gcc_jit_loop_end): Delete.
1363         * internal-api.h (gcc::jit::recording::label): Delete class in
1364         favor of...
1365         (gcc::jit::recording::block): New class.
1366         (gcc::jit::recording::loop): Delete class.
1367         (gcc::jit::recording::loop_end): Delete class.
1369         (gcc::jit::playback::label): Delete class in favor of...
1370         (gcc::jit::playback::block): New class.
1372         (gcc::jit::playback::loop): Delete class.
1374         (gcc::jit::recording::playback_label): Delete function in favor of...
1375         (gcc::jit::recording::playback_block): New function.
1377         (gcc::jit::recording::context::validate): New.
1379         (gcc::jit::recording::function::new_forward_label): Delete method.
1380         (gcc::jit::recording::function::add_eval): Delete method in favor
1381         of method of new gcc::jit::recording::block class.
1382         (gcc::jit::recording::function::add_assignment): Likewise.
1383         (gcc::jit::recording::function::add_assignment_op): Likewise.
1384         (gcc::jit::recording::function::add_comment): Likewise.
1385         (gcc::jit::recording::function::add_conditional): Likewise.
1386         (gcc::jit::recording::function::place_forward_label): Likewise.
1387         (gcc::jit::recording::function::add_jump): Likewise.
1388         (gcc::jit::recording::function::add_return): Likewise.
1390         (gcc::jit::recording::function::add_label): Delete method in favor of...
1391         (gcc::jit::recording::function::new_block): New method.
1393         (gcc::jit::recording::function::new_loop): Delete method.
1395         (gcc::jit::recording::function::validate): New method.
1396         (gcc::jit::recording::function::m_activity): Delete field in favor of...
1397         (gcc::jit::recording::function::m_blocks): New field.
1399         (gcc::jit::recording::statement::get_successor_blocks): New method.
1400         (gcc::jit::recording::statement::write_to_dump): Make public.
1401         (gcc::jit::recording::statement::statement): Accept a block rather
1402         than a function.
1403         (gcc::jit::recording::statement::playback_function): Delete.
1404         (gcc::jit::recording::statement::get_block): New.
1405         (gcc::jit::recording::statement::m_func): Delete in favor of...
1406         (gcc::jit::recording::statement::m_block): ...this.
1408         (gcc::jit::recording::eval::eval): Accept a block rather than a
1409         function.
1410         (gcc::jit::recording::assignment::assignment): Likewise.
1411         (gcc::jit::recording::assignment_op::assignment_op): Likewise.
1412         (gcc::jit::recording::comment::comment): Likewise.
1413         (gcc::jit::recording::return::return): Likewise.
1414         (gcc::jit::recording::conditional::conditional): Likewise; accept
1415         blocks rather than labels.
1416         (gcc::jit::recording::jump::jump): Likewise.
1417         (gcc::jit::recording::conditional::get_successor_blocks): New.
1418         (gcc::jit::recording::jump::get_successor_blocks): New.
1420         (gcc::jit::playback::function::new_forward_label): Delete method
1421         in favor of...
1422         (gcc::jit::playback::function::new_block): New method.
1423         (gcc::jit::playback::function::build_stmt_list): New method.
1424         (gcc::jit::playback::function::m_blocks): New field.
1426         * libgccjit++.h (gccjit::label): Delete class in favor of...
1427         (gccjit::block): New class.
1428         (gccjit::function::new_forward_label): Delete methods in favor of...
1429         (gccjit::function::new_block): New methods.
1430         (gccjit::function::add_comment): Delete methods in favor of methods
1431         of new class gccjit::block.
1432         (gccjit::function::add_conditional): Likewise.
1433         (gccjit::function::add_label): Likewise.
1434         (gccjit::function::place_forward_label): Likewise.
1435         (gccjit::function::add_jump): Likewise.
1436         (gccjit::function::add_return): Likewise.
1437         (gccjit::function::add_call): Likewise.
1439         * internal-api.c (gcc::jit::recording::playback_label): Delete in
1440         favor of...
1441         (gcc::jit::recording::playback_block): New.
1442         (gcc::jit::recording::context::compile): Validate.
1443         (gcc::jit::recording::context::validate): New.
1444         (gcc::jit::recording::function::function): Update.
1445         (gcc::jit::recording::function::new_forward_label): Delete.
1446         (gcc::jit::recording::function::add_eval): Delete.
1447         (gcc::jit::recording::function::add_assignment): Delete.
1448         (gcc::jit::recording::function::add_assignment_op): Delete.
1449         (gcc::jit::recording::function::new_block): New.
1450         (gcc::jit::recording::function::add_comment): Delete.
1451         (gcc::jit::ecording::function::add_conditional): Delete.
1452         (gcc::jit::recording::function::add_label): Delete.
1453         (gcc::jit::recording::function::place_forward_label): Delete.
1454         (gcc::jit::recording::function::add_jump): Delete.
1455         (gcc::jit::recording::function::add_return): Delete.
1456         (gcc::jit::recording::function::new_loop): Delete.
1457         (gcc::jit::recording::function::write_to_dump): Port to block-based
1458         representation.
1459         (gcc::jit::recording::function::validate): New.
1460         (gcc::jit::recording::block::add_eval): New.
1461         (gcc::jit::recording::block::add_assignment): New.
1462         (gcc::jit::recording::label::replay_into): Delete.
1463         (gcc::jit::recording::block::add_assignment_op): New.
1464         (gcc::jit::recording::block::add_comment): New.
1465         (gcc::jit::recording::block::end_with_conditional): New.
1466         (gcc::jit::recording::block::end_with_jump): New.
1467         (gcc::jit::recording::block::end_with_return): New.
1468         (gcc::jit::recording::block::write_to_dump): New.
1469         (gcc::jit::recording::block::validate): New.
1470         (gcc::jit::recording::block::get_last_statement): New.
1471         (gcc::jit::recording::block::get_successor_blocks): New.
1472         (gcc::jit::recording::block::replay_into): New.
1473         (gcc::jit::recording::label::make_debug_string): Delete.
1474         (gcc::jit::recording::block::make_debug_string): New.
1475         (gcc::jit::recording::statement::get_successor_blocks): New.
1476         (gcc::jit::recording::eval::replay_into): Port to block-based
1477         representation.
1478         (gcc::jit::recording::assignment::replay_into): Likewise.
1479         (gcc::jit::recording::assignment_op::replay_into): Likewise.
1480         (gcc::jit::recording::comment::replay_into): Likewise.
1481         (gcc::jit::recording::conditional::replay_into): Likewise.
1482         (gcc::jit::recording::jump::replay_into): Likewise.
1483         (gcc::jit::recording::return_::replay_into): Likewise.
1485         (gcc::jit::recording::conditional::get_successor_blocks): New.
1486         (gcc::jit::recording::place_label::place_label): Delete.
1487         (gcc::jit::recording::place_label::replay_into): Delete.
1488         (gcc::jit::recording::place_label::make_debug_string): Delete.
1489         (gcc::jit::recording::place_label::write_to_dump): Delete.
1491         (gcc::jit::recording::jump::get_successor_blocks): New.
1492         (gcc::jit::recording::return_::get_successor_blocks): New.
1494         (gcc::jit::recording::loop::replay_into): Delete.
1495         (gcc::jit::recording::loop::make_debug_string): Delete.
1496         (gcc::jit::recording::loop::end): Delete.
1497         (gcc::jit::recording::loop_end::replay_into): Delete.
1498         (gcc::jit::recording::loop_end::make_debug_string): Delete.
1500         (gcc::jit::playback::function::new_forward_label): Delete.
1501         (gcc::jit::playback::function::new_block): New.
1502         (gcc::jit::playback::function::build_stmt_list): New.
1503         (gcc::jit::playback::function::add_eval): Replace with...
1504         (gcc::jit::playback::block::add_eval): New.
1505         (gcc::jit::playback::function::add_assignment): Replace with...
1506         (gcc::jit::playback::block::add_assignment): New.
1507         (gcc::jit::playback::function::add_comment): Replace with...
1508         (gcc::jit::playback::block::add_comment): New, reimplementing,
1509         given that we no longer have labels.
1510         (gcc::jit::playback::function::add_conditional): Replace with...
1511         (gcc::jit::playback::block::add_conditional): New, reworking,
1512         given that on_false can no longer be NULL.
1513         (gcc::jit::playback::function::add_label): Delete.
1514         (gcc::jit::playback::function::place_forward_label): Delete.
1515         (gcc::jit::playback::function::add_jump): Replace with...
1516         (gcc::jit::playback::block::add_jump): New.
1517         (gcc::jit::playback::function::add_return): Replace with...
1518         (gcc::jit::playback::block::add_return): New.
1519         (gcc::jit::playback::function::new_loop): Delete.
1520         (gcc::jit::playback::label::label): Replace with...
1521         (gcc::jit::playback::block::block): ...this.
1523         (gcc::jit::playback::loop::loop): Delete.
1524         (gcc::jit::playback::loop::end): Delete.
1526         (gcc::jit::playback::context::replay): Call each function's
1527         build_stmt_list.
1529         * TODO.rst: Update
1531 2014-02-25  David Malcolm  <dmalcolm@redhat.com>
1533         * libgccjit.h (gcc_jit_function_add_void_return): New.
1534         * libgccjit.map (gcc_jit_function_add_void_return): New.
1535         * libgccjit.c (gcc_jit_function_add_void_return): New.
1536         * libgccjit++.h (add_return): Add overloaded variant with no
1537         rvalue, calling gcc_jit_function_add_void_return.
1539         * internal-api.c (gcc::jit::recording::function::add_return): Add
1540         comment that rvalue could be NULL.
1541         (gcc::jit::playback::function::add_return): Support rvalue being
1542         NULL.
1544 2014-02-25  David Malcolm  <dmalcolm@redhat.com>
1546         * internal-api.h (gcc::jit::playback::function): Add field
1547         m_inner_block.
1549         * internal-api.c (gcc::jit::playback::function::function):
1550         Create BLOCK here and link it to the BIND_EXPR.
1551         (gcc::jit::playback::function::gt_ggc_mx): Walk m_inner_block.
1552         (gcc::jit::playback::function::postprocess): Set up BLOCK_VARS on
1553         the block, so that the local variables make it into the debuginfo.
1555 2014-02-24  Philip Herron <redbrain@gcc.gnu.org>
1557         * Make-lang.in (jit.install-common): Implement.
1559 2014-02-21  David Malcolm  <dmalcolm@redhat.com>
1561         * libgccjit.h (gcc_jit_context_dump_to_file): New.
1562         * libgccjit.map (gcc_jit_context_dump_to_file): New.
1563         * libgccjit.c (gcc_jit_context_dump_to_file): New.
1564         * libgccjit++.h (gccjit::context::dump_to_file): New.
1566         * internal-api.h (gcc::jit::dump): New class.
1567         (gcc::jit::recording::playback_location): Add a replayer argument,
1568         so that playback locations can be created before playback statements.
1569         (gcc::jit::recording::location::playback_location): Likewise.
1570         (gcc::jit::recording::statement::playback_location): Likewise.
1571         (gcc::jit::recording::context::dump_to_file): New.
1572         (gcc::jit::recording::context::m_structs): New field, for use by
1573         dump_to_file.
1574         (gcc::jit::recording::context::m_functions): Likewise.
1575         (gcc::jit::recording::memento::write_to_dump): New virtual function.
1576         (gcc::jit::recording::field::write_to_dump): New.
1577         (gcc::jit::recording::fields::write_to_dump): New.
1578         (gcc::jit::recording::function::write_to_dump): New.
1579         (gcc::jit::recording::function::m_locals): New field for use by
1580         write_to_dump.
1581         (gcc::jit::recording::function::m_activity): Likewise.
1582         (gcc::jit::recording::local::write_to_dump): New.
1583         (gcc::jit::recording::statement::write_to_dump): New.
1584         (gcc::jit::recording::place_label::write_to_dump): New.
1586         * internal-api.c (gcc::jit::dump::dump): New.
1587         (gcc::jit::dump::~dump): New.
1588         (gcc::jit::dump::write): New.
1589         (gcc::jit::dump::make_location): New.
1590         (gcc::jit::recording::playback_location): Add a replayer argument,
1591         so that playback locations can be created before playback statements.
1593         (gcc::jit::recording::context::context): Initialize new fields.
1594         (gcc::jit::recording::function::function): Likewise.
1596         (gcc::jit::recording::context::new_struct_type): Add struct to the
1597         context's m_structs vector.
1598         (gcc::jit::recording::context::new_function): Add function to the
1599         context's m_functions vector.
1600         (gcc::jit::recording::context::dump_to_file): New.
1601         (gcc::jit::recording::memento::write_to_dump): New.
1602         (gcc::jit::recording::field::write_to_dump): New.
1603         (gcc::jit::recording::fields::write_to_dump): New.
1604         (gcc::jit::recording::function::write_to_dump): New.
1605         (gcc::jit::recording::local::write_to_dump): New.
1606         (gcc::jit::recording::statement::write_to_dump): New.
1607         (gcc::jit::recording::place_label::write_to_dump): New.
1609         (gcc::jit::recording::array_type::replay_into): Pass on replayer
1610         to call to playback_location.
1611         (gcc::jit::recording::field::replay_into): Likewise.
1612         (gcc::jit::recording::struct_::replay_into): Likewise.
1613         (gcc::jit::recording::param::replay_into): Likewise.
1614         (gcc::jit::recording::function::replay_into): Likewise.
1615         (gcc::jit::recording::global::replay_into): Likewise.
1616         (gcc::jit::recording::unary_op::replay_into): Likewise.
1617         (gcc::jit::recording::binary_op::replay_into): Likewise.
1618         (gcc::jit::recording::comparison::replay_into): Likewise.
1619         (gcc::jit::recording::call::replay_into): Likewise.
1620         (gcc::jit::recording::array_access::replay_into): Likewise.
1621         (gcc::jit::recording::access_field_of_lvalue::replay_into): Likewise.
1622         (gcc::jit::recording::access_field_rvalue::replay_into): Likewise.
1623         (gcc::jit::recording::dereference_field_rvalue::replay_into): Likewise.
1624         (gcc::jit::recording::dereference_rvalue::replay_into): Likewise.
1625         (gcc::jit::recording::get_address_of_lvalue::replay_into): Likewise.
1626         (gcc::jit::recording::local::replay_into): Likewise.
1627         (gcc::jit::recording::eval::replay_into): Likewise.
1628         (gcc::jit::recording::assignment::replay_into): Likewise.
1629         (gcc::jit::recording::assignment_op::replay_into): Likewise.
1630         (gcc::jit::recording::comment::replay_into): Likewise.
1631         (gcc::jit::recording::conditional::replay_into): Likewise.
1632         (gcc::jit::recording::place_label::replay_into): Likewise.
1633         (gcc::jit::recording::jump::replay_into): Likewise.
1634         (gcc::jit::recording::return_::replay_into): Likewise.
1635         (gcc::jit::recording::loop::replay_into): Likewise.
1636         (gcc::jit::recording::loop_end::replay_into): Likewise.
1638         (gcc::jit::recording::function::new_local): Add to the function's
1639         vector of locals.
1640         (gcc::jit::recording::function::add_eval): Add to the function's
1641         m_activity field.
1642         (gcc::jit::recording::function::add_assignment): Likewise.
1643         (gcc::jit::recording::function::add_assignment_op): Likewise.
1644         (gcc::jit::recording::function::add_comment): Likewise.
1645         (gcc::jit::recording::function::add_conditional): Likewise.
1646         (gcc::jit::recording::function::place_forward_label): Likewise.
1647         (gcc::jit::recording::function::add_jump): Likewise.
1648         (gcc::jit::recording::function::add_return): Likewise.
1649         (gcc::jit::recording::function::new_loop): Likewise.
1651         (gcc::jit::recording::conditional::make_debug_string): Add missing
1652         semicolon.
1654 2014-02-19  David Malcolm  <dmalcolm@redhat.com>
1656         * libgccjit.c (gcc_jit_context_new_rvalue_from_ptr): Verify that
1657         pointer_type is indeed a pointer type.
1658         (gcc_jit_context_null): Likewise.
1659         (gcc_jit_context_new_array_access): Verify that ptr is indeed a
1660         pointer.
1662         * TODO.rst: Update
1664 2014-02-18  David Malcolm  <dmalcolm@redhat.com>
1666         * libgccjit.h (gcc_jit_struct): New.
1667         (gcc_jit_context_new_struct_type): Change return type from gcc_jit_type
1668         to gcc_jit_struct.
1669         (gcc_jit_context_new_opaque_struct): New.
1670         (gcc_jit_struct_as_type): New.
1671         (gcc_jit_struct_set_fields): New.
1672         (gcc_jit_context_null): New.
1674         * libgccjit.map (gcc_jit_context_new_opaque_struct): New.
1675         (gcc_jit_context_null): New.
1676         (gcc_jit_struct_as_type): New.
1677         (gcc_jit_struct_set_fields): New.
1679         * libgccjit++.h (gccjit::context::new_struct_type): Return a
1680         struct_ rather than a type.
1681         (gccjit::context::new_opaque_struct_type): New.
1682         (gccjit::struct_): New subclass of type.
1684         * libgccjit.c (gcc_jit_struct): New.
1685         (RETURN_VAL_IF_FAIL_PRINTF1): New.
1686         (RETURN_VAL_IF_FAIL_PRINTF2): New.
1687         (RETURN_NULL_IF_FAIL_PRINTF1): New.
1688         (RETURN_IF_FAIL_PRINTF1): New.
1689         (RETURN_IF_FAIL_PRINTF2): New.
1690         (gcc_jit_context_new_struct_type): Return a gcc_jit_struct rather
1691         than a gcc_jit_type; implement by creating the struct, then
1692         setting the fields in it.
1693         (gcc_jit_context_new_opaque_struct): New.
1694         (gcc_jit_struct_as_type): New.
1695         (gcc_jit_struct_set_fields): New.
1696         (gcc_jit_context_null): New.
1697         (gcc_jit_lvalue_access_field): Use the struct's context when
1698         reporting on a NULL field; verify that the field has been placed
1699         in a struct.
1700         (gcc_jit_rvalue_access_field): Likewise.
1701         (is_bool): New.
1702         (gcc_jit_function_add_conditional): Use the function's context
1703         when reporting errors; verify that boolval's type is indeed
1704         boolean.
1705         (gcc_jit_function_new_loop): Likewise.
1707         * internal-api.h (gcc::jit::recording::context::new_struct_type):
1708         Don't accept fields, and return a struct_ rather than a type_, so
1709         that fields can be set later.
1710         (gcc::jit::recording::struct_::struct_): Store a (fields *) rather
1711         than a vec of fields.
1712         (gcc::jit::recording::struct_::as_type): New.
1713         (gcc::jit::recording::struct_::get_fields): New.
1714         (gcc::jit::recording::struct_::set_fields): New.
1715         (gcc::jit::recording::struct_::playback_struct): New.
1716         (gcc::jit::recording::fields): New class.
1717         (gcc::jit::playback::context::new_struct_type): Don't accept
1718         fields, and return a struct_ rather than a type_, so that fields
1719         can be set later.
1720         (gcc::jit::playback::struct_): New subclass of type.
1722         * internal-api.c (gcc::jit::recording::context::get_type): With
1723         nested contexts, create basic types within the ultimate parent
1724         context, allowing for a fast check for the boolean type using
1725         pointer equality.
1726         (gcc::jit::recording::context::new_struct_type): Don't accept
1727         fields, and return a struct_ rather than a type_, so that fields
1728         can be set later.
1729         (gcc::jit::recording::context::get_opaque_FILE_type): Update for
1730         struct-creation changes.
1731         (gcc::jit::recording::struct_::struct_): Store a (fields *) rather
1732         than a vec of fields.
1733         (gcc::jit::recording::struct_::set_fields): New.
1734         (gcc::jit::recording::struct_::replay_into): Don't playback the
1735         fields, as this is now done by a fields instance.
1736         (gcc::jit::recording::fields::fields): New.
1737         (gcc::jit::recording::fields::replay_into): New.
1738         (gcc::jit::recording::fields::make_debug_string): New.
1739         (gcc::jit:: playback::context::new_struct_type): Don't accept
1740         fields, and return a struct_ rather than a type_, so that fields
1741         can be set later.
1742         (gcc::jit::playback::struct_::set_fields): New.
1744         * TODO.rst: Update.
1746 2014-02-18  David Malcolm  <dmalcolm@redhat.com>
1748         * libgccjit.c (gcc_jit_function_new_local): Use the context of the
1749         function when reporting errors.
1750         (gcc_jit_function_place_forward_label): Likewise.
1751         (gcc_jit_function_add_eval): Likewise.
1752         (gcc_jit_function_add_assignment_op): Likewise.
1753         (gcc_jit_function_add_comment): Likewise.
1754         (gcc_jit_function_add_jump): Likewise.
1756 2014-02-14  David Malcolm  <dmalcolm@redhat.com>
1758         * libgccjit++.h (gccjit::type::zero): New method.
1759         (gccjit::type::one): New method.
1760         (gccjit::function::add_call): New family of overloaded methods.
1762 2014-02-13  David Malcolm  <dmalcolm@redhat.com>
1764         * libgccjit.h (gcc_jit_context_get_builtin_function): New.
1765         * libgccjit.map (gcc_jit_context_get_builtin_function): New.
1766         * libgccjit++.h (gccjit::context::get_builtin_function): New method.
1768         * Make-lang.in (jit_OBJS): Add jit/jit-builtins.o
1769         * jit-builtins.c: New source file, for managing builtin functions
1770         and their types.
1771         * jit-builtins.h: Likewise.
1773         * libgccjit.c (gcc_jit_context_new_function): Pass BUILT_IN_NONE for
1774         the new argument of new_function
1775         (gcc_jit_context_get_builtin_function): New.
1777         * internal-api.h: Add idempotency guards.
1778         (gcc::jit::recording::context::new_function): Add parameter
1779         for builtin functions.
1780         (gcc::jit::recording::context::get_builtin_function): New method.
1781         (gcc::jit::recording::context::m_builtins_manager): New field.
1782         (gcc::jit::recording::type::as_a_function_type): New virtual function.
1783         (gcc::jit::recording::function_type): New subclass of type.
1784         (gcc::jit::recording::function::function): Add parameter for
1785         builtin functions.
1786         (gcc::jit::recording::function::m_builtin_id): New field.
1787         (gcc::jit::recording::function::new_function_type): New method.
1788         (gcc::jit::playback::function::function):  Add parameter for
1789         builtin functions.
1790         * internal-api.c (gcc::jit::recording::context::context):
1791         NULL-initialize new field m_builtins_manager.
1792         (gcc::jit::recording::context::~context): Clean up the builtins
1793         manager, if one has been created.
1794         (gcc::jit::recording::context::new_function): Add parameter
1795         (gcc::jit::recording::context::get_builtin_function): New method.
1796         (gcc::jit::recording::function_type::function_type): Implement
1797         constructor for new subclass.
1798         (gcc::jit::recording::function_type::dereference): Implement
1799         method for new subclass.
1800         (gcc::jit::recording::function_type::replay_into): Likewise.
1801         (gcc::jit::recording::function_type::make_debug_string): Likewise.
1802         (gcc::jit::recording::function::function): Add parameter for
1803         builtin functions.
1804         (gcc::jit::recording::function::replay_into): Likewise for
1805         creation of playback object.
1806         (gcc::jit::recording::function::new_function_type): New method.
1807         (gcc::jit::playback::function::new_function):  Add parameter for
1808         builtin functions, using it to set up the fndecl accordingly.
1810 2014-02-11  David Malcolm  <dmalcolm@redhat.com>
1812         * libgccjit.c (IS_ASCII_ALPHA): New macro.
1813         (IS_ASCII_DIGIT): New macro.
1814         (IS_ASCII_ALNUM): New macro.
1815         (gcc_jit_context_new_function): Require that function names be valid
1816         C identifiers for now, to avoid later problems in the assembler.
1818 2014-02-11  David Malcolm  <dmalcolm@redhat.com>
1820         * libgccjit.h (enum gcc_jit_types): Add GCC_JIT_TYPE_BOOL.
1822         * internal-api.h (gcc::jit::recording::comparison::comparison): Use
1823         GCC_JIT_TYPE_BOOL as the types of comparisons, rather than
1824         GCC_JIT_TYPE_INT.
1826         * internal-api.c (gcc::jit::recording::memento_of_get_type::
1827         dereference): Handle GCC_JIT_TYPE_BOOL (with an error).
1828         (get_type_strings): Add GCC_JIT_TYPE_BOOL.
1829         (get_tree_node_for_type): Handle GCC_JIT_TYPE_BOOL.
1831 2014-02-11  David Malcolm  <dmalcolm@redhat.com>
1833         * internal-api.c (gcc::jit::recording::context::add_error_va): If
1834         GCC_JIT_STR_OPTION_PROGNAME is NULL, use "libgccjit.so", as per
1835         the comment in libgccjit.h
1836         (gcc::jit::recording::label::replay_into): When reporting on an
1837         unplaced label, include the name of the containing function in
1838         the error message.
1839         * libgccjit.c: Remove comment about "Functions for use within the
1840         code factory", as this distinction went away in commit
1841         96b218c9a1d5f39fb649e02c0e77586b180e8516.
1842         (RETURN_VAL_IF_FAIL_PRINTF4): New.
1843         (RETURN_NULL_IF_FAIL_PRINTF4): New.
1844         (jit_error): Invoke vfprintf with the correct format string in
1845         the NULL context case.
1846         (gcc_jit_context_new_call): Check for NULL entries within the
1847         array of arguments.
1849 2014-02-10  David Malcolm  <dmalcolm@redhat.com>
1851         * libgccjit.h (gcc_jit_context_get_int_type): New.
1852         * libgccjit.map (gcc_jit_context_get_int_type): New.
1853         * libgccjit.c (gcc_jit_context_get_int_type): New.
1855         * internal-api.h (gcc::jit::recording::context::get_int_type): New.
1856         (gcc::jit::recording::context::get_int_type<T>): New template.
1857         * internal-api.c (gcc::jit::recording::context::get_int_type): New.
1859         * libgccjit++.h: Include <limits> so we can use std::numeric_limits.
1860         (gccjit::context::get_int_type): New.
1861         (gccjit::context::get_int_type<T>): New.
1863 2014-02-10  David Malcolm  <dmalcolm@redhat.com>
1865         * libgccjit.h (gcc_jit_function_get_param): New.
1866         * libgccjit.map (gcc_jit_function_get_param): New.
1867         * libgccjit.c (gcc_jit_function_get_param): New.
1868         * libgccjit++.h (gccjit::function::get_param): New.
1870 2014-02-10  David Malcolm  <dmalcolm@redhat.com>
1872         * libgccjit++.h (gccjit::object::get_inner_object): Make const.
1873         (gccjit::location::get_inner_location): Likewise.
1874         (gccjit::field::get_inner_field): Likewise.
1875         (gccjit::type::get_inner_type): Likewise.
1876         (gccjit::function::get_inner_function): Likewise.
1877         (gccjit::label::get_inner_label): Likewise.
1878         (gccjit::rvalue::get_inner_rvalue): Likewise.
1879         (gccjit::lvalue::get_inner_lvalue): Likewise.
1880         (gccjit::param::get_inner_param): Likewise.
1882 2014-02-10  David Malcolm  <dmalcolm@redhat.com>
1884         * libgccjit++.h (gccjit::object::get_context): New method.
1885         (gccjit::function): Add overloaded operator () for various
1886         numbers of arguments as a very terse way of creating function calls.
1887         (gccjit::rvalue::get_type): New method.
1889         (operator-): New overloaded unary op for rvalues.
1890         (operator~): Likewise.
1891         (operator!): Likewise.
1893         (operator+): New overloaded binary op for rvalues.
1894         (operator-): Likewise.
1895         (operator*): Likewise.
1896         (operator/): Likewise.
1897         (operator%): Likewise.
1898         (operator&): Likewise.
1899         (operator^): Likewise.
1900         (operator|): Likewise.
1901         (operator&&): Likewise.
1902         (operator||): Likewise.
1904         (operator==): New overloaded comparison for rvalues.
1905         (operator!=): Likewise.
1906         (operator<): Likewise.
1907         (operator<=): Likewise.
1908         (operator>): Likewise.
1909         (operator>=): Likewise.
1911         (operator*): New overloaded operator for dereferencing an
1912         rvalue representing a pointer.
1914         * libgccjit.c (gcc_jit_rvalue_get_type): New.
1915         * libgccjit.h (gcc_jit_rvalue_get_type): New.
1916         * libgccjit.map (gcc_jit_rvalue_get_type): New.
1918 2014-02-10  David Malcolm  <dmalcolm@redhat.com>
1920         * libgccjit++.h (gccjit::context::new_minus): New method,
1921         providing a way to do a specific unary op with less typing.
1922         (gccjit::context::new_bitwise_negate): Likewise.
1923         (gccjit::context::new_logical_negate): Likewise.
1925         (gccjit::context::new_plus): Likewise, for binary op.
1926         (gccjit::context::new_minus): Likewise.
1927         (gccjit::context::new_mult): Likewise.
1928         (gccjit::context::new_divide): Likewise.
1929         (gccjit::context::new_modulo): Likewise.
1930         (gccjit::context::new_bitwise_and): Likewise.
1931         (gccjit::context::new_bitwise_xor): Likewise.
1932         (gccjit::context::new_bitwise_or): Likewise.
1933         (gccjit::context::new_logical_and): Likewise.
1934         (gccjit::context::new_logical_or): Likewise.
1936         (gccjit::context::new_eq): Likewise, for comparison.
1937         (gccjit::context::new_ne): Likewise.
1938         (gccjit::context::new_lt): Likewise.
1939         (gccjit::context::new_le): Likewise.
1940         (gccjit::context::gccjit::context::new_gt): Likewise.
1941         (gccjit::context::gccjit::context::new_ge): Likewise.
1943         (gccjit::context::new_call): Add a series of overloaded methods
1944         for specific numbers of args (from 0 - 6), to avoid the need for
1945         client code to manually build a std::vector (or requiring C++11).
1947 2014-02-10  David Malcolm  <dmalcolm@redhat.com>
1949         * libgccjit++.h (gccjit::context::new_struct_type): Pass std::vector
1950         "fields" argument by reference rather than by value.
1951         (gccjit::context::new_function): Likewise, for "params" arg.
1952         (gccjit::context::new_call): Likewise, for "args" arg.
1954 2014-02-10  David Malcolm  <dmalcolm@redhat.com>
1956         * libgccjit++.h (gccjit::context::new_location): Update filename
1957         arg from a const char * to a const std::string &.
1958         (gccjit::context::new_field): Likewise for "name" arg.
1959         (gccjit::context::new_struct_type): Likewise.
1960         (gccjit::context::new_param): Likewise.
1961         (gccjit::context::new_function): Likewise.
1962         (gccjit::function::new_local): Likewise.
1963         (gccjit::context::new_rvalue): Likewise for "value" arg.
1964         (gccjit::function::add_comment): Likewise for "text" arg.
1965         (gccjit::function::new_forward_label): Likewise for "name" arg; add
1966         variant taking no args for anonymous labels.
1967         (gccjit::function::add_label): Likewise.
1969 2014-02-10  David Malcolm  <dmalcolm@redhat.com>
1971         * libgccjit++.h (gccjit::object, gccjit::location): Move
1972         these declarations to before that of gccjit::context so that
1973         the various methods of context taking a location can have a
1974         default location value.
1975         (gccjit::context::new_array_type): Consolidate two methods,
1976         one accepting a gccjit::location, the other without, by
1977         providing a default argument (which thus has to be moved to the
1978         end of the argument list).
1979         (gccjit::context::new_field): Likewise.
1980         (gccjit::context::new_struct_type): Likewise.
1981         (gccjit::context::new_param): Likewise.
1982         (gccjit::context::new_function): Likewise.
1983         (gccjit::context::new_unary_op): Likewise.
1984         (gccjit::context::new_binary_op): Likewise.
1985         (gccjit::context::new_comparison): Likewise.
1986         (gccjit::context::new_call): Likewise.
1987         (gccjit::context::new_array_access): Likewise.
1988         (gccjit::function::new_local): Likewise.
1989         (gccjit::function::add_eval): Likewise.
1990         (gccjit::function::add_assignment): Likewise.
1991         (gccjit::function::add_assignment_op): Likewise.
1992         (gccjit::function::add_comment): Likewise.
1993         (gccjit::function::add_conditional): Likewise.
1994         (gccjit::function::add_label): Likewise.
1995         (gccjit::function::place_forward_label): Likewise.
1996         (gccjit::function::add_jump): Likewise.
1997         (gccjit::function::add_return): Likewise.
1998         (gccjit::rvalue::access_field): Likewise.
1999         (gccjit::rvalue::dereference_field): Likewise.
2000         (gccjit::rvalue::dereference): Likewise.
2001         (gccjit::lvalue::access_field): Likewise.
2002         (gccjit::lvalue::get_address): Likewise.
2004 2014-02-10  David Malcolm  <dmalcolm@redhat.com>
2006         * TODO.rst: Update.
2008 2014-02-06  David Malcolm  <dmalcolm@redhat.com>
2010         * libgccjit++.h: Include <ostream> rather than <iostream>, since
2011         the former gets us std::ostream, and the latter may introduce
2012         startup-time overhead for constructing std::cout et al.
2013         (gccjit::context::new_child_context): New.
2014         (gccjit::context::release): New.
2015         (gccjit::context::compile): New.
2016         (gccjit::context::set_int_option): New.
2017         (gccjit::context::set_bool_option): New.
2019 2014-02-03  David Malcolm  <dmalcolm@redhat.com>
2021         * libgccjit.h (struct gcc_jit_object): New.
2022         (gcc_jit_object_get_context): New.
2023         (gcc_jit_object_get_debug_string): New.
2024         (gcc_jit_location_as_object): New.
2025         (gcc_jit_type_as_object): New.
2026         (gcc_jit_field_as_object): New.
2027         (gcc_jit_param_as_object): New.
2028         (gcc_jit_function_as_object): New.
2029         (gcc_jit_label_as_object): New.
2030         (gcc_jit_lvalue_as_object): New.
2031         (gcc_jit_rvalue_as_object): New.
2032         (gcc_jit_loop_as_object): New.
2034         * libgccjit.map (gcc_jit_field_as_object): New.
2035         (gcc_jit_function_as_object): New.
2036         (gcc_jit_label_as_object): New.
2037         (gcc_jit_location_as_object): New.
2038         (gcc_jit_loop_as_object): New.
2039         (gcc_jit_lvalue_as_object): New.
2040         (gcc_jit_object_get_context): New.
2041         (gcc_jit_object_get_debug_string): New.
2042         (gcc_jit_param_as_object): New.
2043         (gcc_jit_rvalue_as_object): New.
2044         (gcc_jit_type_as_object): New.
2046         * libgccjit.c (struct gcc_jit_object): New.
2047         (gcc_jit_location_as_object): New.
2048         (gcc_jit_type_as_object): New.
2049         (gcc_jit_field_as_object): New.
2050         (gcc_jit_param_as_object): New.
2051         (gcc_jit_function_as_object): New.
2052         (gcc_jit_label_as_object): New.
2053         (gcc_jit_lvalue_as_object): New.
2054         (gcc_jit_rvalue_as_object): New.
2055         (gcc_jit_object_get_context): New.
2056         (gcc_jit_object_get_debug_string): New.
2057         (gcc_jit_loop_as_object): New.
2058         * internal-api.h (gcc::jit::recording::memento::get_context): New.
2059         (gcc::jit::recording::memento::as_object): New.
2061         * libgccjit++.h: Require iostream, for std::ostream.
2062         (class object): New base class.
2063         (operator << (std::ostream& stream, const object &obj)): New.
2064         (location): Inherit from the new "object" base class.
2065         (location::m_inner_loc): Remove, in favor of...
2066         (location::get_inner_location): ...new method.
2067         (field): Inherit from the new "object" base class.
2068         (field::m_inner_field): Remove, in favor of...
2069         (field::get_inner_field): ...new method.
2070         (type): Inherit from the new "object" base class.
2071         (type::m_inner_type): Remove, in favor of...
2072         (type::get_inner_type): ...new method.
2073         (function): Inherit from the new "object" base class.
2074         (function::m_inner_func): Remove, in favor of...
2075         (function::get_inner_function): ...new method.
2076         (label): Inherit from the new "object" base class.
2077         (label::m_inner_label): Remove, in favor of...
2078         (label::get_inner_label): ...new method.
2079         (rvalue) Inherit from the new "object" base class.
2080         (rvalue::m_inner_rvalue): Remove, in favor of...
2081         (rvalue::get_inner_rvalue): ...new method.
2083         (context::new_field): Update for move of inner pointer to the
2084         "object" base class.
2085         (context::new_struct_type): Likewise.
2086         (context::new_param): Likewise.
2087         (context::new_function): Likewise.
2088         (context::new_rvalue): Likewise.
2089         (context::zero): Likewise.
2090         (context::one): Likewise.
2091         (context::new_rvalue): Likewise.
2092         (context::new_rvalue): Likewise.
2093         (context::new_unary_op): Likewise.
2094         (context::new_binary_op): Likewise.
2095         (context::new_comparison): Likewise.
2096         (context::new_call): Likewise.
2098         (object::get_debug_string): New.
2099         (object::object): New.
2100         (object::get_inner_object): New.
2101         (operator << (std::ostream&, const object &)): New.
2103         (location::location): Update for move of inner pointer to the
2104         "object" base class.
2105         (location::get_inner_location): New.
2107         (field::field): Update for move of inner pointer to the
2108         "object" base class.
2109         (field::get_inner_field): New.
2111         (type::type): Update for move of inner pointer to the
2112         "object" base class.
2113         (type::get_pointer): Likewise.
2114         (type::get_inner_type): New.
2116         (function::function): Update for move of inner pointer to the
2117         "object" base class.
2118         (function::new_forward_label): Likewise.
2119         (function::new_local): Likewise.
2120         (function::add_eval): Likewise.
2121         (function::add_assignment): Likewise.
2122         (function::add_assignment_op): Likewise.
2123         (function::add_comment): Likewise.
2124         (function::add_conditional): Likewise.
2125         (function::add_label): Likewise.
2126         (function::place_forward_label): Likewise.
2127         (function::add_jump): Likewise.
2128         (function::add_return): Likewise.
2129         (function::get_inner_function): New.
2131         (label::label): Update for move of inner pointer to the "object"
2132         base class.
2133         (label::get_inner_label): New
2135         (rvalue::rvalue): Update for move of inner pointer to the "object"
2136         base class.
2137         (rvalue::get_inner_rvalue): New.
2138         (rvalue::access_field): Likewise.
2139         (rvalue::dereference_field): Likewise.
2140         (rvalue::dereference): Likewise.
2142         (lvalue::get_inner_lvalue): Update for move of inner pointer to
2143         the "object" base class.
2144         (lvalue::access_field): Likewise.
2145         (lvalue::get_address): Likewise.
2147 2014-01-31  David Malcolm  <dmalcolm@redhat.com>
2149         * libgccjit++.h: New file - a C++ wrapper for the libgccjit.h API.
2151         * TODO.rst ("Test Suite"): New section, adding note about C++
2152         tests.
2154 2014-01-31  David Malcolm  <dmalcolm@redhat.com>
2156         * libgccjit.h (gcc_jit_context_new_rvalue_from_int): Give the type
2157         parameter a more descriptive name.
2158         (gcc_jit_context_zero): Likewise.
2159         (gcc_jit_context_one): Likewise.
2160         (gcc_jit_context_new_rvalue_from_double): Likewise.
2161         (gcc_jit_context_new_rvalue_from_ptr): Likewise.
2163         * libgccjit.c (gcc_jit_context_new_rvalue_from_int): Likewise.
2164         (gcc_jit_context_zero): Likewise.
2165         (gcc_jit_context_one): Likewise.
2166         (gcc_jit_context_new_rvalue_from_double): Likewise.
2167         (gcc_jit_context_new_rvalue_from_ptr): Likewise.
2169         * internal-api.h (gcc::jit::recording::context::
2170         new_rvalue_from_int): Likewise.
2171         (gcc::jit::recording::context::
2172         new_rvalue_from_double): Likewise.
2173         (gcc::jit::recording::memento_of_new_rvalue_from_int::
2174         memento_of_new_rvalue_from_int): Likewise.
2175         (gcc::jit::recording::memento_of_new_rvalue_from_double::
2176         memento_of_new_rvalue_from_double): Likewise.
2177         (gcc::jit::recording::memento_of_new_rvalue_from_ptr::
2178         memento_of_new_rvalue_from_ptr): Likewise.
2180 2014-01-30  David Malcolm  <dmalcolm@redhat.com>
2182         * TODO.rst: Label-placement is now checked.
2184         * internal-api.c (gcc::jit::recording::context::replay_into): Give
2185         up if any errors occur during the playback.
2186         (gcc::jit::recording::label::replay_into): Issue an error if the
2187         label has not yet been placed (at playback time).
2188         (gcc::jit::recording::place_label::place_label): Move this here
2189         from internal-api.h.  Issue an error if the label has already
2190         been placed (at recording time).
2192         * internal-api.h (gcc::jit::recording::label): Add an
2193         m_has_been_placed field, and make class place_label a friend so
2194         it can set it.
2195         (gcc::jit::recording::label::has_been_placed): New accessor.
2196         (gcc::jit::recording::place_label::place_label): Move to
2197         internal-api.c.
2199         (gcc::jit::playback::context::errors_occurred): Make public, for
2200         use by gcc::jit::recording::context::replay_into.
2202 2014-01-30  David Malcolm  <dmalcolm@redhat.com>
2204         * internal-api.c (gcc::jit::recording::type::get_pointer):
2205         Ensure that repeated calls yield the same type.
2206         (gcc::jit::recording::memento_of_get_pointer::
2207         accepts_writes_from): New.
2208         (gcc::jit::recording::context::new_call): Move
2209         the existing argument checking to...
2211         * libgccjit.c (gcc_jit_context_new_call): ...here, and add
2212         checking of the types of the arguments against the function.
2213         (RETURN_VAL_IF_FAIL_PRINTF6): New.
2214         (RETURN_NULL_IF_FAIL_PRINTF6): New.
2216         * internal-api.h (gcc::jit::recording::type): New field
2217         m_pointer_to_this_type, for use by get_pointer method.
2218         (gcc::jit::recording::memento_of_get_pointer::
2219         accepts_writes_from): New.
2220         (gcc::jit::recording::function::get_param): New.
2222         * TODO.rst (argument checking of gcc_jit_context_new_call): Done.
2224 2014-01-30  David Malcolm  <dmalcolm@redhat.com>
2226         * TODO.rst: begin a list of error-checking we could do that this
2227         commit *doesn't* cover.
2229         * libgccjit.h (gcc_jit_field): Add note that fields can't be
2230         shared between structs.
2231         (GCC_JIT_BINARY_OP_MODULO): Fix typo in comment.
2233         * libgccjit.c: (RETURN_VAL_IF_FAIL_PRINTF2): New.
2234         (RETURN_VAL_IF_FAIL_PRINTF3): New.
2235         (RETURN_NULL_IF_FAIL_PRINTF2): New.
2236         (RETURN_NULL_IF_FAIL_PRINTF3): New.
2237         (RETURN_IF_FAIL_PRINTF4): New.
2239         (jit_error): Take a gcc::jit::recording::context rather than
2240         a gcc_jit_context so that we pass in contexts from the inner
2241         layer.
2243         (compatible_types): New, for use in type-checking.
2245         (gcc_jit_context_new_struct_type): Check each field to ensure that
2246         it isn't already in use by another struct.
2248         (gcc_jit_rvalue_dereference_field): Check that ptr is of a pointer
2249         type and that the field is within the correct struct, using new
2250         get_debug_string hooks to generate error messages.
2252         (gcc_jit_rvalue_dereference): Check that rvalue is of a pointer
2253         type.
2255         (gcc_jit_function_add_assignment): Use the function's context when
2256         reporting on NULL lvalue or rvalue.  Verify that the lvalue and
2257         rvalue have compatible types.
2259         (gcc_jit_function_add_return): Use the function's context when
2260         reporting on NULL rvalue.  Verify that the rvalue is of an
2261         appropriate type given the function's return type.
2263         * internal-api.h (NUM_GCC_JIT_TYPES): New.
2264         (gcc::jit::recording::context::record): Move from here to
2265         internal-api.c.
2266         (gcc::jit::recording::context::get_opaque_FILE_type): New.
2267         (gcc::jit::recording::context::m_basic_types): New field.
2268         (gcc::jit::recording::context::m_FILE_type): New field.
2270         (gcc::jit::recording::memento::get_debug_string): New method.
2271         (gcc::jit::recording::memento::memento): Initialize new field
2272         m_debug_string, and verify context is non-NULL.
2273         (gcc::jit::recording::memento::make_debug_string): New
2274         pure-virtual function lazily used by get_debug_string.
2275         (gcc::jit::recording::memento::m_debug_string): New field, for
2276         get_debug_string to use as a cache.
2278         (gcc::jit::recording::string): Rename field m_copy to m_buffer.
2279         (gcc::jit::recording::from_printf): New factory function.
2280         (gcc::jit::recording::make_debug_string): New.
2282         (gcc::jit::recording::location::make_debug_string): New.
2284         (gcc::jit::recording::type::dereference): New pure-virtual
2285         function.
2286         (gcc::jit::recording::type::accepts_writes_from): New virtual
2287         function.
2288         (gcc::jit::recording::type::unqualified): New virtual function.
2290         (gcc::jit::recording::memento_of_get_type::dereference): New.
2291         (gcc::jit::recording::memento_of_get_type::
2292         accepts_writes_from): New.
2293         (gcc::jit::recording::memento_of_get_type::make_debug_string):
2294         New.
2296         (gcc::jit::recording::memento_of_get_pointer::make_debug_string):
2297         New.
2298         (gcc::jit::recording::memento_of_get_pointer::dereference): New.
2299         New.
2301         (gcc::jit::recording::memento_of_get_const::make_debug_string):
2302         New.
2303         (gcc::jit::recording::memento_of_get_const::dereference): New.
2304         New.
2305         (gcc::jit::recording::memento_of_get_const::accepts_writes_from):
2306         New.
2307         (gcc::jit::recording::memento_of_get_const::unqualified): New.
2309         (gcc::jit::recording::field): New field m_container, for the
2310         containing struct (or union, if we implement that).
2311         (gcc::jit::recording::field::get_type): New.
2312         (gcc::jit::recording::field::get_container): New.
2313         (gcc::jit::recording::field:set_container): New.
2314         (gcc::jit::recording::field::make_debug_string): New.
2316         (gcc::jit::recording::struct_::struct_): Move ctor implementation
2317         from here into internal-api.c.
2318         (gcc::jit::recording::struct_::dereference): New.
2319         (gcc::jit::recording::struct_::make_debug_string): New.
2321         (gcc::jit::recording::rvalue::m_type): New field.
2322         (gcc::jit::recording::rvalue::rvalue): Require a non-NULL type for
2323         new rvalue instances.
2324         (gcc::jit::recording::rvalue::get_type): New accessor.
2326         (gcc::jit::recording::lvalue): Eliminate field m_type in favor of
2327         that within the rvalue base class.
2329         (gcc::jit::recording::param::make_debug_string): New.
2331         (gcc::jit::recording::function::get_return_type): New accessor.
2332         (gcc::jit::recording::function::make_debug_string): New.
2334         (gcc::jit::recording::label::make_debug_string): New.
2336         (gcc::jit::recording::global): Eliminate field m_type in favor of
2337         that within the rvalue ultimate base class (via lvalue).
2338         (gcc::jit::recording::make_debug_string): New.
2340         (gcc::jit::recording::memento_of_new_rvalue_from_int): Eliminate
2341         field m_type in favor of that within the rvalue base class.
2342         (gcc::jit::recording::memento_of_new_rvalue_from_int::
2343         make_debug_string): New.
2345         (gcc::jit::recording::memento_of_new_rvalue_from_double): Eliminate
2346         field m_type in favor of that within the rvalue base class.
2347         (gcc::jit::recording::memento_of_new_rvalue_from_double::
2348         make_debug_string): New.
2350         (gcc::jit::recording::memento_of_new_rvalue_from_ptr): Eliminate
2351         field m_type in favor of that within the rvalue base class.
2352         (gcc::jit::recording::memento_of_new_rvalue_from_ptr::
2353         make_debug_string): New.
2355         (gcc::jit::recording::memento_of_new_string_literal::
2356         memento_of_new_string_literal): Initialize type.
2357         (gcc::jit::recording::memento_of_new_string_literal::
2358         make_debug_string): New.
2360         (gcc::jit::recording::unary_op): Eliminate field m_result_type in
2361         favor of m_type within the rvalue base class.
2362         (gcc::jit::recording::unary_op::make_debug_string): New.
2364         (gcc::jit::recording::binary_op): Eliminate field m_result_type in
2365         favor of m_type within the rvalue base class.
2366         (gcc::jit::recording::binary_op::make_debug_string): New.
2368         (gcc::jit::recording::comparison): Eliminate field m_result_type
2369         in favor of m_type within the rvalue base class.
2370         (gcc::jit::recording::comparison::make_debug_string): New.
2372         (gcc::jit::recording::make_debug_string): New.
2374         (gcc::jit::recording::array_lookup::array_lookup): Initialize type
2375         by dereferencing the type of the pointer.
2376         (gcc::jit::recording::array_lookup::make_debug_string): New.
2378         (gcc::jit::recording::access_field_of_lvalue::
2379         access_field_of_lvalue): Initialize type from that of the field.
2380         (gcc::jit::recording::access_field_of_lvalue::
2381         make_debug_string): New.
2383         (gcc::jit::recording::access_field_rvalue::
2384         access_field_of_rvalue): Initialize type from that of the field.
2385         (gcc::jit::recording::access_field_rvalue::make_debug_string):
2386         New.
2388         (gcc::jit::recording::dereference_field_rvalue::
2389         dereference_field_rvalue): Initialize type from that of the field.
2390         (gcc::jit::recording::dereference_field_rvalue::
2391         make_debug_string): New.
2393         (gcc::jit::recording::dereference_rvalue::dereference_rvalue):
2394         Initialize type by dereferencing the type of the pointer.
2395         (gcc::jit::recording::dereference_rvalue::make_debug_string): New.
2397         (gcc::jit::recording::get_address_of_lvalue::
2398         get_address_of_lvalue):  Initialize type by dereferencing the type
2399         of the pointer.
2400         (gcc::jit::recording::get_address_of_lvalue::make_debug_string):
2401         New.
2403         (gcc::jit::recording::local): Eliminate field m_type in favor of
2404         that within the rvalue ultimate base class (via lvalue).
2405         (gcc::jit::recording::make_debug_string): New.
2407         (gcc::jit::recording::eval::make_debug_string): New.
2408         (gcc::jit::recording::assignment::make_debug_string): New.
2409         (gcc::jit::recording::assignment_op::make_debug_string): New.
2410         (gcc::jit::recording::comment::make_debug_string): New.
2411         (gcc::jit::recording::conditional::make_debug_string): New.
2412         (gcc::jit::recording::place_label::make_debug_string): New.
2413         (gcc::jit::recording::jump::make_debug_string): New.
2414         (gcc::jit::recording::return_::make_debug_string): New.
2415         (gcc::jit::recording::loop::make_debug_string): New.
2416         (gcc::jit::recording::loop_end::make_debug_string): New.
2418         * internal-api.c (gcc::jit::recording::context::context):
2419         Initialize m_FILE_type and m_basic_types.
2420         (gcc::jit::recording::context::record): Move here from
2421         internal-api.h.
2422         (gcc::jit::recording::context::replay_into): Add a disabled way to
2423         log everything during a replay, exercising the stringification
2424         machinery.
2425         (gcc::jit::recording::context::get_type): Cache and reuse the
2426         types, so that repeated calls on the context give the same object.
2427         (gcc::jit::recording::context::get_opaque_FILE_type): New, for
2428         the result of dereferencing (FILE*), mostly so that fuzz-testing
2429         that tries this gets something sane back.
2430         (gcc::jit::recording::memento::get_debug_string): New method,
2431         giving a way to easily get a descriptive (const char *) for
2432         an API entity.  Internally, it lazily calls the make_debug_string
2433         virtual function, storing the result in m_debug_string.
2435         (gcc::jit::recording::string::string): Rename field m_copy to m_buffer.
2436         (gcc::jit::recording::string::~string): Likewise.
2437         (gcc::jit::recording::string::from_printf): New factory function,
2438         to make it easy to implement the make_debug_string hooks.
2440         (gcc::jit::recording::string::make_debug_string): New.
2442         (gcc::jit::recording::location::make_debug_string): New.
2444         (gcc::jit::recording::memento_of_get_type::dereference): New.
2446         (get_type_strings): New table of strings, for use by...
2447         (gcc::jit::recording::memento_of_get_type::make_debug_string): New.
2449         (gcc::jit::recording::memento_of_get_pointer::make_debug_string): New.
2451         (gcc::jit::recording::memento_of_get_const::make_debug_string): New.
2453         (gcc::jit::recording::field::make_debug_string): New.
2455         (gcc::jit::recording::struct_::struct_): Move here from
2456         internal-api.h.  Mark all fields as belonging to the new struct.
2458         (gcc::jit::recording::struct_::dereference): New.
2459         (gcc::jit::recording::struct_::make_debug_string): New.
2461         (gcc::jit::recording::function::make_debug_string): New.
2463         (gcc::jit::recording::label::make_debug_string): New.
2465         (gcc::jit::recording::memento_of_new_rvalue_from_int::
2466         make_debug_string): New.
2467         (gcc::jit::recording::memento_of_new_rvalue_from_double::
2468         make_debug_string): New.
2469         (gcc::jit::recording::memento_of_new_rvalue_from_ptr::
2470         make_debug_string): New.
2471         (gcc::jit::recording::memento_of_new_string_literal::
2472         make_debug_string): New.
2474         (gcc::jit::recording::unary_op::replay_into): Use get_type ()
2475         rather than the now-defunct m_result_type.
2476         (gcc::jit::recording::binary_op::replay_into): Likewise.
2478         (unary_op_strings): New table of strings for use by...
2479         (gcc::jit::recording::unary_op::make_debug_string): New.
2481         (binary_op_strings): New table of strings for use by...
2482         (gcc::jit::recording::binary_op::make_debug_string): New.
2484         (comparison_strings): New table of strings for use by...
2485         (gcc::jit::recording::comparison::make_debug_string): New.
2487         (gcc::jit::recording::call::call): Initialize the type.
2488         (gcc::jit::recording::call::make_debug_string): New.
2490         (gcc::jit::recording::array_lookup::make_debug_string): New.
2491         (gcc::jit::recording::access_field_of_lvalue::
2492         make_debug_string): New.
2493         (gcc::jit::recording::access_field_rvalue::
2494         make_debug_string): New.
2495         (gcc::jit::recording::dereference_field_rvalue::
2496         make_debug_string): New.
2497         (gcc::jit::recording::dereference_rvalue::make_debug_string): New.
2498         (gcc::jit::recording::get_address_of_lvalue::
2499         make_debug_string): New.
2500         (gcc::jit::recording::eval::make_debug_string): New.
2501         (gcc::jit::recording::assignment::make_debug_string): New.
2502         (gcc::jit::recording::assignment_op::make_debug_string): New.
2503         (gcc::jit::recording::comment::make_debug_string): New.
2504         (gcc::jit::recording::conditional::make_debug_string): New.
2505         (gcc::jit::recording::place_label::make_debug_string): New.
2506         (gcc::jit::recording::jump::make_debug_string): New.
2507         (gcc::jit::recording::return_::make_debug_string): New.
2508         (gcc::jit::recording::loop::make_debug_string): New.
2509         (gcc::jit::recording::loop_end::make_debug_string): New.
2511 2014-01-29  David Malcolm  <dmalcolm@redhat.com>
2513         * libgccjit.h (gcc_jit_lvalue_access_field): Require
2514         a (gcc_jit_field *) rather than a field name.
2515         (gcc_jit_rvalue_access_field): Likewise.
2516         (gcc_jit_rvalue_dereference_field): Likewise.
2518         * libgccjit.c (gcc_jit_lvalue_access_field): Require
2519         a (gcc_jit_field *) rather than a field name.
2520         (gcc_jit_rvalue_access_field): Likewise.
2521         (gcc_jit_rvalue_dereference_field): Likewise.
2523         * internal-api.c (gcc::jit::recording::rvalue::access_field):
2524         Require a field rather than a fieldname string.
2525         (gcc::jit::recording::rvalue::dereference_field): Likewise.
2526         (gcc::jit::recording::lvalue::access_field): Likewise.
2528         (gcc::jit::recording::access_field_of_lvalue::replay_into): Update
2529         given that this now has a field, rather than a fieldname.
2530         (gcc::jit::recording::access_field_rvalue::replay_into): Likewise.
2531         (gcc::jit::recording::dereference_field_rvalue::replay_into): Likewise.
2533         (get_field): Delete, as we no longer need to convert
2534         from (struct, identifier) pairs to fields, instead directly using
2535         fields.
2537         (gcc::jit::playback::context::new_field_access): Require a field
2538         rather than a fieldname, removing the need to look up the field by
2539         name within the struct.
2541         (gcc::jit::playback::lvalue::access_field): Likewise.
2542         (gcc::jit::playback::rvalue::access_field): Likewise.
2543         (gcc::jit::playback::rvalue::dereference_field): Likewise.
2545         * internal-api.h (gcc::jit::recording::rvalue::access_field):
2546         Require a field rather than a fieldname string.
2547         (gcc::jit::recording::rvalue::dereference_field): Likewise.
2548         (gcc::jit::recording::lvalue::access_field): Likewise.
2550         (gcc::jit::recording::access_field_of_lvalue::access_field_of_lvalue):
2551         Likewise.
2552         (gcc::jit::recording::access_field_of_lvalue::m_fieldname): Drop
2553         string field in favor of...
2554         (gcc::jit::recording::access_field_of_lvalue::m_field):
2555         ..."field" field, as it were.
2557         (gcc::jit::recording::access_field_of_rvalue::access_field_of_rvalue):
2558         Likewise.
2559         (gcc::jit::recording::access_field_of_rvalue::m_fieldname): Drop
2560         string field in favor of...
2561         (gcc::jit::recording::access_field_of_rvalue::m_field):
2562         ..."field" field.
2564         (gcc::jit::recording::dereference_field_rvalue::
2565         dereference_field_rvalue): Likewise.
2566         (gcc::jit::recording::dereference_field_rvalue::m_fieldname): Drop
2567         string field in favor of...
2568         (gcc::jit::recording::dereference_field_rvalue::m_field):
2569         ..."field" field.
2571         (gcc::jit::playback::context::new_field_access): Require a field
2572         rather than a fieldname string.
2573         (gcc::jit::playback::context::access_field): Likewise.
2574         (gcc::jit::playback::context::dereference_field): Likewise.
2575         (gcc::jit::playback::rvalue::access_field):
2577 2014-01-28  David Malcolm  <dmalcolm@redhat.com>
2579         * libgccjit.h (gcc_jit_context_new_child_context): New function.
2581         * libgccjit.map (gcc_jit_context_new_child_context): New function.
2583         * libgccjit.c (gcc_jit_context): Make the constructor explicit,
2584         with a parent context as a parameter.
2585         (gcc_jit_context_acquire): Create context with a NULL parent.
2586         (gcc_jit_context_new_child_context): New function, creating a
2587         context with the given parent.
2589         * internal-api.h (gcc::jit::recording::context::context): New
2590         explicit constructor, taking a parent context as a parameter.
2591         (gcc::jit::recording::context::m_parent_ctxt): New field.
2593         * internal-api.c (gcc::jit::recording::context::context): New
2594         explicit constructor, taking a parent context as a parameter.
2595         (gcc::jit::recording::context::replay_into): Replay parent contexts
2596         before replaying the context itself.
2598 2014-01-27  David Malcolm  <dmalcolm@redhat.com>
2600         * internal-api.c (gcc::jit::playback::context::compile): Removal
2601         of the code-creation callback (96b218c9a1d5f39fb649e02c0e77586b180e8516)
2602         accidentally removed the implementation of
2603         GCC_JIT_BOOL_OPTION_DUMP_GENERATED_CODE; reinstate it.
2605 2014-01-27  David Malcolm  <dmalcolm@redhat.com>
2607         * internal-api (gcc::jit::recording::context::new_call): Verify
2608         the argument count of the call against the parameter count of the
2609         function, issuing an error if there's a mismatch.
2611         * internal-api.h (gcc::jit::recording::function::get_name): New.
2612         * (gcc::jit::recording::function::get_params): New.
2613         * (gcc::jit::recording::function::is_variadic): New.
2615 2014-01-27  David Malcolm  <dmalcolm@redhat.com>
2617         * libgccjit.h (enum gcc_jit_binary_op): Remove
2618         GCC_JIT_BINARY_OP_FLOATING_DIVIDE, which I accidentally added
2619         as part of a880c0d9c642730550f39d328f29a1d9935cb07e.
2621 2014-01-24  David Malcolm  <dmalcolm@redhat.com>
2623         * libgccjit.h: Update comments to eliminate the code-creation
2624         callback.  All "contextual" objects change from merely being
2625         "alive" during the callback to having a lifetime equal to that
2626         of the context they are created within, with automatic cleanup
2627         when the context is released.
2628         (gcc_jit_code_callback): Delete.
2629         (gcc_jit_context_set_code_factory): Delete.
2631         * libgccjit.map (gcc_jit_context_set_code_factory): Delete.
2633         * dummy-frontend.c (my_walker): Update for rename of the singleton
2634         reference-owning context.
2635         (jit_langhook_parse_file): Rather than run a client-provided
2636         callback, we now replay a recording of the client activity.
2638         * internal-api.h (gcc::jit): Split the existing API into two
2639         copies...
2640         (gcc::jit::recording): ...a class hierarchy used to implement
2641         the client-facing API, which records the API calls made to it
2642         and...
2643         (gcc::jit::playback): ...a class hierarchy used within the
2644         dummy GCC frontend, which plays back the recorded API calls once
2645         GCC is initialized.
2647         * internal-api.c (gcc::jit::recording::playback_location): New
2648         API, in which client API calls are recorded as a list of "memento"
2649         objects, to be played back into GCC when the dummy frontend runs.
2650         (gcc::jit::recording::playback_string): Likewise.
2651         (gcc::jit::recording::playback_label): Likewise.
2652         (gcc::jit::recording::context::~context): Likewise.
2653         (gcc::jit::recording::context::replay_into): Likewise.
2654         (gcc::jit::recording::context::disassociate_from_playback): Likewise.
2655         (gcc::jit::recording::context::new_string): Likewise.
2656         (gcc::jit::recording::context::new_location): Likewise.
2657         (gcc::jit::recording::context::get_type): Likewise.
2658         (gcc::jit::recording::context::new_field): Likewise.
2659         (gcc::jit::recording::context::new_struct_type): Likewise.
2660         (gcc::jit::recording::context::new_param): Likewise.
2661         (gcc::jit::recording::context::new_function): Likewise.
2662         (gcc::jit::recording::context::new_global): Likewise.
2663         (gcc::jit::recording::context::new_rvalue_from_int): Likewise.
2664         (gcc::jit::recording::context::new_rvalue_from_double): Likewise.
2665         (gcc::jit::recording::context::new_rvalue_from_ptr): Likewise.
2666         (gcc::jit::recording::context::new_string_literal): Likewise.
2667         (gcc::jit::recording::context::new_unary_op): Likewise.
2668         (gcc::jit::recording::context::new_binary_op): Likewise.
2669         (gcc::jit::recording::context::new_comparison): Likewise.
2670         (gcc::jit::recording::context::new_call): Likewise.
2671         (gcc::jit::recording::context::new_array_lookup): Likewise.
2672         (gcc::jit::recording::string::string): Likewise.
2673         (gcc::jit::recording::string::~string): Likewise.
2674         (gcc::jit::recording::location::replay_into): Likewise.
2675         (gcc::jit::recording::type::get_pointer): Likewise.
2676         (gcc::jit::recording::type::get_const): Likewise.
2677         (gcc::jit::recording::memento_of_get_type::replay_into): Likewise.
2678         (gcc::jit::recording::memento_of_get_pointer::replay_into): Likewise.
2679         (gcc::jit::recording::memento_of_get_const::replay_into): Likewise.
2680         (gcc::jit::recording::field::replay_into): Likewise.
2681         (gcc::jit::recording::struct_::replay_into): Likewise.
2682         (gcc::jit::recording::rvalue::access_field): Likewise.
2683         (gcc::jit::recording::rvalue::dereference_field): Likewise.
2684         (gcc::jit::recording::rvalue::dereference): Likewise.
2685         (gcc::jit::recording::lvalue::access_field): Likewise.
2686         (gcc::jit::recording::lvalue::get_address): Likewise.
2687         (gcc::jit::recording::param::replay_into): Likewise.
2688         (gcc::jit::recording::function::function): Likewise.
2689         (gcc::jit::recording::function::replay_into): Likewise.
2690         (gcc::jit::recording::function::new_local): Likewise.
2691         (gcc::jit::recording::function::new_forward_label): Likewise.
2692         (gcc::jit::recording::function::add_eval): Likewise.
2693         (gcc::jit::recording::function::add_assignment): Likewise.
2694         (gcc::jit::recording::function::add_assignment_op): Likewise.
2695         (gcc::jit::recording::function::add_comment): Likewise.
2696         (gcc::jit::recording::function::add_conditional): Likewise.
2697         (gcc::jit::recording::function::add_label): Likewise.
2698         (gcc::jit::recording::function::place_forward_label): Likewise.
2699         (gcc::jit::recording::function::add_jump): Likewise.
2700         (gcc::jit::recording::function::add_return): Likewise.
2701         (gcc::jit::recording::function::new_loop): Likewise.
2702         (gcc::jit::recording::label::replay_into): Likewise.
2703         (gcc::jit::recording::global::replay_into): Likewise.
2704         (gcc::jit::recording::memento_of_new_rvalue_from_int::replay_into):
2705         Likewise.
2706         (gcc::jit::recording::memento_of_new_rvalue_from_double::replay_into):
2707         Likewise.
2708         (gcc::jit::recording::memento_of_new_rvalue_from_ptr::replay_into):
2709         Likewise.
2710         (gcc::jit::recording::memento_of_new_string_literal::replay_into):
2711         Likewise.
2712         (gcc::jit::recording::unary_op::replay_into): Likewise.
2713         (gcc::jit::recording::binary_op::replay_into): Likewise.
2714         (gcc::jit::recording::comparison::replay_into): Likewise.
2715         (gcc::jit::recording::call::call): Likewise.
2716         (gcc::jit::recording::call::replay_into): Likewise.
2717         (gcc::jit::recording::array_lookup::replay_into): Likewise.
2718         (gcc::jit::recording::access_field_of_lvalue::replay_into): Likewise.
2719         (gcc::jit::recording::access_field_rvalue::replay_into): Likewise.
2720         (gcc::jit::recording::dereference_field_rvalue::replay_into): Likewise.
2721         (gcc::jit::recording::dereference_rvalue::replay_into): Likewise.
2722         (gcc::jit::recording::get_address_of_lvalue::replay_into): Likewise.
2723         (gcc::jit::recording::local::replay_into): Likewise.
2724         (gcc::jit::recording::eval::replay_into): Likewise.
2725         (gcc::jit::recording::assignment::replay_into): Likewise.
2726         (gcc::jit::recording::assignment_op::replay_into): Likewise.
2727         (gcc::jit::recording::comment::replay_into): Likewise.
2728         (gcc::jit::recording::conditional::replay_into): Likewise.
2729         (gcc::jit::recording::place_label::replay_into): Likewise.
2730         (gcc::jit::recording::jump::replay_into): Likewise.
2731         (gcc::jit::recording::return_::replay_into): Likewise.
2732         (gcc::jit::recording::loop::replay_into): Likewise.
2733         (gcc::jit::recording::loop::end): Likewise.
2734         (gcc::jit::recording::loop_end::replay_into): Likewise.
2736         (gcc::jit::recording::context::set_str_option): Likewise.
2737         Option setting and error-handling is now "owned" by the recording
2738         context; the playback context delegates to the recording context
2739         for these aspects.
2740         (gcc::jit::recording::context::set_int_option): Likewise.
2741         (gcc::jit::recording::context::set_bool_option): Likewise.
2742         (gcc::jit::recording::context::compile): Likewise.
2743         (gcc::jit::recording::context::add_error): Likewise.
2744         (gcc::jit::recording::context::add_error_va): Likewise.
2745         (gcc::jit::recording::context::get_first_error): Likewise.
2747         (gcc::jit::context::context): Rename to...
2748         (gcc::jit::playback::context::context): ...this.
2749         (gcc::jit::context::~context): Rename to...
2750         (gcc::jit::playback::context::~context): ...this.
2751         (gcc::jit::context::gt_ggc_mx): Rename to...
2752         (gcc::jit::playback::context::gt_ggc_mx): ...this.
2754         (gcc::jit::context::set_code_factory): Eliminate.
2756         (gcc::jit::context::get_type): Rename to...
2757         (gcc::jit::playback::context::get_type): ...this.
2758         (gcc::jit::context::new_field): Rename to...
2759         (gcc::jit::playback::context::new_field): ...this.
2760         (gcc::jit::context::new_struct_type): Rename to...
2761         (gcc::jit::playback::context::new_struct_type): ...this, and
2762         update to require a vec<field *>.
2763         (gcc::jit::context::new_param): Rename to...
2764         (gcc::jit::playback::context::new_param): ...this.
2765         (gcc::jit::context::new_function): Rename to...
2766         (gcc::jit::playback::context::new_function): ...this, and update
2767         to require a vec<param *>.
2768         (gcc::jit::context::new_global): Rename to...
2769         (gcc::jit::playback::context::new_global): ...this.
2770         (gcc::jit::context::new_rvalue_from_int): Rename to...
2771         (gcc::jit::playback::context::new_rvalue_from_int): ...this.
2772         (gcc::jit::context::new_rvalue_from_double): Rename to...
2773         (gcc::jit::playback::context::new_rvalue_from_double): ...this.
2774         (gcc::jit::context::new_rvalue_from_ptr): Rename to...
2775         (gcc::jit::playback::context::new_rvalue_from_ptr): ...this.
2776         (gcc::jit::context::new_string_literal): Rename to...
2777         (gcc::jit::playback::context::new_string_literal): ...this.
2778         (gcc::jit::context::as_truth_value): Rename to...
2779         (gcc::jit::playback::context::as_truth_value): ...this.
2780         (gcc::jit::context::new_unary_op): Rename to...
2781         (gcc::jit::playback::context::new_unary_op): ...this.
2782         (gcc::jit::context::new_binary_op): Rename to...
2783         (gcc::jit::playback::context::new_binary_op): ...this.
2784         (gcc::jit::context::new_comparison): Rename to...
2785         (gcc::jit::playback::context::new_comparison): ...this.
2786         (gcc::jit::context::new_call): Rename to...
2787         (gcc::jit::playback::context::new_call): ...this, and update
2788         to require a vec<rvalue *>.
2789         (gcc::jit::context::new_array_lookup): Rename to...
2790         (gcc::jit::playback::context::new_array_lookup): ...this.
2791         (gcc::jit::context::new_field_access): Rename to...
2792         (gcc::jit::playback::context::new_field_access): ...this.
2793         (gcc::jit::context::new_dereference): Rename to...
2794         (gcc::jit::playback::context::new_dereference): ...this.
2796         (gcc::jit::lvalue::access_field): Rename to...
2797         (gcc::jit::playback::lvalue::access_field): ...this.
2798         (gcc::jit::lvalue::get_address): Rename to...
2799         (gcc::jit::playback::lvalue::get_address): ...this.
2801         (gcc::jit::rvalue::dereference_field): Rename to...
2802         (gcc::jit::playback::rvalue::dereference_field): ...this.
2804         (gcc::jit::rvalue::dereference): Rename to...
2805         (gcc::jit::playback::rvalue::dereference): ...this.
2807         (gcc::jit::wrapper::operator new): Rename to...
2808         (gcc::jit::playback::wrapper::operator new): ...this.
2810         (gcc::jit::function::function): Rename to...
2811         (gcc::jit::playback::function::function): ...this.
2812         (gcc::jit::function::gt_ggc_mx): Rename to...
2813         (gcc::jit::playback::function::gt_ggc_mx): ...this.
2814         (gcc::jit::function::get_return_type_as_tree): Rename to...
2815         (gcc::jit::playback::function::get_return_type_as_tree): ...this.
2816         (gcc::jit::function::new_local): Rename to...
2817         (gcc::jit::playback::function::new_local): ...this.
2818         (gcc::jit::function::new_forward_label): Rename to...
2819         (gcc::jit::playback::function::new_forward_label): ...this.
2820         (gcc::jit::function::postprocess): Rename to...
2821         (gcc::jit::playback::function::postprocess): ...this.
2822         (gcc::jit::function::add_eval): Rename to...
2823         (gcc::jit::playback::function::add_eval): ...this.
2824         (gcc::jit::function::add_assignment): Rename to...
2825         (gcc::jit::playback::function::add_assignment): ...this.
2826         (gcc::jit::function::add_comment): Rename to...
2827         (gcc::jit::playback::function::add_comment): ...this.
2828         (gcc::jit::function::add_conditional): Rename to...
2829         (gcc::jit::playback::function::add_conditional): ...this.
2830         (gcc::jit::function::add_label): Rename to...
2831         (gcc::jit::playback::function::add_label): ...this.
2832         (gcc::jit::function::place_forward_label): Rename to...
2833         (gcc::jit::playback::function::place_forward_label): ...this.
2834         (gcc::jit::function::add_jump): Rename to...
2835         (gcc::jit::playback::function::add_jump): ...this.
2836         (gcc::jit::function::add_return): Rename to...
2837         (gcc::jit::playback::function::add_return): ...this.
2838         (gcc::jit::function::new_loop): Rename to...
2839         (gcc::jit::playback::function::new_loop): ...this.
2841         (gcc::jit::label::label): Rename to...
2842         (gcc::jit::playback::label::label): ...this.
2844         (gcc::jit::loop::loop): Rename to...
2845         (gc::jit::playback::loop::loop): ...this.
2846         (gcc::jit::loop::end): Rename to...
2847         (gcc::jit::playback::loop): ...this.
2849         (gcc::jit::active_jit_ctxt): Eliminate in favor of...
2850         (gcc::jit::active_playback_ctxt): ...this.
2852         (gcc::jit::context::compile): Rename to...
2853         (gcc::jit::playback::context::compile): ...this, and eliminate the
2854         mutex handling; this is done for us by the caller.
2856         (gcc::jit::context::invoke_code_factory): Rename to...
2857         (gcc::jit::playback::context::replay): this.  Rather than call
2858         a client-provided callback, instead replay the recorded API
2859         calls.
2861         (gcc::jit::context::dump_generated_code): Rename to...
2862         (gcc::jit::playback::context::dump_generated_code): ...this.
2864         (location_comparator): Update for renamed types.
2866         (gcc::jit::context::handle_locations): Rename to...
2867         (gcc::jit::playback::context::handle_locations): ...this.
2869         (gcc::jit::context::add_error): Rename to...
2870         (gcc::jit::playback::context::add_error): this, and delegate to
2871         the recording context's add_error_va.
2873         (gcc::jit::context::add_error_va): Rename to...
2874         (gcc::jit::playback::context::add_error_va): this, and delegate
2875         to the recording context.
2877         (gcc::jit::context::new_location): Rename to...
2878         (gcc::jit::playback::context::new_location): ...this.
2879         (gcc::jit::context::set_tree_location): Rename to...
2880         (gcc::jit::playback::context::set_tree_location): ...this.
2881         (gcc::jit::context::get_source_file): Rename to...
2882         (gcc::jit::playback::context::get_source_file): ...this.
2883         (gcc::jit::source_file::source_file): Rename to...
2884         (gcc::jit::playback::source_file::source_file): ...this.
2885         (gcc::jit::source_file::get_source_line): Rename to...
2886         (gcc::jit::playback::source_file::get_source_line): ...this.
2887         (gcc::jit::source_line::source_line): Rename to...
2888         (gcc::jit::playback::source_line::source_line): ...this.
2889         (gcc::jit::source_line::get_location): Rename to...
2890         (gcc::jit::playback::source_line::get_location): ...this.
2892         (gcc::jit::location::location): Rename to...
2893         (gcc::jit::playback::location::location): ...this.
2895         * libgccjit.c: Update classes to derive from the "jit::recording"
2896         class hierarchy.
2897         (RETURN_IF_NOT_INITIAL_CTXT): Eliminate, as it relates to
2898         code-creation callbacks.
2899         (RETURN_NULL_IF_NOT_INITIAL_CTXT): Likewise.
2900         (RETURN_NULL_IF_NOT_CALLBACK_CTXT): Likewise.
2901         (jit_error): There isn't an "active jit context" anymore, except
2902         during actual compilation, so simplify the logic here.
2903         (gcc_jit_context_set_code_factory): Delete.
2905         (gcc_jit_context_new_location): Update preconditions now that we
2906         don't have code-creation callbacks.
2907         (gcc_jit_context_get_type): Likewise.
2908         (gcc_jit_type_get_pointer): Likewise.
2909         (gcc_jit_type_get_const): Likewise.
2910         (gcc_jit_context_new_field): Likewise.
2911         (gcc_jit_context_new_struct_type): Likewise.
2912         (gcc_jit_context_new_param): Likewise.
2913         (gcc_jit_param_as_lvalue): Likewise.
2914         (gcc_jit_param_as_rvalue): Likewise.
2915         (gcc_jit_context_new_function): Likewise.
2916         (gcc_jit_context_new_function): Likewise.
2917         (gcc_jit_function_new_forward_label): Likewise.
2918         (gcc_jit_context_new_global): Likewise.
2919         (gcc_jit_lvalue_as_rvalue): Likewise.
2920         (gcc_jit_context_new_rvalue_from_int): Likewise.
2921         (gcc_jit_context_zero): Likewise.
2922         (gcc_jit_context_one): Likewise.
2923         (gcc_jit_context_new_rvalue_from_double): Likewise.
2924         (gcc_jit_context_new_rvalue_from_ptr): Likewise.
2925         (gcc_jit_context_new_string_literal): Likewise.
2926         (gcc_jit_context_new_unary_op): Likewise.
2927         (gcc_jit_context_new_binary_op): Likewise.
2928         (gcc_jit_context_new_comparison): Likewise.
2929         (gcc_jit_context_new_call): Likewise.
2930         (gcc_jit_context_new_call): Likewise.
2931         (gcc_jit_context_new_array_lookup): Likewise.
2932         (gcc_jit_context_set_str_option): Likewise.
2933         (gcc_jit_context_set_int_option): Likewise.
2934         (gcc_jit_context_set_bool_option): Likewise.
2935         (gcc_jit_context_compile): Likewise.
2936         (gcc_jit_function_add_assignment_op): Likewise.  Also,
2937         reimplement as a separate kind of recording, since we can't know
2938         the type of the lvalue at recording-time.
2940         * notes.txt: Update diagram to reflect the new implementation.
2942 2014-01-24  David Malcolm  <dmalcolm@redhat.com>
2944         * libgccjit.h (enum gcc_jit_binary_op): We will use the result
2945         type to determine if GCC_JIT_BINARY_OP_DIVIDE should
2946         truncate towards zero, or be floating-point division.
2948         * internal-api.c (gcc::jit::context::new_binary_op): Likewise.
2950 2014-01-24  David Malcolm  <dmalcolm@redhat.com>
2952         * internal-api.h (gcc::jit::context::get_str_option): New access
2953         method.
2954         (gcc::jit::context::get_int_option): Likewise.
2956         * internal-api.c (gcc::jit::context::~context): Use access methods
2957         for options, rather than direct field access.
2958         (gcc::jit::context::compile): Likewise.
2960 2014-01-23  David Malcolm  <dmalcolm@redhat.com>
2962         * libgccjit.h (enum gcc_jit_bool_option): New value:
2963         GCC_JIT_BOOL_OPTION_DUMP_GENERATED_CODE.
2965         * internal-api.c (gcc::jit::context::compile): Call
2966         dump_generated_code if the user has requested it.
2967         (gcc::jit::context::dump_generated_code): New, copying
2968         from the .s file to stderr.
2970         * internal-api.h (gcc::jit::context::dump_generated_code): New.
2972 2014-01-23  David Malcolm  <dmalcolm@redhat.com>
2974         * internal-api.h (gcc::jit::function): Add field
2975         "m_inner_bind_expr".
2976         * internal-api.c (gcc::jit::function::function): Create a BIND_EXPR
2977         for all non-imported functions, and put the statement list within
2978         it.
2979         (gcc::jit::function::gt_ggc_mx): Visit m_inner_bind_expr.
2980         (gcc::jit::function::new_local): Set the DECL_CONTEXT of the new
2981         local to be the function's BIND_EXPR, and prepend the new local
2982         to said BIND_EXPR's BIND_EXPR_VARS chain.
2983         (gcc::jit::function::postprocess): Set the DECL_SAVED_TREE of the
2984         FUNCTION_DECL to be the BIND_EXPR, rather than the statement list.
2985         The latter is now contained within the former.
2987 2014-01-23  David Malcolm  <dmalcolm@redhat.com>
2989         * internal-api.h (gcc::jit::function::add_stmt): New.
2991         * internal-api.c (gcc::jit::function::add_eval): Replace use of
2992         tsi_link_stmt with call to add_stmt.
2993         (gcc::jit::function::add_assignment): Likewise.
2994         (gcc::jit::function::add_conditional): Likewise.
2995         (gcc::jit::function::place_forward_label): Likewise.
2996         (gcc::jit::function::add_jump): Likewise.
2997         (gcc::jit::function::add_return): Likewise.
2999 2014-01-21  David Malcolm  <dmalcolm@redhat.com>
3001         * internal-api.c (gcc::jit::function::add_comment): New.
3002         * internal-api.h (gcc::jit::function::add_comment): New.
3003         * libgccjit.c (gcc_jit_function_add_comment): New.
3004         * libgccjit.h (gcc_jit_function_add_comment): New.
3005         * libgccjit.map: Add gcc_jit_function_add_comment.
3007 2013-10-24  David Malcolm  <dmalcolm@redhat.com>
3009         * internal-api.c (gcc::jit::function::add_eval): Handle non-NULL
3010         locations.
3011         (gcc::jit::context::handle_locations): Fix test for the various
3012         kinds of declarations, replacing use of DECL_MINIMAL_CHECK,
3013         which aborts on failure (such as if we saw a type).
3014         * libgccjit.h (GCC_JIT_BOOL_OPTION_DEBUGINFO): Fix out-of-date
3015         comment.
3017 2013-10-23  David Malcolm  <dmalcolm@redhat.com>
3019         * internal-api.c: Update for rename of tree-flow.h to tree-cfg.h
3020         in r203320, for declaration of dump_function_to_file.
3021         * TODO.rst ("segfault seen in libbacktrace"): Remove - this was
3022         fixed by Ian in r203810.
3024 2013-10-23  David Malcolm  <dmalcolm@redhat.com>
3026         * internal-api.c: Add missing include of diagnostic-core.h
3028 2013-10-22  David Malcolm  <dmalcolm@redhat.com>
3030         * internal-api.c (gcc::jit::context::add_error_va): Record the
3031         first error that occurs on a context.
3032         (gcc::jit::context::get_first_error): New.
3033         * internal-api.h (gcc::jit::context::get_first_error): New.
3034         (gcc::jit::context::m_first_error_str): New.
3035         * libgccjit.c (gcc_jit_context_get_first_error): New.
3036         * libgccjit.h (gcc_jit_context_get_first_error): New.
3037         * libgccjit.map (gcc_jit_context_get_first_error): New.
3039 2013-10-21  David Malcolm  <dmalcolm@redhat.com>
3041         * internal-api.c (gcc::jit::context::compile): Correctly cleanup
3042         timevars in error-handling, preventing an issue where an error
3043         on a context left timevar.c in an unstopped state, leading to an
3044         assertion failure when restarting timevars in the next compile.
3045         Found via fuzz-testing.
3047 2013-10-21  David Malcolm  <dmalcolm@redhat.com>
3049         * internal-api.c (gcc::jit::context::postprocess): Show source
3050         line numbers (if any) in gimple dump.
3052 2013-10-21  David Malcolm  <dmalcolm@redhat.com>
3054         * libgccjit.c (gcc_jit_function_new_local): Use a more clear
3055         error message for the case where someone tries to add a local
3056         to a function imported from elsewhere.
3058 2013-10-21  David Malcolm  <dmalcolm@redhat.com>
3060         * TODO.rst ("the C unary prefix "&" operator"): Remove completed item.
3061         * internal-api.c (gcc::jit::lvalue::get_address): New.
3062         * internal-api.h (gcc::jit::lvalue::get_address): New.
3063         * libgccjit.c (gcc_jit_lvalue_get_address): New.
3064         * libgccjit.h (gcc_jit_lvalue_get_address): New.
3065         * libgccjit.map (gcc_jit_lvalue_get_address): New.
3067 2013-10-18  David Malcolm  <dmalcolm@redhat.com>
3069         * internal-api.c (gcc::jit::context::new_param): Add context
3070         argument to ctor for rvalue and its subclasses.
3071         (gcc::jit::context::new_global): Likewise.
3072         (gcc::jit::context::new_rvalue_from_int): Likewise.
3073         (gcc::jit::context::new_rvalue_from_double): Likewise.
3074         (gcc::jit::context::new_rvalue_from_ptr): Likewise.
3075         (gcc::jit::context::new_string_literal): Likewise.
3076         (gcc::jit::context::new_call): Likewise.
3077         (gcc::jit::context::new_array_lookup): Likewise.
3078         (gcc::jit::function::new_local): Likewise.
3079         (gcc::jit::context::new_binary_op): Likewise; add new
3080         operations.
3081         (gcc::jit::context::new_comparison): Likewise; add new
3082         comparisons.
3083         (gcc::jit::context::as_truth_value): New.
3084         (gcc::jit::context::new_unary_op): New.
3085         (gcc::jit::context::new_field_access): Convert to a helper
3086         method for use by the access_fields methods.
3087         (gcc::jit::context::new_dereference): New.
3088         (gcc::jit::lvalue::access_field): New.
3089         (gcc::jit::rvalue::access_field): New.
3090         (gcc::jit::rvalue::dereference_field): New.
3091         (gcc::jit::rvalue::dereference): New.
3092         * internal-api.h (gcc::jit::context::new_unary_op): New.
3093         (gcc::jit::context::new_field_access): Work
3094         (gcc::jit::context::new_dereference): New.
3095         (gcc::jit::context::as_truth_value): New.
3096         (gcc::jit::rvalue): Add a context field.
3097         (gcc::jit::rvalue::access_field): New.
3098         (gcc::jit::rvalue::dereference_field): New.
3099         (gcc::jit::rvalue::dereference): New.
3100         (gcc::jit::lvalue::lvalue): Add context to ctor.
3101         (gcc::jit::lvalue::access_field): New.
3102         (gcc::jit::param::param): Add context to ctor.
3103         * libgccjit.c (gcc_jit_context_new_unary_op): New.
3104         (gcc_jit_context_new_field_access): Remove.
3105         (gcc_jit_lvalue_access_field): New.
3106         (gcc_jit_rvalue_access_field): New.
3107         (gcc_jit_rvalue_dereference_field): New.
3108         (gcc_jit_rvalue_dereference): New.
3109         *libgccjit.h (enum gcc_jit_unary_op): New.
3110         (gcc_jit_context_new_unary_op): New.
3111         (enum gcc_jit_binary_op): Document values, and add...
3112         (GCC_JIT_BINARY_OP_DIVIDE): New.
3113         (GCC_JIT_BINARY_OP_MODULO): New.
3114         (GCC_JIT_BINARY_OP_BITWISE_AND): New.
3115         (GCC_JIT_BINARY_OP_BITWISE_XOR): New.
3116         (GCC_JIT_BINARY_OP_BITWISE_OR): New.
3117         (GCC_JIT_BINARY_OP_LOGICAL_AND): New.
3118         (GCC_JIT_BINARY_OP_LOGICAL_OR): New.
3119         (enum gcc_jit_comparison): Document values, and add...
3120         (GCC_JIT_COMPARISON_EQ): New.
3121         (GCC_JIT_COMPARISON_NE): New.
3122         (GCC_JIT_COMPARISON_LE): New.
3123         (GCC_JIT_COMPARISON_GT): New.
3124         (GCC_JIT_COMPARISON_GE): New.
3125         (gcc_jit_context_new_field_access): Remove.
3126         (gcc_jit_lvalue_access_field): New.
3127         (gcc_jit_rvalue_access_field): New.
3128         (gcc_jit_rvalue_dereference_field): New.
3129         (gcc_jit_rvalue_dereference): New.
3130         * libgccjit.map (gcc_jit_context_new_field_access): Remove.
3131         (gcc_jit_lvalue_access_field): New.
3132         (gcc_jit_rvalue_access_field): New.
3133         (gcc_jit_rvalue_dereference_field): New.
3134         (gcc_jit_rvalue_dereference): New.
3135         * TODO.rst: Update
3137 2013-10-18  David Malcolm  <dmalcolm@redhat.com>
3139         * internal-api.c (gcc::jit::context::get_type): Improve error
3140         message, and report the bogus value.
3141         (gcc::jit::context::new_binary_op): Likewise.
3142         (gcc::jit::context::new_comparison): Likewise.
3143         (gcc::jit::context::set_str_option): Likewise.
3144         (gcc::jit::context::set_int_option): Likewise.
3145         (gcc::jit::context::set_bool_option): Likewise.
3146         (gcc::jit::context::compile): Likewise, and make the errors
3147         block the creation of result, rather than just the return
3148         value of the client callback.
3149         (gcc::jit::context::add_error): Add varargs and provide
3150         implementation, calling into...
3151         (gcc::jit::context::add_error_va): New.
3152         * internal-api.h (GNU_PRINTF): New.
3153         (gcc::jit::context::add_error): Add varargs and GNU_PRINTF
3154         attribute macro.
3155         (gcc::jit::context::add_error_va): New.
3156         (gcc::jit::context::errors_occurred): New.
3157         (gcc::jit::context::m_error_count): New.
3158         (gcc::jit::function::get_kind): New.
3159         * libgccjit.c (JIT_BEGIN_STMT): New.
3160         (JIT_END_STMT): New.
3161         (RETURN_VAL_IF_FAIL): New.
3162         (RETURN_NULL_IF_FAIL): New.
3163         (RETURN_IF_FAIL): New.
3164         (RETURN_IF_NOT_INITIAL_CTXT): New.
3165         (RETURN_NULL_IF_NOT_INITIAL_CTXT): New.
3166         (RETURN_NULL_IF_NOT_CALLBACK_CTXT): New.
3167         (RETURN_IF_NOT_FUNC_DEFINITION): New.
3168         (RETURN_NULL_IF_NOT_FUNC_DEFINITION): New.
3169         (jit_error): New.
3170         (gcc_jit_context_set_code_factory): Use new error-checking
3171         macros.
3172         (ASSERT_WITHIN_CALLBACK): Remove.
3173         (ASSERT_NOT_WITHIN_CALLBACK): Remove.
3174         (gcc_jit_context_new_location): Use new error-checking macros.
3175         (gcc_jit_context_get_type): Likewise.
3176         (gcc_jit_type_get_pointer): Likewise.
3177         (gcc_jit_type_get_const): Likewise.
3178         (gcc_jit_context_new_field): Likewise.
3179         (gcc_jit_context_new_struct_type): Likewise.
3180         (gcc_jit_context_new_param): Likewise.
3181         (gcc_jit_param_as_lvalue): Likewise.
3182         (gcc_jit_param_as_rvalue): Likewise.
3183         (gcc_jit_context_new_function): Likewise.
3184         (gcc_jit_function_new_forward_label): Likewise.
3185         (gcc_jit_context_new_global): Likewise.
3186         (gcc_jit_lvalue_as_rvalue): Likewise.
3187         (gcc_jit_context_new_rvalue_from_int): Likewise.
3188         (gcc_jit_context_zero): Likewise.
3189         (gcc_jit_context_one): Likewise.
3190         (gcc_jit_context_new_rvalue_from_double): Likewise.
3191         (gcc_jit_context_new_rvalue_from_ptr): Likewise.
3192         (gcc_jit_context_new_string_literal): Likewise.
3193         (gcc_jit_context_new_binary_op): Likewise.
3194         (gcc_jit_context_new_comparison): Likewise.
3195         (gcc_jit_context_new_call): Likewise.
3196         (gcc_jit_context_new_array_lookup): Likewise.
3197         (gcc_jit_context_new_field_access): Likewise.
3198         (gcc_jit_function_new_local): Likewise.
3199         (gcc_jit_function_add_label): Likewise.
3200         (gcc_jit_function_place_forward_label): Likewise.
3201         (gcc_jit_function_add_eval): Likewise.
3202         (gcc_jit_function_add_assignment): Likewise.
3203         (gcc_jit_function_add_assignment_op): Likewise.
3204         (gcc_jit_function_add_conditional): Likewise.
3205         (gcc_jit_function_add_jump): Likewise.
3206         (gcc_jit_function_add_return): Likewise.
3207         (gcc_jit_function_new_loop): Likewise.
3208         (gcc_jit_loop_end): Likewise.
3209         (gcc_jit_context_set_str_option): Likewise.
3210         (gcc_jit_context_set_int_option): Likewise.
3211         (gcc_jit_context_set_bool_option): Likewise.
3212         (gcc_jit_context_compile): Likewise.
3213         (gcc_jit_result_get_code): Likewise.
3214         (gcc_jit_result_release): Likewise.
3215         * libgccjit.h (gcc_jit_function_new_forward_label): Clarify
3216         behavior.
3217         (gcc_jit_function_add_label): Likewise.
3219 2013-10-17  David Malcolm  <dmalcolm@redhat.com>
3221         * internal-api.c (gcc::jit::context::get_void_type): Remove.
3222         (gcc::jit::context::get_char_type): Remove.
3223         (gcc::jit::context::get_int_type): Remove.
3224         (gcc::jit::context::get_float_type): Remove.
3225         (gcc::jit::context::get_double_type): Remove.
3226         (get_tree_node_for_type): New.
3227         (gcc::jit::context::get_type): New.
3228         (gcc::jit::context::new_rvalue_from_double): New.
3229         (gcc::jit::context::new_rvalue_from_ptr): New.
3230         * internal-api.h (gcc::jit::context::get_void_type): Remove.
3231         (gcc::jit::context::get_char_type): Remove.
3232         (gcc::jit::context::get_int_type): Remove.
3233         (gcc::jit::context::get_float_type): Remove.
3234         (gcc::jit::context::get_double_type): Remove.
3235         (gcc::jit::context::get_type): New.
3236         (gcc::jit::context::new_rvalue_from_double): New.
3237         (gcc::jit::context::new_rvalue_from_ptr): New.
3238         * libgccjit.c (gcc_jit_context_get_void_type): Remove.
3239         (gcc_jit_context_get_char_type): Remove.
3240         (gcc_jit_context_get_int_type): Remove.
3241         (gcc_jit_context_get_float_type): Remove.
3242         (gcc_jit_context_get_double_type): Remove.
3243         (gcc_jit_context_get_type): New.
3244         (gcc_jit_context_new_rvalue_from_double): New.
3245         (gcc_jit_context_new_rvalue_from_ptr): New.
3246         * libgccjit.h (gcc_jit_context_get_void_type): Remove.
3247         (gcc_jit_context_get_char_type): Remove.
3248         (gcc_jit_context_get_int_type): Remove.
3249         (gcc_jit_context_get_float_type): Remove.
3250         (gcc_jit_context_get_double_type): Remove.
3251         (enum gcc_jit_types): New.
3252         (gcc_jit_context_get_type): New.
3253         (gcc_jit_context_new_rvalue_from_double): New.
3254         (gcc_jit_context_new_rvalue_from_ptr): New.
3255         * libgccjit.map (gcc_jit_context_get_void_type): Remove.
3256         (gcc_jit_context_get_char_type): Remove.
3257         (gcc_jit_context_get_int_type): Remove.
3258         (gcc_jit_context_get_float_type): Remove.
3259         (gcc_jit_context_get_double_type): Remove.
3260         (enum gcc_jit_types): New.
3261         (gcc_jit_context_get_type): New.
3262         (gcc_jit_context_new_rvalue_from_double): New.
3263         (gcc_jit_context_new_rvalue_from_ptr): New.
3264         * TODO.rst ("access to more primitive types"): Remove
3265         completed item.
3267 2013-10-17  David Malcolm  <dmalcolm@redhat.com>
3269         * libgccjit.h: Add and reword comments throughout.
3271 2013-10-17  David Malcolm  <dmalcolm@redhat.com>
3273         * TODO.rst: Update.
3275 2013-10-16  David Malcolm  <dmalcolm@redhat.com>
3277         * TODO.rst (gcc_jit_context_new_local): Remove completed item.
3278         * internal-api.c (gcc::jit::context::new_local): Replace with...
3279         (gcc::jit::function::new_local): ...this, and change return type
3280         from (local*) to (lvalue*).
3281         * internal-api.h (gcc::jit::local): Eliminate.
3282         (gcc::jit::context::new_local): Replace with...
3283         (gcc::jit::function::new_local): ...this, and change return type
3284         from (local*) to (lvalue*).
3285         * libgccjit.c (gcc_jit_local): Eliminate.
3286         (gcc_jit_context_new_local): Replace with...
3287         (gcc_jit_function_new_local): ...this, and change return type
3288         from (gcc_jit_local*) to (gcc_jit_lvalue*).
3289         (gcc_jit_local_as_lvalue): Remove.
3290         (gcc_jit_local_as_rvalue): Remove.
3291         * libgccjit.h (gcc_jit_local): Remove.
3292         (gcc_jit_context_new_local): Replace with...
3293         (gcc_jit_function_new_local): ...this, and change return type
3294         from (gcc_jit_local*) to (gcc_jit_lvalue*).
3295         (gcc_jit_local_as_lvalue): Remove.
3296         (gcc_jit_local_as_rvalue): Remove.
3297         * libgccjit.map (gcc_jit_context_new_local): Replace with...
3298         (gcc_jit_function_new_local): ...this.
3299         (gcc_jit_local_as_lvalue): Remove.
3300         (gcc_jit_local_as_rvalue): Remove.
3302 2013-10-15  David Malcolm  <dmalcolm@redhat.com>
3304         * libgccjit.h (gcc_jit_location): Rewrite comment to reflect
3305         that this part of the API is now implemented.
3306         ("Functions for use within the code factory."): Add notes on
3307         memory-management and lifetimes.
3308         * notes.txt: Update diagram to show handle_locations.
3310 2013-10-15  David Malcolm  <dmalcolm@redhat.com>
3312         * TODO.rst: Update.
3314 2013-10-14  David Malcolm  <dmalcolm@redhat.com>
3316         * libgccjit.map: Alphabetize the exported symbols.
3318 2013-10-14  David Malcolm  <dmalcolm@redhat.com>
3320         * internal-api.c (gcc::jit::context::new_field): Implement
3321         location support, by calling set_tree_location.
3322         (gcc::jit::context::new_struct_type): Likewise.
3323         (gcc::jit::context::new_param): Likewise.
3324         (gcc::jit::context::new_function): Likewise.
3325         (gcc::jit::context::new_global): Likewise.
3326         (gcc::jit::context::new_local): Likewise.
3327         (gcc::jit::context::new_binary_op): Likewise.
3328         (gcc::jit::context::new_comparison): Likewise.
3329         (gcc::jit::context::new_call): Likewise.
3330         (gcc::jit::context::new_array_lookup): Likewise.
3331         (gcc::jit::context::new_field_access): Likewise.
3332         (gcc::jit::context::add_assignment): Likewise.
3333         (gcc::jit::context::add_conditional): Likewise.
3334         (gcc::jit::function::add_label): Likewise.
3335         (gcc::jit::function::add_jump): Likewise.
3336         (gcc::jit::function::add_return): Likewise.
3337         (gcc::jit::function::place_forward_label): Likewise, adding
3338         location parameter.
3339         (gcc::jit::loop::loop): Add loc arg to place_forward_label.
3340         (gcc::jit::loop::end): Likewise.
3341         (gcc::jit::context::invoke_code_factory): Call handle_locations
3342         after the client callback is done, before any GC can run.
3343         (line_comparator): New.
3344         (location_comparator): New.
3345         (gcc::jit::context::handle_locations): New.
3346         (gcc::jit::context::new_location): New.
3347         (gcc::jit::context::set_tree_location): New.
3348         (gcc::jit::context::get_source_file): New.
3349         (gcc::jit::source_file::source_file): New.
3350         (gcc::jit::source_file::get_source_line): New.
3351         (gcc::jit::source_line::source_line): New.
3352         (gcc::jit::source_line::get_location): New.
3353         (gcc::jit::location::location): New.
3354         * internal-api.h (gcc::jit::context::new_location): New.
3355         (gcc::jit::context::set_tree_location): New.
3356         (gcc::jit::context::handle_locations): New.
3357         (gcc::jit::context::get_source_file): New.
3358         (gcc::jit::context::m_source_files): New field.
3359         (gcc::jit::context::m_cached_locations: New field.
3360         (gcc::jit::function::place_forward_label): Add location
3361         parameter.
3362         (gcc::jit::function::set_tree_location): New.
3363         (gcc::jit::source_file): New class.
3364         (gcc::jit::source_line): New class.
3365         (gcc::jit::location): New class.
3366         * libgccjit.c (gcc_jit_context_new_location): New.
3367         (gcc_jit_function_place_forward_label): Add location parameter,
3368         changing public API.
3369         * libgccjit.h (gcc_jit_context_new_location): New.
3370         (gcc_jit_function_place_forward_label): Add location parameter,
3371         changing public API.
3372         * libgccjit.map (gcc_jit_context_new_location): New.
3373         (main): Remove obsolete export.
3374         (called_function): Likewise.
3376 2013-10-11  David Malcolm  <dmalcolm@redhat.com>
3378         * internal-api.c: Update includes to reflect move of decl of
3379         dump_function_to_file from tree-dump.h to tree-flow.h in
3380         r203320.
3382 2013-10-10  David Malcolm  <dmalcolm@redhat.com>
3384         * libgccjit.h (GCC_JIT_BOOL_OPTION_DUMP_SUMMARY): New.
3385         * internal-api.c ((gcc::jit::context::compile): Implement
3386         GCC_JIT_BOOL_OPTION_DUMP_SUMMARY.
3388 2013-10-10  David Malcolm  <dmalcolm@redhat.com>
3390         * libgccjit.h (GCC_JIT_BOOL_OPTION_SELFCHECK_GC): Improve
3391         documentation.
3392         (GCC_JIT_BOOL_OPTION_DUMP_INITIAL_GIMPLE): Likewise.
3394 2013-10-10  David Malcolm  <dmalcolm@redhat.com>
3396         * libgccjit.h: Clarify the separation of the API into "outside
3397         the callback" and "within the callback" entrypoints, moving the
3398         latter to the bottom of the header.
3400 2013-10-10  David Malcolm  <dmalcolm@redhat.com>
3402         * libgccjit.h: Add comments throughout.
3404 2013-10-09  David Malcolm  <dmalcolm@redhat.com>
3406         * internal-api.c (gcc::jit::context::~context): Fix indentation;
3407         clean up memory allocations when using
3408         GCC_JIT_BOOL_OPTION_KEEP_INTERMEDIATES.
3410 2013-10-09  David Malcolm  <dmalcolm@redhat.com>
3412         * libgccjit.h (enum gcc_jit_bool_option): Add
3413         GCC_JIT_BOOL_OPTION_DUMP_EVERYTHING.
3414         * internal-api.c (gcc::jit::context::compile): Implement
3415         GCC_JIT_BOOL_OPTION_DUMP_EVERYTHING.
3417 2013-10-09  David Malcolm  <dmalcolm@redhat.com>
3419         * libgccjit.h (enum gcc_jit_bool_option): Add
3420         GCC_JIT_BOOL_OPTION_KEEP_INTERMEDIATES.
3421         * internal-api.c (gcc::jit::context::~context): Implement
3422         GCC_JIT_BOOL_OPTION_KEEP_INTERMEDIATES.
3424 2013-10-08  David Malcolm  <dmalcolm@redhat.com>
3426         * internal-api.c (gcc::jit::context::compile): Use mkdtemp to
3427         create a temporary directory and create the .s and .so files
3428         there, rather than writing to "fake.s" and then reading it to
3429         make "fake.so", then using it, fixing various possible race
3430         attacks by processes that can write to the process' current
3431         working directory.
3432         (gcc::jit::context::~context): Clean up tempfiles and path
3433         buffers.
3434         * internal-api.h (gcc::jit::context): Add fields
3435         m_path_template, m_path_tempdir, m_path_c_file, m_path_s_file,
3436         m_path_so_file.
3438 2013-10-08  David Malcolm  <dmalcolm@redhat.com>
3440         * internal-api.c (gcc::jit::context::new_function): Fix leak of
3441         arg_types.
3443 2013-10-08  David Malcolm  <dmalcolm@redhat.com>
3445         * internal-api.c (gcc::jit::context::~context): New.
3446         * internal-api.h (gcc::jit::context::~context): New.
3448 2013-10-07  David Malcolm  <dmalcolm@redhat.com>
3450         * internal-api.c (gcc::jit::context::compile): Implement
3451         GCC_JIT_BOOL_OPTION_SELFCHECK_GC.
3453         * libgccjit.h (enum gcc_jit_bool_option): Add
3454         GCC_JIT_BOOL_OPTION_SELFCHECK_GC.
3456 2013-10-07  David Malcolm  <dmalcolm@redhat.com>
3458         * Make-lang.in: Rename JIT_OBJS to jit_OBJS.  Delete manual
3459         dependencies.
3461 2013-10-04  David Malcolm  <dmalcolm@redhat.com>
3463         * internal-api.c (gcc::jit::context::new_global): New.
3464         * internal-api.h (gcc::jit::context::new_global): New.
3465         * libgccjit.c (gcc_jit_context_new_global) New.
3466         * libgccjit.h (gcc_jit_context_new_global) New.
3467         * libgccjit.map: Add gcc_jit_context_new_global.
3469 2013-10-03  David Malcolm  <dmalcolm@redhat.com>
3471         * libgccjit.c (gcc_jit_param_as_lvalue): New.
3472         * libgccjit.h (gcc_jit_param_as_lvalue): New.
3473         * libgccjit.map: Add gcc_jit_param_as_lvalue.
3475 2013-10-03  David Malcolm  <dmalcolm@redhat.com>
3477         * internal-api.c (gcc::jit::function::postprocess): Dump gimple
3478         using dump_function_to_file rather than debug_gimple_seq so that
3479         we also get the declaration.
3481 2013-10-03  David Malcolm  <dmalcolm@redhat.com>
3483         * Make-lang.in: New.
3484         * TODO.rst: New.
3485         * config-lang.in: New.
3486         * dummy-frontend.c: New.
3487         * internal-api.c: New.
3488         * internal-api.h: New.
3489         * libgccjit.c: New.
3490         * libgccjit.h: New.
3491         * libgccjit.map: New.
3492         * notes.txt: New.
3494 Copyright (C) 2013-2014 Free Software Foundation, Inc.
3496 Copying and distribution of this file, with or without modification,
3497 are permitted in any medium without royalty provided the copyright
3498 notice and this notice are preserved.