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