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