1 2017-07-05 Richard Sandiford <richard.sandiford@linaro.org>
2 Alan Hayward <alan.hayward@arm.com>
3 David Sherwood <david.sherwood@arm.com>
5 * dummy-frontend.c (jit_langhook_type_for_mode): Remove "enum" before
8 2017-04-24 David Malcolm <dmalcolm@redhat.com>
10 * docs/cp/topics/types.rst (gccjit::type::get_const): Remove
12 (gccjit::type::get_aligned): Add.
13 * docs/topics/compatibility.rst: Add LIBGCCJIT_ABI_7.
14 * docs/topics/types.rst: Add gcc_jit_type_get_aligned.
15 * docs/_build/texinfo/libgccjit.texi: Regenerate.
16 * jit-playback.c (gcc::jit::playback::type::get_aligned): New
18 * jit-playback.h (gcc::jit::playback::type::get_aligned): New
20 * jit-recording.c: Within namespace gcc::jit::recording...
21 (type::get_aligned): New method.
22 (memento_of_get_aligned::replay_into): New method.
23 (memento_of_get_aligned::make_debug_string): New method.
24 (memento_of_get_aligned::write_reproducer): New method.
25 * jit-recording.h: Within namespace gcc::jit::recording...
26 (type::get_aligned): New method.
27 (type::accepts_writes_from): Strip off qualifications from
28 this when comparing pointer equality.
29 (decorated_type): New subclass of type, subsuming the
30 commonality between memento_of_get_const and
31 memento_of_get_volatile.
32 (memento_of_get_const): Make a subclass of decorated_type,
34 (memento_of_get_volatile): Likewise.
35 (memento_of_get_aligned): Likewise.
36 * libgccjit++.h: Within namespace gccjit...
37 (type::get_const): New method.
38 (type::get_aligned): New method.
39 * libgccjit.c (gcc_jit_type_get_aligned): New function.
40 * libgccjit.h (gcc_jit_type_get_aligned): New decl.
41 * libgccjit.map (LIBGCCJIT_ABI_7): New
42 (gcc_jit_type_get_aligned): Add.
44 2017-01-19 David Malcolm <dmalcolm@redhat.com>
46 * dummy-frontend.c (jit_langhook_type_for_size): Delete.
47 (LANG_HOOKS_TYPE_FOR_SIZE): Don't redefine.
49 2017-01-18 David Malcolm <dmalcolm@redhat.com>
51 * dummy-frontend.c (jit_langhook_type_for_size): Implement, using
52 lto's lto_type_for_size.
54 2017-01-01 Jakub Jelinek <jakub@redhat.com>
56 Update copyright years.
58 2016-05-20 David Malcolm <dmalcolm@redhat.com>
60 * docs/topics/compatibility.rst: Add LIBGCCJIT_ABI_6.
61 * docs/topics/expressions.rst (Function calls): Add documentation
62 of gcc_jit_rvalue_set_bool_require_tail_call.
63 * docs/_build/texinfo/libgccjit.texi: Regenerate.
64 * jit-common.h (gcc::jit::recording::base_call): Add forward decl.
65 * jit-playback.c: Within namespace gcc::jit::playback...
66 (context::build_call) Add "require_tail_call" param and use it
67 to set CALL_EXPR_MUST_TAIL_CALL.
68 (context::new_call): Add "require_tail_call" param.
69 (context::new_call_through_ptr): Likewise.
70 * jit-playback.h: Within namespace gcc::jit::playback...
71 (context::new_call: Add "require_tail_call" param.
72 (context::new_call_through_ptr): Likewise.
73 (context::build_call): Likewise.
74 * jit-recording.c: Within namespace gcc::jit::recording...
75 (base_call::base_call): New constructor.
76 (base_call::write_reproducer_tail_call): New method.
77 (call::call): Update for inheritance from base_call.
78 (call::replay_into): Provide m_require_tail_call to call
80 (call::write_reproducer): Call write_reproducer_tail_call.
81 (call_through_ptr::call_through_ptr): Update for inheritance from
83 (call_through_ptr::replay_into): Provide m_require_tail_call to call
84 to new_call_through_ptr.
85 (recording::call_through_ptr::write_reproducer): Call
86 write_reproducer_tail_call.
87 * jit-recording.h: Within namespace gcc::jit::recording...
88 (rvalue::dyn_cast_base_call): New virtual function.
89 (class base_call): New subclass of class rvalue.
90 (class call): Inherit from base_call rather than directly from
91 rvalue, moving get_precedence and m_args to base_call.
92 (class call_through_ptr): Likewise.
93 * libgccjit.c (gcc_jit_rvalue_set_bool_require_tail_call): New
96 (LIBGCCJIT_HAVE_gcc_jit_rvalue_set_bool_require_tail_call): New
98 (gcc_jit_rvalue_set_bool_require_tail_call): New function.
99 * libgccjit.map (LIBGCCJIT_ABI_6): New.
100 (gcc_jit_rvalue_set_bool_require_tail_call): Add.
102 2016-05-17 David Malcolm <dmalcolm@redhat.com>
104 * dummy-frontend.c: Include diagnostic.h.
105 (jit_begin_diagnostic): New function.
106 (jit_end_diagnostic): New function.
107 (jit_langhook_init): Register jit_begin_diagnostic
108 and jit_end_diagnostic with the global_dc.
109 * jit-playback.c: Include diagnostic.h.
110 (gcc::jit::playback::context::add_diagnostic): New method.
111 * jit-playback.h (struct diagnostic_context): Add forward
113 (gcc::jit::playback::context::add_diagnostic): New method.
115 2016-05-17 David Malcolm <dmalcolm@redhat.com>
117 * docs/topics/expressions.rst (Function calls): Document
118 gcc_jit_context_new_call_through_ptr.
119 * docs/_build/texinfo/libgccjit.texi: Regenerate.
121 2016-05-13 David Malcolm <dmalcolm@redhat.com>
123 * jit-playback.h: Within namespace gcc:jit::playback...
124 (compile_to_memory::postprocess): Mark with FINAL OVERRIDE.
125 (compile_to_file::postprocess): Likewise.
126 (function::finalizer): Likewise.
127 (block::finalizer): Likewise.
128 (source_file::finalizer): Likewise.
129 (source_line::finalizer): Likewise.
130 * jit-recording.c (gcc::jit::rvalue_usage_validator):: Likewise.
131 * jit-recording.h: Within namespace gcc::jit::recording...
132 (string::replay_into): Mark with FINAL OVERRIDE.
133 (string::make_debug_string): Likewise.
134 (string::write_reproducer): Likewise.
135 (location::replay_into): Likewise.
136 (location::dyn_cast_location): Likewise.
137 (location::make_debug_string): Likewise.
138 (location::write_reproducer): Likewise.
139 (memento_of_get_type::dereference): Likewise.
140 (memento_of_get_type::accepts_writes_from): Likewise.
141 (memento_of_get_type::is_int): Likewise.
142 (memento_of_get_type::is_float): Likewise.
143 (memento_of_get_type::is_bool): Likewise.
144 (memento_of_get_type::is_pointer): Likewise.
145 (memento_of_get_type::is_array): Likewise.
146 (memento_of_get_type::is_void): Likewise.
147 (memento_of_get_type::replay_into): Likewise.
148 (memento_of_get_type::make_debug_string): Likewise.
149 (memento_of_get_type::write_reproducer): Likewise.
150 (memento_of_get_pointer::dereference): Likewise.
151 (memento_of_get_pointer::accepts_writes_from): Likewise.
152 (memento_of_get_pointer::replay_into): Likewise.
153 (memento_of_get_pointer::is_int): Likewise.
154 (memento_of_get_pointer::is_float): Likewise.
155 (memento_of_get_pointer::is_bool): Likewise.
156 (memento_of_get_pointer::is_pointer): Likewise.
157 (memento_of_get_pointer::is_array): Likewise.
158 (memento_of_get_pointer::make_debug_string): Likewise.
159 (memento_of_get_pointer::write_reproducer): Likewise.
160 (memento_of_get_const::dereference): Likewise.
161 (memento_of_get_const::accepts_writes_from): Likewise.
162 (memento_of_get_const::unqualified): Likewise.
163 (memento_of_get_const::is_int): Likewise.
164 (memento_of_get_const::is_float): Likewise.
165 (memento_of_get_const::is_bool): Likewise.
166 (memento_of_get_const::is_pointer): Likewise.
167 (memento_of_get_const::is_array): Likewise.
168 (memento_of_get_const::void replay_into): Likewise;
169 (memento_of_get_const::make_debug_string): Likewise.
170 (memento_of_get_const::write_reproducer): Likewise.
171 (memento_of_get_volatile::dereference): Likewise.
172 (memento_of_get_volatile::unqualified): Likewise.
173 (memento_of_get_volatile::is_int): Likewise.
174 (memento_of_get_volatile::is_float): Likewise.
175 (memento_of_get_volatile::is_bool): Likewise.
176 (memento_of_get_volatile::is_pointer): Likewise.
177 (memento_of_get_volatile::is_array): Likewise.
178 (memento_of_get_volatile::replay_into): Likewise;
179 (memento_of_get_volatile::make_debug_string): Likewise.
180 (memento_of_get_volatile::write_reproducer): Likewise.
181 (array_type::dereference): Likewise.
182 (array_type::is_int): Likewise.
183 (array_type::is_float): Likewise.
184 (array_type::is_bool): Likewise.
185 (array_type::is_pointer): Likewise.
186 (array_type::is_array): Likewise.
187 (array_type::replay_into): Likewise;
188 (array_type::make_debug_string): Likewise.
189 (array_type::write_reproducer): Likewise.
190 (function_type::dereference): Likewise.
191 (function_type::function_dyn_cast_function_type): Likewise.
192 (function_type::function_as_a_function_type): Likewise.
193 (function_type::is_int): Likewise.
194 (function_type::is_float): Likewise.
195 (function_type::is_bool): Likewise.
196 (function_type::is_pointer): Likewise.
197 (function_type::is_array): Likewise.
198 (function_type::replay_into): Likewise;
199 (function_type::make_debug_string): Likewise.
200 (function_type::write_reproducer): Likewise.
201 (field::replay_into): Likewise;
202 (field::write_to_dump): Likewise.
203 (field::make_debug_string): Likewise.
204 (field::write_reproducer): Likewise.
205 (compound_type::dereference): Likewise.
206 (compound_type::is_int): Likewise.
207 (compound_type::is_float): Likewise.
208 (compound_type::is_bool): Likewise.
209 (compound_type::is_pointer): Likewise.
210 (compound_type::is_array): Likewise.
211 (compound_type::has_known_size): Likewise.
212 (struct_::dyn_cast_struct): Likewise.
213 (struct_::replay_into): Likewise.
214 (struct_::access_as_type): Likewise.
215 (struct_::make_debug_string): Likewise.
216 (struct_::write_reproducer): Likewise.
217 (fields::replay_into): Likewise.
218 (fields::write_to_dump): Likewise.
219 (fields::make_debug_string): Likewise.
220 (fields::write_reproducer): Likewise.
221 (union_::replay_into): Likewise.
222 (union_::make_debug_string): Likewise.
223 (union_::write_reproducer): Likewise.
224 (lvalue::access_as_rvalue): Mark with OVERRIDE.
225 (param::replay_into): Mark with FINAL OVERRIDE.
226 (param::visit_children): Likewise.
227 (param::dyn_cast_param): Likewise.
228 (param::access_as_rvalue): Likewise.
229 (param::access_as_lvalue): Likewise.
230 (param::make_debug_string): Likewise.
231 (param::write_reproducer): Likewise.
232 (param::get_precedence): Likewise.
233 (function::replay_into): Likewise.
234 (function::write_to_dump): Likewise.
235 (function::make_debug_string): Likewise.
236 (function::write_reproducer): Likewise.
237 (block::write_to_dump): Likewise.
238 (block::make_debug_string): Likewise.
239 (block::write_reproducer): Likewise.
240 (block::replay_into): Likewise.
241 (global::replay_into): Likewise;
242 (global::visit_children): Likewise.
243 (global::write_to_dump): Likewise.
244 (global::make_debug_string): Likewise.
245 (global::write_reproducer): Likewise.
246 (global::get_precedence): Likewise.
247 (memento_of_new_rvalue_from_const::replay_into): Likewise.
248 (memento_of_new_rvalue_from_const::visit_children): Likewise.
249 (memento_of_new_rvalue_from_const::is_constant): Likewise.
250 (memento_of_new_rvalue_from_const::get_wide_int): Likewise.
251 (memento_of_new_rvalue_from_const::make_debug_string): Likewise.
252 (memento_of_new_rvalue_from_const::write_reproducer): Likewise.
253 (memento_of_new_rvalue_from_const::get_precedence): Likewise.
254 (memento_of_new_string_literal::replay_into): Likewise.
255 (memento_of_new_string_literal::visit_children): Likewise.
256 (memento_of_new_string_literal::make_debug_string): Likewise.
257 (memento_of_new_string_literal::write_reproducer): Likewise.
258 (memento_of_new_string_literal::get_precedence): Likewise.
259 (unary_op::replay_into): Likewise.
260 (unary_op::visit_children): Likewise.
261 (unary_op::make_debug_string): Likewise.
262 (unary_op::write_reproducer): Likewise.
263 (unary_op::get_precedence): Likewise.
264 (binary_op::replay_into): Likewise.
265 (binary_op::visit_children): Likewise.
266 (binary_op::make_debug_string): Likewise.
267 (binary_op::write_reproducer): Likewise.
268 (binary_op::get_precedence): Likewise.
269 (comparison::replay_into): Likewise.
270 (comparison::visit_children): Likewise.
271 (comparison::make_debug_string): Likewise.
272 (comparison::write_reproducer): Likewise.
273 (comparison::get_precedence): Likewise.
274 (cast::replay_into): Likewise.
275 (cast::visit_children): Likewise.
276 (cast::make_debug_string): Likewise.
277 (cast::write_reproducer): Likewise.
278 (cast::get_precedence): Likewise.
279 (call::replay_into): Likewise.
280 (call::visit_children): Likewise.
281 (call::make_debug_string): Likewise.
282 (call::write_reproducer): Likewise.
283 (call::get_precedence): Likewise.
284 (call_through_ptr::replay_into): Likewise.
285 (call_through_ptr::visit_children): Likewise.
286 (call_through_ptr::make_debug_string): Likewise.
287 (call_through_ptr::write_reproducer): Likewise.
288 (call_through_ptr::get_precedence): Likewise.
289 (array_access::replay_into): Likewise.
290 (array_access::visit_children): Likewise.
291 (array_access::make_debug_string): Likewise.
292 (array_access::write_reproducer): Likewise.
293 (array_access::get_precedence): Likewise.
294 (access_field_of_lvalue::replay_into): Likewise.
295 (access_field_of_lvalue::visit_children): Likewise.
296 (access_field_of_lvalue::make_debug_string): Likewise.
297 (access_field_of_lvalue::write_reproducer): Likewise.
298 (access_field_of_lvalue::get_precedence): Likewise.
299 (access_field_rvalue::replay_into): Likewise.
300 (access_field_rvalue::visit_children): Likewise.
301 (access_field_rvalue::make_debug_string): Likewise.
302 (access_field_rvalue::write_reproducer): Likewise.
303 (access_field_rvalue::get_precedence): Likewise.
304 (dereference_field_rvalue::replay_into): Likewise.
305 (dereference_field_rvalue::visit_children): Likewise.
306 (dereference_field_rvalue::make_debug_string): Likewise.
307 (dereference_field_rvalue::write_reproducer): Likewise.
308 (dereference_field_rvalue::get_precedence): Likewise.
309 (dereference_rvalue::replay_into): Likewise.
310 (dereference_rvalue::visit_children): Likewise.
311 (dereference_rvalue::make_debug_string): Likewise.
312 (dereference_rvalue::write_reproducer): Likewise.
313 (dereference_rvalue::get_precedence): Likewise.
314 (get_address_of_lvalue::replay_into): Likewise.
315 (get_address_of_lvalue::visit_children): Likewise.
316 (get_address_of_lvalue::make_debug_string): Likewise.
317 (get_address_of_lvalue::write_reproducer): Likewise.
318 (get_address_of_lvalue::get_precedence): Likewise.
319 (local::replay_into): Likewise.
320 (local::visit_children): Likewise.
321 (local::write_to_dump): Likewise.
322 (local::make_debug_string): Likewise.
323 (local::write_reproducer): Likewise.
324 (local::get_precedence): Likewise.
325 (statement::write_to_dump): Likewise.
326 (eval::replay_into): Likewise.
327 (eval::make_debug_string): Likewise.
328 (eval::write_reproducer): Likewise.
329 (assignment::replay_into): Likewise.
330 (assignment::make_debug_string): Likewise.
331 (assignment::write_reproducer): Likewise.
332 (assignment_op::replay_into): Likewise.
333 (assignment_op::make_debug_string): Likewise.
334 (assignment_op::write_reproducer): Likewise.
335 (comment::replay_into): Likewise.
336 (comment::make_debug_string): Likewise.
337 (comment::write_reproducer): Likewise.
338 (conditional::replay_into): Likewise.
339 (conditional::get_successor_blocks): Likewise.
340 (conditional::make_debug_string): Likewise.
341 (conditional::write_reproducer): Likewise.
342 (jump::replay_into): Likewise.
343 (jump::get_successor_blocks): Likewise.
344 (jump::make_debug_string): Likewise.
345 (jump::write_reproducer): Likewise.
346 (return_::replay_into): Likewise.
347 (return_::get_successor_blocks): Likewise.
348 (return_::make_debug_string): Likewise.
349 (return_::write_reproducer): Likewise.
350 (case_::replay_into): Likewise.
351 (case_::write_reproducer): Likewise.
352 (case_::make_debug_string): Likewise.
353 (switch_::replay_into): Likewise.
354 (switch_::get_successor_blocks): Likewise.
355 (switch_::make_debug_string): Likewise.
356 (switch_::write_reproducer): Likewise.
358 2016-02-08 David Malcolm <dmalcolm@redhat.com>
360 * dummy-frontend.c (jit_langhook_init): Remove
361 second argument to build_common_tree_nodes to
364 2016-01-23 Iain Buclaw <ibuclaw@gdcproject.org>
366 * jit-playback.c: Include pthread.h.
368 2016-01-19 David Malcolm <dmalcolm@redhat.com>
371 * jit-playback.c (gcc::jit::playback::compile_to_file::postprocess):
372 Potentially add the temporary artifact to the tempdir's list of
373 tempfiles needing additional cleanup.
374 (gcc::jit::playback::context::extract_any_requested_dumps): Likewise
376 * jit-tempdir.c (gcc::jit::tempdir::~tempdir): Clean up additional
378 * jit-tempdir.h (gcc::jit::tempdir::add_temp_file): New method.
379 (gcc::jit::tempdir::m_tempfiles): New field.
380 * docs/cp/intro/tutorial04.rst: Update for changes to toyvm.cc.
381 * docs/examples/tut04-toyvm/toyvm.cc (class compilation_result):
383 (toyvm_function::compile): Change return type from function ptr
384 to a compilation_result.
385 (toyvm_function::get_function_name): New accessor.
386 (toyvm_function::m_funcname): New field.
387 (get_function_name): Convert to...
388 (toyvm_function::make_function_name): ...this new method.
389 (toyvm_function::parse): Call make_function_name.
390 (toyvm_function::compile): Convert return type from function ptr
391 to a compilation_result. Use get_function_name.
392 (compilation_state::compile): Convert return type from
393 gcc_jit_result * to a compilation_result.
394 (test_script): Update for above changes, extracting the code from
395 the compilation_result.
397 * docs/_build/texinfo/libgccjit.texi: Regenerate.
399 2016-01-04 Jakub Jelinek <jakub@redhat.com>
401 Update copyright years.
403 2015-11-11 Andrew MacLeod <amacleod@redhat.com>
405 * dummy-frontend.c: Remove unused header files.
406 * jit-builtins.c: Likewise.
407 * jit-playback.c: Likewise.
408 * jit-recording.c: Likewise.
409 * jit-spec.c: Likewise.
410 * libgccjit.c: Likewise.
412 2015-11-07 Richard Sandiford <richard.sandiford@arm.com>
414 * jit-builtins.c: Don't undef DEF_BUILTIN.
416 2015-10-29 Andrew MacLeod <amacleod@redhat.com>
418 * dummy-frontend.c: Reorder #include's and remove duplicates.
419 * jit-builtins.c: Likewise.
420 * jit-playback.c: Likewise.
421 * jit-recording.c: Likewise.
422 * libgccjit.c: Likewise.
424 2015-10-13 Jakub Jelinek <jakub@redhat.com>
426 * jit-builtins.c (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10,
427 DEF_FUNCTION_TYPE_11): Define.
428 * jit-builtins.h (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10,
429 DEF_FUNCTION_TYPE_11): Define.
431 2015-09-30 Thomas Schwinge <thomas@codesourcery.com>
432 Ulrich Drepper <drepper@gmail.com>
434 * jit-builtins.h: Undefine DEF_FUNCTION_TYPE_VAR_6 after use.
436 2015-09-30 Matthias Klose <doko@ubuntu.com>
438 * jit-builtins.h Define DEF_FUNCTION_TYPE_VAR_6,
439 remove DEF_FUNCTION_TYPE_VAR_11.
440 * jit-builtins.c (builtins_manager::make_type): Define and handle
441 DEF_FUNCTION_TYPE_VAR_6, remove DEF_FUNCTION_TYPE_VAR_11.
443 2015-08-25 David Malcolm <dmalcolm@redhat.com>
445 * docs/cp/topics/contexts.rst
446 (gccjit::context::set_bool_use_external_driver): New.
447 * docs/internals/test-hello-world.exe.log.txt: Update.
448 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_5): New.
449 * docs/topics/contexts.rst
450 (gcc_jit_context_set_bool_use_external_driver): New.
451 * jit-common.h (enum inner_bool_option): Add
452 INNER_BOOL_OPTION_USE_EXTERNAL_DRIVER.
453 * jit-playback.c (gcc_driver_name): New global.
454 (gcc:jit::playback::context::invoke_driver): Split out second
456 (gcc::jit::playback::context::invoke_embedded_driver): ...this new
458 (gcc::jit::playback::context::invoke_external_driver): ...this new
461 (gcc::jit::playback::context::get_inner_bool_option): New.
462 (gcc::jit::playback::context::invoke_embedded_driver): New.
463 (gcc::jit::playback::context::invoke_external_driver): New.
464 * jit-recording.c (inner_bool_option_reproducer_strings):
465 Add entry for INNER_BOOL_OPTION_USE_EXTERNAL_DRIVER.
467 (gccjit::context::set_bool_use_external_driver): New.
468 * libgccjit.c (gcc_jit_context_set_bool_use_external_driver): New.
469 * libgccjit.h (gcc_jit_context_set_bool_use_external_driver): New.
470 (LIBGCCJIT_HAVE_gcc_jit_context_set_bool_use_external_driver):
472 * libgccjit.map (LIBGCCJIT_ABI_5): New.
473 * notes.txt: Show invocation of embedded copy of driver.
474 * docs/internals/test-hello-world.exe.log.txt: Update
476 2015-08-13 David Malcolm <dmalcolm@redhat.com>
478 * jit-playback.c (invoke_driver): On OS X, add
479 "-Wl,-undefined,dynamic_lookup" to the driver arguments.
481 2015-08-03 David Malcolm <dmalcolm@redhat.com>
483 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_4): New.
484 * docs/topics/contexts.rst (GCC_JIT_BOOL_OPTION_DUMP_SUMMARY):
485 We no longer show a profile.
486 * docs/topics/index.rst (Topic Reference): Add performance.rst.
487 * docs/topics/performance.rst: New file.
488 * docs/_build/texinfo/libgccjit.texi: Regenerate.
489 * jit-playback.c (gcc::jit::playback::context::compile): Add timer
490 param when constructing the "toplev" instance.
491 (gcc::jit::playback::context::acquire_mutex): Add timer param when
492 constructing auto_timevar instance.
493 (gcc::jit::playback::context::make_fake_args): If we have a timer,
495 (gcc::jit::playback::context::invoke_driver): Add timer param when
496 constructing auto_timevar instance.
497 (gcc::jit::playback::context::dlopen_built_dso): Likewise.
498 * jit-playback.h (gcc::jit::playback::context::get_timer): New accessor.
499 * jit-recording.c: Include timevar.h.
500 (gcc::jit::recording::context::context): Initialize field "m_timer".
501 * jit-recording.h: Add forward declaration of class timer.
502 (gcc::jit::recording::context::set_timer): New method.
503 (gcc::jit::recording::context::get_timer): New method.
504 (gcc::jit::recording::context::m_timer): New field.
505 * libgccjit++.h (gccjit::timer): New class.
506 (gccjit::auto_time): New class.
507 (gccjit::context::set_timer): New method.
508 (gccjit::context::get_timer): New.
509 (gccjit::timer::timer): New.
510 (gccjit::timer::push): New.
511 (gccjit::timer::pop): New.
513 (timer::get_inner_timer): New.
514 (timer::release): New.
515 (auto_time::auto_time): New.
516 (auto_time::~auto_time): New.
517 * libgccjit.c: Include timevar.h.
518 (struct gcc_jit_timer): New.
519 (gcc_jit_timer_new): New function.
520 (gcc_jit_timer_release): New function.
521 (gcc_jit_context_set_timer): New function.
522 (gcc_jit_context_get_timer): New function.
523 (gcc_jit_timer_push): New function.
524 (gcc_jit_timer_pop): New function.
525 (gcc_jit_timer_print): New function.
526 * libgccjit.h (LIBGCCJIT_HAVE_TIMING_API): New macro.
527 (gcc_jit_timer): New typedef.
528 (gcc_jit_timer_new): New function.
529 (gcc_jit_timer_release): New function.
530 (gcc_jit_context_set_timer): New function.
531 (gcc_jit_context_get_timer): New function.
532 (gcc_jit_timer_push): New function.
533 (gcc_jit_timer_pop): New function.
534 (gcc_jit_timer_print): New function.
535 * libgccjit.map (LIBGCCJIT_ABI_4): New.
536 (gcc_jit_timer_new): New function.
537 (gcc_jit_timer_release): New function.
538 (gcc_jit_context_set_timer): New function.
539 (gcc_jit_context_get_timer): New function.
540 (gcc_jit_timer_push): New function.
541 (gcc_jit_timer_pop): New function.
542 (gcc_jit_timer_print): New function.
544 2015-07-23 David Malcolm <dmalcolm@redhat.com>
546 * jit-playback.c (invoke_driver): Convert local "argvec"
547 to an auto_argvec, so that it owns copies of the strings,
548 rather than borrows them, updating ADD_ARG to use xstrdup
549 and special-casing the NULL terminator to avoid
550 xstrdup (NULL). Call add_multilib_driver_arguments at the front
552 (MULTILIB_DEFAULTS): Provide a default definition.
553 (multilib_defaults_raw): New constant array.
554 (gcc::jit::playback::context::add_multilib_driver_arguments): New
557 (gcc::jit::playback::context::add_multilib_driver_arguments): New
559 * docs/internals/test-hello-world.exe.log.txt: Update.
560 * docs/_build/texinfo/libgccjit.texi: Regenerate.
562 2015-07-16 David Malcolm <dmalcolm@redhat.com>
564 * docs/internals/index.rst (Overview of code structure): Add note
565 that the implementation is in C++, despite the .c extension.
566 (Submitting patches): New subsection.
567 * docs/_build/texinfo/libgccjit.texi: Regenerate.
569 2015-07-09 Andrew MacLeod <amacleod@redhat.com>
571 * dummy-frontend.c: Adjust includes for flags.h changes.
572 * jit-common.h: Likewise.
573 * jit-playback.c: Likewise.
575 2015-07-08 David Malcolm <dmalcolm@redhat.com>
578 * libgccjit.c (gcc_jit_context_new_field): Show name of field in
579 "unknown size" error message.
580 (gcc_jit_struct_set_fields): Show name of struct in error message.
581 (gcc_jit_context_new_global): Show name of global in
582 "unknown size" error message.
583 (gcc_jit_function_new_local): Likewise for local.
585 2015-07-07 Andrew MacLeod <amacleod@redhat.com>
587 * dummy-frontend.c: Adjust includes.
588 * jit-common.h: Likewise.
589 * jit-playback.c: Likewise.
591 2015-07-07 David Malcolm <dmalcolm@redhat.com>
594 * jit-recording.h: Within namespace gcc:jit::recording...
595 (type::has_known_size): New virtual function.
596 (struct_has_known_size): New function.
597 * libgccjit.c (gcc_jit_context_new_field): Verify that the type
599 (gcc_jit_context_new_global): Likewise.
600 (gcc_jit_function_new_local): Likewise.
602 2015-07-07 David Malcolm <dmalcolm@redhat.com>
605 * dummy-frontend.c (jit_langhook_type_for_mode): Ensure that we
606 handle modes QI, HI, SI, DI, TI.
608 2015-07-01 David Malcolm <dmalcolm@redhat.com>
611 * jit-playback.c (jit_mark_addressable): New function.
612 (gcc::jit::playback::lvalue::get_address): Call
613 jit_mark_addressable on the underlying tree.
615 2015-07-01 David Malcolm <dmalcolm@redhat.com>
617 * docs/topics/types.rst (gcc_jit_context_new_union_type): Add
619 * docs/_build/texinfo/libgccjit.texi: Regenerate.
621 2015-07-01 David Malcolm <dmalcolm@redhat.com>
623 * docs/topics/contexts.rst (gcc_jit_context_set_bool_option):
624 Clarify lack of lifetime requirements on (const char *) parameter.
625 * docs/topics/expressions.rst
626 (gcc_jit_context_new_string_literal): Likewise.
627 (gcc_jit_context_new_global): Likewise.
628 * docs/topics/functions.rst (gcc_jit_context_new_param): Likewise.
629 (gcc_jit_context_new_function): Likewise.
630 (gcc_jit_function_new_block): Likewise.
631 (gcc_jit_block_add_comment): Likewise.
632 * docs/topics/locations.rst (gcc_jit_context_new_location):
634 * docs/topics/types.rst (gcc_jit_context_new_field): Likewise.
635 (gcc_jit_context_new_struct_type): Likewise.
636 * docs/_build/texinfo/libgccjit.texi: Regenerate.
638 2015-06-30 David Malcolm <dmalcolm@redhat.com>
640 * docs/cp/topics/functions.rst (Blocks): Add switch statements to
641 list of ways to terminate a block.
642 (gccjit::block::end_with_switch): Add function description.
643 (gccjit::case_): Add class.
644 (gccjit::context::new_case): Add function description.
645 * docs/cp/topics/objects.rst: Add "case_" to class hierarchy.
646 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_3): New.
647 * docs/topics/functions.rst (Blocks): Add switch statements to
648 list of ways to terminate a block.
649 (gcc_jit_block_end_with_switch): Add function description.
650 (gcc_jit_case): Add type.
651 (gcc_jit_context_new_case): Add function description.
652 (gcc_jit_case_as_object): Add function description.
653 * docs/topics/objects.rst: Add gcc_jit_case to class hierarchy.
654 * docs/_build/texinfo/libgccjit.texi: Regenerate.
655 * jit-common.h (gcc::jit::recording::case_): Add forward decl.
656 (gcc::jit::playback::case_): Add forward decl.
657 * jit-playback.c (add_case): New function.
658 (gcc::jit::playback::block::add_switch): New function.
659 * jit-playback.h (gcc::jit::playback::case_): New struct.
660 (gcc::jit::playback::block::get_function): New method.
661 (gcc::jit::playback::block::add_switch): New method.
662 * jit-recording.c: Within namespace gcc::jit...
663 (recording::context::new_case): New method.
664 (recording::function::validate): Update for change to
665 get_successor_blocks.
666 (recording::block::end_with_switch): New method.
667 (recording::block::get_successor_blocks): Update to support an
668 arbitrary number of successor blocks.
669 (recording::block::dump_edges_to_dot): Likewise.
670 (memento_of_new_rvalue_from_const <int>::get_wide_int): New.
671 (memento_of_new_rvalue_from_const <long>::get_wide_int): New.
672 (memento_of_new_rvalue_from_const <double>::get_wide_int): New.
673 (memento_of_new_rvalue_from_const <void *>::get_wide_int): New.
674 (recording::statement::get_successor_blocks): Update to support an
675 arbitrary number of successor blocks.
676 (recording::conditional::get_successor_blocks): Likewise.
677 (recording::jump::get_successor_blocks): Likewise.
678 (recording::return_::get_successor_blocks): Likewise.
679 (recording::case_::write_reproducer): New.
680 (recording::case_::make_debug_string): New.
681 (recording::switch_::switch_): New.
682 (recording::switch_::replay_into): New.
683 (recording::switch_::get_successor_blocks): New.
684 (recording::switch_::make_debug_string): New.
685 (recording::switch_::write_reproducer): New.
686 * jit-recording.h: Within namespace gcc::jit::recording...
687 (context::new_case): New.
688 (rvalue::is_constant): New.
689 (rvalue::get_wide_int): New.
690 (block::end_with_switch): New.
691 (block::get_successor_blocks): Update to support an arbitrary
692 number of successor blocks.
693 (memento_of_new_rvalue_from_const::is_constant): New.
694 (memento_of_new_rvalue_from_const::get_wide_int): New.
695 (statement::get_successor_blocks): Update to support an arbitrary
696 number of successor blocks.
697 (conditional::get_successor_blocks): Likewise.
698 (jump::get_successor_blocks): Likewise.
699 (return_::get_successor_blocks): Likewise.
700 (case_): New subclass of memento.
701 (switch_): New subclass of statement.
702 * libgccjit++.h (gccjit::case_): New subclass of gccjit::object.
703 (gccjit::context::new_case): New method.
704 (gccjit::block::end_with_switch): New method.
705 (gccjit::case_::case): New ctors.
706 (gccjit::case_::get_inner_case): New method.
707 * libgccjit.c: Include "typed-splay-tree.h"
708 (struct gcc_jit_case): New.
709 (gcc_jit_context_new_case): New function.
710 (gcc_jit_case_as_object): New function.
711 (valid_dest_for_switch): New function.
712 (valid_case_for_switch): New function.
713 (class api_call_validator): New class.
714 (class case_range_validator): New class.
715 (case_range_validator::case_range_validator): New.
716 (case_range_validator::validate): New.
717 (case_range_validator::case_compare): New.
718 (case_range_validator::get_wide_int): new.
719 (gcc_jit_block_end_with_switch): New.
720 * libgccjit.h: Add gcc_jit_case to class hierarchy comment.
721 (gcc_jit_case): New typedef.
722 (gcc_jit_context_new_case): New function.
723 (gcc_jit_case_as_object): New function.
724 (gcc_jit_block_end_with_switch): New function.
725 (LIBGCCJIT_HAVE_SWITCH_STATEMENTS): New.
726 * libgccjit.map: Add gcc_jit_block_end_with_switch,
727 gcc_jit_case_as_object and gcc_jit_context_new_case.
729 2015-06-30 David Malcolm <dmalcolm@redhat.com>
732 * docs/cp/topics/contexts.rst
733 (gccjit::context::set_bool_allow_unreachable_blocks): New.
734 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_2): New.
735 * docs/topics/contexts.rst (Options): Add notes discussing the
736 transition from enums to entrypoints for new options.
737 (gcc_jit_context_set_bool_allow_unreachable_blocks): New.
738 * docs/_build/texinfo/libgccjit.texi: Regenerate.
739 * jit-common.h (gcc::jit::inner_bool_option): New enum.
740 * jit-recording.c: Within namespace gcc::jit...
741 (recording::context::context): Handle m_inner_bool_options.
742 (recording::context::set_inner_bool_option): New.
743 (inner_bool_option_reproducer_strings): New.
744 (recording::context::log_all_options): Log the "inner" bool
746 (recording::context::log_inner_bool_option): New.
747 (recording::context::dump_reproducer_to_file): Write initializers
748 for "inner" bool options.
749 (recording::function::validate): Don't check for block
750 reachability if INNER_BOOL_OPTION_ALLOW_UNREACHABLE_BLOCKS is set.
751 * jit-recording.h: Within namespace gcc::jit...
752 (recording::context::set_inner_bool_option): New.
753 (recording::context::get_inner_bool_option): New.
754 (recording::context::log_inner_bool_option): New.
755 (recording::context::m_inner_bool_options): New.
757 (gccjit::context::set_bool_allow_unreachable_blocks): New.
759 (gcc_jit_context_set_bool_allow_unreachable_blocks): New.
760 * libgccjit.h: Add note about options present in the
761 initial release of libgccjit.
762 (gcc_jit_context_set_bool_allow_unreachable_blocks): New API
764 (LIBGCCJIT_HAVE_gcc_jit_context_set_bool_allow_unreachable_blocks):
766 * libgccjit.map (LIBGCCJIT_ABI_2): New, containing...
767 (gcc_jit_context_set_bool_allow_unreachable_blocks): ...this new
770 2015-06-30 David Malcolm <dmalcolm@redhat.com>
773 * docs/cp/topics/contexts.rst (Additional command-line options):
775 * docs/topics/compatibility.rst: New file.
776 * docs/topics/contexts.rst (Additional command-line options): New
778 * docs/topics/index.rst: Add compatibility.rst.
779 * docs/_build/texinfo/libgccjit.texi: Regenerate.
780 * jit-playback.c (make_fake_args): Add call to
781 append_command_line_options.
782 * jit-recording.c: Within namespace gcc::jit...
783 (recording::context::~context): Free the optnames within
784 m_command_line_options.
785 (recording::context::set_bool_option): Likewise.
786 (recording::context::add_command_line_option): New method.
787 (recording::context::append_command_line_options): New method.
788 (recording::context::dump_reproducer_to_file): Add command-line
790 * jit-recording.h: Within namespace gcc::jit...
791 (recording::context::add_command_line_option): New method.
792 (recording::context::append_command_line_options): New method.
793 (recording::context::m_command_line_options): New field.
794 * libgccjit++.h (gccjit::context::add_command_line_option): New
796 * libgccjit.c (gcc_jit_context_add_command_line_option): New API
798 * libgccjit.h (gcc_jit_context_add_command_line_option): New API
800 (LIBGCCJIT_HAVE_gcc_jit_context_add_command_line_option): New
802 * libgccjit.map: Put existing symbols within LIBGCCJIT_ABI_0; add
803 LIBGCCJIT_ABI_1 and gcc_jit_context_add_command_line_option.
805 2015-06-30 David Malcolm <dmalcolm@redhat.com>
808 (gcc::jit::recording::context::dump_reproducer_to_file):
809 Add pragma to generated reproducers to disable -Wunused-variable.
810 Fix handling of NULL string options.
812 2015-06-30 David Malcolm <dmalcolm@redhat.com>
814 * docs/cp/topics/expressions.rst: Remove stray semicolon.
815 * docs/cp/topics/functions.rst: Remove stray backslash.
816 * docs/_build/texinfo/libgccjit.texi: Regenerate.
818 2015-06-25 Andrew MacLeod <amacleod@redhat.com>
820 * dummy-frontend.c: Remove ipa-ref.h and plugin-api.h from include list.
821 * jit-playback.c: Likewise.
823 2015-06-25 Andrew Macleod <amacleod@redhat.com>
825 * jit-common.h: Don't include alias.h.
827 2015-06-17 David Malcolm <dmalcolm@redhat.com>
829 * libgccjit.c (gcc_jit_lvalue_access_field): Verify that the field
830 is for the correct struct.
831 (gcc_jit_rvalue_access_field): Likewise.
833 2015-06-17 Andrew MacLeod <amacleod@redhat.com>
835 * dummy-frontend.c: Do not include input.h, line-map.h or is-a.h.
836 * jit-common.h: Likewise.
837 * jit-playback.c: Likewise.
839 2015-06-16 David Malcolm <dmalcolm@redhat.com>
842 * jit-recording.c: Within namespace gcc::jit::recording::
843 (rvalue::get_debug_string_parens): New function.
844 (binary_op::make_debug_string): Update to mimic C precedence
846 (binary_op_precedence): New array.
847 (binary_op::get_precedence): New function.
848 (comparison::make_debug_string): Update to mimic C precedence
850 (comparison_precedence): New array.
851 (comparison::get_precedence): New function.
852 (cast::make_debug_string): Update to mimic C precedence rules.
853 (call::make_debug_string): Likewise.
854 (call_through_ptr::make_debug_string): Likewise.
855 (array_access::make_debug_string): Likewise.
856 (access_field_of_lvalue::make_debug_string): Likewise.
857 (access_field_rvalue::make_debug_string): Likewise.
858 (dereference_field_rvalue::make_debug_string): Likewise.
859 (dereference_rvalue::make_debug_string): Likewise.
860 (get_address_of_lvalue::make_debug_string): Likewise.
861 * jit-recording.h: Within namespace gcc::jit::recording::
862 (precedence): New enum.
863 (rvalue::rvalue): Initialize field "m_parenthesized_string".
864 (rvalue::get_debug_string_parens): New method.
865 (rvalue::get_precedence): New pure virtual function.
866 (rvalue::m_parenthesized_string): New field.
867 (param::get_precedence): New function.
868 (global::get_precedence): New function.
869 (memento_of_new_rvalue_from_const::get_precedence): New function.
870 (memento_of_new_string_literal::get_precedence): New function.
871 (unary_op::get_precedence): New function.
872 (binary_op::get_precedence): New function.
873 (comparison::get_precedence): New function.
874 (cast::get_precedence): New function.
875 (call::get_precedence): New function.
876 (call_through_ptr::get_precedence): New function.
877 (array_access::get_precedence): New function.
878 (access_field_of_lvalue::get_precedence): New function.
879 (access_field_rvalue::get_precedence): New function.
880 (dereference_field_rvalue::get_precedence): New function.
881 (dereference_rvalue::get_precedence): New function.
882 (get_address_of_lvalue::get_precedence): New function.
883 (local::get_precedence): New function.
885 2015-06-09 Matthias Klose <doko@ubuntu.com>
887 * Make-lang.in (jit.install-common): Install headers using INSTALL_DATA.
889 2015-06-08 Andrew MacLeod <amacleod@redhat.com>
891 * dummy-frontend.c : Adjust include files.
892 * jit-common.h : Likewise.
893 * jit-playback.c : Likewise.
895 2015-06-05 David Malcolm <dmalcolm@redhat.com>
898 (jit_langhook_post_compilation_parsing_cleanups): Remove.
899 (LANG_HOOKS_POST_COMPILATION_PARSING_CLEANUPS): Remove
900 * jit-playback.c (gcc::jit::playback::context::new_global): Add
901 call to varpool_node::finalize_decl.
902 (gcc::jit::playback::context::finalize_global_decls): Remove.
904 (gcc::jit::playback::context::finalize_global_decls): Remove.
906 2015-06-05 David Malcolm <dmalcolm@redhat.com>
908 * dummy-frontend.c (jit_langhook_write_globals): Rename to...
909 (jit_langhook_post_compilation_parsing_cleanups): ...this, and
910 eliminate calls to finalize_compilation_unit and
911 write_global_decls_2.
912 (LANG_HOOKS_WRITE_GLOBALS): Rename to...
913 (LANG_HOOKS_POST_COMPILATION_PARSING_CLEANUPS): ...this and
914 redirect from jit_langhook_write_globals to
915 jit_langhook_post_compilation_parsing_cleanups.
917 (gcc::jit::playback::context::write_global_decls_1): Rename to...
918 (gcc::jit::playback::context::finalize_global_decls): ...this.
919 (gcc::jit::playback::context::write_global_decls_1): Delete.
921 (gcc::jit::playback::context::write_global_decls_1): Rename to...
922 (gcc::jit::playback::context::finalize_global_decls): ...this.
923 (gcc::jit::playback::context::write_global_decls_1): Delete.
925 2015-06-04 Andrew MacLeod <amacleod@redhat.com>
927 * dummy-frontend.c: Adjust includes for restructured coretypes.h.
928 * jit-common.h: Likewise.
929 * jit-playback.c: Likewise.
931 2015-05-12 David Malcolm <dmalcolm@redhat.com>
933 * jit-builtins.c: Include vec.h before target.h.
935 2015-04-27 Jim Wilson <jim.wilson@linaro.org>
937 * Make-lang.in (jit.mostlyclean): Remove shared libraries and object
940 2015-04-09 David Malcolm <dmalcolm@redhat.com>
943 * docs/cp/topics/expressions.rst (Simple expressions): Fix copy
944 and paste error in description of gccjit::context::one.
945 * docs/topics/expressions.rst (Simple expressions): Likewise in
946 description of gcc_jit_context_one.
947 * docs/_build/texinfo/libgccjit.texi: Regenerate.
949 2015-03-13 Uros Bizjak <ubizjak@gmail.com>
951 * jit-recording.c (dump::write): Also check vasprintf return value.
952 (recording::context::add_error_va): Ditto.
953 (recording::string::from_printf): Ditto.
955 2015-03-13 David Malcolm <dmalcolm@redhat.com>
957 * docs/internals/index.rst (Packaging notes): New section.
958 * docs/_build/texinfo/libgccjit.texi: Regenerate.
960 2015-03-05 David Malcolm <dmalcolm@redhat.com>
962 * docs/cp/intro/tutorial03.rst: Add missing arguments to
963 gccjit::block::end_with_conditional call. Add on_true/on_false
964 comments. Tweak the wording.
965 * docs/intro/tutorial03.rst: Add missing arguments to
966 gcc_jit_block_end_with_conditional call. Add some clarifying
968 * docs/topics/compilation.rst: Tweak the wording to avoid an
969 ambiguous use of "this".
970 * docs/topics/contexts.rst: Fix a typo.
971 * docs/topics/expressions.rst (GCC_JIT_BINARY_OP_MINUS): Remove
973 * docs/_build/texinfo/libgccjit.texi: Regenerate.
975 2015-02-24 Thomas Schwinge <thomas@codesourcery.com>
978 * jit-builtins.c (DEF_FUNCTION_TYPE_VAR_8)
979 (DEF_FUNCTION_TYPE_VAR_12): Remove macros.
980 (DEF_FUNCTION_TYPE_VAR_7, DEF_FUNCTION_TYPE_VAR_11): New macros.
981 * jit-builtins.h (DEF_FUNCTION_TYPE_VAR_8)
982 (DEF_FUNCTION_TYPE_VAR_12): Remove macros.
983 (DEF_FUNCTION_TYPE_VAR_7, DEF_FUNCTION_TYPE_VAR_11): New macros.
985 2015-02-04 David Malcolm <dmalcolm@redhat.com>
988 * docs/conf.py (html_theme): Change from 'pyramid'
991 2015-02-04 David Malcolm <dmalcolm@redhat.com>
993 * docs/topics/contexts.rst (gcc_jit_context_acquire): Fix
995 * docs/_build/texinfo/libgccjit.texi: Regenerate.
997 2015-02-03 David Malcolm <dmalcolm@redhat.com>
999 * jit-logging.h (gcc::jit::log_user::log): Make const.
1000 * jit-recording.c (gcc::jit::recording::context::set_str_option):
1001 Log the new value of the option.
1002 (gcc::jit::recording::context::set_int_option): Likewise.
1003 (gcc::jit::recording::context::set_bool_option): Likewise.
1004 (gcc::jit::recording::context::compile): Log the value of all
1006 (gcc::jit::recording::context::compile_to_file): Likewise.
1007 (gcc::jit::recording::context::log_all_options): New function.
1008 (gcc::jit::recording::context::log_str_option): New function.
1009 (gcc::jit::recording::context::log_int_option): New function.
1010 (gcc::jit::recording::context::log_bool_option): New function.
1011 * jit-recording.h (gcc::jit::recording::context::log_all_options):
1013 (gcc::jit::recording::context::log_str_option): New function.
1014 (gcc::jit::recording::context::log_int_option): New function.
1015 (gcc::jit::recording::context::log_bool_option): New function.
1016 * docs/internals/test-hello-world.exe.log.txt: Update for above
1018 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1020 2015-02-03 David Malcolm <dmalcolm@redhat.com>
1023 * Make-lang.in (jit_OBJS): Add jit/jit-spec.o and gcc.o.
1024 (LIBGCCJIT_FILENAME): Add EXTRA_GCC_OBJS.
1025 * jit-playback.c: Include gcc.h.
1026 (gcc::jit::playback::context::compile): Move mutex acquisition
1027 to before the call to make_fake_args.
1028 (append_arg_from_driver): New function.
1029 (gcc::jit::playback::context::make_fake_args): On the first call,
1030 call into driver_get_configure_time_options to get configure-time
1031 default options and cache them. Add them to the args for
1033 * jit-spec.c: New source file.
1034 * docs/internals/test-hello-world.exe.log.txt: Update to reflect
1036 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1038 2015-02-02 David Malcolm <dmalcolm@redhat.com>
1041 * dummy-frontend.c (jit_langhook_type_for_mode): Support
1042 TYPE_MODE (long_long_integer_type_node).
1044 2015-01-27 David Malcolm <dmalcolm@redhat.com>
1046 * docs/internals/test-hello-world.exe.log.txt: Add example version
1048 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1049 * jit-common.h (gcc::jit::dump::get_file): New accessor.
1050 * jit-logging.c: Include toplev.h.
1051 (gcc::jit::logger::logger): Log the GCC version.
1052 * jit-recording.c: Include toplev.h.
1053 (gcc:jit::recording::context::dump_reproducer_to_file): Log the
1056 2015-01-26 David Malcolm <dmalcolm@redhat.com>
1058 * docs/topics/compilation.rst (gcc_jit_result_get_code): Fix typo.
1059 * docs/topics/contexts.rst (gcc_jit_context_get_last_error): The
1060 error buffer is only valid until the next call to the context.
1061 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1062 * libgccjit.h (gcc_jit_context_get_first_error): Reword the
1063 comment to omit mention of compiling.
1064 (gcc_jit_context_get_last_error): The error buffer is only valid
1065 until the next call to the context.
1067 2015-01-26 David Malcolm <dmalcolm@redhat.com>
1070 * config-lang.in (compilers): Drop "libgccjit.so".
1072 2015-01-23 David Malcolm <dmalcolm@redhat.com>
1075 * jit-playback.c (gcc::jit::playback::context::compile): Construct
1076 toplev instances with init_signals=false.
1078 2015-01-19 David Malcolm <dmalcolm@redhat.com>
1080 * docs/cp/topics/results.rst: Rename to...
1081 * docs/cp/topics/compilation.rst: ...this, and add section on
1082 ahead-of-time compilation.
1083 * docs/cp/topics/index.rst: Update for renaming of results.rst
1085 * docs/examples/emit-alphabet.bf: New file, a sample "brainf"
1087 * docs/examples/tut05-bf.c: New file, implementing a compiler
1089 * docs/internals/test-hello-world.exe.log.txt: Update to reflect
1090 changes to logger output.
1091 * docs/intro/index.rst: Add tutorial05.rst
1092 * docs/intro/tutorial05.rst: New file.
1093 * docs/topics/results.rst: Rename to...
1094 * docs/topics/compilation.rst: ...this, and add section on
1095 ahead-of-time compilation.
1096 * docs/topics/index.rst: Update for renaming of results.rst to
1098 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1099 * jit-playback.c (gcc::jit::playback::context::compile): Convert
1100 return type from result * to void. Move the code to convert to
1101 dso and dlopen the result to a new pure virtual "postprocess"
1103 (gcc::jit::playback::compile_to_memory::compile_to_memory): New
1105 (gcc::jit::playback::compile_to_memory::postprocess): New
1106 function, based on playback::context::compile.
1107 (gcc::jit::playback::compile_to_file::compile_to_file): New
1109 (gcc::jit::playback::compile_to_file::postprocess): New function.
1110 (gcc::jit::playback::compile_to_file::copy_file): New function.
1111 (gcc::jit::playback::context::convert_to_dso): Move internals
1113 (gcc::jit::playback::context::invoke_driver): New method. Add
1114 "-shared" and "-c" options to driver's argv as needed.
1115 * jit-playback.h: Include "timevar.h".
1116 (gcc::jit::playback::context::compile): Convert return type from
1118 (gcc::jit::playback::context::postprocess): New pure virtual
1119 function, making this an abstract base class.
1120 (gcc::jit::playback::context::get_tempdir): New accessor.
1121 (gcc::jit::playback::context::invoke_driver): New function.
1122 (class gcc::jit::playback::compile_to_memory): New subclass of
1124 (class gcc::jit::playback::compile_to_file): Likewise.
1125 * jit-recording.c (gcc::jit::recording::context::compile): Use a
1126 playback::compile_to_memory, and extract its result.
1127 (gcc::jit::recording::context::compile_to_file): New function.
1128 * jit-recording.h (gcc::jit::recording::context::compile_to_file):
1130 * libgccjit++.h (gccjit::context::compile_to_file): New method.
1131 * libgccjit.c (gcc_jit_context_compile): Update log message to
1132 clarify that this is an in-memory compile.
1133 (gcc_jit_context_compile_to_file): New function.
1134 * libgccjit.h (gcc_jit_context): Clarify that you can compile
1135 a context more than once, and that you can compile to a file
1136 as well as to memory.
1137 (gcc_jit_result): Clarify that this is the result of an
1138 in-memory compilation.
1139 (gcc_jit_context_compile): Clarify that you can compile, and that
1140 this is an in-memory compilation.
1141 (enum gcc_jit_output_kind): New enum.
1142 (gcc_jit_context_compile_to_file): New function.
1143 (gcc_jit_context_enable_dump): Clarify comment to cover both forms
1145 * libgccjit.map (gcc_jit_context_compile_to_file): New API
1147 * notes.txt: Update to show the playback::context::postprocess
1150 2015-01-19 David Malcolm <dmalcolm@redhat.com>
1153 (gcc::jit::recording::memento_of_new_string_literal::make_debug_string):
1154 Add missing format string.
1156 2015-01-16 David Malcolm <dmalcolm@redhat.com>
1158 * Make-lang.in (lang_checks_parallelized): Add "check-jit".
1159 (check_jit_parallelize): Set this to an arbitrary value (10).
1161 2015-01-16 Jakub Jelinek <jakub@redhat.com>
1163 * jit-builtins.h (DEF_FUNCTION_TYPE_VAR_5): Fix spelling of
1165 (DEF_FUNCTION_TYPE_VAR_8, DEF_FUNCTION_TYPE_VAR_12): Define and
1167 * jit-builtins.c (DEF_FUNCTION_TYPE_VAR_8, DEF_FUNCTION_TYPE_VAR_12):
1170 2015-01-15 Richard Sandiford <richard.sandiford@arm.com>
1172 Update copyright years in docs/.
1174 2015-01-15 David Malcolm <dmalcolm@redhat.com>
1176 * libgccjit.c (gcc_jit_block_add_assignment_op): Check that the
1177 lvalue and the rvalue are of compatible type.
1179 2015-01-13 David Malcolm <dmalcolm@redhat.com>
1181 * docs/cp/topics/contexts.rst (Debugging): Add
1182 gccjit::context::dump_reproducer_to_file.
1183 * docs/internals/index.rst (Design notes): New section,
1184 discussing input validation and
1185 gcc_jit_context_dump_reproducer_to_file.
1186 * docs/topics/contexts.rst (Debugging): Add
1187 gcc_jit_context_dump_reproducer_to_file.
1188 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1189 * jit-common.h (gcc::jit::dump::get_context): New accessor.
1190 * jit-recording.c: Include "hash-map.h".
1191 Within namespace ::gcc::jit...
1192 (dump::write): Flush each line.
1193 (dump::make_location): Pass false for new param "created_by_user".
1194 (class allocator): New class.
1195 (allocator::~allocator): New function.
1196 (allocator::xstrdup_printf): New function.
1197 (allocator::xstrdup_printf_va): New function.
1198 (class reproducer): New subclass of dump.
1199 (reproducer::reproducer): New function.
1200 (reproducer::write_params): New function.
1201 (reproducer::write_args): New function.
1202 (reproducer::make_identifier): New function.
1203 (reproducer::make_tmp_identifier): New function.
1204 (reproducer::get_identifier): New pair of functions.
1205 (reproducer::get_identifier_as_rvalue): New function.
1206 (reproducer::get_identifier_as_lvalue): New function.
1207 (reproducer::get_identifier_as_type): New function.
1208 (reproducer::xstrdup_printf): New function.
1209 (recording::context::context): Initialize m_toplevel_ctxt.
1210 (recording::context::new_location): Add param created_by_user.
1211 (str_option_reproducer_strings): New table of strings.
1212 (int_option_reproducer_strings): Likewise.
1213 (bool_option_reproducer_strings): Likewise.
1214 (get_type_enum_strings): Likewise.
1215 (names_of_function_kinds): Likewise.
1216 (global_kind_reproducer_strings): Likewise.
1217 (unary_op_reproducer_strings): Likewise.
1218 (binary_op_reproducer_strings): Likewise.
1219 (comparison_reproducer_strings): Likewise.
1220 Within namespace ::gcc::jit::recording::...
1221 (context::dump_reproducer_to_file): New function.
1222 (string::write_reproducer): Likewise.
1223 (location::write_reproducer): Likewise.
1224 (type::access_as_type): Likewise.
1225 (memento_of_get_type::write_reproducer): Likewise.
1226 (memento_of_get_pointer::write_reproducer): Likewise.
1227 (memento_of_get_const::write_reproducer): Likewise.
1228 (memento_of_get_volatile::write_reproducer): Likewise.
1229 (array_type::write_reproducer): Likewise.
1230 (function_type::write_reproducer): Likewise.
1231 (function_type::write_deferred_reproducer): Likewise.
1232 (field::write_reproducer): Likewise.
1233 (struct_::access_as_type): Likewise.
1234 (struct_::write_reproducer): Likewise.
1235 (union_::write_reproducer): Likewise.
1236 (fields::write_reproducer): Likewise.
1237 (rvalue::access_as_rvalue): Likewise.
1238 (lvalue::access_as_rvalue): Likewise.
1239 (lvalue::access_as_lvalue): Likewise.
1240 (param::access_as_rvalue): Likewise.
1241 (param::access_as_lvalue): Likewise.
1242 (param::write_reproducer): Likewise.
1243 (function::write_reproducer): Likewise.
1244 (block::write_reproducer): Likewise.
1245 (global::write_reproducer): Likewise.
1246 (memento_of_new_rvalue_from_const <int>::write_reproducer):
1248 (memento_of_new_rvalue_from_const <long>::write_reproducer):
1250 (memento_of_new_rvalue_from_const <double>::write_reproducer):
1252 (memento_of_new_rvalue_from_const <void *>::write_reproducer):
1254 (memento_of_new_string_literal::write_reproducer): Likewise.
1255 (unary_op::write_reproducer): Likewise.
1256 (binary_op::write_reproducer): Likewise.
1257 (comparison::write_reproducer): Likewise.
1258 (cast::write_reproducer): Likewise.
1259 (call::write_reproducer): Likewise.
1260 (call_through_ptr::write_reproducer): Likewise.
1261 (array_access::write_reproducer): Likewise.
1262 (access_field_of_lvalue::write_reproducer): Likewise.
1263 (access_field_rvalue::write_reproducer): Likewise.
1264 (dereference_field_rvalue::write_reproducer): Likewise.
1265 (dereference_rvalue::write_reproducer): Likewise.
1266 (get_address_of_lvalue::write_reproducer): Likewise.
1267 (local::write_reproducer): Likewise.
1268 (eval::write_reproducer): Likewise.
1269 (assignment::write_reproducer): Likewise.
1270 (assignment_op::write_reproducer): Likewise.
1271 (comment::write_reproducer): Likewise.
1272 (conditional::write_reproducer): Likewise.
1273 (jump::write_reproducer): Likewise.
1274 (return_::write_reproducer): Likewise.
1275 * jit-recording.h (gcc::jit::reproducer): New forward declararion.
1276 Within namespace ::gcc::jit::recording::...
1277 (context::new_location): Add "created_by_user" param.
1278 (context::dump_reproducer_to_file): New method.
1279 (context::m_toplevel_ctxt): New field.
1280 (memento::write_reproducer): New pure virtual function.
1281 (memento::dyn_cast_location): New virtual function.
1282 (string::write_reproducer):
1283 (location::location): Add "created_by_user" param.
1284 (location::dyn_cast_location): New function.
1285 (location::created_by_user): New accessor.
1286 (location::write_reproducer): New function.
1287 (location::m_created_by_user): New field.
1288 (type::access_as_type): New virtual function.
1289 (location::write_reproducer): Likewise.
1290 (type::access_as_type): Likewise.
1291 (memento_of_get_type::write_reproducer): Likewise.
1292 (memento_of_get_pointer::write_reproducer): Likewise.
1293 (memento_of_get_const::write_reproducer): Likewise.
1294 (memento_of_get_volatile::write_reproducer): Likewise.
1295 (array_type::write_reproducer): Likewise.
1296 (function_type::write_reproducer): Likewise.
1297 (function_type::write_deferred_reproducer): Likewise.
1298 (field::write_reproducer): Likewise.
1299 (struct_::access_as_type): Likewise.
1300 (struct_::write_reproducer): Likewise.
1301 (union_::write_reproducer): Likewise.
1302 (union_::m_fields): Remove stray unused field.
1303 (fields::length): New accessor.
1304 (fields::get_field): New accessor.
1305 (fields::write_reproducer): New function.
1306 (rvalue::access_as_rvalue): Likewise.
1307 (lvalue::access_as_rvalue): Likewise.
1308 (lvalue::access_as_lvalue): Likewise.
1309 (param::access_as_rvalue): Likewise.
1310 (param::access_as_lvalue): Likewise.
1311 (param::write_reproducer): Likewise.
1312 (function::write_reproducer): Likewise.
1313 (block::write_reproducer): Likewise.
1314 (global::write_reproducer): Likewise.
1315 (memento_of_new_rvalue_from_const <HOST_TYPE>::write_reproducer):
1317 (memento_of_new_string_literal::write_reproducer): Likewise.
1318 (unary_op::write_reproducer): Likewise.
1319 (binary_op::write_reproducer): Likewise.
1320 (comparison::write_reproducer): Likewise.
1321 (cast::write_reproducer): Likewise.
1322 (call::write_reproducer): Likewise.
1323 (call_through_ptr::write_reproducer): Likewise.
1324 (array_access::write_reproducer): Likewise.
1325 (access_field_of_lvalue::write_reproducer): Likewise.
1326 (access_field_rvalue::write_reproducer): Likewise.
1327 (dereference_field_rvalue::write_reproducer): Likewise.
1328 (dereference_rvalue::write_reproducer): Likewise.
1329 (get_address_of_lvalue::write_reproducer): Likewise.
1330 (local::write_reproducer): Likewise.
1331 (eval::write_reproducer): Likewise.
1332 (assignment::write_reproducer): Likewise.
1333 (assignment_op::write_reproducer): Likewise.
1334 (comment::write_reproducer): Likewise.
1335 (conditional::write_reproducer): Likewise.
1336 (jump::write_reproducer): Likewise.
1337 (return_::write_reproducer): Likewise.
1338 * libgccjit++.h (gccjit::context::dump_reproducer_to_file): New.
1339 * libgccjit.c (gcc_jit_context_new_location): Pass "true" as
1340 param "created_by_user".
1341 (gcc_jit_context_dump_reproducer_to_file): New API entrypoint.
1342 * libgccjit.h (gcc_jit_context_dump_reproducer_to_file): New API
1344 * libgccjit.map (gcc_jit_context_dump_reproducer_to_file): New API
1347 2015-01-12 David Malcolm <dmalcolm@redhat.com>
1349 * jit-recording.c (class gcc::jit::rvalue_usage_validator): New.
1350 (gcc::jit::rvalue_usage_validator::rvalue_usage_validator): New
1352 (gcc::jit::rvalue_usage_validator::visit): New function.
1353 (gcc::jit::recording::rvalue::verify_valid_within_stmt): New
1355 (gcc::jit::recording::rvalue::set_scope): New function.
1356 (gcc::jit::recording::function::function): Call set_scope on each
1357 param, issuing errors for any params that already have a function.
1358 (gcc::jit::recording::block::add_eval): Return the new statement;
1359 update the comment given that some error-checking now happens after
1361 (gcc::jit::recording::block::add_assignment): Likewise.
1362 (gcc::jit::recording::block::add_assignment_op): Likewise.
1363 (gcc::jit::recording::block::add_comment): Likewise.
1364 (gcc::jit::recording::block::end_with_conditional): Likewise.
1365 (gcc::jit::recording::block::end_with_jump): Likewise.
1366 (gcc::jit::recording::block::end_with_return): Likewise.
1367 (gcc::jit::recording::block::validate): Add a comment.
1368 (gcc::jit::recording::unary_op::visit_children): New function.
1369 (gcc::jit::recording::binary_op::visit_children): New function.
1370 (gcc::jit::recording::comparison::visit_children): New function.
1371 (gcc::jit::recording::cast::visit_children): New function.
1372 (gcc::jit::recording::call::visit_children): New function.
1373 (gcc::jit::recording::call_through_ptr::visit_children): New function.
1374 (gcc::jit::recording::array_access::visit_children): New function.
1375 (gcc::jit::recording::access_field_of_lvalue::visit_children): New
1377 (gcc::jit::recording::access_field_rvalue::visit_children): New
1379 (gcc::jit::recording::dereference_field_rvalue::visit_children):
1381 (gcc::jit::recording::dereference_rvalue::visit_children): New
1383 (gcc::jit::recording::get_address_of_lvalue::visit_children): New
1385 * jit-recording.h: Within namespace gcc::jit::recording...
1386 (class rvalue_visitor): New.
1387 (rvalue::rvalue): Initialize m_scope.
1388 (rvalue::get_loc): New accessor.
1389 (rvalue::verify_valid_within_stmt): New function.
1390 (rvalue::visit_children): New pure virtual function.
1391 (rvalue::set_scope): New function.
1392 (rvalue::get_scope): New function.
1393 (rvalue::dyn_cast_param): New function.
1394 (rvalue::m_scope): New field.
1395 (param::visit_children): New empty function.
1396 (param::dyn_cast_param): New function.
1397 (function::get_loc): New function.
1398 (block::add_eval): Return the new statement.
1399 (block::add_assignment): Likewise.
1400 (block::add_assignment_op): Likewise.
1401 (block::add_comment): Likewise.
1402 (block::end_with_conditional): Likewise.
1403 (block::end_with_jump): Likewise.
1404 (block::end_with_return): Likewise.
1405 (global::visit_children): New function.
1406 (memento_of_new_rvalue_from_const<HOST_TYPE>::visit_children):
1408 (memento_of_new_string_literal::visit_children): New function.
1409 (unary_op::visit_children): New function.
1410 (binary_op::visit_children): New function.
1411 (comparison::visit_children): New function.
1412 (cast::visit_children): New function.
1413 (call::visit_children): New function.
1414 (call_through_ptr::visit_children): New function.
1415 (array_access::visit_children): New function.
1416 (access_field_of_lvalue::visit_children): New function.
1417 (access_field_rvalue::visit_children): New function.
1418 (dereference_field_rvalue::visit_children): New function.
1419 (dereference_rvalue::visit_children): New function.
1420 (get_address_of_lvalue::visit_children): New function.
1421 (local::local): Call set_scope.
1422 (local::visit_children): New function.
1423 (statement::get_block): Make public.
1424 * libgccjit.c (RETURN_VAL_IF_FAIL_PRINTF5): New macro.
1425 (RETURN_NULL_IF_FAIL_PRINTF5): New macro.
1426 (gcc_jit_context_new_function): Verify that each param has
1427 not yet been used for creating another function.
1428 (gcc_jit_block_add_eval): After creating the stmt, verify
1429 that the rvalue expression tree is valid to use within it.
1430 (gcc_jit_block_add_assignment): Likewise for the lvalue and
1431 rvalue expression trees.
1432 (gcc_jit_block_add_assignment_op): Likewise.
1433 (gcc_jit_block_end_with_conditional): Likewise for the boolval
1435 (gcc_jit_block_end_with_return): Likewise for the rvalue
1437 (gcc_jit_block_end_with_void_return): Remove return of "void",
1438 now that block::end_with_return is now non-void.
1440 2015-01-12 David Malcolm <dmalcolm@redhat.com>
1442 * jit-playback.c (gcc::jit::playback::context::read_dump_file):
1443 Add missing fclose on error-handling path.
1445 2015-01-12 David Malcolm <dmalcolm@redhat.com>
1447 * docs/cp/topics/expressions.rst (Global variables): Add
1448 enum gcc_jit_global_kind param to gccjit::context::new_global.
1449 * docs/topics/expressions.rst (Global variables): Likewise.
1450 Document the new enum.
1451 * docs/topics/results.rst (Compilation results): Document
1453 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1454 * dummy-frontend.c (jit_langhook_write_globals): Call into the
1455 playback context's write_global_decls_1 and write_global_decls_2
1456 before and after calling symtab->finalize_compilation_unit ().
1457 * jit-playback.c: Include "debug.h".
1458 (gcc::jit::playback::context::new_global): Add "kind" param and
1459 use it to set TREE_PUBLIC, TREE_STATIC and DECL_EXTERNAL on the
1460 underlying VAR_DECL. Call varpool_node::get_create on the
1461 VAR_DECL, and add it to m_globals.
1462 (gcc::jit::playback::context::write_global_decls_1): New function.
1463 (gcc::jit::playback::context::write_global_decls_2): New function.
1464 * jit-playback.h (gcc::jit::playback::context::context): Call
1465 create on m_globals.
1466 (gcc::jit::playback::context::new_global): Add "kind" param.
1467 (gcc::jit::playback::context::write_global_decls_1): New function.
1468 (gcc::jit::playback::context::write_global_decls_2): New function.
1469 (gcc::jit::playback::context::m_globals): New field.
1470 * jit-recording.c (gcc::jit::recording::context::context):
1471 Initialize m_globals.
1472 (gcc::jit::recording::context::new_global): Add param "kind".
1473 Add the new global to m_globals.
1474 (gcc::jit::recording::context::dump_to_file): Dump the globals.
1475 (gcc::jit::recording::global::replay_into): Add field m_kind.
1476 (gcc::jit::recording::global::write_to_dump): New override.
1477 * jit-recording.h (gcc::jit::recording::context::new_global): Add
1479 (gcc::jit::recording::context::m_globals): New field.
1480 (gcc::jit::recording::global::global): Add param kind.
1481 (gcc::jit::recording::global::write_to_dump): New override.
1482 (gcc::jit::recording::global::m_kind): New field.
1483 * jit-result.c (gcc::jit::result::get_global): New function.
1484 * jit-result.h (gcc::jit::result::get_global): New function.
1485 * libgccjit++.h (gccjit::context::new_global): Add "kind" param.
1486 * libgccjit.c (gcc_jit_context_new_global): Likewise.
1487 (gcc_jit_result_get_global): New API entrypoint.
1488 * libgccjit.h (gcc_jit_result_get_global): New API entrypoint.
1489 (enum gcc_jit_global_kind): New enum.
1490 (gcc_jit_context_new_global): API change: add "kind" param.
1491 * libgccjit.map (gcc_jit_result_get_global): New symbol.
1493 2015-01-09 David Malcolm <dmalcolm@redhat.com>
1495 * dummy-frontend.c: Include "fixed-value.h", "alias.h", "flags.h",
1496 "symtab.h", "inchash.h". Move include of "hash-set.h" much
1498 * jit-builtins.c: Remove redundant includes of "opts.h" and
1500 * jit-common.h: Include "hash-set.h", "input.h", "vec.h",
1501 "double-int.h", "alias.h", "flags.h", "symtab.h", "inchash.h".
1502 * jit-playback.c: Include "hashtab.h", "machmode.h", "input.h",
1503 "statistics.h", "vec.h", "double-int.h", "real.h",
1504 "fixed-value.h", "alias.h", "flags.h", "symtab.h", "tree-core.h",
1505 "inchash.h", "fold-const.h". Move include of "hash-set.h" to
1507 * jit-recording.c: Remove redundant includes of "opts.h" and
1510 2015-01-09 David Malcolm <dmalcolm@redhat.com>
1512 * docs/cp/topics/expressions.rst (Simple expressions): Use
1513 ":c:type:" for C types. Document new overload of
1514 gcc::jit::context::new_rvalue.
1515 * docs/topics/expressions.rst (Simple expressions): Use
1516 ":c:type:" for C types. Document new entrypoint
1517 gcc_jit_context_new_rvalue_from_long.
1518 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1519 * jit-playback.c: Within namespace gcc::jit::playback...
1520 (context::new_rvalue_from_int): Eliminate in favor of...
1521 (context::new_rvalue_from_const <int>): ...this.
1522 (context::new_rvalue_from_double): Eliminate in favor of...
1523 (context::new_rvalue_from_const <double>): ...this.
1524 (context::new_rvalue_from_const <long>): New.
1525 (context::new_rvalue_from_ptr): Eliminate in favor of...
1526 (context::new_rvalue_from_const <void *>): ...this.
1527 * jit-playback.h: Within namespace gcc::jit::playback...
1528 (context::new_rvalue_from_int): Eliminate in favor of...
1529 (context::new_rvalue_from_const <HOST_TYPE>): ...this.
1530 (context::new_rvalue_from_double): Likewise.
1531 (context::new_rvalue_from_ptr): Likewise.
1532 * jit-recording.c: Within namespace gcc::jit::recording...
1533 (context::new_rvalue_from_int): Eliminate.
1534 (context::new_rvalue_from_double): Likewise.
1535 (context::new_rvalue_from_ptr): Likewise.
1536 (class memento_of_new_rvalue_from_const <int>):
1537 Add explicit specialization.
1538 (class memento_of_new_rvalue_from_const <long>):
1540 (class memento_of_new_rvalue_from_const <double>):
1542 (class memento_of_new_rvalue_from_const <void *>):
1544 (memento_of_new_rvalue_from_int::replay_into):
1546 (memento_of_new_rvalue_from_const <HOST_TYPE>::replay_into):
1548 (memento_of_new_rvalue_from_double::replay_into):
1550 (memento_of_new_rvalue_from_ptr::replay_into):
1551 ...and this to be deleted.
1552 (memento_of_new_rvalue_from_int::make_debug_string):
1554 (memento_of_new_rvalue_from_const <int>::make_debug_string):
1556 (memento_of_new_rvalue_from_double::make_debug_string):
1558 (memento_of_new_rvalue_from_const <double>::make_debug_string):
1560 (memento_of_new_rvalue_from_ptr::make_debug_string)
1562 (memento_of_new_rvalue_from_const <void *>::make_debug_string):
1564 (memento_of_new_rvalue_from_const <long>::make_debug_string):
1566 * jit-recording.h: Within namespace gcc::jit::recording...
1567 (context::new_rvalue_from_int): Eliminate.
1568 (context::new_rvalue_from_double): Likewise.
1569 (context::new_rvalue_from_ptr): Likewise, all in favor of...
1570 (context::new_rvalue_from_const <HOST_TYPE>): New family of
1572 (class memento_of_new_rvalue_from_int): Eliminate.
1573 (class memento_of_new_rvalue_from_double): Likewise.
1574 (class memento_of_new_rvalue_from_ptr): Likewise.
1575 (class memento_of_new_rvalue_from_const <HOST_TYPE>): New family
1576 of rvalue subclasses.
1577 * libgccjit++.h (gccjit::context::new_rvalue): New overload, for
1579 * libgccjit.c (gcc_jit_context_new_rvalue_from_int): Update for
1580 rewriting of recording::context::new_rvalue_from_int to
1581 recording::context::new_rvalue_from_const <int>.
1582 (gcc_jit_context_new_rvalue_from_long): New API entrypoint.
1583 (gcc_jit_context_new_rvalue_from_double): Update for
1584 rewriting of recording::context::new_rvalue_from_double to
1585 recording::context::new_rvalue_from_const <double>.
1586 (gcc_jit_context_new_rvalue_from_ptr): Update for
1587 rewriting of recording::context::new_rvalue_from_ptr to
1588 recording::context::new_rvalue_from_const <void *>.
1589 * libgccjit.h (gcc_jit_context_new_rvalue_from_long): New API
1591 * libgccjit.map (gcc_jit_context_new_rvalue_from_long): Likewise.
1593 2015-01-09 David Malcolm <dmalcolm@redhat.com>
1596 * docs/internals/test-hello-world.exe.log.txt: Update, the log now
1597 shows tempdir creation/cleanup.
1598 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1599 * jit-logging.h (class gcc::jit::log_user): Add gcc::jit::tempdir
1600 to the list of subclasses in the comment.
1601 * jit-playback.c (gcc::jit::playback::context::context): Add a
1602 comment clarifying when the tempdir gets cleaned up.
1603 (gcc::jit::playback::context::compile): Pass the context's logger,
1604 if any, to the tempdir.
1605 (gcc::jit::playback::context::dlopen_built_dso): When creating the
1606 gcc::jit::result, if GCC_JIT_BOOL_OPTION_DEBUGINFO is set, hand
1607 over ownership of the tempdir to it.
1608 * jit-result.c: Include "jit-tempdir.h".
1609 (gcc::jit::result::result): Add tempdir param, saving it as
1611 (gcc::jit::result::~result): Delete m_tempdir.
1612 * jit-result.h (gcc::jit::result::result): Add tempdir param.
1613 (gcc::jit::result::m_tempdir): New field.
1614 * jit-tempdir.c (gcc::jit::tempdir::tempdir): Add logger param;
1616 (gcc::jit::tempdir::create): Add JIT_LOG_SCOPE to log entry/exit,
1617 and log m_path_template and m_path_tempdir.
1618 (gcc::jit::tempdir::~tempdir): Add JIT_LOG_SCOPE to log
1619 entry/exit, and log the unlink and rmdir calls.
1620 * jit-tempdir.h: Include "jit-logging.h".
1621 (class gcc::jit::tempdir): Make this be a subclass of log_user.
1622 (gcc::jit::tempdir::tempdir): Add logger param.
1623 * notes.txt: Update to show the two possible places where the
1624 tempdir can be cleaned up.
1626 2015-01-08 David Malcolm <dmalcolm@redhat.com>
1628 * libgccjit.h (struct gcc_jit_context): Rewrite the descriptive
1631 2015-01-08 David Malcolm <dmalcolm@redhat.com>
1633 * docs/topics/contexts.rst (Error-handling): Document new
1634 entrypoint gcc_jit_context_get_last_error.
1635 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1636 * jit-recording.c (gcc::jit::recording::context::context):
1637 Initialize new fields "m_last_error_str" and
1638 "m_owns_last_error_str".
1639 (gcc::jit::recording::context::~context): Clean up
1640 m_last_error_str, if needed.
1641 (gcc::jit::recording::context::add_error_va): Update
1642 m_last_error_str and m_owns_last_error_str, freeing the old
1643 value if appropriate.
1644 (gcc::jit::recording::context::get_last_error): New function.
1645 * jit-recording.h (gcc::jit::recording::context::get_last_error):
1647 (gcc::jit::recording::context): New fields m_last_error_str and
1648 m_owns_last_error_str.
1649 * libgccjit.c (gcc_jit_context_get_last_error): New function.
1650 * libgccjit.h (gcc_jit_context_get_last_error): New declaration.
1651 * libgccjit.map (gcc_jit_context_get_last_error): New function.
1653 2015-01-08 David Malcolm <dmalcolm@redhat.com>
1655 * Make-lang.in (jit_OBJS): Add jit/jit-logging.o.
1656 * docs/internals/index.rst (Overview of code structure): Mention
1657 gcc_jit_context_set_logfile, and embed the example logfile.
1658 * docs/internals/test-hello-world.exe.log.txt: New file: example
1660 * docs/topics/contexts.rst (Debugging): Add documentation
1661 for gcc_jit_context_set_logfile.
1662 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1663 * dummy-frontend.c: Include "jit-logging.h".
1664 (jit_langhook_init): Assert that there is an active playback
1665 context. If it has a logger, log entry/exit to this function.
1666 (jit_langhook_write_globals): Likewise.
1667 * jit-common.h (gcc::jit::logger): New forward declaration.
1668 * jit-logging.c: New file.
1669 * jit-logging.h: New file.
1670 * jit-playback.c: Include "jit-logging.h".
1671 (gcc::jit::playback::context::context): Initialize the log_user
1672 base class from the recording context's logger (if any). Use
1673 JIT_LOG_SCOPE to log entry/exit from the function body.
1674 (gcc::jit::playback::context::~context): Use JIT_LOG_SCOPE to
1675 log entry/exit from the function body.
1676 (gcc::jit::playback::build_stmt_list): Likewise.
1677 (gcc::jit::playback::function::postprocess): Likewise.
1678 (gcc::jit::playback::context::compile): Likewise. Log the
1679 entry/exit to toplev::main and toplev::finalize. Log the
1680 fake argv passed to toplev::main.
1681 (gcc::jit::playback::context::acquire_mutex): Use JIT_LOG_SCOPE to
1682 log entry/exit from the function body.
1683 (gcc::jit::playback::context::release_mutex): Likewise.
1684 (gcc::jit::playback::context::make_fake_args): Likewise.
1685 (gcc::jit::playback::context::extract_any_requested_dumps):
1687 (gcc::jit::playback::context::convert_to_dso): Likewise. Also,
1688 log the arguments that the driver is invoked with.
1689 (gcc::jit::playback::context::dlopen_built_dso): Likewise. Pass
1690 the logger to the result object.
1691 (gcc::jit::playback::context::replay): Use JIT_LOG_SCOPE to
1692 log entry/exit from the function body.
1693 (gcc::jit::playback::context::dump_generated_code): Likewise.
1694 (gcc::jit::playback::context::handle_locations): Likewise.
1695 * jit-playback.h (gcc::jit::playback::context): Make this be
1696 a subclass of gcc::jit::log_user.
1697 * jit-recording.c: Include "jit-logging.h".
1698 (gcc::jit::recording::context::context: Initialize the logger to
1699 NULL for root contexts, or to the parent's logger for child
1701 (gcc::jit::recording::context::~context): Use JIT_LOG_SCOPE to
1702 log entry/exit from the function body.
1703 (gcc::jit::recording::context::replay_into): Likewise.
1704 (gcc::jit::recording::context::disassociate_from_playback):
1706 (gcc::jit::recording::context::compile): Likewise.
1707 (recording::context::add_error_va): Likewise. Also, log the
1709 (gcc::jit::recording::context::validate): Use JIT_LOG_SCOPE to
1710 log entry/exit from the function body.
1711 * jit-recording.h: Include "jit-logging.h".
1712 (gcc::jit::recording::context): Make this be a subclass of
1714 * jit-result.c: Include "jit-common.h" and "jit-logging.h".
1715 (gcc::jit::result::result): Add logger param, recording it.
1716 Use JIT_LOG_SCOPE to log entry/exit from the function body.
1717 (gcc::jit::result::~result(): Use JIT_LOG_SCOPE to
1718 log entry/exit from the function body.
1719 (gcc::jit::result::get_code): Likewise.
1720 * jit-result.h (gcc::jit::result): Make this be a subclass of
1722 (gcc::jit::result::result): Add logger parameter.
1723 * libgccjit++.h (gccjit::context::set_logfile): New function.
1724 * libgccjit.c: Include "jit-logging.h".
1725 (gcc_jit_context_acquire): Log the context.
1726 (gcc_jit_context_release): Use JIT_LOG_FUNC to
1727 log entry/exit from the function body, and log the context.
1728 (gcc_jit_context_new_child_context): Likewise, logging both
1730 (gcc_jit_context_new_location): Use JIT_LOG_FUNC to
1731 log entry/exit from the function body.
1732 (gcc_jit_context_get_type): Likewise.
1733 (gcc_jit_context_get_int_type): Likewise.
1734 (gcc_jit_context_new_array_type): Likewise.
1735 (gcc_jit_context_new_field): Likewise.
1736 (gcc_jit_context_new_struct_type): Likewise.
1737 (gcc_jit_context_new_opaque_struct): Likewise.
1738 (gcc_jit_struct_set_fields): Likewise.
1739 (gcc_jit_context_new_union_type): Likewise.
1740 (gcc_jit_context_new_function_ptr_type): Likewise.
1741 (gcc_jit_context_new_param): Likewise.
1742 (gcc_jit_context_new_function): Likewise.
1743 (gcc_jit_context_get_builtin_function): Likewise.
1744 (gcc_jit_function_get_param): Likewise.
1745 (gcc_jit_function_dump_to_dot): Likewise.
1746 (gcc_jit_function_new_block): Likewise.
1747 (gcc_jit_context_new_global): Likewise.
1748 (gcc_jit_context_new_rvalue_from_int): Likewise.
1749 (gcc_jit_context_zero): Likewise.
1750 (gcc_jit_context_one): Likewise.
1751 (gcc_jit_context_new_rvalue_from_double): Likewise.
1752 (gcc_jit_context_new_rvalue_from_ptr): Likewise.
1753 (gcc_jit_context_null): Likewise.
1754 (gcc_jit_context_new_string_literal): Likewise.
1755 (gcc_jit_context_new_unary_op): Likewise.
1756 (gcc_jit_context_new_binary_op): Likewise.
1757 (gcc_jit_context_new_comparison): Likewise.
1758 (gcc_jit_context_new_call): Likewise.
1759 (gcc_jit_context_new_call_through_ptr): Likewise.
1760 (gcc_jit_context_new_cast): Likewise.
1761 (gcc_jit_context_new_array_access): Likewise.
1762 (gcc_jit_lvalue_access_field): Likewise.
1763 (gcc_jit_rvalue_access_field): Likewise.
1764 (gcc_jit_rvalue_dereference_field): Likewise.
1765 (gcc_jit_rvalue_dereference): Likewise.
1766 (gcc_jit_lvalue_get_address): Likewise.
1767 (gcc_jit_function_new_local): Likewise.
1768 (gcc_jit_block_add_eval): Likewise.
1769 (gcc_jit_block_add_assignment): Likewise.
1770 (gcc_jit_block_add_assignment_op): Likewise.
1771 (gcc_jit_block_end_with_conditional): Likewise.
1772 (gcc_jit_block_add_comment): Likewise.
1773 (gcc_jit_block_end_with_jump): Likewise.
1774 (gcc_jit_block_end_with_return): Likewise.
1775 (gcc_jit_block_end_with_void_return): Likewise.
1776 (gcc_jit_context_set_str_option): Likewise.
1777 (gcc_jit_context_set_int_option): Likewise.
1778 (gcc_jit_context_set_bool_option): Likewise.
1779 (gcc_jit_context_enable_dump): Likewise.
1780 (gcc_jit_context_compile): Likewise. Also log the context,
1782 (gcc_jit_context_dump_to_file): Likewise.
1783 (gcc_jit_context_set_logfile): New function.
1784 (gcc_jit_context_get_first_error): Use JIT_LOG_FUNC to
1785 log entry/exit from the function body.
1786 (gcc_jit_result_get_code): Likewise. Also log the fnname)
1787 and the ptr to be returned.
1788 (gcc_jit_result_release): Likewise. Also log the result.
1789 * libgccjit.h: Include <stdio.h>, since we need FILE *.
1790 (gcc_jit_context_set_logfile): New declaration.
1791 * libgccjit.map (gcc_jit_context_set_logfile): New.
1793 2015-01-07 David Malcolm <dmalcolm@redhat.com>
1795 * jit-recording.h (gcc::jit::recording::type::is_void): New
1797 (gcc::jit::recording::memento_of_get_type::is_void): New
1798 function, overriding default implementation.
1799 * libgccjit.c (gcc_jit_rvalue_dereference): Verify that
1800 the underlying type is not "void".
1802 2015-01-07 David Malcolm <dmalcolm@redhat.com>
1804 * docs/topics/expressions.rst (Unary Operations): Add
1805 GCC_JIT_UNARY_OP_ABS.
1806 * jit-playback.c (gcc::jit::playback::context::new_unary_op):
1808 * jit-recording.c (unary_op_strings): Likewise.
1809 * libgccjit.c (gcc_jit_context_new_unary_op): Update checking
1810 of "op" to reflect addition of GCC_JIT_UNARY_OP_ABS.
1811 * libgccjit.h (enum gcc_jit_unary_op): Add GCC_JIT_UNARY_OP_ABS.
1812 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1814 2015-01-07 David Malcolm <dmalcolm@redhat.com>
1816 * jit-recording.h (gcc::jit::recording::memento_of_get_type): Fix
1819 2015-01-07 David Malcolm <dmalcolm@redhat.com>
1821 * TODO.rst (Test suite): Remove item about running C++ testcases.
1822 * docs/internals/index.rst (Working on the JIT library): Add
1823 "c++" to the enabled languages in the suggested "configure"
1824 invocation, and add a description of why this is necessary.
1825 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1827 2015-01-07 David Malcolm <dmalcolm@redhat.com>
1829 * docs/internals/index.rst: Update to reflect that built
1830 testcases are now test-foo.c.exe, rather than test-foo.exe.
1831 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1833 2015-01-05 Jakub Jelinek <jakub@redhat.com>
1835 Update copyright years.
1837 2014-12-19 David Malcolm <dmalcolm@redhat.com>
1839 * jit-playback.c (gcc::jit::playback::context::build_cast): In
1840 case BOOLEAN_TYPE, don't assume that the source expression is
1843 2014-12-19 David Malcolm <dmalcolm@redhat.com>
1845 * jit-recording.c (gcc::jit::recording::context::context): When
1846 copying string options from a parent context, take a copy of the
1847 underlying buffers, rather than simply copying the pointer.
1849 2014-12-19 David Malcolm <dmalcolm@redhat.com>
1851 * jit-recording.c (gcc::jit::recording::context::set_str_option):
1854 2014-12-11 David Malcolm <dmalcolm@redhat.com>
1856 * docs/cp/topics/contexts.rst (gccjit::context::set_str_option):
1857 Document new function.
1858 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1860 2014-12-10 Ulrich Drepper <drepper@gmail.com>
1862 Minor interface cleanups of libgccjit
1863 * jit-playback.c (convert_to_dso): Use auto_vec instead
1864 of automatic array to build up command line.
1865 * jit-recording.c (recording::context::set_str_option):
1866 Make copy of the string.
1867 (recording::context::~context): Free string options.
1868 * jit-recording.h (recording::context): Adjust type
1869 of m_str_options member.
1870 * libgccjit.h: Adjust comment about
1871 gcc_jit_context_set_str_option parameter being used after
1873 Update comment now that all interfaces are copy strings
1875 * libgccjit++.h (gccjit::context): Add set_str_option
1878 2014-12-10 David Malcolm <dmalcolm@redhat.com>
1880 * docs/cp/index.rst: New file.
1881 * docs/cp/intro/index.rst: New file.
1882 * docs/cp/intro/tutorial01.rst: New file.
1883 * docs/cp/intro/tutorial02.rst: New file.
1884 * docs/cp/intro/tutorial03.rst: New file.
1885 * docs/cp/intro/tutorial04.rst: New file.
1886 * docs/cp/topics/contexts.rst: New file.
1887 * docs/cp/topics/expressions.rst: New file.
1888 * docs/cp/topics/functions.rst: New file.
1889 * docs/cp/topics/index.rst: New file.
1890 * docs/cp/topics/locations.rst: New file.
1891 * docs/cp/topics/objects.rst: New file.
1892 * docs/cp/topics/results.rst: New file.
1893 * docs/cp/topics/types.rst: New file.
1894 * docs/examples/tut01-hello-world.cc: New file.
1895 * docs/examples/tut02-square.c: Fix missing newline in output.
1896 * docs/examples/tut02-square.cc: New file.
1897 * docs/examples/tut03-sum-of-squares.cc: New file.
1898 * docs/examples/tut04-toyvm/toyvm.cc: New file.
1899 * docs/index.rst: Move summary to above the table of contents.
1900 Add text about the C vs C++ APIs.
1901 * docs/topics/contexts.rst: Fix a typo.
1903 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1904 * docs/_build/texinfo/factorial1.png: New file.
1905 * docs/_build/texinfo/sum-of-squares1.png: New file.
1907 2014-12-09 David Malcolm <dmalcolm@redhat.com>
1909 * docs/examples/tut04-toyvm/toyvm.c (toyvm_function_compile): Move
1910 logic for determine "funcname" to new function...
1911 (get_function_name): ...here, adding logic to skip any leading
1912 path from the filename.
1913 (toyvm_function_parse): Use the filename for fn_filename, rather
1914 than "name", so that the debugger can locate the source .toy
1916 (toyvm_function_parse): Don't fclose a NULL FILE *.
1918 2014-12-09 David Malcolm <dmalcolm@redhat.com>
1921 * docs/internals/index.rst (Running under valgrind): New
1923 (docs/_build/texinfo/libgccjit.texi): Regenerate.
1925 2014-12-09 David Malcolm <dmalcolm@redhat.com>
1928 * Make-lang.in (jit_OBJS): Add jit/jit-tempdir.o.
1929 * jit-common.h (gcc::jit::tempdir): New forward decl.
1930 * jit-playback.c: Include jit-tempdir.h.
1931 (gcc::jit::playback::context::context): Initialize m_tempdir.
1932 (gcc::jit::playback::context::~context): Move tempdir
1933 cleanup to new file jit-tempdir.c
1934 (make_tempdir_path_template): Move to new file jit-tempdir.c.
1935 (gcc::jit::playback::context::compile): Move tempdir creation
1936 to new tempdir object in new file jit-tempdir.c.
1937 (gcc::jit::playback::context::make_fake_args): Get path from
1938 tempdir object rather than from member data.
1939 (gcc::jit::playback::context::convert_to_dso): Likewise.
1940 (gcc::jit::playback::context::dlopen_built_dso): Likewise.
1941 (gcc::jit::playback::context::dump_generated_code): Likewise.
1942 (gcc::jit::playback::context::get_path_c_file): New function.
1943 (gcc::jit::playback::context::get_path_s_file): New function.
1944 (gcc::jit::playback::context::get_path_so_file): New function.
1945 * jit-playback.h (gcc::jit::playback::context::get_path_c_file):
1947 (gcc::jit::playback::context::get_path_s_file): New function.
1948 (gcc::jit::playback::context::get_path_so_file): New function.
1949 (gcc::jit::playback::context): Move fields "m_path_template",
1950 "m_path_tempdir", "m_path_c_file", "m_path_s_file",
1951 "m_path_so_file" to new jit::tempdir class; add field "m_tempdir".
1952 * jit-tempdir.c: New file.
1953 * jit-tempdir.h: New file.
1955 2014-12-09 David Malcolm <dmalcolm@redhat.com>
1957 * jit-playback.c (gcc::jit::playback::context::compile): Acquire the
1958 mutex here, immediately before using toplev, and release it here, on
1959 each exit path after acquisition.
1960 (jit_mutex): Move this variable here, from jit-recording.c.
1961 (gcc::jit::playback::context::acquire_mutex): New function, based on
1962 code in jit-recording.c.
1963 (gcc::jit::playback::context::release_mutex): Likewise.
1964 * jit-playback.h (gcc::jit::playback::context::acquire_mutex): New
1966 (gcc::jit::playback::context::release_mutex): New function.
1967 * jit-recording.c (jit_mutex): Move this variable to jit-playback.c.
1968 (gcc::jit::recording::context::compile): Move mutex-handling from
1969 here into jit-playback.c's gcc::jit::playback::context::compile.
1970 * notes.txt: Update to show the new locations of ACQUIRE_MUTEX
1973 2014-12-09 David Malcolm <dmalcolm@redhat.com>
1975 * jit-playback.c (gcc::jit::playback::context::compile): Move the
1977 (gcc::jit::playback::context::dlopen_built_dso): ...this new
1979 * jit-playback.h (gcc::jit::playback::context::dlopen_built_dso):
1982 2014-12-09 David Malcolm <dmalcolm@redhat.com>
1985 * docs/topics/contexts.rst (Debugging): Add description of
1986 gcc_jit_context_enable_dump.
1987 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1988 * jit-playback.c: Include context.h.
1989 (class auto_argvec): New class.
1990 (auto_argvec::~auto_argvec): New function.
1991 (gcc::jit::playback::context::compile): Convert fake_args to be
1992 an auto_argvec, so that it can contain dynamically-allocated
1993 strings. Construct a vec of all requested dumps, and pass it to
1994 make_fake_args. Extract requested dumps between the calls to
1995 toplev::main and toplev::finalize.
1996 (gcc::jit::playback::context::make_fake_args): Convert param
1997 "argvec" to be a vec <char *>, and gain a "requested_dumps"
1998 param. Convert to dynamically-allocated arg strings by converting
1999 ADD_ARG to take a copy of the arg, and add ADD_ARG_TAKE_OWNERSHIP
2000 for args that are already a copy. Add args for all requested dumps.
2001 (gcc::jit::playback::context::extract_any_requested_dumps): New
2003 (gcc::jit::playback::context::read_dump_file): New function.
2004 * jit-playback.h (gcc::jit::playback::context::make_fake_args):
2005 Convert param "argvec" to be a vec <char *>, and gain a
2006 "requested_dumps" param.
2007 (gcc::jit::playback::context::extract_any_requested_dumps): New
2009 (gcc::jit::playback::context::read_dump_file): New function.
2010 * jit-recording.c (gcc::jit::recording::context::enable_dump): New
2012 (gcc::jit::recording::context::get_all_requested_dumps): New
2014 * jit-recording.h (gcc::jit::recording::requested_dump): New
2016 (gcc::jit::recording::context::enable_dump): New function.
2017 (gcc::jit::recording::context::get_all_requested_dumps): New
2019 (gcc::jit::recording::context::m_requested_dumps): New field.
2020 * libgccjit.c (gcc_jit_context_enable_dump): New API entrypoint.
2021 * libgccjit.h (gcc_jit_context_enable_dump): New API entrypoint.
2022 * libgccjit.map (gcc_jit_context_enable_dump): New API entrypoint.
2024 2014-12-08 David Malcolm <dmalcolm@redhat.com>
2026 * libgccjit++.h: Indent the forward declarations of the classes to
2027 show the inheritance hierarchy.
2029 2014-12-08 David Malcolm <dmalcolm@redhat.com>
2031 * notes.txt: Show the beginning and ending of
2032 recording::context::compile vs playback::context::compile. Show
2033 the creation and unlinking of the tempdir. Show toplev::finalize.
2034 Move "RELEASE MUTEX" to the correct location. Show
2035 gcc_jit_result_release, and indicate where the
2036 dlopen/dlsym/dlclose occur.
2038 2014-12-01 David Malcolm <dmalcolm@redhat.com>
2040 * docs/examples/tut02-square.c (main): Release the context
2041 earlier, to show that this is possible. Update error-handling
2042 to avoid a double-release of the context, and to avoid
2043 releasing a NULL result.
2044 * docs/intro/tutorial02.rst: Discuss gcc_jit_context_release.
2045 * docs/topics/functions.rst (GCC_JIT_FUNCTION_EXPORTED): Emphasize
2046 * docs/topics/results.rst (gcc_jit_result): Mention that this
2047 controls the lifetimes of machine code functions.
2048 (gcc_jit_result_get_code): Spell out the requirements for this
2049 to succeed, and the lifetime of the result.
2050 (gcc_jit_result_release): Mention that this invalidates any code
2051 that was obtained from the result.
2052 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2054 2014-12-01 David Malcolm <dmalcolm@redhat.com>
2057 * docs/intro/tutorial02.rst: Spell out lifetime of generated code.
2058 Add description of error-handling, taken in part from...
2059 * docs/topics/contexts.rst (Error-handling): Expand, and move some
2060 content to tutorial02.rst.
2061 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2063 2014-12-01 David Malcolm <dmalcolm@redhat.com>
2066 * docs/topics/types.rst (Standard types) Add new enum values to
2067 the table of enum gcc_jit_types: GCC_JIT_TYPE_COMPLEX_FLOAT,
2068 GCC_JIT_TYPE_COMPLEX_DOUBLE, GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE.
2069 Widen the left-hand column so that
2070 GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE will fit.
2071 * docs/_build/texinfo/libgccjit.texi: Regenerate.
2073 * jit-builtins.c: Include stringpool.h and jit-playback.h.
2074 Move everything out of the gcc::jit::recording namespace into
2076 (struct builtin_data): Add fields "fnclass", "attr", and
2078 (DEF_BUILTIN): Update macro so populate the new fields.
2079 (builtins_manager::builtins_manager): Update for move out of
2080 recording namespace. Initialize the m_attributes array.
2081 (builtins_manager::get_builtin_function): Likewise.
2082 (builtins_manager::get_builtin_function_by_id): New function.
2083 (builtins_manager::make_builtin_function): Update for move out of
2084 recording namespace. Add fix for PR jit/64020 by detecting
2085 specific builtin ids and having them ensure that builtins for
2086 other ids are created as necessary.
2087 (builtins_manager::get_type): Update for move out of recording
2089 (builtins_manager::make_type): Likewise. Add some missing
2091 (builtins_manager::make_primitive_type): Update for move out of
2092 recording namespace. Implement the three BT_COMPLEX_ cases and
2094 (builtins_manager::make_fn_type): Update for move out of recording
2096 (builtins_manager::make_ptr_type): Likewise.
2097 (builtins_manager::finish_playback): New function.
2098 (builtins_manager::get_class): New function.
2099 (builtins_manager::implicit_p): New function.
2100 (builtins_manager::get_attrs_tree): Two new functions.
2101 (builtins_manager::make_attrs_tree): New function.
2103 * jit-builtins.h: Move everything out of the gcc::jit::recording
2104 namespace into just gcc::jit.
2105 (enum built_in_attribute): New.
2106 (builtins_manager::builtins_manager): Update decl for namespace
2108 (builtins_manager::get_builtin_function): Likewise.
2109 (builtins_manager::get_class): New.
2110 (builtins_manager::implicit_p): New.
2111 (builtins_manager::get_attrs_tree): Two new functions.
2112 (builtins_manager::make_attrs_tree): New function.
2113 (builtins_manager::finish_playback): New.
2114 (builtins_manager::get_builtin_function_by_id): New.
2115 (builtins_manager::make_builtin_function): Update decl for
2117 (builtins_manager::get_type): Likewise.
2118 (builtins_manager::make_type): Likewise.
2119 (builtins_manager::make_primitive_type): Likewise.
2120 (builtins_manager::make_fn_type): Likewise.
2121 (builtins_manager::make_ptr_type): Likewise.
2122 (builtins_manager): Likewise for fields. Add new field
2125 * jit-common.h (NUM_GCC_JIT_TYPES): Update.
2126 (builtins_manager): Update forward decl to reflect namespace
2129 * jit-playback.c: Include attribs.h and jit-builtins.h.
2130 (gcc::jit::playback::context::get_tree_node_for_type): Add cases
2131 for the new COMPLEX_ types.
2132 (gcc::jit::playback::context::new_function): If creating a
2133 builtin, set the DECL_BUILT_IN_CLASS and attributes on the fndecl,
2134 and call set_builtin_decl.
2135 (gcc::jit::playback::context::replay): If we have a
2136 builtins_manager, call its finish_playback method when we're done.
2139 (gcc::jit::playback::context::get_builtins_manager): New function.
2142 (gcc::jit::recording::context::get_builtins_manager): New function.
2143 (gcc::jit::recording::get_builtin_function): Use
2144 get_builtins_manager, in case we're a child context.
2145 (gcc::jit::recording::memento_of_get_type::dereference): Add the
2147 (gcc::jit::recording::memento_of_get_type::is_int): Likewise.
2148 (gcc::jit::recording::memento_of_get_type::is_float): Likewise.
2149 (gcc::jit::recording::memento_of_get_type::is_bool): Likewise.
2150 (get_type_strings): Likewise.
2153 (gcc::jit::recording::context::get_builtins_manager): New.
2155 * libgccjit.h (enum gcc_jit_types): Add
2156 GCC_JIT_TYPE_COMPLEX_FLOAT, GCC_JIT_TYPE_COMPLEX_DOUBLE,
2157 GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE.
2159 2014-12-01 David Malcolm <dmalcolm@redhat.com>
2162 (gcc::jit::recording::builtins_manager::get_builtin_function):
2163 Check for NULL return from make_builtin_function.
2164 (gcc::jit::recording::builtins_manager::make_builtin_function):
2165 Check for NULL return from get_type.
2167 2014-12-01 David Malcolm <dmalcolm@redhat.com>
2169 * jit-playback.c (gcc::jit::playback::context::compile): Move DSO
2170 creation code into...
2171 (gcc::jit::playback::context::convert_to_dso): New function.
2172 * jit-playback.h (gcc::jit::playback::context::convert_to_dso):
2175 2014-12-01 David Malcolm <dmalcolm@redhat.com>
2177 * jit-playback.c (gcc::jit::playback::context::compile): Use an
2178 auto_vec<const char *> rather than a const char *[20] for the
2179 top-level argv, and move the logic to build it to...
2180 (gcc::jit::playback::context::make_fake_args): New function.
2181 * jit-playback.h (gcc::jit::playback::context::make_fake_args):
2184 2014-12-01 David Malcolm <dmalcolm@redhat.com>
2186 * Make-lang.in (jit_OBJS): Add jit/jit-result.o.
2187 * jit-playback.c: Include new header jit-result.h.
2188 (gcc::jit::result::result): Move to new file jit-result.c.
2189 (gcc::jit::result::~result): Likewise.
2190 (gcc::jit::playback::result): Likewise.
2191 * jit-recording.h (class gcc::jit::result): Move to new
2192 header jit-result.h.
2193 * jit-result.c: New file, to contain...
2194 (gcc::jit::result::result): Move here from jit-playback.c,
2195 removing erroneous "playback" namespace from comment.
2196 (gcc::jit::result::~result): Likewise.
2197 (gcc::jit::playback::result): Likewise.
2198 * jit-result.h: New file, to contain...
2199 (class gcc::jit::result): Move from jit-recording.h.
2200 * libgccjit.c: Include jit-result.h.
2201 (gcc_jit_result_get_code): Update comment to reflect move
2203 (gcc_jit_result_release): Likewise.
2205 2014-12-01 David Malcolm <dmalcolm@redhat.com>
2208 * docs/examples/tut04-toyvm/toyvm.c
2209 (toyvm_compiled_function): New typedef.
2210 (toyvm_compiled_func) Rename to...
2211 (toyvm_compiled_code) ...this.
2212 (struct toyvm_compiled_function): New struct.
2213 (toyvm_function_compile): Return a toyvm_compiled_function *
2214 rather than a toyvm_compiled_func, so that the caller can fully
2215 clean things up. Free "funcname".
2216 (test_script): Update for change to toyvm_function_compile.
2217 Clean up the toyvm_compiled_function.
2219 (docs/intro/tutorial04.rst): Update to reflect the above changes,
2220 and to better spell out the lifetime of the compiled code.
2222 2014-12-01 David Malcolm <dmalcolm@redhat.com>
2226 (gcc::jit::recording::builtins_manager::make_fn_type): Call the
2227 context's new_function_type method, rather than directly creating
2228 a function_type instance.
2230 (gcc::jit::recording::context::new_function_type): New method,
2231 adapted from part of...
2232 (gcc::jit::recording::context::new_function_ptr_type): ...this.
2233 Update to call new_function_type.
2235 (gcc::jit::recording::context::new_function_type): New method.
2237 2014-12-01 David Malcolm <dmalcolm@redhat.com>
2240 * jit-playback.c: Ensure that ctxt_progname is non-NULL.
2242 2014-11-19 David Malcolm <dmalcolm@redhat.com>
2245 * jit-playback.c (gcc::jit::playback::compound_type::set_fields):
2246 Convert param from const vec<playback::field *> & to
2247 const auto_vec<playback::field *> *.
2248 (gcc::jit::playback::context::new_function_type): Convert param
2249 "param_types" from vec<type *> * to const auto_vec<type *> *.
2250 (gcc::jit::playback::context::new_function): Convert param
2251 "params" from vec<param *> * to const auto_vec<param *> *.
2252 (gcc::jit::playback::context::build_call): Convert param "args"
2253 from vec<rvalue *> to const auto_vec<rvalue *> *.
2254 (gcc::jit::playback::context::new_call): Likewise.
2255 (gcc::jit::playback::context::new_call_through_ptr): Likewise.
2256 (wrapper_finalizer): New function.
2257 (gcc::jit::playback::wrapper::operator new): Call the finalizer
2258 variant of ggc_internal_cleared_alloc, supplying
2260 (gcc::jit::playback::function::finalizer): New.
2261 (gcc::jit::playback::block::finalizer): New.
2262 (gcc::jit::playback::source_file::finalizer): New.
2263 (gcc::jit::playback::source_line::finalizer): New.
2266 (gcc::jit::playback::context::new_function_type): Convert param
2267 "param_types" from vec<type *> * to const auto_vec<type *> *.
2268 (gcc::jit::playback::context::new_function): Convert param
2269 "params" from vec<param *> * to const auto_vec<param *> *.
2270 (gcc::jit::playback::context::new_call): Convert param
2271 "args" from vec<rvalue *> to const auto_vec<rvalue *> *.
2272 (gcc::jit::playback::context::new_call_through_ptr): Likewise.
2273 (gcc::jit::playback::context::build_call): Likewise.
2274 (gcc::jit::playback::context): Convert fields "m_functions",
2275 "m_source_files", "m_cached_locations" from vec to auto_vec.
2276 (gcc::jit::playback::wrapper::finalizer): New virtual function.
2277 (gcc::jit::playback::compound_type::set_fields): Convert param fro
2278 const vec<playback::field *> & to
2279 const auto_vec<playback::field *> *.
2280 (gcc::jit::playback::function::finalizer): New.
2281 (gcc::jit::playback::block::finalizer): New.
2282 (gcc::jit::playback::source_file::finalizer): New.
2283 (gcc::jit::playback::source_line::finalizer): New.
2286 (gcc::jit::recording::function_type::replay_into): Convert local
2287 from a vec into an auto_vec.
2288 (gcc::jit::recording::fields::replay_into): Likewise.
2289 (gcc::jit::recording::function::replay_into): Likewise.
2290 (gcc::jit::recording::call::replay_into): Likewise.
2291 (gcc::jit::recording::call_through_ptr::replay_into): Likewise.
2293 * jit-recording.h (gcc::jit::recording::context): Convert fields
2294 "m_mementos", "m_compound_types", "m_functions" from vec<> to
2296 (gcc::jit::recording::function_type::get_param_types): Convert
2297 return type from vec<type *> to const vec<type *> &.
2298 (gcc::jit::recording::function_type): Convert field
2299 "m_param_types" from a vec<> to an auto_vec<>.
2300 (gcc::jit::recording::fields): Likewise for field "m_fields".
2301 (gcc::jit::recording::function::get_params): Convert return type
2302 from vec <param *> to const vec<param *> &.
2303 (gcc::jit::recording::function): Convert fields "m_params",
2304 "m_locals", "m_blocks" from vec<> to auto_vec<>.
2305 (gcc::jit::recording::block): Likewise for field "m_statements".
2306 vec<> to auto_vec<>.
2307 (gcc::jit::recording::call): Likewise for field "m_args".
2308 (gcc::jit::recording::call_through_ptr): Likewise.
2310 2014-11-19 David Malcolm <dmalcolm@redhat.com>
2313 * jit-recording.c (recording::function::validate): Convert
2314 "worklist" from vec<> to autovec<> to fix a leak.
2316 2014-11-11 David Malcolm <dmalcolm@redhat.com>
2318 * ChangeLog.jit: New.
2320 * Make-lang.in: New.
2322 * config-lang.in: New.
2323 * docs/Makefile: New.
2324 * docs/_build/texinfo/Makefile: New.
2325 * docs/_build/texinfo/factorial.png: New.
2326 * docs/_build/texinfo/libgccjit.texi: New.
2327 * docs/_build/texinfo/sum-of-squares.png: New.
2328 * docs/conf.py: New.
2329 * docs/examples/tut01-hello-world.c: New.
2330 * docs/examples/tut02-square.c: New.
2331 * docs/examples/tut03-sum-of-squares.c: New.
2332 * docs/examples/tut04-toyvm/Makefile: New.
2333 * docs/examples/tut04-toyvm/factorial.toy: New.
2334 * docs/examples/tut04-toyvm/fibonacci.toy: New.
2335 * docs/examples/tut04-toyvm/toyvm.c: New.
2336 * docs/index.rst: New.
2337 * docs/internals/index.rst: New.
2338 * docs/intro/factorial.png: New.
2339 * docs/intro/index.rst: New.
2340 * docs/intro/sum-of-squares.png: New.
2341 * docs/intro/tutorial01.rst: New.
2342 * docs/intro/tutorial02.rst: New.
2343 * docs/intro/tutorial03.rst: New.
2344 * docs/intro/tutorial04.rst: New.
2345 * docs/topics/contexts.rst: New.
2346 * docs/topics/expressions.rst: New.
2347 * docs/topics/functions.rst: New.
2348 * docs/topics/index.rst: New.
2349 * docs/topics/locations.rst: New.
2350 * docs/topics/objects.rst: New.
2351 * docs/topics/results.rst: New.
2352 * docs/topics/types.rst: New.
2353 * dummy-frontend.c: New.
2354 * jit-builtins.c: New.
2355 * jit-builtins.h: New.
2356 * jit-common.h: New.
2357 * jit-playback.c: New.
2358 * jit-playback.h: New.
2359 * jit-recording.c: New.
2360 * jit-recording.h: New.
2361 * libgccjit++.h: New.
2364 * libgccjit.map: New.
2367 2013-07-26 David Malcolm <dmalcolm@redhat.com>
2371 Copyright (C) 2013-2017 Free Software Foundation, Inc.
2373 Copying and distribution of this file, with or without modification,
2374 are permitted in any medium without royalty provided the copyright
2375 notice and this notice are preserved.