12023-05-08 Release Manager 2 3 * GCC 12.3.0 released. 4 52023-03-29 David Malcolm <dmalcolm@redhat.com> 6 7 * docs/internals/index.rst: Remove reference to ".c" extensions 8 of source files. 9 102022-08-19 Release Manager 11 12 * GCC 12.2.0 released. 13 142022-08-09 Vibhav Pant <vibhavp@gmail.com> 15 16 * libgccjit.h (LIBGCCJIT_HAVE_gcc_jit_context_new_bitcast): Move 17 definition out of comment. 18 192022-07-02 Sergei Trofimovich <siarheit@google.com> 20 21 Backported from master: 22 2022-06-29 Sergei Trofimovich <siarheit@google.com> 23 24 PR c++/106102 25 * jit-playback.cc: Include <pthread.h> via "system.h" to avoid calloc() 26 poisoning. 27 * jit-recording.cc: Ditto. 28 * libgccjit.cc: Ditto. 29 302022-05-06 Release Manager 31 32 * GCC 12.1.0 released. 33 342022-04-14 Iain Sandoe <iain@sandoe.co.uk> 35 36 * jit-playback.cc (new_bitcast): Cast values returned by tree_to_uhwi 37 to 'long' to match the print format. 38 392022-04-12 Antoni Boucher <bouanto@zoho.com> 40 41 PR jit/104293 42 * docs/_build/texinfo/libgccjit.texi: Regenerate. 43 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_24): New ABI tag. 44 * docs/topics/expressions.rst: Add documentation for the 45 functions gcc_jit_lvalue_set_alignment and 46 gcc_jit_lvalue_get_alignment. 47 * jit-playback.h: New function (set_alignment). 48 * jit-recording.cc: New function (set_alignment). 49 * jit-recording.h: New functions (set_alignment, get_alignment) 50 and new field (m_alignment). 51 * libgccjit.cc: New functions (gcc_jit_lvalue_get_alignment, 52 gcc_jit_lvalue_set_alignment) 53 * libgccjit.h: New functions (gcc_jit_lvalue_get_alignment, 54 gcc_jit_lvalue_set_alignment) 55 * libgccjit.map (LIBGCCJIT_ABI_24): New ABI tag. 56 572022-04-12 Antoni Boucher <bouanto@zoho.com> 58 59 PR jit/104073 60 * docs/_build/texinfo/libgccjit.texi: Regenerate. 61 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_23): New ABI tag. 62 * docs/topics/contexts.rst: Add documentation for the new 63 function gcc_jit_context_set_bool_print_errors_to_stderr. 64 * jit-common.h: New enum value 65 (INNER_BOOL_OPTION_PRINT_ERRORS_TO_STDERR). 66 * jit-recording.cc: Handle the new option 67 INNER_BOOL_OPTION_PRINT_ERRORS_TO_STDERR. 68 * libgccjit.cc: New function 69 (gcc_jit_context_set_bool_print_errors_to_stderr). 70 * libgccjit.h: New function 71 (gcc_jit_context_set_bool_print_errors_to_stderr). 72 * libgccjit.map (LIBGCCJIT_ABI_23): New ABI tag. 73 742022-04-12 Antoni Boucher <bouanto@zoho.com> 75 76 PR jit/104072 77 * docs/_build/texinfo/libgccjit.texi: Regenerate. 78 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_22): New ABI tag. 79 * docs/topics/expressions.rst: Add documentation for the 80 function gcc_jit_lvalue_set_register_name. 81 * jit-playback.h: New function (set_register_name). 82 * jit-recording.cc: New function (set_register_name) and add 83 support for register variables. 84 * jit-recording.h: New field (m_reg_name) and new function 85 (set_register_name). 86 * libgccjit.cc: New function (gcc_jit_lvalue_set_register_name). 87 * libgccjit.h: New function (gcc_jit_lvalue_set_register_name). 88 * libgccjit.map (LIBGCCJIT_ABI_22): New ABI tag. 89 902022-04-12 Antoni Boucher <bouanto@zoho.com> 91 92 PR jit/104071 93 * docs/_build/texinfo/libgccjit.texi: Regenerate. 94 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_21): New ABI tag. 95 * docs/topics/expressions.rst: Add documentation for the 96 function gcc_jit_context_new_bitcast. 97 * jit-playback.cc: New function (new_bitcast). 98 * jit-playback.h: New function (new_bitcast). 99 * jit-recording.cc: New functions (new_bitcast, 100 bitcast::replay_into, bitcast::visit_children, 101 bitcast::make_debug_string, bitcast::write_reproducer). 102 * jit-recording.h: New class (bitcast) and new function 103 (new_bitcast, bitcast::replay_into, bitcast::visit_children, 104 bitcast::make_debug_string, bitcast::write_reproducer, 105 bitcast::get_precedence). 106 * libgccjit.cc: New function (gcc_jit_context_new_bitcast) 107 * libgccjit.h: New function (gcc_jit_context_new_bitcast) 108 * libgccjit.map (LIBGCCJIT_ABI_21): New ABI tag. 109 1102022-04-12 Antoni Boucher <bouanto@zoho.com> 111 112 PR target/95325 113 * docs/_build/texinfo/libgccjit.texi: Regenerate 114 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_20): New ABI tag. 115 * docs/topics/types.rst: Add documentation for the new types 116 GCC_JIT_TYPE_UINT8_T, GCC_JIT_TYPE_UINT16_T, 117 GCC_JIT_TYPE_UINT32_T, GCC_JIT_TYPE_UINT64_T, 118 GCC_JIT_TYPE_UINT128_T, GCC_JIT_TYPE_INT8_T, GCC_JIT_TYPE_INT16_T, 119 GCC_JIT_TYPE_INT32_T, GCC_JIT_TYPE_INT64_T, GCC_JIT_TYPE_INT128_T and 120 new functions (gcc_jit_compatible_types, gcc_jit_type_get_size). 121 * jit-builtins.cc: Add support for BT_UINT128. 122 * jit-common.h: Update the value of NUM_GCC_JIT_TYPES. 123 * jit-playback.cc: Add support for the sized integer types. 124 * jit-recording.cc: Add support for the sized integer types. 125 * jit-recording.h: Add support for comparing integer types 126 and new function (is_signed). 127 * libgccjit.cc (gcc_jit_compatible_types): New. 128 (gcc_jit_type_get_size) New. 129 * libgccjit.h: New enum variants for gcc_jit_types 130 (GCC_JIT_TYPE_UINT8_T, GCC_JIT_TYPE_UINT16_T, 131 GCC_JIT_TYPE_UINT32_T, GCC_JIT_TYPE_UINT64_T, 132 GCC_JIT_TYPE_UINT128_T, GCC_JIT_TYPE_INT8_T, 133 GCC_JIT_TYPE_INT16_T, GCC_JIT_TYPE_INT32_T, 134 GCC_JIT_TYPE_INT64_T, GCC_JIT_TYPE_INT128_T) and new functions 135 (gcc_jit_compatible_types, gcc_jit_type_get_size). 136 * libgccjit.map (LIBGCCJIT_ABI_20): New ABI tag. 137 1382022-04-06 David Malcolm <dmalcolm@redhat.com> 139 140 PR jit/102824 141 * docs/_build/texinfo/factorial.png: Move to... 142 * docs/_build/texinfo/libgccjit-figures/factorial.png: ...here. 143 * docs/_build/texinfo/factorial1.png: Move to... 144 * docs/_build/texinfo/libgccjit-figures/factorial1.png: ...here. 145 * docs/_build/texinfo/sum-of-squares.png: Move to... 146 * docs/_build/texinfo/libgccjit-figures/sum-of-squares.png: ...here. 147 * docs/_build/texinfo/sum-of-squares1.png: Move to... 148 * docs/_build/texinfo/libgccjit-figures/sum-of-squares1.png: ...here. 149 1502022-04-01 David Malcolm <dmalcolm@redhat.com> 151 152 * docs/topics/expressions.rst: Fix formatting. 153 * docs/topics/types.rst: Likewise. 154 * docs/_build/texinfo/libgccjit.texi: Regenerate 155 1562022-04-01 Petter Tomner <tomner@kth.se> 157 158 * docs/topics/compatibility.rst: Add 19 tag 159 * docs/topics/compilation.rst: Linking 160 * docs/topics/contexts.rst: Linking example 161 * docs/topics/expressions.rst: Fix formatting and dropped 's' 162 1632022-03-07 Jakub Jelinek <jakub@redhat.com> 164 165 * libgccjit.h: Fix up duplicated word issue in a comment. 166 1672022-01-17 Martin Liska <mliska@suse.cz> 168 169 * config-lang.in: Rename .c names to .cc. 170 * docs/_build/texinfo/libgccjit.texi: Likewise. 171 * docs/internals/index.rst: Likewise. 172 * jit-builtins.cc (builtins_manager::make_builtin_function): Likewise. 173 * jit-playback.cc (fold_const_var): Likewise. 174 (playback::context::~context): Likewise. 175 (new_field): Likewise. 176 (new_bitfield): Likewise. 177 (new_compound_type): Likewise. 178 (playback::compound_type::set_fields): Likewise. 179 (global_set_init_rvalue): Likewise. 180 (load_blob_in_ctor): Likewise. 181 (new_global_initialized): Likewise. 182 (double>): Likewise. 183 (new_string_literal): Likewise. 184 (as_truth_value): Likewise. 185 (build_call): Likewise. 186 (playback::context::build_cast): Likewise. 187 (new_array_access): Likewise. 188 (new_field_access): Likewise. 189 (dereference): Likewise. 190 (postprocess): Likewise. 191 (add_jump): Likewise. 192 (add_switch): Likewise. 193 (build_goto_operands): Likewise. 194 (playback::context::read_dump_file): Likewise. 195 (init_types): Likewise. 196 * jit-recording.cc (recording::context::get_int_type): Likewise. 197 * jit-recording.h: Likewise. 198 * libgccjit.cc (compatible_types): Likewise. 199 (gcc_jit_context_acquire): Likewise. 200 (gcc_jit_context_release): Likewise. 201 (gcc_jit_context_new_child_context): Likewise. 202 (gcc_jit_type_as_object): Likewise. 203 (gcc_jit_context_get_type): Likewise. 204 (gcc_jit_context_get_int_type): Likewise. 205 (gcc_jit_type_get_pointer): Likewise. 206 (gcc_jit_type_get_const): Likewise. 207 (gcc_jit_type_get_volatile): Likewise. 208 (gcc_jit_type_dyncast_array): Likewise. 209 (gcc_jit_type_is_bool): Likewise. 210 (gcc_jit_type_is_pointer): Likewise. 211 (gcc_jit_type_is_integral): Likewise. 212 (gcc_jit_type_dyncast_vector): Likewise. 213 (gcc_jit_type_is_struct): Likewise. 214 (gcc_jit_vector_type_get_num_units): Likewise. 215 (gcc_jit_vector_type_get_element_type): Likewise. 216 (gcc_jit_type_unqualified): Likewise. 217 (gcc_jit_type_dyncast_function_ptr_type): Likewise. 218 (gcc_jit_function_type_get_return_type): Likewise. 219 (gcc_jit_function_type_get_param_count): Likewise. 220 (gcc_jit_function_type_get_param_type): Likewise. 221 (gcc_jit_context_new_array_type): Likewise. 222 (gcc_jit_context_new_field): Likewise. 223 (gcc_jit_field_as_object): Likewise. 224 (gcc_jit_context_new_struct_type): Likewise. 225 (gcc_jit_struct_as_type): Likewise. 226 (gcc_jit_struct_set_fields): Likewise. 227 (gcc_jit_struct_get_field_count): Likewise. 228 (gcc_jit_context_new_union_type): Likewise. 229 (gcc_jit_context_new_function_ptr_type): Likewise. 230 (gcc_jit_param_as_rvalue): Likewise. 231 (gcc_jit_context_new_function): Likewise. 232 (gcc_jit_function_get_return_type): Likewise. 233 (gcc_jit_function_dump_to_dot): Likewise. 234 (gcc_jit_block_get_function): Likewise. 235 (gcc_jit_global_set_initializer_rvalue): Likewise. 236 (gcc_jit_rvalue_get_type): Likewise. 237 (gcc_jit_context_new_rvalue_from_int): Likewise. 238 (gcc_jit_context_one): Likewise. 239 (gcc_jit_context_new_rvalue_from_double): Likewise. 240 (gcc_jit_context_null): Likewise. 241 (gcc_jit_context_new_string_literal): Likewise. 242 (valid_binary_op_p): Likewise. 243 (gcc_jit_context_new_binary_op): Likewise. 244 (gcc_jit_context_new_comparison): Likewise. 245 (gcc_jit_context_new_call): Likewise. 246 (is_valid_cast): Likewise. 247 (gcc_jit_context_new_cast): Likewise. 248 (gcc_jit_object_get_context): Likewise. 249 (gcc_jit_object_get_debug_string): Likewise. 250 (gcc_jit_lvalue_access_field): Likewise. 251 (gcc_jit_rvalue_access_field): Likewise. 252 (gcc_jit_rvalue_dereference_field): Likewise. 253 (gcc_jit_rvalue_dereference): Likewise. 254 (gcc_jit_lvalue_get_address): Likewise. 255 (gcc_jit_lvalue_set_tls_model): Likewise. 256 (gcc_jit_lvalue_set_link_section): Likewise. 257 (gcc_jit_function_new_local): Likewise. 258 (gcc_jit_block_add_eval): Likewise. 259 (gcc_jit_block_add_assignment): Likewise. 260 (is_bool): Likewise. 261 (gcc_jit_block_end_with_conditional): Likewise. 262 (gcc_jit_block_add_comment): Likewise. 263 (gcc_jit_block_end_with_jump): Likewise. 264 (gcc_jit_block_end_with_return): Likewise. 265 (gcc_jit_block_end_with_void_return): Likewise. 266 (case_range_validator::case_range_validator): Likewise. 267 (case_range_validator::validate): Likewise. 268 (case_range_validator::get_wide_int): Likewise. 269 (gcc_jit_block_end_with_switch): Likewise. 270 (gcc_jit_context_set_str_option): Likewise. 271 (gcc_jit_context_set_int_option): Likewise. 272 (gcc_jit_context_set_bool_option): Likewise. 273 (gcc_jit_context_set_bool_allow_unreachable_blocks): Likewise. 274 (gcc_jit_context_set_bool_use_external_driver): Likewise. 275 (gcc_jit_context_add_command_line_option): Likewise. 276 (gcc_jit_context_add_driver_option): Likewise. 277 (gcc_jit_context_enable_dump): Likewise. 278 (gcc_jit_context_compile): Likewise. 279 (gcc_jit_context_compile_to_file): Likewise. 280 (gcc_jit_context_set_logfile): Likewise. 281 (gcc_jit_context_dump_reproducer_to_file): Likewise. 282 (gcc_jit_context_get_first_error): Likewise. 283 (gcc_jit_context_get_last_error): Likewise. 284 (gcc_jit_result_get_code): Likewise. 285 (gcc_jit_result_get_global): Likewise. 286 (gcc_jit_rvalue_set_bool_require_tail_call): Likewise. 287 (gcc_jit_type_get_aligned): Likewise. 288 (gcc_jit_type_get_vector): Likewise. 289 (gcc_jit_function_get_address): Likewise. 290 (gcc_jit_version_patchlevel): Likewise. 291 (gcc_jit_block_add_extended_asm): Likewise. 292 (gcc_jit_extended_asm_as_object): Likewise. 293 (gcc_jit_extended_asm_set_volatile_flag): Likewise. 294 (gcc_jit_extended_asm_set_inline_flag): Likewise. 295 (gcc_jit_extended_asm_add_output_operand): Likewise. 296 (gcc_jit_extended_asm_add_input_operand): Likewise. 297 (gcc_jit_extended_asm_add_clobber): Likewise. 298 * notes.txt: Likewise. 299 3002022-01-17 Martin Liska <mliska@suse.cz> 301 302 * dummy-frontend.c: Moved to... 303 * dummy-frontend.cc: ...here. 304 * jit-builtins.c: Moved to... 305 * jit-builtins.cc: ...here. 306 * jit-logging.c: Moved to... 307 * jit-logging.cc: ...here. 308 * jit-playback.c: Moved to... 309 * jit-playback.cc: ...here. 310 * jit-recording.c: Moved to... 311 * jit-recording.cc: ...here. 312 * jit-result.c: Moved to... 313 * jit-result.cc: ...here. 314 * jit-spec.c: Moved to... 315 * jit-spec.cc: ...here. 316 * jit-tempdir.c: Moved to... 317 * jit-tempdir.cc: ...here. 318 * jit-w32.c: Moved to... 319 * jit-w32.cc: ...here. 320 * libgccjit.c: Moved to... 321 * libgccjit.cc: ...here. 322 3232021-12-28 Martin Liska <mliska@suse.cz> 324 325 * docs/_build/texinfo/libgccjit.texi: Replace http:// with https. 326 * docs/cp/index.rst: Likewise. 327 * docs/cp/intro/index.rst: Likewise. 328 * docs/cp/intro/tutorial01.rst: Likewise. 329 * docs/cp/intro/tutorial02.rst: Likewise. 330 * docs/cp/intro/tutorial03.rst: Likewise. 331 * docs/cp/intro/tutorial04.rst: Likewise. 332 * docs/cp/topics/asm.rst: Likewise. 333 * docs/cp/topics/compilation.rst: Likewise. 334 * docs/cp/topics/contexts.rst: Likewise. 335 * docs/cp/topics/expressions.rst: Likewise. 336 * docs/cp/topics/functions.rst: Likewise. 337 * docs/cp/topics/index.rst: Likewise. 338 * docs/cp/topics/locations.rst: Likewise. 339 * docs/cp/topics/objects.rst: Likewise. 340 * docs/cp/topics/types.rst: Likewise. 341 * docs/index.rst: Likewise. 342 * docs/internals/index.rst: Likewise. 343 * docs/intro/index.rst: Likewise. 344 * docs/intro/tutorial01.rst: Likewise. 345 * docs/intro/tutorial02.rst: Likewise. 346 * docs/intro/tutorial03.rst: Likewise. 347 * docs/intro/tutorial04.rst: Likewise. 348 * docs/intro/tutorial05.rst: Likewise. 349 * docs/topics/asm.rst: Likewise. 350 * docs/topics/compatibility.rst: Likewise. 351 * docs/topics/compilation.rst: Likewise. 352 * docs/topics/contexts.rst: Likewise. 353 * docs/topics/expressions.rst: Likewise. 354 * docs/topics/function-pointers.rst: Likewise. 355 * docs/topics/functions.rst: Likewise. 356 * docs/topics/index.rst: Likewise. 357 * docs/topics/locations.rst: Likewise. 358 * docs/topics/objects.rst: Likewise. 359 * docs/topics/performance.rst: Likewise. 360 * docs/topics/types.rst: Likewise. 361 3622021-12-20 Martin Liska <mliska@suse.cz> 363 364 * libgccjit.c (struct version_info): Rename to jit_version_info. 365 (struct jit_version_info): Likewise. 366 (gcc_jit_version_major): Likewise. 367 (gcc_jit_version_minor): Likewise. 368 (gcc_jit_version_patchlevel): Likewise. 369 3702021-12-14 Petter Tomner <tomner@kth.se> 371 372 * jit-common.h: New enum 373 * jit-playback.c : Folding an setting intitial 374 (global_new_decl) : Handle const global generation 375 (new_global) : New flag 376 (global_set_init_rvalue) : New 377 (new_ctor) : New 378 (new_global_initialized) : Flag 379 (as_truth_value) : Fold 380 (new_unary_op) : Fold 381 (new_binary_op) : Fold 382 (new_comparison) : Fold 383 (new_array_access) : Fold 384 (new_dereference) : Fold 385 (get_address) : Fold 386 * jit-playback.h : 387 (global_set_init_rvalue) : New 388 (new_ctor) : New 389 * jit-recording.c : 390 * jit-recording.h : 391 (new_global_init_rvalue) : New 392 (new_ctor) : New 393 (ctor) : New, inherits rvalue 394 (global_init_rvalue) : New, inherits memento 395 (type::is_union) : New 396 * libgccjit++.h : New entrypoints, see C-header 397 * libgccjit.c : See .h 398 * libgccjit.h : New entrypoints 399 (gcc_jit_context_new_array_constructor) : New 400 (gcc_jit_context_new_struct_constructor) : New 401 (gcc_jit_context_new_union_constructor) : New 402 (gcc_jit_global_set_initializer_rvalue) : New 403 (LIBGCCJIT_HAVE_CTORS) : New feuture macro 404 * libgccjit.map : New entrypoints added to ABI 19 405 * docs/topics/expressions.rst : Updated docs 406 4072021-12-12 Antoni Boucher <bouanto@zoho.com> 408 409 PR target/100688 410 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_18): New ABI 411 tag. 412 * docs/topics/expressions.rst: Add documentation for the 413 function gcc_jit_lvalue_set_link_section. 414 * jit-playback.h: New function (set_link_section). 415 * jit-recording.c: New function (set_link_section) and 416 support for setting the link section. 417 * jit-recording.h: New function (set_link_section) and new 418 field m_link_section. 419 * libgccjit.c: New function (gcc_jit_lvalue_set_link_section). 420 * libgccjit.h: New function (gcc_jit_lvalue_set_link_section). 421 * libgccjit.map (LIBGCCJIT_ABI_18): New ABI tag. 422 4232021-12-12 Antoni Boucher <bouanto@zoho.com> 424 425 PR target/95415 426 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_17): New ABI 427 tag. 428 * docs/topics/expressions.rst: Add document for the function 429 gcc_jit_lvalue_set_tls_model. 430 * jit-playback.h: New function (set_tls_model). 431 * jit-recording.c: New function (set_tls_model), new 432 variables (tls_models and tls_model_enum_strings) and support 433 for setting the tls model. 434 * jit-recording.h: New function (set_tls_model) and new 435 field m_tls_model. 436 * libgccjit.c: New function (gcc_jit_lvalue_set_tls_model). 437 * libgccjit.h: New function (gcc_jit_lvalue_set_tls_model) 438 and new enum (gcc_jit_tls_model). 439 * libgccjit.map (LIBGCCJIT_ABI_17): New ABI tag. 440 4412021-12-11 Antoni Boucher <bouanto@zoho.com> 442 443 PR target/96066 444 PR target/96067 445 * jit-builtins.c: Implement missing types for builtins. 446 * jit-recording.c:: Allow sending a volatile const void * as 447 argument. 448 * jit-recording.h: New functions (is_volatile, is_const) and 449 allow comparing qualified types. 450 4512021-12-10 David Malcolm <dmalcolm@redhat.com> 452 453 PR jit/103562 454 * jit-playback.c (gcc::jit::playback::context::new_function): Set 455 DECL_CONTEXT of the result_decl. 456 4572021-11-27 Petter Tomner <tomner@kth.se> 458 459 * libgccjit.c: %ld -> %zu 460 4612021-11-24 Martin Liska <mliska@suse.cz> 462 463 * jit-playback.c (function): Initialize m_blocks vector. 464 4652021-11-20 Antoni Boucher <bouanto@zoho.com> 466 467 PR target/96889 468 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_16): New ABI tag. 469 * docs/topics/functions.rst: Add documentation for the 470 functions gcc_jit_function_get_return_type and 471 gcc_jit_function_get_param_count 472 * docs/topics/types.rst: Add documentation for the functions 473 gcc_jit_function_type_get_return_type, 474 gcc_jit_function_type_get_param_count, 475 gcc_jit_function_type_get_param_type, 476 gcc_jit_type_unqualified, gcc_jit_type_dyncast_array, 477 gcc_jit_type_is_bool, 478 gcc_jit_type_dyncast_function_ptr_type, 479 gcc_jit_type_is_integral, gcc_jit_type_is_pointer, 480 gcc_jit_type_dyncast_vector, 481 gcc_jit_vector_type_get_element_type, 482 gcc_jit_vector_type_get_num_units, 483 gcc_jit_struct_get_field, gcc_jit_type_is_struct, 484 and gcc_jit_struct_get_field_count 485 * libgccjit.c: 486 (gcc_jit_function_get_return_type, gcc_jit_function_get_param_count, 487 gcc_jit_function_type_get_return_type, 488 gcc_jit_function_type_get_param_count, 489 gcc_jit_function_type_get_param_type, gcc_jit_type_unqualified, 490 gcc_jit_type_dyncast_array, gcc_jit_type_is_bool, 491 gcc_jit_type_dyncast_function_ptr_type, gcc_jit_type_is_integral, 492 gcc_jit_type_is_pointer, gcc_jit_type_dyncast_vector, 493 gcc_jit_vector_type_get_element_type, 494 gcc_jit_vector_type_get_num_units, gcc_jit_struct_get_field, 495 gcc_jit_type_is_struct, gcc_jit_struct_get_field_count): New 496 functions. 497 (struct gcc_jit_function_type, struct gcc_jit_vector_type): 498 New types. 499 * libgccjit.h: 500 (gcc_jit_function_get_return_type, gcc_jit_function_get_param_count, 501 gcc_jit_function_type_get_return_type, 502 gcc_jit_function_type_get_param_count, 503 gcc_jit_function_type_get_param_type, gcc_jit_type_unqualified, 504 gcc_jit_type_dyncast_array, gcc_jit_type_is_bool, 505 gcc_jit_type_dyncast_function_ptr_type, gcc_jit_type_is_integral, 506 gcc_jit_type_is_pointer, gcc_jit_type_dyncast_vector, 507 gcc_jit_vector_type_get_element_type, 508 gcc_jit_vector_type_get_num_units, gcc_jit_struct_get_field, 509 gcc_jit_type_is_struct, gcc_jit_struct_get_field_count): New 510 function declarations. 511 (struct gcc_jit_function_type, struct gcc_jit_vector_type): 512 New types. 513 * jit-recording.h: New functions (is_struct and is_vector) 514 * libgccjit.map (LIBGCCJIT_ABI_16): New ABI tag. 515 5162021-11-12 David Malcolm <dmalcolm@redhat.com> 517 518 PR jit/103199 519 * docs/examples/tut04-toyvm/toyvm.c (toyvm_function_compile): 520 Increase size of buffer. 521 * docs/examples/tut04-toyvm/toyvm.cc 522 (compilation_state::create_function): Likewise. 523 5242021-09-10 Petter Tomner <tomner@kth.se> 525 526 * jit-playback.c: Moved global var processing to after loc handling. 527 Setting TYPE_NAME for fundamental types. 528 Using common functions for finalizing globals. 529 * jit-playback.h: New method init_types(). 530 Changed get_tree_node_for_type() to method. 531 5322021-08-19 Iain Sandoe <iain@sandoe.co.uk> 533 534 * docs/examples/tut04-toyvm/toyvm.c: Include jit-dejagnu.h. 535 * docs/examples/tut04-toyvm/toyvm.cc: Likewise. 536 * jit-dejagnu.h: New file, imported from dejagnu-1.6.2 and 537 patched for this application. 538 5392021-08-18 Iain Sandoe <iain@sandoe.co.uk> 540 541 PR jit/100613 542 * Make-lang.in: Provide clauses for Darwin hosts. 543 5442021-07-18 Antoni Boucher <bouanto@zoho.com> 545 546 PR target/95498 547 * jit-playback.c (convert): Add support to handle truncation and 548 extension in the convert function. 549 5502021-05-19 Martin Liska <mliska@suse.cz> 551 552 PR testsuite/100658 553 * libgccjit.c (gcc_jit_context_new_function): Fix typos. 554 5552021-03-24 Matthias Klose <doko@ubuntu.com> 556 557 * Make-lang.in (jit.sphinx.html, jit.sphinx.pdf): Use $(mkinstalldirs), 558 (jit.install-headers): Depend on installdirs. 559 5602021-02-19 David Malcolm <dmalcolm@redhat.com> 561 562 PR jit/99126 563 * jit-builtins.c 564 (gcc::jit::builtins_manager::get_builtin_function_by_id): 565 Update assertion to reject BUILT_IN_NONE. 566 (gcc::jit::builtins_manager::ensure_optimization_builtins_exist): 567 New. 568 * jit-builtins.h 569 (gcc::jit::builtins_manager::ensure_optimization_builtins_exist): 570 New decl. 571 * jit-playback.c (gcc::jit::playback::context::replay): Call it. 572 Remove redundant conditional on bm. 573 5742021-01-14 David Malcolm <dmalcolm@redhat.com> 575 576 * docs/cp/index.rst: Remove "Alpha" warning. 577 * docs/index.rst: Likewise. 578 * docs/_build/texinfo/libgccjit.texi: Regenerate 579 5802020-11-25 Martin Sebor <msebor@redhat.com> 581 582 PR bootstrap/94982 583 * jit-recording.c (recording::function::dump_to_dot): Avoid 584 -Wformat-diag. 585 (recording::block::dump_to_dot): Same. 586 5872020-11-20 Jakub Jelinek <jakub@redhat.com> 588 589 PR other/97911 590 * Make-lang.in (jit.serial): Change from goal to a 591 variable. 592 (.PHONY): Drop jit.serial and jit.prev. 593 ($(LIBGCCJIT_FILENAME)): Depend on $(jit.serial) rather than 594 jit.serial. 595 5962020-11-18 Jakub Jelinek <jakub@redhat.com> 597 598 * Make-lang.in (jit.serial): New goal. 599 (.PHONY): Add jit.serial jit.prev. 600 ($(LIBGCCJIT_FILENAME)): Depend on jit.prev. Call LINK_PROGRESS. 601 6022020-11-12 David Malcolm <dmalcolm@redhat.com> 603 604 PR jit/87291 605 * docs/cp/topics/asm.rst: New file. 606 * docs/cp/topics/index.rst (Topic Reference): Add it. 607 * docs/topics/asm.rst: New file. 608 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_15): New. 609 * docs/topics/functions.rst (Statements): Add link to extended 610 asm. 611 * docs/topics/index.rst (Topic Reference): Add asm.rst. 612 * docs/topics/objects.rst: Add gcc_jit_extended_asm to ASCII art. 613 * docs/_build/texinfo/Makefile: Regenerate. 614 * docs/_build/texinfo/libgccjit.texi: Regenerate. 615 * jit-common.h (gcc::jit::recording::extended_asm): New forward 616 decl. 617 (gcc::jit::recording::top_level_asm): Likewise. 618 * jit-playback.c: Include "stmt.h". 619 (build_string): New. 620 (gcc::jit::playback::context::new_string_literal): Disambiguate 621 build_string call. 622 (gcc::jit::playback::context::add_top_level_asm): New. 623 (build_operand_chain): New. 624 (build_clobbers): New. 625 (build_goto_operands): New. 626 (gcc::jit::playback::block::add_extended_asm): New. 627 * jit-playback.h (gcc::jit::playback::context::add_top_level_asm): 628 New decl. 629 (struct gcc::jit::playback::asm_operand): New struct. 630 (gcc::jit::playback::block::add_extended_asm): New decl. 631 * jit-recording.c (gcc::jit::recording::context::dump_to_file): 632 Dump top-level asms. 633 (gcc::jit::recording::context::add_top_level_asm): New. 634 (gcc::jit::recording::block::add_extended_asm): New. 635 (gcc::jit::recording::block::end_with_extended_asm_goto): New. 636 (gcc::jit::recording::asm_operand::asm_operand): New. 637 (gcc::jit::recording::asm_operand::print): New. 638 (gcc::jit::recording::asm_operand::make_debug_string): New. 639 (gcc::jit::recording::output_asm_operand::write_reproducer): New. 640 (gcc::jit::recording::output_asm_operand::print): New. 641 (gcc::jit::recording::input_asm_operand::write_reproducer): New. 642 (gcc::jit::recording::input_asm_operand::print): New. 643 (gcc::jit::recording::extended_asm::add_output_operand): New. 644 (gcc::jit::recording::extended_asm::add_input_operand): New. 645 (gcc::jit::recording::extended_asm::add_clobber): New. 646 (gcc::jit::recording::extended_asm::replay_into): New. 647 (gcc::jit::recording::extended_asm::make_debug_string): New. 648 (gcc::jit::recording::extended_asm::write_flags): New. 649 (gcc::jit::recording::extended_asm::write_clobbers): New. 650 (gcc::jit::recording::extended_asm_simple::write_reproducer): New. 651 (gcc::jit::recording::extended_asm::maybe_populate_playback_blocks): 652 New. 653 (gcc::jit::recording::extended_asm_goto::extended_asm_goto): New. 654 (gcc::jit::recording::extended_asm_goto::replay_into): New. 655 (gcc::jit::recording::extended_asm_goto::write_reproducer): New. 656 (gcc::jit::recording::extended_asm_goto::get_successor_blocks): 657 New. 658 (gcc::jit::recording::extended_asm_goto::maybe_print_gotos): New. 659 (gcc::jit::recording::extended_asm_goto::maybe_populate_playback_blocks): 660 New. 661 (gcc::jit::recording::top_level_asm::top_level_asm): New. 662 (gcc::jit::recording::top_level_asm::replay_into): New. 663 (gcc::jit::recording::top_level_asm::make_debug_string): New. 664 (gcc::jit::recording::top_level_asm::write_to_dump): New. 665 (gcc::jit::recording::top_level_asm::write_reproducer): New. 666 * jit-recording.h 667 (gcc::jit::recording::context::add_top_level_asm): New decl. 668 (gcc::jit::recording::context::m_top_level_asms): New field. 669 (gcc::jit::recording::block::add_extended_asm): New decl. 670 (gcc::jit::recording::block::end_with_extended_asm_goto): New 671 decl. 672 (gcc::jit::recording::asm_operand): New class. 673 (gcc::jit::recording::output_asm_operand): New class. 674 (gcc::jit::recording::input_asm_operand): New class. 675 (gcc::jit::recording::extended_asm): New class. 676 (gcc::jit::recording::extended_asm_simple): New class. 677 (gcc::jit::recording::extended_asm_goto): New class. 678 (gcc::jit::recording::top_level_asm): New class. 679 * libgccjit++.h (gccjit::extended_asm): New forward decl. 680 (gccjit::context::add_top_level_asm): New. 681 (gccjit::block::add_extended_asm): New. 682 (gccjit::block::end_with_extended_asm_goto): New. 683 (gccjit::extended_asm): New class. 684 (gccjit::extended_asm::extended_asm): New ctors. 685 (gccjit::extended_asm::set_volatile_flag): New. 686 (gccjit::extended_asm::set_inline_flag): New. 687 (gccjit::extended_asm::add_output_operand): New. 688 (gccjit::extended_asm::add_input_operand): New. 689 (gccjit::extended_asm::add_clobber): New. 690 (gccjit::extended_asm::get_inner_extended_asm): New. 691 * libgccjit.c (struct gcc_jit_extended_asm): New. 692 (jit_error): Make "loc" param take a gcc::jit::recording::location * 693 rather than a gcc_jit_location *. 694 (gcc_jit_block_add_extended_asm): New entrypoint. 695 (gcc_jit_block_end_with_extended_asm_goto): New entrypoint. 696 (gcc_jit_extended_asm_as_object): New entrypoint. 697 (gcc_jit_extended_asm_set_volatile_flag): New entrypoint. 698 (gcc_jit_extended_asm_set_inline_flag): New entrypoint. 699 (gcc_jit_extended_asm_add_output_operand): New entrypoint. 700 (gcc_jit_extended_asm_add_clobber): New entrypoint. 701 (gcc_jit_context_add_top_level_asm): New entrypoint. 702 * libgccjit.h: Add gcc_jit_extended_asm to ASCII art. 703 (gcc_jit_extended_asm): New typedef. 704 (LIBGCCJIT_HAVE_ASM_STATEMENTS): New define. 705 (gcc_jit_block_add_extended_asm): New entrypoint. 706 (gcc_jit_block_end_with_extended_asm_goto): New entrypoint. 707 (gcc_jit_extended_asm_as_object): New entrypoint. 708 (gcc_jit_extended_asm_set_volatile_flag): New entrypoint. 709 (gcc_jit_extended_asm_set_inline_flag): New entrypoint. 710 (gcc_jit_extended_asm_add_output_operand): New entrypoint. 711 (gcc_jit_extended_asm_add_input_operand): New entrypoint. 712 (gcc_jit_extended_asm_add_clobber): New entrypoint. 713 (gcc_jit_context_add_top_level_asm): New entrypoint. 714 * libgccjit.map (LIBGCCJIT_ABI_15): New. 715 7162020-11-12 David Malcolm <dmalcolm@redhat.com> 717 718 * jit-recording.c (recording::context::new_string): Add "escaped" 719 param and use it when creating the new recording::string instance. 720 (recording::string::string): Add "escaped" param and use it to 721 initialize m_escaped. 722 (recording::string::make_debug_string): Replace check that first 723 char is double-quote with use of m_escaped. Fix escaping of 724 '\t' and '\n'. Set "escaped" on the result. 725 * jit-recording.h (recording::context::new_string): Add "escaped" 726 param. 727 (recording::string::string): Add "escaped" param. 728 (recording::string::m_escaped): New field. 729 7302020-11-12 David Malcolm <dmalcolm@redhat.com> 731 732 * libgccjit.h: Fix typo in comment. 733 7342020-09-14 Andrea Corallo <andrea.corallo@arm.com> 735 736 * docs/_build/texinfo/libgccjit.texi: Regenerate. 737 7382020-09-11 Andrea Corallo <andrea.corallo@arm.com> 739 740 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_14): New ABI tag. 741 * docs/topics/expressions.rst (gcc_jit_global_set_initializer): 742 Document new entry point in section 'Global variables'. 743 * jit-playback.c (global_new_decl, global_finalize_lvalue): New 744 method. 745 (playback::context::new_global): Make use of global_new_decl, 746 global_finalize_lvalue. 747 (load_blob_in_ctor): New template function in use by the 748 following. 749 (playback::context::new_global_initialized): New method. 750 * jit-playback.h (class context): Decl 'new_global_initialized', 751 'global_new_decl', 'global_finalize_lvalue'. 752 (lvalue::set_initializer): Add implementation. 753 * jit-recording.c (recording::memento_of_get_pointer::get_size) 754 (recording::memento_of_get_type::get_size): Add implementation. 755 (recording::global::write_initializer_reproducer): New function in 756 use by 'recording::global::write_reproducer'. 757 (recording::global::replay_into) 758 (recording::global::write_to_dump) 759 (recording::global::write_reproducer): Handle 760 initialized case. 761 * jit-recording.h (class type): Decl 'get_size' and 762 'num_elements'. 763 * libgccjit++.h (class lvalue): Declare new 'set_initializer' 764 method. 765 (class lvalue): Decl 'is_global' and 'set_initializer'. 766 (class global) Decl 'write_initializer_reproducer'. Add 767 'm_initializer', 'm_initializer_num_bytes' fields. Implement 768 'set_initializer'. Add a destructor to free 'm_initializer'. 769 * libgccjit.c (gcc_jit_global_set_initializer): New function. 770 * libgccjit.h (gcc_jit_global_set_initializer): New function 771 declaration. 772 * libgccjit.map (LIBGCCJIT_ABI_14): New ABI tag. 773 7742020-08-28 Martin Sebor <msebor@redhat.com> 775 776 * jit-recording.c (recording::switch_::make_debug_string): Add argument 777 to a call. 778 7792020-08-22 Andrea Corallo <andrea.corallo@arm.com> 780 781 * libgccjit.c: 782 (gcc_jit_context_new_rvalue_from_int) 783 (gcc_jit_context_new_rvalue_from_long) 784 (gcc_jit_context_new_rvalue_from_double) 785 (gcc_jit_context_new_rvalue_from_ptr): Update function heading 786 comments. 787 7882020-06-16 Nicolas B��rtolo <nicolasbertolo@gmail.com> 789 790 * Make-lang.in: Always define version, minor and release 791 numbers. Create the Windows shared library as 792 libgccjit-$(LIBGCCJIT_VERSION_NUM).dll. 793 7942020-06-03 David Malcolm <dmalcolm@redhat.com> 795 796 PR jit/95306 797 * jit-builtins.c (builtins_manager::make_primitive_type): 798 Implement BT_CONST_VOLATILE_PTR. 799 8002020-06-02 David Malcolm <dmalcolm@redhat.com> 801 802 PR jit/95426 803 * dummy-frontend.c: Include "options.h", "stringpool.h", and 804 "attribs.h". 805 (ATTR_EXCL): New, copied from lto/lto-lang.c. 806 (attr_noreturn_exclusions): Likewise. 807 (attr_returns_twice_exclusions): Likewise. 808 (attr_const_pure_exclusions): Likewise. 809 (jit_attribute_table): Likewise, copied from lto_attribute_table. 810 (jit_format_attribute_table): Likewise, copied from 811 lto_format_attribute_table. 812 (handle_noreturn_attribute): New, copied from lto/lto-lang.c. 813 (handle_leaf_attribute): Likewise. 814 (handle_const_attribute): Likewise. 815 (handle_malloc_attribute): Likewise. 816 (handle_pure_attribute): Likewise. 817 (handle_novops_attribute): Likewise. 818 (get_nonnull_operand): Likewise. 819 (handle_nonnull_attribute): Likewise. 820 (handle_nothrow_attribute): Likewise. 821 (handle_sentinel_attribute): Likewise. 822 (handle_type_generic_attribute): Likewise. 823 (handle_transaction_pure_attribute): Likewise. 824 (handle_returns_twice_attribute): Likewise. 825 (handle_patchable_function_entry_attribute): Likewise. 826 (ignore_attribute): Likewise. 827 (handle_format_attribute): Likewise. 828 (handle_format_arg_attribute): Likewise. 829 (handle_fnspec_attribute): Likewise. 830 (LANG_HOOKS_COMMON_ATTRIBUTE_TABLE): Define. 831 (LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE): Define. 832 8332020-05-28 Nicolas B��rtolo <nicolasbertolo@gmail.com> 834 835 * Make-lang.in: Remove extra slash. Build libgccjit.dll and its 836 import library in Windows. 837 * config-lang.in: Update comment about --enable-host-shared. 838 * jit-w32.h: New file. 839 * jit-w32.c: New file. 840 (print_last_error): New function that prints the error 841 string corresponding to GetLastError(). 842 (get_TOKEN_USER_current_user): Helper function used for getting 843 the SID belonging to the current user. 844 (create_directory_for_current_user): Helper function to create 845 a directory with permissions such that only the current user can 846 access it. 847 (win_mkdtemp): Create a temporary directory using Windows APIs. 848 * jit-playback.c: Do not chmod files in Windows. Use LoadLibrary, 849 FreeLibrary and GetProcAddress instead of libdl. 850 * jit-result.h, jit-result.c: Introduce result::handle_t to 851 abstract over the types used for dynamic library handles. 852 * jit-tempdir.c: Do not use mkdtemp() in Windows, use 853 win_mkdtemp(). 854 8552020-05-27 David Malcolm <dmalcolm@redhat.com> 856 857 PR jit/95314 858 * dummy-frontend.c (LANG_HOOKS_DEEP_UNSHARING): Define to be true. 859 * jit-playback.h (gcc::jit::playback::rvalue): Mark tree node with 860 TREE_VISITED. 861 8622020-05-27 Tom Tromey <tromey@gcc.gnu.org> 863 864 PR jit/91330 865 * docs/conf.py (texinfo_documents): Set description. 866 * docs/_build/texinfo/libgccjit.texi: Regenerate. 867 8682020-05-26 David Malcolm <dmalcolm@redhat.com> 869 870 PR jit/95306 871 * docs/topics/functions.rst 872 (gcc_jit_context_get_builtin_function): Document. 873 * docs/_build/texinfo/libgccjit.texi: Regenerate. 874 * dummy-frontend.c (jit_langhook_global_bindings_p): Remove 875 gcc_unreachable. 876 * jit-builtins.c (type_names): New array. 877 (get_string_for_type_id): New function. 878 (gcc::jit::builtins_manager::make_primitive_type): Show name of 879 type in error messages. Update cases to reflect the order in 880 builtin-types.def. Implement cases for BT_INT8, BT_INT16, 881 BT_UINT8, BT_CONST_PTR, BT_VOLATILE_PTR, BT_INT_PTR, BT_FLOAT_PTR, 882 BT_CONST_DOUBLE_PTR, BT_SIZE, BT_CONST_SIZE. 883 8842020-05-26 David Malcolm <dmalcolm@redhat.com> 885 886 * docs/topics/compatibility.rst: Fix underline. 887 Fix missing labels. 888 * docs/topics/types.rst: Fix missing blank line. 889 * docs/_build/texinfo/libgccjit.texi: Regenerate. 890 8912020-05-26 David Malcolm <dmalcolm@redhat.com> 892 893 PR jit/95296 894 * docs/topics/expressions.rst (Unary Operations): Document that 895 result_type of gcc_jit_context_new_unary_op must be a numeric type. 896 (Binary Operations): Likewise for gcc_jit_context_new_binary_op. 897 (Global variables): Document that "type" of 898 gcc_jit_context_new_global must be non-`void`. 899 * docs/topics/function-pointers.rst 900 (gcc_jit_context_new_function_ptr_type): Document that the 901 param_types must be non-void, but that return_type may be. 902 * docs/topics/functions.rst (Params): Document that 903 gcc_jit_context_new_param's type must be non-void. 904 (Functions): Likewise for gcc_jit_function_new_local. 905 * docs/topics/types.rst (gcc_jit_context_new_array_type): Document 906 that the type must be non-void. 907 (gcc_jit_context_new_field): Likewise. 908 * docs/_build/texinfo/Makefile: Regenerate. 909 * docs/_build/texinfo/libgccjit.texi: Regenerate. 910 * libgccjit.c (gcc_jit_context_new_array_type): Fail if 911 element_type is void. 912 (gcc_jit_context_new_field): Likewise for "type". 913 (gcc_jit_context_new_function_ptr_type): Likewise for each 914 element of param_types. 915 (gcc_jit_context_new_param): Likewise for "type". 916 (gcc_jit_context_new_global): Likewise. 917 (gcc_jit_function_new_local): Likewise. 918 (gcc_jit_type_get_aligned): Likewise. 919 9202020-03-31 Andrea Corallo <andrea.corallo@arm.com> 921 David Malcolm <dmalcolm@redhat.com> 922 923 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_13): New ABI tag 924 plus add version paragraph. 925 * libgccjit++.h (namespace gccjit::version): Add new namespace. 926 * libgccjit.c (gcc_jit_version_major, gcc_jit_version_minor) 927 (gcc_jit_version_patchlevel): New functions. 928 * libgccjit.h (LIBGCCJIT_HAVE_gcc_jit_version): New macro. 929 (gcc_jit_version_major, gcc_jit_version_minor) 930 (gcc_jit_version_patchlevel): New functions. 931 * libgccjit.map (LIBGCCJIT_ABI_13) New ABI tag. 932 9332020-03-23 Andrea Corallo <andrea.corallo@arm.com> 934 935 * jit-playback.h 936 (gcc::jit::playback::context m_recording_ctxt): Remove 937 m_char_array_type_node field. 938 * jit-playback.c 939 (playback::context::context) Remove m_char_array_type_node from member 940 initializer list. 941 (playback::context::new_string_literal) Fix logic to handle string 942 length > 200. 943 9442020-01-01 Jakub Jelinek <jakub@redhat.com> 945 946 Update copyright years. 947 9482019-11-29 Julian Brown <julian@codesourcery.com> 949 950 * jit-builtins.c (BT_DFLOAT32_PTR, BT_DFLOAT64_PTR, BT_DFLOAT128_PTR): 951 Remove commented-out cases. 952 9532019-11-20 David Malcolm <dmalcolm@redhat.com> 954 955 PR jit/92483 956 * jit-playback.c (gcc::jit::playback::context::make_fake_args): 957 Update GCC_JIT_BOOL_OPTION_SELFCHECK_GC for new --param syntax. 958 9592019-08-13 Richard Sandiford <richard.sandiford@arm.com> 960 961 PR middle-end/91421 962 * jit-playback.c (new_function): Use set_decl_built_in_function. 963 9642019-07-22 Andrea Corallo <andrea.corallo@arm.com> 965 966 * jit-recording.c (unary_op_reproducer_strings): Make it extern. 967 (binary_op_reproducer_strings): Likewise. 968 * jit-recording.h (unary_op_reproducer_strings): Likewise. 969 (binary_op_reproducer_strings): Likewise. 970 * libgccjit.c (gcc_jit_context_new_unary_op): Check result_type to be a 971 numeric type. 972 * libgccjit.c (gcc_jit_context_new_binary_op): Improve error message. 973 9742019-07-04 Andrea Corallo <andrea.corallo@arm.com> 975 976 * libgccjit.c (gcc_jit_context_new_binary_op): Check result_type to be a 977 numeric type. 978 9792019-07-04 Andrea Corallo <andrea.corallo@arm.com> 980 981 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_12): New ABI tag. 982 * docs/topics/types.rst: Add gcc_jit_context_new_bitfield. 983 * jit-common.h (namespace recording): Add class bitfield. 984 * jit-playback.c: 985 (DECL_C_BIT_FIELD, SET_DECL_C_BIT_FIELD): Add macros. 986 (playback::context::new_bitfield): New method. 987 (playback::compound_type::set_fields): Add bitfield support. 988 (playback::lvalue::mark_addressable): Was jit_mark_addressable make this 989 a method of lvalue plus return a bool to communicate success. 990 (playback::lvalue::get_address): Check for jit_mark_addressable return 991 value. 992 * jit-playback.h (new_bitfield): New method. 993 (class bitfield): New class. 994 (class lvalue): Add jit_mark_addressable method. 995 * jit-recording.c (recording::context::new_bitfield): New method. 996 (recording::bitfield::replay_into): New method. 997 (recording::bitfield::write_to_dump): Likewise. 998 (recording::bitfield::make_debug_string): Likewise. 999 (recording::bitfield::write_reproducer): Likewise. 1000 * jit-recording.h (class context): Add new_bitfield method. 1001 (class field): Make it derivable by class bitfield. 1002 (class bitfield): Add new class. 1003 * libgccjit++.h (class context): Add new_bitfield method. 1004 * libgccjit.c (struct gcc_jit_bitfield): New structure. 1005 (gcc_jit_context_new_bitfield): New function. 1006 * libgccjit.h 1007 (LIBGCCJIT_HAVE_gcc_jit_context_new_bitfield) New macro. 1008 (gcc_jit_context_new_bitfield): New function. 1009 * libgccjit.map (LIBGCCJIT_ABI_12) New ABI tag. 1010 10112019-03-21 Jakub Jelinek <jakub@redhat.com> 1012 1013 * jit-recording.c (reproducer::m_set_identifiers): Use false as Lazy 1014 in hash_set template param. 1015 10162019-02-05 Andrea Corallo <andrea.corallo@arm.com> 1017 1018 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_11): New ABI tag. 1019 * docs/topics/contexts.rst (Additional driver options): New 1020 section. 1021 * jit-playback.c (invoke_driver): Add call to append_driver_options. 1022 * jit-recording.c: Within namespace gcc::jit... 1023 (recording::context::~context): Free the optnames within 1024 m_driver_options. 1025 (recording::context::add_driver_option): New method. 1026 (recording::context::append_driver_options): New method. 1027 (recording::context::dump_reproducer_to_file): Add driver 1028 options. 1029 * jit-recording.h: Within namespace gcc::jit... 1030 (recording::context::add_driver_option): New method. 1031 (recording::context::append_driver_options): New method. 1032 (recording::context::m_driver_options): New field. 1033 * libgccjit++.h (gccjit::context::add_driver_option): New 1034 method. 1035 * libgccjit.c (gcc_jit_context_add_driver_option): New API 1036 entrypoint. 1037 * libgccjit.h (gcc_jit_context_add_driver_option): New API 1038 entrypoint. 1039 (LIBGCCJIT_HAVE_gcc_jit_context_add_driver_option): New 1040 macro. 1041 * libgccjit.map (LIBGCCJIT_ABI_11): New ABI tag. 1042 10432019-01-01 Jakub Jelinek <jakub@redhat.com> 1044 1045 Update copyright years. 1046 10472018-11-15 David Malcolm <dmalcolm@redhat.com> 1048 1049 PR other/19165 1050 * dummy-frontend.c (jit_begin_diagnostic): Add diagnostic_t param. 1051 10522018-11-13 David Malcolm <dmalcolm@redhat.com> 1053 1054 * jit-playback.c: Replace "source_location" with "location_t". 1055 10562018-10-17 David Malcolm <dmalcolm@redhat.com> 1057 1058 * Make-lang.in (selftest-jit): New. 1059 10602018-06-28 Martin Liska <mliska@suse.cz> 1061 1062 * jit-playback.c: Include opt-suggestions.h. 1063 10642018-06-28 Martin Liska <mliska@suse.cz> 1065 1066 * jit-playback.c (class auto_argvec): Moved to vec.h. 1067 (auto_argvec::~auto_argvec): Likewise. 1068 (compile): Use the renamed name. 1069 (invoke_driver): Likewise. 1070 10712018-03-21 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> 1072 1073 PR jit/84288 1074 * Make-lang.in ($(LIBGCCJIT_FILENAME)): Add $(EXTRA_GCC_LIBS). 1075 10762018-03-09 David Malcolm <dmalcolm@redhat.com> 1077 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> 1078 1079 PR jit/64089 1080 PR jit/84288 1081 * Make-lang.in (COMMA): New. 1082 (LIBGCCJIT_VERSION_SCRIPT_OPTION): New. 1083 (LIBGCCJIT_SONAME_OPTION): New. 1084 (jit): Move --version-script and -soname linker options to the 1085 above. 1086 10872018-01-25 David Malcolm <dmalcolm@redhat.com> 1088 1089 PR jit/81672 1090 * jit-recording.h (gcc::jit::recording::union_): Remove fields 1091 "m_loc" and "m_name". 1092 10932018-01-03 Jakub Jelinek <jakub@redhat.com> 1094 1095 Update copyright years. 1096 10972017-12-19 Jakub Jelinek <jakub@redhat.com> 1098 1099 * jit-playback.c (get_type, playback::compile_to_file::copy_file, 1100 playback::context::acquire_mutex): Replace Yoda conditions with 1101 typical order conditions. 1102 * libgccjit.c (gcc_jit_context_new_struct_type, 1103 gcc_jit_struct_set_fields, gcc_jit_context_new_union_type, 1104 gcc_jit_context_new_function, gcc_jit_timer_pop): Likewise. 1105 * jit-builtins.c (matches_builtin): Likewise. 1106 * jit-recording.c (recording::compound_type::set_fields, 1107 recording::fields::write_reproducer, recording::rvalue::set_scope, 1108 recording::function::validate): Likewise. 1109 * jit-logging.c (logger::decref): Likewise. 1110 11112017-11-30 Jakub Jelinek <jakub@redhat.com> 1112 1113 * jit-recording.c 1114 (recording::memento_of_new_rvalue_from_const <long>::write_reproducer): 1115 Use ; instead of ;;. 1116 11172017-11-28 Jakub Jelinek <jakub@redhat.com> 1118 1119 * jit-playback.c (add_switch): Build SWITCH_EXPR using build2 instead 1120 of build3. Formatting fixes. Adjust funciton comment. 1121 11222017-11-23 Tom de Vries <tom@codesourcery.com> 1123 1124 * libgccjit.c (RETURN_NULL_IF_FAIL_NONNULL_NUMERIC_TYPE): Wrap in 1125 JIT_{BEGIN,END}_STMT. 1126 11272017-10-31 David Malcolm <dmalcolm@redhat.com> 1128 1129 * docs/internals/index.rst (Running the test suite): Document 1130 PRESERVE_EXECUTABLES. 1131 (Running under valgrind): Add markup to RUN_UNDER_VALGRIND. 1132 * docs/_build/texinfo/libgccjit.texi: Regenerate. 1133 11342017-10-04 David Malcolm <dmalcolm@redhat.com> 1135 1136 * docs/cp/topics/expressions.rst (Vector expressions): New 1137 section. 1138 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_10): New ABI tag. 1139 * docs/topics/expressions.rst (Vector expressions): New section. 1140 * docs/topics/types.rst (gcc_jit_type_get_vector): Add link to 1141 gcc_jit_context_new_rvalue_from_vector. 1142 * docs/_build/texinfo/libgccjit.texi: Regenerate. 1143 * jit-common.h (gcc::jit:recording::vector_type): New forward 1144 decl. 1145 * jit-playback.c 1146 (gcc::jit::playback::context::new_rvalue_from_vector): New method. 1147 * jit-playback.h 1148 (gcc::jit::playback::context::new_rvalue_from_vector): New method. 1149 * jit-recording.c: In namespace gcc::jit:: 1150 (class comma_separated_string): New class. 1151 (comma_separated_string::comma_separated_string): New ctor, 1152 adapted from recording::call::make_debug_string. 1153 (comma_separated_string::~comma_separated_string): New dtor. 1154 In namespace gcc::jit::recording:: 1155 (context::new_rvalue_from_vector): New method. 1156 (type::get_vector): Update for renaming of memento_of_get_vector. 1157 (class memento_of_get_vector): Rename to... 1158 (class vector_type): ..this. 1159 (memento_of_new_rvalue_from_vector::memento_of_new_rvalue_from_vector): 1160 New ctor. 1161 (memento_of_new_rvalue_from_vector::replay_into): New method. 1162 (memento_of_new_rvalue_from_vector::visit_children): New method. 1163 (memento_of_new_rvalue_from_vector::make_debug_string): New 1164 method. 1165 (memento_of_new_rvalue_from_vector::write_reproducer): New method. 1166 (call::make_debug_string): Split out arg-printing code into ctor 1167 for comma_separated_string. 1168 * jit-recording.h: In namespace gcc::jit::recording:: 1169 (context::new_rvalue_from_vector): New method. 1170 (type::dyn_cast_vector_type): New virtual function. 1171 (class memento_of_get_vector): Rename to... 1172 (class vector_type): ...this. 1173 (vector_type::unqualified): Remove this vfunc override in favor 1174 of... 1175 (vector_type::get_element_type): ...this new method. 1176 (vector_type::get_num_units): New method. 1177 (vector_type::dyn_cast_vector_type): New vfunc override. 1178 (class memento_of_new_rvalue_from_vector): New class. 1179 * libgccjit++.h (gccjit::context::new_rvalue): Add overload for 1180 vector of rvalue. 1181 * libgccjit.c (gcc_jit_context_new_binary_op): Strip off type 1182 qualifications when checking that both operands have same type. 1183 (gcc_jit_context_new_rvalue_from_vector): New API entrypoint. 1184 * libgccjit.h 1185 (LIBGCCJIT_HAVE_gcc_jit_context_new_rvalue_from_vector): New 1186 macro. 1187 (gcc_jit_context_new_rvalue_from_vector): New API entrypoint. 1188 * libgccjit.map (LIBGCCJIT_ABI_10): New ABI tag. 1189 11902017-09-28 David Malcolm <dmalcolm@redhat.com> 1191 1192 * docs/topics/expressions.rst (Function calls): Add link to 1193 gcc_jit_context_new_function_ptr_type. 1194 (Function pointers): Convert to cross-references to 1195 function-pointers.rst, moving material there. 1196 * docs/topics/function-pointers.rst: New page. 1197 * docs/topics/index.rst: Add function-pointers.rst. 1198 * docs/topics/types.rst (Function pointer types): New section. 1199 * docs/_build/texinfo/libgccjit.texi: Regenerate. 1200 12012017-09-28 David Malcolm <dmalcolm@redhat.com> 1202 1203 * jit-recording.c 1204 (gcc::jit::recording::function_type::is_same_type_as): New function. 1205 * jit-recording.h: In namespace gcc::jit::recording:: 1206 (type::accepts_writes_from): Use is_same_type_as rather than pointer 1207 equality. 1208 (type::is_same_type_as): New virtual function. 1209 (function_type::is_same_type_as): New override. 1210 12112017-09-27 David Malcolm <dmalcolm@redhat.com> 1212 1213 * docs/cp/topics/expressions.rst (Function pointers): New section. 1214 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_9): New tag. 1215 * docs/topics/expressions.rst (Function pointers): New section. 1216 * docs/_build/texinfo/libgccjit.texi: Regenerate. 1217 * jit-common.h (class gcc::jit::recording::function_pointer): New 1218 forward decl. 1219 * jit-playback.c (gcc::jit::playback::function::get_address): New 1220 method. 1221 * jit-playback.h (gcc::jit::playback::function::get_address): New 1222 method decl. 1223 * jit-recording.c: Within namespace gcc::jit::recording... 1224 (function::function): Initialize new field "m_fn_ptr_type". 1225 (function::get_address): New method. 1226 (function_pointer::replay_into): New method. 1227 (function_pointer::visit_children): New method. 1228 (function_pointer::make_debug_string): New method. 1229 (function_pointer::write_reproducer): New method. 1230 * jit-recording.h: Within namespace gcc::jit::recording... 1231 (function::get_address): New method. 1232 (function): Add field "m_fn_ptr_type". 1233 (class function_pointer): New subclass of rvalue. 1234 * libgccjit++.h (gccjit::function::get_address): New method. 1235 * libgccjit.c (gcc_jit_function_get_address): New function. 1236 * libgccjit.h (LIBGCCJIT_HAVE_gcc_jit_function_get_address): New 1237 macro. 1238 (gcc_jit_function_get_address): New API entrypoint. 1239 * libgccjit.map (LIBGCCJIT_ABI_9): New tag. 1240 12412017-09-14 David Malcolm <dmalcolm@redhat.com> 1242 1243 PR jit/82174 1244 * jit-builtins.c (matches_builtin): Ignore entries with a NULL 1245 name. 1246 12472017-08-18 David Malcolm <dmalcolm@redhat.com> 1248 1249 PR tree-optimization/46805 1250 * dummy-frontend.c (jit_langhook_parse_file): Handle vector types. 1251 12522017-08-18 David Malcolm <dmalcolm@redhat.com> 1253 1254 * jit-recording.c (class gcc::jit::reproducer): Rename field 1255 "m_identifiers" to "m_map_memento_to_identifier". Add field 1256 "m_set_identifiers" and struct hash_traits for it. 1257 (gcc::jit::reproducer::reproducer): Update for above. 1258 (convert_to_identifier): New function. 1259 (gcc::jit::reproducer::ensure_identifier_is_unique): New method. 1260 (gcc::jit::reproducer::make_identifier): Avoid appending the %p 1261 unless necessary for uniqueness. Update for field renaming. 1262 (gcc::jit::reproducer::get_identifier): Update for field renaming. 1263 12642017-08-09 David Malcolm <dmalcolm@redhat.com> 1265 1266 * docs/cp/topics/types.rst (Vector types): New section. 1267 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_8): New tag. 1268 * docs/topics/types.rst (gcc_jit_context_get_type): Fix typo in 1269 example. 1270 (Vector types): New section. 1271 * docs/_build/texinfo/libgccjit.texi: Regenerate. 1272 * jit-playback.c (gcc::jit::playback::type::get_vector): New 1273 method. 1274 * jit-playback.h (gcc::jit::playback::type::get_vector): New 1275 method. 1276 * jit-recording.c: In namespace gcc::jit::recording:: 1277 (type::get_vector): New method. 1278 (memento_of_get_aligned::write_reproducer): Fix typo 1279 in leading comment. 1280 (memento_of_get_vector::replay_into): New method. 1281 (memento_of_get_vector::make_debug_string): New method. 1282 (memento_of_get_vector::write_reproducer): New method. 1283 * jit-recording.h: In namespace gcc::jit::recording:: 1284 (type::get_vector): New 1285 method. 1286 (class memento_of_get_vector): New class. 1287 * libgccjit++.h (gccjit::type::get_vector): New method. 1288 * libgccjit.c (gcc_jit_type_get_vector): New public entrypoint. 1289 * libgccjit.h (LIBGCCJIT_HAVE_gcc_jit_type_get_vector): New 1290 define. 1291 (gcc_jit_type_get_vector): New decl. 1292 * libgccjit.map (LIBGCCJIT_ABI_8): New ABI tag. 1293 12942017-07-05 Richard Sandiford <richard.sandiford@linaro.org> 1295 Alan Hayward <alan.hayward@arm.com> 1296 David Sherwood <david.sherwood@arm.com> 1297 1298 * dummy-frontend.c (jit_langhook_type_for_mode): Remove "enum" before 1299 "machine_mode". 1300 13012017-04-24 David Malcolm <dmalcolm@redhat.com> 1302 1303 * docs/cp/topics/types.rst (gccjit::type::get_const): Remove 1304 comment. 1305 (gccjit::type::get_aligned): Add. 1306 * docs/topics/compatibility.rst: Add LIBGCCJIT_ABI_7. 1307 * docs/topics/types.rst: Add gcc_jit_type_get_aligned. 1308 * docs/_build/texinfo/libgccjit.texi: Regenerate. 1309 * jit-playback.c (gcc::jit::playback::type::get_aligned): New 1310 method. 1311 * jit-playback.h (gcc::jit::playback::type::get_aligned): New 1312 method. 1313 * jit-recording.c: Within namespace gcc::jit::recording... 1314 (type::get_aligned): New method. 1315 (memento_of_get_aligned::replay_into): New method. 1316 (memento_of_get_aligned::make_debug_string): New method. 1317 (memento_of_get_aligned::write_reproducer): New method. 1318 * jit-recording.h: Within namespace gcc::jit::recording... 1319 (type::get_aligned): New method. 1320 (type::accepts_writes_from): Strip off qualifications from 1321 this when comparing pointer equality. 1322 (decorated_type): New subclass of type, subsuming the 1323 commonality between memento_of_get_const and 1324 memento_of_get_volatile. 1325 (memento_of_get_const): Make a subclass of decorated_type, 1326 rather than type. 1327 (memento_of_get_volatile): Likewise. 1328 (memento_of_get_aligned): Likewise. 1329 * libgccjit++.h: Within namespace gccjit... 1330 (type::get_const): New method. 1331 (type::get_aligned): New method. 1332 * libgccjit.c (gcc_jit_type_get_aligned): New function. 1333 * libgccjit.h (gcc_jit_type_get_aligned): New decl. 1334 * libgccjit.map (LIBGCCJIT_ABI_7): New 1335 (gcc_jit_type_get_aligned): Add. 1336 13372017-01-19 David Malcolm <dmalcolm@redhat.com> 1338 1339 * dummy-frontend.c (jit_langhook_type_for_size): Delete. 1340 (LANG_HOOKS_TYPE_FOR_SIZE): Don't redefine. 1341 13422017-01-18 David Malcolm <dmalcolm@redhat.com> 1343 1344 * dummy-frontend.c (jit_langhook_type_for_size): Implement, using 1345 lto's lto_type_for_size. 1346 13472017-01-01 Jakub Jelinek <jakub@redhat.com> 1348 1349 Update copyright years. 1350 13512016-05-20 David Malcolm <dmalcolm@redhat.com> 1352 1353 * docs/topics/compatibility.rst: Add LIBGCCJIT_ABI_6. 1354 * docs/topics/expressions.rst (Function calls): Add documentation 1355 of gcc_jit_rvalue_set_bool_require_tail_call. 1356 * docs/_build/texinfo/libgccjit.texi: Regenerate. 1357 * jit-common.h (gcc::jit::recording::base_call): Add forward decl. 1358 * jit-playback.c: Within namespace gcc::jit::playback... 1359 (context::build_call) Add "require_tail_call" param and use it 1360 to set CALL_EXPR_MUST_TAIL_CALL. 1361 (context::new_call): Add "require_tail_call" param. 1362 (context::new_call_through_ptr): Likewise. 1363 * jit-playback.h: Within namespace gcc::jit::playback... 1364 (context::new_call: Add "require_tail_call" param. 1365 (context::new_call_through_ptr): Likewise. 1366 (context::build_call): Likewise. 1367 * jit-recording.c: Within namespace gcc::jit::recording... 1368 (base_call::base_call): New constructor. 1369 (base_call::write_reproducer_tail_call): New method. 1370 (call::call): Update for inheritance from base_call. 1371 (call::replay_into): Provide m_require_tail_call to call 1372 to new_call. 1373 (call::write_reproducer): Call write_reproducer_tail_call. 1374 (call_through_ptr::call_through_ptr): Update for inheritance from 1375 base_call. 1376 (call_through_ptr::replay_into): Provide m_require_tail_call to call 1377 to new_call_through_ptr. 1378 (recording::call_through_ptr::write_reproducer): Call 1379 write_reproducer_tail_call. 1380 * jit-recording.h: Within namespace gcc::jit::recording... 1381 (rvalue::dyn_cast_base_call): New virtual function. 1382 (class base_call): New subclass of class rvalue. 1383 (class call): Inherit from base_call rather than directly from 1384 rvalue, moving get_precedence and m_args to base_call. 1385 (class call_through_ptr): Likewise. 1386 * libgccjit.c (gcc_jit_rvalue_set_bool_require_tail_call): New 1387 function. 1388 * libgccjit.h 1389 (LIBGCCJIT_HAVE_gcc_jit_rvalue_set_bool_require_tail_call): New 1390 macro. 1391 (gcc_jit_rvalue_set_bool_require_tail_call): New function. 1392 * libgccjit.map (LIBGCCJIT_ABI_6): New. 1393 (gcc_jit_rvalue_set_bool_require_tail_call): Add. 1394 13952016-05-17 David Malcolm <dmalcolm@redhat.com> 1396 1397 * dummy-frontend.c: Include diagnostic.h. 1398 (jit_begin_diagnostic): New function. 1399 (jit_end_diagnostic): New function. 1400 (jit_langhook_init): Register jit_begin_diagnostic 1401 and jit_end_diagnostic with the global_dc. 1402 * jit-playback.c: Include diagnostic.h. 1403 (gcc::jit::playback::context::add_diagnostic): New method. 1404 * jit-playback.h (struct diagnostic_context): Add forward 1405 declaration. 1406 (gcc::jit::playback::context::add_diagnostic): New method. 1407 14082016-05-17 David Malcolm <dmalcolm@redhat.com> 1409 1410 * docs/topics/expressions.rst (Function calls): Document 1411 gcc_jit_context_new_call_through_ptr. 1412 * docs/_build/texinfo/libgccjit.texi: Regenerate. 1413 14142016-05-13 David Malcolm <dmalcolm@redhat.com> 1415 1416 * jit-playback.h: Within namespace gcc:jit::playback... 1417 (compile_to_memory::postprocess): Mark with FINAL OVERRIDE. 1418 (compile_to_file::postprocess): Likewise. 1419 (function::finalizer): Likewise. 1420 (block::finalizer): Likewise. 1421 (source_file::finalizer): Likewise. 1422 (source_line::finalizer): Likewise. 1423 * jit-recording.c (gcc::jit::rvalue_usage_validator):: Likewise. 1424 * jit-recording.h: Within namespace gcc::jit::recording... 1425 (string::replay_into): Mark with FINAL OVERRIDE. 1426 (string::make_debug_string): Likewise. 1427 (string::write_reproducer): Likewise. 1428 (location::replay_into): Likewise. 1429 (location::dyn_cast_location): Likewise. 1430 (location::make_debug_string): Likewise. 1431 (location::write_reproducer): Likewise. 1432 (memento_of_get_type::dereference): Likewise. 1433 (memento_of_get_type::accepts_writes_from): Likewise. 1434 (memento_of_get_type::is_int): Likewise. 1435 (memento_of_get_type::is_float): Likewise. 1436 (memento_of_get_type::is_bool): Likewise. 1437 (memento_of_get_type::is_pointer): Likewise. 1438 (memento_of_get_type::is_array): Likewise. 1439 (memento_of_get_type::is_void): Likewise. 1440 (memento_of_get_type::replay_into): Likewise. 1441 (memento_of_get_type::make_debug_string): Likewise. 1442 (memento_of_get_type::write_reproducer): Likewise. 1443 (memento_of_get_pointer::dereference): Likewise. 1444 (memento_of_get_pointer::accepts_writes_from): Likewise. 1445 (memento_of_get_pointer::replay_into): Likewise. 1446 (memento_of_get_pointer::is_int): Likewise. 1447 (memento_of_get_pointer::is_float): Likewise. 1448 (memento_of_get_pointer::is_bool): Likewise. 1449 (memento_of_get_pointer::is_pointer): Likewise. 1450 (memento_of_get_pointer::is_array): Likewise. 1451 (memento_of_get_pointer::make_debug_string): Likewise. 1452 (memento_of_get_pointer::write_reproducer): Likewise. 1453 (memento_of_get_const::dereference): Likewise. 1454 (memento_of_get_const::accepts_writes_from): Likewise. 1455 (memento_of_get_const::unqualified): Likewise. 1456 (memento_of_get_const::is_int): Likewise. 1457 (memento_of_get_const::is_float): Likewise. 1458 (memento_of_get_const::is_bool): Likewise. 1459 (memento_of_get_const::is_pointer): Likewise. 1460 (memento_of_get_const::is_array): Likewise. 1461 (memento_of_get_const::void replay_into): Likewise; 1462 (memento_of_get_const::make_debug_string): Likewise. 1463 (memento_of_get_const::write_reproducer): Likewise. 1464 (memento_of_get_volatile::dereference): Likewise. 1465 (memento_of_get_volatile::unqualified): Likewise. 1466 (memento_of_get_volatile::is_int): Likewise. 1467 (memento_of_get_volatile::is_float): Likewise. 1468 (memento_of_get_volatile::is_bool): Likewise. 1469 (memento_of_get_volatile::is_pointer): Likewise. 1470 (memento_of_get_volatile::is_array): Likewise. 1471 (memento_of_get_volatile::replay_into): Likewise; 1472 (memento_of_get_volatile::make_debug_string): Likewise. 1473 (memento_of_get_volatile::write_reproducer): Likewise. 1474 (array_type::dereference): Likewise. 1475 (array_type::is_int): Likewise. 1476 (array_type::is_float): Likewise. 1477 (array_type::is_bool): Likewise. 1478 (array_type::is_pointer): Likewise. 1479 (array_type::is_array): Likewise. 1480 (array_type::replay_into): Likewise; 1481 (array_type::make_debug_string): Likewise. 1482 (array_type::write_reproducer): Likewise. 1483 (function_type::dereference): Likewise. 1484 (function_type::function_dyn_cast_function_type): Likewise. 1485 (function_type::function_as_a_function_type): Likewise. 1486 (function_type::is_int): Likewise. 1487 (function_type::is_float): Likewise. 1488 (function_type::is_bool): Likewise. 1489 (function_type::is_pointer): Likewise. 1490 (function_type::is_array): Likewise. 1491 (function_type::replay_into): Likewise; 1492 (function_type::make_debug_string): Likewise. 1493 (function_type::write_reproducer): Likewise. 1494 (field::replay_into): Likewise; 1495 (field::write_to_dump): Likewise. 1496 (field::make_debug_string): Likewise. 1497 (field::write_reproducer): Likewise. 1498 (compound_type::dereference): Likewise. 1499 (compound_type::is_int): Likewise. 1500 (compound_type::is_float): Likewise. 1501 (compound_type::is_bool): Likewise. 1502 (compound_type::is_pointer): Likewise. 1503 (compound_type::is_array): Likewise. 1504 (compound_type::has_known_size): Likewise. 1505 (struct_::dyn_cast_struct): Likewise. 1506 (struct_::replay_into): Likewise. 1507 (struct_::access_as_type): Likewise. 1508 (struct_::make_debug_string): Likewise. 1509 (struct_::write_reproducer): Likewise. 1510 (fields::replay_into): Likewise. 1511 (fields::write_to_dump): Likewise. 1512 (fields::make_debug_string): Likewise. 1513 (fields::write_reproducer): Likewise. 1514 (union_::replay_into): Likewise. 1515 (union_::make_debug_string): Likewise. 1516 (union_::write_reproducer): Likewise. 1517 (lvalue::access_as_rvalue): Mark with OVERRIDE. 1518 (param::replay_into): Mark with FINAL OVERRIDE. 1519 (param::visit_children): Likewise. 1520 (param::dyn_cast_param): Likewise. 1521 (param::access_as_rvalue): Likewise. 1522 (param::access_as_lvalue): Likewise. 1523 (param::make_debug_string): Likewise. 1524 (param::write_reproducer): Likewise. 1525 (param::get_precedence): Likewise. 1526 (function::replay_into): Likewise. 1527 (function::write_to_dump): Likewise. 1528 (function::make_debug_string): Likewise. 1529 (function::write_reproducer): Likewise. 1530 (block::write_to_dump): Likewise. 1531 (block::make_debug_string): Likewise. 1532 (block::write_reproducer): Likewise. 1533 (block::replay_into): Likewise. 1534 (global::replay_into): Likewise; 1535 (global::visit_children): Likewise. 1536 (global::write_to_dump): Likewise. 1537 (global::make_debug_string): Likewise. 1538 (global::write_reproducer): Likewise. 1539 (global::get_precedence): Likewise. 1540 (memento_of_new_rvalue_from_const::replay_into): Likewise. 1541 (memento_of_new_rvalue_from_const::visit_children): Likewise. 1542 (memento_of_new_rvalue_from_const::is_constant): Likewise. 1543 (memento_of_new_rvalue_from_const::get_wide_int): Likewise. 1544 (memento_of_new_rvalue_from_const::make_debug_string): Likewise. 1545 (memento_of_new_rvalue_from_const::write_reproducer): Likewise. 1546 (memento_of_new_rvalue_from_const::get_precedence): Likewise. 1547 (memento_of_new_string_literal::replay_into): Likewise. 1548 (memento_of_new_string_literal::visit_children): Likewise. 1549 (memento_of_new_string_literal::make_debug_string): Likewise. 1550 (memento_of_new_string_literal::write_reproducer): Likewise. 1551 (memento_of_new_string_literal::get_precedence): Likewise. 1552 (unary_op::replay_into): Likewise. 1553 (unary_op::visit_children): Likewise. 1554 (unary_op::make_debug_string): Likewise. 1555 (unary_op::write_reproducer): Likewise. 1556 (unary_op::get_precedence): Likewise. 1557 (binary_op::replay_into): Likewise. 1558 (binary_op::visit_children): Likewise. 1559 (binary_op::make_debug_string): Likewise. 1560 (binary_op::write_reproducer): Likewise. 1561 (binary_op::get_precedence): Likewise. 1562 (comparison::replay_into): Likewise. 1563 (comparison::visit_children): Likewise. 1564 (comparison::make_debug_string): Likewise. 1565 (comparison::write_reproducer): Likewise. 1566 (comparison::get_precedence): Likewise. 1567 (cast::replay_into): Likewise. 1568 (cast::visit_children): Likewise. 1569 (cast::make_debug_string): Likewise. 1570 (cast::write_reproducer): Likewise. 1571 (cast::get_precedence): Likewise. 1572 (call::replay_into): Likewise. 1573 (call::visit_children): Likewise. 1574 (call::make_debug_string): Likewise. 1575 (call::write_reproducer): Likewise. 1576 (call::get_precedence): Likewise. 1577 (call_through_ptr::replay_into): Likewise. 1578 (call_through_ptr::visit_children): Likewise. 1579 (call_through_ptr::make_debug_string): Likewise. 1580 (call_through_ptr::write_reproducer): Likewise. 1581 (call_through_ptr::get_precedence): Likewise. 1582 (array_access::replay_into): Likewise. 1583 (array_access::visit_children): Likewise. 1584 (array_access::make_debug_string): Likewise. 1585 (array_access::write_reproducer): Likewise. 1586 (array_access::get_precedence): Likewise. 1587 (access_field_of_lvalue::replay_into): Likewise. 1588 (access_field_of_lvalue::visit_children): Likewise. 1589 (access_field_of_lvalue::make_debug_string): Likewise. 1590 (access_field_of_lvalue::write_reproducer): Likewise. 1591 (access_field_of_lvalue::get_precedence): Likewise. 1592 (access_field_rvalue::replay_into): Likewise. 1593 (access_field_rvalue::visit_children): Likewise. 1594 (access_field_rvalue::make_debug_string): Likewise. 1595 (access_field_rvalue::write_reproducer): Likewise. 1596 (access_field_rvalue::get_precedence): Likewise. 1597 (dereference_field_rvalue::replay_into): Likewise. 1598 (dereference_field_rvalue::visit_children): Likewise. 1599 (dereference_field_rvalue::make_debug_string): Likewise. 1600 (dereference_field_rvalue::write_reproducer): Likewise. 1601 (dereference_field_rvalue::get_precedence): Likewise. 1602 (dereference_rvalue::replay_into): Likewise. 1603 (dereference_rvalue::visit_children): Likewise. 1604 (dereference_rvalue::make_debug_string): Likewise. 1605 (dereference_rvalue::write_reproducer): Likewise. 1606 (dereference_rvalue::get_precedence): Likewise. 1607 (get_address_of_lvalue::replay_into): Likewise. 1608 (get_address_of_lvalue::visit_children): Likewise. 1609 (get_address_of_lvalue::make_debug_string): Likewise. 1610 (get_address_of_lvalue::write_reproducer): Likewise. 1611 (get_address_of_lvalue::get_precedence): Likewise. 1612 (local::replay_into): Likewise. 1613 (local::visit_children): Likewise. 1614 (local::write_to_dump): Likewise. 1615 (local::make_debug_string): Likewise. 1616 (local::write_reproducer): Likewise. 1617 (local::get_precedence): Likewise. 1618 (statement::write_to_dump): Likewise. 1619 (eval::replay_into): Likewise. 1620 (eval::make_debug_string): Likewise. 1621 (eval::write_reproducer): Likewise. 1622 (assignment::replay_into): Likewise. 1623 (assignment::make_debug_string): Likewise. 1624 (assignment::write_reproducer): Likewise. 1625 (assignment_op::replay_into): Likewise. 1626 (assignment_op::make_debug_string): Likewise. 1627 (assignment_op::write_reproducer): Likewise. 1628 (comment::replay_into): Likewise. 1629 (comment::make_debug_string): Likewise. 1630 (comment::write_reproducer): Likewise. 1631 (conditional::replay_into): Likewise. 1632 (conditional::get_successor_blocks): Likewise. 1633 (conditional::make_debug_string): Likewise. 1634 (conditional::write_reproducer): Likewise. 1635 (jump::replay_into): Likewise. 1636 (jump::get_successor_blocks): Likewise. 1637 (jump::make_debug_string): Likewise. 1638 (jump::write_reproducer): Likewise. 1639 (return_::replay_into): Likewise. 1640 (return_::get_successor_blocks): Likewise. 1641 (return_::make_debug_string): Likewise. 1642 (return_::write_reproducer): Likewise. 1643 (case_::replay_into): Likewise. 1644 (case_::write_reproducer): Likewise. 1645 (case_::make_debug_string): Likewise. 1646 (switch_::replay_into): Likewise. 1647 (switch_::get_successor_blocks): Likewise. 1648 (switch_::make_debug_string): Likewise. 1649 (switch_::write_reproducer): Likewise. 1650 16512016-02-08 David Malcolm <dmalcolm@redhat.com> 1652 1653 * dummy-frontend.c (jit_langhook_init): Remove 1654 second argument to build_common_tree_nodes to 1655 track r233218. 1656 16572016-01-23 Iain Buclaw <ibuclaw@gdcproject.org> 1658 1659 * jit-playback.c: Include pthread.h. 1660 16612016-01-19 David Malcolm <dmalcolm@redhat.com> 1662 1663 PR jit/69144 1664 * jit-playback.c (gcc::jit::playback::compile_to_file::postprocess): 1665 Potentially add the temporary artifact to the tempdir's list of 1666 tempfiles needing additional cleanup. 1667 (gcc::jit::playback::context::extract_any_requested_dumps): Likewise 1668 for the dumpfile. 1669 * jit-tempdir.c (gcc::jit::tempdir::~tempdir): Clean up additional 1670 tempfiles. 1671 * jit-tempdir.h (gcc::jit::tempdir::add_temp_file): New method. 1672 (gcc::jit::tempdir::m_tempfiles): New field. 1673 * docs/cp/intro/tutorial04.rst: Update for changes to toyvm.cc. 1674 * docs/examples/tut04-toyvm/toyvm.cc (class compilation_result): 1675 New. 1676 (toyvm_function::compile): Change return type from function ptr 1677 to a compilation_result. 1678 (toyvm_function::get_function_name): New accessor. 1679 (toyvm_function::m_funcname): New field. 1680 (get_function_name): Convert to... 1681 (toyvm_function::make_function_name): ...this new method. 1682 (toyvm_function::parse): Call make_function_name. 1683 (toyvm_function::compile): Convert return type from function ptr 1684 to a compilation_result. Use get_function_name. 1685 (compilation_state::compile): Convert return type from 1686 gcc_jit_result * to a compilation_result. 1687 (test_script): Update for above changes, extracting the code from 1688 the compilation_result. 1689 (main): Likewise. 1690 * docs/_build/texinfo/libgccjit.texi: Regenerate. 1691 16922016-01-04 Jakub Jelinek <jakub@redhat.com> 1693 1694 Update copyright years. 1695 16962015-11-11 Andrew MacLeod <amacleod@redhat.com> 1697 1698 * dummy-frontend.c: Remove unused header files. 1699 * jit-builtins.c: Likewise. 1700 * jit-playback.c: Likewise. 1701 * jit-recording.c: Likewise. 1702 * jit-spec.c: Likewise. 1703 * libgccjit.c: Likewise. 1704 17052015-11-07 Richard Sandiford <richard.sandiford@arm.com> 1706 1707 * jit-builtins.c: Don't undef DEF_BUILTIN. 1708 17092015-10-29 Andrew MacLeod <amacleod@redhat.com> 1710 1711 * dummy-frontend.c: Reorder #include's and remove duplicates. 1712 * jit-builtins.c: Likewise. 1713 * jit-playback.c: Likewise. 1714 * jit-recording.c: Likewise. 1715 * libgccjit.c: Likewise. 1716 17172015-10-13 Jakub Jelinek <jakub@redhat.com> 1718 1719 * jit-builtins.c (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10, 1720 DEF_FUNCTION_TYPE_11): Define. 1721 * jit-builtins.h (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10, 1722 DEF_FUNCTION_TYPE_11): Define. 1723 17242015-09-30 Thomas Schwinge <thomas@codesourcery.com> 1725 Ulrich Drepper <drepper@gmail.com> 1726 1727 * jit-builtins.h: Undefine DEF_FUNCTION_TYPE_VAR_6 after use. 1728 17292015-09-30 Matthias Klose <doko@ubuntu.com> 1730 1731 * jit-builtins.h Define DEF_FUNCTION_TYPE_VAR_6, 1732 remove DEF_FUNCTION_TYPE_VAR_11. 1733 * jit-builtins.c (builtins_manager::make_type): Define and handle 1734 DEF_FUNCTION_TYPE_VAR_6, remove DEF_FUNCTION_TYPE_VAR_11. 1735 17362015-08-25 David Malcolm <dmalcolm@redhat.com> 1737 1738 * docs/cp/topics/contexts.rst 1739 (gccjit::context::set_bool_use_external_driver): New. 1740 * docs/internals/test-hello-world.exe.log.txt: Update. 1741 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_5): New. 1742 * docs/topics/contexts.rst 1743 (gcc_jit_context_set_bool_use_external_driver): New. 1744 * jit-common.h (enum inner_bool_option): Add 1745 INNER_BOOL_OPTION_USE_EXTERNAL_DRIVER. 1746 * jit-playback.c (gcc_driver_name): New global. 1747 (gcc:jit::playback::context::invoke_driver): Split out second 1748 half into... 1749 (gcc::jit::playback::context::invoke_embedded_driver): ...this new 1750 function, and... 1751 (gcc::jit::playback::context::invoke_external_driver): ...this new 1752 function. 1753 * jit-playback.h 1754 (gcc::jit::playback::context::get_inner_bool_option): New. 1755 (gcc::jit::playback::context::invoke_embedded_driver): New. 1756 (gcc::jit::playback::context::invoke_external_driver): New. 1757 * jit-recording.c (inner_bool_option_reproducer_strings): 1758 Add entry for INNER_BOOL_OPTION_USE_EXTERNAL_DRIVER. 1759 * libgccjit++.h 1760 (gccjit::context::set_bool_use_external_driver): New. 1761 * libgccjit.c (gcc_jit_context_set_bool_use_external_driver): New. 1762 * libgccjit.h (gcc_jit_context_set_bool_use_external_driver): New. 1763 (LIBGCCJIT_HAVE_gcc_jit_context_set_bool_use_external_driver): 1764 New. 1765 * libgccjit.map (LIBGCCJIT_ABI_5): New. 1766 * notes.txt: Show invocation of embedded copy of driver. 1767 * docs/internals/test-hello-world.exe.log.txt: Update 1768 17692015-08-13 David Malcolm <dmalcolm@redhat.com> 1770 1771 * jit-playback.c (invoke_driver): On OS X, add 1772 "-Wl,-undefined,dynamic_lookup" to the driver arguments. 1773 17742015-08-03 David Malcolm <dmalcolm@redhat.com> 1775 1776 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_4): New. 1777 * docs/topics/contexts.rst (GCC_JIT_BOOL_OPTION_DUMP_SUMMARY): 1778 We no longer show a profile. 1779 * docs/topics/index.rst (Topic Reference): Add performance.rst. 1780 * docs/topics/performance.rst: New file. 1781 * docs/_build/texinfo/libgccjit.texi: Regenerate. 1782 * jit-playback.c (gcc::jit::playback::context::compile): Add timer 1783 param when constructing the "toplev" instance. 1784 (gcc::jit::playback::context::acquire_mutex): Add timer param when 1785 constructing auto_timevar instance. 1786 (gcc::jit::playback::context::make_fake_args): If we have a timer, 1787 add "-ftime-report". 1788 (gcc::jit::playback::context::invoke_driver): Add timer param when 1789 constructing auto_timevar instance. 1790 (gcc::jit::playback::context::dlopen_built_dso): Likewise. 1791 * jit-playback.h (gcc::jit::playback::context::get_timer): New accessor. 1792 * jit-recording.c: Include timevar.h. 1793 (gcc::jit::recording::context::context): Initialize field "m_timer". 1794 * jit-recording.h: Add forward declaration of class timer. 1795 (gcc::jit::recording::context::set_timer): New method. 1796 (gcc::jit::recording::context::get_timer): New method. 1797 (gcc::jit::recording::context::m_timer): New field. 1798 * libgccjit++.h (gccjit::timer): New class. 1799 (gccjit::auto_time): New class. 1800 (gccjit::context::set_timer): New method. 1801 (gccjit::context::get_timer): New. 1802 (gccjit::timer::timer): New. 1803 (gccjit::timer::push): New. 1804 (gccjit::timer::pop): New. 1805 (timer::print): New. 1806 (timer::get_inner_timer): New. 1807 (timer::release): New. 1808 (auto_time::auto_time): New. 1809 (auto_time::~auto_time): New. 1810 * libgccjit.c: Include timevar.h. 1811 (struct gcc_jit_timer): New. 1812 (gcc_jit_timer_new): New function. 1813 (gcc_jit_timer_release): New function. 1814 (gcc_jit_context_set_timer): New function. 1815 (gcc_jit_context_get_timer): New function. 1816 (gcc_jit_timer_push): New function. 1817 (gcc_jit_timer_pop): New function. 1818 (gcc_jit_timer_print): New function. 1819 * libgccjit.h (LIBGCCJIT_HAVE_TIMING_API): New macro. 1820 (gcc_jit_timer): New typedef. 1821 (gcc_jit_timer_new): New function. 1822 (gcc_jit_timer_release): New function. 1823 (gcc_jit_context_set_timer): New function. 1824 (gcc_jit_context_get_timer): New function. 1825 (gcc_jit_timer_push): New function. 1826 (gcc_jit_timer_pop): New function. 1827 (gcc_jit_timer_print): New function. 1828 * libgccjit.map (LIBGCCJIT_ABI_4): New. 1829 (gcc_jit_timer_new): New function. 1830 (gcc_jit_timer_release): New function. 1831 (gcc_jit_context_set_timer): New function. 1832 (gcc_jit_context_get_timer): New function. 1833 (gcc_jit_timer_push): New function. 1834 (gcc_jit_timer_pop): New function. 1835 (gcc_jit_timer_print): New function. 1836 18372015-07-23 David Malcolm <dmalcolm@redhat.com> 1838 1839 * jit-playback.c (invoke_driver): Convert local "argvec" 1840 to an auto_argvec, so that it owns copies of the strings, 1841 rather than borrows them, updating ADD_ARG to use xstrdup 1842 and special-casing the NULL terminator to avoid 1843 xstrdup (NULL). Call add_multilib_driver_arguments at the front 1844 of the arguments. 1845 (MULTILIB_DEFAULTS): Provide a default definition. 1846 (multilib_defaults_raw): New constant array. 1847 (gcc::jit::playback::context::add_multilib_driver_arguments): New 1848 method. 1849 * jit-playback.h 1850 (gcc::jit::playback::context::add_multilib_driver_arguments): New 1851 method. 1852 * docs/internals/test-hello-world.exe.log.txt: Update. 1853 * docs/_build/texinfo/libgccjit.texi: Regenerate. 1854 18552015-07-16 David Malcolm <dmalcolm@redhat.com> 1856 1857 * docs/internals/index.rst (Overview of code structure): Add note 1858 that the implementation is in C++, despite the .c extension. 1859 (Submitting patches): New subsection. 1860 * docs/_build/texinfo/libgccjit.texi: Regenerate. 1861 18622015-07-09 Andrew MacLeod <amacleod@redhat.com> 1863 1864 * dummy-frontend.c: Adjust includes for flags.h changes. 1865 * jit-common.h: Likewise. 1866 * jit-playback.c: Likewise. 1867 18682015-07-08 David Malcolm <dmalcolm@redhat.com> 1869 1870 PR jit/66783 1871 * libgccjit.c (gcc_jit_context_new_field): Show name of field in 1872 "unknown size" error message. 1873 (gcc_jit_struct_set_fields): Show name of struct in error message. 1874 (gcc_jit_context_new_global): Show name of global in 1875 "unknown size" error message. 1876 (gcc_jit_function_new_local): Likewise for local. 1877 18782015-07-07 Andrew MacLeod <amacleod@redhat.com> 1879 1880 * dummy-frontend.c: Adjust includes. 1881 * jit-common.h: Likewise. 1882 * jit-playback.c: Likewise. 1883 18842015-07-07 David Malcolm <dmalcolm@redhat.com> 1885 1886 PR jit/66783 1887 * jit-recording.h: Within namespace gcc:jit::recording... 1888 (type::has_known_size): New virtual function. 1889 (struct_has_known_size): New function. 1890 * libgccjit.c (gcc_jit_context_new_field): Verify that the type 1891 has a known size. 1892 (gcc_jit_context_new_global): Likewise. 1893 (gcc_jit_function_new_local): Likewise. 1894 18952015-07-07 David Malcolm <dmalcolm@redhat.com> 1896 1897 PR jit/66779 1898 * dummy-frontend.c (jit_langhook_type_for_mode): Ensure that we 1899 handle modes QI, HI, SI, DI, TI. 1900 19012015-07-01 David Malcolm <dmalcolm@redhat.com> 1902 1903 PR jit/66700 1904 * jit-playback.c (jit_mark_addressable): New function. 1905 (gcc::jit::playback::lvalue::get_address): Call 1906 jit_mark_addressable on the underlying tree. 1907 19082015-07-01 David Malcolm <dmalcolm@redhat.com> 1909 1910 * docs/topics/types.rst (gcc_jit_context_new_union_type): Add 1911 documentation. 1912 * docs/_build/texinfo/libgccjit.texi: Regenerate. 1913 19142015-07-01 David Malcolm <dmalcolm@redhat.com> 1915 1916 * docs/topics/contexts.rst (gcc_jit_context_set_bool_option): 1917 Clarify lack of lifetime requirements on (const char *) parameter. 1918 * docs/topics/expressions.rst 1919 (gcc_jit_context_new_string_literal): Likewise. 1920 (gcc_jit_context_new_global): Likewise. 1921 * docs/topics/functions.rst (gcc_jit_context_new_param): Likewise. 1922 (gcc_jit_context_new_function): Likewise. 1923 (gcc_jit_function_new_block): Likewise. 1924 (gcc_jit_block_add_comment): Likewise. 1925 * docs/topics/locations.rst (gcc_jit_context_new_location): 1926 Likewise. 1927 * docs/topics/types.rst (gcc_jit_context_new_field): Likewise. 1928 (gcc_jit_context_new_struct_type): Likewise. 1929 * docs/_build/texinfo/libgccjit.texi: Regenerate. 1930 19312015-06-30 David Malcolm <dmalcolm@redhat.com> 1932 1933 * docs/cp/topics/functions.rst (Blocks): Add switch statements to 1934 list of ways to terminate a block. 1935 (gccjit::block::end_with_switch): Add function description. 1936 (gccjit::case_): Add class. 1937 (gccjit::context::new_case): Add function description. 1938 * docs/cp/topics/objects.rst: Add "case_" to class hierarchy. 1939 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_3): New. 1940 * docs/topics/functions.rst (Blocks): Add switch statements to 1941 list of ways to terminate a block. 1942 (gcc_jit_block_end_with_switch): Add function description. 1943 (gcc_jit_case): Add type. 1944 (gcc_jit_context_new_case): Add function description. 1945 (gcc_jit_case_as_object): Add function description. 1946 * docs/topics/objects.rst: Add gcc_jit_case to class hierarchy. 1947 * docs/_build/texinfo/libgccjit.texi: Regenerate. 1948 * jit-common.h (gcc::jit::recording::case_): Add forward decl. 1949 (gcc::jit::playback::case_): Add forward decl. 1950 * jit-playback.c (add_case): New function. 1951 (gcc::jit::playback::block::add_switch): New function. 1952 * jit-playback.h (gcc::jit::playback::case_): New struct. 1953 (gcc::jit::playback::block::get_function): New method. 1954 (gcc::jit::playback::block::add_switch): New method. 1955 * jit-recording.c: Within namespace gcc::jit... 1956 (recording::context::new_case): New method. 1957 (recording::function::validate): Update for change to 1958 get_successor_blocks. 1959 (recording::block::end_with_switch): New method. 1960 (recording::block::get_successor_blocks): Update to support an 1961 arbitrary number of successor blocks. 1962 (recording::block::dump_edges_to_dot): Likewise. 1963 (memento_of_new_rvalue_from_const <int>::get_wide_int): New. 1964 (memento_of_new_rvalue_from_const <long>::get_wide_int): New. 1965 (memento_of_new_rvalue_from_const <double>::get_wide_int): New. 1966 (memento_of_new_rvalue_from_const <void *>::get_wide_int): New. 1967 (recording::statement::get_successor_blocks): Update to support an 1968 arbitrary number of successor blocks. 1969 (recording::conditional::get_successor_blocks): Likewise. 1970 (recording::jump::get_successor_blocks): Likewise. 1971 (recording::return_::get_successor_blocks): Likewise. 1972 (recording::case_::write_reproducer): New. 1973 (recording::case_::make_debug_string): New. 1974 (recording::switch_::switch_): New. 1975 (recording::switch_::replay_into): New. 1976 (recording::switch_::get_successor_blocks): New. 1977 (recording::switch_::make_debug_string): New. 1978 (recording::switch_::write_reproducer): New. 1979 * jit-recording.h: Within namespace gcc::jit::recording... 1980 (context::new_case): New. 1981 (rvalue::is_constant): New. 1982 (rvalue::get_wide_int): New. 1983 (block::end_with_switch): New. 1984 (block::get_successor_blocks): Update to support an arbitrary 1985 number of successor blocks. 1986 (memento_of_new_rvalue_from_const::is_constant): New. 1987 (memento_of_new_rvalue_from_const::get_wide_int): New. 1988 (statement::get_successor_blocks): Update to support an arbitrary 1989 number of successor blocks. 1990 (conditional::get_successor_blocks): Likewise. 1991 (jump::get_successor_blocks): Likewise. 1992 (return_::get_successor_blocks): Likewise. 1993 (case_): New subclass of memento. 1994 (switch_): New subclass of statement. 1995 * libgccjit++.h (gccjit::case_): New subclass of gccjit::object. 1996 (gccjit::context::new_case): New method. 1997 (gccjit::block::end_with_switch): New method. 1998 (gccjit::case_::case): New ctors. 1999 (gccjit::case_::get_inner_case): New method. 2000 * libgccjit.c: Include "typed-splay-tree.h" 2001 (struct gcc_jit_case): New. 2002 (gcc_jit_context_new_case): New function. 2003 (gcc_jit_case_as_object): New function. 2004 (valid_dest_for_switch): New function. 2005 (valid_case_for_switch): New function. 2006 (class api_call_validator): New class. 2007 (class case_range_validator): New class. 2008 (case_range_validator::case_range_validator): New. 2009 (case_range_validator::validate): New. 2010 (case_range_validator::case_compare): New. 2011 (case_range_validator::get_wide_int): new. 2012 (gcc_jit_block_end_with_switch): New. 2013 * libgccjit.h: Add gcc_jit_case to class hierarchy comment. 2014 (gcc_jit_case): New typedef. 2015 (gcc_jit_context_new_case): New function. 2016 (gcc_jit_case_as_object): New function. 2017 (gcc_jit_block_end_with_switch): New function. 2018 (LIBGCCJIT_HAVE_SWITCH_STATEMENTS): New. 2019 * libgccjit.map: Add gcc_jit_block_end_with_switch, 2020 gcc_jit_case_as_object and gcc_jit_context_new_case. 2021 20222015-06-30 David Malcolm <dmalcolm@redhat.com> 2023 2024 PR jit/66546 2025 * docs/cp/topics/contexts.rst 2026 (gccjit::context::set_bool_allow_unreachable_blocks): New. 2027 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_2): New. 2028 * docs/topics/contexts.rst (Options): Add notes discussing the 2029 transition from enums to entrypoints for new options. 2030 (gcc_jit_context_set_bool_allow_unreachable_blocks): New. 2031 * docs/_build/texinfo/libgccjit.texi: Regenerate. 2032 * jit-common.h (gcc::jit::inner_bool_option): New enum. 2033 * jit-recording.c: Within namespace gcc::jit... 2034 (recording::context::context): Handle m_inner_bool_options. 2035 (recording::context::set_inner_bool_option): New. 2036 (inner_bool_option_reproducer_strings): New. 2037 (recording::context::log_all_options): Log the "inner" bool 2038 options. 2039 (recording::context::log_inner_bool_option): New. 2040 (recording::context::dump_reproducer_to_file): Write initializers 2041 for "inner" bool options. 2042 (recording::function::validate): Don't check for block 2043 reachability if INNER_BOOL_OPTION_ALLOW_UNREACHABLE_BLOCKS is set. 2044 * jit-recording.h: Within namespace gcc::jit... 2045 (recording::context::set_inner_bool_option): New. 2046 (recording::context::get_inner_bool_option): New. 2047 (recording::context::log_inner_bool_option): New. 2048 (recording::context::m_inner_bool_options): New. 2049 * libgccjit++.h 2050 (gccjit::context::set_bool_allow_unreachable_blocks): New. 2051 * libgccjit.c 2052 (gcc_jit_context_set_bool_allow_unreachable_blocks): New. 2053 * libgccjit.h: Add note about options present in the 2054 initial release of libgccjit. 2055 (gcc_jit_context_set_bool_allow_unreachable_blocks): New API 2056 entrypoint. 2057 (LIBGCCJIT_HAVE_gcc_jit_context_set_bool_allow_unreachable_blocks): 2058 New macro. 2059 * libgccjit.map (LIBGCCJIT_ABI_2): New, containing... 2060 (gcc_jit_context_set_bool_allow_unreachable_blocks): ...this new 2061 entrypoint. 2062 20632015-06-30 David Malcolm <dmalcolm@redhat.com> 2064 2065 PR jit/66628 2066 * docs/cp/topics/contexts.rst (Additional command-line options): 2067 New section. 2068 * docs/topics/compatibility.rst: New file. 2069 * docs/topics/contexts.rst (Additional command-line options): New 2070 section. 2071 * docs/topics/index.rst: Add compatibility.rst. 2072 * docs/_build/texinfo/libgccjit.texi: Regenerate. 2073 * jit-playback.c (make_fake_args): Add call to 2074 append_command_line_options. 2075 * jit-recording.c: Within namespace gcc::jit... 2076 (recording::context::~context): Free the optnames within 2077 m_command_line_options. 2078 (recording::context::set_bool_option): Likewise. 2079 (recording::context::add_command_line_option): New method. 2080 (recording::context::append_command_line_options): New method. 2081 (recording::context::dump_reproducer_to_file): Add command-line 2082 options. 2083 * jit-recording.h: Within namespace gcc::jit... 2084 (recording::context::add_command_line_option): New method. 2085 (recording::context::append_command_line_options): New method. 2086 (recording::context::m_command_line_options): New field. 2087 * libgccjit++.h (gccjit::context::add_command_line_option): New 2088 method. 2089 * libgccjit.c (gcc_jit_context_add_command_line_option): New API 2090 entrypoint. 2091 * libgccjit.h (gcc_jit_context_add_command_line_option): New API 2092 entrypoint. 2093 (LIBGCCJIT_HAVE_gcc_jit_context_add_command_line_option): New 2094 macro. 2095 * libgccjit.map: Put existing symbols within LIBGCCJIT_ABI_0; add 2096 LIBGCCJIT_ABI_1 and gcc_jit_context_add_command_line_option. 2097 20982015-06-30 David Malcolm <dmalcolm@redhat.com> 2099 2100 * jit-recording.c 2101 (gcc::jit::recording::context::dump_reproducer_to_file): 2102 Add pragma to generated reproducers to disable -Wunused-variable. 2103 Fix handling of NULL string options. 2104 21052015-06-30 David Malcolm <dmalcolm@redhat.com> 2106 2107 * docs/cp/topics/expressions.rst: Remove stray semicolon. 2108 * docs/cp/topics/functions.rst: Remove stray backslash. 2109 * docs/_build/texinfo/libgccjit.texi: Regenerate. 2110 21112015-06-25 Andrew MacLeod <amacleod@redhat.com> 2112 2113 * dummy-frontend.c: Remove ipa-ref.h and plugin-api.h from include list. 2114 * jit-playback.c: Likewise. 2115 21162015-06-25 Andrew Macleod <amacleod@redhat.com> 2117 2118 * jit-common.h: Don't include alias.h. 2119 21202015-06-17 David Malcolm <dmalcolm@redhat.com> 2121 2122 * libgccjit.c (gcc_jit_lvalue_access_field): Verify that the field 2123 is for the correct struct. 2124 (gcc_jit_rvalue_access_field): Likewise. 2125 21262015-06-17 Andrew MacLeod <amacleod@redhat.com> 2127 2128 * dummy-frontend.c: Do not include input.h, line-map.h or is-a.h. 2129 * jit-common.h: Likewise. 2130 * jit-playback.c: Likewise. 2131 21322015-06-16 David Malcolm <dmalcolm@redhat.com> 2133 2134 PR jit/66539 2135 * jit-recording.c: Within namespace gcc::jit::recording:: 2136 (rvalue::get_debug_string_parens): New function. 2137 (binary_op::make_debug_string): Update to mimic C precedence 2138 rules. 2139 (binary_op_precedence): New array. 2140 (binary_op::get_precedence): New function. 2141 (comparison::make_debug_string): Update to mimic C precedence 2142 rules. 2143 (comparison_precedence): New array. 2144 (comparison::get_precedence): New function. 2145 (cast::make_debug_string): Update to mimic C precedence rules. 2146 (call::make_debug_string): Likewise. 2147 (call_through_ptr::make_debug_string): Likewise. 2148 (array_access::make_debug_string): Likewise. 2149 (access_field_of_lvalue::make_debug_string): Likewise. 2150 (access_field_rvalue::make_debug_string): Likewise. 2151 (dereference_field_rvalue::make_debug_string): Likewise. 2152 (dereference_rvalue::make_debug_string): Likewise. 2153 (get_address_of_lvalue::make_debug_string): Likewise. 2154 * jit-recording.h: Within namespace gcc::jit::recording:: 2155 (precedence): New enum. 2156 (rvalue::rvalue): Initialize field "m_parenthesized_string". 2157 (rvalue::get_debug_string_parens): New method. 2158 (rvalue::get_precedence): New pure virtual function. 2159 (rvalue::m_parenthesized_string): New field. 2160 (param::get_precedence): New function. 2161 (global::get_precedence): New function. 2162 (memento_of_new_rvalue_from_const::get_precedence): New function. 2163 (memento_of_new_string_literal::get_precedence): New function. 2164 (unary_op::get_precedence): New function. 2165 (binary_op::get_precedence): New function. 2166 (comparison::get_precedence): New function. 2167 (cast::get_precedence): New function. 2168 (call::get_precedence): New function. 2169 (call_through_ptr::get_precedence): New function. 2170 (array_access::get_precedence): New function. 2171 (access_field_of_lvalue::get_precedence): New function. 2172 (access_field_rvalue::get_precedence): New function. 2173 (dereference_field_rvalue::get_precedence): New function. 2174 (dereference_rvalue::get_precedence): New function. 2175 (get_address_of_lvalue::get_precedence): New function. 2176 (local::get_precedence): New function. 2177 21782015-06-09 Matthias Klose <doko@ubuntu.com> 2179 2180 * Make-lang.in (jit.install-common): Install headers using INSTALL_DATA. 2181 21822015-06-08 Andrew MacLeod <amacleod@redhat.com> 2183 2184 * dummy-frontend.c : Adjust include files. 2185 * jit-common.h : Likewise. 2186 * jit-playback.c : Likewise. 2187 21882015-06-05 David Malcolm <dmalcolm@redhat.com> 2189 2190 * dummy-frontend.c 2191 (jit_langhook_post_compilation_parsing_cleanups): Remove. 2192 (LANG_HOOKS_POST_COMPILATION_PARSING_CLEANUPS): Remove 2193 * jit-playback.c (gcc::jit::playback::context::new_global): Add 2194 call to varpool_node::finalize_decl. 2195 (gcc::jit::playback::context::finalize_global_decls): Remove. 2196 * jit-playback.h 2197 (gcc::jit::playback::context::finalize_global_decls): Remove. 2198 21992015-06-05 David Malcolm <dmalcolm@redhat.com> 2200 2201 * dummy-frontend.c (jit_langhook_write_globals): Rename to... 2202 (jit_langhook_post_compilation_parsing_cleanups): ...this, and 2203 eliminate calls to finalize_compilation_unit and 2204 write_global_decls_2. 2205 (LANG_HOOKS_WRITE_GLOBALS): Rename to... 2206 (LANG_HOOKS_POST_COMPILATION_PARSING_CLEANUPS): ...this and 2207 redirect from jit_langhook_write_globals to 2208 jit_langhook_post_compilation_parsing_cleanups. 2209 * jit-playback.c 2210 (gcc::jit::playback::context::write_global_decls_1): Rename to... 2211 (gcc::jit::playback::context::finalize_global_decls): ...this. 2212 (gcc::jit::playback::context::write_global_decls_1): Delete. 2213 * jit-playback.h 2214 (gcc::jit::playback::context::write_global_decls_1): Rename to... 2215 (gcc::jit::playback::context::finalize_global_decls): ...this. 2216 (gcc::jit::playback::context::write_global_decls_1): Delete. 2217 22182015-06-04 Andrew MacLeod <amacleod@redhat.com> 2219 2220 * dummy-frontend.c: Adjust includes for restructured coretypes.h. 2221 * jit-common.h: Likewise. 2222 * jit-playback.c: Likewise. 2223 22242015-05-12 David Malcolm <dmalcolm@redhat.com> 2225 2226 * jit-builtins.c: Include vec.h before target.h. 2227 22282015-04-27 Jim Wilson <jim.wilson@linaro.org> 2229 2230 * Make-lang.in (jit.mostlyclean): Remove shared libraries and object 2231 files. 2232 22332015-04-09 David Malcolm <dmalcolm@redhat.com> 2234 2235 PR jit/65691 2236 * docs/cp/topics/expressions.rst (Simple expressions): Fix copy 2237 and paste error in description of gccjit::context::one. 2238 * docs/topics/expressions.rst (Simple expressions): Likewise in 2239 description of gcc_jit_context_one. 2240 * docs/_build/texinfo/libgccjit.texi: Regenerate. 2241 22422015-03-13 Uros Bizjak <ubizjak@gmail.com> 2243 2244 * jit-recording.c (dump::write): Also check vasprintf return value. 2245 (recording::context::add_error_va): Ditto. 2246 (recording::string::from_printf): Ditto. 2247 22482015-03-13 David Malcolm <dmalcolm@redhat.com> 2249 2250 * docs/internals/index.rst (Packaging notes): New section. 2251 * docs/_build/texinfo/libgccjit.texi: Regenerate. 2252 22532015-03-05 David Malcolm <dmalcolm@redhat.com> 2254 2255 * docs/cp/intro/tutorial03.rst: Add missing arguments to 2256 gccjit::block::end_with_conditional call. Add on_true/on_false 2257 comments. Tweak the wording. 2258 * docs/intro/tutorial03.rst: Add missing arguments to 2259 gcc_jit_block_end_with_conditional call. Add some clarifying 2260 comments. 2261 * docs/topics/compilation.rst: Tweak the wording to avoid an 2262 ambiguous use of "this". 2263 * docs/topics/contexts.rst: Fix a typo. 2264 * docs/topics/expressions.rst (GCC_JIT_BINARY_OP_MINUS): Remove 2265 a stray backtick. 2266 * docs/_build/texinfo/libgccjit.texi: Regenerate. 2267 22682015-02-24 Thomas Schwinge <thomas@codesourcery.com> 2269 2270 PR libgomp/64625 2271 * jit-builtins.c (DEF_FUNCTION_TYPE_VAR_8) 2272 (DEF_FUNCTION_TYPE_VAR_12): Remove macros. 2273 (DEF_FUNCTION_TYPE_VAR_7, DEF_FUNCTION_TYPE_VAR_11): New macros. 2274 * jit-builtins.h (DEF_FUNCTION_TYPE_VAR_8) 2275 (DEF_FUNCTION_TYPE_VAR_12): Remove macros. 2276 (DEF_FUNCTION_TYPE_VAR_7, DEF_FUNCTION_TYPE_VAR_11): New macros. 2277 22782015-02-04 David Malcolm <dmalcolm@redhat.com> 2279 2280 PR jit/64257 2281 * docs/conf.py (html_theme): Change from 'pyramid' 2282 to 'sphinxdoc'. 2283 22842015-02-04 David Malcolm <dmalcolm@redhat.com> 2285 2286 * docs/topics/contexts.rst (gcc_jit_context_acquire): Fix 2287 typo. 2288 * docs/_build/texinfo/libgccjit.texi: Regenerate. 2289 22902015-02-03 David Malcolm <dmalcolm@redhat.com> 2291 2292 * jit-logging.h (gcc::jit::log_user::log): Make const. 2293 * jit-recording.c (gcc::jit::recording::context::set_str_option): 2294 Log the new value of the option. 2295 (gcc::jit::recording::context::set_int_option): Likewise. 2296 (gcc::jit::recording::context::set_bool_option): Likewise. 2297 (gcc::jit::recording::context::compile): Log the value of all 2298 options. 2299 (gcc::jit::recording::context::compile_to_file): Likewise. 2300 (gcc::jit::recording::context::log_all_options): New function. 2301 (gcc::jit::recording::context::log_str_option): New function. 2302 (gcc::jit::recording::context::log_int_option): New function. 2303 (gcc::jit::recording::context::log_bool_option): New function. 2304 * jit-recording.h (gcc::jit::recording::context::log_all_options): 2305 New function. 2306 (gcc::jit::recording::context::log_str_option): New function. 2307 (gcc::jit::recording::context::log_int_option): New function. 2308 (gcc::jit::recording::context::log_bool_option): New function. 2309 * docs/internals/test-hello-world.exe.log.txt: Update for above 2310 changes. 2311 * docs/_build/texinfo/libgccjit.texi: Regenerate. 2312 23132015-02-03 David Malcolm <dmalcolm@redhat.com> 2314 2315 PR jit/64810 2316 * Make-lang.in (jit_OBJS): Add jit/jit-spec.o and gcc.o. 2317 (LIBGCCJIT_FILENAME): Add EXTRA_GCC_OBJS. 2318 * jit-playback.c: Include gcc.h. 2319 (gcc::jit::playback::context::compile): Move mutex acquisition 2320 to before the call to make_fake_args. 2321 (append_arg_from_driver): New function. 2322 (gcc::jit::playback::context::make_fake_args): On the first call, 2323 call into driver_get_configure_time_options to get configure-time 2324 default options and cache them. Add them to the args for 2325 toplev::main. 2326 * jit-spec.c: New source file. 2327 * docs/internals/test-hello-world.exe.log.txt: Update to reflect 2328 above changes. 2329 * docs/_build/texinfo/libgccjit.texi: Regenerate. 2330 23312015-02-02 David Malcolm <dmalcolm@redhat.com> 2332 2333 PR jit/64810 2334 * dummy-frontend.c (jit_langhook_type_for_mode): Support 2335 TYPE_MODE (long_long_integer_type_node). 2336 23372015-01-27 David Malcolm <dmalcolm@redhat.com> 2338 2339 * docs/internals/test-hello-world.exe.log.txt: Add example version 2340 lines. 2341 * docs/_build/texinfo/libgccjit.texi: Regenerate. 2342 * jit-common.h (gcc::jit::dump::get_file): New accessor. 2343 * jit-logging.c: Include toplev.h. 2344 (gcc::jit::logger::logger): Log the GCC version. 2345 * jit-recording.c: Include toplev.h. 2346 (gcc:jit::recording::context::dump_reproducer_to_file): Log the 2347 GCC version. 2348 23492015-01-26 David Malcolm <dmalcolm@redhat.com> 2350 2351 * docs/topics/compilation.rst (gcc_jit_result_get_code): Fix typo. 2352 * docs/topics/contexts.rst (gcc_jit_context_get_last_error): The 2353 error buffer is only valid until the next call to the context. 2354 * docs/_build/texinfo/libgccjit.texi: Regenerate. 2355 * libgccjit.h (gcc_jit_context_get_first_error): Reword the 2356 comment to omit mention of compiling. 2357 (gcc_jit_context_get_last_error): The error buffer is only valid 2358 until the next call to the context. 2359 23602015-01-26 David Malcolm <dmalcolm@redhat.com> 2361 2362 PR jit/64708 2363 * config-lang.in (compilers): Drop "libgccjit.so". 2364 23652015-01-23 David Malcolm <dmalcolm@redhat.com> 2366 2367 PR jit/64721 2368 * jit-playback.c (gcc::jit::playback::context::compile): Construct 2369 toplev instances with init_signals=false. 2370 23712015-01-19 David Malcolm <dmalcolm@redhat.com> 2372 2373 * docs/cp/topics/results.rst: Rename to... 2374 * docs/cp/topics/compilation.rst: ...this, and add section on 2375 ahead-of-time compilation. 2376 * docs/cp/topics/index.rst: Update for renaming of results.rst 2377 to compilation.rst. 2378 * docs/examples/emit-alphabet.bf: New file, a sample "brainf" 2379 script. 2380 * docs/examples/tut05-bf.c: New file, implementing a compiler 2381 for "brainf". 2382 * docs/internals/test-hello-world.exe.log.txt: Update to reflect 2383 changes to logger output. 2384 * docs/intro/index.rst: Add tutorial05.rst 2385 * docs/intro/tutorial05.rst: New file. 2386 * docs/topics/results.rst: Rename to... 2387 * docs/topics/compilation.rst: ...this, and add section on 2388 ahead-of-time compilation. 2389 * docs/topics/index.rst: Update for renaming of results.rst to 2390 compilation.rst. 2391 * docs/_build/texinfo/libgccjit.texi: Regenerate. 2392 * jit-playback.c (gcc::jit::playback::context::compile): Convert 2393 return type from result * to void. Move the code to convert to 2394 dso and dlopen the result to a new pure virtual "postprocess" 2395 method. 2396 (gcc::jit::playback::compile_to_memory::compile_to_memory): New 2397 function. 2398 (gcc::jit::playback::compile_to_memory::postprocess): New 2399 function, based on playback::context::compile. 2400 (gcc::jit::playback::compile_to_file::compile_to_file): New 2401 function. 2402 (gcc::jit::playback::compile_to_file::postprocess): New function. 2403 (gcc::jit::playback::compile_to_file::copy_file): New function. 2404 (gcc::jit::playback::context::convert_to_dso): Move internals 2405 to... 2406 (gcc::jit::playback::context::invoke_driver): New method. Add 2407 "-shared" and "-c" options to driver's argv as needed. 2408 * jit-playback.h: Include "timevar.h". 2409 (gcc::jit::playback::context::compile): Convert return type from 2410 result * to void. 2411 (gcc::jit::playback::context::postprocess): New pure virtual 2412 function, making this an abstract base class. 2413 (gcc::jit::playback::context::get_tempdir): New accessor. 2414 (gcc::jit::playback::context::invoke_driver): New function. 2415 (class gcc::jit::playback::compile_to_memory): New subclass of 2416 playback::context. 2417 (class gcc::jit::playback::compile_to_file): Likewise. 2418 * jit-recording.c (gcc::jit::recording::context::compile): Use a 2419 playback::compile_to_memory, and extract its result. 2420 (gcc::jit::recording::context::compile_to_file): New function. 2421 * jit-recording.h (gcc::jit::recording::context::compile_to_file): 2422 New function. 2423 * libgccjit++.h (gccjit::context::compile_to_file): New method. 2424 * libgccjit.c (gcc_jit_context_compile): Update log message to 2425 clarify that this is an in-memory compile. 2426 (gcc_jit_context_compile_to_file): New function. 2427 * libgccjit.h (gcc_jit_context): Clarify that you can compile 2428 a context more than once, and that you can compile to a file 2429 as well as to memory. 2430 (gcc_jit_result): Clarify that this is the result of an 2431 in-memory compilation. 2432 (gcc_jit_context_compile): Clarify that you can compile, and that 2433 this is an in-memory compilation. 2434 (enum gcc_jit_output_kind): New enum. 2435 (gcc_jit_context_compile_to_file): New function. 2436 (gcc_jit_context_enable_dump): Clarify comment to cover both forms 2437 of compilation. 2438 * libgccjit.map (gcc_jit_context_compile_to_file): New API 2439 entrypoint. 2440 * notes.txt: Update to show the playback::context::postprocess 2441 virtual function. 2442 24432015-01-19 David Malcolm <dmalcolm@redhat.com> 2444 2445 * jit-recording.c 2446 (gcc::jit::recording::memento_of_new_string_literal::make_debug_string): 2447 Add missing format string. 2448 24492015-01-16 David Malcolm <dmalcolm@redhat.com> 2450 2451 * Make-lang.in (lang_checks_parallelized): Add "check-jit". 2452 (check_jit_parallelize): Set this to an arbitrary value (10). 2453 24542015-01-16 Jakub Jelinek <jakub@redhat.com> 2455 2456 * jit-builtins.h (DEF_FUNCTION_TYPE_VAR_5): Fix spelling of 2457 last argument. 2458 (DEF_FUNCTION_TYPE_VAR_8, DEF_FUNCTION_TYPE_VAR_12): Define and 2459 undef afterwards. 2460 * jit-builtins.c (DEF_FUNCTION_TYPE_VAR_8, DEF_FUNCTION_TYPE_VAR_12): 2461 Likewise. 2462 24632015-01-15 Richard Sandiford <richard.sandiford@arm.com> 2464 2465 Update copyright years in docs/. 2466 24672015-01-15 David Malcolm <dmalcolm@redhat.com> 2468 2469 * libgccjit.c (gcc_jit_block_add_assignment_op): Check that the 2470 lvalue and the rvalue are of compatible type. 2471 24722015-01-13 David Malcolm <dmalcolm@redhat.com> 2473 2474 * docs/cp/topics/contexts.rst (Debugging): Add 2475 gccjit::context::dump_reproducer_to_file. 2476 * docs/internals/index.rst (Design notes): New section, 2477 discussing input validation and 2478 gcc_jit_context_dump_reproducer_to_file. 2479 * docs/topics/contexts.rst (Debugging): Add 2480 gcc_jit_context_dump_reproducer_to_file. 2481 * docs/_build/texinfo/libgccjit.texi: Regenerate. 2482 * jit-common.h (gcc::jit::dump::get_context): New accessor. 2483 * jit-recording.c: Include "hash-map.h". 2484 Within namespace ::gcc::jit... 2485 (dump::write): Flush each line. 2486 (dump::make_location): Pass false for new param "created_by_user". 2487 (class allocator): New class. 2488 (allocator::~allocator): New function. 2489 (allocator::xstrdup_printf): New function. 2490 (allocator::xstrdup_printf_va): New function. 2491 (class reproducer): New subclass of dump. 2492 (reproducer::reproducer): New function. 2493 (reproducer::write_params): New function. 2494 (reproducer::write_args): New function. 2495 (reproducer::make_identifier): New function. 2496 (reproducer::make_tmp_identifier): New function. 2497 (reproducer::get_identifier): New pair of functions. 2498 (reproducer::get_identifier_as_rvalue): New function. 2499 (reproducer::get_identifier_as_lvalue): New function. 2500 (reproducer::get_identifier_as_type): New function. 2501 (reproducer::xstrdup_printf): New function. 2502 (recording::context::context): Initialize m_toplevel_ctxt. 2503 (recording::context::new_location): Add param created_by_user. 2504 (str_option_reproducer_strings): New table of strings. 2505 (int_option_reproducer_strings): Likewise. 2506 (bool_option_reproducer_strings): Likewise. 2507 (get_type_enum_strings): Likewise. 2508 (names_of_function_kinds): Likewise. 2509 (global_kind_reproducer_strings): Likewise. 2510 (unary_op_reproducer_strings): Likewise. 2511 (binary_op_reproducer_strings): Likewise. 2512 (comparison_reproducer_strings): Likewise. 2513 Within namespace ::gcc::jit::recording::... 2514 (context::dump_reproducer_to_file): New function. 2515 (string::write_reproducer): Likewise. 2516 (location::write_reproducer): Likewise. 2517 (type::access_as_type): Likewise. 2518 (memento_of_get_type::write_reproducer): Likewise. 2519 (memento_of_get_pointer::write_reproducer): Likewise. 2520 (memento_of_get_const::write_reproducer): Likewise. 2521 (memento_of_get_volatile::write_reproducer): Likewise. 2522 (array_type::write_reproducer): Likewise. 2523 (function_type::write_reproducer): Likewise. 2524 (function_type::write_deferred_reproducer): Likewise. 2525 (field::write_reproducer): Likewise. 2526 (struct_::access_as_type): Likewise. 2527 (struct_::write_reproducer): Likewise. 2528 (union_::write_reproducer): Likewise. 2529 (fields::write_reproducer): Likewise. 2530 (rvalue::access_as_rvalue): Likewise. 2531 (lvalue::access_as_rvalue): Likewise. 2532 (lvalue::access_as_lvalue): Likewise. 2533 (param::access_as_rvalue): Likewise. 2534 (param::access_as_lvalue): Likewise. 2535 (param::write_reproducer): Likewise. 2536 (function::write_reproducer): Likewise. 2537 (block::write_reproducer): Likewise. 2538 (global::write_reproducer): Likewise. 2539 (memento_of_new_rvalue_from_const <int>::write_reproducer): 2540 Likewise. 2541 (memento_of_new_rvalue_from_const <long>::write_reproducer): 2542 Likewise. 2543 (memento_of_new_rvalue_from_const <double>::write_reproducer): 2544 Likewise. 2545 (memento_of_new_rvalue_from_const <void *>::write_reproducer): 2546 Likewise. 2547 (memento_of_new_string_literal::write_reproducer): Likewise. 2548 (unary_op::write_reproducer): Likewise. 2549 (binary_op::write_reproducer): Likewise. 2550 (comparison::write_reproducer): Likewise. 2551 (cast::write_reproducer): Likewise. 2552 (call::write_reproducer): Likewise. 2553 (call_through_ptr::write_reproducer): Likewise. 2554 (array_access::write_reproducer): Likewise. 2555 (access_field_of_lvalue::write_reproducer): Likewise. 2556 (access_field_rvalue::write_reproducer): Likewise. 2557 (dereference_field_rvalue::write_reproducer): Likewise. 2558 (dereference_rvalue::write_reproducer): Likewise. 2559 (get_address_of_lvalue::write_reproducer): Likewise. 2560 (local::write_reproducer): Likewise. 2561 (eval::write_reproducer): Likewise. 2562 (assignment::write_reproducer): Likewise. 2563 (assignment_op::write_reproducer): Likewise. 2564 (comment::write_reproducer): Likewise. 2565 (conditional::write_reproducer): Likewise. 2566 (jump::write_reproducer): Likewise. 2567 (return_::write_reproducer): Likewise. 2568 * jit-recording.h (gcc::jit::reproducer): New forward declararion. 2569 Within namespace ::gcc::jit::recording::... 2570 (context::new_location): Add "created_by_user" param. 2571 (context::dump_reproducer_to_file): New method. 2572 (context::m_toplevel_ctxt): New field. 2573 (memento::write_reproducer): New pure virtual function. 2574 (memento::dyn_cast_location): New virtual function. 2575 (string::write_reproducer): 2576 (location::location): Add "created_by_user" param. 2577 (location::dyn_cast_location): New function. 2578 (location::created_by_user): New accessor. 2579 (location::write_reproducer): New function. 2580 (location::m_created_by_user): New field. 2581 (type::access_as_type): New virtual function. 2582 (location::write_reproducer): Likewise. 2583 (type::access_as_type): Likewise. 2584 (memento_of_get_type::write_reproducer): Likewise. 2585 (memento_of_get_pointer::write_reproducer): Likewise. 2586 (memento_of_get_const::write_reproducer): Likewise. 2587 (memento_of_get_volatile::write_reproducer): Likewise. 2588 (array_type::write_reproducer): Likewise. 2589 (function_type::write_reproducer): Likewise. 2590 (function_type::write_deferred_reproducer): Likewise. 2591 (field::write_reproducer): Likewise. 2592 (struct_::access_as_type): Likewise. 2593 (struct_::write_reproducer): Likewise. 2594 (union_::write_reproducer): Likewise. 2595 (union_::m_fields): Remove stray unused field. 2596 (fields::length): New accessor. 2597 (fields::get_field): New accessor. 2598 (fields::write_reproducer): New function. 2599 (rvalue::access_as_rvalue): Likewise. 2600 (lvalue::access_as_rvalue): Likewise. 2601 (lvalue::access_as_lvalue): Likewise. 2602 (param::access_as_rvalue): Likewise. 2603 (param::access_as_lvalue): Likewise. 2604 (param::write_reproducer): Likewise. 2605 (function::write_reproducer): Likewise. 2606 (block::write_reproducer): Likewise. 2607 (global::write_reproducer): Likewise. 2608 (memento_of_new_rvalue_from_const <HOST_TYPE>::write_reproducer): 2609 Likewise. 2610 (memento_of_new_string_literal::write_reproducer): Likewise. 2611 (unary_op::write_reproducer): Likewise. 2612 (binary_op::write_reproducer): Likewise. 2613 (comparison::write_reproducer): Likewise. 2614 (cast::write_reproducer): Likewise. 2615 (call::write_reproducer): Likewise. 2616 (call_through_ptr::write_reproducer): Likewise. 2617 (array_access::write_reproducer): Likewise. 2618 (access_field_of_lvalue::write_reproducer): Likewise. 2619 (access_field_rvalue::write_reproducer): Likewise. 2620 (dereference_field_rvalue::write_reproducer): Likewise. 2621 (dereference_rvalue::write_reproducer): Likewise. 2622 (get_address_of_lvalue::write_reproducer): Likewise. 2623 (local::write_reproducer): Likewise. 2624 (eval::write_reproducer): Likewise. 2625 (assignment::write_reproducer): Likewise. 2626 (assignment_op::write_reproducer): Likewise. 2627 (comment::write_reproducer): Likewise. 2628 (conditional::write_reproducer): Likewise. 2629 (jump::write_reproducer): Likewise. 2630 (return_::write_reproducer): Likewise. 2631 * libgccjit++.h (gccjit::context::dump_reproducer_to_file): New. 2632 * libgccjit.c (gcc_jit_context_new_location): Pass "true" as 2633 param "created_by_user". 2634 (gcc_jit_context_dump_reproducer_to_file): New API entrypoint. 2635 * libgccjit.h (gcc_jit_context_dump_reproducer_to_file): New API 2636 entrypoint. 2637 * libgccjit.map (gcc_jit_context_dump_reproducer_to_file): New API 2638 entrypoint. 2639 26402015-01-12 David Malcolm <dmalcolm@redhat.com> 2641 2642 * jit-recording.c (class gcc::jit::rvalue_usage_validator): New. 2643 (gcc::jit::rvalue_usage_validator::rvalue_usage_validator): New 2644 ctor. 2645 (gcc::jit::rvalue_usage_validator::visit): New function. 2646 (gcc::jit::recording::rvalue::verify_valid_within_stmt): New 2647 function. 2648 (gcc::jit::recording::rvalue::set_scope): New function. 2649 (gcc::jit::recording::function::function): Call set_scope on each 2650 param, issuing errors for any params that already have a function. 2651 (gcc::jit::recording::block::add_eval): Return the new statement; 2652 update the comment given that some error-checking now happens after 2653 this returns. 2654 (gcc::jit::recording::block::add_assignment): Likewise. 2655 (gcc::jit::recording::block::add_assignment_op): Likewise. 2656 (gcc::jit::recording::block::add_comment): Likewise. 2657 (gcc::jit::recording::block::end_with_conditional): Likewise. 2658 (gcc::jit::recording::block::end_with_jump): Likewise. 2659 (gcc::jit::recording::block::end_with_return): Likewise. 2660 (gcc::jit::recording::block::validate): Add a comment. 2661 (gcc::jit::recording::unary_op::visit_children): New function. 2662 (gcc::jit::recording::binary_op::visit_children): New function. 2663 (gcc::jit::recording::comparison::visit_children): New function. 2664 (gcc::jit::recording::cast::visit_children): New function. 2665 (gcc::jit::recording::call::visit_children): New function. 2666 (gcc::jit::recording::call_through_ptr::visit_children): New function. 2667 (gcc::jit::recording::array_access::visit_children): New function. 2668 (gcc::jit::recording::access_field_of_lvalue::visit_children): New 2669 function. 2670 (gcc::jit::recording::access_field_rvalue::visit_children): New 2671 function. 2672 (gcc::jit::recording::dereference_field_rvalue::visit_children): 2673 New function. 2674 (gcc::jit::recording::dereference_rvalue::visit_children): New 2675 function. 2676 (gcc::jit::recording::get_address_of_lvalue::visit_children): New 2677 function. 2678 * jit-recording.h: Within namespace gcc::jit::recording... 2679 (class rvalue_visitor): New. 2680 (rvalue::rvalue): Initialize m_scope. 2681 (rvalue::get_loc): New accessor. 2682 (rvalue::verify_valid_within_stmt): New function. 2683 (rvalue::visit_children): New pure virtual function. 2684 (rvalue::set_scope): New function. 2685 (rvalue::get_scope): New function. 2686 (rvalue::dyn_cast_param): New function. 2687 (rvalue::m_scope): New field. 2688 (param::visit_children): New empty function. 2689 (param::dyn_cast_param): New function. 2690 (function::get_loc): New function. 2691 (block::add_eval): Return the new statement. 2692 (block::add_assignment): Likewise. 2693 (block::add_assignment_op): Likewise. 2694 (block::add_comment): Likewise. 2695 (block::end_with_conditional): Likewise. 2696 (block::end_with_jump): Likewise. 2697 (block::end_with_return): Likewise. 2698 (global::visit_children): New function. 2699 (memento_of_new_rvalue_from_const<HOST_TYPE>::visit_children): 2700 New function. 2701 (memento_of_new_string_literal::visit_children): New function. 2702 (unary_op::visit_children): New function. 2703 (binary_op::visit_children): New function. 2704 (comparison::visit_children): New function. 2705 (cast::visit_children): New function. 2706 (call::visit_children): New function. 2707 (call_through_ptr::visit_children): New function. 2708 (array_access::visit_children): New function. 2709 (access_field_of_lvalue::visit_children): New function. 2710 (access_field_rvalue::visit_children): New function. 2711 (dereference_field_rvalue::visit_children): New function. 2712 (dereference_rvalue::visit_children): New function. 2713 (get_address_of_lvalue::visit_children): New function. 2714 (local::local): Call set_scope. 2715 (local::visit_children): New function. 2716 (statement::get_block): Make public. 2717 * libgccjit.c (RETURN_VAL_IF_FAIL_PRINTF5): New macro. 2718 (RETURN_NULL_IF_FAIL_PRINTF5): New macro. 2719 (gcc_jit_context_new_function): Verify that each param has 2720 not yet been used for creating another function. 2721 (gcc_jit_block_add_eval): After creating the stmt, verify 2722 that the rvalue expression tree is valid to use within it. 2723 (gcc_jit_block_add_assignment): Likewise for the lvalue and 2724 rvalue expression trees. 2725 (gcc_jit_block_add_assignment_op): Likewise. 2726 (gcc_jit_block_end_with_conditional): Likewise for the boolval 2727 expression tree. 2728 (gcc_jit_block_end_with_return): Likewise for the rvalue 2729 expression tree. 2730 (gcc_jit_block_end_with_void_return): Remove return of "void", 2731 now that block::end_with_return is now non-void. 2732 27332015-01-12 David Malcolm <dmalcolm@redhat.com> 2734 2735 * jit-playback.c (gcc::jit::playback::context::read_dump_file): 2736 Add missing fclose on error-handling path. 2737 27382015-01-12 David Malcolm <dmalcolm@redhat.com> 2739 2740 * docs/cp/topics/expressions.rst (Global variables): Add 2741 enum gcc_jit_global_kind param to gccjit::context::new_global. 2742 * docs/topics/expressions.rst (Global variables): Likewise. 2743 Document the new enum. 2744 * docs/topics/results.rst (Compilation results): Document 2745 globals-handling. 2746 * docs/_build/texinfo/libgccjit.texi: Regenerate. 2747 * dummy-frontend.c (jit_langhook_write_globals): Call into the 2748 playback context's write_global_decls_1 and write_global_decls_2 2749 before and after calling symtab->finalize_compilation_unit (). 2750 * jit-playback.c: Include "debug.h". 2751 (gcc::jit::playback::context::new_global): Add "kind" param and 2752 use it to set TREE_PUBLIC, TREE_STATIC and DECL_EXTERNAL on the 2753 underlying VAR_DECL. Call varpool_node::get_create on the 2754 VAR_DECL, and add it to m_globals. 2755 (gcc::jit::playback::context::write_global_decls_1): New function. 2756 (gcc::jit::playback::context::write_global_decls_2): New function. 2757 * jit-playback.h (gcc::jit::playback::context::context): Call 2758 create on m_globals. 2759 (gcc::jit::playback::context::new_global): Add "kind" param. 2760 (gcc::jit::playback::context::write_global_decls_1): New function. 2761 (gcc::jit::playback::context::write_global_decls_2): New function. 2762 (gcc::jit::playback::context::m_globals): New field. 2763 * jit-recording.c (gcc::jit::recording::context::context): 2764 Initialize m_globals. 2765 (gcc::jit::recording::context::new_global): Add param "kind". 2766 Add the new global to m_globals. 2767 (gcc::jit::recording::context::dump_to_file): Dump the globals. 2768 (gcc::jit::recording::global::replay_into): Add field m_kind. 2769 (gcc::jit::recording::global::write_to_dump): New override. 2770 * jit-recording.h (gcc::jit::recording::context::new_global): Add 2771 param "kind". 2772 (gcc::jit::recording::context::m_globals): New field. 2773 (gcc::jit::recording::global::global): Add param kind. 2774 (gcc::jit::recording::global::write_to_dump): New override. 2775 (gcc::jit::recording::global::m_kind): New field. 2776 * jit-result.c (gcc::jit::result::get_global): New function. 2777 * jit-result.h (gcc::jit::result::get_global): New function. 2778 * libgccjit++.h (gccjit::context::new_global): Add "kind" param. 2779 * libgccjit.c (gcc_jit_context_new_global): Likewise. 2780 (gcc_jit_result_get_global): New API entrypoint. 2781 * libgccjit.h (gcc_jit_result_get_global): New API entrypoint. 2782 (enum gcc_jit_global_kind): New enum. 2783 (gcc_jit_context_new_global): API change: add "kind" param. 2784 * libgccjit.map (gcc_jit_result_get_global): New symbol. 2785 27862015-01-09 David Malcolm <dmalcolm@redhat.com> 2787 2788 * dummy-frontend.c: Include "fixed-value.h", "alias.h", "flags.h", 2789 "symtab.h", "inchash.h". Move include of "hash-set.h" much 2790 earlier. 2791 * jit-builtins.c: Remove redundant includes of "opts.h" and 2792 "tree.h". 2793 * jit-common.h: Include "hash-set.h", "input.h", "vec.h", 2794 "double-int.h", "alias.h", "flags.h", "symtab.h", "inchash.h". 2795 * jit-playback.c: Include "hashtab.h", "machmode.h", "input.h", 2796 "statistics.h", "vec.h", "double-int.h", "real.h", 2797 "fixed-value.h", "alias.h", "flags.h", "symtab.h", "tree-core.h", 2798 "inchash.h", "fold-const.h". Move include of "hash-set.h" to 2799 earlier. 2800 * jit-recording.c: Remove redundant includes of "opts.h" and 2801 "tree.h". 2802 28032015-01-09 David Malcolm <dmalcolm@redhat.com> 2804 2805 * docs/cp/topics/expressions.rst (Simple expressions): Use 2806 ":c:type:" for C types. Document new overload of 2807 gcc::jit::context::new_rvalue. 2808 * docs/topics/expressions.rst (Simple expressions): Use 2809 ":c:type:" for C types. Document new entrypoint 2810 gcc_jit_context_new_rvalue_from_long. 2811 * docs/_build/texinfo/libgccjit.texi: Regenerate. 2812 * jit-playback.c: Within namespace gcc::jit::playback... 2813 (context::new_rvalue_from_int): Eliminate in favor of... 2814 (context::new_rvalue_from_const <int>): ...this. 2815 (context::new_rvalue_from_double): Eliminate in favor of... 2816 (context::new_rvalue_from_const <double>): ...this. 2817 (context::new_rvalue_from_const <long>): New. 2818 (context::new_rvalue_from_ptr): Eliminate in favor of... 2819 (context::new_rvalue_from_const <void *>): ...this. 2820 * jit-playback.h: Within namespace gcc::jit::playback... 2821 (context::new_rvalue_from_int): Eliminate in favor of... 2822 (context::new_rvalue_from_const <HOST_TYPE>): ...this. 2823 (context::new_rvalue_from_double): Likewise. 2824 (context::new_rvalue_from_ptr): Likewise. 2825 * jit-recording.c: Within namespace gcc::jit::recording... 2826 (context::new_rvalue_from_int): Eliminate. 2827 (context::new_rvalue_from_double): Likewise. 2828 (context::new_rvalue_from_ptr): Likewise. 2829 (class memento_of_new_rvalue_from_const <int>): 2830 Add explicit specialization. 2831 (class memento_of_new_rvalue_from_const <long>): 2832 Likewise. 2833 (class memento_of_new_rvalue_from_const <double>): 2834 Likewise. 2835 (class memento_of_new_rvalue_from_const <void *>): 2836 Likewise. 2837 (memento_of_new_rvalue_from_int::replay_into): 2838 Generalize into... 2839 (memento_of_new_rvalue_from_const <HOST_TYPE>::replay_into): 2840 ...this... 2841 (memento_of_new_rvalue_from_double::replay_into): 2842 ...allowing this... 2843 (memento_of_new_rvalue_from_ptr::replay_into): 2844 ...and this to be deleted. 2845 (memento_of_new_rvalue_from_int::make_debug_string): 2846 Convert to... 2847 (memento_of_new_rvalue_from_const <int>::make_debug_string): 2848 ...this. 2849 (memento_of_new_rvalue_from_double::make_debug_string): 2850 Convert to... 2851 (memento_of_new_rvalue_from_const <double>::make_debug_string): 2852 ...this. 2853 (memento_of_new_rvalue_from_ptr::make_debug_string) 2854 Convert to... 2855 (memento_of_new_rvalue_from_const <void *>::make_debug_string): 2856 ...this. 2857 (memento_of_new_rvalue_from_const <long>::make_debug_string): 2858 New function. 2859 * jit-recording.h: Within namespace gcc::jit::recording... 2860 (context::new_rvalue_from_int): Eliminate. 2861 (context::new_rvalue_from_double): Likewise. 2862 (context::new_rvalue_from_ptr): Likewise, all in favor of... 2863 (context::new_rvalue_from_const <HOST_TYPE>): New family of 2864 methods. 2865 (class memento_of_new_rvalue_from_int): Eliminate. 2866 (class memento_of_new_rvalue_from_double): Likewise. 2867 (class memento_of_new_rvalue_from_ptr): Likewise. 2868 (class memento_of_new_rvalue_from_const <HOST_TYPE>): New family 2869 of rvalue subclasses. 2870 * libgccjit++.h (gccjit::context::new_rvalue): New overload, for 2871 "long". 2872 * libgccjit.c (gcc_jit_context_new_rvalue_from_int): Update for 2873 rewriting of recording::context::new_rvalue_from_int to 2874 recording::context::new_rvalue_from_const <int>. 2875 (gcc_jit_context_new_rvalue_from_long): New API entrypoint. 2876 (gcc_jit_context_new_rvalue_from_double): Update for 2877 rewriting of recording::context::new_rvalue_from_double to 2878 recording::context::new_rvalue_from_const <double>. 2879 (gcc_jit_context_new_rvalue_from_ptr): Update for 2880 rewriting of recording::context::new_rvalue_from_ptr to 2881 recording::context::new_rvalue_from_const <void *>. 2882 * libgccjit.h (gcc_jit_context_new_rvalue_from_long): New API 2883 entrypoint. 2884 * libgccjit.map (gcc_jit_context_new_rvalue_from_long): Likewise. 2885 28862015-01-09 David Malcolm <dmalcolm@redhat.com> 2887 2888 PR jit/64206 2889 * docs/internals/test-hello-world.exe.log.txt: Update, the log now 2890 shows tempdir creation/cleanup. 2891 * docs/_build/texinfo/libgccjit.texi: Regenerate. 2892 * jit-logging.h (class gcc::jit::log_user): Add gcc::jit::tempdir 2893 to the list of subclasses in the comment. 2894 * jit-playback.c (gcc::jit::playback::context::context): Add a 2895 comment clarifying when the tempdir gets cleaned up. 2896 (gcc::jit::playback::context::compile): Pass the context's logger, 2897 if any, to the tempdir. 2898 (gcc::jit::playback::context::dlopen_built_dso): When creating the 2899 gcc::jit::result, if GCC_JIT_BOOL_OPTION_DEBUGINFO is set, hand 2900 over ownership of the tempdir to it. 2901 * jit-result.c: Include "jit-tempdir.h". 2902 (gcc::jit::result::result): Add tempdir param, saving it as 2903 m_tempdir. 2904 (gcc::jit::result::~result): Delete m_tempdir. 2905 * jit-result.h (gcc::jit::result::result): Add tempdir param. 2906 (gcc::jit::result::m_tempdir): New field. 2907 * jit-tempdir.c (gcc::jit::tempdir::tempdir): Add logger param; 2908 add JIT_LOG_SCOPE. 2909 (gcc::jit::tempdir::create): Add JIT_LOG_SCOPE to log entry/exit, 2910 and log m_path_template and m_path_tempdir. 2911 (gcc::jit::tempdir::~tempdir): Add JIT_LOG_SCOPE to log 2912 entry/exit, and log the unlink and rmdir calls. 2913 * jit-tempdir.h: Include "jit-logging.h". 2914 (class gcc::jit::tempdir): Make this be a subclass of log_user. 2915 (gcc::jit::tempdir::tempdir): Add logger param. 2916 * notes.txt: Update to show the two possible places where the 2917 tempdir can be cleaned up. 2918 29192015-01-08 David Malcolm <dmalcolm@redhat.com> 2920 2921 * libgccjit.h (struct gcc_jit_context): Rewrite the descriptive 2922 comment. 2923 29242015-01-08 David Malcolm <dmalcolm@redhat.com> 2925 2926 * docs/topics/contexts.rst (Error-handling): Document new 2927 entrypoint gcc_jit_context_get_last_error. 2928 * docs/_build/texinfo/libgccjit.texi: Regenerate. 2929 * jit-recording.c (gcc::jit::recording::context::context): 2930 Initialize new fields "m_last_error_str" and 2931 "m_owns_last_error_str". 2932 (gcc::jit::recording::context::~context): Clean up 2933 m_last_error_str, if needed. 2934 (gcc::jit::recording::context::add_error_va): Update 2935 m_last_error_str and m_owns_last_error_str, freeing the old 2936 value if appropriate. 2937 (gcc::jit::recording::context::get_last_error): New function. 2938 * jit-recording.h (gcc::jit::recording::context::get_last_error): 2939 New function. 2940 (gcc::jit::recording::context): New fields m_last_error_str and 2941 m_owns_last_error_str. 2942 * libgccjit.c (gcc_jit_context_get_last_error): New function. 2943 * libgccjit.h (gcc_jit_context_get_last_error): New declaration. 2944 * libgccjit.map (gcc_jit_context_get_last_error): New function. 2945 29462015-01-08 David Malcolm <dmalcolm@redhat.com> 2947 2948 * Make-lang.in (jit_OBJS): Add jit/jit-logging.o. 2949 * docs/internals/index.rst (Overview of code structure): Mention 2950 gcc_jit_context_set_logfile, and embed the example logfile. 2951 * docs/internals/test-hello-world.exe.log.txt: New file: example 2952 of a logfile. 2953 * docs/topics/contexts.rst (Debugging): Add documentation 2954 for gcc_jit_context_set_logfile. 2955 * docs/_build/texinfo/libgccjit.texi: Regenerate. 2956 * dummy-frontend.c: Include "jit-logging.h". 2957 (jit_langhook_init): Assert that there is an active playback 2958 context. If it has a logger, log entry/exit to this function. 2959 (jit_langhook_write_globals): Likewise. 2960 * jit-common.h (gcc::jit::logger): New forward declaration. 2961 * jit-logging.c: New file. 2962 * jit-logging.h: New file. 2963 * jit-playback.c: Include "jit-logging.h". 2964 (gcc::jit::playback::context::context): Initialize the log_user 2965 base class from the recording context's logger (if any). Use 2966 JIT_LOG_SCOPE to log entry/exit from the function body. 2967 (gcc::jit::playback::context::~context): Use JIT_LOG_SCOPE to 2968 log entry/exit from the function body. 2969 (gcc::jit::playback::build_stmt_list): Likewise. 2970 (gcc::jit::playback::function::postprocess): Likewise. 2971 (gcc::jit::playback::context::compile): Likewise. Log the 2972 entry/exit to toplev::main and toplev::finalize. Log the 2973 fake argv passed to toplev::main. 2974 (gcc::jit::playback::context::acquire_mutex): Use JIT_LOG_SCOPE to 2975 log entry/exit from the function body. 2976 (gcc::jit::playback::context::release_mutex): Likewise. 2977 (gcc::jit::playback::context::make_fake_args): Likewise. 2978 (gcc::jit::playback::context::extract_any_requested_dumps): 2979 Likewise. 2980 (gcc::jit::playback::context::convert_to_dso): Likewise. Also, 2981 log the arguments that the driver is invoked with. 2982 (gcc::jit::playback::context::dlopen_built_dso): Likewise. Pass 2983 the logger to the result object. 2984 (gcc::jit::playback::context::replay): Use JIT_LOG_SCOPE to 2985 log entry/exit from the function body. 2986 (gcc::jit::playback::context::dump_generated_code): Likewise. 2987 (gcc::jit::playback::context::handle_locations): Likewise. 2988 * jit-playback.h (gcc::jit::playback::context): Make this be 2989 a subclass of gcc::jit::log_user. 2990 * jit-recording.c: Include "jit-logging.h". 2991 (gcc::jit::recording::context::context: Initialize the logger to 2992 NULL for root contexts, or to the parent's logger for child 2993 contexts. 2994 (gcc::jit::recording::context::~context): Use JIT_LOG_SCOPE to 2995 log entry/exit from the function body. 2996 (gcc::jit::recording::context::replay_into): Likewise. 2997 (gcc::jit::recording::context::disassociate_from_playback): 2998 Likewise. 2999 (gcc::jit::recording::context::compile): Likewise. 3000 (recording::context::add_error_va): Likewise. Also, log the 3001 error. 3002 (gcc::jit::recording::context::validate): Use JIT_LOG_SCOPE to 3003 log entry/exit from the function body. 3004 * jit-recording.h: Include "jit-logging.h". 3005 (gcc::jit::recording::context): Make this be a subclass of 3006 gcc::jit::log_user. 3007 * jit-result.c: Include "jit-common.h" and "jit-logging.h". 3008 (gcc::jit::result::result): Add logger param, recording it. 3009 Use JIT_LOG_SCOPE to log entry/exit from the function body. 3010 (gcc::jit::result::~result(): Use JIT_LOG_SCOPE to 3011 log entry/exit from the function body. 3012 (gcc::jit::result::get_code): Likewise. 3013 * jit-result.h (gcc::jit::result): Make this be a subclass of 3014 gcc::jit::log_user. 3015 (gcc::jit::result::result): Add logger parameter. 3016 * libgccjit++.h (gccjit::context::set_logfile): New function. 3017 * libgccjit.c: Include "jit-logging.h". 3018 (gcc_jit_context_acquire): Log the context. 3019 (gcc_jit_context_release): Use JIT_LOG_FUNC to 3020 log entry/exit from the function body, and log the context. 3021 (gcc_jit_context_new_child_context): Likewise, logging both 3022 contexts. 3023 (gcc_jit_context_new_location): Use JIT_LOG_FUNC to 3024 log entry/exit from the function body. 3025 (gcc_jit_context_get_type): Likewise. 3026 (gcc_jit_context_get_int_type): Likewise. 3027 (gcc_jit_context_new_array_type): Likewise. 3028 (gcc_jit_context_new_field): Likewise. 3029 (gcc_jit_context_new_struct_type): Likewise. 3030 (gcc_jit_context_new_opaque_struct): Likewise. 3031 (gcc_jit_struct_set_fields): Likewise. 3032 (gcc_jit_context_new_union_type): Likewise. 3033 (gcc_jit_context_new_function_ptr_type): Likewise. 3034 (gcc_jit_context_new_param): Likewise. 3035 (gcc_jit_context_new_function): Likewise. 3036 (gcc_jit_context_get_builtin_function): Likewise. 3037 (gcc_jit_function_get_param): Likewise. 3038 (gcc_jit_function_dump_to_dot): Likewise. 3039 (gcc_jit_function_new_block): Likewise. 3040 (gcc_jit_context_new_global): Likewise. 3041 (gcc_jit_context_new_rvalue_from_int): Likewise. 3042 (gcc_jit_context_zero): Likewise. 3043 (gcc_jit_context_one): Likewise. 3044 (gcc_jit_context_new_rvalue_from_double): Likewise. 3045 (gcc_jit_context_new_rvalue_from_ptr): Likewise. 3046 (gcc_jit_context_null): Likewise. 3047 (gcc_jit_context_new_string_literal): Likewise. 3048 (gcc_jit_context_new_unary_op): Likewise. 3049 (gcc_jit_context_new_binary_op): Likewise. 3050 (gcc_jit_context_new_comparison): Likewise. 3051 (gcc_jit_context_new_call): Likewise. 3052 (gcc_jit_context_new_call_through_ptr): Likewise. 3053 (gcc_jit_context_new_cast): Likewise. 3054 (gcc_jit_context_new_array_access): Likewise. 3055 (gcc_jit_lvalue_access_field): Likewise. 3056 (gcc_jit_rvalue_access_field): Likewise. 3057 (gcc_jit_rvalue_dereference_field): Likewise. 3058 (gcc_jit_rvalue_dereference): Likewise. 3059 (gcc_jit_lvalue_get_address): Likewise. 3060 (gcc_jit_function_new_local): Likewise. 3061 (gcc_jit_block_add_eval): Likewise. 3062 (gcc_jit_block_add_assignment): Likewise. 3063 (gcc_jit_block_add_assignment_op): Likewise. 3064 (gcc_jit_block_end_with_conditional): Likewise. 3065 (gcc_jit_block_add_comment): Likewise. 3066 (gcc_jit_block_end_with_jump): Likewise. 3067 (gcc_jit_block_end_with_return): Likewise. 3068 (gcc_jit_block_end_with_void_return): Likewise. 3069 (gcc_jit_context_set_str_option): Likewise. 3070 (gcc_jit_context_set_int_option): Likewise. 3071 (gcc_jit_context_set_bool_option): Likewise. 3072 (gcc_jit_context_enable_dump): Likewise. 3073 (gcc_jit_context_compile): Likewise. Also log the context, 3074 and the result. 3075 (gcc_jit_context_dump_to_file): Likewise. 3076 (gcc_jit_context_set_logfile): New function. 3077 (gcc_jit_context_get_first_error): Use JIT_LOG_FUNC to 3078 log entry/exit from the function body. 3079 (gcc_jit_result_get_code): Likewise. Also log the fnname) 3080 and the ptr to be returned. 3081 (gcc_jit_result_release): Likewise. Also log the result. 3082 * libgccjit.h: Include <stdio.h>, since we need FILE *. 3083 (gcc_jit_context_set_logfile): New declaration. 3084 * libgccjit.map (gcc_jit_context_set_logfile): New. 3085 30862015-01-07 David Malcolm <dmalcolm@redhat.com> 3087 3088 * jit-recording.h (gcc::jit::recording::type::is_void): New 3089 virtual function. 3090 (gcc::jit::recording::memento_of_get_type::is_void): New 3091 function, overriding default implementation. 3092 * libgccjit.c (gcc_jit_rvalue_dereference): Verify that 3093 the underlying type is not "void". 3094 30952015-01-07 David Malcolm <dmalcolm@redhat.com> 3096 3097 * docs/topics/expressions.rst (Unary Operations): Add 3098 GCC_JIT_UNARY_OP_ABS. 3099 * jit-playback.c (gcc::jit::playback::context::new_unary_op): 3100 Likewise. 3101 * jit-recording.c (unary_op_strings): Likewise. 3102 * libgccjit.c (gcc_jit_context_new_unary_op): Update checking 3103 of "op" to reflect addition of GCC_JIT_UNARY_OP_ABS. 3104 * libgccjit.h (enum gcc_jit_unary_op): Add GCC_JIT_UNARY_OP_ABS. 3105 * docs/_build/texinfo/libgccjit.texi: Regenerate. 3106 31072015-01-07 David Malcolm <dmalcolm@redhat.com> 3108 3109 * jit-recording.h (gcc::jit::recording::memento_of_get_type): Fix 3110 typo in comment. 3111 31122015-01-07 David Malcolm <dmalcolm@redhat.com> 3113 3114 * TODO.rst (Test suite): Remove item about running C++ testcases. 3115 * docs/internals/index.rst (Working on the JIT library): Add 3116 "c++" to the enabled languages in the suggested "configure" 3117 invocation, and add a description of why this is necessary. 3118 * docs/_build/texinfo/libgccjit.texi: Regenerate. 3119 31202015-01-07 David Malcolm <dmalcolm@redhat.com> 3121 3122 * docs/internals/index.rst: Update to reflect that built 3123 testcases are now test-foo.c.exe, rather than test-foo.exe. 3124 * docs/_build/texinfo/libgccjit.texi: Regenerate. 3125 31262015-01-05 Jakub Jelinek <jakub@redhat.com> 3127 3128 Update copyright years. 3129 31302014-12-19 David Malcolm <dmalcolm@redhat.com> 3131 3132 * jit-playback.c (gcc::jit::playback::context::build_cast): In 3133 case BOOLEAN_TYPE, don't assume that the source expression is 3134 of type "int". 3135 31362014-12-19 David Malcolm <dmalcolm@redhat.com> 3137 3138 * jit-recording.c (gcc::jit::recording::context::context): When 3139 copying string options from a parent context, take a copy of the 3140 underlying buffers, rather than simply copying the pointer. 3141 31422014-12-19 David Malcolm <dmalcolm@redhat.com> 3143 3144 * jit-recording.c (gcc::jit::recording::context::set_str_option): 3145 Handle NULL. 3146 31472014-12-11 David Malcolm <dmalcolm@redhat.com> 3148 3149 * docs/cp/topics/contexts.rst (gccjit::context::set_str_option): 3150 Document new function. 3151 * docs/_build/texinfo/libgccjit.texi: Regenerate. 3152 31532014-12-10 Ulrich Drepper <drepper@gmail.com> 3154 3155 Minor interface cleanups of libgccjit 3156 * jit-playback.c (convert_to_dso): Use auto_vec instead 3157 of automatic array to build up command line. 3158 * jit-recording.c (recording::context::set_str_option): 3159 Make copy of the string. 3160 (recording::context::~context): Free string options. 3161 * jit-recording.h (recording::context): Adjust type 3162 of m_str_options member. 3163 * libgccjit.h: Adjust comment about 3164 gcc_jit_context_set_str_option parameter being used after 3165 the call. 3166 Update comment now that all interfaces are copy strings 3167 if necessary. 3168 * libgccjit++.h (gccjit::context): Add set_str_option 3169 member function. 3170 31712014-12-10 David Malcolm <dmalcolm@redhat.com> 3172 3173 * docs/cp/index.rst: New file. 3174 * docs/cp/intro/index.rst: New file. 3175 * docs/cp/intro/tutorial01.rst: New file. 3176 * docs/cp/intro/tutorial02.rst: New file. 3177 * docs/cp/intro/tutorial03.rst: New file. 3178 * docs/cp/intro/tutorial04.rst: New file. 3179 * docs/cp/topics/contexts.rst: New file. 3180 * docs/cp/topics/expressions.rst: New file. 3181 * docs/cp/topics/functions.rst: New file. 3182 * docs/cp/topics/index.rst: New file. 3183 * docs/cp/topics/locations.rst: New file. 3184 * docs/cp/topics/objects.rst: New file. 3185 * docs/cp/topics/results.rst: New file. 3186 * docs/cp/topics/types.rst: New file. 3187 * docs/examples/tut01-hello-world.cc: New file. 3188 * docs/examples/tut02-square.c: Fix missing newline in output. 3189 * docs/examples/tut02-square.cc: New file. 3190 * docs/examples/tut03-sum-of-squares.cc: New file. 3191 * docs/examples/tut04-toyvm/toyvm.cc: New file. 3192 * docs/index.rst: Move summary to above the table of contents. 3193 Add text about the C vs C++ APIs. 3194 * docs/topics/contexts.rst: Fix a typo. 3195 3196 * docs/_build/texinfo/libgccjit.texi: Regenerate. 3197 * docs/_build/texinfo/factorial1.png: New file. 3198 * docs/_build/texinfo/sum-of-squares1.png: New file. 3199 32002014-12-09 David Malcolm <dmalcolm@redhat.com> 3201 3202 * docs/examples/tut04-toyvm/toyvm.c (toyvm_function_compile): Move 3203 logic for determine "funcname" to new function... 3204 (get_function_name): ...here, adding logic to skip any leading 3205 path from the filename. 3206 (toyvm_function_parse): Use the filename for fn_filename, rather 3207 than "name", so that the debugger can locate the source .toy 3208 file. 3209 (toyvm_function_parse): Don't fclose a NULL FILE *. 3210 32112014-12-09 David Malcolm <dmalcolm@redhat.com> 3212 3213 PR jit/63854 3214 * docs/internals/index.rst (Running under valgrind): New 3215 subsection. 3216 (docs/_build/texinfo/libgccjit.texi): Regenerate. 3217 32182014-12-09 David Malcolm <dmalcolm@redhat.com> 3219 3220 PR jit/64206 3221 * Make-lang.in (jit_OBJS): Add jit/jit-tempdir.o. 3222 * jit-common.h (gcc::jit::tempdir): New forward decl. 3223 * jit-playback.c: Include jit-tempdir.h. 3224 (gcc::jit::playback::context::context): Initialize m_tempdir. 3225 (gcc::jit::playback::context::~context): Move tempdir 3226 cleanup to new file jit-tempdir.c 3227 (make_tempdir_path_template): Move to new file jit-tempdir.c. 3228 (gcc::jit::playback::context::compile): Move tempdir creation 3229 to new tempdir object in new file jit-tempdir.c. 3230 (gcc::jit::playback::context::make_fake_args): Get path from 3231 tempdir object rather than from member data. 3232 (gcc::jit::playback::context::convert_to_dso): Likewise. 3233 (gcc::jit::playback::context::dlopen_built_dso): Likewise. 3234 (gcc::jit::playback::context::dump_generated_code): Likewise. 3235 (gcc::jit::playback::context::get_path_c_file): New function. 3236 (gcc::jit::playback::context::get_path_s_file): New function. 3237 (gcc::jit::playback::context::get_path_so_file): New function. 3238 * jit-playback.h (gcc::jit::playback::context::get_path_c_file): 3239 New function. 3240 (gcc::jit::playback::context::get_path_s_file): New function. 3241 (gcc::jit::playback::context::get_path_so_file): New function. 3242 (gcc::jit::playback::context): Move fields "m_path_template", 3243 "m_path_tempdir", "m_path_c_file", "m_path_s_file", 3244 "m_path_so_file" to new jit::tempdir class; add field "m_tempdir". 3245 * jit-tempdir.c: New file. 3246 * jit-tempdir.h: New file. 3247 32482014-12-09 David Malcolm <dmalcolm@redhat.com> 3249 3250 * jit-playback.c (gcc::jit::playback::context::compile): Acquire the 3251 mutex here, immediately before using toplev, and release it here, on 3252 each exit path after acquisition. 3253 (jit_mutex): Move this variable here, from jit-recording.c. 3254 (gcc::jit::playback::context::acquire_mutex): New function, based on 3255 code in jit-recording.c. 3256 (gcc::jit::playback::context::release_mutex): Likewise. 3257 * jit-playback.h (gcc::jit::playback::context::acquire_mutex): New 3258 function. 3259 (gcc::jit::playback::context::release_mutex): New function. 3260 * jit-recording.c (jit_mutex): Move this variable to jit-playback.c. 3261 (gcc::jit::recording::context::compile): Move mutex-handling from 3262 here into jit-playback.c's gcc::jit::playback::context::compile. 3263 * notes.txt: Update to show the new locations of ACQUIRE_MUTEX 3264 and RELEASE_MUTEX. 3265 32662014-12-09 David Malcolm <dmalcolm@redhat.com> 3267 3268 * jit-playback.c (gcc::jit::playback::context::compile): Move the 3269 dlopen code into... 3270 (gcc::jit::playback::context::dlopen_built_dso): ...this new 3271 function. 3272 * jit-playback.h (gcc::jit::playback::context::dlopen_built_dso): 3273 New function. 3274 32752014-12-09 David Malcolm <dmalcolm@redhat.com> 3276 3277 PR jit/64166 3278 * docs/topics/contexts.rst (Debugging): Add description of 3279 gcc_jit_context_enable_dump. 3280 * docs/_build/texinfo/libgccjit.texi: Regenerate. 3281 * jit-playback.c: Include context.h. 3282 (class auto_argvec): New class. 3283 (auto_argvec::~auto_argvec): New function. 3284 (gcc::jit::playback::context::compile): Convert fake_args to be 3285 an auto_argvec, so that it can contain dynamically-allocated 3286 strings. Construct a vec of all requested dumps, and pass it to 3287 make_fake_args. Extract requested dumps between the calls to 3288 toplev::main and toplev::finalize. 3289 (gcc::jit::playback::context::make_fake_args): Convert param 3290 "argvec" to be a vec <char *>, and gain a "requested_dumps" 3291 param. Convert to dynamically-allocated arg strings by converting 3292 ADD_ARG to take a copy of the arg, and add ADD_ARG_TAKE_OWNERSHIP 3293 for args that are already a copy. Add args for all requested dumps. 3294 (gcc::jit::playback::context::extract_any_requested_dumps): New 3295 function. 3296 (gcc::jit::playback::context::read_dump_file): New function. 3297 * jit-playback.h (gcc::jit::playback::context::make_fake_args): 3298 Convert param "argvec" to be a vec <char *>, and gain a 3299 "requested_dumps" param. 3300 (gcc::jit::playback::context::extract_any_requested_dumps): New 3301 function. 3302 (gcc::jit::playback::context::read_dump_file): New function. 3303 * jit-recording.c (gcc::jit::recording::context::enable_dump): New 3304 function. 3305 (gcc::jit::recording::context::get_all_requested_dumps): New 3306 function. 3307 * jit-recording.h (gcc::jit::recording::requested_dump): New 3308 struct. 3309 (gcc::jit::recording::context::enable_dump): New function. 3310 (gcc::jit::recording::context::get_all_requested_dumps): New 3311 function. 3312 (gcc::jit::recording::context::m_requested_dumps): New field. 3313 * libgccjit.c (gcc_jit_context_enable_dump): New API entrypoint. 3314 * libgccjit.h (gcc_jit_context_enable_dump): New API entrypoint. 3315 * libgccjit.map (gcc_jit_context_enable_dump): New API entrypoint. 3316 33172014-12-08 David Malcolm <dmalcolm@redhat.com> 3318 3319 * libgccjit++.h: Indent the forward declarations of the classes to 3320 show the inheritance hierarchy. 3321 33222014-12-08 David Malcolm <dmalcolm@redhat.com> 3323 3324 * notes.txt: Show the beginning and ending of 3325 recording::context::compile vs playback::context::compile. Show 3326 the creation and unlinking of the tempdir. Show toplev::finalize. 3327 Move "RELEASE MUTEX" to the correct location. Show 3328 gcc_jit_result_release, and indicate where the 3329 dlopen/dlsym/dlclose occur. 3330 33312014-12-01 David Malcolm <dmalcolm@redhat.com> 3332 3333 * docs/examples/tut02-square.c (main): Release the context 3334 earlier, to show that this is possible. Update error-handling 3335 to avoid a double-release of the context, and to avoid 3336 releasing a NULL result. 3337 * docs/intro/tutorial02.rst: Discuss gcc_jit_context_release. 3338 * docs/topics/functions.rst (GCC_JIT_FUNCTION_EXPORTED): Emphasize 3339 * docs/topics/results.rst (gcc_jit_result): Mention that this 3340 controls the lifetimes of machine code functions. 3341 (gcc_jit_result_get_code): Spell out the requirements for this 3342 to succeed, and the lifetime of the result. 3343 (gcc_jit_result_release): Mention that this invalidates any code 3344 that was obtained from the result. 3345 * docs/_build/texinfo/libgccjit.texi: Regenerate. 3346 33472014-12-01 David Malcolm <dmalcolm@redhat.com> 3348 3349 PR jit/64018 3350 * docs/intro/tutorial02.rst: Spell out lifetime of generated code. 3351 Add description of error-handling, taken in part from... 3352 * docs/topics/contexts.rst (Error-handling): Expand, and move some 3353 content to tutorial02.rst. 3354 * docs/_build/texinfo/libgccjit.texi: Regenerate. 3355 33562014-12-01 David Malcolm <dmalcolm@redhat.com> 3357 3358 PR jit/64020 3359 * docs/topics/types.rst (Standard types) Add new enum values to 3360 the table of enum gcc_jit_types: GCC_JIT_TYPE_COMPLEX_FLOAT, 3361 GCC_JIT_TYPE_COMPLEX_DOUBLE, GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE. 3362 Widen the left-hand column so that 3363 GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE will fit. 3364 * docs/_build/texinfo/libgccjit.texi: Regenerate. 3365 3366 * jit-builtins.c: Include stringpool.h and jit-playback.h. 3367 Move everything out of the gcc::jit::recording namespace into 3368 just gcc::jit. 3369 (struct builtin_data): Add fields "fnclass", "attr", and 3370 "implicit_p". 3371 (DEF_BUILTIN): Update macro so populate the new fields. 3372 (builtins_manager::builtins_manager): Update for move out of 3373 recording namespace. Initialize the m_attributes array. 3374 (builtins_manager::get_builtin_function): Likewise. 3375 (builtins_manager::get_builtin_function_by_id): New function. 3376 (builtins_manager::make_builtin_function): Update for move out of 3377 recording namespace. Add fix for PR jit/64020 by detecting 3378 specific builtin ids and having them ensure that builtins for 3379 other ids are created as necessary. 3380 (builtins_manager::get_type): Update for move out of recording 3381 namespace. 3382 (builtins_manager::make_type): Likewise. Add some missing 3383 #undefs. 3384 (builtins_manager::make_primitive_type): Update for move out of 3385 recording namespace. Implement the three BT_COMPLEX_ cases and 3386 BT_DOUBLE_PTR. 3387 (builtins_manager::make_fn_type): Update for move out of recording 3388 namespace. 3389 (builtins_manager::make_ptr_type): Likewise. 3390 (builtins_manager::finish_playback): New function. 3391 (builtins_manager::get_class): New function. 3392 (builtins_manager::implicit_p): New function. 3393 (builtins_manager::get_attrs_tree): Two new functions. 3394 (builtins_manager::make_attrs_tree): New function. 3395 3396 * jit-builtins.h: Move everything out of the gcc::jit::recording 3397 namespace into just gcc::jit. 3398 (enum built_in_attribute): New. 3399 (builtins_manager::builtins_manager): Update decl for namespace 3400 change. 3401 (builtins_manager::get_builtin_function): Likewise. 3402 (builtins_manager::get_class): New. 3403 (builtins_manager::implicit_p): New. 3404 (builtins_manager::get_attrs_tree): Two new functions. 3405 (builtins_manager::make_attrs_tree): New function. 3406 (builtins_manager::finish_playback): New. 3407 (builtins_manager::get_builtin_function_by_id): New. 3408 (builtins_manager::make_builtin_function): Update decl for 3409 namespace change. 3410 (builtins_manager::get_type): Likewise. 3411 (builtins_manager::make_type): Likewise. 3412 (builtins_manager::make_primitive_type): Likewise. 3413 (builtins_manager::make_fn_type): Likewise. 3414 (builtins_manager::make_ptr_type): Likewise. 3415 (builtins_manager): Likewise for fields. Add new field 3416 "m_attributes". 3417 3418 * jit-common.h (NUM_GCC_JIT_TYPES): Update. 3419 (builtins_manager): Update forward decl to reflect namespace 3420 change. 3421 3422 * jit-playback.c: Include attribs.h and jit-builtins.h. 3423 (gcc::jit::playback::context::get_tree_node_for_type): Add cases 3424 for the new COMPLEX_ types. 3425 (gcc::jit::playback::context::new_function): If creating a 3426 builtin, set the DECL_BUILT_IN_CLASS and attributes on the fndecl, 3427 and call set_builtin_decl. 3428 (gcc::jit::playback::context::replay): If we have a 3429 builtins_manager, call its finish_playback method when we're done. 3430 3431 * jit-playback.h: 3432 (gcc::jit::playback::context::get_builtins_manager): New function. 3433 3434 * jit-recording.c 3435 (gcc::jit::recording::context::get_builtins_manager): New function. 3436 (gcc::jit::recording::get_builtin_function): Use 3437 get_builtins_manager, in case we're a child context. 3438 (gcc::jit::recording::memento_of_get_type::dereference): Add the 3439 COMPLEX_ types. 3440 (gcc::jit::recording::memento_of_get_type::is_int): Likewise. 3441 (gcc::jit::recording::memento_of_get_type::is_float): Likewise. 3442 (gcc::jit::recording::memento_of_get_type::is_bool): Likewise. 3443 (get_type_strings): Likewise. 3444 3445 * jit-recording.h 3446 (gcc::jit::recording::context::get_builtins_manager): New. 3447 3448 * libgccjit.h (enum gcc_jit_types): Add 3449 GCC_JIT_TYPE_COMPLEX_FLOAT, GCC_JIT_TYPE_COMPLEX_DOUBLE, 3450 GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE. 3451 34522014-12-01 David Malcolm <dmalcolm@redhat.com> 3453 3454 * jit-builtins.c 3455 (gcc::jit::recording::builtins_manager::get_builtin_function): 3456 Check for NULL return from make_builtin_function. 3457 (gcc::jit::recording::builtins_manager::make_builtin_function): 3458 Check for NULL return from get_type. 3459 34602014-12-01 David Malcolm <dmalcolm@redhat.com> 3461 3462 * jit-playback.c (gcc::jit::playback::context::compile): Move DSO 3463 creation code into... 3464 (gcc::jit::playback::context::convert_to_dso): New function. 3465 * jit-playback.h (gcc::jit::playback::context::convert_to_dso): 3466 New function. 3467 34682014-12-01 David Malcolm <dmalcolm@redhat.com> 3469 3470 * jit-playback.c (gcc::jit::playback::context::compile): Use an 3471 auto_vec<const char *> rather than a const char *[20] for the 3472 top-level argv, and move the logic to build it to... 3473 (gcc::jit::playback::context::make_fake_args): New function. 3474 * jit-playback.h (gcc::jit::playback::context::make_fake_args): 3475 New function. 3476 34772014-12-01 David Malcolm <dmalcolm@redhat.com> 3478 3479 * Make-lang.in (jit_OBJS): Add jit/jit-result.o. 3480 * jit-playback.c: Include new header jit-result.h. 3481 (gcc::jit::result::result): Move to new file jit-result.c. 3482 (gcc::jit::result::~result): Likewise. 3483 (gcc::jit::playback::result): Likewise. 3484 * jit-recording.h (class gcc::jit::result): Move to new 3485 header jit-result.h. 3486 * jit-result.c: New file, to contain... 3487 (gcc::jit::result::result): Move here from jit-playback.c, 3488 removing erroneous "playback" namespace from comment. 3489 (gcc::jit::result::~result): Likewise. 3490 (gcc::jit::playback::result): Likewise. 3491 * jit-result.h: New file, to contain... 3492 (class gcc::jit::result): Move from jit-recording.h. 3493 * libgccjit.c: Include jit-result.h. 3494 (gcc_jit_result_get_code): Update comment to reflect move 3495 of implementation. 3496 (gcc_jit_result_release): Likewise. 3497 34982014-12-01 David Malcolm <dmalcolm@redhat.com> 3499 3500 PR jit/63854 3501 * docs/examples/tut04-toyvm/toyvm.c 3502 (toyvm_compiled_function): New typedef. 3503 (toyvm_compiled_func) Rename to... 3504 (toyvm_compiled_code) ...this. 3505 (struct toyvm_compiled_function): New struct. 3506 (toyvm_function_compile): Return a toyvm_compiled_function * 3507 rather than a toyvm_compiled_func, so that the caller can fully 3508 clean things up. Free "funcname". 3509 (test_script): Update for change to toyvm_function_compile. 3510 Clean up the toyvm_compiled_function. 3511 (main): Likewise. 3512 (docs/intro/tutorial04.rst): Update to reflect the above changes, 3513 and to better spell out the lifetime of the compiled code. 3514 35152014-12-01 David Malcolm <dmalcolm@redhat.com> 3516 3517 PR jit/63854 3518 * jit-builtins.c 3519 (gcc::jit::recording::builtins_manager::make_fn_type): Call the 3520 context's new_function_type method, rather than directly creating 3521 a function_type instance. 3522 * jit-recording.c 3523 (gcc::jit::recording::context::new_function_type): New method, 3524 adapted from part of... 3525 (gcc::jit::recording::context::new_function_ptr_type): ...this. 3526 Update to call new_function_type. 3527 * jit-recording.h 3528 (gcc::jit::recording::context::new_function_type): New method. 3529 35302014-12-01 David Malcolm <dmalcolm@redhat.com> 3531 3532 PR jit/63969 3533 * jit-playback.c: Ensure that ctxt_progname is non-NULL. 3534 35352014-11-19 David Malcolm <dmalcolm@redhat.com> 3536 3537 PR jit/63854 3538 * jit-playback.c (gcc::jit::playback::compound_type::set_fields): 3539 Convert param from const vec<playback::field *> & to 3540 const auto_vec<playback::field *> *. 3541 (gcc::jit::playback::context::new_function_type): Convert param 3542 "param_types" from vec<type *> * to const auto_vec<type *> *. 3543 (gcc::jit::playback::context::new_function): Convert param 3544 "params" from vec<param *> * to const auto_vec<param *> *. 3545 (gcc::jit::playback::context::build_call): Convert param "args" 3546 from vec<rvalue *> to const auto_vec<rvalue *> *. 3547 (gcc::jit::playback::context::new_call): Likewise. 3548 (gcc::jit::playback::context::new_call_through_ptr): Likewise. 3549 (wrapper_finalizer): New function. 3550 (gcc::jit::playback::wrapper::operator new): Call the finalizer 3551 variant of ggc_internal_cleared_alloc, supplying 3552 wrapper_finalizer. 3553 (gcc::jit::playback::function::finalizer): New. 3554 (gcc::jit::playback::block::finalizer): New. 3555 (gcc::jit::playback::source_file::finalizer): New. 3556 (gcc::jit::playback::source_line::finalizer): New. 3557 3558 * jit-playback.h 3559 (gcc::jit::playback::context::new_function_type): Convert param 3560 "param_types" from vec<type *> * to const auto_vec<type *> *. 3561 (gcc::jit::playback::context::new_function): Convert param 3562 "params" from vec<param *> * to const auto_vec<param *> *. 3563 (gcc::jit::playback::context::new_call): Convert param 3564 "args" from vec<rvalue *> to const auto_vec<rvalue *> *. 3565 (gcc::jit::playback::context::new_call_through_ptr): Likewise. 3566 (gcc::jit::playback::context::build_call): Likewise. 3567 (gcc::jit::playback::context): Convert fields "m_functions", 3568 "m_source_files", "m_cached_locations" from vec to auto_vec. 3569 (gcc::jit::playback::wrapper::finalizer): New virtual function. 3570 (gcc::jit::playback::compound_type::set_fields): Convert param fro 3571 const vec<playback::field *> & to 3572 const auto_vec<playback::field *> *. 3573 (gcc::jit::playback::function::finalizer): New. 3574 (gcc::jit::playback::block::finalizer): New. 3575 (gcc::jit::playback::source_file::finalizer): New. 3576 (gcc::jit::playback::source_line::finalizer): New. 3577 3578 * jit-recording.c 3579 (gcc::jit::recording::function_type::replay_into): Convert local 3580 from a vec into an auto_vec. 3581 (gcc::jit::recording::fields::replay_into): Likewise. 3582 (gcc::jit::recording::function::replay_into): Likewise. 3583 (gcc::jit::recording::call::replay_into): Likewise. 3584 (gcc::jit::recording::call_through_ptr::replay_into): Likewise. 3585 3586 * jit-recording.h (gcc::jit::recording::context): Convert fields 3587 "m_mementos", "m_compound_types", "m_functions" from vec<> to 3588 auto_vec <>. 3589 (gcc::jit::recording::function_type::get_param_types): Convert 3590 return type from vec<type *> to const vec<type *> &. 3591 (gcc::jit::recording::function_type): Convert field 3592 "m_param_types" from a vec<> to an auto_vec<>. 3593 (gcc::jit::recording::fields): Likewise for field "m_fields". 3594 (gcc::jit::recording::function::get_params): Convert return type 3595 from vec <param *> to const vec<param *> &. 3596 (gcc::jit::recording::function): Convert fields "m_params", 3597 "m_locals", "m_blocks" from vec<> to auto_vec<>. 3598 (gcc::jit::recording::block): Likewise for field "m_statements". 3599 vec<> to auto_vec<>. 3600 (gcc::jit::recording::call): Likewise for field "m_args". 3601 (gcc::jit::recording::call_through_ptr): Likewise. 3602 36032014-11-19 David Malcolm <dmalcolm@redhat.com> 3604 3605 PR jit/63854 3606 * jit-recording.c (recording::function::validate): Convert 3607 "worklist" from vec<> to autovec<> to fix a leak. 3608 36092014-11-11 David Malcolm <dmalcolm@redhat.com> 3610 3611 * ChangeLog.jit: New. 3612 * ChangeLog: New. 3613 * Make-lang.in: New. 3614 * TODO.rst: New. 3615 * config-lang.in: New. 3616 * docs/Makefile: New. 3617 * docs/_build/texinfo/Makefile: New. 3618 * docs/_build/texinfo/factorial.png: New. 3619 * docs/_build/texinfo/libgccjit.texi: New. 3620 * docs/_build/texinfo/sum-of-squares.png: New. 3621 * docs/conf.py: New. 3622 * docs/examples/tut01-hello-world.c: New. 3623 * docs/examples/tut02-square.c: New. 3624 * docs/examples/tut03-sum-of-squares.c: New. 3625 * docs/examples/tut04-toyvm/Makefile: New. 3626 * docs/examples/tut04-toyvm/factorial.toy: New. 3627 * docs/examples/tut04-toyvm/fibonacci.toy: New. 3628 * docs/examples/tut04-toyvm/toyvm.c: New. 3629 * docs/index.rst: New. 3630 * docs/internals/index.rst: New. 3631 * docs/intro/factorial.png: New. 3632 * docs/intro/index.rst: New. 3633 * docs/intro/sum-of-squares.png: New. 3634 * docs/intro/tutorial01.rst: New. 3635 * docs/intro/tutorial02.rst: New. 3636 * docs/intro/tutorial03.rst: New. 3637 * docs/intro/tutorial04.rst: New. 3638 * docs/topics/contexts.rst: New. 3639 * docs/topics/expressions.rst: New. 3640 * docs/topics/functions.rst: New. 3641 * docs/topics/index.rst: New. 3642 * docs/topics/locations.rst: New. 3643 * docs/topics/objects.rst: New. 3644 * docs/topics/results.rst: New. 3645 * docs/topics/types.rst: New. 3646 * dummy-frontend.c: New. 3647 * jit-builtins.c: New. 3648 * jit-builtins.h: New. 3649 * jit-common.h: New. 3650 * jit-playback.c: New. 3651 * jit-playback.h: New. 3652 * jit-recording.c: New. 3653 * jit-recording.h: New. 3654 * libgccjit++.h: New. 3655 * libgccjit.c: New. 3656 * libgccjit.h: New. 3657 * libgccjit.map: New. 3658 * notes.txt: New. 3659 36602013-07-26 David Malcolm <dmalcolm@redhat.com> 3661 3662 * Initial creation 3663 3664Copyright (C) 2013-2022 Free Software Foundation, Inc. 3665 3666Copying and distribution of this file, with or without modification, 3667are permitted in any medium without royalty provided the copyright 3668notice and this notice are preserved. 3669