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