]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/jit/ChangeLog
Daily bump.
[thirdparty/gcc.git] / gcc / jit / ChangeLog
CommitLineData
450e225b
DM
12015-01-19 David Malcolm <dmalcolm@redhat.com>
2
3 * jit-recording.c
4 (gcc::jit::recording::memento_of_new_string_literal::make_debug_string):
5 Add missing format string.
6
499de348
DM
72015-01-16 David Malcolm <dmalcolm@redhat.com>
8
9 * Make-lang.in (lang_checks_parallelized): Add "check-jit".
10 (check_jit_parallelize): Set this to an arbitrary value (10).
11
e989e68d
JJ
122015-01-16 Jakub Jelinek <jakub@redhat.com>
13
14 * jit-builtins.h (DEF_FUNCTION_TYPE_VAR_5): Fix spelling of
15 last argument.
16 (DEF_FUNCTION_TYPE_VAR_8, DEF_FUNCTION_TYPE_VAR_12): Define and
17 undef afterwards.
18 * jit-builtins.c (DEF_FUNCTION_TYPE_VAR_8, DEF_FUNCTION_TYPE_VAR_12):
19 Likewise.
20
179ed8f5
RS
212015-01-15 Richard Sandiford <richard.sandiford@arm.com>
22
23 Update copyright years in docs/.
24
96a87981
DM
252015-01-15 David Malcolm <dmalcolm@redhat.com>
26
27 * libgccjit.c (gcc_jit_block_add_assignment_op): Check that the
28 lvalue and the rvalue are of compatible type.
29
86d0ac88
DM
302015-01-13 David Malcolm <dmalcolm@redhat.com>
31
32 * docs/cp/topics/contexts.rst (Debugging): Add
33 gccjit::context::dump_reproducer_to_file.
34 * docs/internals/index.rst (Design notes): New section,
35 discussing input validation and
36 gcc_jit_context_dump_reproducer_to_file.
37 * docs/topics/contexts.rst (Debugging): Add
38 gcc_jit_context_dump_reproducer_to_file.
39 * docs/_build/texinfo/libgccjit.texi: Regenerate.
40 * jit-common.h (gcc::jit::dump::get_context): New accessor.
41 * jit-recording.c: Include "hash-map.h".
42 Within namespace ::gcc::jit...
43 (dump::write): Flush each line.
44 (dump::make_location): Pass false for new param "created_by_user".
45 (class allocator): New class.
46 (allocator::~allocator): New function.
47 (allocator::xstrdup_printf): New function.
48 (allocator::xstrdup_printf_va): New function.
49 (class reproducer): New subclass of dump.
50 (reproducer::reproducer): New function.
51 (reproducer::write_params): New function.
52 (reproducer::write_args): New function.
53 (reproducer::make_identifier): New function.
54 (reproducer::make_tmp_identifier): New function.
55 (reproducer::get_identifier): New pair of functions.
56 (reproducer::get_identifier_as_rvalue): New function.
57 (reproducer::get_identifier_as_lvalue): New function.
58 (reproducer::get_identifier_as_type): New function.
59 (reproducer::xstrdup_printf): New function.
60 (recording::context::context): Initialize m_toplevel_ctxt.
61 (recording::context::new_location): Add param created_by_user.
62 (str_option_reproducer_strings): New table of strings.
63 (int_option_reproducer_strings): Likewise.
64 (bool_option_reproducer_strings): Likewise.
65 (get_type_enum_strings): Likewise.
66 (names_of_function_kinds): Likewise.
67 (global_kind_reproducer_strings): Likewise.
68 (unary_op_reproducer_strings): Likewise.
69 (binary_op_reproducer_strings): Likewise.
70 (comparison_reproducer_strings): Likewise.
71 Within namespace ::gcc::jit::recording::...
72 (context::dump_reproducer_to_file): New function.
73 (string::write_reproducer): Likewise.
74 (location::write_reproducer): Likewise.
75 (type::access_as_type): Likewise.
76 (memento_of_get_type::write_reproducer): Likewise.
77 (memento_of_get_pointer::write_reproducer): Likewise.
78 (memento_of_get_const::write_reproducer): Likewise.
79 (memento_of_get_volatile::write_reproducer): Likewise.
80 (array_type::write_reproducer): Likewise.
81 (function_type::write_reproducer): Likewise.
82 (function_type::write_deferred_reproducer): Likewise.
83 (field::write_reproducer): Likewise.
84 (struct_::access_as_type): Likewise.
85 (struct_::write_reproducer): Likewise.
86 (union_::write_reproducer): Likewise.
87 (fields::write_reproducer): Likewise.
88 (rvalue::access_as_rvalue): Likewise.
89 (lvalue::access_as_rvalue): Likewise.
90 (lvalue::access_as_lvalue): Likewise.
91 (param::access_as_rvalue): Likewise.
92 (param::access_as_lvalue): Likewise.
93 (param::write_reproducer): Likewise.
94 (function::write_reproducer): Likewise.
95 (block::write_reproducer): Likewise.
96 (global::write_reproducer): Likewise.
97 (memento_of_new_rvalue_from_const <int>::write_reproducer):
98 Likewise.
99 (memento_of_new_rvalue_from_const <long>::write_reproducer):
100 Likewise.
101 (memento_of_new_rvalue_from_const <double>::write_reproducer):
102 Likewise.
103 (memento_of_new_rvalue_from_const <void *>::write_reproducer):
104 Likewise.
105 (memento_of_new_string_literal::write_reproducer): Likewise.
106 (unary_op::write_reproducer): Likewise.
107 (binary_op::write_reproducer): Likewise.
108 (comparison::write_reproducer): Likewise.
109 (cast::write_reproducer): Likewise.
110 (call::write_reproducer): Likewise.
111 (call_through_ptr::write_reproducer): Likewise.
112 (array_access::write_reproducer): Likewise.
113 (access_field_of_lvalue::write_reproducer): Likewise.
114 (access_field_rvalue::write_reproducer): Likewise.
115 (dereference_field_rvalue::write_reproducer): Likewise.
116 (dereference_rvalue::write_reproducer): Likewise.
117 (get_address_of_lvalue::write_reproducer): Likewise.
118 (local::write_reproducer): Likewise.
119 (eval::write_reproducer): Likewise.
120 (assignment::write_reproducer): Likewise.
121 (assignment_op::write_reproducer): Likewise.
122 (comment::write_reproducer): Likewise.
123 (conditional::write_reproducer): Likewise.
124 (jump::write_reproducer): Likewise.
125 (return_::write_reproducer): Likewise.
126 * jit-recording.h (gcc::jit::reproducer): New forward declararion.
127 Within namespace ::gcc::jit::recording::...
128 (context::new_location): Add "created_by_user" param.
129 (context::dump_reproducer_to_file): New method.
130 (context::m_toplevel_ctxt): New field.
131 (memento::write_reproducer): New pure virtual function.
132 (memento::dyn_cast_location): New virtual function.
133 (string::write_reproducer):
134 (location::location): Add "created_by_user" param.
135 (location::dyn_cast_location): New function.
136 (location::created_by_user): New accessor.
137 (location::write_reproducer): New function.
138 (location::m_created_by_user): New field.
139 (type::access_as_type): New virtual function.
140 (location::write_reproducer): Likewise.
141 (type::access_as_type): Likewise.
142 (memento_of_get_type::write_reproducer): Likewise.
143 (memento_of_get_pointer::write_reproducer): Likewise.
144 (memento_of_get_const::write_reproducer): Likewise.
145 (memento_of_get_volatile::write_reproducer): Likewise.
146 (array_type::write_reproducer): Likewise.
147 (function_type::write_reproducer): Likewise.
148 (function_type::write_deferred_reproducer): Likewise.
149 (field::write_reproducer): Likewise.
150 (struct_::access_as_type): Likewise.
151 (struct_::write_reproducer): Likewise.
152 (union_::write_reproducer): Likewise.
153 (union_::m_fields): Remove stray unused field.
154 (fields::length): New accessor.
155 (fields::get_field): New accessor.
156 (fields::write_reproducer): New function.
157 (rvalue::access_as_rvalue): Likewise.
158 (lvalue::access_as_rvalue): Likewise.
159 (lvalue::access_as_lvalue): Likewise.
160 (param::access_as_rvalue): Likewise.
161 (param::access_as_lvalue): Likewise.
162 (param::write_reproducer): Likewise.
163 (function::write_reproducer): Likewise.
164 (block::write_reproducer): Likewise.
165 (global::write_reproducer): Likewise.
166 (memento_of_new_rvalue_from_const <HOST_TYPE>::write_reproducer):
167 Likewise.
168 (memento_of_new_string_literal::write_reproducer): Likewise.
169 (unary_op::write_reproducer): Likewise.
170 (binary_op::write_reproducer): Likewise.
171 (comparison::write_reproducer): Likewise.
172 (cast::write_reproducer): Likewise.
173 (call::write_reproducer): Likewise.
174 (call_through_ptr::write_reproducer): Likewise.
175 (array_access::write_reproducer): Likewise.
176 (access_field_of_lvalue::write_reproducer): Likewise.
177 (access_field_rvalue::write_reproducer): Likewise.
178 (dereference_field_rvalue::write_reproducer): Likewise.
179 (dereference_rvalue::write_reproducer): Likewise.
180 (get_address_of_lvalue::write_reproducer): Likewise.
181 (local::write_reproducer): Likewise.
182 (eval::write_reproducer): Likewise.
183 (assignment::write_reproducer): Likewise.
184 (assignment_op::write_reproducer): Likewise.
185 (comment::write_reproducer): Likewise.
186 (conditional::write_reproducer): Likewise.
187 (jump::write_reproducer): Likewise.
188 (return_::write_reproducer): Likewise.
189 * libgccjit++.h (gccjit::context::dump_reproducer_to_file): New.
190 * libgccjit.c (gcc_jit_context_new_location): Pass "true" as
191 param "created_by_user".
192 (gcc_jit_context_dump_reproducer_to_file): New API entrypoint.
193 * libgccjit.h (gcc_jit_context_dump_reproducer_to_file): New API
194 entrypoint.
195 * libgccjit.map (gcc_jit_context_dump_reproducer_to_file): New API
196 entrypoint.
197
f6f2b019
DM
1982015-01-12 David Malcolm <dmalcolm@redhat.com>
199
200 * jit-recording.c (class gcc::jit::rvalue_usage_validator): New.
201 (gcc::jit::rvalue_usage_validator::rvalue_usage_validator): New
202 ctor.
203 (gcc::jit::rvalue_usage_validator::visit): New function.
204 (gcc::jit::recording::rvalue::verify_valid_within_stmt): New
205 function.
206 (gcc::jit::recording::rvalue::set_scope): New function.
207 (gcc::jit::recording::function::function): Call set_scope on each
208 param, issuing errors for any params that already have a function.
209 (gcc::jit::recording::block::add_eval): Return the new statement;
210 update the comment given that some error-checking now happens after
211 this returns.
212 (gcc::jit::recording::block::add_assignment): Likewise.
213 (gcc::jit::recording::block::add_assignment_op): Likewise.
214 (gcc::jit::recording::block::add_comment): Likewise.
215 (gcc::jit::recording::block::end_with_conditional): Likewise.
216 (gcc::jit::recording::block::end_with_jump): Likewise.
217 (gcc::jit::recording::block::end_with_return): Likewise.
218 (gcc::jit::recording::block::validate): Add a comment.
219 (gcc::jit::recording::unary_op::visit_children): New function.
220 (gcc::jit::recording::binary_op::visit_children): New function.
221 (gcc::jit::recording::comparison::visit_children): New function.
222 (gcc::jit::recording::cast::visit_children): New function.
223 (gcc::jit::recording::call::visit_children): New function.
224 (gcc::jit::recording::call_through_ptr::visit_children): New function.
225 (gcc::jit::recording::array_access::visit_children): New function.
226 (gcc::jit::recording::access_field_of_lvalue::visit_children): New
227 function.
228 (gcc::jit::recording::access_field_rvalue::visit_children): New
229 function.
230 (gcc::jit::recording::dereference_field_rvalue::visit_children):
231 New function.
232 (gcc::jit::recording::dereference_rvalue::visit_children): New
233 function.
234 (gcc::jit::recording::get_address_of_lvalue::visit_children): New
235 function.
236 * jit-recording.h: Within namespace gcc::jit::recording...
237 (class rvalue_visitor): New.
238 (rvalue::rvalue): Initialize m_scope.
239 (rvalue::get_loc): New accessor.
240 (rvalue::verify_valid_within_stmt): New function.
241 (rvalue::visit_children): New pure virtual function.
242 (rvalue::set_scope): New function.
243 (rvalue::get_scope): New function.
244 (rvalue::dyn_cast_param): New function.
245 (rvalue::m_scope): New field.
246 (param::visit_children): New empty function.
247 (param::dyn_cast_param): New function.
248 (function::get_loc): New function.
249 (block::add_eval): Return the new statement.
250 (block::add_assignment): Likewise.
251 (block::add_assignment_op): Likewise.
252 (block::add_comment): Likewise.
253 (block::end_with_conditional): Likewise.
254 (block::end_with_jump): Likewise.
255 (block::end_with_return): Likewise.
256 (global::visit_children): New function.
257 (memento_of_new_rvalue_from_const<HOST_TYPE>::visit_children):
258 New function.
259 (memento_of_new_string_literal::visit_children): New function.
260 (unary_op::visit_children): New function.
261 (binary_op::visit_children): New function.
262 (comparison::visit_children): New function.
263 (cast::visit_children): New function.
264 (call::visit_children): New function.
265 (call_through_ptr::visit_children): New function.
266 (array_access::visit_children): New function.
267 (access_field_of_lvalue::visit_children): New function.
268 (access_field_rvalue::visit_children): New function.
269 (dereference_field_rvalue::visit_children): New function.
270 (dereference_rvalue::visit_children): New function.
271 (get_address_of_lvalue::visit_children): New function.
272 (local::local): Call set_scope.
273 (local::visit_children): New function.
274 (statement::get_block): Make public.
275 * libgccjit.c (RETURN_VAL_IF_FAIL_PRINTF5): New macro.
276 (RETURN_NULL_IF_FAIL_PRINTF5): New macro.
277 (gcc_jit_context_new_function): Verify that each param has
278 not yet been used for creating another function.
279 (gcc_jit_block_add_eval): After creating the stmt, verify
280 that the rvalue expression tree is valid to use within it.
281 (gcc_jit_block_add_assignment): Likewise for the lvalue and
282 rvalue expression trees.
283 (gcc_jit_block_add_assignment_op): Likewise.
284 (gcc_jit_block_end_with_conditional): Likewise for the boolval
285 expression tree.
286 (gcc_jit_block_end_with_return): Likewise for the rvalue
287 expression tree.
288 (gcc_jit_block_end_with_void_return): Remove return of "void",
289 now that block::end_with_return is now non-void.
290
1c35cc2c
DM
2912015-01-12 David Malcolm <dmalcolm@redhat.com>
292
293 * jit-playback.c (gcc::jit::playback::context::read_dump_file):
294 Add missing fclose on error-handling path.
295
791cfef8
DM
2962015-01-12 David Malcolm <dmalcolm@redhat.com>
297
298 * docs/cp/topics/expressions.rst (Global variables): Add
299 enum gcc_jit_global_kind param to gccjit::context::new_global.
300 * docs/topics/expressions.rst (Global variables): Likewise.
301 Document the new enum.
302 * docs/topics/results.rst (Compilation results): Document
303 globals-handling.
304 * docs/_build/texinfo/libgccjit.texi: Regenerate.
305 * dummy-frontend.c (jit_langhook_write_globals): Call into the
306 playback context's write_global_decls_1 and write_global_decls_2
307 before and after calling symtab->finalize_compilation_unit ().
308 * jit-playback.c: Include "debug.h".
309 (gcc::jit::playback::context::new_global): Add "kind" param and
310 use it to set TREE_PUBLIC, TREE_STATIC and DECL_EXTERNAL on the
311 underlying VAR_DECL. Call varpool_node::get_create on the
312 VAR_DECL, and add it to m_globals.
313 (gcc::jit::playback::context::write_global_decls_1): New function.
314 (gcc::jit::playback::context::write_global_decls_2): New function.
315 * jit-playback.h (gcc::jit::playback::context::context): Call
316 create on m_globals.
317 (gcc::jit::playback::context::new_global): Add "kind" param.
318 (gcc::jit::playback::context::write_global_decls_1): New function.
319 (gcc::jit::playback::context::write_global_decls_2): New function.
320 (gcc::jit::playback::context::m_globals): New field.
321 * jit-recording.c (gcc::jit::recording::context::context):
322 Initialize m_globals.
323 (gcc::jit::recording::context::new_global): Add param "kind".
324 Add the new global to m_globals.
325 (gcc::jit::recording::context::dump_to_file): Dump the globals.
326 (gcc::jit::recording::global::replay_into): Add field m_kind.
327 (gcc::jit::recording::global::write_to_dump): New override.
328 * jit-recording.h (gcc::jit::recording::context::new_global): Add
329 param "kind".
330 (gcc::jit::recording::context::m_globals): New field.
331 (gcc::jit::recording::global::global): Add param kind.
332 (gcc::jit::recording::global::write_to_dump): New override.
333 (gcc::jit::recording::global::m_kind): New field.
334 * jit-result.c (gcc::jit::result::get_global): New function.
335 * jit-result.h (gcc::jit::result::get_global): New function.
336 * libgccjit++.h (gccjit::context::new_global): Add "kind" param.
337 * libgccjit.c (gcc_jit_context_new_global): Likewise.
338 (gcc_jit_result_get_global): New API entrypoint.
339 * libgccjit.h (gcc_jit_result_get_global): New API entrypoint.
340 (enum gcc_jit_global_kind): New enum.
341 (gcc_jit_context_new_global): API change: add "kind" param.
342 * libgccjit.map (gcc_jit_result_get_global): New symbol.
343
860e981c
DM
3442015-01-09 David Malcolm <dmalcolm@redhat.com>
345
346 * dummy-frontend.c: Include "fixed-value.h", "alias.h", "flags.h",
347 "symtab.h", "inchash.h". Move include of "hash-set.h" much
348 earlier.
349 * jit-builtins.c: Remove redundant includes of "opts.h" and
350 "tree.h".
351 * jit-common.h: Include "hash-set.h", "input.h", "vec.h",
352 "double-int.h", "alias.h", "flags.h", "symtab.h", "inchash.h".
353 * jit-playback.c: Include "hashtab.h", "machmode.h", "input.h",
354 "statistics.h", "vec.h", "double-int.h", "real.h",
355 "fixed-value.h", "alias.h", "flags.h", "symtab.h", "tree-core.h",
356 "inchash.h", "fold-const.h". Move include of "hash-set.h" to
357 earlier.
358 * jit-recording.c: Remove redundant includes of "opts.h" and
359 "tree.h".
360
ccce3b2a
DM
3612015-01-09 David Malcolm <dmalcolm@redhat.com>
362
363 * docs/cp/topics/expressions.rst (Simple expressions): Use
364 ":c:type:" for C types. Document new overload of
365 gcc::jit::context::new_rvalue.
366 * docs/topics/expressions.rst (Simple expressions): Use
367 ":c:type:" for C types. Document new entrypoint
368 gcc_jit_context_new_rvalue_from_long.
369 * docs/_build/texinfo/libgccjit.texi: Regenerate.
370 * jit-playback.c: Within namespace gcc::jit::playback...
371 (context::new_rvalue_from_int): Eliminate in favor of...
372 (context::new_rvalue_from_const <int>): ...this.
373 (context::new_rvalue_from_double): Eliminate in favor of...
374 (context::new_rvalue_from_const <double>): ...this.
375 (context::new_rvalue_from_const <long>): New.
376 (context::new_rvalue_from_ptr): Eliminate in favor of...
377 (context::new_rvalue_from_const <void *>): ...this.
378 * jit-playback.h: Within namespace gcc::jit::playback...
379 (context::new_rvalue_from_int): Eliminate in favor of...
380 (context::new_rvalue_from_const <HOST_TYPE>): ...this.
381 (context::new_rvalue_from_double): Likewise.
382 (context::new_rvalue_from_ptr): Likewise.
383 * jit-recording.c: Within namespace gcc::jit::recording...
384 (context::new_rvalue_from_int): Eliminate.
385 (context::new_rvalue_from_double): Likewise.
386 (context::new_rvalue_from_ptr): Likewise.
387 (class memento_of_new_rvalue_from_const <int>):
388 Add explicit specialization.
389 (class memento_of_new_rvalue_from_const <long>):
390 Likewise.
391 (class memento_of_new_rvalue_from_const <double>):
392 Likewise.
393 (class memento_of_new_rvalue_from_const <void *>):
394 Likewise.
395 (memento_of_new_rvalue_from_int::replay_into):
396 Generalize into...
397 (memento_of_new_rvalue_from_const <HOST_TYPE>::replay_into):
398 ...this...
399 (memento_of_new_rvalue_from_double::replay_into):
400 ...allowing this...
401 (memento_of_new_rvalue_from_ptr::replay_into):
402 ...and this to be deleted.
403 (memento_of_new_rvalue_from_int::make_debug_string):
404 Convert to...
405 (memento_of_new_rvalue_from_const <int>::make_debug_string):
406 ...this.
407 (memento_of_new_rvalue_from_double::make_debug_string):
408 Convert to...
409 (memento_of_new_rvalue_from_const <double>::make_debug_string):
410 ...this.
411 (memento_of_new_rvalue_from_ptr::make_debug_string)
412 Convert to...
413 (memento_of_new_rvalue_from_const <void *>::make_debug_string):
414 ...this.
415 (memento_of_new_rvalue_from_const <long>::make_debug_string):
416 New function.
417 * jit-recording.h: Within namespace gcc::jit::recording...
418 (context::new_rvalue_from_int): Eliminate.
419 (context::new_rvalue_from_double): Likewise.
420 (context::new_rvalue_from_ptr): Likewise, all in favor of...
421 (context::new_rvalue_from_const <HOST_TYPE>): New family of
422 methods.
423 (class memento_of_new_rvalue_from_int): Eliminate.
424 (class memento_of_new_rvalue_from_double): Likewise.
425 (class memento_of_new_rvalue_from_ptr): Likewise.
426 (class memento_of_new_rvalue_from_const <HOST_TYPE>): New family
427 of rvalue subclasses.
428 * libgccjit++.h (gccjit::context::new_rvalue): New overload, for
429 "long".
430 * libgccjit.c (gcc_jit_context_new_rvalue_from_int): Update for
431 rewriting of recording::context::new_rvalue_from_int to
432 recording::context::new_rvalue_from_const <int>.
433 (gcc_jit_context_new_rvalue_from_long): New API entrypoint.
434 (gcc_jit_context_new_rvalue_from_double): Update for
435 rewriting of recording::context::new_rvalue_from_double to
436 recording::context::new_rvalue_from_const <double>.
437 (gcc_jit_context_new_rvalue_from_ptr): Update for
438 rewriting of recording::context::new_rvalue_from_ptr to
439 recording::context::new_rvalue_from_const <void *>.
440 * libgccjit.h (gcc_jit_context_new_rvalue_from_long): New API
441 entrypoint.
442 * libgccjit.map (gcc_jit_context_new_rvalue_from_long): Likewise.
443
d2286af3
DM
4442015-01-09 David Malcolm <dmalcolm@redhat.com>
445
446 PR jit/64206
447 * docs/internals/test-hello-world.exe.log.txt: Update, the log now
448 shows tempdir creation/cleanup.
449 * docs/_build/texinfo/libgccjit.texi: Regenerate.
450 * jit-logging.h (class gcc::jit::log_user): Add gcc::jit::tempdir
451 to the list of subclasses in the comment.
452 * jit-playback.c (gcc::jit::playback::context::context): Add a
453 comment clarifying when the tempdir gets cleaned up.
454 (gcc::jit::playback::context::compile): Pass the context's logger,
455 if any, to the tempdir.
456 (gcc::jit::playback::context::dlopen_built_dso): When creating the
457 gcc::jit::result, if GCC_JIT_BOOL_OPTION_DEBUGINFO is set, hand
458 over ownership of the tempdir to it.
459 * jit-result.c: Include "jit-tempdir.h".
460 (gcc::jit::result::result): Add tempdir param, saving it as
461 m_tempdir.
462 (gcc::jit::result::~result): Delete m_tempdir.
463 * jit-result.h (gcc::jit::result::result): Add tempdir param.
464 (gcc::jit::result::m_tempdir): New field.
465 * jit-tempdir.c (gcc::jit::tempdir::tempdir): Add logger param;
466 add JIT_LOG_SCOPE.
467 (gcc::jit::tempdir::create): Add JIT_LOG_SCOPE to log entry/exit,
468 and log m_path_template and m_path_tempdir.
469 (gcc::jit::tempdir::~tempdir): Add JIT_LOG_SCOPE to log
470 entry/exit, and log the unlink and rmdir calls.
471 * jit-tempdir.h: Include "jit-logging.h".
472 (class gcc::jit::tempdir): Make this be a subclass of log_user.
473 (gcc::jit::tempdir::tempdir): Add logger param.
474 * notes.txt: Update to show the two possible places where the
475 tempdir can be cleaned up.
476
7c8db13e
DM
4772015-01-08 David Malcolm <dmalcolm@redhat.com>
478
479 * libgccjit.h (struct gcc_jit_context): Rewrite the descriptive
480 comment.
481
303e1d56
DM
4822015-01-08 David Malcolm <dmalcolm@redhat.com>
483
484 * docs/topics/contexts.rst (Error-handling): Document new
485 entrypoint gcc_jit_context_get_last_error.
486 * docs/_build/texinfo/libgccjit.texi: Regenerate.
487 * jit-recording.c (gcc::jit::recording::context::context):
488 Initialize new fields "m_last_error_str" and
489 "m_owns_last_error_str".
490 (gcc::jit::recording::context::~context): Clean up
491 m_last_error_str, if needed.
492 (gcc::jit::recording::context::add_error_va): Update
493 m_last_error_str and m_owns_last_error_str, freeing the old
494 value if appropriate.
495 (gcc::jit::recording::context::get_last_error): New function.
496 * jit-recording.h (gcc::jit::recording::context::get_last_error):
497 New function.
498 (gcc::jit::recording::context): New fields m_last_error_str and
499 m_owns_last_error_str.
500 * libgccjit.c (gcc_jit_context_get_last_error): New function.
501 * libgccjit.h (gcc_jit_context_get_last_error): New declaration.
502 * libgccjit.map (gcc_jit_context_get_last_error): New function.
503
eb4c16eb
DM
5042015-01-08 David Malcolm <dmalcolm@redhat.com>
505
506 * Make-lang.in (jit_OBJS): Add jit/jit-logging.o.
507 * docs/internals/index.rst (Overview of code structure): Mention
508 gcc_jit_context_set_logfile, and embed the example logfile.
509 * docs/internals/test-hello-world.exe.log.txt: New file: example
510 of a logfile.
511 * docs/topics/contexts.rst (Debugging): Add documentation
512 for gcc_jit_context_set_logfile.
513 * docs/_build/texinfo/libgccjit.texi: Regenerate.
514 * dummy-frontend.c: Include "jit-logging.h".
515 (jit_langhook_init): Assert that there is an active playback
516 context. If it has a logger, log entry/exit to this function.
517 (jit_langhook_write_globals): Likewise.
518 * jit-common.h (gcc::jit::logger): New forward declaration.
519 * jit-logging.c: New file.
520 * jit-logging.h: New file.
521 * jit-playback.c: Include "jit-logging.h".
522 (gcc::jit::playback::context::context): Initialize the log_user
523 base class from the recording context's logger (if any). Use
524 JIT_LOG_SCOPE to log entry/exit from the function body.
525 (gcc::jit::playback::context::~context): Use JIT_LOG_SCOPE to
526 log entry/exit from the function body.
527 (gcc::jit::playback::build_stmt_list): Likewise.
528 (gcc::jit::playback::function::postprocess): Likewise.
529 (gcc::jit::playback::context::compile): Likewise. Log the
530 entry/exit to toplev::main and toplev::finalize. Log the
531 fake argv passed to toplev::main.
532 (gcc::jit::playback::context::acquire_mutex): Use JIT_LOG_SCOPE to
533 log entry/exit from the function body.
534 (gcc::jit::playback::context::release_mutex): Likewise.
535 (gcc::jit::playback::context::make_fake_args): Likewise.
536 (gcc::jit::playback::context::extract_any_requested_dumps):
537 Likewise.
538 (gcc::jit::playback::context::convert_to_dso): Likewise. Also,
539 log the arguments that the driver is invoked with.
540 (gcc::jit::playback::context::dlopen_built_dso): Likewise. Pass
541 the logger to the result object.
542 (gcc::jit::playback::context::replay): Use JIT_LOG_SCOPE to
543 log entry/exit from the function body.
544 (gcc::jit::playback::context::dump_generated_code): Likewise.
545 (gcc::jit::playback::context::handle_locations): Likewise.
546 * jit-playback.h (gcc::jit::playback::context): Make this be
547 a subclass of gcc::jit::log_user.
548 * jit-recording.c: Include "jit-logging.h".
549 (gcc::jit::recording::context::context: Initialize the logger to
550 NULL for root contexts, or to the parent's logger for child
551 contexts.
552 (gcc::jit::recording::context::~context): Use JIT_LOG_SCOPE to
553 log entry/exit from the function body.
554 (gcc::jit::recording::context::replay_into): Likewise.
555 (gcc::jit::recording::context::disassociate_from_playback):
556 Likewise.
557 (gcc::jit::recording::context::compile): Likewise.
558 (recording::context::add_error_va): Likewise. Also, log the
559 error.
560 (gcc::jit::recording::context::validate): Use JIT_LOG_SCOPE to
561 log entry/exit from the function body.
562 * jit-recording.h: Include "jit-logging.h".
563 (gcc::jit::recording::context): Make this be a subclass of
564 gcc::jit::log_user.
565 * jit-result.c: Include "jit-common.h" and "jit-logging.h".
566 (gcc::jit::result::result): Add logger param, recording it.
567 Use JIT_LOG_SCOPE to log entry/exit from the function body.
568 (gcc::jit::result::~result(): Use JIT_LOG_SCOPE to
569 log entry/exit from the function body.
570 (gcc::jit::result::get_code): Likewise.
571 * jit-result.h (gcc::jit::result): Make this be a subclass of
572 gcc::jit::log_user.
573 (gcc::jit::result::result): Add logger parameter.
574 * libgccjit++.h (gccjit::context::set_logfile): New function.
575 * libgccjit.c: Include "jit-logging.h".
576 (gcc_jit_context_acquire): Log the context.
577 (gcc_jit_context_release): Use JIT_LOG_FUNC to
578 log entry/exit from the function body, and log the context.
579 (gcc_jit_context_new_child_context): Likewise, logging both
580 contexts.
581 (gcc_jit_context_new_location): Use JIT_LOG_FUNC to
582 log entry/exit from the function body.
583 (gcc_jit_context_get_type): Likewise.
584 (gcc_jit_context_get_int_type): Likewise.
585 (gcc_jit_context_new_array_type): Likewise.
586 (gcc_jit_context_new_field): Likewise.
587 (gcc_jit_context_new_struct_type): Likewise.
588 (gcc_jit_context_new_opaque_struct): Likewise.
589 (gcc_jit_struct_set_fields): Likewise.
590 (gcc_jit_context_new_union_type): Likewise.
591 (gcc_jit_context_new_function_ptr_type): Likewise.
592 (gcc_jit_context_new_param): Likewise.
593 (gcc_jit_context_new_function): Likewise.
594 (gcc_jit_context_get_builtin_function): Likewise.
595 (gcc_jit_function_get_param): Likewise.
596 (gcc_jit_function_dump_to_dot): Likewise.
597 (gcc_jit_function_new_block): Likewise.
598 (gcc_jit_context_new_global): Likewise.
599 (gcc_jit_context_new_rvalue_from_int): Likewise.
600 (gcc_jit_context_zero): Likewise.
601 (gcc_jit_context_one): Likewise.
602 (gcc_jit_context_new_rvalue_from_double): Likewise.
603 (gcc_jit_context_new_rvalue_from_ptr): Likewise.
604 (gcc_jit_context_null): Likewise.
605 (gcc_jit_context_new_string_literal): Likewise.
606 (gcc_jit_context_new_unary_op): Likewise.
607 (gcc_jit_context_new_binary_op): Likewise.
608 (gcc_jit_context_new_comparison): Likewise.
609 (gcc_jit_context_new_call): Likewise.
610 (gcc_jit_context_new_call_through_ptr): Likewise.
611 (gcc_jit_context_new_cast): Likewise.
612 (gcc_jit_context_new_array_access): Likewise.
613 (gcc_jit_lvalue_access_field): Likewise.
614 (gcc_jit_rvalue_access_field): Likewise.
615 (gcc_jit_rvalue_dereference_field): Likewise.
616 (gcc_jit_rvalue_dereference): Likewise.
617 (gcc_jit_lvalue_get_address): Likewise.
618 (gcc_jit_function_new_local): Likewise.
619 (gcc_jit_block_add_eval): Likewise.
620 (gcc_jit_block_add_assignment): Likewise.
621 (gcc_jit_block_add_assignment_op): Likewise.
622 (gcc_jit_block_end_with_conditional): Likewise.
623 (gcc_jit_block_add_comment): Likewise.
624 (gcc_jit_block_end_with_jump): Likewise.
625 (gcc_jit_block_end_with_return): Likewise.
626 (gcc_jit_block_end_with_void_return): Likewise.
627 (gcc_jit_context_set_str_option): Likewise.
628 (gcc_jit_context_set_int_option): Likewise.
629 (gcc_jit_context_set_bool_option): Likewise.
630 (gcc_jit_context_enable_dump): Likewise.
631 (gcc_jit_context_compile): Likewise. Also log the context,
632 and the result.
633 (gcc_jit_context_dump_to_file): Likewise.
634 (gcc_jit_context_set_logfile): New function.
635 (gcc_jit_context_get_first_error): Use JIT_LOG_FUNC to
636 log entry/exit from the function body.
637 (gcc_jit_result_get_code): Likewise. Also log the fnname)
638 and the ptr to be returned.
639 (gcc_jit_result_release): Likewise. Also log the result.
640 * libgccjit.h: Include <stdio.h>, since we need FILE *.
641 (gcc_jit_context_set_logfile): New declaration.
642 * libgccjit.map (gcc_jit_context_set_logfile): New.
643
c211cd23
DM
6442015-01-07 David Malcolm <dmalcolm@redhat.com>
645
646 * jit-recording.h (gcc::jit::recording::type::is_void): New
647 virtual function.
648 (gcc::jit::recording::memento_of_get_type::is_void): New
649 function, overriding default implementation.
650 * libgccjit.c (gcc_jit_rvalue_dereference): Verify that
651 the underlying type is not "void".
652
18146f45
DM
6532015-01-07 David Malcolm <dmalcolm@redhat.com>
654
655 * docs/topics/expressions.rst (Unary Operations): Add
656 GCC_JIT_UNARY_OP_ABS.
657 * jit-playback.c (gcc::jit::playback::context::new_unary_op):
658 Likewise.
659 * jit-recording.c (unary_op_strings): Likewise.
660 * libgccjit.c (gcc_jit_context_new_unary_op): Update checking
661 of "op" to reflect addition of GCC_JIT_UNARY_OP_ABS.
662 * libgccjit.h (enum gcc_jit_unary_op): Add GCC_JIT_UNARY_OP_ABS.
663 * docs/_build/texinfo/libgccjit.texi: Regenerate.
664
11af98ff
DM
6652015-01-07 David Malcolm <dmalcolm@redhat.com>
666
667 * jit-recording.h (gcc::jit::recording::memento_of_get_type): Fix
668 typo in comment.
669
433d16df
DM
6702015-01-07 David Malcolm <dmalcolm@redhat.com>
671
672 * TODO.rst (Test suite): Remove item about running C++ testcases.
673 * docs/internals/index.rst (Working on the JIT library): Add
674 "c++" to the enabled languages in the suggested "configure"
675 invocation, and add a description of why this is necessary.
676 * docs/_build/texinfo/libgccjit.texi: Regenerate.
677
50bb6c8e
DM
6782015-01-07 David Malcolm <dmalcolm@redhat.com>
679
680 * docs/internals/index.rst: Update to reflect that built
681 testcases are now test-foo.c.exe, rather than test-foo.exe.
682 * docs/_build/texinfo/libgccjit.texi: Regenerate.
683
1e3b6a3d
JJ
6842015-01-05 Jakub Jelinek <jakub@redhat.com>
685
686 Update copyright years.
687
e8af59bc
DM
6882014-12-19 David Malcolm <dmalcolm@redhat.com>
689
690 * jit-playback.c (gcc::jit::playback::context::build_cast): In
691 case BOOLEAN_TYPE, don't assume that the source expression is
692 of type "int".
693
5afd44e3
DM
6942014-12-19 David Malcolm <dmalcolm@redhat.com>
695
696 * jit-recording.c (gcc::jit::recording::context::context): When
697 copying string options from a parent context, take a copy of the
698 underlying buffers, rather than simply copying the pointer.
699
1f0858d7
DM
7002014-12-19 David Malcolm <dmalcolm@redhat.com>
701
702 * jit-recording.c (gcc::jit::recording::context::set_str_option):
703 Handle NULL.
704
35291c7d
DM
7052014-12-11 David Malcolm <dmalcolm@redhat.com>
706
707 * docs/cp/topics/contexts.rst (gccjit::context::set_str_option):
708 Document new function.
709 * docs/_build/texinfo/libgccjit.texi: Regenerate.
710
7b31ff5e
DM
7112014-12-10 Ulrich Drepper <drepper@gmail.com>
712
713 Minor interface cleanups of libgccjit
714 * jit-playback.c (convert_to_dso): Use auto_vec instead
715 of automatic array to build up command line.
716 * jit-recording.c (recording::context::set_str_option):
717 Make copy of the string.
718 (recording::context::~context): Free string options.
719 * jit-recording.h (recording::context): Adjust type
720 of m_str_options member.
721 * libgccjit.h: Adjust comment about
722 gcc_jit_context_set_str_option parameter being used after
723 the call.
724 Update comment now that all interfaces are copy strings
725 if necessary.
726 * libgccjit++.h (gccjit::context): Add set_str_option
727 member function.
728
29df5715
DM
7292014-12-10 David Malcolm <dmalcolm@redhat.com>
730
731 * docs/cp/index.rst: New file.
732 * docs/cp/intro/index.rst: New file.
733 * docs/cp/intro/tutorial01.rst: New file.
734 * docs/cp/intro/tutorial02.rst: New file.
735 * docs/cp/intro/tutorial03.rst: New file.
736 * docs/cp/intro/tutorial04.rst: New file.
737 * docs/cp/topics/contexts.rst: New file.
738 * docs/cp/topics/expressions.rst: New file.
739 * docs/cp/topics/functions.rst: New file.
740 * docs/cp/topics/index.rst: New file.
741 * docs/cp/topics/locations.rst: New file.
742 * docs/cp/topics/objects.rst: New file.
743 * docs/cp/topics/results.rst: New file.
744 * docs/cp/topics/types.rst: New file.
745 * docs/examples/tut01-hello-world.cc: New file.
746 * docs/examples/tut02-square.c: Fix missing newline in output.
747 * docs/examples/tut02-square.cc: New file.
748 * docs/examples/tut03-sum-of-squares.cc: New file.
749 * docs/examples/tut04-toyvm/toyvm.cc: New file.
750 * docs/index.rst: Move summary to above the table of contents.
751 Add text about the C vs C++ APIs.
752 * docs/topics/contexts.rst: Fix a typo.
753
754 * docs/_build/texinfo/libgccjit.texi: Regenerate.
755 * docs/_build/texinfo/factorial1.png: New file.
756 * docs/_build/texinfo/sum-of-squares1.png: New file.
757
5cd614ce
DM
7582014-12-09 David Malcolm <dmalcolm@redhat.com>
759
760 * docs/examples/tut04-toyvm/toyvm.c (toyvm_function_compile): Move
761 logic for determine "funcname" to new function...
762 (get_function_name): ...here, adding logic to skip any leading
763 path from the filename.
764 (toyvm_function_parse): Use the filename for fn_filename, rather
765 than "name", so that the debugger can locate the source .toy
766 file.
767 (toyvm_function_parse): Don't fclose a NULL FILE *.
768
2712de78
DM
7692014-12-09 David Malcolm <dmalcolm@redhat.com>
770
771 PR jit/63854
772 * docs/internals/index.rst (Running under valgrind): New
773 subsection.
774 (docs/_build/texinfo/libgccjit.texi): Regenerate.
775
d1e5f2c7
DM
7762014-12-09 David Malcolm <dmalcolm@redhat.com>
777
778 PR jit/64206
779 * Make-lang.in (jit_OBJS): Add jit/jit-tempdir.o.
780 * jit-common.h (gcc::jit::tempdir): New forward decl.
781 * jit-playback.c: Include jit-tempdir.h.
782 (gcc::jit::playback::context::context): Initialize m_tempdir.
783 (gcc::jit::playback::context::~context): Move tempdir
784 cleanup to new file jit-tempdir.c
785 (make_tempdir_path_template): Move to new file jit-tempdir.c.
786 (gcc::jit::playback::context::compile): Move tempdir creation
787 to new tempdir object in new file jit-tempdir.c.
788 (gcc::jit::playback::context::make_fake_args): Get path from
789 tempdir object rather than from member data.
790 (gcc::jit::playback::context::convert_to_dso): Likewise.
791 (gcc::jit::playback::context::dlopen_built_dso): Likewise.
792 (gcc::jit::playback::context::dump_generated_code): Likewise.
793 (gcc::jit::playback::context::get_path_c_file): New function.
794 (gcc::jit::playback::context::get_path_s_file): New function.
795 (gcc::jit::playback::context::get_path_so_file): New function.
796 * jit-playback.h (gcc::jit::playback::context::get_path_c_file):
797 New function.
798 (gcc::jit::playback::context::get_path_s_file): New function.
799 (gcc::jit::playback::context::get_path_so_file): New function.
800 (gcc::jit::playback::context): Move fields "m_path_template",
801 "m_path_tempdir", "m_path_c_file", "m_path_s_file",
802 "m_path_so_file" to new jit::tempdir class; add field "m_tempdir".
803 * jit-tempdir.c: New file.
804 * jit-tempdir.h: New file.
805
38771e4e
DM
8062014-12-09 David Malcolm <dmalcolm@redhat.com>
807
808 * jit-playback.c (gcc::jit::playback::context::compile): Acquire the
809 mutex here, immediately before using toplev, and release it here, on
810 each exit path after acquisition.
811 (jit_mutex): Move this variable here, from jit-recording.c.
812 (gcc::jit::playback::context::acquire_mutex): New function, based on
813 code in jit-recording.c.
814 (gcc::jit::playback::context::release_mutex): Likewise.
815 * jit-playback.h (gcc::jit::playback::context::acquire_mutex): New
816 function.
817 (gcc::jit::playback::context::release_mutex): New function.
818 * jit-recording.c (jit_mutex): Move this variable to jit-playback.c.
819 (gcc::jit::recording::context::compile): Move mutex-handling from
820 here into jit-playback.c's gcc::jit::playback::context::compile.
821 * notes.txt: Update to show the new locations of ACQUIRE_MUTEX
822 and RELEASE_MUTEX.
823
38f4f641
DM
8242014-12-09 David Malcolm <dmalcolm@redhat.com>
825
826 * jit-playback.c (gcc::jit::playback::context::compile): Move the
827 dlopen code into...
828 (gcc::jit::playback::context::dlopen_built_dso): ...this new
829 function.
830 * jit-playback.h (gcc::jit::playback::context::dlopen_built_dso):
831 New function.
832
82e0c914
DM
8332014-12-09 David Malcolm <dmalcolm@redhat.com>
834
835 PR jit/64166
836 * docs/topics/contexts.rst (Debugging): Add description of
837 gcc_jit_context_enable_dump.
838 * docs/_build/texinfo/libgccjit.texi: Regenerate.
839 * jit-playback.c: Include context.h.
840 (class auto_argvec): New class.
841 (auto_argvec::~auto_argvec): New function.
842 (gcc::jit::playback::context::compile): Convert fake_args to be
843 an auto_argvec, so that it can contain dynamically-allocated
844 strings. Construct a vec of all requested dumps, and pass it to
845 make_fake_args. Extract requested dumps between the calls to
846 toplev::main and toplev::finalize.
847 (gcc::jit::playback::context::make_fake_args): Convert param
848 "argvec" to be a vec <char *>, and gain a "requested_dumps"
849 param. Convert to dynamically-allocated arg strings by converting
850 ADD_ARG to take a copy of the arg, and add ADD_ARG_TAKE_OWNERSHIP
851 for args that are already a copy. Add args for all requested dumps.
852 (gcc::jit::playback::context::extract_any_requested_dumps): New
853 function.
854 (gcc::jit::playback::context::read_dump_file): New function.
855 * jit-playback.h (gcc::jit::playback::context::make_fake_args):
856 Convert param "argvec" to be a vec <char *>, and gain a
857 "requested_dumps" param.
858 (gcc::jit::playback::context::extract_any_requested_dumps): New
859 function.
860 (gcc::jit::playback::context::read_dump_file): New function.
861 * jit-recording.c (gcc::jit::recording::context::enable_dump): New
862 function.
863 (gcc::jit::recording::context::get_all_requested_dumps): New
864 function.
865 * jit-recording.h (gcc::jit::recording::requested_dump): New
866 struct.
867 (gcc::jit::recording::context::enable_dump): New function.
868 (gcc::jit::recording::context::get_all_requested_dumps): New
869 function.
870 (gcc::jit::recording::context::m_requested_dumps): New field.
871 * libgccjit.c (gcc_jit_context_enable_dump): New API entrypoint.
872 * libgccjit.h (gcc_jit_context_enable_dump): New API entrypoint.
873 * libgccjit.map (gcc_jit_context_enable_dump): New API entrypoint.
874
53b730ff
DM
8752014-12-08 David Malcolm <dmalcolm@redhat.com>
876
877 * libgccjit++.h: Indent the forward declarations of the classes to
878 show the inheritance hierarchy.
879
0f379445
DM
8802014-12-08 David Malcolm <dmalcolm@redhat.com>
881
882 * notes.txt: Show the beginning and ending of
883 recording::context::compile vs playback::context::compile. Show
884 the creation and unlinking of the tempdir. Show toplev::finalize.
885 Move "RELEASE MUTEX" to the correct location. Show
886 gcc_jit_result_release, and indicate where the
887 dlopen/dlsym/dlclose occur.
888
81ba15f1
DM
8892014-12-01 David Malcolm <dmalcolm@redhat.com>
890
891 * docs/examples/tut02-square.c (main): Release the context
892 earlier, to show that this is possible. Update error-handling
893 to avoid a double-release of the context, and to avoid
894 releasing a NULL result.
895 * docs/intro/tutorial02.rst: Discuss gcc_jit_context_release.
896 * docs/topics/functions.rst (GCC_JIT_FUNCTION_EXPORTED): Emphasize
897 * docs/topics/results.rst (gcc_jit_result): Mention that this
898 controls the lifetimes of machine code functions.
899 (gcc_jit_result_get_code): Spell out the requirements for this
900 to succeed, and the lifetime of the result.
901 (gcc_jit_result_release): Mention that this invalidates any code
902 that was obtained from the result.
903 * docs/_build/texinfo/libgccjit.texi: Regenerate.
904
e250f0dc
DM
9052014-12-01 David Malcolm <dmalcolm@redhat.com>
906
907 PR jit/64018
908 * docs/intro/tutorial02.rst: Spell out lifetime of generated code.
909 Add description of error-handling, taken in part from...
910 * docs/topics/contexts.rst (Error-handling): Expand, and move some
911 content to tutorial02.rst.
912 * docs/_build/texinfo/libgccjit.texi: Regenerate.
913
eeafb319
DM
9142014-12-01 David Malcolm <dmalcolm@redhat.com>
915
916 PR jit/64020
917 * docs/topics/types.rst (Standard types) Add new enum values to
918 the table of enum gcc_jit_types: GCC_JIT_TYPE_COMPLEX_FLOAT,
919 GCC_JIT_TYPE_COMPLEX_DOUBLE, GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE.
920 Widen the left-hand column so that
921 GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE will fit.
922 * docs/_build/texinfo/libgccjit.texi: Regenerate.
923
924 * jit-builtins.c: Include stringpool.h and jit-playback.h.
925 Move everything out of the gcc::jit::recording namespace into
926 just gcc::jit.
927 (struct builtin_data): Add fields "fnclass", "attr", and
928 "implicit_p".
929 (DEF_BUILTIN): Update macro so populate the new fields.
930 (builtins_manager::builtins_manager): Update for move out of
931 recording namespace. Initialize the m_attributes array.
932 (builtins_manager::get_builtin_function): Likewise.
933 (builtins_manager::get_builtin_function_by_id): New function.
934 (builtins_manager::make_builtin_function): Update for move out of
935 recording namespace. Add fix for PR jit/64020 by detecting
936 specific builtin ids and having them ensure that builtins for
937 other ids are created as necessary.
938 (builtins_manager::get_type): Update for move out of recording
939 namespace.
940 (builtins_manager::make_type): Likewise. Add some missing
941 #undefs.
942 (builtins_manager::make_primitive_type): Update for move out of
943 recording namespace. Implement the three BT_COMPLEX_ cases and
944 BT_DOUBLE_PTR.
945 (builtins_manager::make_fn_type): Update for move out of recording
946 namespace.
947 (builtins_manager::make_ptr_type): Likewise.
948 (builtins_manager::finish_playback): New function.
949 (builtins_manager::get_class): New function.
950 (builtins_manager::implicit_p): New function.
951 (builtins_manager::get_attrs_tree): Two new functions.
952 (builtins_manager::make_attrs_tree): New function.
953
954 * jit-builtins.h: Move everything out of the gcc::jit::recording
955 namespace into just gcc::jit.
956 (enum built_in_attribute): New.
957 (builtins_manager::builtins_manager): Update decl for namespace
958 change.
959 (builtins_manager::get_builtin_function): Likewise.
960 (builtins_manager::get_class): New.
961 (builtins_manager::implicit_p): New.
962 (builtins_manager::get_attrs_tree): Two new functions.
963 (builtins_manager::make_attrs_tree): New function.
964 (builtins_manager::finish_playback): New.
965 (builtins_manager::get_builtin_function_by_id): New.
966 (builtins_manager::make_builtin_function): Update decl for
967 namespace change.
968 (builtins_manager::get_type): Likewise.
969 (builtins_manager::make_type): Likewise.
970 (builtins_manager::make_primitive_type): Likewise.
971 (builtins_manager::make_fn_type): Likewise.
972 (builtins_manager::make_ptr_type): Likewise.
973 (builtins_manager): Likewise for fields. Add new field
974 "m_attributes".
975
976 * jit-common.h (NUM_GCC_JIT_TYPES): Update.
977 (builtins_manager): Update forward decl to reflect namespace
978 change.
979
980 * jit-playback.c: Include attribs.h and jit-builtins.h.
981 (gcc::jit::playback::context::get_tree_node_for_type): Add cases
982 for the new COMPLEX_ types.
983 (gcc::jit::playback::context::new_function): If creating a
984 builtin, set the DECL_BUILT_IN_CLASS and attributes on the fndecl,
985 and call set_builtin_decl.
986 (gcc::jit::playback::context::replay): If we have a
987 builtins_manager, call its finish_playback method when we're done.
988
989 * jit-playback.h:
990 (gcc::jit::playback::context::get_builtins_manager): New function.
991
992 * jit-recording.c
993 (gcc::jit::recording::context::get_builtins_manager): New function.
994 (gcc::jit::recording::get_builtin_function): Use
995 get_builtins_manager, in case we're a child context.
996 (gcc::jit::recording::memento_of_get_type::dereference): Add the
997 COMPLEX_ types.
998 (gcc::jit::recording::memento_of_get_type::is_int): Likewise.
999 (gcc::jit::recording::memento_of_get_type::is_float): Likewise.
1000 (gcc::jit::recording::memento_of_get_type::is_bool): Likewise.
1001 (get_type_strings): Likewise.
1002
1003 * jit-recording.h
1004 (gcc::jit::recording::context::get_builtins_manager): New.
1005
1006 * libgccjit.h (enum gcc_jit_types): Add
1007 GCC_JIT_TYPE_COMPLEX_FLOAT, GCC_JIT_TYPE_COMPLEX_DOUBLE,
1008 GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE.
1009
23844fd7
DM
10102014-12-01 David Malcolm <dmalcolm@redhat.com>
1011
1012 * jit-builtins.c
1013 (gcc::jit::recording::builtins_manager::get_builtin_function):
1014 Check for NULL return from make_builtin_function.
1015 (gcc::jit::recording::builtins_manager::make_builtin_function):
1016 Check for NULL return from get_type.
1017
c6760a13
DM
10182014-12-01 David Malcolm <dmalcolm@redhat.com>
1019
1020 * jit-playback.c (gcc::jit::playback::context::compile): Move DSO
1021 creation code into...
1022 (gcc::jit::playback::context::convert_to_dso): New function.
1023 * jit-playback.h (gcc::jit::playback::context::convert_to_dso):
1024 New function.
1025
8f50ee3c
DM
10262014-12-01 David Malcolm <dmalcolm@redhat.com>
1027
1028 * jit-playback.c (gcc::jit::playback::context::compile): Use an
1029 auto_vec<const char *> rather than a const char *[20] for the
1030 top-level argv, and move the logic to build it to...
1031 (gcc::jit::playback::context::make_fake_args): New function.
1032 * jit-playback.h (gcc::jit::playback::context::make_fake_args):
1033 New function.
1034
56dea35f
DM
10352014-12-01 David Malcolm <dmalcolm@redhat.com>
1036
1037 * Make-lang.in (jit_OBJS): Add jit/jit-result.o.
1038 * jit-playback.c: Include new header jit-result.h.
1039 (gcc::jit::result::result): Move to new file jit-result.c.
1040 (gcc::jit::result::~result): Likewise.
1041 (gcc::jit::playback::result): Likewise.
1042 * jit-recording.h (class gcc::jit::result): Move to new
1043 header jit-result.h.
1044 * jit-result.c: New file, to contain...
1045 (gcc::jit::result::result): Move here from jit-playback.c,
1046 removing erroneous "playback" namespace from comment.
1047 (gcc::jit::result::~result): Likewise.
1048 (gcc::jit::playback::result): Likewise.
1049 * jit-result.h: New file, to contain...
1050 (class gcc::jit::result): Move from jit-recording.h.
1051 * libgccjit.c: Include jit-result.h.
1052 (gcc_jit_result_get_code): Update comment to reflect move
1053 of implementation.
1054 (gcc_jit_result_release): Likewise.
1055
52b9468f
DM
10562014-12-01 David Malcolm <dmalcolm@redhat.com>
1057
1058 PR jit/63854
1059 * docs/examples/tut04-toyvm/toyvm.c
1060 (toyvm_compiled_function): New typedef.
1061 (toyvm_compiled_func) Rename to...
1062 (toyvm_compiled_code) ...this.
1063 (struct toyvm_compiled_function): New struct.
1064 (toyvm_function_compile): Return a toyvm_compiled_function *
1065 rather than a toyvm_compiled_func, so that the caller can fully
1066 clean things up. Free "funcname".
1067 (test_script): Update for change to toyvm_function_compile.
1068 Clean up the toyvm_compiled_function.
1069 (main): Likewise.
1070 (docs/intro/tutorial04.rst): Update to reflect the above changes,
1071 and to better spell out the lifetime of the compiled code.
1072
c8d19a69
DM
10732014-12-01 David Malcolm <dmalcolm@redhat.com>
1074
1075 PR jit/63854
1076 * jit-builtins.c
1077 (gcc::jit::recording::builtins_manager::make_fn_type): Call the
1078 context's new_function_type method, rather than directly creating
1079 a function_type instance.
1080 * jit-recording.c
1081 (gcc::jit::recording::context::new_function_type): New method,
1082 adapted from part of...
1083 (gcc::jit::recording::context::new_function_ptr_type): ...this.
1084 Update to call new_function_type.
1085 * jit-recording.h
1086 (gcc::jit::recording::context::new_function_type): New method.
1087
c985705a
DM
10882014-12-01 David Malcolm <dmalcolm@redhat.com>
1089
1090 PR jit/63969
1091 * jit-playback.c: Ensure that ctxt_progname is non-NULL.
1092
b957b2e0
DM
10932014-11-19 David Malcolm <dmalcolm@redhat.com>
1094
1095 PR jit/63854
1096 * jit-playback.c (gcc::jit::playback::compound_type::set_fields):
1097 Convert param from const vec<playback::field *> & to
1098 const auto_vec<playback::field *> *.
1099 (gcc::jit::playback::context::new_function_type): Convert param
1100 "param_types" from vec<type *> * to const auto_vec<type *> *.
1101 (gcc::jit::playback::context::new_function): Convert param
1102 "params" from vec<param *> * to const auto_vec<param *> *.
1103 (gcc::jit::playback::context::build_call): Convert param "args"
1104 from vec<rvalue *> to const auto_vec<rvalue *> *.
1105 (gcc::jit::playback::context::new_call): Likewise.
1106 (gcc::jit::playback::context::new_call_through_ptr): Likewise.
1107 (wrapper_finalizer): New function.
1108 (gcc::jit::playback::wrapper::operator new): Call the finalizer
1109 variant of ggc_internal_cleared_alloc, supplying
1110 wrapper_finalizer.
1111 (gcc::jit::playback::function::finalizer): New.
1112 (gcc::jit::playback::block::finalizer): New.
1113 (gcc::jit::playback::source_file::finalizer): New.
1114 (gcc::jit::playback::source_line::finalizer): New.
1115
1116 * jit-playback.h
1117 (gcc::jit::playback::context::new_function_type): Convert param
1118 "param_types" from vec<type *> * to const auto_vec<type *> *.
1119 (gcc::jit::playback::context::new_function): Convert param
1120 "params" from vec<param *> * to const auto_vec<param *> *.
1121 (gcc::jit::playback::context::new_call): Convert param
1122 "args" from vec<rvalue *> to const auto_vec<rvalue *> *.
1123 (gcc::jit::playback::context::new_call_through_ptr): Likewise.
1124 (gcc::jit::playback::context::build_call): Likewise.
1125 (gcc::jit::playback::context): Convert fields "m_functions",
1126 "m_source_files", "m_cached_locations" from vec to auto_vec.
1127 (gcc::jit::playback::wrapper::finalizer): New virtual function.
1128 (gcc::jit::playback::compound_type::set_fields): Convert param fro
1129 const vec<playback::field *> & to
1130 const auto_vec<playback::field *> *.
1131 (gcc::jit::playback::function::finalizer): New.
1132 (gcc::jit::playback::block::finalizer): New.
1133 (gcc::jit::playback::source_file::finalizer): New.
1134 (gcc::jit::playback::source_line::finalizer): New.
1135
1136 * jit-recording.c
1137 (gcc::jit::recording::function_type::replay_into): Convert local
1138 from a vec into an auto_vec.
1139 (gcc::jit::recording::fields::replay_into): Likewise.
1140 (gcc::jit::recording::function::replay_into): Likewise.
1141 (gcc::jit::recording::call::replay_into): Likewise.
1142 (gcc::jit::recording::call_through_ptr::replay_into): Likewise.
1143
1144 * jit-recording.h (gcc::jit::recording::context): Convert fields
1145 "m_mementos", "m_compound_types", "m_functions" from vec<> to
1146 auto_vec <>.
1147 (gcc::jit::recording::function_type::get_param_types): Convert
1148 return type from vec<type *> to const vec<type *> &.
1149 (gcc::jit::recording::function_type): Convert field
1150 "m_param_types" from a vec<> to an auto_vec<>.
1151 (gcc::jit::recording::fields): Likewise for field "m_fields".
1152 (gcc::jit::recording::function::get_params): Convert return type
1153 from vec <param *> to const vec<param *> &.
1154 (gcc::jit::recording::function): Convert fields "m_params",
1155 "m_locals", "m_blocks" from vec<> to auto_vec<>.
1156 (gcc::jit::recording::block): Likewise for field "m_statements".
1157 vec<> to auto_vec<>.
1158 (gcc::jit::recording::call): Likewise for field "m_args".
1159 (gcc::jit::recording::call_through_ptr): Likewise.
1160
79cafc7a
DM
11612014-11-19 David Malcolm <dmalcolm@redhat.com>
1162
1163 PR jit/63854
1164 * jit-recording.c (recording::function::validate): Convert
1165 "worklist" from vec<> to autovec<> to fix a leak.
1166
35485da9
DM
11672014-11-11 David Malcolm <dmalcolm@redhat.com>
1168
1169 * ChangeLog.jit: New.
1170 * ChangeLog: New.
1171 * Make-lang.in: New.
1172 * TODO.rst: New.
1173 * config-lang.in: New.
1174 * docs/Makefile: New.
1175 * docs/_build/texinfo/Makefile: New.
1176 * docs/_build/texinfo/factorial.png: New.
1177 * docs/_build/texinfo/libgccjit.texi: New.
1178 * docs/_build/texinfo/sum-of-squares.png: New.
1179 * docs/conf.py: New.
1180 * docs/examples/tut01-hello-world.c: New.
1181 * docs/examples/tut02-square.c: New.
1182 * docs/examples/tut03-sum-of-squares.c: New.
1183 * docs/examples/tut04-toyvm/Makefile: New.
1184 * docs/examples/tut04-toyvm/factorial.toy: New.
1185 * docs/examples/tut04-toyvm/fibonacci.toy: New.
1186 * docs/examples/tut04-toyvm/toyvm.c: New.
1187 * docs/index.rst: New.
1188 * docs/internals/index.rst: New.
1189 * docs/intro/factorial.png: New.
1190 * docs/intro/index.rst: New.
1191 * docs/intro/sum-of-squares.png: New.
1192 * docs/intro/tutorial01.rst: New.
1193 * docs/intro/tutorial02.rst: New.
1194 * docs/intro/tutorial03.rst: New.
1195 * docs/intro/tutorial04.rst: New.
1196 * docs/topics/contexts.rst: New.
1197 * docs/topics/expressions.rst: New.
1198 * docs/topics/functions.rst: New.
1199 * docs/topics/index.rst: New.
1200 * docs/topics/locations.rst: New.
1201 * docs/topics/objects.rst: New.
1202 * docs/topics/results.rst: New.
1203 * docs/topics/types.rst: New.
1204 * dummy-frontend.c: New.
1205 * jit-builtins.c: New.
1206 * jit-builtins.h: New.
1207 * jit-common.h: New.
1208 * jit-playback.c: New.
1209 * jit-playback.h: New.
1210 * jit-recording.c: New.
1211 * jit-recording.h: New.
1212 * libgccjit++.h: New.
1213 * libgccjit.c: New.
1214 * libgccjit.h: New.
1215 * libgccjit.map: New.
1216 * notes.txt: New.
1217
12182013-07-26 David Malcolm <dmalcolm@redhat.com>
1219
1220 * Initial creation
1221
1e3b6a3d 1222Copyright (C) 2013-2015 Free Software Foundation, Inc.
35485da9
DM
1223
1224Copying and distribution of this file, with or without modification,
1225are permitted in any medium without royalty provided the copyright
1226notice and this notice are preserved.