1 2015-06-25 Andrew MacLeod <amacleod@redhat.com>
3 * dummy-frontend.c: Remove ipa-ref.h and plugin-api.h from include list.
4 * jit-playback.c: Likewise.
6 2015-06-25 Andrew Macleod <amacleod@redhat.com>
8 * jit-common.h: Don't include alias.h.
10 2015-06-17 David Malcolm <dmalcolm@redhat.com>
12 * libgccjit.c (gcc_jit_lvalue_access_field): Verify that the field
13 is for the correct struct.
14 (gcc_jit_rvalue_access_field): Likewise.
16 2015-06-17 Andrew MacLeod <amacleod@redhat.com>
18 * dummy-frontend.c: Do not include input.h, line-map.h or is-a.h.
19 * jit-common.h: Likewise.
20 * jit-playback.c: Likewise.
22 2015-06-16 David Malcolm <dmalcolm@redhat.com>
25 * jit-recording.c: Within namespace gcc::jit::recording::
26 (rvalue::get_debug_string_parens): New function.
27 (binary_op::make_debug_string): Update to mimic C precedence
29 (binary_op_precedence): New array.
30 (binary_op::get_precedence): New function.
31 (comparison::make_debug_string): Update to mimic C precedence
33 (comparison_precedence): New array.
34 (comparison::get_precedence): New function.
35 (cast::make_debug_string): Update to mimic C precedence rules.
36 (call::make_debug_string): Likewise.
37 (call_through_ptr::make_debug_string): Likewise.
38 (array_access::make_debug_string): Likewise.
39 (access_field_of_lvalue::make_debug_string): Likewise.
40 (access_field_rvalue::make_debug_string): Likewise.
41 (dereference_field_rvalue::make_debug_string): Likewise.
42 (dereference_rvalue::make_debug_string): Likewise.
43 (get_address_of_lvalue::make_debug_string): Likewise.
44 * jit-recording.h: Within namespace gcc::jit::recording::
45 (precedence): New enum.
46 (rvalue::rvalue): Initialize field "m_parenthesized_string".
47 (rvalue::get_debug_string_parens): New method.
48 (rvalue::get_precedence): New pure virtual function.
49 (rvalue::m_parenthesized_string): New field.
50 (param::get_precedence): New function.
51 (global::get_precedence): New function.
52 (memento_of_new_rvalue_from_const::get_precedence): New function.
53 (memento_of_new_string_literal::get_precedence): New function.
54 (unary_op::get_precedence): New function.
55 (binary_op::get_precedence): New function.
56 (comparison::get_precedence): New function.
57 (cast::get_precedence): New function.
58 (call::get_precedence): New function.
59 (call_through_ptr::get_precedence): New function.
60 (array_access::get_precedence): New function.
61 (access_field_of_lvalue::get_precedence): New function.
62 (access_field_rvalue::get_precedence): New function.
63 (dereference_field_rvalue::get_precedence): New function.
64 (dereference_rvalue::get_precedence): New function.
65 (get_address_of_lvalue::get_precedence): New function.
66 (local::get_precedence): New function.
68 2015-06-09 Matthias Klose <doko@ubuntu.com>
70 * Make-lang.in (jit.install-common): Install headers using INSTALL_DATA.
72 2015-06-08 Andrew MacLeod <amacleod@redhat.com>
74 * dummy-frontend.c : Adjust include files.
75 * jit-common.h : Likewise.
76 * jit-playback.c : Likewise.
78 2015-06-05 David Malcolm <dmalcolm@redhat.com>
81 (jit_langhook_post_compilation_parsing_cleanups): Remove.
82 (LANG_HOOKS_POST_COMPILATION_PARSING_CLEANUPS): Remove
83 * jit-playback.c (gcc::jit::playback::context::new_global): Add
84 call to varpool_node::finalize_decl.
85 (gcc::jit::playback::context::finalize_global_decls): Remove.
87 (gcc::jit::playback::context::finalize_global_decls): Remove.
89 2015-06-05 David Malcolm <dmalcolm@redhat.com>
91 * dummy-frontend.c (jit_langhook_write_globals): Rename to...
92 (jit_langhook_post_compilation_parsing_cleanups): ...this, and
93 eliminate calls to finalize_compilation_unit and
95 (LANG_HOOKS_WRITE_GLOBALS): Rename to...
96 (LANG_HOOKS_POST_COMPILATION_PARSING_CLEANUPS): ...this and
97 redirect from jit_langhook_write_globals to
98 jit_langhook_post_compilation_parsing_cleanups.
100 (gcc::jit::playback::context::write_global_decls_1): Rename to...
101 (gcc::jit::playback::context::finalize_global_decls): ...this.
102 (gcc::jit::playback::context::write_global_decls_1): Delete.
104 (gcc::jit::playback::context::write_global_decls_1): Rename to...
105 (gcc::jit::playback::context::finalize_global_decls): ...this.
106 (gcc::jit::playback::context::write_global_decls_1): Delete.
108 2015-06-04 Andrew MacLeod <amacleod@redhat.com>
110 * dummy-frontend.c: Adjust includes for restructured coretypes.h.
111 * jit-common.h: Likewise.
112 * jit-playback.c: Likewise.
114 2015-05-12 David Malcolm <dmalcolm@redhat.com>
116 * jit-builtins.c: Include vec.h before target.h.
118 2015-04-27 Jim Wilson <jim.wilson@linaro.org>
120 * Make-lang.in (jit.mostlyclean): Remove shared libraries and object
123 2015-04-09 David Malcolm <dmalcolm@redhat.com>
126 * docs/cp/topics/expressions.rst (Simple expressions): Fix copy
127 and paste error in description of gccjit::context::one.
128 * docs/topics/expressions.rst (Simple expressions): Likewise in
129 description of gcc_jit_context_one.
130 * docs/_build/texinfo/libgccjit.texi: Regenerate.
132 2015-03-13 Uros Bizjak <ubizjak@gmail.com>
134 * jit-recording.c (dump::write): Also check vasprintf return value.
135 (recording::context::add_error_va): Ditto.
136 (recording::string::from_printf): Ditto.
138 2015-03-13 David Malcolm <dmalcolm@redhat.com>
140 * docs/internals/index.rst (Packaging notes): New section.
141 * docs/_build/texinfo/libgccjit.texi: Regenerate.
143 2015-03-05 David Malcolm <dmalcolm@redhat.com>
145 * docs/cp/intro/tutorial03.rst: Add missing arguments to
146 gccjit::block::end_with_conditional call. Add on_true/on_false
147 comments. Tweak the wording.
148 * docs/intro/tutorial03.rst: Add missing arguments to
149 gcc_jit_block_end_with_conditional call. Add some clarifying
151 * docs/topics/compilation.rst: Tweak the wording to avoid an
152 ambiguous use of "this".
153 * docs/topics/contexts.rst: Fix a typo.
154 * docs/topics/expressions.rst (GCC_JIT_BINARY_OP_MINUS): Remove
156 * docs/_build/texinfo/libgccjit.texi: Regenerate.
158 2015-02-24 Thomas Schwinge <thomas@codesourcery.com>
161 * jit-builtins.c (DEF_FUNCTION_TYPE_VAR_8)
162 (DEF_FUNCTION_TYPE_VAR_12): Remove macros.
163 (DEF_FUNCTION_TYPE_VAR_7, DEF_FUNCTION_TYPE_VAR_11): New macros.
164 * jit-builtins.h (DEF_FUNCTION_TYPE_VAR_8)
165 (DEF_FUNCTION_TYPE_VAR_12): Remove macros.
166 (DEF_FUNCTION_TYPE_VAR_7, DEF_FUNCTION_TYPE_VAR_11): New macros.
168 2015-02-04 David Malcolm <dmalcolm@redhat.com>
171 * docs/conf.py (html_theme): Change from 'pyramid'
174 2015-02-04 David Malcolm <dmalcolm@redhat.com>
176 * docs/topics/contexts.rst (gcc_jit_context_acquire): Fix
178 * docs/_build/texinfo/libgccjit.texi: Regenerate.
180 2015-02-03 David Malcolm <dmalcolm@redhat.com>
182 * jit-logging.h (gcc::jit::log_user::log): Make const.
183 * jit-recording.c (gcc::jit::recording::context::set_str_option):
184 Log the new value of the option.
185 (gcc::jit::recording::context::set_int_option): Likewise.
186 (gcc::jit::recording::context::set_bool_option): Likewise.
187 (gcc::jit::recording::context::compile): Log the value of all
189 (gcc::jit::recording::context::compile_to_file): Likewise.
190 (gcc::jit::recording::context::log_all_options): New function.
191 (gcc::jit::recording::context::log_str_option): New function.
192 (gcc::jit::recording::context::log_int_option): New function.
193 (gcc::jit::recording::context::log_bool_option): New function.
194 * jit-recording.h (gcc::jit::recording::context::log_all_options):
196 (gcc::jit::recording::context::log_str_option): New function.
197 (gcc::jit::recording::context::log_int_option): New function.
198 (gcc::jit::recording::context::log_bool_option): New function.
199 * docs/internals/test-hello-world.exe.log.txt: Update for above
201 * docs/_build/texinfo/libgccjit.texi: Regenerate.
203 2015-02-03 David Malcolm <dmalcolm@redhat.com>
206 * Make-lang.in (jit_OBJS): Add jit/jit-spec.o and gcc.o.
207 (LIBGCCJIT_FILENAME): Add EXTRA_GCC_OBJS.
208 * jit-playback.c: Include gcc.h.
209 (gcc::jit::playback::context::compile): Move mutex acquisition
210 to before the call to make_fake_args.
211 (append_arg_from_driver): New function.
212 (gcc::jit::playback::context::make_fake_args): On the first call,
213 call into driver_get_configure_time_options to get configure-time
214 default options and cache them. Add them to the args for
216 * jit-spec.c: New source file.
217 * docs/internals/test-hello-world.exe.log.txt: Update to reflect
219 * docs/_build/texinfo/libgccjit.texi: Regenerate.
221 2015-02-02 David Malcolm <dmalcolm@redhat.com>
224 * dummy-frontend.c (jit_langhook_type_for_mode): Support
225 TYPE_MODE (long_long_integer_type_node).
227 2015-01-27 David Malcolm <dmalcolm@redhat.com>
229 * docs/internals/test-hello-world.exe.log.txt: Add example version
231 * docs/_build/texinfo/libgccjit.texi: Regenerate.
232 * jit-common.h (gcc::jit::dump::get_file): New accessor.
233 * jit-logging.c: Include toplev.h.
234 (gcc::jit::logger::logger): Log the GCC version.
235 * jit-recording.c: Include toplev.h.
236 (gcc:jit::recording::context::dump_reproducer_to_file): Log the
239 2015-01-26 David Malcolm <dmalcolm@redhat.com>
241 * docs/topics/compilation.rst (gcc_jit_result_get_code): Fix typo.
242 * docs/topics/contexts.rst (gcc_jit_context_get_last_error): The
243 error buffer is only valid until the next call to the context.
244 * docs/_build/texinfo/libgccjit.texi: Regenerate.
245 * libgccjit.h (gcc_jit_context_get_first_error): Reword the
246 comment to omit mention of compiling.
247 (gcc_jit_context_get_last_error): The error buffer is only valid
248 until the next call to the context.
250 2015-01-26 David Malcolm <dmalcolm@redhat.com>
253 * config-lang.in (compilers): Drop "libgccjit.so".
255 2015-01-23 David Malcolm <dmalcolm@redhat.com>
258 * jit-playback.c (gcc::jit::playback::context::compile): Construct
259 toplev instances with init_signals=false.
261 2015-01-19 David Malcolm <dmalcolm@redhat.com>
263 * docs/cp/topics/results.rst: Rename to...
264 * docs/cp/topics/compilation.rst: ...this, and add section on
265 ahead-of-time compilation.
266 * docs/cp/topics/index.rst: Update for renaming of results.rst
268 * docs/examples/emit-alphabet.bf: New file, a sample "brainf"
270 * docs/examples/tut05-bf.c: New file, implementing a compiler
272 * docs/internals/test-hello-world.exe.log.txt: Update to reflect
273 changes to logger output.
274 * docs/intro/index.rst: Add tutorial05.rst
275 * docs/intro/tutorial05.rst: New file.
276 * docs/topics/results.rst: Rename to...
277 * docs/topics/compilation.rst: ...this, and add section on
278 ahead-of-time compilation.
279 * docs/topics/index.rst: Update for renaming of results.rst to
281 * docs/_build/texinfo/libgccjit.texi: Regenerate.
282 * jit-playback.c (gcc::jit::playback::context::compile): Convert
283 return type from result * to void. Move the code to convert to
284 dso and dlopen the result to a new pure virtual "postprocess"
286 (gcc::jit::playback::compile_to_memory::compile_to_memory): New
288 (gcc::jit::playback::compile_to_memory::postprocess): New
289 function, based on playback::context::compile.
290 (gcc::jit::playback::compile_to_file::compile_to_file): New
292 (gcc::jit::playback::compile_to_file::postprocess): New function.
293 (gcc::jit::playback::compile_to_file::copy_file): New function.
294 (gcc::jit::playback::context::convert_to_dso): Move internals
296 (gcc::jit::playback::context::invoke_driver): New method. Add
297 "-shared" and "-c" options to driver's argv as needed.
298 * jit-playback.h: Include "timevar.h".
299 (gcc::jit::playback::context::compile): Convert return type from
301 (gcc::jit::playback::context::postprocess): New pure virtual
302 function, making this an abstract base class.
303 (gcc::jit::playback::context::get_tempdir): New accessor.
304 (gcc::jit::playback::context::invoke_driver): New function.
305 (class gcc::jit::playback::compile_to_memory): New subclass of
307 (class gcc::jit::playback::compile_to_file): Likewise.
308 * jit-recording.c (gcc::jit::recording::context::compile): Use a
309 playback::compile_to_memory, and extract its result.
310 (gcc::jit::recording::context::compile_to_file): New function.
311 * jit-recording.h (gcc::jit::recording::context::compile_to_file):
313 * libgccjit++.h (gccjit::context::compile_to_file): New method.
314 * libgccjit.c (gcc_jit_context_compile): Update log message to
315 clarify that this is an in-memory compile.
316 (gcc_jit_context_compile_to_file): New function.
317 * libgccjit.h (gcc_jit_context): Clarify that you can compile
318 a context more than once, and that you can compile to a file
319 as well as to memory.
320 (gcc_jit_result): Clarify that this is the result of an
321 in-memory compilation.
322 (gcc_jit_context_compile): Clarify that you can compile, and that
323 this is an in-memory compilation.
324 (enum gcc_jit_output_kind): New enum.
325 (gcc_jit_context_compile_to_file): New function.
326 (gcc_jit_context_enable_dump): Clarify comment to cover both forms
328 * libgccjit.map (gcc_jit_context_compile_to_file): New API
330 * notes.txt: Update to show the playback::context::postprocess
333 2015-01-19 David Malcolm <dmalcolm@redhat.com>
336 (gcc::jit::recording::memento_of_new_string_literal::make_debug_string):
337 Add missing format string.
339 2015-01-16 David Malcolm <dmalcolm@redhat.com>
341 * Make-lang.in (lang_checks_parallelized): Add "check-jit".
342 (check_jit_parallelize): Set this to an arbitrary value (10).
344 2015-01-16 Jakub Jelinek <jakub@redhat.com>
346 * jit-builtins.h (DEF_FUNCTION_TYPE_VAR_5): Fix spelling of
348 (DEF_FUNCTION_TYPE_VAR_8, DEF_FUNCTION_TYPE_VAR_12): Define and
350 * jit-builtins.c (DEF_FUNCTION_TYPE_VAR_8, DEF_FUNCTION_TYPE_VAR_12):
353 2015-01-15 Richard Sandiford <richard.sandiford@arm.com>
355 Update copyright years in docs/.
357 2015-01-15 David Malcolm <dmalcolm@redhat.com>
359 * libgccjit.c (gcc_jit_block_add_assignment_op): Check that the
360 lvalue and the rvalue are of compatible type.
362 2015-01-13 David Malcolm <dmalcolm@redhat.com>
364 * docs/cp/topics/contexts.rst (Debugging): Add
365 gccjit::context::dump_reproducer_to_file.
366 * docs/internals/index.rst (Design notes): New section,
367 discussing input validation and
368 gcc_jit_context_dump_reproducer_to_file.
369 * docs/topics/contexts.rst (Debugging): Add
370 gcc_jit_context_dump_reproducer_to_file.
371 * docs/_build/texinfo/libgccjit.texi: Regenerate.
372 * jit-common.h (gcc::jit::dump::get_context): New accessor.
373 * jit-recording.c: Include "hash-map.h".
374 Within namespace ::gcc::jit...
375 (dump::write): Flush each line.
376 (dump::make_location): Pass false for new param "created_by_user".
377 (class allocator): New class.
378 (allocator::~allocator): New function.
379 (allocator::xstrdup_printf): New function.
380 (allocator::xstrdup_printf_va): New function.
381 (class reproducer): New subclass of dump.
382 (reproducer::reproducer): New function.
383 (reproducer::write_params): New function.
384 (reproducer::write_args): New function.
385 (reproducer::make_identifier): New function.
386 (reproducer::make_tmp_identifier): New function.
387 (reproducer::get_identifier): New pair of functions.
388 (reproducer::get_identifier_as_rvalue): New function.
389 (reproducer::get_identifier_as_lvalue): New function.
390 (reproducer::get_identifier_as_type): New function.
391 (reproducer::xstrdup_printf): New function.
392 (recording::context::context): Initialize m_toplevel_ctxt.
393 (recording::context::new_location): Add param created_by_user.
394 (str_option_reproducer_strings): New table of strings.
395 (int_option_reproducer_strings): Likewise.
396 (bool_option_reproducer_strings): Likewise.
397 (get_type_enum_strings): Likewise.
398 (names_of_function_kinds): Likewise.
399 (global_kind_reproducer_strings): Likewise.
400 (unary_op_reproducer_strings): Likewise.
401 (binary_op_reproducer_strings): Likewise.
402 (comparison_reproducer_strings): Likewise.
403 Within namespace ::gcc::jit::recording::...
404 (context::dump_reproducer_to_file): New function.
405 (string::write_reproducer): Likewise.
406 (location::write_reproducer): Likewise.
407 (type::access_as_type): Likewise.
408 (memento_of_get_type::write_reproducer): Likewise.
409 (memento_of_get_pointer::write_reproducer): Likewise.
410 (memento_of_get_const::write_reproducer): Likewise.
411 (memento_of_get_volatile::write_reproducer): Likewise.
412 (array_type::write_reproducer): Likewise.
413 (function_type::write_reproducer): Likewise.
414 (function_type::write_deferred_reproducer): Likewise.
415 (field::write_reproducer): Likewise.
416 (struct_::access_as_type): Likewise.
417 (struct_::write_reproducer): Likewise.
418 (union_::write_reproducer): Likewise.
419 (fields::write_reproducer): Likewise.
420 (rvalue::access_as_rvalue): Likewise.
421 (lvalue::access_as_rvalue): Likewise.
422 (lvalue::access_as_lvalue): Likewise.
423 (param::access_as_rvalue): Likewise.
424 (param::access_as_lvalue): Likewise.
425 (param::write_reproducer): Likewise.
426 (function::write_reproducer): Likewise.
427 (block::write_reproducer): Likewise.
428 (global::write_reproducer): Likewise.
429 (memento_of_new_rvalue_from_const <int>::write_reproducer):
431 (memento_of_new_rvalue_from_const <long>::write_reproducer):
433 (memento_of_new_rvalue_from_const <double>::write_reproducer):
435 (memento_of_new_rvalue_from_const <void *>::write_reproducer):
437 (memento_of_new_string_literal::write_reproducer): Likewise.
438 (unary_op::write_reproducer): Likewise.
439 (binary_op::write_reproducer): Likewise.
440 (comparison::write_reproducer): Likewise.
441 (cast::write_reproducer): Likewise.
442 (call::write_reproducer): Likewise.
443 (call_through_ptr::write_reproducer): Likewise.
444 (array_access::write_reproducer): Likewise.
445 (access_field_of_lvalue::write_reproducer): Likewise.
446 (access_field_rvalue::write_reproducer): Likewise.
447 (dereference_field_rvalue::write_reproducer): Likewise.
448 (dereference_rvalue::write_reproducer): Likewise.
449 (get_address_of_lvalue::write_reproducer): Likewise.
450 (local::write_reproducer): Likewise.
451 (eval::write_reproducer): Likewise.
452 (assignment::write_reproducer): Likewise.
453 (assignment_op::write_reproducer): Likewise.
454 (comment::write_reproducer): Likewise.
455 (conditional::write_reproducer): Likewise.
456 (jump::write_reproducer): Likewise.
457 (return_::write_reproducer): Likewise.
458 * jit-recording.h (gcc::jit::reproducer): New forward declararion.
459 Within namespace ::gcc::jit::recording::...
460 (context::new_location): Add "created_by_user" param.
461 (context::dump_reproducer_to_file): New method.
462 (context::m_toplevel_ctxt): New field.
463 (memento::write_reproducer): New pure virtual function.
464 (memento::dyn_cast_location): New virtual function.
465 (string::write_reproducer):
466 (location::location): Add "created_by_user" param.
467 (location::dyn_cast_location): New function.
468 (location::created_by_user): New accessor.
469 (location::write_reproducer): New function.
470 (location::m_created_by_user): New field.
471 (type::access_as_type): New virtual function.
472 (location::write_reproducer): Likewise.
473 (type::access_as_type): Likewise.
474 (memento_of_get_type::write_reproducer): Likewise.
475 (memento_of_get_pointer::write_reproducer): Likewise.
476 (memento_of_get_const::write_reproducer): Likewise.
477 (memento_of_get_volatile::write_reproducer): Likewise.
478 (array_type::write_reproducer): Likewise.
479 (function_type::write_reproducer): Likewise.
480 (function_type::write_deferred_reproducer): Likewise.
481 (field::write_reproducer): Likewise.
482 (struct_::access_as_type): Likewise.
483 (struct_::write_reproducer): Likewise.
484 (union_::write_reproducer): Likewise.
485 (union_::m_fields): Remove stray unused field.
486 (fields::length): New accessor.
487 (fields::get_field): New accessor.
488 (fields::write_reproducer): New function.
489 (rvalue::access_as_rvalue): Likewise.
490 (lvalue::access_as_rvalue): Likewise.
491 (lvalue::access_as_lvalue): Likewise.
492 (param::access_as_rvalue): Likewise.
493 (param::access_as_lvalue): Likewise.
494 (param::write_reproducer): Likewise.
495 (function::write_reproducer): Likewise.
496 (block::write_reproducer): Likewise.
497 (global::write_reproducer): Likewise.
498 (memento_of_new_rvalue_from_const <HOST_TYPE>::write_reproducer):
500 (memento_of_new_string_literal::write_reproducer): Likewise.
501 (unary_op::write_reproducer): Likewise.
502 (binary_op::write_reproducer): Likewise.
503 (comparison::write_reproducer): Likewise.
504 (cast::write_reproducer): Likewise.
505 (call::write_reproducer): Likewise.
506 (call_through_ptr::write_reproducer): Likewise.
507 (array_access::write_reproducer): Likewise.
508 (access_field_of_lvalue::write_reproducer): Likewise.
509 (access_field_rvalue::write_reproducer): Likewise.
510 (dereference_field_rvalue::write_reproducer): Likewise.
511 (dereference_rvalue::write_reproducer): Likewise.
512 (get_address_of_lvalue::write_reproducer): Likewise.
513 (local::write_reproducer): Likewise.
514 (eval::write_reproducer): Likewise.
515 (assignment::write_reproducer): Likewise.
516 (assignment_op::write_reproducer): Likewise.
517 (comment::write_reproducer): Likewise.
518 (conditional::write_reproducer): Likewise.
519 (jump::write_reproducer): Likewise.
520 (return_::write_reproducer): Likewise.
521 * libgccjit++.h (gccjit::context::dump_reproducer_to_file): New.
522 * libgccjit.c (gcc_jit_context_new_location): Pass "true" as
523 param "created_by_user".
524 (gcc_jit_context_dump_reproducer_to_file): New API entrypoint.
525 * libgccjit.h (gcc_jit_context_dump_reproducer_to_file): New API
527 * libgccjit.map (gcc_jit_context_dump_reproducer_to_file): New API
530 2015-01-12 David Malcolm <dmalcolm@redhat.com>
532 * jit-recording.c (class gcc::jit::rvalue_usage_validator): New.
533 (gcc::jit::rvalue_usage_validator::rvalue_usage_validator): New
535 (gcc::jit::rvalue_usage_validator::visit): New function.
536 (gcc::jit::recording::rvalue::verify_valid_within_stmt): New
538 (gcc::jit::recording::rvalue::set_scope): New function.
539 (gcc::jit::recording::function::function): Call set_scope on each
540 param, issuing errors for any params that already have a function.
541 (gcc::jit::recording::block::add_eval): Return the new statement;
542 update the comment given that some error-checking now happens after
544 (gcc::jit::recording::block::add_assignment): Likewise.
545 (gcc::jit::recording::block::add_assignment_op): Likewise.
546 (gcc::jit::recording::block::add_comment): Likewise.
547 (gcc::jit::recording::block::end_with_conditional): Likewise.
548 (gcc::jit::recording::block::end_with_jump): Likewise.
549 (gcc::jit::recording::block::end_with_return): Likewise.
550 (gcc::jit::recording::block::validate): Add a comment.
551 (gcc::jit::recording::unary_op::visit_children): New function.
552 (gcc::jit::recording::binary_op::visit_children): New function.
553 (gcc::jit::recording::comparison::visit_children): New function.
554 (gcc::jit::recording::cast::visit_children): New function.
555 (gcc::jit::recording::call::visit_children): New function.
556 (gcc::jit::recording::call_through_ptr::visit_children): New function.
557 (gcc::jit::recording::array_access::visit_children): New function.
558 (gcc::jit::recording::access_field_of_lvalue::visit_children): New
560 (gcc::jit::recording::access_field_rvalue::visit_children): New
562 (gcc::jit::recording::dereference_field_rvalue::visit_children):
564 (gcc::jit::recording::dereference_rvalue::visit_children): New
566 (gcc::jit::recording::get_address_of_lvalue::visit_children): New
568 * jit-recording.h: Within namespace gcc::jit::recording...
569 (class rvalue_visitor): New.
570 (rvalue::rvalue): Initialize m_scope.
571 (rvalue::get_loc): New accessor.
572 (rvalue::verify_valid_within_stmt): New function.
573 (rvalue::visit_children): New pure virtual function.
574 (rvalue::set_scope): New function.
575 (rvalue::get_scope): New function.
576 (rvalue::dyn_cast_param): New function.
577 (rvalue::m_scope): New field.
578 (param::visit_children): New empty function.
579 (param::dyn_cast_param): New function.
580 (function::get_loc): New function.
581 (block::add_eval): Return the new statement.
582 (block::add_assignment): Likewise.
583 (block::add_assignment_op): Likewise.
584 (block::add_comment): Likewise.
585 (block::end_with_conditional): Likewise.
586 (block::end_with_jump): Likewise.
587 (block::end_with_return): Likewise.
588 (global::visit_children): New function.
589 (memento_of_new_rvalue_from_const<HOST_TYPE>::visit_children):
591 (memento_of_new_string_literal::visit_children): New function.
592 (unary_op::visit_children): New function.
593 (binary_op::visit_children): New function.
594 (comparison::visit_children): New function.
595 (cast::visit_children): New function.
596 (call::visit_children): New function.
597 (call_through_ptr::visit_children): New function.
598 (array_access::visit_children): New function.
599 (access_field_of_lvalue::visit_children): New function.
600 (access_field_rvalue::visit_children): New function.
601 (dereference_field_rvalue::visit_children): New function.
602 (dereference_rvalue::visit_children): New function.
603 (get_address_of_lvalue::visit_children): New function.
604 (local::local): Call set_scope.
605 (local::visit_children): New function.
606 (statement::get_block): Make public.
607 * libgccjit.c (RETURN_VAL_IF_FAIL_PRINTF5): New macro.
608 (RETURN_NULL_IF_FAIL_PRINTF5): New macro.
609 (gcc_jit_context_new_function): Verify that each param has
610 not yet been used for creating another function.
611 (gcc_jit_block_add_eval): After creating the stmt, verify
612 that the rvalue expression tree is valid to use within it.
613 (gcc_jit_block_add_assignment): Likewise for the lvalue and
614 rvalue expression trees.
615 (gcc_jit_block_add_assignment_op): Likewise.
616 (gcc_jit_block_end_with_conditional): Likewise for the boolval
618 (gcc_jit_block_end_with_return): Likewise for the rvalue
620 (gcc_jit_block_end_with_void_return): Remove return of "void",
621 now that block::end_with_return is now non-void.
623 2015-01-12 David Malcolm <dmalcolm@redhat.com>
625 * jit-playback.c (gcc::jit::playback::context::read_dump_file):
626 Add missing fclose on error-handling path.
628 2015-01-12 David Malcolm <dmalcolm@redhat.com>
630 * docs/cp/topics/expressions.rst (Global variables): Add
631 enum gcc_jit_global_kind param to gccjit::context::new_global.
632 * docs/topics/expressions.rst (Global variables): Likewise.
633 Document the new enum.
634 * docs/topics/results.rst (Compilation results): Document
636 * docs/_build/texinfo/libgccjit.texi: Regenerate.
637 * dummy-frontend.c (jit_langhook_write_globals): Call into the
638 playback context's write_global_decls_1 and write_global_decls_2
639 before and after calling symtab->finalize_compilation_unit ().
640 * jit-playback.c: Include "debug.h".
641 (gcc::jit::playback::context::new_global): Add "kind" param and
642 use it to set TREE_PUBLIC, TREE_STATIC and DECL_EXTERNAL on the
643 underlying VAR_DECL. Call varpool_node::get_create on the
644 VAR_DECL, and add it to m_globals.
645 (gcc::jit::playback::context::write_global_decls_1): New function.
646 (gcc::jit::playback::context::write_global_decls_2): New function.
647 * jit-playback.h (gcc::jit::playback::context::context): Call
649 (gcc::jit::playback::context::new_global): Add "kind" param.
650 (gcc::jit::playback::context::write_global_decls_1): New function.
651 (gcc::jit::playback::context::write_global_decls_2): New function.
652 (gcc::jit::playback::context::m_globals): New field.
653 * jit-recording.c (gcc::jit::recording::context::context):
654 Initialize m_globals.
655 (gcc::jit::recording::context::new_global): Add param "kind".
656 Add the new global to m_globals.
657 (gcc::jit::recording::context::dump_to_file): Dump the globals.
658 (gcc::jit::recording::global::replay_into): Add field m_kind.
659 (gcc::jit::recording::global::write_to_dump): New override.
660 * jit-recording.h (gcc::jit::recording::context::new_global): Add
662 (gcc::jit::recording::context::m_globals): New field.
663 (gcc::jit::recording::global::global): Add param kind.
664 (gcc::jit::recording::global::write_to_dump): New override.
665 (gcc::jit::recording::global::m_kind): New field.
666 * jit-result.c (gcc::jit::result::get_global): New function.
667 * jit-result.h (gcc::jit::result::get_global): New function.
668 * libgccjit++.h (gccjit::context::new_global): Add "kind" param.
669 * libgccjit.c (gcc_jit_context_new_global): Likewise.
670 (gcc_jit_result_get_global): New API entrypoint.
671 * libgccjit.h (gcc_jit_result_get_global): New API entrypoint.
672 (enum gcc_jit_global_kind): New enum.
673 (gcc_jit_context_new_global): API change: add "kind" param.
674 * libgccjit.map (gcc_jit_result_get_global): New symbol.
676 2015-01-09 David Malcolm <dmalcolm@redhat.com>
678 * dummy-frontend.c: Include "fixed-value.h", "alias.h", "flags.h",
679 "symtab.h", "inchash.h". Move include of "hash-set.h" much
681 * jit-builtins.c: Remove redundant includes of "opts.h" and
683 * jit-common.h: Include "hash-set.h", "input.h", "vec.h",
684 "double-int.h", "alias.h", "flags.h", "symtab.h", "inchash.h".
685 * jit-playback.c: Include "hashtab.h", "machmode.h", "input.h",
686 "statistics.h", "vec.h", "double-int.h", "real.h",
687 "fixed-value.h", "alias.h", "flags.h", "symtab.h", "tree-core.h",
688 "inchash.h", "fold-const.h". Move include of "hash-set.h" to
690 * jit-recording.c: Remove redundant includes of "opts.h" and
693 2015-01-09 David Malcolm <dmalcolm@redhat.com>
695 * docs/cp/topics/expressions.rst (Simple expressions): Use
696 ":c:type:" for C types. Document new overload of
697 gcc::jit::context::new_rvalue.
698 * docs/topics/expressions.rst (Simple expressions): Use
699 ":c:type:" for C types. Document new entrypoint
700 gcc_jit_context_new_rvalue_from_long.
701 * docs/_build/texinfo/libgccjit.texi: Regenerate.
702 * jit-playback.c: Within namespace gcc::jit::playback...
703 (context::new_rvalue_from_int): Eliminate in favor of...
704 (context::new_rvalue_from_const <int>): ...this.
705 (context::new_rvalue_from_double): Eliminate in favor of...
706 (context::new_rvalue_from_const <double>): ...this.
707 (context::new_rvalue_from_const <long>): New.
708 (context::new_rvalue_from_ptr): Eliminate in favor of...
709 (context::new_rvalue_from_const <void *>): ...this.
710 * jit-playback.h: Within namespace gcc::jit::playback...
711 (context::new_rvalue_from_int): Eliminate in favor of...
712 (context::new_rvalue_from_const <HOST_TYPE>): ...this.
713 (context::new_rvalue_from_double): Likewise.
714 (context::new_rvalue_from_ptr): Likewise.
715 * jit-recording.c: Within namespace gcc::jit::recording...
716 (context::new_rvalue_from_int): Eliminate.
717 (context::new_rvalue_from_double): Likewise.
718 (context::new_rvalue_from_ptr): Likewise.
719 (class memento_of_new_rvalue_from_const <int>):
720 Add explicit specialization.
721 (class memento_of_new_rvalue_from_const <long>):
723 (class memento_of_new_rvalue_from_const <double>):
725 (class memento_of_new_rvalue_from_const <void *>):
727 (memento_of_new_rvalue_from_int::replay_into):
729 (memento_of_new_rvalue_from_const <HOST_TYPE>::replay_into):
731 (memento_of_new_rvalue_from_double::replay_into):
733 (memento_of_new_rvalue_from_ptr::replay_into):
734 ...and this to be deleted.
735 (memento_of_new_rvalue_from_int::make_debug_string):
737 (memento_of_new_rvalue_from_const <int>::make_debug_string):
739 (memento_of_new_rvalue_from_double::make_debug_string):
741 (memento_of_new_rvalue_from_const <double>::make_debug_string):
743 (memento_of_new_rvalue_from_ptr::make_debug_string)
745 (memento_of_new_rvalue_from_const <void *>::make_debug_string):
747 (memento_of_new_rvalue_from_const <long>::make_debug_string):
749 * jit-recording.h: Within namespace gcc::jit::recording...
750 (context::new_rvalue_from_int): Eliminate.
751 (context::new_rvalue_from_double): Likewise.
752 (context::new_rvalue_from_ptr): Likewise, all in favor of...
753 (context::new_rvalue_from_const <HOST_TYPE>): New family of
755 (class memento_of_new_rvalue_from_int): Eliminate.
756 (class memento_of_new_rvalue_from_double): Likewise.
757 (class memento_of_new_rvalue_from_ptr): Likewise.
758 (class memento_of_new_rvalue_from_const <HOST_TYPE>): New family
759 of rvalue subclasses.
760 * libgccjit++.h (gccjit::context::new_rvalue): New overload, for
762 * libgccjit.c (gcc_jit_context_new_rvalue_from_int): Update for
763 rewriting of recording::context::new_rvalue_from_int to
764 recording::context::new_rvalue_from_const <int>.
765 (gcc_jit_context_new_rvalue_from_long): New API entrypoint.
766 (gcc_jit_context_new_rvalue_from_double): Update for
767 rewriting of recording::context::new_rvalue_from_double to
768 recording::context::new_rvalue_from_const <double>.
769 (gcc_jit_context_new_rvalue_from_ptr): Update for
770 rewriting of recording::context::new_rvalue_from_ptr to
771 recording::context::new_rvalue_from_const <void *>.
772 * libgccjit.h (gcc_jit_context_new_rvalue_from_long): New API
774 * libgccjit.map (gcc_jit_context_new_rvalue_from_long): Likewise.
776 2015-01-09 David Malcolm <dmalcolm@redhat.com>
779 * docs/internals/test-hello-world.exe.log.txt: Update, the log now
780 shows tempdir creation/cleanup.
781 * docs/_build/texinfo/libgccjit.texi: Regenerate.
782 * jit-logging.h (class gcc::jit::log_user): Add gcc::jit::tempdir
783 to the list of subclasses in the comment.
784 * jit-playback.c (gcc::jit::playback::context::context): Add a
785 comment clarifying when the tempdir gets cleaned up.
786 (gcc::jit::playback::context::compile): Pass the context's logger,
787 if any, to the tempdir.
788 (gcc::jit::playback::context::dlopen_built_dso): When creating the
789 gcc::jit::result, if GCC_JIT_BOOL_OPTION_DEBUGINFO is set, hand
790 over ownership of the tempdir to it.
791 * jit-result.c: Include "jit-tempdir.h".
792 (gcc::jit::result::result): Add tempdir param, saving it as
794 (gcc::jit::result::~result): Delete m_tempdir.
795 * jit-result.h (gcc::jit::result::result): Add tempdir param.
796 (gcc::jit::result::m_tempdir): New field.
797 * jit-tempdir.c (gcc::jit::tempdir::tempdir): Add logger param;
799 (gcc::jit::tempdir::create): Add JIT_LOG_SCOPE to log entry/exit,
800 and log m_path_template and m_path_tempdir.
801 (gcc::jit::tempdir::~tempdir): Add JIT_LOG_SCOPE to log
802 entry/exit, and log the unlink and rmdir calls.
803 * jit-tempdir.h: Include "jit-logging.h".
804 (class gcc::jit::tempdir): Make this be a subclass of log_user.
805 (gcc::jit::tempdir::tempdir): Add logger param.
806 * notes.txt: Update to show the two possible places where the
807 tempdir can be cleaned up.
809 2015-01-08 David Malcolm <dmalcolm@redhat.com>
811 * libgccjit.h (struct gcc_jit_context): Rewrite the descriptive
814 2015-01-08 David Malcolm <dmalcolm@redhat.com>
816 * docs/topics/contexts.rst (Error-handling): Document new
817 entrypoint gcc_jit_context_get_last_error.
818 * docs/_build/texinfo/libgccjit.texi: Regenerate.
819 * jit-recording.c (gcc::jit::recording::context::context):
820 Initialize new fields "m_last_error_str" and
821 "m_owns_last_error_str".
822 (gcc::jit::recording::context::~context): Clean up
823 m_last_error_str, if needed.
824 (gcc::jit::recording::context::add_error_va): Update
825 m_last_error_str and m_owns_last_error_str, freeing the old
826 value if appropriate.
827 (gcc::jit::recording::context::get_last_error): New function.
828 * jit-recording.h (gcc::jit::recording::context::get_last_error):
830 (gcc::jit::recording::context): New fields m_last_error_str and
831 m_owns_last_error_str.
832 * libgccjit.c (gcc_jit_context_get_last_error): New function.
833 * libgccjit.h (gcc_jit_context_get_last_error): New declaration.
834 * libgccjit.map (gcc_jit_context_get_last_error): New function.
836 2015-01-08 David Malcolm <dmalcolm@redhat.com>
838 * Make-lang.in (jit_OBJS): Add jit/jit-logging.o.
839 * docs/internals/index.rst (Overview of code structure): Mention
840 gcc_jit_context_set_logfile, and embed the example logfile.
841 * docs/internals/test-hello-world.exe.log.txt: New file: example
843 * docs/topics/contexts.rst (Debugging): Add documentation
844 for gcc_jit_context_set_logfile.
845 * docs/_build/texinfo/libgccjit.texi: Regenerate.
846 * dummy-frontend.c: Include "jit-logging.h".
847 (jit_langhook_init): Assert that there is an active playback
848 context. If it has a logger, log entry/exit to this function.
849 (jit_langhook_write_globals): Likewise.
850 * jit-common.h (gcc::jit::logger): New forward declaration.
851 * jit-logging.c: New file.
852 * jit-logging.h: New file.
853 * jit-playback.c: Include "jit-logging.h".
854 (gcc::jit::playback::context::context): Initialize the log_user
855 base class from the recording context's logger (if any). Use
856 JIT_LOG_SCOPE to log entry/exit from the function body.
857 (gcc::jit::playback::context::~context): Use JIT_LOG_SCOPE to
858 log entry/exit from the function body.
859 (gcc::jit::playback::build_stmt_list): Likewise.
860 (gcc::jit::playback::function::postprocess): Likewise.
861 (gcc::jit::playback::context::compile): Likewise. Log the
862 entry/exit to toplev::main and toplev::finalize. Log the
863 fake argv passed to toplev::main.
864 (gcc::jit::playback::context::acquire_mutex): Use JIT_LOG_SCOPE to
865 log entry/exit from the function body.
866 (gcc::jit::playback::context::release_mutex): Likewise.
867 (gcc::jit::playback::context::make_fake_args): Likewise.
868 (gcc::jit::playback::context::extract_any_requested_dumps):
870 (gcc::jit::playback::context::convert_to_dso): Likewise. Also,
871 log the arguments that the driver is invoked with.
872 (gcc::jit::playback::context::dlopen_built_dso): Likewise. Pass
873 the logger to the result object.
874 (gcc::jit::playback::context::replay): Use JIT_LOG_SCOPE to
875 log entry/exit from the function body.
876 (gcc::jit::playback::context::dump_generated_code): Likewise.
877 (gcc::jit::playback::context::handle_locations): Likewise.
878 * jit-playback.h (gcc::jit::playback::context): Make this be
879 a subclass of gcc::jit::log_user.
880 * jit-recording.c: Include "jit-logging.h".
881 (gcc::jit::recording::context::context: Initialize the logger to
882 NULL for root contexts, or to the parent's logger for child
884 (gcc::jit::recording::context::~context): Use JIT_LOG_SCOPE to
885 log entry/exit from the function body.
886 (gcc::jit::recording::context::replay_into): Likewise.
887 (gcc::jit::recording::context::disassociate_from_playback):
889 (gcc::jit::recording::context::compile): Likewise.
890 (recording::context::add_error_va): Likewise. Also, log the
892 (gcc::jit::recording::context::validate): Use JIT_LOG_SCOPE to
893 log entry/exit from the function body.
894 * jit-recording.h: Include "jit-logging.h".
895 (gcc::jit::recording::context): Make this be a subclass of
897 * jit-result.c: Include "jit-common.h" and "jit-logging.h".
898 (gcc::jit::result::result): Add logger param, recording it.
899 Use JIT_LOG_SCOPE to log entry/exit from the function body.
900 (gcc::jit::result::~result(): Use JIT_LOG_SCOPE to
901 log entry/exit from the function body.
902 (gcc::jit::result::get_code): Likewise.
903 * jit-result.h (gcc::jit::result): Make this be a subclass of
905 (gcc::jit::result::result): Add logger parameter.
906 * libgccjit++.h (gccjit::context::set_logfile): New function.
907 * libgccjit.c: Include "jit-logging.h".
908 (gcc_jit_context_acquire): Log the context.
909 (gcc_jit_context_release): Use JIT_LOG_FUNC to
910 log entry/exit from the function body, and log the context.
911 (gcc_jit_context_new_child_context): Likewise, logging both
913 (gcc_jit_context_new_location): Use JIT_LOG_FUNC to
914 log entry/exit from the function body.
915 (gcc_jit_context_get_type): Likewise.
916 (gcc_jit_context_get_int_type): Likewise.
917 (gcc_jit_context_new_array_type): Likewise.
918 (gcc_jit_context_new_field): Likewise.
919 (gcc_jit_context_new_struct_type): Likewise.
920 (gcc_jit_context_new_opaque_struct): Likewise.
921 (gcc_jit_struct_set_fields): Likewise.
922 (gcc_jit_context_new_union_type): Likewise.
923 (gcc_jit_context_new_function_ptr_type): Likewise.
924 (gcc_jit_context_new_param): Likewise.
925 (gcc_jit_context_new_function): Likewise.
926 (gcc_jit_context_get_builtin_function): Likewise.
927 (gcc_jit_function_get_param): Likewise.
928 (gcc_jit_function_dump_to_dot): Likewise.
929 (gcc_jit_function_new_block): Likewise.
930 (gcc_jit_context_new_global): Likewise.
931 (gcc_jit_context_new_rvalue_from_int): Likewise.
932 (gcc_jit_context_zero): Likewise.
933 (gcc_jit_context_one): Likewise.
934 (gcc_jit_context_new_rvalue_from_double): Likewise.
935 (gcc_jit_context_new_rvalue_from_ptr): Likewise.
936 (gcc_jit_context_null): Likewise.
937 (gcc_jit_context_new_string_literal): Likewise.
938 (gcc_jit_context_new_unary_op): Likewise.
939 (gcc_jit_context_new_binary_op): Likewise.
940 (gcc_jit_context_new_comparison): Likewise.
941 (gcc_jit_context_new_call): Likewise.
942 (gcc_jit_context_new_call_through_ptr): Likewise.
943 (gcc_jit_context_new_cast): Likewise.
944 (gcc_jit_context_new_array_access): Likewise.
945 (gcc_jit_lvalue_access_field): Likewise.
946 (gcc_jit_rvalue_access_field): Likewise.
947 (gcc_jit_rvalue_dereference_field): Likewise.
948 (gcc_jit_rvalue_dereference): Likewise.
949 (gcc_jit_lvalue_get_address): Likewise.
950 (gcc_jit_function_new_local): Likewise.
951 (gcc_jit_block_add_eval): Likewise.
952 (gcc_jit_block_add_assignment): Likewise.
953 (gcc_jit_block_add_assignment_op): Likewise.
954 (gcc_jit_block_end_with_conditional): Likewise.
955 (gcc_jit_block_add_comment): Likewise.
956 (gcc_jit_block_end_with_jump): Likewise.
957 (gcc_jit_block_end_with_return): Likewise.
958 (gcc_jit_block_end_with_void_return): Likewise.
959 (gcc_jit_context_set_str_option): Likewise.
960 (gcc_jit_context_set_int_option): Likewise.
961 (gcc_jit_context_set_bool_option): Likewise.
962 (gcc_jit_context_enable_dump): Likewise.
963 (gcc_jit_context_compile): Likewise. Also log the context,
965 (gcc_jit_context_dump_to_file): Likewise.
966 (gcc_jit_context_set_logfile): New function.
967 (gcc_jit_context_get_first_error): Use JIT_LOG_FUNC to
968 log entry/exit from the function body.
969 (gcc_jit_result_get_code): Likewise. Also log the fnname)
970 and the ptr to be returned.
971 (gcc_jit_result_release): Likewise. Also log the result.
972 * libgccjit.h: Include <stdio.h>, since we need FILE *.
973 (gcc_jit_context_set_logfile): New declaration.
974 * libgccjit.map (gcc_jit_context_set_logfile): New.
976 2015-01-07 David Malcolm <dmalcolm@redhat.com>
978 * jit-recording.h (gcc::jit::recording::type::is_void): New
980 (gcc::jit::recording::memento_of_get_type::is_void): New
981 function, overriding default implementation.
982 * libgccjit.c (gcc_jit_rvalue_dereference): Verify that
983 the underlying type is not "void".
985 2015-01-07 David Malcolm <dmalcolm@redhat.com>
987 * docs/topics/expressions.rst (Unary Operations): Add
988 GCC_JIT_UNARY_OP_ABS.
989 * jit-playback.c (gcc::jit::playback::context::new_unary_op):
991 * jit-recording.c (unary_op_strings): Likewise.
992 * libgccjit.c (gcc_jit_context_new_unary_op): Update checking
993 of "op" to reflect addition of GCC_JIT_UNARY_OP_ABS.
994 * libgccjit.h (enum gcc_jit_unary_op): Add GCC_JIT_UNARY_OP_ABS.
995 * docs/_build/texinfo/libgccjit.texi: Regenerate.
997 2015-01-07 David Malcolm <dmalcolm@redhat.com>
999 * jit-recording.h (gcc::jit::recording::memento_of_get_type): Fix
1002 2015-01-07 David Malcolm <dmalcolm@redhat.com>
1004 * TODO.rst (Test suite): Remove item about running C++ testcases.
1005 * docs/internals/index.rst (Working on the JIT library): Add
1006 "c++" to the enabled languages in the suggested "configure"
1007 invocation, and add a description of why this is necessary.
1008 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1010 2015-01-07 David Malcolm <dmalcolm@redhat.com>
1012 * docs/internals/index.rst: Update to reflect that built
1013 testcases are now test-foo.c.exe, rather than test-foo.exe.
1014 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1016 2015-01-05 Jakub Jelinek <jakub@redhat.com>
1018 Update copyright years.
1020 2014-12-19 David Malcolm <dmalcolm@redhat.com>
1022 * jit-playback.c (gcc::jit::playback::context::build_cast): In
1023 case BOOLEAN_TYPE, don't assume that the source expression is
1026 2014-12-19 David Malcolm <dmalcolm@redhat.com>
1028 * jit-recording.c (gcc::jit::recording::context::context): When
1029 copying string options from a parent context, take a copy of the
1030 underlying buffers, rather than simply copying the pointer.
1032 2014-12-19 David Malcolm <dmalcolm@redhat.com>
1034 * jit-recording.c (gcc::jit::recording::context::set_str_option):
1037 2014-12-11 David Malcolm <dmalcolm@redhat.com>
1039 * docs/cp/topics/contexts.rst (gccjit::context::set_str_option):
1040 Document new function.
1041 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1043 2014-12-10 Ulrich Drepper <drepper@gmail.com>
1045 Minor interface cleanups of libgccjit
1046 * jit-playback.c (convert_to_dso): Use auto_vec instead
1047 of automatic array to build up command line.
1048 * jit-recording.c (recording::context::set_str_option):
1049 Make copy of the string.
1050 (recording::context::~context): Free string options.
1051 * jit-recording.h (recording::context): Adjust type
1052 of m_str_options member.
1053 * libgccjit.h: Adjust comment about
1054 gcc_jit_context_set_str_option parameter being used after
1056 Update comment now that all interfaces are copy strings
1058 * libgccjit++.h (gccjit::context): Add set_str_option
1061 2014-12-10 David Malcolm <dmalcolm@redhat.com>
1063 * docs/cp/index.rst: New file.
1064 * docs/cp/intro/index.rst: New file.
1065 * docs/cp/intro/tutorial01.rst: New file.
1066 * docs/cp/intro/tutorial02.rst: New file.
1067 * docs/cp/intro/tutorial03.rst: New file.
1068 * docs/cp/intro/tutorial04.rst: New file.
1069 * docs/cp/topics/contexts.rst: New file.
1070 * docs/cp/topics/expressions.rst: New file.
1071 * docs/cp/topics/functions.rst: New file.
1072 * docs/cp/topics/index.rst: New file.
1073 * docs/cp/topics/locations.rst: New file.
1074 * docs/cp/topics/objects.rst: New file.
1075 * docs/cp/topics/results.rst: New file.
1076 * docs/cp/topics/types.rst: New file.
1077 * docs/examples/tut01-hello-world.cc: New file.
1078 * docs/examples/tut02-square.c: Fix missing newline in output.
1079 * docs/examples/tut02-square.cc: New file.
1080 * docs/examples/tut03-sum-of-squares.cc: New file.
1081 * docs/examples/tut04-toyvm/toyvm.cc: New file.
1082 * docs/index.rst: Move summary to above the table of contents.
1083 Add text about the C vs C++ APIs.
1084 * docs/topics/contexts.rst: Fix a typo.
1086 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1087 * docs/_build/texinfo/factorial1.png: New file.
1088 * docs/_build/texinfo/sum-of-squares1.png: New file.
1090 2014-12-09 David Malcolm <dmalcolm@redhat.com>
1092 * docs/examples/tut04-toyvm/toyvm.c (toyvm_function_compile): Move
1093 logic for determine "funcname" to new function...
1094 (get_function_name): ...here, adding logic to skip any leading
1095 path from the filename.
1096 (toyvm_function_parse): Use the filename for fn_filename, rather
1097 than "name", so that the debugger can locate the source .toy
1099 (toyvm_function_parse): Don't fclose a NULL FILE *.
1101 2014-12-09 David Malcolm <dmalcolm@redhat.com>
1104 * docs/internals/index.rst (Running under valgrind): New
1106 (docs/_build/texinfo/libgccjit.texi): Regenerate.
1108 2014-12-09 David Malcolm <dmalcolm@redhat.com>
1111 * Make-lang.in (jit_OBJS): Add jit/jit-tempdir.o.
1112 * jit-common.h (gcc::jit::tempdir): New forward decl.
1113 * jit-playback.c: Include jit-tempdir.h.
1114 (gcc::jit::playback::context::context): Initialize m_tempdir.
1115 (gcc::jit::playback::context::~context): Move tempdir
1116 cleanup to new file jit-tempdir.c
1117 (make_tempdir_path_template): Move to new file jit-tempdir.c.
1118 (gcc::jit::playback::context::compile): Move tempdir creation
1119 to new tempdir object in new file jit-tempdir.c.
1120 (gcc::jit::playback::context::make_fake_args): Get path from
1121 tempdir object rather than from member data.
1122 (gcc::jit::playback::context::convert_to_dso): Likewise.
1123 (gcc::jit::playback::context::dlopen_built_dso): Likewise.
1124 (gcc::jit::playback::context::dump_generated_code): Likewise.
1125 (gcc::jit::playback::context::get_path_c_file): New function.
1126 (gcc::jit::playback::context::get_path_s_file): New function.
1127 (gcc::jit::playback::context::get_path_so_file): New function.
1128 * jit-playback.h (gcc::jit::playback::context::get_path_c_file):
1130 (gcc::jit::playback::context::get_path_s_file): New function.
1131 (gcc::jit::playback::context::get_path_so_file): New function.
1132 (gcc::jit::playback::context): Move fields "m_path_template",
1133 "m_path_tempdir", "m_path_c_file", "m_path_s_file",
1134 "m_path_so_file" to new jit::tempdir class; add field "m_tempdir".
1135 * jit-tempdir.c: New file.
1136 * jit-tempdir.h: New file.
1138 2014-12-09 David Malcolm <dmalcolm@redhat.com>
1140 * jit-playback.c (gcc::jit::playback::context::compile): Acquire the
1141 mutex here, immediately before using toplev, and release it here, on
1142 each exit path after acquisition.
1143 (jit_mutex): Move this variable here, from jit-recording.c.
1144 (gcc::jit::playback::context::acquire_mutex): New function, based on
1145 code in jit-recording.c.
1146 (gcc::jit::playback::context::release_mutex): Likewise.
1147 * jit-playback.h (gcc::jit::playback::context::acquire_mutex): New
1149 (gcc::jit::playback::context::release_mutex): New function.
1150 * jit-recording.c (jit_mutex): Move this variable to jit-playback.c.
1151 (gcc::jit::recording::context::compile): Move mutex-handling from
1152 here into jit-playback.c's gcc::jit::playback::context::compile.
1153 * notes.txt: Update to show the new locations of ACQUIRE_MUTEX
1156 2014-12-09 David Malcolm <dmalcolm@redhat.com>
1158 * jit-playback.c (gcc::jit::playback::context::compile): Move the
1160 (gcc::jit::playback::context::dlopen_built_dso): ...this new
1162 * jit-playback.h (gcc::jit::playback::context::dlopen_built_dso):
1165 2014-12-09 David Malcolm <dmalcolm@redhat.com>
1168 * docs/topics/contexts.rst (Debugging): Add description of
1169 gcc_jit_context_enable_dump.
1170 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1171 * jit-playback.c: Include context.h.
1172 (class auto_argvec): New class.
1173 (auto_argvec::~auto_argvec): New function.
1174 (gcc::jit::playback::context::compile): Convert fake_args to be
1175 an auto_argvec, so that it can contain dynamically-allocated
1176 strings. Construct a vec of all requested dumps, and pass it to
1177 make_fake_args. Extract requested dumps between the calls to
1178 toplev::main and toplev::finalize.
1179 (gcc::jit::playback::context::make_fake_args): Convert param
1180 "argvec" to be a vec <char *>, and gain a "requested_dumps"
1181 param. Convert to dynamically-allocated arg strings by converting
1182 ADD_ARG to take a copy of the arg, and add ADD_ARG_TAKE_OWNERSHIP
1183 for args that are already a copy. Add args for all requested dumps.
1184 (gcc::jit::playback::context::extract_any_requested_dumps): New
1186 (gcc::jit::playback::context::read_dump_file): New function.
1187 * jit-playback.h (gcc::jit::playback::context::make_fake_args):
1188 Convert param "argvec" to be a vec <char *>, and gain a
1189 "requested_dumps" param.
1190 (gcc::jit::playback::context::extract_any_requested_dumps): New
1192 (gcc::jit::playback::context::read_dump_file): New function.
1193 * jit-recording.c (gcc::jit::recording::context::enable_dump): New
1195 (gcc::jit::recording::context::get_all_requested_dumps): New
1197 * jit-recording.h (gcc::jit::recording::requested_dump): New
1199 (gcc::jit::recording::context::enable_dump): New function.
1200 (gcc::jit::recording::context::get_all_requested_dumps): New
1202 (gcc::jit::recording::context::m_requested_dumps): New field.
1203 * libgccjit.c (gcc_jit_context_enable_dump): New API entrypoint.
1204 * libgccjit.h (gcc_jit_context_enable_dump): New API entrypoint.
1205 * libgccjit.map (gcc_jit_context_enable_dump): New API entrypoint.
1207 2014-12-08 David Malcolm <dmalcolm@redhat.com>
1209 * libgccjit++.h: Indent the forward declarations of the classes to
1210 show the inheritance hierarchy.
1212 2014-12-08 David Malcolm <dmalcolm@redhat.com>
1214 * notes.txt: Show the beginning and ending of
1215 recording::context::compile vs playback::context::compile. Show
1216 the creation and unlinking of the tempdir. Show toplev::finalize.
1217 Move "RELEASE MUTEX" to the correct location. Show
1218 gcc_jit_result_release, and indicate where the
1219 dlopen/dlsym/dlclose occur.
1221 2014-12-01 David Malcolm <dmalcolm@redhat.com>
1223 * docs/examples/tut02-square.c (main): Release the context
1224 earlier, to show that this is possible. Update error-handling
1225 to avoid a double-release of the context, and to avoid
1226 releasing a NULL result.
1227 * docs/intro/tutorial02.rst: Discuss gcc_jit_context_release.
1228 * docs/topics/functions.rst (GCC_JIT_FUNCTION_EXPORTED): Emphasize
1229 * docs/topics/results.rst (gcc_jit_result): Mention that this
1230 controls the lifetimes of machine code functions.
1231 (gcc_jit_result_get_code): Spell out the requirements for this
1232 to succeed, and the lifetime of the result.
1233 (gcc_jit_result_release): Mention that this invalidates any code
1234 that was obtained from the result.
1235 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1237 2014-12-01 David Malcolm <dmalcolm@redhat.com>
1240 * docs/intro/tutorial02.rst: Spell out lifetime of generated code.
1241 Add description of error-handling, taken in part from...
1242 * docs/topics/contexts.rst (Error-handling): Expand, and move some
1243 content to tutorial02.rst.
1244 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1246 2014-12-01 David Malcolm <dmalcolm@redhat.com>
1249 * docs/topics/types.rst (Standard types) Add new enum values to
1250 the table of enum gcc_jit_types: GCC_JIT_TYPE_COMPLEX_FLOAT,
1251 GCC_JIT_TYPE_COMPLEX_DOUBLE, GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE.
1252 Widen the left-hand column so that
1253 GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE will fit.
1254 * docs/_build/texinfo/libgccjit.texi: Regenerate.
1256 * jit-builtins.c: Include stringpool.h and jit-playback.h.
1257 Move everything out of the gcc::jit::recording namespace into
1259 (struct builtin_data): Add fields "fnclass", "attr", and
1261 (DEF_BUILTIN): Update macro so populate the new fields.
1262 (builtins_manager::builtins_manager): Update for move out of
1263 recording namespace. Initialize the m_attributes array.
1264 (builtins_manager::get_builtin_function): Likewise.
1265 (builtins_manager::get_builtin_function_by_id): New function.
1266 (builtins_manager::make_builtin_function): Update for move out of
1267 recording namespace. Add fix for PR jit/64020 by detecting
1268 specific builtin ids and having them ensure that builtins for
1269 other ids are created as necessary.
1270 (builtins_manager::get_type): Update for move out of recording
1272 (builtins_manager::make_type): Likewise. Add some missing
1274 (builtins_manager::make_primitive_type): Update for move out of
1275 recording namespace. Implement the three BT_COMPLEX_ cases and
1277 (builtins_manager::make_fn_type): Update for move out of recording
1279 (builtins_manager::make_ptr_type): Likewise.
1280 (builtins_manager::finish_playback): New function.
1281 (builtins_manager::get_class): New function.
1282 (builtins_manager::implicit_p): New function.
1283 (builtins_manager::get_attrs_tree): Two new functions.
1284 (builtins_manager::make_attrs_tree): New function.
1286 * jit-builtins.h: Move everything out of the gcc::jit::recording
1287 namespace into just gcc::jit.
1288 (enum built_in_attribute): New.
1289 (builtins_manager::builtins_manager): Update decl for namespace
1291 (builtins_manager::get_builtin_function): Likewise.
1292 (builtins_manager::get_class): New.
1293 (builtins_manager::implicit_p): New.
1294 (builtins_manager::get_attrs_tree): Two new functions.
1295 (builtins_manager::make_attrs_tree): New function.
1296 (builtins_manager::finish_playback): New.
1297 (builtins_manager::get_builtin_function_by_id): New.
1298 (builtins_manager::make_builtin_function): Update decl for
1300 (builtins_manager::get_type): Likewise.
1301 (builtins_manager::make_type): Likewise.
1302 (builtins_manager::make_primitive_type): Likewise.
1303 (builtins_manager::make_fn_type): Likewise.
1304 (builtins_manager::make_ptr_type): Likewise.
1305 (builtins_manager): Likewise for fields. Add new field
1308 * jit-common.h (NUM_GCC_JIT_TYPES): Update.
1309 (builtins_manager): Update forward decl to reflect namespace
1312 * jit-playback.c: Include attribs.h and jit-builtins.h.
1313 (gcc::jit::playback::context::get_tree_node_for_type): Add cases
1314 for the new COMPLEX_ types.
1315 (gcc::jit::playback::context::new_function): If creating a
1316 builtin, set the DECL_BUILT_IN_CLASS and attributes on the fndecl,
1317 and call set_builtin_decl.
1318 (gcc::jit::playback::context::replay): If we have a
1319 builtins_manager, call its finish_playback method when we're done.
1322 (gcc::jit::playback::context::get_builtins_manager): New function.
1325 (gcc::jit::recording::context::get_builtins_manager): New function.
1326 (gcc::jit::recording::get_builtin_function): Use
1327 get_builtins_manager, in case we're a child context.
1328 (gcc::jit::recording::memento_of_get_type::dereference): Add the
1330 (gcc::jit::recording::memento_of_get_type::is_int): Likewise.
1331 (gcc::jit::recording::memento_of_get_type::is_float): Likewise.
1332 (gcc::jit::recording::memento_of_get_type::is_bool): Likewise.
1333 (get_type_strings): Likewise.
1336 (gcc::jit::recording::context::get_builtins_manager): New.
1338 * libgccjit.h (enum gcc_jit_types): Add
1339 GCC_JIT_TYPE_COMPLEX_FLOAT, GCC_JIT_TYPE_COMPLEX_DOUBLE,
1340 GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE.
1342 2014-12-01 David Malcolm <dmalcolm@redhat.com>
1345 (gcc::jit::recording::builtins_manager::get_builtin_function):
1346 Check for NULL return from make_builtin_function.
1347 (gcc::jit::recording::builtins_manager::make_builtin_function):
1348 Check for NULL return from get_type.
1350 2014-12-01 David Malcolm <dmalcolm@redhat.com>
1352 * jit-playback.c (gcc::jit::playback::context::compile): Move DSO
1353 creation code into...
1354 (gcc::jit::playback::context::convert_to_dso): New function.
1355 * jit-playback.h (gcc::jit::playback::context::convert_to_dso):
1358 2014-12-01 David Malcolm <dmalcolm@redhat.com>
1360 * jit-playback.c (gcc::jit::playback::context::compile): Use an
1361 auto_vec<const char *> rather than a const char *[20] for the
1362 top-level argv, and move the logic to build it to...
1363 (gcc::jit::playback::context::make_fake_args): New function.
1364 * jit-playback.h (gcc::jit::playback::context::make_fake_args):
1367 2014-12-01 David Malcolm <dmalcolm@redhat.com>
1369 * Make-lang.in (jit_OBJS): Add jit/jit-result.o.
1370 * jit-playback.c: Include new header jit-result.h.
1371 (gcc::jit::result::result): Move to new file jit-result.c.
1372 (gcc::jit::result::~result): Likewise.
1373 (gcc::jit::playback::result): Likewise.
1374 * jit-recording.h (class gcc::jit::result): Move to new
1375 header jit-result.h.
1376 * jit-result.c: New file, to contain...
1377 (gcc::jit::result::result): Move here from jit-playback.c,
1378 removing erroneous "playback" namespace from comment.
1379 (gcc::jit::result::~result): Likewise.
1380 (gcc::jit::playback::result): Likewise.
1381 * jit-result.h: New file, to contain...
1382 (class gcc::jit::result): Move from jit-recording.h.
1383 * libgccjit.c: Include jit-result.h.
1384 (gcc_jit_result_get_code): Update comment to reflect move
1386 (gcc_jit_result_release): Likewise.
1388 2014-12-01 David Malcolm <dmalcolm@redhat.com>
1391 * docs/examples/tut04-toyvm/toyvm.c
1392 (toyvm_compiled_function): New typedef.
1393 (toyvm_compiled_func) Rename to...
1394 (toyvm_compiled_code) ...this.
1395 (struct toyvm_compiled_function): New struct.
1396 (toyvm_function_compile): Return a toyvm_compiled_function *
1397 rather than a toyvm_compiled_func, so that the caller can fully
1398 clean things up. Free "funcname".
1399 (test_script): Update for change to toyvm_function_compile.
1400 Clean up the toyvm_compiled_function.
1402 (docs/intro/tutorial04.rst): Update to reflect the above changes,
1403 and to better spell out the lifetime of the compiled code.
1405 2014-12-01 David Malcolm <dmalcolm@redhat.com>
1409 (gcc::jit::recording::builtins_manager::make_fn_type): Call the
1410 context's new_function_type method, rather than directly creating
1411 a function_type instance.
1413 (gcc::jit::recording::context::new_function_type): New method,
1414 adapted from part of...
1415 (gcc::jit::recording::context::new_function_ptr_type): ...this.
1416 Update to call new_function_type.
1418 (gcc::jit::recording::context::new_function_type): New method.
1420 2014-12-01 David Malcolm <dmalcolm@redhat.com>
1423 * jit-playback.c: Ensure that ctxt_progname is non-NULL.
1425 2014-11-19 David Malcolm <dmalcolm@redhat.com>
1428 * jit-playback.c (gcc::jit::playback::compound_type::set_fields):
1429 Convert param from const vec<playback::field *> & to
1430 const auto_vec<playback::field *> *.
1431 (gcc::jit::playback::context::new_function_type): Convert param
1432 "param_types" from vec<type *> * to const auto_vec<type *> *.
1433 (gcc::jit::playback::context::new_function): Convert param
1434 "params" from vec<param *> * to const auto_vec<param *> *.
1435 (gcc::jit::playback::context::build_call): Convert param "args"
1436 from vec<rvalue *> to const auto_vec<rvalue *> *.
1437 (gcc::jit::playback::context::new_call): Likewise.
1438 (gcc::jit::playback::context::new_call_through_ptr): Likewise.
1439 (wrapper_finalizer): New function.
1440 (gcc::jit::playback::wrapper::operator new): Call the finalizer
1441 variant of ggc_internal_cleared_alloc, supplying
1443 (gcc::jit::playback::function::finalizer): New.
1444 (gcc::jit::playback::block::finalizer): New.
1445 (gcc::jit::playback::source_file::finalizer): New.
1446 (gcc::jit::playback::source_line::finalizer): New.
1449 (gcc::jit::playback::context::new_function_type): Convert param
1450 "param_types" from vec<type *> * to const auto_vec<type *> *.
1451 (gcc::jit::playback::context::new_function): Convert param
1452 "params" from vec<param *> * to const auto_vec<param *> *.
1453 (gcc::jit::playback::context::new_call): Convert param
1454 "args" from vec<rvalue *> to const auto_vec<rvalue *> *.
1455 (gcc::jit::playback::context::new_call_through_ptr): Likewise.
1456 (gcc::jit::playback::context::build_call): Likewise.
1457 (gcc::jit::playback::context): Convert fields "m_functions",
1458 "m_source_files", "m_cached_locations" from vec to auto_vec.
1459 (gcc::jit::playback::wrapper::finalizer): New virtual function.
1460 (gcc::jit::playback::compound_type::set_fields): Convert param fro
1461 const vec<playback::field *> & to
1462 const auto_vec<playback::field *> *.
1463 (gcc::jit::playback::function::finalizer): New.
1464 (gcc::jit::playback::block::finalizer): New.
1465 (gcc::jit::playback::source_file::finalizer): New.
1466 (gcc::jit::playback::source_line::finalizer): New.
1469 (gcc::jit::recording::function_type::replay_into): Convert local
1470 from a vec into an auto_vec.
1471 (gcc::jit::recording::fields::replay_into): Likewise.
1472 (gcc::jit::recording::function::replay_into): Likewise.
1473 (gcc::jit::recording::call::replay_into): Likewise.
1474 (gcc::jit::recording::call_through_ptr::replay_into): Likewise.
1476 * jit-recording.h (gcc::jit::recording::context): Convert fields
1477 "m_mementos", "m_compound_types", "m_functions" from vec<> to
1479 (gcc::jit::recording::function_type::get_param_types): Convert
1480 return type from vec<type *> to const vec<type *> &.
1481 (gcc::jit::recording::function_type): Convert field
1482 "m_param_types" from a vec<> to an auto_vec<>.
1483 (gcc::jit::recording::fields): Likewise for field "m_fields".
1484 (gcc::jit::recording::function::get_params): Convert return type
1485 from vec <param *> to const vec<param *> &.
1486 (gcc::jit::recording::function): Convert fields "m_params",
1487 "m_locals", "m_blocks" from vec<> to auto_vec<>.
1488 (gcc::jit::recording::block): Likewise for field "m_statements".
1489 vec<> to auto_vec<>.
1490 (gcc::jit::recording::call): Likewise for field "m_args".
1491 (gcc::jit::recording::call_through_ptr): Likewise.
1493 2014-11-19 David Malcolm <dmalcolm@redhat.com>
1496 * jit-recording.c (recording::function::validate): Convert
1497 "worklist" from vec<> to autovec<> to fix a leak.
1499 2014-11-11 David Malcolm <dmalcolm@redhat.com>
1501 * ChangeLog.jit: New.
1503 * Make-lang.in: New.
1505 * config-lang.in: New.
1506 * docs/Makefile: New.
1507 * docs/_build/texinfo/Makefile: New.
1508 * docs/_build/texinfo/factorial.png: New.
1509 * docs/_build/texinfo/libgccjit.texi: New.
1510 * docs/_build/texinfo/sum-of-squares.png: New.
1511 * docs/conf.py: New.
1512 * docs/examples/tut01-hello-world.c: New.
1513 * docs/examples/tut02-square.c: New.
1514 * docs/examples/tut03-sum-of-squares.c: New.
1515 * docs/examples/tut04-toyvm/Makefile: New.
1516 * docs/examples/tut04-toyvm/factorial.toy: New.
1517 * docs/examples/tut04-toyvm/fibonacci.toy: New.
1518 * docs/examples/tut04-toyvm/toyvm.c: New.
1519 * docs/index.rst: New.
1520 * docs/internals/index.rst: New.
1521 * docs/intro/factorial.png: New.
1522 * docs/intro/index.rst: New.
1523 * docs/intro/sum-of-squares.png: New.
1524 * docs/intro/tutorial01.rst: New.
1525 * docs/intro/tutorial02.rst: New.
1526 * docs/intro/tutorial03.rst: New.
1527 * docs/intro/tutorial04.rst: New.
1528 * docs/topics/contexts.rst: New.
1529 * docs/topics/expressions.rst: New.
1530 * docs/topics/functions.rst: New.
1531 * docs/topics/index.rst: New.
1532 * docs/topics/locations.rst: New.
1533 * docs/topics/objects.rst: New.
1534 * docs/topics/results.rst: New.
1535 * docs/topics/types.rst: New.
1536 * dummy-frontend.c: New.
1537 * jit-builtins.c: New.
1538 * jit-builtins.h: New.
1539 * jit-common.h: New.
1540 * jit-playback.c: New.
1541 * jit-playback.h: New.
1542 * jit-recording.c: New.
1543 * jit-recording.h: New.
1544 * libgccjit++.h: New.
1547 * libgccjit.map: New.
1550 2013-07-26 David Malcolm <dmalcolm@redhat.com>
1554 Copyright (C) 2013-2015 Free Software Foundation, Inc.
1556 Copying and distribution of this file, with or without modification,
1557 are permitted in any medium without royalty provided the copyright
1558 notice and this notice are preserved.