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