12021-04-08 Release Manager 2 3 * GCC 10.3.0 released. 4 52021-02-03 Nathan Sidwell <nathan@acm.org> 6 7 PR preprocessor/95253 8 * mkdeps.c (munge): Do not escape ':'. 9 102020-10-05 Jakub Jelinek <jakub@redhat.com> 11 12 Backported from master: 13 2020-09-26 Jakub Jelinek <jakub@redhat.com> 14 15 PR bootstrap/97163 16 * lex.c (search_line_fast): Only use _ARCH_PWR8 Altivec version 17 for GCC >= 4.5. 18 192020-07-29 Tiziano Müller <tiziano.mueller@chem.uzh.ch> 20 21 * init.c (builtin_array): Add xref comment. 22 * traditional.c (fun_like_macro): Add HAS_INCLUDE codes. 23 242020-07-23 Release Manager 25 26 * GCC 10.2.0 released. 27 282020-05-07 Release Manager 29 30 * GCC 10.1.0 released. 31 322020-02-14 Jakub Jelinek <jakub@redhat.com> 33 34 Partially implement P1042R1: __VA_OPT__ wording clarifications 35 PR preprocessor/92319 36 * macro.c (expand_arg): Move declarations before vaopt_state 37 definition. 38 (class vaopt_state): Move enum update_type definition earlier. Remove 39 m_allowed member, add m_arg and m_update members. 40 (vaopt_state::vaopt_state): Change last argument from bool any_args 41 to macro_arg *arg, initialize m_arg and m_update instead of m_allowed. 42 (vaopt_state::update): When bumping m_state from 1 to 2 and m_update 43 is ERROR, determine if __VA_ARGS__ expansion has any non-CPP_PADDING 44 tokens and set m_update to INCLUDE if it has any, DROP otherwise. 45 Return m_update instead of m_allowed ? INCLUDE : DROP in m_state >= 2. 46 (replace_args, create_iso_definition): Adjust last argument to 47 vaopt_state ctor. 48 492020-02-05 Martin Sebor <msebor@redhat.com> 50 51 * include/cpplib.h (cpp_builtin_type): Remove trailing comma to 52 avoid pedantic warnings in C++ 98 mode. 53 542020-02-04 Jakub Jelinek <jakub@redhat.com> 55 56 * macro.c (builtin_has_include): Diagnose __has_include* use outside 57 of preprocessing directives. 58 59 PR preprocessor/93545 60 * macro.c (cpp_get_token_no_padding): New function. 61 (builtin_has_include): Use it instead of cpp_get_token. Don't check 62 SEEN_EOL. 63 642020-02-01 Andrew Burgess <andrew.burgess@embecosm.com> 65 66 * configure: Regenerate. 67 682020-01-28 Nathan Sidwell <nathan@acm.org> 69 70 PR preprocessor/93452 71 * internal.h (struct spec_nodes): Drop n__has_include{,_next}. 72 * directives.c (lex_macro_node): Don't check __has_include redef. 73 * expr.c (eval_token): Drop __has_include eval. 74 (parse_has_include): Move to ... 75 * macro.c (builtin_has_include): ... here. 76 (_cpp_builtin_macro_text): Eval __has_include{,_next}. 77 * include/cpplib.h (enum cpp_builtin_type): Add BT_HAS_INCLUDE{,_NEXT}. 78 * init.c (builtin_array): Add them. 79 (cpp_init_builtins): Drop __has_include{,_next} init here ... 80 * pch.c (cpp_read_state): ... and here. 81 * traditional.c (enum ls): Drop has_include states ... 82 (_cpp_scan_out_logical_line): ... and here. 83 842020-01-27 Andrew Burgess <andrew.burgess@embecosm.com> 85 86 * configure: Regenerate. 87 882020-01-24 Nathan Sidwell <nathan@acm.org> 89 90 * expr.c (parse_has_include): Remove bogus controlling macro code. 91 922020-01-20 Nathan Sidwell <nathan@acm.org> 93 94 PR preprocessor/80005 95 * include/cpplib.h (BT_HAS_ATTRIBUTE): Fix comment. 96 * internal.h (struct lexer_state): Delete in__has_include field. 97 (struct spec_nodes): Rename n__has_include{,_next}__ fields. 98 (_cpp_defined_macro_p): New. 99 (_cpp_find_file): Add has_include parm. 100 * directives.c (lex_macro_node): Combine defined, 101 __has_inline{,_next} checking. 102 (do_ifdef, do_ifndef): Use _cpp_defined_macro_p. 103 (_cpp_init_directives): Refactor. 104 * expr.c (parse_defined): Use _cpp_defined_macro_p. 105 (eval_token): Adjust parse_has_include calls. 106 (parse_has_include): Add OP parameter. Reimplement. 107 * files.c (_cpp_find_file): Add HAS_INCLUDE parm. Use it to 108 inhibit error message. 109 (_cpp_stack_include): Adjust _cpp_find_file call. 110 (_cpp_fake_include, _cpp_compare_file_date): Likewise. 111 (open_file_failed): Remove in__has_include check. 112 (_cpp_has_header): Adjust _cpp_find_file call. 113 * identifiers.c (_cpp_init_hashtable): Don't init 114 __has_include{,_next} here ... 115 * init.c (cpp_init_builtins): ... init them here. Define as 116 macros. 117 (cpp_read_main_file): Adjust _cpp_find_file call. 118 * pch.c (cpp_read_state): Adjust __has_include{,_next} access. 119 * traditional.c (_cpp_scan_out_locgical_line): Likewise. 120 121 PR preprocessor/93306 122 * expr.c (parse_has_include): Refactor. Check skip_eval before 123 looking. 124 1252020-01-10 David Malcolm <dmalcolm@redhat.com> 126 127 * include/line-map.h (class diagnostic_path): New forward decl. 128 (rich_location::get_path): New accessor. 129 (rich_location::set_path): New function. 130 (rich_location::m_path): New field. 131 * line-map.c (rich_location::rich_location): Initialize m_path. 132 1332020-01-01 Jakub Jelinek <jakub@redhat.com> 134 135 Update copyright years. 136 1372019-12-18 David Malcolm <dmalcolm@redhat.com> 138 139 PR preprocessor/92982 140 * charset.c 141 (cpp_string_location_reader::cpp_string_location_reader): Delete 142 initialization of m_line_table. 143 * include/cpplib.h (cpp_string_location_reader::m_line_table): 144 Delete unused member. 145 1462019-12-14 Jakub Jelinek <jakub@redhat.com> 147 148 PR preprocessor/92919 149 * charset.c (wide_str_to_charconst): If str contains just the 150 NUL terminator, punt quietly. 151 1522019-12-09 David Malcolm <dmalcolm@redhat.com> 153 154 * include/line-map.h (label_text::label_text): Make private. 155 (label_text::borrow): New. 156 (label_text::take): New. 157 (label_text::take_or_copy): New. 158 1592019-12-09 Lewis Hyatt <lhyatt@gmail.com> 160 161 PR preprocessor/49973 162 * generated_cpp_wcwidth.h: New file generated by 163 ../contrib/unicode/gen_wcwidth.py, supports new cpp_wcwidth function. 164 * charset.c (compute_next_display_width): New function to help 165 implement display columns. 166 (cpp_byte_column_to_display_column): Likewise. 167 (cpp_display_column_to_byte_column): Likewise. 168 (cpp_wcwidth): Likewise. 169 * include/cpplib.h (cpp_byte_column_to_display_column): Declare. 170 (cpp_display_column_to_byte_column): Declare. 171 (cpp_wcwidth): Declare. 172 (cpp_display_width): New function. 173 1742019-11-14 Joseph Myers <joseph@codesourcery.com> 175 176 * charset.c (narrow_str_to_charconst): Make CPP_UTF8CHAR constants 177 unsigned for C. 178 * init.c (lang_defaults): Set utf8_char_literals for GNUC2X and 179 STDC2X. 180 1812019-11-07 Jakub Jelinek <jakub@redhat.com> 182 183 PR c++/91370 - Implement P1041R4 and P1139R2 - Stronger Unicode reqs 184 * charset.c (narrow_str_to_charconst): Add TYPE argument. For 185 CPP_UTF8CHAR diagnose whenever number of chars is > 1, using 186 CPP_DL_ERROR instead of CPP_DL_WARNING. 187 (wide_str_to_charconst): For CPP_CHAR16 or CPP_CHAR32, use 188 CPP_DL_ERROR instead of CPP_DL_WARNING when multiple char16_t 189 or char32_t chars are needed. 190 (cpp_interpret_charconst): Adjust narrow_str_to_charconst caller. 191 1922019-11-05 Tim van Deurzen <tim@kompiler.org> 193 194 * cpplib.h: Add spaceship operator for C++. 195 * lex.c: Implement conditional lexing of spaceship operator for C++20. 196 1972019-10-31 Jakub Jelinek <jakub@redhat.com> 198 199 PR preprocessor/92296 200 * internal.h (struct def_pragma_macro): Add is_builtin bitfield. 201 (_cpp_restore_special_builtin): Declare. 202 * init.c (_cpp_restore_special_builtin): New function. 203 * directives.c (do_pragma_push_macro): For NT_BUILTIN_MACRO 204 set is_builtin and don't try to grab definition. 205 (cpp_pop_definition): Use _cpp_restore_special_builtin to restore 206 builtin macros. 207 2082019-10-15 Nathan Sidwell <nathan@acm.org> 209 210 * include/line-map.h (struct maps_info_ordinary): Make cache 211 mutable. 212 (struct maps_info_macro): Likewise. 213 (LINEMAPS_CACHE): Remove non-ref accessor. Constify ref accessor. 214 (LINEMAPS_ORDINARY_CACHE, LINEMAPS_MACRO_CACHE): Likewise. 215 (LINEMAPS_ORDINARY_MAP_AT, LINEMAPS_MACRO_MAP_AT): Use 216 LINEMAPS_USED and LINEMAPS_MAP_AT. 217 (linemap_lookup): Constify line_map arg. 218 linemap.c (linemap_ordinary_map_lookup, linemap_macro_map_lookup): 219 Constify line_map arg. 220 2212019-10-11 Joseph Myers <joseph@codesourcery.com> 222 223 * include/cpplib.h (struct cpp_options): Add dfp_constants and 224 cpp_warn_c11_c2x_compat. 225 (enum cpp_warning_reason): Add CPP_W_C11_C2X_COMPAT. 226 * init.c (struct lang_flags): Add dfp_constants. 227 (lang_defaults): Set dfp_constants to 1 for GNUC2X and STDC2X and 228 0 for other languages. 229 (cpp_set_lang): Set dfp_constants from language. 230 (cpp_create_reader): Set cpp_warn_c11_c2x_compat to -1. 231 * expr.c (interpret_float_suffix): Mention DFP constants as C2X in 232 comment. 233 (cpp_classify_number): Do not diagnose DFP constants for languages 234 setting dfp_constants, unless cpp_warn_c11_c2x_compat. 235 2362019-10-04 Nathan Sidwell <nathan@acm.org> 237 238 PR preprocessor/91991 239 * line-map.c (linemap_line_start): Clear max_column_hint if we run 240 out of locations. 241 2422019-10-02 Richard Biener <rguenther@suse.de> 243 244 * internal.h (enum include_type): Remove trailing comma. 245 2462019-10-02 Joseph Myers <joseph@codesourcery.com> 247 248 * include/cpplib.h (struct cpp_options): Add member scope. 249 * init.c (struct lang_flags, lang_defaults): Likewise. 250 (cpp_set_lang): Set scope member of pfile. 251 * lex.c (_cpp_lex_direct): Test CPP_OPTION (pfile, scope) not 252 CPP_OPTION (pfile, cplusplus) for creating CPP_SCOPE tokens. 253 2542019-09-26 Eric Botcazou <ebotcazou@adacore.com> 255 256 * charset.c (UCS_LIMIT): New macro. 257 (ucn_valid_in_identifier): Use it instead of a hardcoded constant. 258 (_cpp_valid_ucn): Issue a pedantic warning for UCNs larger than 259 UCS_LIMIT outside of identifiers in C and in C++2a or later. 260 2612019-09-19 Lewis Hyatt <lhyatt@gmail.com> 262 263 PR c/67224 264 * charset.c (_cpp_valid_utf8): New function to help lex UTF-8 tokens. 265 * internal.h (_cpp_valid_utf8): Declare. 266 * lex.c (forms_identifier_p): Use it to recognize UTF-8 identifiers. 267 (_cpp_lex_direct): Handle UTF-8 in identifiers and CPP_OTHER tokens. 268 Do all work in "default" case to avoid slowing down typical code paths. 269 Also handle $ and UCN in the default case for consistency. 270 2712019-08-30 Nathan Sidwell <nathan@acm.org> 272 273 New # semantics for popping to "" name. 274 libcpp/ 275 * directives.c (do_linemarker): Popping to "" name means get the 276 name from the include stack.. 277 2782019-09-05 Nathan Sidwell <nathan@acm.org> 279 280 PR preprocessor/91639 281 * directives.c (do_include_common): Tell lexer we're a #include. 282 * files.c (_cpp_stack_file): Lexer will have always incremented. 283 * internal.h (struct cpp_context): Extend in_directive's 284 semantics. 285 * lex.c (_cpp_lex_direct): Increment line for final \n when lexing 286 for an ISO #include. 287 * line-map.c (linemap_line_start): Remember if we overflowed. 288 2892019-09-03 Ulrich Weigand <uweigand@de.ibm.com> 290 291 * directives.c: Remove references to spu from comments. 292 * expr.c: Likewise. 293 2942019-08-29 Nathan Sidwell <nathan@acm.org> 295 296 * internal.h (enum include_type): Add IT_MAIN, IT_DIRECTIVE_HWM, 297 IT_HEADER_HWM. 298 (_cpp_stack_file): Take include_type, not a bool. 299 * files.c (_cpp_find_file): Refactor to not hide an if inside a 300 for conditional. 301 (should_stack_file): Break apart to ... 302 (is_known_idempotent_file, has_unique_contents): ... these. 303 (_cpp_stack_file): Replace IMPORT boolean with include_type enum. 304 Refactor to use new predicates. Do linemap compensation here ... 305 (_cpp_stack_include): ... not here. 306 * init.c (cpp_read_main_file): Pass IT_MAIN to _cpp_stack_file. 307 3082019-08-28 Nathan Sidwell <nathan@acm.org> 309 310 * directives-only.c (_cpp_preprocess_dir_only): Use false, not 311 zero for _cpp_handle_directive call. 312 * directives.c (_cpp_handle_directive): Indented is bool. 313 * files.c (struct _cpp_file): Make bools 1 bit bitfields. 314 * internal.h (enum include_type): Reformat and comment. 315 (struct cpp_buffer): Make flags 1 bit bitfields. 316 (_cpp_handle_directive): Indented is bool. 317 3182019-07-09 Martin Sebor <msebor@redhat.com> 319 320 * include/line-map.h: Change class-key from class to struct and vice 321 versa to match convention and avoid -Wclass-is-pod and -Wstruct-no-pod. 322 * mkdeps.c: Same. 323 3242019-07-03 Martin Liska <mliska@suse.cz> 325 326 * line-map.c (linemap_get_expansion_filename): Remove 327 dead assignemts. 328 * mkdeps.c (make_write): Likewise. 329 3302019-07-02 qing zhao <qing.zhao@oracle.com> 331 332 PR preprocessor/90581 333 * directives.c (do_include_common): Replace CPP_STACK_MAX with 334 CPP_OPTION (pfile, max_include_depth). 335 * include/cpplib.h (struct cpp_options): Add new field 336 max_include_depth. 337 * init.c (cpp_create_reader): Initiate new field max_include_depth. 338 * internal.h: Delete CPP_STACK_MAX. 339 3402019-06-26 Nathan Sidwell <nathan@acm.org> 341 342 PR preprocessor/90927 343 * mkdeps.c (mkdeps::vec::operator[]): Add non-const variant. 344 (deps_add_target): Deal with out of order unquoted targets. 345 3462019-05-19 Andrew Pinski <apinski@marvell.com> 347 348 PR pch/81721 349 * lex.c (cpp_token_val_index <case SPELL_OPERATOR>): If tok->flags 350 has NAMED_OP set, then return CPP_TOKEN_FLD_NODE. 351 3522019-05-14 Martin Liska <mliska@suse.cz> 353 354 PR preprocessor/90382 355 * line-map.c (first_map_in_common_1): Handle ADHOC 356 locations. 357 3582019-05-14 Martin Liska <mliska@suse.cz> 359 360 PR preprocessor/90382 361 * include/line-map.h (get_data_from_adhoc_loc): Add const to 362 the first argument. 363 (get_location_from_adhoc_loc): Likewise. 364 * line-map.c(get_data_from_adhoc_loc): Add const to 365 the first argument. 366 (get_location_from_adhoc_loc): Likewise. 367 (get_combined_adhoc_loc): Use get_location_from_adhoc_loc 368 (or get_data_from_adhoc_loc). 369 (get_range_from_adhoc_loc): Likewise. 370 (get_pure_location): Likewise. 371 (linemap_position_for_loc_and_offset): Likewise. 372 (linemap_lookup): Likewise. 373 (linemap_ordinary_map_lookup): Likewise. 374 (linemap_macro_map_lookup): Likewise. 375 (linemap_get_expansion_line): Likewise. 376 (linemap_get_expansion_filename): Likewise. 377 (linemap_location_in_system_header_p): Likewise. 378 (linemap_location_from_macro_expansion_p): Likewise. 379 (linemap_macro_loc_to_exp_point): Likewise. 380 (linemap_resolve_location): Likewise. 381 (linemap_unwind_toward_expansion): Likewise. 382 (linemap_unwind_to_first_non_reserved_loc): Likewise. 383 (linemap_expand_location): Likewise. 384 (linemap_dump_location): Likewise. 385 3862019-05-07 Nathan Sidwell <nathan@acm.org> 387 388 * files.c (_cpp_stack_file): Empty filenames aren't dependencies. 389 * mkdeps.c (deps_add_dep): Assert not empty. 390 391 * include/mkdeps.h (deps_write): Add PHONY arg. 392 (deps_phony_targets): Delete. 393 * init.c (cpp_finish): Just call deps_write. 394 * mkdeps.c (struct mkdeps): Add local vector class. Reimplement 395 vector handling. 396 (munge): Munge to static buffer. 397 (apply_vpath): Adjust vector handling. 398 (deps_init, deps_free): Use new, delete. 399 (deps_add_target): Do not munge here. Record quoting low water mark. 400 (deps_add_dep): Do not munge here. 401 (deps_add_vpath): Adjust vector handling. 402 (make_write_name): New. Munge on demand here. 403 (make_write_vec): New. 404 (deps_phony_targets): Delete. 405 (make_write): New. 406 (deps_write): Forward to deps_Write. 407 (deps_save, deps_restore): Adjust vector handling. 408 4092019-05-06 Nathan Sidwell <nathan@acm.org> 410 411 * include/mkdeps.h: Rename struct deps to struct mkdeps. 412 * mkdeps.c: Likewise. 413 * include/cpplib.h (cpp_get_deps): Rename return type.. 414 * directives.c (cpp_get_deps): Likewise. 415 * internal.h (struct cpp_reader): Rename deps field type. 416 4172019-04-03 Jonathan Wakely <jwakely@redhat.com> 418 419 * files.c (search_path_exhausted): Fix typo in comment. 420 4212019-02-26 Martin Liska <mliska@suse.cz> 422 423 * symtab.c (ht_dump_statistics): Make 424 horizontal alignment for statistics. 425 4262019-02-20 David Malcolm <dmalcolm@redhat.com> 427 428 PR c/89410 429 * include/line-map.h (linenum_arith_t): New typedef. 430 (compare): Use it. 431 4322019-02-18 Martin Liska <mliska@suse.cz> 433 434 PR c++/89383 435 * line-map.c (linemap_line_start): Use 1UL in order 436 to not overflow. 437 4382019-02-11 Martin Liska <mliska@suse.cz> 439 440 PR lto/88147 441 * line-map.c (linemap_line_start): Don't reuse the existing line 442 map if the line offset is sufficiently large to cause overflow 443 when computing location_t values. 444 4452019-01-26 Jakub Jelinek <jakub@redhat.com> 446 447 PR preprocessor/88974 448 * directives.c (SEEN_EOL): Move macro to ... 449 * internal.h (SEEN_EOL): ... here. 450 * expr.c (parse_has_include): Don't cpp_get_token if SEEN_EOL (). 451 4522019-01-01 Jakub Jelinek <jakub@redhat.com> 453 454 Update copyright years. 455 4562018-11-27 Mike Gulick <mgulick@mathworks.com> 457 458 PR preprocessor/83173 459 * location-example.txt: Update example -fdump-internal-locations 460 output. 461 4622018-11-27 Mike Gulick <mgulick@mathworks.com> 463 464 PR preprocessor/83173 465 * files.c (_cpp_stack_include): Check if 466 line_table->highest_location is past current line before 467 decrementing. 468 4692018-11-13 David Malcolm <dmalcolm@redhat.com> 470 471 * charset.c: Replace "source_location" with "location_t". 472 * directives-only.c: Likewise. 473 * directives.c: Likewise. 474 * errors.c: Likewise. 475 * expr.c: Likewise. 476 * files.c: Likewise. 477 * include/cpplib.h: Likewise. Rename MAX_SOURCE_LOCATION to 478 MAX_LOCATION_T. 479 * include/line-map.h: Likewise. 480 * init.c: Likewise. 481 * internal.h: Likewise. 482 * lex.c: Likewise. 483 * line-map.c: Likewise. 484 * location-example.txt: Likewise. 485 * macro.c: Likewise. 486 * pch.c: Likewise. 487 * traditional.c: Likewise. 488 4892018-11-07 Hafiz Abid Qadeer <abidh@codesourcery.com> 490 491 * configure: Regenerated. 492 4932018-11-05 Martin Liska <mliska@suse.cz> 494 495 * symtab.c (ht_dump_statistics): Replace %zu with %lu format. 496 4972018-11-05 Martin Liska <mliska@suse.cz> 498 499 * symtab.c (ht_dump_statistics): Fix format and 500 pass missing argument. 501 5022018-11-05 Martin Liska <mliska@suse.cz> 503 504 * symtab.c (ht_dump_statistics): Make dump conditional 505 based on alloc_subobject. 506 5072018-10-31 Joseph Myers <joseph@codesourcery.com> 508 509 PR bootstrap/82856 510 * configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE. 511 * aclocal.m4, config.in, configure: Regenerate. 512 5132018-10-31 Nathan Sidwell <nathan@acm.org> 514 515 * internal.h (struct cpp_reader): Rename forced_token_location_p 516 to forced_token_location and drop its pointerness. 517 * include/cpplib.h (cpp_force_token_locations): Take location, not 518 pointer to one. 519 * init.c (cpp_create_reader): Adjust. 520 * lex.c (cpp_read_main_file): 521 522 * directives.c (do_include_common): Commonize cleanup path. 523 (_cpp_pop_buffer): Fix leak. 524 525 * include/line-map.h (IS_ORDINARY_LOC, IS_MACRO_LOC): New 526 predicates. 527 (IS_ADHOC_LOC): Move earlier. 528 (MAP_ORDINARY_P): Use IS_ORDINARY_LOC. 529 * line-map.c (linemap_location_from_macro_expansion_p): Use 530 IS_MACRO_LOC. 531 532 * include/cpplib.h (cpp_macro_definition_location): Make inline. 533 * macro.c (warn_of_redefinition): Fix comments, examine macro 534 type, use C++ for. 535 (cpp_macro_definition_location): Don't define here. 536 537 * include/cpplib.h (HT_NODE): Don't cast NODE. 538 (NODE_LEN, NODE_NAME): Use HT_NODE. 539 540 * directives.c (DIRECTIVE_TABLE): Drop historical frequency 541 comments. 542 * files.c (_cpp_stack_file): Fix indentation. 543 5442018-10-17 Joseph Myers <joseph@codesourcery.com> 545 546 * include/cpplib.h (enum c_lang): Add CLK_GNUC2X and CLK_STDC2X. 547 * init.c (lang_defaults): Add GNUC2X and STDC2X entries. 548 (cpp_init_builtins): Define __STDC_VERSION__ to 202000L for C2X. 549 5502018-10-11 David Malcolm <dmalcolm@redhat.com> 551 552 * macro.c (_cpp_arguments_ok): If the argument count is wrong, add 553 a note showing the definition of the macro. 554 5552018-10-11 Nathan Sidwell <nathan@acm.org> 556 557 * include/line-map.h (LINEMAPS_MACRO_LOWEST_LOCATION): Fix 558 off-by-one error. 559 * line-map.c (linemap_enter_macro): Use RAII. Clear all of the 560 macro_locations. 561 5622018-10-09 David Malcolm <dmalcolm@redhat.com> 563 564 * charset.c (noop_error_cb): Rename to... 565 (noop_diagnostic_cb): ...this, converting params to enums. 566 (cpp_interpret_string_ranges): Update for renaming and enums. 567 * directives.c (check_eol_1): Convert reason to enum. 568 (do_diagnostic): Convert code and reason to enum. 569 (do_error): Use CPP_W_NONE rather than 0. 570 (do_pragma_dependency): Likewise. 571 * errors.c (cpp_diagnostic_at): Convert level and reason to enums. 572 Update for renaming. 573 (cpp_diagnostic): Convert level and reason to enums. 574 (cpp_error): Convert level to enum. 575 (cpp_warning): Convert reason to enums. 576 (cpp_pedwarning): Likewise. 577 (cpp_warning_syshdr): Likewise. 578 (cpp_diagnostic_with_line): Convert level and reason to enums. 579 Update for renaming. 580 (cpp_error_with_line): Convert level to enum. 581 (cpp_warning_with_line): Convert reason to enums. 582 (cpp_pedwarning_with_line): Likewise. 583 (cpp_warning_with_line_syshdr): Likewise. 584 (cpp_error_at): Convert level to enum. 585 (cpp_errno): Likewise. 586 (cpp_errno_filename): Likewise. 587 * include/cpplib.h (enum cpp_diagnostic_level): Name this enum, 588 and move to before struct cpp_callbacks. 589 (enum cpp_warning_reason): Likewise. 590 (cpp_callbacks::diagnostic): Convert params from int to enums. 591 (cpp_error): Convert int param to enum cpp_diagnostic_level. 592 (cpp_warning): Convert int param to enum cpp_warning_reason. 593 (cpp_pedwarning): Likewise. 594 (cpp_warning_syshdr): Likewise. 595 (cpp_errno): Convert int param to enum cpp_diagnostic_level. 596 (cpp_errno_filename): Likewise. 597 (cpp_error_with_line): Likewise. 598 (cpp_warning_with_line): Convert int param to enum 599 cpp_warning_reason. 600 (cpp_pedwarning_with_line): Likewise. 601 (cpp_warning_with_line_syshdr): Likewise. 602 (cpp_error_at): Convert int param to enum cpp_diagnostic_level. 603 * macro.c (create_iso_definition): Convert int to enum. 604 (_cpp_create_definition): Likewise. 605 6062018-09-17 David Malcolm <dmalcolm@redhat.com> 607 608 * include/line-map.h (range_label::get_text): Add param 609 "range_idx". 610 6112018-08-30 Nathan Sidwell <nathan@acm.org> 612 613 * include/line-map.h (enum lc_reason): Comment each member 614 separately. 615 (struct line_maps): Fix reallocator comment. 616 6172018-08-27 David Malcolm <dmalcolm@redhat.com> 618 619 PR 87091 620 * include/line-map.h (enum range_display_kind): New enum. 621 (struct location_range): Replace field "m_show_caret_p" with 622 "m_range_display_kind", converting from bool to the new enum. 623 (class rich_location): Add example of line insertion fix-it hint. 624 (rich_location::add_range): Convert param "show_caret_p" from bool 625 to enum range_display_kind and rename to "range_display_kind", 626 giving it a default of SHOW_RANGE_WITHOUT_CARET. 627 (rich_location::set_range): Likewise, albeit without a default. 628 * line-map.c (rich_location::rich_location): Update for conversion 629 of show_caret_p to tri-state enum. 630 (rich_location::add_range): Likewise. 631 (rich_location::set_range): Likewise. 632 6332018-08-24 H.J. Lu <hongjiu.lu@intel.com> 634 635 PR bootstrap/86872 636 * line-map.c (pure_location_p): Return true if linemap_lookup 637 returns NULL. 638 (linemap_add): Set start_location to 0 if we run out of line map 639 space. 640 6412018-08-20 Nathan Sidwell <nathan@acm.org> 642 643 * include/cpplib.h: Fixup some whitespace. 644 (cpp_hashnode): Reduce type to 2 bit & flags to 8. 645 646 * include/cpplib.h (NODE_BUILTIN, NODE_MACRO_ARG): Delete. 647 Renumber others. 648 (enum node_type): Replace NT_MACRO with NT_USER_MACRO, 649 NT_BUILTIN_MACRO, NT_MACRO_ARG. Delete NT_ASSERTION. 650 (NTV_MACRO, NTV_ANSWER, NTV_BUILTIN, NTV_ARGUMENT, NTV_NONE): 651 Delete. 652 (CPP_HASHNODE_VALUE_IDX): Delete. 653 (union _cpp_hashnode_value): GTY tag from enum node_type directly. 654 (struct cpp_hashnode): Adjust GTY desc for value field. 655 (cpp_user_macro_p, cpp_builtin_macro_p, cpp_macro_p): Adjust. 656 * directives.c (undefine_macros): Clear value.anwers, adjust flag 657 clearing. 658 (_cpp_test_assertion): No need to check NT_ASSERTION. 659 (do_assert, do_unassert): Likewise. 660 * init.c (cpp_init_special_builtins): Set type not flags. 661 * macro.c (struct macro_arg_saved_data): Add type field. 662 (cpp_get_token_1): Check type not NT_VOID. 663 (_cpp_free_definition): Adjust flag clearing. Nullify 664 value.answers. 665 (_cpp_save_parameter, _cpp_unsave_parameters): Save and restore 666 type. 667 (lex_expansion_token): Check type not flags. 668 (_cpp_create_definition): Set type to NT_USER_MACRO. 669 (_cpp_notify_macro_use): Adjust type checking. 670 * pch.c (write_macdef, count_defs, write_defs, cpp_valid_state) 671 (save_macros): Adjust node type/flag handling. 672 * traditional.c (_cpp_scan_out_logical_line): Check type not flags. 673 674 * directives.c (do_undef): Use cpp_macro_p & cpp_builtin_macro_p. 675 * include/cpplib.h (enum cpp_macro_kind): Remove trailing comma. 676 (cpp_fun_like_macro_p): Make inline, define. 677 * macro.c (cpp_define_lazily): Use UCHAR_MAX. 678 (cpp_fun_like_macro_p): Delete. 679 680 * Makefile.in (TAGS_SOURCES): Remove cpp-id-data.h. 681 * include/cpp-id-data.h: Delete. 682 * internal.h: Include cpplib.h not cpp-id-data.h. 683 684 * include/cpp-id-data.h (struct answer): Delete. 685 * include/cpplib.h (struct answer): Don't forward-declare. 686 (enum cpp_macro_kind): Add cmk_assert. 687 (struct cpp_macro): Union parms and next assert chain. 688 (union _cpp_hashnode_value): 'answer' field is cpp_macro. 689 * directives.c (parse_answer): Convert to use cpp_macro. Return 690 true on success. 691 (parse_assertion, find_answer, _cpp_test_assertion, cpp_do_assert) 692 (cpp_do_unassert): Convert to use cpp_macro. 693 * macro.c (warn_of_redefinition, _cpp_new_macro) 694 (check_trad_stringification, cpp_macro_definition): Adjust macro 695 parm access. 696 * traditional.c (_cpp_replacement_text_len) 697 (_cpp_copy_replacement_text, _cpp_create_trad_definition): Likewise. 698 6992018-08-17 Nathan Sidwell <nathan@acm.org> 700 701 * include/cpplib.h (struct cpp_callbacks): Replace 702 user_builtin_macro with user_lazy_macro. 703 (struct cpp_macro): add lazy field. 704 (enum cpp_builtin_type): Remove BT_FIRST_USER, BT_LAST_USER. 705 (cpp_define_lazily): Declare. 706 * macro.c (enter_macro_context) Use _cpp_maybe_notify_macro_use. 707 (warn_of_redefinition): Use cpp_builtin_macro_p, directly call 708 user_lazy_macro hook. 709 (_cpp_new_macro): Clear lazy field. 710 (cpp_define_lazily): Define. 711 (_cpp_notify_macro_use): Adjust lazy definition code. 712 (cpp_macro_definition): No need to do lazy definition here. 713 * pch.c (write_macdef, save_macros): Likewise. 714 715 * include/cpplib.h (enum cpp_macro_kind): New. 716 (struct cpp_macro): Make body trailing array. Add kind field, 717 delete traditional flag. 718 * internal.h (_cpp_new_macro): Declare. 719 (_cpp_reserve_room): New inline. 720 (_cpp_commit_buf): Declare. 721 (_cpp_create_trad_definition): Return new macro. 722 * lex.c (_cpp_commit_buff): New. 723 * macro.c (macro_real_token_count): Count backwards. 724 (replace_args): Pointer equality not orderedness. 725 (_cpp_save_parameter): Use _cpp_reserve_room. 726 (alloc_expansion_token): Delete. 727 (lex_expansion_token): Return macro pointer. Use _cpp_reserve_room. 728 (create_iso_definition): Allocate macro itself. Adjust for 729 different allocation ordering. 730 (_cpp_new_macro): New. 731 (_cpp_create_definition): Adjust for API changes. 732 * traditional.c (push_replacement_text): Don't set traditional 733 flag. 734 (save_replacement_text): Likewise. 735 (_cpp_create_trad_definition): Allocate macro itself, Adjust for 736 different allocation ordering. 737 738 * cpp-id-data.h (uchar, UC): Move to internal.h 739 (struct cpp_macro): Move to cpplib.h. 740 * internal.h (uchar, UC): From cpp-id-data.h. 741 * include/cpplib.h (struct cpp_macro): From cpp-id-data.h. 742 7432018-08-16 Nathan Sidwell <nathan@acm.org> 744 745 * internal.h (_cpp_save_parameter): Take parmno, not macro. 746 (_cpp_unsave_parameters): Declare. 747 * macro.c (_cpp_save_parameter): Take parm number, not macro. 748 Return true on success. 749 (_cpp_unsave_parameters): New. 750 (parse_params): Take parm_no and variadic pointers, not macro. 751 Reimplement parsing logic. 752 (create_iso_definition): Adjust parse_params changes. Call 753 _cpp_unsave_parameters here. 754 (_cpp_create_definition): Don't unsave params here. 755 * traditional.c (scan_parameters): Take n_param pointer, adjust. 756 (_cpp_create_trad_definition): Ajust scan_parameters change. Call 757 _cpp_unsave_parameters. 758 759 * include/cpplib.h (cpp_user_macro_p, cpp_builtin_macro_p) 760 (cpp_macro_p): New inlines. 761 * directives.c (do_pragma_poison): Use cpp_macro_p. 762 (do_ifdef, do_ifndef): Likewise. Use _cpp_maybe_notify_macro_use. 763 (cpp_pop_definition): Use cpp_macro_p. Move _cpp_free_definition 764 earlier. Don't zap node directly. 765 * expr.c (parse_defined): Use _cpp_maybe_notify_macro_use & 766 cpp_macro_p. 767 * files.c (should_stack_file): Use cpp_macro_p. 768 * identifiers.c (cpp_defined): Likewise. 769 * internal.h (_cpp_mark_macro): Use cpp_user_macro_p. 770 (_cpp_notify_macro_use): Declare. 771 (_cpp_maybe_notify_macro_use): New inline. 772 * lex.c (is_macro): Use cpp_macro_p. 773 * macro.c (_cpp_warn_if_unused_macro): Use cpp_user_macro_p. 774 (enter_macro_context): Likewise. 775 (_cpp_create_definition): Use cpp_builtin_macro_p, 776 cpp_user_macro_p. Move _cpp_free_definition earlier. 777 (_cpp_notify_macro_use): New, broken out of multiple call sites. 778 * traditional.c (fun_like_macro_p): Use cpp_builtin_macro_p. 779 (maybe_start_funlike, _cpp_scan_out_logical_line) 780 (push_replacement_text): Likewise. 781 7822018-08-15 David Malcolm <dmalcolm@redhat.com> 783 784 * include/line-map.h (struct location_range): Add "m_label" field. 785 (class rich_location): Add description of labels to leading 786 comment. 787 (rich_location::rich_location): Add "label" param, defaulting to 788 NULL. 789 (rich_location::add_range): Likewise. 790 (struct label_text): New struct. 791 (class range_label): New abstract base class. 792 * line-map.c (rich_location::rich_location): Add "label" param; 793 use it. 794 (rich_location::add_range): Likewise. 795 7962018-08-08 Nathan Sidwell <nathan@acm.org> 797 798 Make linemap::included_from a location 799 libcpp/ 800 * include/line-map.h (struct line_map_ordinary): Replace 801 included_from map index with included_at source_location. 802 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Delete. 803 (LAST_SOURCE_LINE_LOCATION): Delete. 804 (LAST_SOURCE_LINE, LAST_SOURCE_COLUMN): Delete. 805 (linemap_included_from): New. 806 (linemap_included_from_linemap): Declare. 807 (MAIN_FILE_P): Adjust. 808 * line-map.c (linemap_included_from_linemap): New. 809 (lonemap_check_files_exited): Use linemap_included_at. 810 (linemap_add): Adjust inclusion setting. 811 (linemap_dump, linemap_dump_location): Adjust. 812 * directives.c (do_linemarker): Use linemap_included_at. 813 8142018-08-07 Nathan Sidwell <nathan@acm.org> 815 816 * line-map.c: (linemap_init): Set default allocator here. 817 (new_linemap): Rather than here. Refactor allocation logic. 818 8192018-07-20 David Malcolm <dmalcolm@redhat.com> 820 821 * include/line-map.h (rich_location::set_range): Remove redundant 822 line_maps * parameter. 823 * line-map.c (rich_location::set_range): Likewise. 824 8252018-07-18 Bernd Edlinger <bernd.edlinger@hotmail.de> 826 827 PR 69558 828 * macro.c (enter_macro_context): Change the location info for builtin 829 macros and _Pragma from location of the closing parenthesis to location 830 of the macro expansion point. 831 8322018-07-17 Jason Franklin <j_fra@fastmail.us> 833 Jakub Jelinek <jakub@redhat.com> 834 835 * lex.c (_cpp_lex_direct): Use CPP_DL_NOTE instead of CPP_DL_PEDWARN, 836 CPP_DL_WARNING or CPP_DL_ERROR for note that diagnostics for C++ style 837 comments is reported only once per file and guard those calls on the 838 preceding cpp_error returning true. 839 8402018-07-03 Nathan Sidwell <nathan@acm.org> 841 842 Reorg line_map data structures for better packing. 843 * include/line-map.h (enum lc_reason): Add LC_HWM. 844 (LINE_MAP_MAX_LOCATION): Define here. 845 (struct line_map): Move reason field to line_map_ordinary. Adjust 846 GTY tagging. 847 (struct line_map_ordinary): Reorder fields for less padding. 848 (struct line_map_macro): Likewise. 849 (MAP_ORDINARY_P): New. 850 (linemap_check_ordinary, linemap_check_macro): Adjust. 851 * line-map.c (LINE_MAP_MAX_SOURCE_LOCATION): Delete. 852 (new_linemap): Take start_location, not reason. Adjust. 853 (linemap_add, linemap_enter_macro): Adjust. 854 (linemap_line_start): Likewise. 855 (linemap_macro_expansion_map_p): Use MAP_ORDINARY_P. 856 (linemap_macro_loc_to_spelling_point): Likewise. 857 (linemap_macro_loc_to_def_point): Likewise. 858 (linemap_dump): Likewise. 859 8602018-05-23 Jason Merrill <jason@redhat.com> 861 862 * system.h: #include <new> earlier. 863 8642018-05-17 Jason Merrill <jason@redhat.com> 865 866 * line-map.c (linemap_init): Use placement new. 867 * system.h: #include <new>. 868 8692018-03-14 David Malcolm <dmalcolm@redhat.com> 870 871 * include/line-map.h (compare): New function on linenum_type. 872 8732018-02-28 Jonathan Wakely <jwakely@redhat.com> 874 875 PR preprocessor/84517 876 * lex.c (is_macro_not_literal_suffix): New function. 877 (lex_raw_string, lex_string): Use is_macro_not_literal_suffix to 878 decide when to issue -Wliteral-suffix warnings. 879 8802018-02-16 Richard Biener <rguenther@suse.de> 881 882 PR bootstrap/82939 883 * line-map.c (linemap_init): Avoid broken value-init when compiling 884 with GCC 4.2. 885 8862018-02-15 Jason Merrill <jason@redhat.com> 887 Jakub Jelinek <jakub@redhat.com> 888 889 PR preprocessor/83063 - __VA_OPT__ and ## 890 PR preprocessor/83708 891 * macro.c (vaopt_state): Reorder m_last_was_paste before m_state. 892 (vaopt_state::vaopt_state): Adjust. 893 (vaopt_state::update_flags): Add BEGIN and END. 894 (vaopt_state::update): Return them. 895 (copy_paste_flag): Factor out of replace_args. 896 (last_token_is): New. 897 (replace_args): Handle BEGIN and END. Avoid padding there. 898 (tokens_buff_last_token_ptr): Return NULL if no tokens. 899 9002018-01-31 Jakub Jelinek <jakub@redhat.com> 901 902 PR preprocessor/69869 903 * traditional.c (skip_macro_block_comment): Return bool, true if 904 the macro block comment is unterminated. 905 (copy_comment): Use return value from skip_macro_block_comment instead 906 of always false. 907 9082018-01-27 Jakub Jelinek <jakub@redhat.com> 909 910 * include/cpplib.h (enum cpp_builtin_type): Change BT_LAST_USER from 911 BT_FIRST_USER + 31 to BT_FIRST_USER + 63. 912 9132018-01-18 Boris Kolpackov <boris@codesynthesis.com> 914 915 PR other/70268 916 * include/cpplib.h (cpp_callbacks::remap_filename): New callback. 917 * macro.c (_cpp_builtin_macro_text): Call remap_filename for 918 __FILE__ and __BASE_FILE__. 919 9202018-01-10 Kelvin Nilsen <kelvin@gcc.gnu.org> 921 922 * lex.c (search_line_fast): Remove illegal coercion of an 923 unaligned pointer value to vector pointer type and replace with 924 use of __builtin_vec_vsx_ld () built-in function, which operates 925 on unaligned pointer values. 926 9272018-01-03 Jakub Jelinek <jakub@redhat.com> 928 929 Update copyright years. 930 9312017-12-20 Michael Weiser <michael.weiser@gmx.de> 932 933 PR preprocessor/83492 934 * lex.c (search_line_fast) [__ARM_NEON && __ARM_64BIT_STATE]: 935 Fix selection of big-endian shift parameters by using 936 __ARM_BIG_ENDIAN. 937 9382017-12-14 Bernd Edlinger <bernd.edlinger@hotmail.de> 939 940 * internal.h (maybe_print_line): Change signature. 941 9422017-12-05 Jakub Jelinek <jakub@redhat.com> 943 944 PR c++/79228 945 * expr.c (interpret_float_suffix): Avoid memcmp. 946 (interpret_int_suffix): Likewise. Don't check for if. 947 9482017-12-01 Jason Merrill <jason@redhat.com> 949 950 PR c++/79228 - extensions hide C++14 complex literal operators 951 * expr.c (interpret_float_suffix): Ignore 'i' in C++14 and up. 952 (interpret_int_suffix): Likewise. 953 9542017-11-28 David Malcolm <dmalcolm@redhat.com> 955 956 PR c/82050 957 * include/line-map.h (LINE_MAP_MAX_COLUMN_NUMBER): Move here. 958 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER): ...from here. 959 (rich_location::maybe_add_fixit): Reject fix-it hints in which 960 the start column exceeds the next column. 961 9622017-11-20 Eric Gallager <egall@gwmail.gwu.edu> 963 964 PR preprocessor/81794 965 * macro.c (check_trad_stringification): Have warning be controlled 966 by -Wtraditional. 967 9682017-11-20 David Malcolm <dmalcolm@redhat.com> 969 970 PR c++/72786 971 * include/cpplib.h (cpp_macro_definition_location): New decl. 972 * macro.c (cpp_macro_definition): New function. 973 9742017-11-13 Tom Tromey <tom@tromey.com> 975 976 * pch.c (cpp_read_state): Set n__VA_OPT__. 977 * macro.c (vaopt_state): New class. 978 (_cpp_arguments_ok): Check va_opt flag. 979 (replace_args, create_iso_definition): Use vaopt_state. 980 * lex.c (lex_identifier_intern): Possibly issue errors for 981 __VA_OPT__. 982 (lex_identifier): Likewise. 983 (maybe_va_opt_error): New function. 984 * internal.h (struct lexer_state) <va_args_ok>: Update comment. 985 (struct spec_nodes) <n__VA_OPT__>: New field. 986 * init.c (struct lang_flags) <va_opt>: New field. 987 (lang_defaults): Add entries for C++2A. Update all entries for 988 va_opt. 989 (cpp_set_lang): Initialize va_opt. 990 * include/cpplib.h (struct cpp_options) <va_opt>: New field. 991 * identifiers.c (_cpp_init_hashtable): Initialize n__VA_OPT__. 992 9932017-11-13 David Malcolm <dmalcolm@redhat.com> 994 995 * include/line-map.h (linenum_type): Move this typedef and the 996 comment describing column numbering to near the top of the file. 997 9982017-11-06 Mukesh Kapoor <mukesh.kapoor@oracle.com> 999 1000 PR c++/80955 1001 * lex.c (lex_string): When checking for a valid macro for the 1002 warning related to -Wliteral-suffix (CPP_W_LITERAL_SUFFIX), 1003 check that the macro name does not start with an underscore 1004 before calling is_macro(). 1005 10062017-11-05 Tom de Vries <tom@codesourcery.com> 1007 1008 PR other/82784 1009 * lex.c (BUF_APPEND): Remove semicolon after 1010 "do {} while (0)". 1011 10122017-10-31 David Malcolm <dmalcolm@redhat.com> 1013 1014 * directives.c (_cpp_handle_directive): Update for renaming of 1015 cpp_error_at_richloc to cpp_error_at. 1016 * errors.c (cpp_diagnostic_at_richloc): Rename to... 1017 (cpp_diagnostic_at): ...this, dropping the location_t-based 1018 implementation. 1019 (cpp_diagnostic): Update for removal of location_t-based 1020 cpp_diagnostic_at. 1021 (cpp_error_at): Likewise. 1022 (cpp_error_at_richloc): Rename to... 1023 (cpp_error_at): ...this, and update for renaming of 1024 cpp_diagnostic_at_richloc. 1025 * include/cpplib.h (cpp_error_at_richloc): Rename to... 1026 (cpp_error_at): ...this. 1027 10282017-10-30 Joseph Myers <joseph@codesourcery.com> 1029 1030 * include/cpplib.h (enum c_lang): Add CLK_GNUC17 and CLK_STDC17. 1031 * init.c (lang_defaults): Add GNUC17 and STDC17 data. 1032 (cpp_init_builtins): Handle C17 value of __STDC_VERSION__. 1033 10342017-10-10 Nathan Sidwell <nathan@acm.org> 1035 1036 PR preprocessor/82506 1037 * macro.c (cpp_quote_string): Escape raw LFs. 1038 10392017-09-15 Andrew Sutton <andrew.n.sutton@gmail.com> 1040 Jakub Jelinek <jakub@redhat.com> 1041 1042 Add support for -std=c++2a. 1043 * include/cpplib.h (c_lang): Add CXX2A and GNUCXX2A. 1044 * init.c (lang_defaults): Add rows for CXX2A and GNUCXX2A. 1045 (cpp_init_builtins): Set __cplusplus to 201709L for C++2a. 1046 10472017-09-15 Jakub Jelinek <jakub@redhat.com> 1048 1049 * include/cpplib.h (enum c_lang): Rename CLK_GNUCXX1Z 1050 to CLK_GNUCXX17 and CLK_CXX1Z to CLK_CXX17. 1051 * init.c (lang_defaults, cpp_init_builtins): Likewise. 1052 * expr.c (cpp_classify_number): Use C++17 instead of C++1z 1053 in diagnostics. 1054 10552017-07-07 David Malcolm <dmalcolm@redhat.com> 1056 1057 PR c++/79300 1058 * line-map.c (linemap_macro_loc_to_def_point): Preserve range 1059 information for macro expansions by delaying resolving ad-hoc 1060 locations until within the loop. 1061 10622017-07-06 David Malcolm <dmalcolm@redhat.com> 1063 1064 PR c++/79300 1065 * include/line-map.h (enum location_aspect): New enum. 1066 (linemap_client_expand_location_to_spelling_point): Add 1067 enum location_aspect param. 1068 * line-map.c (rich_location::get_expanded_location): Update for 1069 new param of linemap_client_expand_location_to_spelling_point. 1070 (rich_location::maybe_add_fixit): Likewise. 1071 (fixit_hint::affects_line_p): Likewise. 1072 10732017-06-21 Jakub Jelinek <jakub@redhat.com> 1074 1075 * line-map.c (location_adhoc_data_update): Perform addition in 1076 uintptr_t type rather than char * type. Read *data using 1077 ptrdiff_t type instead of int64_t. 1078 (get_combined_adhoc_loc): Change offset type to ptrdiff_t from 1079 int64_t. 1080 10812017-06-20 David Malcolm <dmalcolm@redhat.com> 1082 1083 * include/line-map.h (class rich_location): Document that attempts 1084 to delete or replace a range *affecting* multiple lines will fail. 1085 * line-map.c (rich_location::maybe_add_fixit): Implement this 1086 restriction. 1087 10882017-06-09 David Malcolm <dmalcolm@redhat.com> 1089 1090 * include/line-map.h 1091 (rich_location::fixits_cannot_be_auto_applied): New method. 1092 (rich_location::fixits_can_be_auto_applied_p): New accessor. 1093 (rich_location::m_fixits_cannot_be_auto_applied): New field. 1094 * line-map.c (rich_location::rich_location): Initialize new field. 1095 10962017-06-05 David Malcolm <dmalcolm@redhat.com> 1097 1098 * include/cpplib.h (struct cpp_callbacks): Add "comment" 1099 callback. 1100 * lex.c (_cpp_lex_direct): Call the comment callback if non-NULL. 1101 11022017-05-02 David Malcolm <dmalcolm@redhat.com> 1103 1104 * include/line-map.h (class rich_location): Update description of 1105 newline handling. 1106 (class fixit_hint): Likewise. 1107 (fixit_hint::ends_with_newline_p): New decl. 1108 * line-map.c (rich_location::maybe_add_fixit): Support newlines 1109 in fix-it hints that are insertions of single lines at the start 1110 of a line. Don't consolidate into such fix-it hints. 1111 (fixit_hint::ends_with_newline_p): New method. 1112 11132017-05-01 David Malcolm <dmalcolm@redhat.com> 1114 1115 * include/line-map.h (source_range::intersects_line_p): Delete. 1116 (rich_location::add_fixit): Delete. 1117 (rich_location::maybe_add_fixit): New method. 1118 (class fixit_hint): Reimplement in terms of... 1119 (class fixit_replace): ...this. 1120 (class fixit_insert): Delete. 1121 * line-map.c (linemap_position_for_loc_and_offset): Drop overzealous 1122 linemap_assert_fails. 1123 (source_range::intersects_line_p): Rename to... 1124 (fixit_hint::affects_line_p): New function. 1125 (rich_location::add_fixit_insert_before): Reimplement in terms of 1126 maybe_add_fixit, moving validation there. 1127 (rich_location::add_fixit_insert_after): Likewise. 1128 (column_before_p): Delete. 1129 (rich_location::add_fixit_replace): Reimplement in terms of 1130 maybe_add_fixit, moving validation there. Convert closed input range 1131 to half-open range. 1132 (rich_location::add_fixit): Delete. 1133 (rich_location::maybe_add_fixit): New function. 1134 (fixit_insert::fixit_insert): Delete. 1135 (fixit_insert::~fixit_insert): Delete. 1136 (fixit_insert::affects_line_p): Delete. 1137 (fixit_insert::maybe_append_replace): Delete. 1138 (fixit_replace::fixit_replace): Rename to... 1139 (fixit_hint::fixit_hint): ...this, rewriting as necessary. 1140 (fixit_replace::~fixit_replace): Delete. 1141 (fixit_replace::affects_line_p): Delete. 1142 (fixit_replace::maybe_append_replace): Rename to... 1143 (fixit_hint::maybe_append): ...this, rewriting as necessary. 1144 11452017-04-03 Jonathan Wakely <jwakely@redhat.com> 1146 1147 * include/line-map.h (LINEMAPS_MACRO_MAPS): Fix typo in comment. 1148 * lex.c (search_line_fast): Likewise. 1149 * pch.h (cpp_valid_state): Likewise. 1150 11512017-03-21 Andreas Schwab <schwab@suse.de> 1152 1153 * lex.c (search_line_fast) [__ARM_NEON && __ARM_64BIT_STATE]: 1154 Convert 64-bit value to boolean before passing to 1155 __builtin_expect. 1156 11572017-03-16 Jason Merrill <jason@redhat.com> 1158 1159 * init.c (cpp_init_builtins): Update __cplusplus for C++17. 1160 11612017-02-09 Gerald Pfeifer <gerald@pfeifer.com> 1162 1163 * Makefile.in (po/$(PACKAGE).pot): Adjust bug reporting URL. 1164 11652017-01-10 David Malcolm <dmalcolm@redhat.com> 1166 1167 PR c++/77949 1168 * line-map.c (linemap_position_for_column): When calling 1169 linemap_start_line, detect if a new linemap was created with 1170 0 column bits, and bail out early if this is the case. 1171 (linemap_position_for_loc_and_offset): Replace overzealous 1172 linemap_assert_fails with a simple conditional; use correct 1173 bit count. 1174 11752017-01-07 David Malcolm <dmalcolm@redhat.com> 1176 1177 PR c++/72803 1178 * line-map.c (linemap_line_start): When determining if the highest 1179 column given out so far will fit into a proposed change to the 1180 current map, use the effective number of column bits, rather than 1181 the total number of column + range bits. 1182 11832017-01-01 Jakub Jelinek <jakub@redhat.com> 1184 1185 Update copyright years. 1186 11872016-12-15 David Malcolm <dmalcolm@redhat.com> 1188 1189 PR preprocessor/78680 1190 PR preprocessor/78811 1191 * lex.c (_cpp_lex_direct): Only determine the end-location of 1192 the token and build a range for non-reserved start locations. 1193 Do not do it for EOF tokens. 1194 11952016-12-12 David Malcolm <dmalcolm@redhat.com> 1196 1197 PR preprocessor/78680 1198 * lex.c (_cpp_lex_direct): Ensure line notes are processed before 1199 computing the end-point of the token. 1200 12012016-11-23 Paolo Bonzini <bonzini@gnu.org> 1202 1203 * include/cpplib.h (struct cpp_options): Add new member 1204 warn_expansion_to_defined. 1205 (CPP_W_EXPANSION_TO_DEFINED): New enum member. 1206 * expr.c (parse_defined): Warn for all uses of "defined" 1207 in macros, and tie warning to CPP_W_EXPANSION_TO_DEFINED. 1208 Make it a pedwarning instead of a warning. 1209 * system.h (HAVE_DESIGNATED_INITIALIZERS): Do not use 1210 "defined" in macros. 1211 12122016-11-17 David Malcolm <dmalcolm@redhat.com> 1213 1214 * charset.c (cpp_interpret_string_1): Skip locations from 1215 loc_reader when advancing 'p' when handling raw strings. 1216 12172016-11-16 Jakub Jelinek <jakub@redhat.com> 1218 1219 PR bootstrap/72823 1220 * configure.ac (ENABLE_ASSERT_CHECKING): Define if gcc configure 1221 would define that macro. 1222 * configure: Regenerated. 1223 * config.in: Regenerated. 1224 12252016-11-08 Richard Earnshaw <rearnsha@arm.com> 1226 1227 * lex.c (search_line_fast): New implementation for AArch64. 1228 12292016-10-25 David Malcolm <dmalcolm@redhat.com> 1230 1231 * files.c (destroy_cpp_file): Free file->path. 1232 12332016-10-25 David Malcolm <dmalcolm@redhat.com> 1234 1235 * include/line-map.h (line_maps::~line_maps): New dtor. 1236 (location_adhoc_data_fini): Delete decl. 1237 * line-map.c (line_maps::~line_maps): New dtor. 1238 (location_adhoc_data_fini): Delete. 1239 12402016-10-21 Andris Pavenis <andris.pavenis@iki.fi> 1241 1242 PR preprocessor/71681 1243 * files.c (remap_filename): Fix handling -remap in subdirectories. 1244 12452016-10-12 Jakub Jelinek <jakub@redhat.com> 1246 1247 * include/cpplib.h (struct cpp_options): Add 1248 cpp_warn_implicit_fallthrough. 1249 * init.c (cpp_create_reader): Initialize it to 0. 1250 * lex.c (fallthrough_comment_p): Handle different 1251 cpp_warn_implicit_fallthrough levels. Whitespace fixes. 1252 12532016-10-08 Jakub Jelinek <jakub@redhat.com> 1254 1255 * lex.c (fallthrough_comment_p): Accept Else, fallthrough. 1256 1257 * lex.c (fallthrough_comment_p): Extend to handle more common FALLTHRU 1258 comment styles. 1259 1260 * lex.c (fallthrough_comment_p): Fix off-by-one size comparison 1261 errors, cleanup. 1262 (_cpp_lex_direct): Allow arbitrary comments in between 1263 fallthrough_comment_p comment and following token. 1264 12652016-10-04 Kelvin Nilsen <kelvin@gcc.gnu.org> 1266 1267 PR target/77847 1268 * lex.c (search_line_fast): Add a FALLTHROUGH comment to correct 1269 compiler error in the version of this function that is 1270 conditionally compiled when GCC_VERSION >= 4005 and both 1271 __ALTIVEC__ and __BIG_ENDIAN__ symbols are defined. 1272 12732016-09-26 Marek Polacek <polacek@redhat.com> 1274 Jakub Jelinek <jakub@redhat.com> 1275 1276 PR c/7652 1277 * include/cpplib.h (PREV_FALLTHROUGH): Define. 1278 * internal.h (CPP_FALLTHRU): Define. 1279 * lex.c (fallthrough_comment_p): New function. 1280 (_cpp_lex_direct): Set PREV_FALLTHROUGH on tokens succeeding a falls 1281 through comment. 1282 12832016-09-23 David Malcolm <dmalcolm@redhat.com> 1284 1285 PR preprocessor/77672 1286 * charset.c (cpp_interpret_string_1): Add a source_range for the 1287 NUL-terminator, using the location of the trailing quote of the 1288 final string. 1289 12902016-09-21 Jason Merrill <jason@redhat.com> 1291 1292 * line-map.c (linemap_location_from_macro_definition_p): New. 1293 * line-map.h: Declare it. 1294 12952016-09-15 David Malcolm <dmalcolm@redhat.com> 1296 1297 * include/line-map.h (class rich_location): Note that newlines 1298 aren't supported in fix-it text. 1299 * line-map.c (rich_location::add_fixit_insert_before): Reject 1300 attempts to add fix-its containing newlines. 1301 (rich_location::add_fixit_replace): Likewise. 1302 13032016-09-13 David Malcolm <dmalcolm@redhat.com> 1304 1305 * include/line-map.h (class rich_location): Add description of 1306 fix-it hints to leading comment. 1307 (rich_location::add_fixit_insert): Rename both overloaded methods 1308 to.. 1309 (rich_location::add_fixit_insert_before): ...this, updating their 1310 comments. 1311 (rich_location::add_fixit_insert_after): Two new overloaded 1312 methods. 1313 (rich_location::stop_supporting_fixits): New method. 1314 * line-map.c (rich_location::add_fixit_insert): Rename both 1315 overloaded methods to.. 1316 (rich_location::add_fixit_insert_before): ...this, updating their 1317 comments. 1318 (rich_location::add_fixit_insert_after): Two new methods. 1319 (rich_location::reject_impossible_fixit): Split out 1320 failure-handling into... 1321 (rich_location::stop_supporting_fixits): New method. 1322 13232016-09-02 David Malcolm <dmalcolm@redhat.com> 1324 1325 * include/line-map.h (rich_location::seen_impossible_fixit_p): New 1326 accessor. 1327 13282016-08-31 David Malcolm <dmalcolm@redhat.com> 1329 1330 * include/line-map.h (class fixit_remove): Remove stray decl. 1331 (fixit_hint::affects_line_p): Make const. 1332 (fixit_insert::affects_line_p): Likewise. 1333 (fixit_replace::affects_line_p): Likewise. 1334 * line-map.c (fixit_insert::affects_line_p): Likewise. 1335 (fixit_replace::affects_line_p): Likewise. 1336 13372016-08-30 David Malcolm <dmalcolm@redhat.com> 1338 1339 * include/line-map.h (class semi_embedded_vec): New class. 1340 (semi_embedded_vec<T, NUM_EMBEDDED>::semi_embedded_vec): New ctor. 1341 (semi_embedded_vec<T, NUM_EMBEDDED>::~semi_embedded_vec): New 1342 dtor. 1343 (semi_embedded_vec<T, NUM_EMBEDDED>::operator[]): New methods. 1344 (semi_embedded_vec<T, NUM_EMBEDDED>::push): New method. 1345 (semi_embedded_vec<T, NUM_EMBEDDED>::truncate): New method. 1346 (rich_location::get_num_locations): Reimplement in terms of 1347 m_ranges. 1348 (rich_location::get_range): Make non-inline. 1349 (rich_location::get_num_fixit_hints): Reimplement in terms of 1350 m_fixit_hints. 1351 (rich_location::add_fixit): New function. 1352 (rich_location::MAX_RANGES): Rename to... 1353 (rich_location::STATICALLY_ALLOCATED_RANGES): ...this. 1354 (rich_location::MAX_FIXIT_HINTS): Rename to... 1355 (rich_location::STATICALLY_ALLOCATED_RANGES): ...this, and make 1356 private. 1357 (rich_location::m_num_ranges): Eliminate in favor of... 1358 (rich_location::m_ranges): ...this, converting from a fixed-size 1359 array to a semi_embedded_vec. 1360 (rich_location::m_num_fixit_hints): Eliminate in favor of... 1361 (rich_location::m_fixit_hints): ...this, converting from a 1362 fixed-size array to a semi_embedded_vec. 1363 * line-map.c (rich_location::rich_location): Update for above 1364 changes. 1365 (rich_location::~rich_location): Likewise. 1366 (rich_location::get_loc): Likewise. 1367 (rich_location::get_range): New methods. 1368 (rich_location::add_range): Update for above changes. 1369 (rich_location::set_range): Likewise. 1370 (rich_location::add_fixit_insert): Likewise. 1371 (rich_location::add_fixit_replace): Likewise. 1372 (rich_location::get_last_fixit_hint): Likewise. 1373 (rich_location::reject_impossible_fixit): Likewise. 1374 (rich_location::add_fixit): New method. 1375 13762016-08-30 David Malcolm <dmalcolm@redhat.com> 1377 1378 * include/line-map.h (rich_location::add_fixit_insert): Add 1379 comments. Add overload omitting the source_location param. 1380 (rich_location::add_fixit_remove): Add comments. Add overloads 1381 omitting the range, and accepting a source_location. 1382 (rich_location::add_fixit_replace): Likewise. 1383 * line-map.c (rich_location::add_fixit_insert): Add comments. Add 1384 overload omitting the source_location param. 1385 (rich_location::add_fixit_remove): Add comments. Add overloads 1386 omitting the range, and accepting a source_location. 1387 (rich_location::add_fixit_replace): Likewise. 1388 13892016-08-26 David Malcolm <dmalcolm@redhat.com> 1390 1391 * include/line-map.h (get_pure_location): New decl. 1392 * line-map.c (get_pure_location): Move here, from gcc/input.c, adding 1393 a line_maps * param. 1394 (rich_location::add_fixit_insert): Call get_pure_location on "where". 1395 (rich_location::add_fixit_replace): Call get_pure_location on the 1396 end-points. 1397 13982016-08-26 David Malcolm <dmalcolm@redhat.com> 1399 1400 * include/line-map.h (rich_location): Eliminate unimplemented 1401 constructor based on source_range. 1402 (rich_location::get_last_fixit_hint): New method. 1403 (rich_location::reject_impossible_fixit): New method. 1404 (rich_location): Add fields m_line_table and 1405 m_seen_impossible_fixit. 1406 (fixit_hint::maybe_append_replace): New pure virtual function. 1407 (fixit_insert::maybe_append_replace): New function. 1408 (fixit_replace::maybe_append_replace): New function. 1409 * line-map.c (rich_location::rich_location): Initialize 1410 m_line_table and m_seen_impossible_fixit. 1411 (rich_location::add_fixit_insert): Call 1412 reject_impossible_fixit and bail out if true. 1413 (column_before_p): New function. 1414 (rich_location::add_fixit_replace): Call reject_impossible_fixit 1415 and bail out if true. Attempt to consolidate with neighboring 1416 fixits. 1417 (rich_location::get_last_fixit_hint): New method. 1418 (rich_location::reject_impossible_fixit): New method. 1419 (fixit_insert::maybe_append_replace): New method. 1420 (fixit_replace::maybe_append_replace): New method. 1421 14222016-08-23 David Malcolm <dmalcolm@redhat.com> 1423 1424 * include/line-map.h (source_range::from_locations): New method. 1425 14262016-08-19 David Malcolm <dmalcolm@redhat.com> 1427 1428 * include/line-map.h (fixit_hint::kind): Delete REPLACE. 1429 (class fixit_remove): Delete. 1430 * line-map.c (rich_location::add_fixit_remove): Reimplement 1431 by calling add_fixit_replace with an empty string. 1432 (fixit_remove::fixit_remove): Delete. 1433 (fixit_remove::affects_line_p): Delete. 1434 14352016-08-19 Joseph Myers <joseph@codesourcery.com> 1436 1437 PR c/32187 1438 * include/cpplib.h (CPP_N_FLOATN, CPP_N_FLOATNX) 1439 (CPP_N_WIDTH_FLOATN_NX, CPP_FLOATN_SHIFT, CPP_FLOATN_MAX): New 1440 macros. 1441 * expr.c (interpret_float_suffix): Handle fN, fNx, FN and FNx 1442 suffixes. 1443 14442016-08-19 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> 1445 1446 * expr.c (eval_token): Append "evaluates to 0" to Wundef diagnostic. 1447 14482016-08-18 David Malcolm <dmalcolm@redhat.com> 1449 1450 * directives.c (directive_names): New array. 1451 (_cpp_handle_directive): Offer spelling suggestions for misspelled 1452 directives. 1453 * errors.c (cpp_diagnostic_at_richloc): New function. 1454 (cpp_error_at_richloc): New function. 1455 * include/cpplib.h (struct cpp_callbacks): Add field 1456 "get_suggestion". 1457 (cpp_error_at_richloc): New decl. 1458 14592016-08-18 Marek Polacek <polacek@redhat.com> 1460 1461 PR c/7652 1462 * pch.c (write_macdef): Add CPP_FALLTHRU. 1463 14642016-08-12 Marek Polacek <polacek@redhat.com> 1465 1466 PR c/7652 1467 * lex.c (search_line_fast): Add FALLTHRU. 1468 (_cpp_lex_direct): Likewise. 1469 (cpp_token_val_index): Adjust fall through comment. 1470 * macro.c (parse_params): Add FALLTHRU. 1471 * pch.c (count_defs): Adjust fall through comment. 1472 (write_defs): Likewise. 1473 14742016-08-06 David Malcolm <dmalcolm@redhat.com> 1475 1476 PR bootstrap/72823 1477 * charset.c (_cpp_valid_ucn): Replace overzealous assert with one 1478 that allows for char_range to be non-NULL when loc_reader is NULL. 1479 14802016-08-05 David Malcolm <dmalcolm@redhat.com> 1481 1482 * charset.c (cpp_substring_ranges::cpp_substring_ranges): New 1483 constructor. 1484 (cpp_substring_ranges::~cpp_substring_ranges): New destructor. 1485 (cpp_substring_ranges::add_range): New method. 1486 (cpp_substring_ranges::add_n_ranges): New method. 1487 (_cpp_valid_ucn): Add "char_range" and "loc_reader" params; if 1488 they are non-NULL, read position information from *loc_reader 1489 and update char_range->m_finish accordingly. 1490 (convert_ucn): Add "char_range", "loc_reader", and "ranges" 1491 params. If loc_reader is non-NULL, read location information from 1492 it, and update *ranges accordingly, using char_range. 1493 Conditionalize the conversion into tbuf on tbuf being non-NULL. 1494 (convert_hex): Likewise, conditionalizing the call to 1495 emit_numeric_escape on tbuf. 1496 (convert_oct): Likewise. 1497 (convert_escape): Add params "loc_reader" and "ranges". If 1498 loc_reader is non-NULL, read location information from it, and 1499 update *ranges accordingly. Conditionalize the conversion into 1500 tbuf on tbuf being non-NULL. 1501 (cpp_interpret_string): Rename to... 1502 (cpp_interpret_string_1): ...this, adding params "loc_readers" and 1503 "out". Use "to" to conditionalize the initialization and usage of 1504 "tbuf", such as running the converter. If "loc_readers" is 1505 non-NULL, use the instances within it, reading location 1506 information from them, and passing them to convert_escape; likewise 1507 write to "out" if loc_readers is non-NULL. Check for leading 1508 quote and issue an error if it is not present. Update boundary 1509 check from "== limit" to ">= limit" to protect against erroneous 1510 location values to calls that are not parsing string literals. 1511 (cpp_interpret_string): Reimplement in terms to 1512 cpp_interpret_string_1. 1513 (noop_error_cb): New function. 1514 (cpp_interpret_string_ranges): New function. 1515 (cpp_string_location_reader::cpp_string_location_reader): New 1516 constructor. 1517 (cpp_string_location_reader::get_next): New method. 1518 * include/cpplib.h (class cpp_string_location_reader): New class. 1519 (class cpp_substring_ranges): New class. 1520 (cpp_interpret_string_ranges): New prototype. 1521 * internal.h (_cpp_valid_ucn): Add params "char_range" and 1522 "loc_reader". 1523 * lex.c (forms_identifier_p): Pass NULL for new params to 1524 _cpp_valid_ucn. 1525 15262016-08-01 Andreas Schwab <schwab@suse.de> 1527 1528 * include/cpplib.h: Fix comment typo. 1529 15302016-07-27 David Malcolm <dmalcolm@redhat.com> 1531 1532 * include/line-map.h (source_location): Fix line numbers in 1533 comment. 1534 15352016-07-11 David Malcolm <dmalcolm@redhat.com> 1536 1537 * include/line-map.h (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): 1538 Move here from line-map.c. 1539 (LINE_MAP_MAX_LOCATION_WITH_COLS): Likewise. 1540 * line-map.c (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): Move from 1541 here to line-map.h. 1542 (LINE_MAP_MAX_LOCATION_WITH_COLS): Likewise. 1543 15442016-06-22 David Malcolm <dmalcolm@redhat.com> 1545 1546 * directives.c (do_include_common): Pass on "location" to 1547 _cpp_stack_include. 1548 * errors.c (cpp_diagnostic): Reimplement in terms of... 1549 (cpp_diagnostic_at): New function. 1550 (cpp_error_at): New function. 1551 (cpp_errno_filename): Add "loc" param and use it by using 1552 cpp_error_at rather than cpp_error. 1553 * files.c (find_file_in_dir): Add "loc" param and pass it to 1554 open_file_failed. 1555 (_cpp_find_file): Add "loc" param. Use it to convert calls to 1556 cpp_error to cpp_error_at, and pass it to find_file_in_dir and 1557 open_file_failed. 1558 (read_file_guts): Add "loc" param. Use it to convert calls to 1559 cpp_error to cpp_error_at. Pass it to cpp_errno_filename. 1560 (read_file): Add "loc" param. Pass it to open_file_failed and 1561 read_file_guts. 1562 (should_stack_file): Add "loc" param. Pass it to read_file. 1563 (_cpp_stack_file): Add "loc" param. Pass it to should_stack_file. 1564 (_cpp_stack_include): Add "loc" param. Pass it to 1565 _cpp_find_file and _cpp_stack_file. 1566 (open_file_failed): Add "loc" param. Pass it to 1567 cpp_errno_filename. 1568 (_cpp_fake_include): Add 0 as a source_location in call to 1569 _cpp_find_file. 1570 (_cpp_compare_file_date): Likewise. 1571 (cpp_push_include): Likewise for call to _cpp_stack_include. 1572 (cpp_push_default_include): Likewise. 1573 (_cpp_save_file_entries): Likewise for call to open_file_failed. 1574 (_cpp_has_header): Likewise for call to _cpp_find_file. 1575 * include/cpplib.h (cpp_errno_filename): Add source_location 1576 param. 1577 (cpp_error_at): New declaration. 1578 * init.c (cpp_read_main_file): Add 0 as a source_location in calls 1579 to _cpp_find_file and _cpp_stack_file. 1580 * internal.h (_cpp_find_file): Add source_location param. 1581 (_cpp_stack_file): Likewise. 1582 (_cpp_stack_include): Likewise. 1583 15842016-06-22 David Malcolm <dmalcolm@redhat.com> 1585 1586 * include/line-map.h (fixit_hint::get_start_loc): New pure virtual 1587 function. 1588 (fixit_hint::maybe_get_end_loc): Likewise. 1589 (fixit_insert::get_start_loc): New function, implementing 1590 fixit_hint::get_start_loc. 1591 (fixit_insert::maybe_get_end_loc): New function, implementing 1592 fixit_hint::maybe_get_end_loc. 1593 (fixit_remove::get_start_loc): New function, implementing 1594 fixit_hint::get_start_loc. 1595 (fixit_remove::maybe_get_end_loc): New function, implementing 1596 fixit_hint::maybe_get_end_loc. 1597 (fixit_replace::get_start_loc): New function, implementing 1598 fixit_hint::get_start_loc. 1599 (fixit_replace::maybe_get_end_loc): New function, implementing 1600 fixit_hint::maybe_get_end_loc. 1601 16022016-06-21 John David Anglin <danglin@gcc.gnu.org> 1603 1604 * line-map.c (location_adhoc_data_update): Use int64_t instead of 1605 long long. 1606 (get_combined_adhoc_loc): Likewise. 1607 16082016-06-01 Eduard Sanou <dhole@openmailbox.org> 1609 1610 * include/cpplib.h (cpp_callbacks): Add get_source_date_epoch 1611 callback. 1612 * include/cpplib.h (cpp_init_source_date_epoch): Remove prototype. 1613 * init.c (cpp_init_source_date_epoch): Remove function. 1614 * init.c (cpp_create_reader): Initialize pfile->source_date_epoch. 1615 * internal.h (cpp_reader): Extend comment about source_date_epoch. 1616 * macro.c (_cpp_builtin_macro_text): Use get_source_date_epoch 1617 callback only once, read pfile->source_date_epoch on future passes. 1618 Check that get_source_date_epoch callback is not NULL. 1619 16202016-05-20 Martin Liska <mliska@suse.cz> 1621 1622 * config.in: Regenerated. 1623 * configure: Likewise. 1624 * configure.ac: Handle --enable-valgrind-annotations. 1625 * lex.c (new_buff): Use ENABLE_VALGRIND_ANNOTATIONS instead 1626 of ENABLE_VALGRIND_CHECKING. 1627 (_cpp_free_buff): Likewise. 1628 16292016-04-28 Eduard Sanou <dhole@openmailbox.org> 1630 Matthias Klose <doko@debian.org> 1631 1632 * include/cpplib.h (cpp_init_source_date_epoch): Prototype. 1633 * init.c (cpp_init_source_date_epoch): New function. 1634 * internal.h: Added source_date_epoch variable to struct 1635 cpp_reader to store a reproducible date. 1636 * macro.c (_cpp_builtin_macro_text): Set pfile->date timestamp from 1637 pfile->source_date_epoch instead of localtime if source_date_epoch is 1638 set, to be used for __DATE__ and __TIME__ macros to help reproducible 1639 builds. 1640 16412016-04-13 Bernd Schmidt <bschmidt@redhat.com> 1642 1643 Patch from Roger Orr <rogero@howzatt.demon.co.uk> 1644 PR preprocessor/69650 1645 * directives.c (do_linemarker): Reread map after calling 1646 cpp_get_token. 1647 16482016-04-06 Richard Henderson <rth@redhat.com> 1649 1650 PR preprocessor/61817 1651 PR preprocessor/69391 1652 * internal.h (_cpp_builtin_macro_text): Update decl. 1653 * macro.c (_cpp_builtin_macro_text): Accept location for __LINE__. 1654 (builtin_macro): Accept a second location for __LINE__. 1655 (enter_macro_context): Compute both virtual and real expansion 1656 locations for the macro. 1657 16582016-03-25 Bernd Schmidt <bschmidt@redhat.com> 1659 1660 PR lto/69650 1661 * directives.c (do_linemarker): Test for file left but not entered 1662 here. 1663 * line-map.c (linemap_add): Not here. 1664 16652016-03-21 Jakub Jelinek <jakub@redhat.com> 1666 1667 PR target/70296 1668 * include/cpplib.h (cpp_fun_like_macro_p): New prototype. 1669 * macro.c (cpp_fun_like_macro_p): New function. 1670 16712016-03-15 Richard Henderson <rth@redhat.com> 1672 1673 * line-map.c (new_linemap): Make alloc_size a size_t. 1674 16752016-03-14 Jason Merrill <jason@redhat.com> 1676 1677 * expr.c (cpp_classify_number): Hex floats are new in C++1z. 1678 * init.c (lang_defaults): Likewise. 1679 16802016-03-09 David Malcolm <dmalcolm@redhat.com> 1681 1682 PR c/68473 1683 PR c++/70105 1684 * line-map.c (linemap_macro_map_loc_unwind_toward_spelling): Move 1685 decl... 1686 * include/line-map.h 1687 (linemap_macro_map_loc_unwind_toward_spelling): ...here, 1688 converting from static to extern. 1689 16902016-03-09 David Malcolm <dmalcolm@redhat.com> 1691 1692 PR c/68473 1693 PR c++/70105 1694 * include/line-map.h (source_range::debug): Delete. 1695 (struct location_range): Update comment. Replace 1696 expanded_location fields "m_start", "m_finish", and "m_caret" with 1697 a source_location field: "m_loc". 1698 (class rich_location): Reword comment. 1699 (rich_location::get_loc): Reimplement in terms of a new overloaded 1700 variant which takes an unsigned int. 1701 (rich_location::get_loc_addr): Delete. 1702 (rich_location::add_range): Drop params "start" and "finish" in 1703 favor of param "loc". Drop overloaded variants taking a 1704 source_range or location_range *. 1705 (rich_location::lazily_expand_location): Delete in favor of... 1706 (rich_location::get_expanded_location): New decl. 1707 (rich_location::m_loc): Delete field. 1708 (rich_location::m_column_override): New field. 1709 * line-map.c (rich_location::rich_location): Drop name of 1710 line_maps * param. Update initializations for deletion of field 1711 "m_loc" and addition of field "m_column_override". Reimplement 1712 body as a call to add_range. Delete overloaded variant taking a 1713 source_range. 1714 (rich_location::get_loc): New function. 1715 (rich_location::lazily_expand_location): Delete in favor of... 1716 (rich_location::get_expanded_location): New function. 1717 (rich_location::override_column): Reimplement. 1718 (rich_location::add_range): Drop params "start" and "finish" in 1719 favor of param "loc". Eliminate location expansion in favor of 1720 simply storing loc. Drop overloaded variants taking a 1721 source_range or location_range *. 1722 (rich_location::set_range): Eliminate location expansion. 1723 17242016-02-29 David Malcolm <dmalcolm@redhat.com> 1725 1726 PR preprocessor/69985 1727 (linemap_position_for_loc_and_offset): Rename param from "offset" 1728 to "column_offset". Right-shift the column_offset by m_range_bits 1729 of the pertinent ordinary map whenever offsetting a 1730 source_location. For clarity, offset the column by the column 1731 offset, rather than the other way around. 1732 17332016-02-23 David Malcolm <dmalcolm@redhat.com> 1734 1735 PR preprocessor/69126 1736 PR preprocessor/69543 1737 * line-map.c (linemap_compare_locations): At the function top, 1738 replace inlined bodies of get_location_from_adhoc_loc with calls 1739 to get_location_from_adhoc_loc. Add a pair of calls to 1740 get_location_from_adhoc_loc at the bottom of the function, to 1741 avoid meaningless comparisons of ad-hoc and non-ad-hoc locations. 1742 17432016-02-08 David Malcolm <dmalcolm@redhat.com> 1744 1745 PR preprocessor/69664 1746 * errors.c (cpp_diagnostic_with_line): Only call 1747 rich_location::override_column if the column is non-zero. 1748 * line-map.c (rich_location::override_column): Update columns 1749 within m_ranges[0]. Add assertions to verify that doing so is 1750 sane. 1751 17522016-02-05 Jakub Jelinek <jakub@redhat.com> 1753 1754 PR c++/69628 1755 * charset.c (cpp_interpret_charconst): Clear *PCHARS_SEEN 1756 and *UNSIGNEDP if bailing out early due to errors. 1757 17582016-01-28 Jakub Jelinek <jakub@redhat.com> 1759 1760 PR pch/68176 1761 * files.c (_cpp_find_file): Set file->implicit_preinclude even if 1762 included from file->implicit_preinclude header. 1763 1764 * directives.c (destringize_and_run): Adjust prototype. 1765 17662016-01-27 David Malcolm <dmalcolm@redhat.com> 1767 1768 PR preprocessor/69126 1769 * directives.c (destringize_and_run): Add expansion_loc param; use 1770 it when handling unexpanded pragmas to fixup the locations of the 1771 synthesized tokens. 1772 (_cpp_do__Pragma): Add expansion_loc param and use it when calling 1773 destringize_and_run. 1774 * internal.h (_cpp_do__Pragma): Add expansion_loc param. 1775 * macro.c (builtin_macro): Pass expansion location of _Pragma to 1776 _cpp_do__Pragma. 1777 17782016-01-14 David Malcolm <dmalcolm@redhat.com> 1779 1780 PR preprocessor/69177 1781 * line-map.c (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): New 1782 constant. 1783 (LINE_MAP_MAX_LOCATION_WITH_COLS): Add note about unit tests 1784 to comment. 1785 (can_be_stored_compactly_p): Reduce threshold from 1786 LINE_MAP_MAX_LOCATION_WITH_COLS to 1787 LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES. 1788 (get_combined_adhoc_loc): Likewise. 1789 (get_range_from_loc): Likewise. 1790 (linemap_line_start): Ensure that a new ordinary map is created 1791 when transitioning from range-packing being enabled to disabled, 1792 at the LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES threshold. Set 1793 range_bits to 0 for new ordinary maps when beyond this limit. 1794 Prevent the "increase the column bits of a freshly created map" 1795 optimization if the range bits has reduced. 1796 17972016-01-08 Jakub Jelinek <jakub@redhat.com> 1798 1799 PR c++/69145 1800 * files.c (cpp_included_before): If IS_ADHOC_LOC (location), lookup 1801 real location from the line_table. 1802 18032016-01-04 Jakub Jelinek <jakub@redhat.com> 1804 1805 Update copyright years. 1806 18072015-12-22 David Malcolm <dmalcolm@redhat.com> 1808 1809 * line-map.c (get_combined_adhoc_loc): Remove condition 1810 on locus < RESERVED_LOCATION_COUNT when considering 1811 whether a caret == start == finish location can be 1812 simply stored as the caret location. 1813 18142015-12-07 David Malcolm <dmalcolm@redhat.com> 1815 1816 * include/line-map.h (rich_location::set_range): Add line_maps * 1817 param; convert param from source_range to source_location. Drop 1818 "overwrite_loc_p" param. 1819 * line-map.c (rich_location::set_range): Likewise, acting as if 1820 "overwrite_loc_p" were true, and getting range from the location. 1821 18222015-11-20 David Malcolm <dmalcolm@redhat.com> 1823 1824 PR 62314 1825 * include/line-map.h (source_range::intersects_line_p): New 1826 method. 1827 (rich_location::~rich_location): New. 1828 (rich_location::add_fixit_insert): New method. 1829 (rich_location::add_fixit_remove): New method. 1830 (rich_location::add_fixit_replace): New method. 1831 (rich_location::get_num_fixit_hints): New accessor. 1832 (rich_location::get_fixit_hint): New accessor. 1833 (rich_location::MAX_FIXIT_HINTS): New constant. 1834 (rich_location::m_num_fixit_hints): New field. 1835 (rich_location::m_fixit_hints): New field. 1836 (class fixit_hint): New class. 1837 (class fixit_insert): New class. 1838 (class fixit_remove): New class. 1839 (class fixit_replace): New class. 1840 * line-map.c (source_range::intersects_line_p): New method. 1841 (rich_location::rich_location): Add initialization of 1842 m_num_fixit_hints to both ctors. 1843 (rich_location::~rich_location): New. 1844 (rich_location::add_fixit_insert): New method. 1845 (rich_location::add_fixit_remove): New method. 1846 (rich_location::add_fixit_replace): New method. 1847 (fixit_insert::fixit_insert): New. 1848 (fixit_insert::~fixit_insert): New. 1849 (fixit_insert::affects_line_p): New. 1850 (fixit_remove::fixit_remove): New. 1851 (fixit_remove::affects_line_p): New. 1852 (fixit_replace::fixit_replace): New. 1853 (fixit_replace::~fixit_replace): New. 1854 (fixit_replace::affects_line_p): New. 1855 18562015-11-19 Jakub Jelinek <jakub@redhat.com> 1857 1858 PR preprocessor/60736 1859 * include/cpplib.h (cpp_errno_filename): New prototype. 1860 * errors.c (cpp_errno): Don't handle msgid "" specially, use 1861 _(msgid) instead of msgid as argument to cpp_error. 1862 (cpp_errno_filename): New function. 1863 * files.c (read_file_guts): Use cpp_errno_filename instead of 1864 cpp_errno. 1865 (open_file_failed): Likewise. Use file->name if file->path is NULL 1866 in diagnostics. 1867 18682015-11-13 David Malcolm <dmalcolm@redhat.com> 1869 1870 * errors.c (cpp_diagnostic): Pass pfile->line_table to 1871 rich_location ctor. 1872 (cpp_diagnostic_with_line): Likewise. 1873 * include/cpplib.h (struct cpp_token): Update comment for src_loc 1874 to indicate that the range of the token is "baked into" the 1875 source_location. 1876 * include/line-map.h (source_location): Update the descriptive 1877 comment to reflect the packing scheme for short ranges, adding 1878 worked examples of location encoding. 1879 (struct line_map_ordinary): Drop field "column_bits" in favor 1880 of field "m_column_and_range_bits"; add field "m_range_bits". 1881 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete. 1882 (location_adhoc_data): Add source_range field. 1883 (struct line_maps): Add fields "default_range_bits", 1884 "num_optimized_ranges" and "num_unoptimized_ranges". 1885 (get_combined_adhoc_loc): Add source_range param. 1886 (get_range_from_loc): New declaration. 1887 (pure_location_p): New prototype. 1888 (COMBINE_LOCATION_DATA): Add source_range param. 1889 (SOURCE_LINE): Update for renaming of column_bits. 1890 (SOURCE_COLUMN): Likewise. Shift the column right by the map's 1891 range_bits. 1892 (LAST_SOURCE_LINE_LOCATION): Update for renaming of column_bits. 1893 (linemap_position_for_line_and_column): Add line_maps * params. 1894 (rich_location::rich_location): Likewise. 1895 * lex.c (_cpp_lex_direct): Capture the range of the token, baking 1896 it into token->src_loc via a call to COMBINE_LOCATION_DATA. 1897 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER): Reduce from 1U << 17 to 1898 1U << 12. 1899 (location_adhoc_data_hash): Add the src_range into 1900 the hash value. 1901 (location_adhoc_data_eq): Require equality of the src_range 1902 values. 1903 (can_be_stored_compactly_p): New function. 1904 (get_combined_adhoc_loc): Add src_range param, and store it, 1905 via a bit-packing scheme for short ranges, otherwise within the 1906 lookaside table. Remove the requirement that data is non-NULL. 1907 (get_range_from_adhoc_loc): New function. 1908 (get_range_from_loc): New function. 1909 (pure_location_p): New function. 1910 (linemap_add): Ensure that start_location has zero for the 1911 range_bits, unless we're past LINE_MAP_MAX_LOCATION_WITH_COLS. 1912 Initialize range_bits to zero. Assert that the start_location 1913 is "pure". 1914 (linemap_line_start): Assert that the 1915 column_and_range_bits >= range_bits. 1916 Update determinination of whether we need to start a new map 1917 using the effective column bits, without the range bits. 1918 Use the set's default_range_bits in new maps, apart from 1919 those with column_bits == 0, which should also have 0 range_bits. 1920 Increase the column bits for new maps by the range bits. 1921 When adding lines to an existing map, use set->highest_line 1922 directly rather than offsetting highest by SOURCE_COLUMN. 1923 Add assertions to sanity-check the return value. 1924 (linemap_position_for_column): Offset to_column by range_bits. 1925 Update set->highest_location if necessary. 1926 (linemap_position_for_line_and_column): Add line_maps * param. 1927 Update the calculation to offset the column by range_bits, and 1928 conditionalize it on being <= LINE_MAP_MAX_LOCATION_WITH_COLS. 1929 Bound it by LINEMAPS_MACRO_LOWEST_LOCATION. Update 1930 set->highest_location if necessary. 1931 (linemap_position_for_loc_and_offset): Handle ad-hoc locations; 1932 pass "set" to linemap_position_for_line_and_column. 1933 (linemap_macro_map_loc_unwind_toward_spelling): Add line_maps 1934 param. Handle ad-hoc locations. 1935 (linemap_location_in_system_header_p): Pass on "set" to call to 1936 linemap_macro_map_loc_unwind_toward_spelling. 1937 (linemap_macro_loc_to_spelling_point): Retain ad-hoc locations. 1938 Pass on "set" to call to 1939 linemap_macro_map_loc_unwind_toward_spelling. 1940 (linemap_resolve_location): Retain ad-hoc locations. Pass on 1941 "set" to call to linemap_macro_map_loc_unwind_toward_spelling. 1942 (linemap_unwind_toward_expansion): Pass on "set" to call to 1943 linemap_macro_map_loc_unwind_toward_spelling. 1944 (linemap_expand_location): Extract the data pointer before 1945 extracting the location. 1946 (rich_location::rich_location): Add line_maps param; use it to 1947 extract the range from the source_location. 1948 * location-example.txt: Regenerate, showing new representation. 1949 19502015-11-06 David Malcolm <dmalcolm@redhat.com> 1951 1952 * errors.c (cpp_diagnostic): Update for change in signature 1953 of "error" callback. 1954 (cpp_diagnostic_with_line): Likewise, calling override_column 1955 on the rich_location. 1956 * include/cpplib.h (struct cpp_callbacks): Within "error" 1957 callback, convert param from source_location to rich_location *, 1958 and drop column_override param. 1959 * include/line-map.h (struct source_range): New struct. 1960 (struct location_range): New struct. 1961 (class rich_location): New class. 1962 (linemap_client_expand_location_to_spelling_point): New declaration. 1963 * line-map.c (rich_location::rich_location): New ctors. 1964 (rich_location::lazily_expand_location): New method. 1965 (rich_location::override_column): New method. 1966 (rich_location::add_range): New methods. 1967 (rich_location::set_range): New method. 1968 19692015-11-06 David Malcolm <dmalcolm@redhat.com> 1970 1971 * include/line-map.h (struct linemap_stats): Add fields 1972 "adhoc_table_size" and "adhoc_table_entries_used". 1973 * line-map.c (linemap_get_statistics): Populate above fields. 1974 19752015-11-04 Mikhail Maltsev <maltsevm@gmail.com> 1976 1977 * config.in: Regenerate. 1978 * configure: Regenerate. 1979 * configure.ac: Remove ENABLE_CHECKING. 1980 19812015-11-03 Uros Bizjak <ubizjak@gmail.com> 1982 1983 * lex.c (search_line_sse42): Correctly advance the pointer to an 1984 aligned address. 1985 19862015-11-02 David Malcolm <dmalcolm@redhat.com> 1987 1988 * include/line-map.h (source_location): In the table in the 1989 descriptive comment, show UNKNOWN_LOCATION, BUILTINS_LOCATION, 1990 LINE_MAP_MAX_LOCATION_WITH_COLS, LINE_MAP_MAX_SOURCE_LOCATION. 1991 Add notes about ad-hoc values. 1992 19932015-10-21 Mikhail Maltsev <maltsevm@gmail.com> 1994 1995 * include/line-map.h: Use CHECKING_P instead of ENABLE_CHECKING. 1996 * init.c: Likewise. 1997 * macro.c (struct macro_arg_token_iter, set_arg_token, 1998 macro_arg_token_iter_init, macro_arg_token_iter_forward, 1999 macro_arg_token_iter_get_token, macro_arg_token_iter_get_location, 2000 alloc_expanded_arg_mem, _cpp_backup_tokens): Likewise. 2001 2002 * config.in: Regenerate. 2003 * configure: Regenerate. 2004 * configure.ac (CHECKING_P): Define. 2005 * system.h (fancy_abort): Declare. 2006 (abort): Define. 2007 (gcc_assert): Define. Use CHECKING_P. 2008 20092015-10-13 Mikhail Maltsev <maltsevm@gmail.com> 2010 2011 * system.h (CHECKING_P, gcc_checking_assert): Define. 2012 20132015-09-21 Manuel López-Ibáñez <manu@gcc.gnu.org> 2014 2015 PR c/66415 2016 * line-map.c (linemap_position_for_loc_and_offset): Handle the 2017 case of long lines encoded in multiple maps. 2018 20192015-09-07 Marek Polacek <polacek@redhat.com> 2020 2021 * system.h (INTTYPE_MINIMUM): Rewrite to avoid shift warning. 2022 20232015-08-06 Yaakov Selkowitz <yselkowi@redhat.com> 2024 2025 * configure: Regenerate. 2026 20272015-07-08 Thomas Schwinge <thomas@codesourcery.com> 2028 2029 * include/line-map.h (RESERVED_LOCATION_COUNT): Change type to 2030 source_location. 2031 20322015-07-02 Paolo Carlini <paolo.carlini@oracle.com> 2033 2034 PR preprocessor/53690 2035 * charset.c (_cpp_valid_ucn): Add cppchar_t * parameter and change 2036 return type to bool. Fix encoding of \u0000 and \U00000000 in C++. 2037 (convert_ucn): Adjust call. 2038 * lex.c (forms_identifier_p): Likewise. 2039 * internal.h (_cpp_valid_ucn): Adjust declaration. 2040 20412015-06-30 Edward Smith-Rowland <3dw4rd@verizon.net> 2042 2043 Implement N4197 - Adding u8 character literals 2044 * include/cpplib.h (UTF8CHAR, UTF8CHAR_USERDEF): New cpp tokens; 2045 (struct cpp_options): Add utf8_char_literals. 2046 * init.c (struct lang_flags): Add utf8_char_literals; 2047 (struct lang_flags lang_defaults): Add column for utf8_char_literals. 2048 * macro.c (stringify_arg()): Treat CPP_UTF8CHAR token; 2049 * expr.c (cpp_userdef_char_remove_type(), cpp_userdef_char_add_type()): 2050 Treat CPP_UTF8CHAR_USERDEF, CPP_UTF8CHAR tokens; 2051 (cpp_userdef_char_p()): Treat CPP_UTF8CHAR_USERDEF token; 2052 (eval_token(), _cpp_parse_expr()): Treat CPP_UTF8CHAR token. 2053 * lex.c (lex_string(), _cpp_lex_direct()): Include CPP_UTF8CHAR tokens. 2054 * charset.c (converter_for_type(), cpp_interpret_charconst()): 2055 Treat CPP_UTF8CHAR token. 2056 20572015-06-30 Uros Bizjak <ubizjak@gmail.com> 2058 2059 * lex.c (search_line_sse42) [__GCC_ASM_FLAG_OUTPUTS__]: New main 2060 loop using asm flag outputs. 2061 20622015-06-08 Marek Polacek <polacek@redhat.com> 2063 2064 PR c/66415 2065 * line-map.c (linemap_position_for_loc_and_offset): Remove 2066 linemap_assert_fails; reverse conditions. 2067 20682015-05-26 Manuel López-Ibáñez <manu@gcc.gnu.org> 2069 2070 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER 2071 LINE_MAP_MAX_LOCATION_WITH_COLS,LINE_MAP_MAX_SOURCE_LOCATION): 2072 New constants. 2073 (linemap_line_start): Use them. 2074 (linemap_position_for_column): Use them. 2075 20762015-05-20 David Malcolm <dmalcolm@redhat.com> 2077 2078 * include/line-map.h (MAP_START_LOCATION): Eliminate the non-const 2079 variant, and tweak comment for the const variant. 2080 (ORDINARY_MAP_STARTING_LINE_NUMBER): Drop the non-const variant. 2081 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise. 2082 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise. 2083 (SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete. 2084 (ORDINARY_MAP_FILE_NAME): Drop the non-const variant. 2085 (MACRO_MAP_MACRO): Likewise. 2086 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise. 2087 (MACRO_MAP_LOCATIONS): Likewise. 2088 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise. 2089 * line-map.c (linemap_add): Replace writes through macros with 2090 direct field accesses. 2091 (linemap_enter_macro): Likewise. 2092 (linemap_line_start): Likewise. 2093 20942015-05-19 David Malcolm <dmalcolm@redhat.com> 2095 2096 * directives.c (do_line): Strengthen local "map" from 2097 const line_map * to const line_map_ordinary *. 2098 (do_linemarker): Likewise. 2099 (_cpp_do_file_change): Assert that we're not dealing with 2100 a macro map. Introduce local "ord_map" via a call to 2101 linemap_check_ordinary, guarded within the check for 2102 non-NULL. Use it for typesafety. 2103 * files.c (cpp_make_system_header): Strengthen local "map" from 2104 const line_map * to const line_map_ordinary *. 2105 * include/cpplib.h (struct cpp_callbacks): Likewise for second 2106 parameter of "file_change" callback. 2107 * include/line-map.h (struct line_map): Convert from a struct 2108 containing a union to a base class. 2109 (struct line_map_ordinary): Convert to a subclass of line_map. 2110 (struct line_map_macro): Likewise. 2111 (linemap_check_ordinary): Strengthen return type from line_map * 2112 to line_map_ordinary *, and add a const-variant. 2113 (linemap_check_macro): New pair of functions. 2114 (ORDINARY_MAP_STARTING_LINE_NUMBER): Strengthen param from 2115 const line_map * to const line_map_ordinary *, eliminating call 2116 to linemap_check_ordinary. Likewise for the non-const variant. 2117 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise. 2118 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise. 2119 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Likewise. 2120 (ORDINARY_MAP_FILE_NAME): Likewise. 2121 (MACRO_MAP_MACRO): Strengthen param from const line_map * to 2122 const line_map_macro *. Likewise for the non-const variant. 2123 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise. 2124 (MACRO_MAP_LOCATIONS): Likewise. 2125 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise. 2126 (struct maps_info): Replace with... 2127 (struct maps_info_ordinary):...this and... 2128 (struct maps_info_macro): ...this. 2129 (struct line_maps): Convert fields "info_ordinary" and 2130 "info_macro" to the above new structs. 2131 (LINEMAPS_MAP_INFO): Delete both functions. 2132 (LINEMAPS_MAPS): Likewise. 2133 (LINEMAPS_ALLOCATED): Rewrite both variants to avoid using 2134 LINEMAPS_MAP_INFO. 2135 (LINEMAPS_USED): Likewise. 2136 (LINEMAPS_CACHE): Likewise. 2137 (LINEMAPS_MAP_AT): Likewise. 2138 (LINEMAPS_ORDINARY_MAPS): Strengthen return type from line_map * 2139 to line_map_ordinary *. 2140 (LINEMAPS_ORDINARY_MAP_AT): Likewise. 2141 (LINEMAPS_LAST_ORDINARY_MAP): Likewise. 2142 (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise. 2143 (LINEMAPS_MACRO_MAPS): Strengthen return type from line_map * to 2144 line_map_macro *. 2145 (LINEMAPS_MACRO_MAP_AT): Likewise. 2146 (LINEMAPS_LAST_MACRO_MAP): Likewise. 2147 (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise. 2148 (linemap_map_get_macro_name): Strengthen param from 2149 const line_map * to const line_map_macro *. 2150 (SOURCE_LINE): Strengthen first param from const line_map * to 2151 const line_map_ordinary *, removing call to 2152 linemap_check_ordinary. 2153 (SOURCE_COLUMN): Likewise. 2154 (LAST_SOURCE_LINE_LOCATION): Likewise. 2155 (LAST_SOURCE_LINE): Strengthen first param from const line_map * 2156 to const line_map_ordinary *. 2157 (LAST_SOURCE_COLUMN): Likewise. 2158 (INCLUDED_FROM): Strengthen return type from line_map * to 2159 line_map_ordinary *., and second param from const line_map * 2160 to const line_map_ordinary *, removing call to 2161 linemap_check_ordinary. 2162 (MAIN_FILE_P): Strengthen param from const line_map * to 2163 const line_map_ordinary *, removing call to 2164 linemap_check_ordinary. 2165 (linemap_position_for_line_and_column): Strengthen param from 2166 const line_map * to const line_map_ordinary *. 2167 (LINEMAP_FILE): Strengthen param from const line_map * to 2168 const line_map_ordinary *, removing call to 2169 linemap_check_ordinary. 2170 (LINEMAP_LINE): Likewise. 2171 (LINEMAP_SYSP): Likewise. 2172 (linemap_resolve_location): Strengthen final param from 2173 const line_map ** to const line_map_ordinary **. 2174 * internal.h (CPP_INCREMENT_LINE): Likewise for local "map". 2175 (linemap_enter_macro): Strengthen return type from 2176 const line_map * to const line_map_macro *. 2177 (linemap_add_macro_token): Likewise for first param. 2178 * line-map.c (linemap_check_files_exited): Strengthen local "map" 2179 from const line_map * to const line_map_ordinary *. 2180 (new_linemap): Introduce local "map_size" and use it when 2181 calculating how large the buffer should be. Rewrite based 2182 on change of info_macro and info_ordinary into distinct types. 2183 (linemap_add): Strengthen locals "map" and "from" from line_map * 2184 to line_map_ordinary *. 2185 (linemap_enter_macro): Strengthen return type from 2186 const line_map * to const line_map_macro *, and local "map" from 2187 line_map * to line_map_macro *. 2188 (linemap_add_macro_token): Strengthen param "map" from 2189 const line_map * to const line_map_macro *. 2190 (linemap_line_start): Strengthen local "map" from line_map * to 2191 line_map_ordinary *. 2192 (linemap_position_for_column): Likewise. 2193 (linemap_position_for_line_and_column): Strengthen first param 2194 from const line_map * to const line_map_ordinary *. 2195 (linemap_position_for_loc_and_offset): Strengthen local "map" from 2196 const line_map * to const line_map_ordinary *. 2197 (linemap_ordinary_map_lookup): Likewise for return type and locals 2198 "cached" and "result". 2199 (linemap_macro_map_lookup): Strengthen return type and locals 2200 "cached" and "result" from const line_map * to 2201 const line_map_macro *. 2202 (linemap_macro_map_loc_to_exp_point): Likewise for param "map". 2203 (linemap_macro_map_loc_to_def_point): Likewise. 2204 (linemap_macro_map_loc_unwind_toward_spelling): Likewise. 2205 (linemap_get_expansion_line): Strengthen local "map" from 2206 const line_map * to const line_map_ordinary *. 2207 (linemap_get_expansion_filename): Likewise. 2208 (linemap_map_get_macro_name): Strengthen param from 2209 const line_map * to const line_map_macro *. 2210 (linemap_location_in_system_header_p): Add call to 2211 linemap_check_ordinary in region guarded by 2212 !linemap_macro_expansion_map_p. Introduce local "macro_map" via 2213 linemap_check_macro in other region, using it in place of "map" 2214 for typesafety. 2215 (first_map_in_common_1): Add calls to linemap_check_macro. 2216 (trace_include): Strengthen param "map" from const line_map * to 2217 const line_map_ordinary *. 2218 (linemap_macro_loc_to_spelling_point): Strengthen final param from 2219 const line_map ** to const line_map_ordinary **. Replace a 2220 C-style cast with a const_cast, and add calls to 2221 linemap_check_macro and linemap_check_ordinary. 2222 (linemap_macro_loc_to_def_point): Likewise. 2223 (linemap_macro_loc_to_exp_point): Likewise. 2224 (linemap_resolve_location): Strengthen final param from 2225 const line_map ** to const line_map_ordinary **. 2226 (linemap_unwind_toward_expansion): Introduce local "macro_map" via 2227 a checked cast and use it in place of *map. 2228 (linemap_unwind_to_first_non_reserved_loc): Strengthen local 2229 "map1" from const line_map * to const line_map_ordinary *. 2230 (linemap_expand_location): Introduce local "ord_map" via a checked 2231 cast and use it in place of map. 2232 (linemap_dump): Make local "map" const. Strengthen local 2233 "includer_map" from line_map * to const line_map_ordinary *. 2234 Introduce locals "ord_map" and "macro_map" via checked casts and 2235 use them in place of "map" for typesafety. 2236 (linemap_dump_location): Strengthen local "map" from 2237 const line_map * to const line_map_ordinary *. 2238 (linemap_get_file_highest_location): Update for elimination of 2239 union. 2240 (linemap_get_statistics): Strengthen local "cur_map" from 2241 line_map * to const line_map_macro *. Update uses of sizeof to 2242 use the appropriate line_map subclasses. 2243 * macro.c (_cpp_warn_if_unused_macro): Add call to 2244 linemap_check_ordinary. 2245 (builtin_macro): Strengthen local "map" from const line_map * to 2246 const line_map_macro *. 2247 (enter_macro_context): Likewise. 2248 (replace_args): Likewise. 2249 (tokens_buff_put_token_to): Likewise for param "map". 2250 (tokens_buff_add_token): Likewise. 2251 22522015-05-13 David Malcolm <dmalcolm@redhat.com> 2253 2254 * include/line-map.h (source_location): Add a reference to 2255 location-example.txt to the descriptive comment. 2256 * location-example.txt: New file. 2257 22582015-05-13 David Malcolm <dmalcolm@redhat.com> 2259 2260 * include/line-map.h (MAX_SOURCE_LOCATION): Convert from a macro 2261 to a const source_location. 2262 (RESERVED_LOCATION_COUNT): Likewise. 2263 (linemap_check_ordinary): Convert from a macro to a pair of inline 2264 functions, for const/non-const arguments. 2265 (MAP_START_LOCATION): Likewise. 2266 (ORDINARY_MAP_STARTING_LINE_NUMBER): Likewise. 2267 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise. 2268 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise. 2269 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Convert from a macro to a 2270 pair of inline functions, for const/non-const arguments, where the 2271 latter is named... 2272 (SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): New function. 2273 (ORDINARY_MAP_FILE_NAME): Convert from a macro to a pair of inline 2274 functions, for const/non-const arguments. 2275 (MACRO_MAP_MACRO): Likewise. 2276 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise. 2277 (MACRO_MAP_LOCATIONS): Likewise. 2278 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise. 2279 (LINEMAPS_MAP_INFO): Likewise. 2280 (LINEMAPS_MAPS): Likewise. 2281 (LINEMAPS_ALLOCATED): Likewise. 2282 (LINEMAPS_USED): Likewise. 2283 (LINEMAPS_CACHE): Likewise. 2284 (LINEMAPS_ORDINARY_CACHE): Likewise. 2285 (LINEMAPS_MACRO_CACHE): Likewise. 2286 (LINEMAPS_MAP_AT): Convert from a macro to an inline function. 2287 (LINEMAPS_LAST_MAP): Likewise. 2288 (LINEMAPS_LAST_ALLOCATED_MAP): Likewise. 2289 (LINEMAPS_ORDINARY_MAPS): Likewise. 2290 (LINEMAPS_ORDINARY_MAP_AT): Likewise. 2291 (LINEMAPS_ORDINARY_ALLOCATED): Likewise. 2292 (LINEMAPS_ORDINARY_USED): Likewise. 2293 (LINEMAPS_LAST_ORDINARY_MAP): Likewise. 2294 (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise. 2295 (LINEMAPS_MACRO_MAPS): Likewise. 2296 (LINEMAPS_MACRO_MAP_AT): Likewise. 2297 (LINEMAPS_MACRO_ALLOCATED): Likewise. 2298 (LINEMAPS_MACRO_USED): Likewise. 2299 (LINEMAPS_MACRO_LOWEST_LOCATION): Likewise. 2300 (LINEMAPS_LAST_MACRO_MAP): Likewise. 2301 (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise. 2302 (IS_ADHOC_LOC): Likewise. 2303 (COMBINE_LOCATION_DATA): Likewise. 2304 (SOURCE_LINE): Likewise. 2305 (SOURCE_COLUMN): Likewise. 2306 (LAST_SOURCE_LINE_LOCATION): Likewise. 2307 (LAST_SOURCE_LINE): Likewise. 2308 (LAST_SOURCE_COLUMN): Likewise. 2309 (LAST_SOURCE_LINE_LOCATION) 2310 (INCLUDED_FROM): Likewise. 2311 (MAIN_FILE_P): Likewise. 2312 (LINEMAP_FILE): Likewise. 2313 (LINEMAP_LINE): Likewise. 2314 (LINEMAP_SYSP): Likewise. 2315 (linemap_location_before_p): Likewise. 2316 * line-map.c (linemap_check_files_exited): Make local "map" const. 2317 (linemap_add): Use SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS. 2318 (linemap_line_start): Likewise. 2319 23202015-05-13 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com> 2321 2322 * aclocal.m4: Regenerated with automake-1.11.6. 2323 23242015-05-13 David Malcolm <dmalcolm@redhat.com> 2325 2326 * include/line-map.h (linemap_assert): Move up within the file to 2327 before all of the map accessor macros. 2328 (linemap_assert_fails): Likewise. 2329 (linemap_check_ordinary): Likewise. 2330 (linemap_macro_expansion_map_p): Likewise. 2331 23322015-05-12 David Malcolm <dmalcolm@redhat.com> 2333 2334 * directives.c (do_line): Set seen_line_directive on line_table. 2335 (do_linemarker): Likewise. 2336 * include/line-map.h (struct line_maps): Add new field 2337 "seen_line_directive". 2338 23392015-05-08 Jason Merrill <jason@redhat.com> 2340 2341 * include/cpplib.h: Add CPP_W_CXX11_COMPAT. 2342 (struct cpp_options): Add cpp_warn_cxx11_compat. 2343 * init.c (cpp_create_reader): Initialize it. 2344 * lex.c (lex_string): Add -Wc++11-compat warning. 2345 23462015-05-05 David Malcolm <dmalcolm@redhat.com> 2347 2348 * pch.c (cpp_valid_state): Fix indentation so that it reflects the 2349 block structure. 2350 23512015-05-05 David Malcolm <dmalcolm@redhat.com> 2352 2353 * include/line-map.h: Fix comment at the top of the file. 2354 (source_location): Rewrite and expand the comment for this 2355 typedef, adding an ascii-art table to clarify how source_location 2356 values are allocated. 2357 * line-map.c: Fix comment at the top of the file. 2358 23592015-04-09 Richard Biener <rguenther@suse.de> 2360 2361 PR pch/65550 2362 * files.c (pch_open_file): Allow main and pre-included files 2363 when trying to open a PCH. 2364 23652015-04-06 Jakub Jelinek <jakub@redhat.com> 2366 2367 PR preprocessor/61977 2368 * lex.c (cpp_peek_token): If peektok is CPP_EOF, back it up 2369 with all tokens peeked by the current function. 2370 23712015-04-02 Jakub Jelinek <jakub@redhat.com> 2372 2373 PR preprocessor/61977 2374 * lex.c (cpp_peek_token): Temporarily clear pfile->cb.line_change. 2375 23762015-03-23 Jakub Jelinek <jakub@redhat.com> 2377 2378 PR preprocessor/65238 2379 * internal.h (_cpp_scan_out_logical_line): Add third argument. 2380 * directives.c (prepare_directive_trad): Pass false to it. 2381 * traditional.c (_cpp_read_logical_line_trad, 2382 _cpp_create_trad_definition): Likewise. 2383 (struct fun_macro): Add paramc field. 2384 (fun_like_macro): New function. 2385 (maybe_start_funlike): Handle NODE_BUILTIN macros. Initialize 2386 macro->paramc field. 2387 (save_argument): Use macro->paramc instead of 2388 macro->node->value.macro->paramc. 2389 (push_replacement_text): Formatting fix. 2390 (recursive_macro): Use fun_like_macro helper. 2391 (_cpp_scan_out_logical_line): Likewise. Add BUILTIN_MACRO_ARG 2392 argument. Initialize fmacro.paramc field. Handle builtin 2393 function-like macros. 2394 23952015-03-16 Edward Smith-Rowland <3dw4rd@verizon.net> 2396 2397 PR c++/64626 2398 * lex.c (lex_number): If a number ends with digit-seps (') skip back 2399 and let lex_string take them. 2400 24012015-03-02 Markus Trippelsdorf <markus@trippelsdorf.de> 2402 2403 PR target/65261 2404 * lex.c (search_line_fast): Silence ubsan errors. 2405 24062015-02-03 <dodji@redhat.com> 2407 2408 PR preprocessor/64803 2409 * internal.h (cpp_reader::top_most_macro_node): New data member. 2410 * macro.c (enter_macro_context): Pass the location of the end of 2411 the top-most invocation of the function-like macro, or the 2412 location of the expansion point of the top-most object-like macro. 2413 (cpp_get_token_1): Store the top-most macro node in the new 2414 pfile->top_most_macro_node data member. 2415 (_cpp_pop_context): Clear the new cpp_reader::top_most_macro_node 2416 data member. 2417 24182015-01-30 Szabolcs Nagy <szabolcs.nagy@arm.com> 2419 2420 * lex.c (search_line_fast): Change __ARM_NEON__ to __ARM_NEON. 2421 24222015-01-23 Marek Polacek <polacek@redhat.com> 2423 2424 DR#412 2425 PR preprocessor/60570 2426 * directives.c (do_elif): Don't evaluate #elif conditionals 2427 when they don't need to be. 2428 24292015-01-16 Jakub Jelinek <jakub@redhat.com> 2430 2431 * expr.c (cpp_classify_number): Add N_() around ?: string 2432 literals used in cpp_error_with_line call as format string. 2433 24342015-01-05 Jakub Jelinek <jakub@redhat.com> 2435 2436 Update copyright years. 2437 24382014-12-19 Jakub Jelinek <jakub@redhat.com> 2439 2440 PR preprocessor/63831 2441 * directives.c (lex_macro_node): Remove __has_attribute__ handling. 2442 * internal.h (struct spec_node): Remove n__has_attribute__ field. 2443 (struct lexer_state): Remove in__has_attribute__ field. 2444 * macro.c (_cpp_builtin_macro_text): Handle BT_HAS_ATTRIBUTE. 2445 * identifiers.c (_cpp_init_hashtable): Remove __has_attribute__ 2446 handling. 2447 * init.c (builtin_array): Add __has_attribute and __has_cpp_attribute. 2448 (cpp_init_special_builtins): Don't initialize __has_attribute 2449 or __has_cpp_attribute if CLK_ASM or pfile->cb.has_attribute is NULL. 2450 * traditional.c (enum ls): Remove ls_has_attribute, 2451 ls_has_attribute_close. 2452 (_cpp_scan_out_logical_line): Remove __has_attribute__ handling. 2453 * include/cpplib.h (enum cpp_builtin_type): Add BT_HAS_ATTRIBUTE. 2454 * pch.c (cpp_read_state): Remove __has_attribute__ handling. 2455 * expr.c (eval_token): Likewise. 2456 (parse_has_attribute): Removed. 2457 24582014-12-11 Uros Bizjak <ubizjak@gmail.com> 2459 2460 * directives.c (cpp_define_formatted): Use xvasprintf. 2461 24622014-12-05 Manuel López-Ibáñez <manu@gcc.gnu.org> 2463 2464 * line-map.c (linemap_position_for_loc_and_offset): Add new 2465 linemap_assert_fails. 2466 24672014-12-02 Manuel López-Ibáñez <manu@gcc.gnu.org> 2468 2469 * include/line-map.h (linemap_assert_fails): Declare. 2470 * line-map.c (linemap_position_for_loc_and_offset): Use it. 2471 24722014-12-02 Manuel López-Ibáñez <manu@gcc.gnu.org> 2473 2474 * line-map.c (linemap_add): Fix typo. 2475 (linemap_line_start): Fix whitespace. 2476 24772014-11-29 John Schmerge <jbschmerge@gmail.com> 2478 2479 PR preprocessor/41698 2480 * charset.c (one_utf8_to_utf16): Do not produce surrogate pairs 2481 for 0xffff. 2482 24832014-11-25 Jakub Jelinek <jakub@redhat.com> 2484 2485 PR preprocessor/60436 2486 * line-map.c (linemap_line_start): If highest is above 0x60000000 2487 and we are still tracking columns or highest is above 0x70000000, 2488 force add_map. 2489 24902014-11-20 Uros Bizjak <ubizjak@gmail.com> 2491 2492 PR target/63966 2493 * lex.c [__i386__ || __x86_64__]: Compile special SSE functions 2494 only for (__GNUC__ >= 5 || !defined(__PIC__)). 2495 24962014-11-13 Manuel López-Ibáñez <manu@gcc.gnu.org> 2497 2498 * include/line-map.h: Include EXPR, so that unused variable warnings 2499 do not occur. 2500 25012014-11-11 Manuel López-Ibáñez <manu@gcc.gnu.org> 2502 2503 PR fortran/44054 2504 * include/line-map.h (linemap_position_for_loc_and_offset): 2505 Declare. 2506 * line-map.c (linemap_position_for_loc_and_offset): New. 2507 25082014-11-11 David Malcolm <dmalcolm@redhat.com> 2509 2510 * ChangeLog.jit: New. 2511 25122014-11-10 Edward Smith-Rowland <3dw4rd@verizon.net> 2513 2514 * include/cpplib.h (cpp_callbacks): Add has_attribute. 2515 * internal.h (lexer_state): Add in__has_attribute__. 2516 * directives.c (lex_macro_node): Prevent use of __has_attribute__ 2517 as a macro. 2518 * expr.c (parse_has_attribute): New function; (eval_token): Look for 2519 __has_attribute__ and route to parse_has_attribute. 2520 * identifiers.c (_cpp_init_hashtable): Initialize n__has_attribute__. 2521 * pch.c (cpp_read_state): Initialize n__has_attribute__. 2522 * traditional.c (enum ls): Add ls_has_attribute, ls_has_attribute_close; 2523 (_cpp_scan_out_logical_line): Attend to __has_attribute__. 2524 25252014-11-06 Joseph Myers <joseph@codesourcery.com> 2526 2527 * include/cpp-id-data.h (struct cpp_macro): Update comment 2528 regarding parameters. 2529 * include/cpplib.h (struct cpp_macro_arg, struct cpp_identifier): 2530 Add spelling fields. 2531 (struct cpp_token): Update comment on macro_arg. 2532 * internal.h (_cpp_save_parameter): Add extra argument. 2533 (_cpp_spell_ident_ucns): New declaration. 2534 * lex.c (lex_identifier): Add SPELLING argument. Set *SPELLING to 2535 original spelling of identifier. 2536 (_cpp_lex_direct): Update calls to lex_identifier. 2537 (_cpp_spell_ident_ucns): New function, factored out of 2538 cpp_spell_token. 2539 (cpp_spell_token): Adjust FORSTRING argument semantics to return 2540 original spelling of identifiers. Use _cpp_spell_ident_ucns in 2541 !FORSTRING case. 2542 (_cpp_equiv_tokens): Check spellings of identifiers and macro 2543 arguments are identical. 2544 * macro.c (macro_arg_saved_data): New structure. 2545 (paste_tokens): Use original spellings of identifiers from 2546 cpp_spell_token. 2547 (_cpp_save_parameter): Add argument SPELLING. Save both canonical 2548 node and its value. 2549 (parse_params): Update calls to _cpp_save_parameter. 2550 (lex_expansion_token): Save spelling of macro argument tokens. 2551 (_cpp_create_definition): Extract canonical node from saved data. 2552 (cpp_macro_definition): Use UCNs in spelling of macro name. Use 2553 original spellings of macro argument tokens and identifiers. 2554 * traditional.c (scan_parameters): Update call to 2555 _cpp_save_parameter. 2556 25572014-11-05 Joseph Myers <joseph@codesourcery.com> 2558 2559 PR preprocessor/9449 2560 * init.c (lang_defaults): Enable extended identifiers for C++ and 2561 C99-based standards. 2562 25632014-10-22 Alan Modra <amodra@gmail.com> 2564 2565 * symtab.c (ht_create): Use obstack_specify_allocation in place of 2566 _obstack_begin. 2567 * files.c (_cpp_init_files): Likewise. 2568 * init.c (cpp_create_reader): Likewise. 2569 * identifiers.c (_cpp_init_hashtable): Likewise. 2570 25712014-10-14 Manuel López-Ibáñez <manu@gcc.gnu.org> 2572 2573 * include/line-map.h (linemap_location_from_macro_expansion_p): 2574 const struct line_maps * argument. 2575 (linemap_position_for_line_and_column): const struct line_map * 2576 argument. 2577 * line-map.c (linemap_add_macro_token): Use correct argument name 2578 in comment. 2579 (linemap_position_for_line_and_column): const struct line_map * 2580 argument. 2581 (linemap_macro_map_loc_to_def_point): Fix comment. Make static. 2582 (linemap_location_from_macro_expansion_p): const struct line_maps * 2583 argument. 2584 (linemap_resolve_location): Fix argument names in comment. 2585 25862014-10-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> 2587 2588 * lex.c (search_line_fast): Add new version to be used for Power8 2589 and later targets when Altivec is enabled. Restrict the existing 2590 Altivec version to big-endian systems so that lvsr is not used on 2591 little endian, where it is deprecated. Remove LE-specific code 2592 from the now-BE-only version. 2593 25942014-10-02 Bernd Edlinger <bernd.edlinger@hotmail.de> 2595 Jeff Law <law@redhat.com> 2596 2597 * charset.c (convert_no_conversion): Reallocate memory with 25% 2598 headroom. 2599 26002014-10-01 Edward Smith-Rowland <3dw4rd@verizon.net> 2601 2602 Implement SD-6: SG10 Feature Test Recommendations 2603 * internal.h (lexer_state, spec_nodes): Add in__has_include__. 2604 * directives.c: Support __has_include__ builtin. 2605 * expr.c (parse_has_include): New function to parse __has_include__ 2606 builtin; (eval_token()): Use it. 2607 * files.c (_cpp_has_header()): New funtion to look for header; 2608 (open_file_failed()): Not an error to not find a header file for 2609 __has_include__. 2610 * identifiers.c (_cpp_init_hashtable()): Add entry for __has_include__. 2611 * pch.c (cpp_read_state): Lookup __has_include__. 2612 * traditional.c (enum ls, _cpp_scan_out_logical_line()): Walk through 2613 __has_include__ statements. 2614 26152014-09-30 Bernd Edlinger <bernd.edlinger@hotmail.de> 2616 2617 PR preprocessor/58893 2618 * errors.c (cpp_diagnostic): Fix possible out of bounds access. 2619 * files.c (_cpp_stack_include): Initialize src_loc for IT_CMDLINE. 2620 26212014-09-24 Marek Polacek <polacek@redhat.com> 2622 2623 PR c/61405 2624 PR c/53874 2625 * include/cpplib.h (enum cpp_ttype): Define CPP_KEYWORD. 2626 26272014-09-17 Jan Hubicka <hubicka@ucw.cz> 2628 2629 * charset.c (conversion): Rename to ... 2630 (cpp_conversion): ... this one; update. 2631 * files.c (file_hash_entry): Rename to ... 2632 (cpp_file_hash_entry): ... this one ; update. 2633 26342014-09-17 Marek Polacek <polacek@redhat.com> 2635 2636 PR c/61854 2637 * init.c (struct lang_flags): Remove cplusplus_comments. 2638 (cpp_set_lang): Likewise. 2639 (post_options): Likewise. 2640 * lex.c (_cpp_lex_direct): Disallow C++ style comments in C90/C94. 2641 26422014-09-09 Manuel López-Ibáñez <manu@gcc.gnu.org> 2643 2644 * include/cpplib.h (struct cpp_options): Declare warn_normalize as 2645 int instead of enum. 2646 26472014-09-04 Manuel López-Ibáñez <manu@gcc.gnu.org> 2648 2649 * macro.c (replace_args): Use cpp_pedwarning, cpp_warning and 2650 CPP_W flags. 2651 * include/cpplib.h: Add CPP_W_C90_C99_COMPAT and CPP_W_PEDANTIC. 2652 * init.c (cpp_create_reader): Do not init to -1 here. 2653 * expr.c (num_binary_op): Use cpp_pedwarning. 2654 26552014-08-29 Manuel López-Ibáñez <manu@gcc.gnu.org> 2656 2657 * directives.c (check_eol_1): New. 2658 (check_eol_endif_labels): New. 2659 (check_eol): Call check_eol_1. 2660 (do_else,do_endif): Call check_eol_endif_labels. 2661 26622014-08-29 Manuel López-Ibáñez <manu@gcc.gnu.org> 2663 2664 * macro.c (warn_of_redefinition): Suppress warnings for builtins 2665 that lack the NODE_WARN flag, unless Wbuiltin-macro-redefined. 2666 (_cpp_create_definition): Use Wbuiltin-macro-redefined for 2667 builtins that lack the NODE_WARN flag. 2668 * directives.c (do_undef): Likewise. 2669 * init.c (cpp_init_special_builtins): Do not change flags 2670 depending on Wbuiltin-macro-redefined. 2671 26722014-08-28 Edward Smith-Rowland <3dw4rd@verizon.net> 2673 2674 PR cpp/23827 - standard C++ should not have hex float preprocessor 2675 tokens 2676 * libcpp/init.c (lang_flags): Change CXX98 flag for extended numbers 2677 from 1 to 0. 2678 * libcpp/expr.c (cpp_classify_number): Weite error message for improper 2679 use of hex floating literal. 2680 26812014-08-23 Edward Smith-Rowland <3dw4rd@verizon.net> 2682 2683 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Z, CLK_CXX1Z; 2684 Rename CLK_GNUCXX1Y, CLK_CXX1Y to CLK_GNUCXX14, CLK_CXX14; 2685 * init.c (struct lang_flags lang_defaults): Add column for trigraphs; 2686 Add rows for CLK_GNUCXX1Z, CLK_CXX1Z; (cpp_set_lang): Set trigraphs; 2687 (cpp_init_builtins): Set __cplusplus to 201402L for C++14; 2688 Set __cplusplus to 201500L for C++17. 2689 * expr.c (cpp_classify_number): Change C++1y to C++14 in binary 2690 constants error message. 2691 26922014-08-20 Marek Polacek <polacek@redhat.com> 2693 2694 * include/cpplib.h (cpp_options): Use signed char. 2695 * lex.c (_cpp_lex_direct): Don't warn in C++ mode. 2696 26972014-08-19 Marek Polacek <polacek@redhat.com> 2698 2699 * lex.c (_cpp_lex_direct): Fix a typo. 2700 27012014-08-19 Marek Polacek <polacek@redhat.com> 2702 2703 * charset.c (_cpp_valid_ucn): Warn only if -Wc90-c99-compat. 2704 * lex.c (_cpp_lex_direct): Likewise. 2705 * macro.c (replace_args): Likewise. 2706 (parse_params): Likewise. 2707 * include/cpplib.h (cpp_options): Change cpp_warn_c90_c99_compat 2708 to char. 2709 27102014-08-10 Marek Polacek <polacek@redhat.com> 2711 2712 PR c/51849 2713 * lex.c (_cpp_lex_direct): Warn when -Wc90-c99-compat is in effect. 2714 * charset.c (_cpp_valid_ucn): Likewise. 2715 * include/cpplib.h (cpp_options): Add cpp_warn_c90_c99_compat. 2716 * macro.c (replace_args): Warn when -Wc90-c99-compat is in effect. 2717 (parse_params): Likewise. 2718 27192014-07-27 Marek Polacek <polacek@redhat.com> 2720 2721 PR c/61861 2722 * macro.c (builtin_macro): Add location parameter. Set 2723 location of builtin macro to the expansion point. 2724 (enter_macro_context): Pass location to builtin_macro. 2725 27262014-07-16 Dodji Seketeli <dodji@redhat.com> 2727 2728 Support location tracking for built-in macro tokens 2729 * include/line-map.h (line_maps::builtin_location): New data 2730 member. 2731 (line_map_init): Add a new parameter to initialize the new 2732 line_maps::builtin_location data member. 2733 * line-map.c (linemap_init): Initialize the 2734 line_maps::builtin_location data member. 2735 * macro.c (builtin_macro): Create a macro map and track the token 2736 resulting from the expansion of a built-in macro. 2737 27382014-07-10 Edward Smith-Rowland <3dw4rd@verizon.net> 2739 Jonathan Wakely <jwakely@redhat.com> 2740 2741 PR preprocessor/61389 2742 * macro.c (_cpp_arguments_ok, parse_params, create_iso_definition): 2743 Warning messages mention C++11 in c++ mode and C99 in c mode. 2744 * lex.c (lex_identifier_intern, lex_identifier): Ditto 2745 27462014-07-09 Edward Smith-Rowland <3dw4rd@verizon.net> 2747 2748 PR c++/58155 - -Wliteral-suffix warns about tokens which are skipped 2749 by preprocessor 2750 * lex.c (lex_raw_string ()): Do not warn about invalid suffix 2751 if skipping. (lex_string ()): Ditto. 2752 27532014-06-04 Edward Smith-Rowland <3dw4rd@verizon.net> 2754 2755 PR c++/61038 2756 * macro.c (stringify_arg (cpp_reader *, macro_arg *)): 2757 Combine user-defined escape logic with the other string and char logic. 2758 27592014-05-26 Richard Biener <rguenther@suse.de> 2760 2761 * configure.ac: Remove long long and __int64 type checks, 2762 add check for uint64_t and fail if that wasn't found. 2763 * include/cpplib.h (cpp_num_part): Use uint64_t. 2764 * config.in: Regenerate. 2765 * configure: Likewise. 2766 27672014-05-21 Marek Polacek <polacek@redhat.com> 2768 2769 PR c/61212 2770 * files.c (find_file_in_dir): Add parens around &&. 2771 27722014-05-20 Edward Smith-Rowland <3dw4rd@verizon.net> 2773 2774 PR c++/61038 2775 * macro.c (stringify_arg (cpp_reader *, macro_arg *)): 2776 Check for user-defined literal strings and user-defined literal chars 2777 to escape necessary characters. 2778 27792014-05-20 Richard Biener <rguenther@suse.de> 2780 2781 * configure.ac: Copy gcc logic of detecting a 64bit type. 2782 Remove HOST_WIDE_INT define. 2783 * include/cpplib.h: typedef cpp_num_part to a 64bit type, 2784 similar to how hwint.h does it. 2785 * config.in: Regenerate. 2786 * configure: Likewise. 2787 27882014-05-09 Joey Ye <joey.ye@arm.com> 2789 2790 * files.c (find_file_in_dir): Always try to shorten for DOS 2791 non-system headers. 2792 * init.c (ENABLE_CANONICAL_SYSTEM_HEADERS): Default enabled for DOS. 2793 27942014-05-07 Richard Biener <rguenther@suse.de> 2795 2796 * configure.ac: Always set need_64bit_hwint to yes. 2797 * configure: Regenerated. 2798 27992014-04-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> 2800 2801 * lex.c: Remove Solaris 9 reference. 2802 28032014-02-24 Walter Lee <walt@tilera.com> 2804 2805 * configure.ac: Change "tilepro" triplet to "tilepro*". 2806 * configure: Regenerate. 2807 28082014-02-19 Jakub Jelinek <jakub@redhat.com> 2809 2810 PR preprocessor/58844 2811 * macro.c (enter_macro_context): Only push 2812 macro_real_token_count (macro) tokens rather than 2813 macro->count tokens, regardless of 2814 CPP_OPTION (pfile, track-macro-expansion). 2815 28162014-02-07 Jakub Jelinek <jakub@redhat.com> 2817 2818 PR preprocessor/56824 2819 * line-map.c (get_combined_adhoc_loc, linemap_get_expansion_line, 2820 linemap_get_expansion_filename, linemap_location_in_system_header_p, 2821 linemap_location_from_macro_expansion_p, 2822 linemap_macro_loc_to_spelling_point, linemap_macro_loc_to_def_point, 2823 linemap_macro_loc_to_exp_point, linemap_expand_location): Fix 2824 formatting. 2825 (linemap_compare_locations): Look through adhoc locations for both 2826 l0 and l1. 2827 28282014-01-23 Dodji Seketeli <dodji@redhat.com> 2829 2830 PR PR preprocessor/58580 2831 * include/line-map.h (linemap_get_file_highest_location): Declare 2832 new function. 2833 * line-map.c (linemap_get_file_highest_location): Define it. 2834 28352014-01-02 Richard Sandiford <rdsandiford@googlemail.com> 2836 2837 Update copyright years 2838 28392013-12-09 Joseph Myers <joseph@codesourcery.com> 2840 2841 PR preprocessor/55715 2842 * expr.c (num_binary_op): Implement subtraction directly rather 2843 than with negation and falling through into addition case. 2844 28452013-11-18 Bill Schmidt <wschmidt@linux.vnet.ibm.com> 2846 2847 * lex.c (search_line_fast): Correct for little endian. 2848 28492013-11-15 Joseph Myers <joseph@codesourcery.com> 2850 2851 * ucnid.tab: Add C11 and C11NOSTART data. 2852 * makeucnid.c (digit): Rename enum value to N99. 2853 (C11, N11, all_languages): New enum values. 2854 (NUM_CODE_POINTS, MAX_CODE_POINT): New macros. 2855 (flags, decomp, combining_value): Use NUM_CODE_POINTS as array 2856 size. 2857 (decomp): Use unsigned int as element type. 2858 (all_decomp): New array. 2859 (read_ucnid): Handle C11 and C11NOSTART. Use MAX_CODE_POINT. 2860 (read_table): Use MAX_CODE_POINT. Store all decompositions in 2861 all_decomp. 2862 (read_derived): Use MAX_CODE_POINT. 2863 (write_table): Use NUM_CODE_POINTS. Print N99, C11 and N11 2864 flags. Print whole array variable declaration rather than just 2865 array contents. 2866 (char_id_valid, write_context_switch): New functions. 2867 (main): Call write_context_switch. 2868 * ucnid.h: Regenerate. 2869 * include/cpplib.h (struct cpp_options): Add c11_identifiers. 2870 * init.c (struct lang_flags): Add c11_identifiers. 2871 (cpp_set_lang): Set c11_identifiers option from selected language. 2872 * internal.h (struct normalize_state): Document "previous" as 2873 previous starter character. 2874 (NORMALIZE_STATE_UPDATE_IDNUM): Take character as argument. 2875 * charset.c (DIG): Rename enum value to N99. 2876 (C11, N11): New enum values. 2877 (struct ucnrange): Give name to struct. Use short for flags and 2878 unsigned int for end of range. Include ucnid.h for whole variable 2879 declaration. 2880 (ucn_valid_in_identifier): Allow for characters up to 0x10FFFF. 2881 Allow for C11 in determining valid characters and valid start 2882 characters. Use check_nfc for non-Hangul context-dependent 2883 checks. Only store starter characters in nst->previous. 2884 (_cpp_valid_ucn): Pass new argument to 2885 NORMALIZE_STATE_UPDATE_IDNUM. 2886 * lex.c (lex_identifier): Pass new argument to 2887 NORMALIZE_STATE_UPDATE_IDNUM. Call NORMALIZE_STATE_UPDATE_IDNUM 2888 after initial non-UCN part of identifier. 2889 (lex_number): Pass new argument to NORMALIZE_STATE_UPDATE_IDNUM. 2890 28912013-11-15 Joseph Myers <joseph@codesourcery.com> 2892 2893 * ucnid.tab: Mark C99 digits as [C99DIG]. 2894 * makeucnid.c (read_ucnid): Handle [C99DIG]. 2895 (read_table): Don't check for digit characters. 2896 * ucnid.h: Regenerate. 2897 28982013-11-06 Tobias Burnus <burnus@net-b.de> 2899 2900 * macro.c (_cpp_builtin_macro_text): Correct 2901 wording of two warnings. 2902 29032013-11-05 Tobias Burnus <burnus@net-b.de> 2904 2905 * include/cpplib.h (CPP_W_DATE_TIME): Added. 2906 (cpp_options): Add warn_date_time. 2907 * init.c (cpp_create_reader): Init it. 2908 * macro.c (_cpp_builtin_macro_text): Warn when 2909 __DATE__/__TIME__/__TIMESTAMP__ is used. 2910 29112013-10-31 Edward Smith-Rowland <3dw4rd@verizon.net> 2912 2913 Implement C++14 digit separators. 2914 * include/cpplib.h (cpp_options): Add digit_separators flag. 2915 * internal.h (DIGIT_SEP(c)): New macro. 2916 * expr.c (cpp_classify_number): Check improper placement of digit sep; 2917 (cpp_interpret_integer): Skip over digit separators. 2918 * init.c (lang_flags): Add digit_separators flag; (lang_defaults): Add 2919 digit separator flags per language; (cpp_set_lang): Set 2920 digit_separators 2921 * lex.c (lex_number): Add digits separator to allowable characters for 2922 C++14. 2923 29242013-10-15 David Malcolm <dmalcolm@redhat.com> 2925 2926 * Makefile.in (PICFLAG): New. 2927 (ALL_CFLAGS): Add PICFLAG. 2928 (ALL_CXXFLAGS): Likewise. 2929 * configure.ac: Add --enable-host-shared, setting up new 2930 PICFLAG variable. 2931 * configure: Regenerate. 2932 29332013-08-07 Richard Earnshaw <rearnsha@arm.com> 2934 2935 * configure.ac: Set need_64bit_hwint for all arm targets. 2936 * configure: Regenerated. 2937 29382013-07-20 Jakub Jelinek <jakub@redhat.com> 2939 2940 PR preprocessor/57620 2941 * lex.c (lex_raw_string): Undo phase1 and phase2 transformations 2942 between R" and final " rather than only in between R"del( and )del". 2943 29442013-07-10 Jakub Jelinek <jakub@redhat.com> 2945 2946 PR preprocessor/57824 2947 * lex.c (lex_raw_string): Allow reading new-lines if 2948 in_deferred_pragma or if parsing_args and there is still 2949 data in the current buffer. 2950 2951 * include/cpplib.h (cpp_token_val_index): Change parameter type to 2952 const cpp_token *. 2953 * lex.c (cpp_token_val_index): Likewise. 2954 2955 PR preprocessor/57757 2956 * lex.c (cpp_avoid_paste): Avoid pasting CPP_{,W,UTF8}STRING 2957 or CPP_STRING{16,32} with CPP_NAME or SPELL_LITERAL token that 2958 starts if a-zA-Z_. 2959 29602013-06-28 Ed Smith-Rowland <3dw4rd@verizon.net> 2961 2962 * lex.c (lex_raw_string(), lex_string()): Constrain suffixes treated 2963 as concatenated literal and macro to just the patterns found in 2964 inttypes.h; (is_macro()): New. 2965 29662013-06-24 Dehao Chen <dehao@google.com> 2967 2968 * files.c (_cpp_stack_include): Fix the highest_location when header 2969 file is guarded by #ifndef and is included twice. 2970 29712013-04-28 Jakub Jelinek <jakub@redhat.com> 2972 2973 N3472 binary constants 2974 * include/cpplib.h (struct cpp_options): Fix a typo in user_literals 2975 field comment. Add binary_constants field. 2976 * init.c (struct lang_flags): Add binary_constants field. 2977 (lang_defaults): Add bin_cst column to the table. 2978 (cpp_set_lang): Initialize CPP_OPTION (pfile, binary_constants). 2979 * expr.c (cpp_classify_number): Talk about C++11 instead of C++0x 2980 in diagnostics. Accept binary constants if 2981 CPP_OPTION (pfile, binary_constants) even when pedantic. Adjust 2982 pedwarn message. 2983 29842013-04-24 Paolo Carlini <paolo.carlini@oracle.com> 2985 2986 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Y and CLK_CXX1Y. 2987 * init.c (lang_defaults): Add defaults for the latter. 2988 (cpp_init_builtins): Define __cplusplus as 201300L for the latter. 2989 * lex.c (_cpp_lex_direct): Update. 2990 29912013-04-03 Sebastian Huber <sebastian.huber@embedded-brains.de> 2992 2993 PR target/56771 2994 * configure.ac: Require 64-bit int for arm*-*-rtems*. 2995 * configure: Regenerate. 2996 29972013-03-06 Jakub Jelinek <jakub@redhat.com> 2998 2999 PR middle-end/56461 3000 * internal.h (struct cpp_buffer): Add to_free field. 3001 (_cpp_pop_file_buffer): Add third argument. 3002 * files.c (_cpp_stack_file): Set buffer->to_free. 3003 (_cpp_pop_file_buffer): Add to_free argument. Free to_free 3004 if non-NULL, and if equal to file->buffer_start, also clear 3005 file->buffer{,_start,_valid}. 3006 * directives.c (_cpp_pop_buffer): Pass buffer->to_free 3007 to _cpp_pop_file_buffer. 3008 30092013-03-01 Jakub Jelinek <jakub@redhat.com> 3010 3011 PR middle-end/56461 3012 * files.c (_cpp_save_file_entries): Free result at the end. 3013 * pch.c (cpp_string_free): New function. 3014 (cpp_save_state): Use it in htab_create call. 3015 (cpp_write_pch_deps): Free ss->defs. Destroy ss->definedhash. 3016 30172013-02-28 Jakub Jelinek <jakub@redhat.com> 3018 3019 * files.c (_cpp_find_file): If returning early, before storing 3020 something to *hash_slot and *hash_slot is NULL, call htab_clear_slot 3021 on it. Access *hash_slot using void * type rather than 3022 struct file_hash_entry * to avoid aliasing issues. 3023 3024 * configure.ac: Don't define ENABLE_CHECKING whenever 3025 --enable-checking is seen, instead use similar --enable-checking=yes 3026 vs. --enable-checking=release default as gcc/ subdir has and 3027 define ENABLE_CHECKING if ENABLE_CHECKING is defined in gcc/. 3028 Define ENABLE_VALGRIND_CHECKING if requested. 3029 * lex.c (new_buff): If ENABLE_VALGRIND_CHECKING, put _cpp_buff 3030 struct first in the allocated buffer and result->base after it. 3031 (_cpp_free_buff): If ENABLE_VALGRIND_CHECKING, free buff itself 3032 instead of buff->base. 3033 * config.in: Regenerated. 3034 * configure: Regenerated. 3035 30362013-02-13 Ed Smith-Rowland <3dw4rd@verizon.net> 3037 3038 PR c++/55582 3039 * lex.c (lex_raw_string): Allow string literal with suffix 3040 beginning with 's' to be parsed as a C++11 user-defined literal. 3041 30422013-01-14 Richard Sandiford <rdsandiford@googlemail.com> 3043 3044 Update copyright years. 3045 30462013-01-04 Paolo Carlini <paolo.carlini@oracle.com> 3047 3048 PR c++/54526 (again) 3049 * lex.c (_cpp_lex_direct): In C++11 mode, implement 2.5 p3, bullet 2. 3050 30512013-01-03 Marc Glisse <marc.glisse@inria.fr> 3052 3053 PR bootstrap/50177 3054 * line-map.c (get_combined_adhoc_loc): Cast from extern "C" type. 3055 (new_linemap): Likewise. 3056 (linemap_enter_macro): Likewise. 3057 30582012-12-03 Jakub Jelinek <jakub@redhat.com> 3059 3060 PR bootstrap/55380 3061 PR other/54691 3062 * files.c (read_file_guts): Allocate extra 16 bytes instead of 3063 1 byte at the end of buf. Pass size + 16 instead of size 3064 to _cpp_convert_input. 3065 * charset.c (_cpp_convert_input): Reallocate if there aren't 3066 at least 16 bytes beyond to.len in the buffer. Clear 16 bytes 3067 at to.text + to.len. 3068 30692012-11-21 Steve Ellcey <sellcey@mips.com> 3070 3071 PR pch/55399 3072 * files.c (pch_open_file): Fix check for implicit_preinclude. 3073 30742012-11-16 Simon Baldwin <simonb@google.com> 3075 3076 * include/cpplib.h (struct cpp_options): Add canonical_system_headers. 3077 * files.c (find_file_in_dir): Call maybe_shorter_path() only if 3078 canonical_system_headers is set. 3079 * init.c (cpp_create_reader): Initialize canonical_system_headers. 3080 * configure.ac: Add new --enable-canonical-system-headers. 3081 * configure: Regenerate. 3082 * config.in: Regenerate. 3083 30842012-11-09 Ed Smith-Rowland <3dw4rd@verizon.net> 3085 3086 PR c++/54413 3087 * include/cpplib.h (cpp_interpret_float_suffix): Add cpp_reader* arg. 3088 (cpp_interpret_int_suffix): Add cpp_reader* arg. 3089 * init.c (cpp_create_reader): Iitialize new flags. 3090 * expr.c (interpret_float_suffix): Use new flags. 3091 (cpp_interpret_float_suffix): Add cpp_reader* arg. 3092 (interpret_int_suffix): Use new flags. 3093 (cpp_interpret_int_suffix): Add cpp_reader* arg. 3094 (cpp_classify_number): Adjust calls to interpret_x_suffix. 3095 30962012-10-23 Ian Bolton <ian.bolton@arm.com> 3097 Jim MacArthur <jim.macarthur@arm.com> 3098 Marcus Shawcroft <marcus.shawcroft@arm.com> 3099 Nigel Stephens <nigel.stephens@arm.com> 3100 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com> 3101 Richard Earnshaw <rearnsha@arm.com> 3102 Sofiane Naci <sofiane.naci@arm.com> 3103 Stephen Thomas <stephen.thomas@arm.com> 3104 Tejas Belagod <tejas.belagod@arm.com> 3105 Yufeng Zhang <yufeng.zhang@arm.com> 3106 3107 * configure.ac: Enable AArch64. 3108 * configure: Regenerate. 3109 31102012-10-23 Joseph Myers <joseph@codesourcery.com> 3111 3112 * files.c (struct _cpp_file): Add implicit_preinclude. 3113 (pch_open_file): Allow a previously opened implicitly included 3114 file. 3115 (_cpp_find_file): Add implicit_preinclude argument. Free file and 3116 do not call open_file_failed if implicit_preinclude. Store 3117 implicit_preinclude value. 3118 (_cpp_stack_include, _cpp_fake_include, _cpp_compare_file_date): 3119 Update calls to _cpp_find_file. 3120 (_cpp_stack_include): Handle IT_DEFAULT. 3121 (cpp_push_default_include): New. 3122 * include/cpplib.h (cpp_push_default_include): Declare. 3123 * init.c (cpp_read_main_file): Update call to _cpp_find_file. 3124 * internal.h (enum include_type): Add IT_DEFAULT. 3125 (_cpp_find_file): Update prototype. 3126 31272012-10-15 Tobias Burnus <burnus@net-b.de> 3128 3129 * files.c (read_file_guts, _cpp_save_file_entries): Free memory 3130 before returning. 3131 * lex.c (warn_about_normalization): Ditto. 3132 * mkdeps.c (deps_save): Ditto. 3133 * pch.c (cpp_valid_state): Ditto. 3134 31352012-10-04 Florian Weimer <fweimer@redhat.com> 3136 3137 * directives.c (do_pragma_warning_or_error): New. 3138 (do_pragma_warning): New. 3139 (do_pragma_error): New. 3140 (_cpp_init_internal_pragmas): Register new pragmas. 3141 31422012-09-25 Dehao Chen <dehao@google.com> 3143 3144 PR middle-end/54704 3145 * line-map.c (location_adhoc_data_hash): Fix the hash function. 3146 31472012-09-25 Dehao Chen <dehao@google.com> 3148 3149 PR middle-end/54645 3150 * include/line-map.h (location_adhoc_data): Move location_adhoc_data 3151 into GC. 3152 (location_adhoc_data_map): Likewise. 3153 (line_maps): Likewise. 3154 (rebuild_location_adhoc_htab): New Function. 3155 * line-map.c (+rebuild_location_adhoc_htab): new Funcion. 3156 (get_combined_adhoc_loc): Move location_adhoc_data into GC. 3157 (location_adhoc_data_fini): Likewise. 3158 (linemap_init): Likewise. 3159 (location_adhoc_data_init): Remove Function. 3160 31612012-09-19 Dehao Chen <dehao@google.com> 3162 3163 * include/line-map.h (MAX_SOURCE_LOCATION): New value. 3164 (location_adhoc_data_fini): New. 3165 (get_combined_adhoc_loc): New. 3166 (get_data_from_adhoc_loc): New. 3167 (get_location_from_adhoc_loc): New. 3168 (location_adhoc_data_map): New. 3169 (COMBINE_LOCATION_DATA): New. 3170 (IS_ADHOC_LOC): New. 3171 (expanded_location): New field. 3172 (line_maps): New field. 3173 * line-map.c (location_adhoc_data): New. 3174 (location_adhoc_data_hash): New. 3175 (location_adhoc_data_eq): New. 3176 (location_adhoc_data_update): New. 3177 (get_combined_adhoc_loc): New. 3178 (get_data_from_adhoc_loc): New. 3179 (get_location_from_adhoc_loc): New. 3180 (location_adhoc_data_init): New. 3181 (location_adhoc_data_fini): New. 3182 (linemap_init): Initialize location_adhoc_data. 3183 (linemap_lookup): Change to use new location. 3184 (linemap_ordinary_map_lookup): Likewise. 3185 (linemap_macro_map_lookup): Likewise. 3186 (linemap_macro_map_loc_to_def_point): Likewise. 3187 (linemap_macro_map_loc_unwind_toward_spel): Likewise. 3188 (linemap_get_expansion_line): Likewise. 3189 (linemap_get_expansion_filename): Likewise. 3190 (linemap_location_in_system_header_p): Likewise. 3191 (linemap_location_from_macro_expansion_p): Likewise. 3192 (linemap_macro_loc_to_spelling_point): Likewise. 3193 (linemap_macro_loc_to_def_point): Likewise. 3194 (linemap_macro_loc_to_exp_point): Likewise. 3195 (linemap_resolve_location): Likewise. 3196 (linemap_unwind_toward_expansion): Likewise. 3197 (linemap_unwind_to_first_non_reserved_loc): Likewise. 3198 (linemap_expand_location): Likewise. 3199 (linemap_dump_location): Likewise. 3200 (linemap_line_start): Likewise. 3201 32022012-05-25 Dodji Seketeli <dodji@redhat.com> 3203 3204 PR preprocessor/53469 3205 * directives.c (do_pragma): Use the virtual location for the 3206 pragma token, instead of its spelling location. 3207 32082012-08-14 Diego Novillo <dnovillo@google.com> 3209 3210 Merge from cxx-conversion branch. Configury. 3211 3212 * Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX. 3213 * configure.ac: Likewise. 3214 * configure: Regenerate. 3215 32162012-08-14 Lawrence Crowl <crowl@google.com> 3217 3218 Merge from cxx-conversion branch. New C++ hash table. 3219 3220 * include/symtab.h (typedef struct ht hash_table): Change the typedef 3221 name to cpp_hash_table. Update all users of the typedef. 3222 32232012-07-30 Laurynas Biveinis <laurynas.biveinis@gmail.com> 3224 3225 * include/line-map.h (line_map_macro): Use the "atomic" GTY option 3226 for the macro_locations field. 3227 32282011-06-19 Uros Bizjak <ubizjak@gmail.com> 3229 3230 * lex.c (search_line_sse42): Use __builtin_ia32_loaddqu and 3231 __builtin_ia32_pcmpestri128 instead of asm. 3232 32332012-06-04 Dimitrios Apostolou <jimis@gmx.net> 3234 3235 * line-map.c (linemap_enter_macro): Don't zero max_column_hint in 3236 every macro. This improves performance by reducing the number of 3237 reallocations when track-macro-expansion is on. 3238 32392012-06-04 Dodji Seketeli <dodji@redhat.com> 3240 3241 PR preprocessor/53463 3242 * line-map.c (linemap_location_in_system_header_p): For built-in 3243 macro tokens, check the first expansion point location that is not 3244 for a token coming from a built-in macro. 3245 32462012-05-29 Joseph Myers <joseph@codesourcery.com> 3247 3248 * directives.c: Fix typos. 3249 * include/line-map.h: Fix typos. 3250 * line-map.c: Fix typos. 3251 * macro.c: Fix typos. 3252 32532012-05-25 Dodji Seketeli <dodji@redhat.com> 3254 3255 PR bootstrap/53459 3256 * lex.c (search_line_fast): Avoid unused local typedefs to simulate 3257 a static assertion. 3258 32592012-05-29 Dodji Seketeli <dodji@redhat.com> 3260 3261 PR preprocessor/53229 3262 * internal.h (cpp_reader::set_invocation_location): Remove. 3263 (cpp_reader::about_to_expand_macro_p): New member flag. 3264 * directives.c (do_pragma): Remove Kludge as 3265 pfile->set_invocation_location is no more. 3266 * macro.c (cpp_get_token_1): Do away with the use of 3267 cpp_reader::set_invocation_location. Just collect the macro 3268 expansion point when we are about to expand the top-most macro. 3269 Do not override cpp_reader::about_to_expand_macro_p. 3270 This fixes gcc.dg/cpp/paste12.c by making get_token_no_padding 3271 properly handle locations of expansion points. 3272 (cpp_get_token_with_location): Adjust, as 3273 cpp_reader::set_invocation_location is no more. 3274 (paste_tokens): Take a virtual location parameter for 3275 the LHS of the pasting operator. Use it in diagnostics. Update 3276 comments. 3277 (paste_all_tokens): Tighten the assert. Propagate the location of 3278 the expansion point when no virtual locations are available. 3279 Pass the virtual location to paste_tokens. 3280 (in_macro_expansion_p): New static function. 3281 (enter_macro_context): Set the cpp_reader::about_to_expand_macro_p 3282 flag until we really start expanding the macro. 3283 32842012-05-16 Dodji Seketeli <dodji@redhat.com> 3285 3286 PR preprocessor/7263 3287 * include/cpplib.h (cpp_classify_number): Take a location 3288 parameter. 3289 * expr.c (SYNTAX_ERROR_AT, SYNTAX_ERROR2_AT): New diagnostic 3290 macros that take a location parameter. 3291 (cpp_classify_number): Take a (virtual) location parameter. Use 3292 it for diagnostics. Adjust comments. 3293 (eval_token): Take a location parameter. Pass it to 3294 cpp_classify_number and to diagnostic routines. 3295 (_cpp_parse_expr): Use virtual locations of tokens when parsing 3296 expressions. Pass a virtual location to eval_token and to 3297 diagnostic routines. 3298 32992012-05-10 Tristan Gingold <gingold@adacore.com> 3300 3301 * expr.c (interpret_float_suffix): Add a guard. 3302 33032012-05-02 Dodji Seketeli <dodji@redhat.com> 3304 3305 Properly initialize cpp_context in destringize_and_run 3306 * directives.c (destringize_and_run): Properly initialize the new 3307 context. 3308 * macro.c (_cpp_pop_context): Assert that we shouldn't try to pop 3309 the initial base context, which has the same life time as the 3310 current instance of cpp_file. 3311 33122012-04-30 Manuel López-Ibáñez <manu@gcc.gnu.org> 3313 Dodji Seketeli <dodji@seketeli.org> 3314 3315 PR c++/52974 3316 * libcpp/files.c (maybe_shorter_path): New. 3317 (find_file_in_dir): Use it. 3318 33192012-04-30 Dodji Seketeli <dodji@redhat.com> 3320 3321 Switch -ftrack-macro-expansion=2 on by default. 3322 * init.c (cpp_create_reader): Switch -ftrack-macro-expansion=2 on 3323 by default. Add comments. 3324 3325 Strip "<built-in>" loc from displayed expansion context 3326 * include/line-map.h (linemap_unwind_toward_expansion): Fix typo 3327 in comment. 3328 (linemap_unwind_to_first_non_reserved_loc): Declare new function. 3329 * line-map.c (linemap_unwind_to_first_non_reserved_loc): Define 3330 new function. 3331 3332 Fix expansion point loc for macro-like tokens 3333 * macro.c (macro_of_context): New static function. 3334 (_cpp_push_token_context, push_extended_tokens_context): If the 3335 macro argument is NULL, it means we are continuing the expansion 3336 of the current macro, if any. Update comments. 3337 (_cpp_pop_context): Re-enable expansion of the macro only when we 3338 are really out of the context of the current expansion. 3339 3340 Fix token pasting with -ftrack-macro-expansion 3341 * macro.c (paste_all_tokens): Put the token resulting from pasting 3342 into an extended token context with -ftrack-macro-location is in 3343 effect. 3344 3345 Fix cpp_sys_macro_p with -ftrack-macro-expansion 3346 * macro.c (cpp_sys_macro_p): Support -ftrack-macro-expansion. 3347 33482012-04-29 Dodji Seketeli <dodji@redhat.com> 3349 3350 * lex.c (lex_raw_string): Change C++ style comments into C style 3351 comments. 3352 (lex_string): Likewise. 3353 33542012-04-27 Ollie Wild <aaw@google.com> 3355 3356 * include/cpplib.h (struct cpp_options): Add new field, 3357 warn_literal_suffix. 3358 (CPP_W_LITERAL_SUFFIX): New enum. 3359 * init.c (cpp_create_reader): Default initialization of 3360 warn_literal_suffix. 3361 * lex.c (lex_raw_string): Treat user-defined literals which don't 3362 begin with '_' as separate tokens and produce a warning. 3363 (lex_string): Ditto. 3364 33652012-04-26 Manuel López-Ibáñez <manu@gcc.gnu.org> 3366 3367 * line-map.c (linemap_resolve_location): Synchronize comments with 3368 those in line-map.h. 3369 * include/line-map.h (linemap_resolve_location): Fix spelling in 3370 comment. 3371 33722012-03-22 Richard Earnshaw <rearnsha@arm.com> 3373 3374 * lex.c (search_line_fast): Provide Neon-optimized version for ARM. 3375 33762012-03-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> 3377 3378 * lex.c: Remove Solaris 8 reference. 3379 33802012-02-14 Walter Lee <walt@tilera.com> 3381 3382 * configure.ac: Require 64-bit hwint for tilegx and tilepro. 3383 * configure: Regenerate. 3384 33852012-01-09 Richard Guenther <rguenther@suse.de> 3386 3387 * macro.c (_cpp_builtin_macro_text): Remove unused variable map. 3388 33892012-01-09 Gary Funck <gary@intrepid.com> 3390 3391 PR preprocessor/33919 3392 * files.c (_cpp_get_file_name): New. Implement file name 3393 access function. 3394 * internal.h (_cpp_get_file_name): New prototype. 3395 * macro.c (_cpp_builtin_macro_text): Call _cpp_get_file_name() 3396 to use pfile->main_file in lieu of traversing INCLUDED_FROM chain. 3397 33982012-01-03 Olivier Hainque <hainque@adacore.com> 3399 3400 * system.h: Prior to #define, #undef fopen and freopen unconditionally. 3401 34022011-12-20 Joseph Myers <joseph@codesourcery.com> 3403 3404 * include/cpplib.h (CLK_GNUC1X): Change to CLK_GNUC11. 3405 (CLK_STDC1X): Change to CLK_STDC11. 3406 * init.c (lang_defaults): Update comments. 3407 (cpp_init_builtins): Update language tests. Use 201112L for C11 3408 __STDC_VERSION__. 3409 34102011-12-20 Andreas Schwab <schwab@linux-m68k.org> 3411 3412 * configure: Regenerate. 3413 34142011-12-19 Andreas Schwab <schwab@linux-m68k.org> 3415 3416 * configure: Regenerate. 3417 34182011-12-07 Jakub Jelinek <jakub@redhat.com> 3419 3420 PR bootstrap/50237 3421 * internal.h (_cpp_init_lexer): New prototype. 3422 * init.c (init_library): Call it. 3423 * lex.c (init_vectorized_lexer): Remove constructor attribute, 3424 add inline keyword. 3425 (HAVE_init_vectorized_lexer): Define. 3426 (_cpp_init_lexer): New function. 3427 34282011-12-03 Dodji Seketeli <dodji@redhat.com> 3429 3430 * macro.c (tokens_buff_remove_last_token) 3431 (tokens_buff_put_token_to): Add an 'inline' function specifier to 3432 the prototype. 3433 34342011-11-22 Diego Novillo <dnovillo@google.com> 3435 3436 * include/line-map.h (linemap_dump): Declare. 3437 (line_table_dump): Declare. 3438 * line-map.c (linemap_dump): New. 3439 (line_table_dump): New. 3440 34412011-11-21 Ed Smith-Rowland <3dw4rd@verizon.net> 3442 3443 PR c++/50958 3444 * expr.c (cpp_userdef_char_remove_type): Fix typo. 3445 34462011-11-03 Michael Matz <matz@suse.de> 3447 3448 PR bootstrap/50857 3449 * configure.ac: Check for -fno-exceptions -fno-rtti. 3450 * configure: Regenerate. 3451 * Makefile.in (NOEXCEPTION_FLAGS): New flag. 3452 (ALL_CXXFLAGS): Use it. 3453 34542011-11-02 Paolo Carlini <paolo.carlini@oracle.com> 3455 3456 * internal.h (uxstrdup, ustrchr): Return const unsigned char *. 3457 34582011-11-02 Jason Merrill <jason@redhat.com> 3459 3460 PR c++/50810 3461 * configure.ac: Add -Wno-narrowing to warning options. 3462 34632011-10-31 Jason Merrill <jason@redhat.com> 3464 3465 PR libstdc++/1773 3466 * init.c (cpp_init_builtins): Set __cplusplus for C++11. 3467 3468 PR c++/50920 3469 * include/cpplib.h (enum c_lang): Rename CLK_CXX0X to CLK_CXX11, 3470 CLK_GNUCXX0X to CLK_GNUCXX11. 3471 34722011-10-26 Ed Smith-Rowland <3dw4rd@verizon.net> 3473 3474 Implement C++11 user-defined literals. 3475 * expr.c: (cpp_interpret_float_suffix, cpp_interpret_int_suffix, 3476 cpp_userdef_string_remove_type, cpp_userdef_string_add_type, 3477 cpp_userdef_char_remove_type, cpp_userdef_char_add_type, 3478 cpp_userdef_string_p, cpp_userdef_char_p, cpp_get_userdef_suffix): New. 3479 (cpp_classify_number): Classify unrecognized tokens as user-defined 3480 literals. 3481 * include/cpplib.h: Add new tokens for user-defined literals. 3482 * init.c: Add new preprocessor flag (cxx11). 3483 * lex.c: (lex_string, lex_raw_string): Handle user-defined literals 3484 including concatenation and promotion with suffixes. 3485 34862011-10-24 Dodji Seketeli <dodji@redhat.com> 3487 3488 * line-map.c (linemap_macro_map_lookup): Fix logic. 3489 34902011-10-24 Dodji Seketeli <dodji@redhat.com> 3491 3492 * include/line-map.h (linemap_expand_location): Take a line table 3493 parameter. Update comment. 3494 (linemap_resolve_location): Update comment. 3495 (linemap_expand_location_full): Remove. 3496 * line-map.c (linemap_resolve_location): Handle reserved 3497 locations; return a NULL map in those cases. 3498 (linemap_expand_location): If location is reserved, return a 3499 zeroed expanded location. Update comment. Take a line table to 3500 assert that the function takes non-virtual locations only. 3501 (linemap_expand_location_full): remove. 3502 (linemap_dump_location): Handle the fact that 3503 linemap_resolve_location can return NULL line maps when the 3504 location resolves to a reserved location. 3505 3506 * line-map.c (linemap_macro_map_lookup): Fix logic. 3507 35082011-10-22 Dodji Seketeli <dodji@redhat.com> 3509 3510 PR bootstrap/50778 3511 * include/internal.h (_cpp_remaining_tokens_num_in_context): Take the 3512 context to act upon. 3513 * lex.c (_cpp_remaining_tokens_num_in_context): Likewise. Update 3514 comment. 3515 (cpp_token_from_context_at): Likewise. 3516 (cpp_peek_token): Use the context to peek tokens from. 3517 35182011-10-20 Dodji Seketeli <dodji@redhat.com> 3519 3520 PR bootstrap/50801 3521 * lex.c (_cpp_remaining_tokens_num_in_context): Fix computation of 3522 number of tokens. 3523 35242011-10-18 Dodji Seketeli <dodji@redhat.com> 3525 3526 PR bootstrap/50760 3527 * include/line-map.h (struct linemap_stats): Change the type of 3528 the members from size_t to long. 3529 * macro.c (macro_arg_token_iter_init): Unconditionally initialize 3530 iter->location_ptr. 3531 35322011-10-17 Dodji Seketeli <dodji@redhat.com> 3533 3534 * line-map.c (linemap_macro_map_loc_to_exp_point): Avoid setting a 3535 variable without using it if ENABLE_CHECKING is not defined. Mark 3536 the LOCATION parameter as being unused. 3537 35382011-10-15 Tom Tromey <tromey@redhat.com> 3539 Dodji Seketeli <dodji@redhat.com> 3540 3541 * include/line-map.h (struct line_maps::alloced_size_for_request): 3542 New member. 3543 * line-map.c (new_linemap): Use set->alloced_size_for_request to 3544 get the actual allocated size of line maps. 3545 35462011-10-15 Tom Tromey <tromey@redhat.com> 3547 Dodji Seketeli <dodji@redhat.com> 3548 3549 * line-map.h (struct linemap_stats): Declare new struct. 3550 (linemap_get_statistics): Declare ... 3551 * line-map.c (linemap_get_statistics): ... new function. 3552 * macro.c (num_expanded_macros_counter, num_macro_tokens_counter): 3553 Declare new counters. 3554 (enter_macro_context, replace_args): Update 3555 num_macro_tokens_counter. 3556 (cpp_get_token_1): Update num_expanded_macros_counter. 3557 35582011-10-15 Tom Tromey <tromey@redhat.com> 3559 Dodji Seketeli <dodji@redhat.com> 3560 3561 * include/cpplib.h (struct cpp_options)<debug>: New struct member. 3562 * include/line-map.h (linemap_dump_location): Declare ... 3563 * line-map.c (linemap_dump_location): ... new function. 3564 35652011-10-15 Tom Tromey <tromey@redhat.com> 3566 Dodji Seketeli <dodji@redhat.com> 3567 3568 * include/cpplib.h (struct cpp_options)<track_macro_expansion>: 3569 New option. 3570 * internal.h (struct macro_context): New struct. 3571 (enum context_tokens_kind): New enum. 3572 (struct cpp_context)<tokens_kind>: New member of type enum 3573 context_tokens_kind. 3574 (struct cpp_context)<macro>: Remove this. Replace it with an enum 3575 of macro and macro_context. 3576 (struct cpp_context)<direct_p>: Remove. 3577 (_cpp_remaining_tokens_num_in_context): Declare new function. 3578 * directives.c (destringize_and_run): Adjust. 3579 * lex.c (_cpp_remaining_tokens_num_in_context) 3580 (_cpp_token_from_context_at): Define new functions 3581 (cpp_peek_token): Use them. 3582 * init.c (cpp_create_reader): Initialize the base context to zero. 3583 (_cpp_token_from_context_at): Define new static function. 3584 (cpp_peek_token): Use new _cpp_remaining_tokens_num_in_context and 3585 _cpp_token_from_context_at. 3586 * macro.c (struct macro_arg)<virt_locs, expanded_virt_locs>: New 3587 members. 3588 (enum macro_arg_token_kind): New enum. 3589 (struct macro_arg_token_iter): New struct. 3590 (maybe_adjust_loc_for_trad_cpp, push_extended_tokens_context) 3591 (alloc_expanded_arg_mem, ensure_expanded_arg_room) 3592 (delete_macro_args, set_arg_token, get_arg_token_location) 3593 (arg_token_ptr_at, macro_arg_token_iter_init) 3594 (macro_arg_token_iter_get_token) 3595 (macro_arg_token_iter_get_location, macro_arg_token_iter_forward) 3596 (expanded_token_index, tokens_buff_new, tokens_buff_count) 3597 (tokens_buff_last_token_ptr, tokens_buff_put_token_to) 3598 (tokens_buff_add_token, tokens_buff_remove_last_token) 3599 (reached_end_of_context, consume_next_token_from_context): New 3600 static functions. 3601 (cpp_get_token_1): New static function. Split and extended from 3602 cpp_get_token. Use reached_end_of_context and 3603 consume_next_token_from_context. Unify its return point. Move 3604 the location tweaking from cpp_get_token_with_location in here. 3605 (cpp_get_token): Use cpp_get_token_1 3606 (stringify_arg): Use the new arg_token_at. 3607 (paste_all_tokens): Support tokens coming from extended tokens 3608 contexts. 3609 (collect_args): Return the number of collected arguments, by 3610 parameter. Store virtual locations of tokens that constitute the 3611 collected args. 3612 (funlike_invocation_p): Return the number of collected arguments, 3613 by parameter. 3614 (enter_macro_context): Add a parameter for macro expansion point. 3615 Pass it to replace_args and to the "used" cpp callback. Get the 3616 number of function-like macro arguments from funlike_invocation_p, 3617 pass it to the new delete_macro_args to free the memory used by 3618 macro args. When -ftrack-macro-expansion is in effect, for macros 3619 that have no arguments, create a macro map for the macro expansion 3620 and use it to allocate proper virtual locations for tokens 3621 resulting from the expansion. Push an extended tokens context 3622 containing the tokens resulting from macro expansion and their 3623 virtual locations. 3624 (replace_args): Rename the different variables named 'count' into 3625 variables with more meaningful names. Create a macro map; 3626 allocate virtual locations of tokens resulting from this 3627 expansion. Use macro_arg_token_iter to iterate over tokens of a 3628 given macro. Handle the case of the argument of 3629 -ftrack-macro-expansion being < 2. Don't free macro arguments 3630 memory resulting from expand_arg here, as these are freed by the 3631 caller of replace_arg using delete_macro_args now. Push extended 3632 token context. 3633 (next_context, push_ptoken_context, _cpp_push_token_context) 3634 (_cpp_push_text_context): Properly initialize the context. 3635 (expand_arg): Use the new alloc_expanded_arg_mem, 3636 push_extended_tokens_context, cpp_get_token_1, and set_arg_token. 3637 (_cpp_pop_context): Really free the memory held by the context. 3638 Handle freeing memory used by extended tokens contexts. 3639 (cpp_get_token_with_location): Use cpp_get_token_1. 3640 (cpp_sys_macro_p): Adjust. 3641 (_cpp_backup_tokens): Support the new kinds of token contexts. 3642 * traditional.c (recursive_macro): Adjust. 3643 36442011-10-15 Tom Tromey <tromey@redhat> 3645 Dodji Seketeli <dodji@redhat.com> 3646 3647 * include/line-map.h (enum lc_reason)<LC_ENTER_MACRO>: New enum 3648 member. 3649 (MAX_SOURCE_LOCATION): New constant. 3650 (struct line_map_ordinary, struct line_map_macro): New structs. 3651 (struct line_map): Turn this into a union of the two above. Add 3652 comments. 3653 (struct maps_info): New struct. 3654 (struct line_maps)<info_ordinary, info_macro>: Two new fields. 3655 These now carry the map information that was previously scattered 3656 in struct line_maps. 3657 (struct map_info::allocated): Fix comment. 3658 (MAP_START_LOCATION, ORDINARY_MAP_FILE_NAME) 3659 (ORDINARY_MAP_STARTING_LINE_NUMBER) 3660 (ORDINARY_MAP_INCLUDER_FILE_INDEX) 3661 (ORDINARY_MAP_IN_SYSTEM_HEADER_P) 3662 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS, MACRO_MAP_MACRO) 3663 (MACRO_MAP_NUM_MACRO_TOKENS MACRO_MAP_LOCATIONS) 3664 (MACRO_MAP_EXPANSION_POINT_LOCATION) 3665 (LOCATION_POSSIBLY_IN_MACRO_MAP_P, LINEMAPS_MAP_INFO) 3666 (LINEMAPS_MAPS, LINEMAPS_ALLOCATE, LINEMAPS_USED, LINEMAPS_CACHE) 3667 (LINEMAPS_LAST_MAP, LINEMAPS_LAST_ALLOCATED_MAP) 3668 (LINEMAPS_ORDINARY_MAPS, LINEMAPS_ORDINARY_ALLOCATED) 3669 (LINEMAPS_ORDINARY_USED, LINEMAPS_ORDINARY_CACHE) 3670 (LINEMAPS_LAST_ORDINARY_MAP, LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP) 3671 (LINEMAPS_MACRO_MAPS, LINEMAPS_MACRO_ALLOCATED) 3672 (LINEMAPS_MACRO_USED, LINEMAPS_MACRO_CACHE) 3673 (LINEMAPS_LAST_MACRO_MAP, LINEMAPS_LAST_ALLOCATED_MACRO_MAP) 3674 (LINEMAPS_MAP_AT, LINEMAPS_ORDINARY_MAP_AT) 3675 (LINEMAPS_MACRO_MAP_AT): New accessors for ordinary and macro map 3676 information. 3677 (linemap_check_ordinary, linemap_assert) 3678 (linemap_location_before_p): New macros. 3679 (linemap_position_for_line_and_column) 3680 (linemap_tracks_macro_expansion_locs_p, linemap_add_macro_token) 3681 (linemap_macro_expansion_map_p) 3682 (linemap_macro_map_loc_to_def_point) 3683 (linemap_macro_map_loc_unwind_once) 3684 (linemap_macro_map_loc_to_exp_point, linemap_step_out_once) 3685 (linemap_get_source_line linemap_get_source_column) 3686 (linemap_map_get_macro_name, linemap_get_file_path) 3687 (linemap_location_in_system_header_p) 3688 (linemap_location_from_macro_expansion_p): Declare new functions. 3689 (SOURCE_LINE, SOURCE_COLUMN, LAST_SOURCE_LINE_LOCATION) 3690 (LINEMAP_FILE, LINEMAP_LINE, LINEMAP_SYSP): Assert that this 3691 accessors act on ordinary maps only. 3692 (INCLUDED_FROM): Return NULL for main files; use the new 3693 accessors. 3694 (LINEMAP_POSITION_FOR_COLUMN): Use the new accessors. 3695 (struct expanded_location): Move here from gcc/input.h 3696 (linemap_resolve_location, linemap_expand_location) 3697 (linemap_expand_location_full): Declare new functions. 3698 * line-map.c: Include cpplib.h, internal.h 3699 (linemap_enter_macro, linemap_add_macro_token) 3700 (linemap_get_expansion_line, linemap_get_expansion_filename): New 3701 functions that are private to libcpp. 3702 (linemap_assert): New macro. 3703 (linemap_macro_loc_to_exp_point, linemap_macro_loc_to_exp_point) 3704 (linemap_macro_loc_unwind, linemap_macro_map_loc_to_def_point) 3705 (linemap_macro_map_loc_unwind_toward_spelling) 3706 (linemap_macro_map_loc_to_exp_point) 3707 (first_map_in_common_1, first_map_in_common): New static 3708 functions. 3709 (new_linemap): Define new static functions. Extracted and 3710 enhanced from ... 3711 (linemap_add): ... here. Use linemap_assert in lieu of abort 3712 previously. 3713 (linemap_tracks_macro_expansion_locs_p) 3714 (linemap_add_macro_token, linemap_macro_expansion_map_p) 3715 (linemap_check_ordinary, linemap_macro_map_loc_to_exp_point) 3716 (linemap_macro_map_loc_to_def_point) 3717 (linemap_macro_map_loc_unwind_once) 3718 (linemap_step_out_once, linemap_map_get_index) 3719 (linemap_get_source_line,linemap_get_source_column) 3720 (linemap_get_file_path, linemap_map_get_macro_name) 3721 (linemap_location_in_system_header_p) 3722 (linemap_location_originated_from_system_header_p) 3723 (linemap_location_from_macro_expansion_p) 3724 (linemap_tracks_macro_expansion_locs_p) 3725 (linemap_resolve_location, linemap_expand_location) 3726 (linemap_expand_location_full) 3727 (linemap_tracks_macro_expansion_locs_p) 3728 (linemap_position_for_line_and_column, linemap_compare_locations): 3729 Define new public functions. 3730 (linemap_init): Initialize ordinary and macro maps information in 3731 the map set. 3732 (linemap_check_files_exited): Use the new accessors. 3733 (linemap_free): Remove this dead code. 3734 (linemap_line_start): Assert this uses an ordinary map. Adjust to 3735 use the new ordinary map accessors and data structures. Don't 3736 overflow past the lowest possible macro token's location. 3737 (linemap_position_for_column): Assert the ordinary maps of the map 3738 set are really ordinary. Use ordinary map accessors. 3739 (linemap_lookup): Keep the same logic but generalize to allow 3740 lookup of both ordinary and macro maps. Do not crash when called 3741 with an empty line table. 3742 * directives-only.c (_cpp_preprocess_dir_only): Adjust to use the 3743 new API of line-map.h. 3744 * directives.c (start_directive, do_line, do_linemarker) 3745 (do_linemarker): Likewise. 3746 * files.c (_cpp_find_file, _cpp_stack_include, open_file_failed) 3747 (make_cpp_dir, cpp_make_system_header): Likewise. 3748 * init.c (cpp_read_main_file): Likewise. 3749 * internal.h (CPP_INCREMENT_LINE): Likewise. 3750 (linemap_enter_macro, linemap_add_macro_token) 3751 (linemap_get_expansion_line, linemap_get_expansion_filename): New 3752 functions private to libcpp. 3753 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment) 3754 (skip_line_comment, skip_whitespace, lex_raw_string) 3755 (_cpp_lex_direct): Likewise. 3756 * macro.c (_cpp_builtin_macro_text): Likewise. 3757 (_cpp_aligned_alloc): Initialize the new name member of the macro. 3758 * traditional.c (copy_comment, _cpp_scan_out_logical_line): 3759 Likewise. 3760 * errors.c (cpp_diagnostic): Adjust to new linemap API. 3761 37622011-08-28 Dodji Seketeli <dodji@redhat.com> 3763 3764 * line-map.c (linemap_add): Assert that reason must not be 3765 LC_RENAME when called for the first time on a "main input file". 3766 37672011-08-22 Gabriel Charette <gchare@google.com> 3768 3769 * init.c (cpp_create_reader): Inititalize forced_token_location_p. 3770 * internal.h (struct cpp_reader): Add field forced_token_location_p. 3771 * lex.c (_cpp_lex_direct): Use forced_token_location_p. 3772 (cpp_force_token_locations): New. 3773 (cpp_stop_forcing_token_locations): New. 3774 37752011-08-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> 3776 3777 PR libstdc++/1773 3778 * init.c (cpp_init_builtins): Define __cplusplus 19971L. 3779 37802011-08-18 Joseph Myers <joseph@codesourcery.com> 3781 3782 * include/cpplib.h (struct cpp_options): Fix typo. 3783 37842011-08-18 Joseph Myers <joseph@codesourcery.com> 3785 3786 * include/cpplib.h (struct cpp_options): Add rliterals. 3787 * init.c (struct lang_flags, lang_defaults): Add rliterals. 3788 (cpp_set_lang): Set rliterals option. 3789 (cpp_init_builtins): Define __STDC_UTF_16__ and __STDC_UTF_32__. 3790 * lex.c (_cpp_lex_direct): Only accept raw strings if rliterals. 3791 37922011-08-15 Gabriel Charette <gchare@google.com> 3793 3794 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Remove. 3795 Update all users to use linemap_position_for_column instead. 3796 37972011-07-28 Gabriel Charette <gchare@google.com> 3798 3799 * include/line-map.h (struct line_maps): 3800 Remove unused field last_listed. Update all users. 3801 38022011-07-28 H.J. Lu <hongjiu.lu@intel.com> 3803 3804 * configure.ac: Set need_64bit_hwint to yes for x86 targets. 3805 * configure: Regenerated. 3806 38072011-07-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> 3808 3809 * system.h [__cplusplus]: Wrap C function declarations in extern "C". 3810 38112011-07-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> 3812 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> 3813 3814 PR bootstrap/49794 3815 * configure.ac: Test AM_ICONV with CXX. 3816 * configure: Regenerate. 3817 * system.h (HAVE_DESIGNATED_INITIALIZERS): Never define for C++. 3818 38192011-07-15 Dodji Seketeli <dodji@redhat.com> 3820 3821 * directives.c (struct if_stack): Use source_location as type 3822 here. 3823 * include/cpplib.h (struct cpp_callbacks)<include, define, undef, 3824 indent, def_pragma, used_define, used_undef>: Properly use 3825 source_location as parameter type, rather than unsigned int. 3826 38272011-07-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> 3828 3829 PR target/39150 3830 * configure.ac (host_wide_int): Handle x86_64-*-solaris2.1[0-9] 3831 like i[34567]86-*-solaris2.1[0-9]*. 3832 * configure: Regenerate. 3833 38342011-06-16 Jason Merrill <jason@redhat.com> 3835 3836 PR c++/45399 3837 * lex.c (lex_raw_string): Don't check for embedded NUL. 3838 38392011-06-06 Dodji Seketeli <dodji@redhat.com> 3840 3841 PR preprocessor/48532 3842 * directives.c (do_pragma): Don't forget the invocation location 3843 when parsing the pragma name of a namespaced pragma directive. 3844 38452011-05-29 John Tytgat <John.Tytgat@aaug.net> 3846 3847 * files.c (read_file_guts): Add test on non-zero value of S_ISREG. 3848 38492011-05-22 Uros Bizjak <ubizjak@gmail.com> 3850 3851 PR target/49104 3852 * lex.c (init_vectorized_lexer): Do not set "minimum" when __3dNOW_A__ 3853 is defined. Check bit_MMXEXT and bit_CMOV to use search_line_mmx. 3854 38552011-04-25 Jan Kratochvil <jan.kratochvil@redhat.com> 3856 3857 * system.h (ENUM_BITFIELD): Remove. 3858 38592011-04-24 Jakub Jelinek <jakub@redhat.com> 3860 3861 PR preprocessor/48740 3862 * lex.c (lex_raw_string): When raw string ends with 3863 ??) followed by raw prefix and ", ensure it is preprocessed 3864 with ??) rather than ??]. 3865 38662011-04-20 Jim Meyering <meyering@redhat.com> 3867 3868 * files.c (destroy_cpp_file): Remove useless if-before-free. 3869 * init.c (cpp_destroy): Likewise. 3870 * macro.c (replace_args): Likewise. 3871 * pch.c (cpp_valid_state): Likewise. 3872 38732011-03-25 Kai Tietz <ktietz@redhat.com> 3874 3875 * files.c (file_hash_eq): Use filename_cmp 3876 instead of strcmp. 3877 (nonexistent_file_hash_eq): Likewise. 3878 (remap_filename): Likewise. 3879 Handle absolute DOS-path, 3880 (append_file_to_dir): Check for IS_DIR_SEPARATOR 3881 instead of slash. 3882 (read_name_map): Likewise. 3883 * linemap.c (linemap_add): Use filename_cmp 3884 instead of strcmp. 3885 * mkdeps.c (apply_vpath): Use filename_ncmp 3886 instead of strncmp. 3887 (deps_restore): Use filename_cmp instead of 3888 strcmp. 3889 * init.c (read_original_directory): Use 3890 IS_DIR_SEPARATOR instead of checking for slash. 3891 38922011-03-21 Michael Meissner <meissner@linux.vnet.ibm.com> 3893 3894 PR preprocessor/48192 3895 * directives.c (do_ifdef): Do not consider conditional macros as 3896 being defined. 3897 (do_ifndef): Ditto. 3898 * expr.c (parse_defined): Ditto. 3899 39002011-03-18 Richard Henderson <rth@redhat.com> 3901 3902 PR bootstrap/45381 3903 * lex.c [ALTIVEC] (search_line_fast): Require gcc version 4.5. 3904 39052011-11-04 Eric Botcazou <ebotcazou@adacore.com> 3906 Jakub Jelinek <jakub@redhat.com> 3907 3908 PR preprocessor/39213 3909 * directives.c (end_directive): Call _cpp_remove_overlay for deferred 3910 pragmas as well in traditional mode. 3911 39122010-11-17 Ian Lance Taylor <iant@google.com> 3913 3914 PR bootstrap/45538 3915 * configure.ac: Use AC_USE_SYSTEM_EXTENSIONS. Remove switch of 3916 AC_LANG based on ENABLE_BUILD_WITH_CXX. 3917 39182010-11-16 Kai Tietz <kai.tietz@onevision.com> 3919 3920 PR preprocessor/17349 3921 * lex.c (save_comment): Handle in argument passing c++ 3922 comments special. 3923 39242010-11-02 Ian Lance Taylor <iant@google.com> 3925 3926 * configure.ac: Use AC_SYS_LARGEFILE. 3927 * configure: Rebuild. 3928 * config.in: Rebuild. 3929 39302010-10-19 Basile Starynkevitch <basile@starynkevitch.net> 3931 3932 * line-map.h (source_location): Remove obsolete comment 3933 mentioning location_s. 3934 39352010-09-29 Kai Tietz <kai.tietz@onevision.com> 3936 3937 PR preprocessor/45362 3938 * directives.c (cpp_pop_definition): Make static. 3939 (do_pragma_push_macro): Reworked to store text 3940 definition. 3941 (do_pragma_pop_macro): Add free text definition. 3942 (cpp_push_definition): Removed. 3943 * include/cpplib.h (cpp_push_definition): Removed. 3944 (cpp_pop_definition): Likewise. 3945 * internal.h (def_pragma_macro): Remove member 'value' 3946 and add new members 'definition', 'line', 3947 'syshdr', 'sued' and 'is_undef'. 3948 * pch.c (_cpp_restore_pushed_macros): Rework to work 3949 on text definition and store additional macro flags. 3950 (_cpp_save_pushed_macros): Likewise. 3951 39522010-09-29 Joseph Myers <joseph@codesourcery.com> 3953 3954 * include/cpplib.h (cpp_options): Rename warn_deprecated, 3955 warn_traditional, warn_long_long and pedantic. 3956 * directives.c (directive_diagnostics, _cpp_handle_directive): 3957 Update names of cpp_options members. 3958 * expr.c (cpp_classify_number, eval_token): Update names of 3959 cpp_options members. 3960 * init.c (cpp_create_reader, post_options): Update names of 3961 cpp_options members. 3962 * internal.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Update names of 3963 cpp_options members. 3964 * macro.c (parse_params): Update names of cpp_options members. 3965 39662010-09-15 Ian Lance Taylor <iant@google.com> 3967 3968 * init.c: Fix type name in comment. 3969 39702010-08-31 Jakub Jelinek <jakub@redhat.com> 3971 3972 PR preprocessor/45457 3973 * expr.c (parse_defined): Call pfile->cb.user_builtin_macro hook if 3974 needed. 3975 * directives.c (do_ifdef, do_ifndef): Likewise. 3976 39772010-08-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> 3978 3979 * system.h [HAVE_INTTYPES_H]: Include inttypes.h. 3980 39812010-08-24 Richard Henderson <rth@redhat.com> 3982 3983 PR bootstrap/45376 3984 * configure.ac (HAVE_SSE4): New check. 3985 * configure, config.in: Rebuild. 3986 * lex.c (search_line_sse42): Omit if !HAVE_SSE4. 3987 39882010-08-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> 3989 3990 * lex.c [__sun__ && __svr4__]: Disable init_vectorized_lexer 3991 etc. on Solaris 2/x86. 3992 39932010-08-21 Richard Henderson <rth@redhat.com> 3994 Andi Kleen <ak@linux.intel.com> 3995 David S. Miller <davem@davemloft.net> 3996 3997 * configure.ac (AC_C_BIGENDIAN, AC_TYPE_UINTPTR_T): New tests. 3998 (ssize_t): Check via AC_TYPE_SSIZE_T instead of AC_CHECK_TYPE. 3999 (ptrdiff_t): Check via AC_CHECK_TYPE. 4000 * config.in, configure: Rebuild. 4001 * system.h: Include stdint.h, if available. 4002 * lex.c (WORDS_BIGENDIAN): Provide default. 4003 (acc_char_mask_misalign, acc_char_replicate, acc_char_cmp, 4004 acc_char_index, search_line_acc_char, repl_chars, search_line_mmx, 4005 search_line_sse2, search_line_sse42, init_vectorized_lexer, 4006 search_line_fast): New. 4007 (_cpp_clean_line): Use search_line_fast. Restructure the fast 4008 loop to make it clear when we're leaving the loop. Stay in the 4009 fast loop for non-trigraph '?'. 4010 40112010-06-11 Jakub Jelinek <jakub@redhat.com> 4012 4013 * include/cpplib.h (struct cpp_callbacks): Add user_builtin_macro 4014 callback. 4015 (enum cpp_builtin_type): Add BT_FIRST_USER and BT_LAST_USER. 4016 (cpp_macro_definition): Remove const qual from second argument. 4017 * macro.c (enter_macro_context): Call user_builtin_macro callback for 4018 NODE_BUILTIN !NODE_USED macros. 4019 (warn_of_redefinition): Likewise. Remove const qual from second 4020 argument. 4021 (cpp_macro_definition): Likewise. 4022 * pch.c (write_macdef, save_macros): Call user_builtin_macro callback 4023 for NODE_BUILTIN !NODE_USED macros. 4024 40252010-06-10 Joseph Myers <joseph@codesourcery.com> 4026 4027 * include/cpplib.h (struct cpp_options): Remove show_column. 4028 * init.c (cpp_create_reader, post_options): Don't set show_column. 4029 40302010-06-09 Joern Rennecke <joern.rennecke@embecosm.com> 4031 4032 PR bootstrap/44432 4033 * configure.ac: Before using ZW_PROG_COMPILER_DEPENDENCIES for C++, 4034 check that C++ compiler works. 4035 * configure: Regenerate. 4036 40372010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> 4038 4039 * include/symtab.h (ht_identifier_ptr): New. 4040 40412010-06-03 Joern Rennecke <joern.rennecke@embecosm.com> 4042 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> 4043 4044 PR bootstrap/42798 4045 * configure.ac: Check for declaration of 'basename(char *)'. 4046 * configure: Regenerate. 4047 * config.in: Regenerate. 4048 40492010-04-25 Joseph Myers <joseph@codesourcery.com> 4050 4051 * include/cpplib.h (enum c_lang): Add CLK_GNUC1X and CLK_STDC1X. 4052 * init.c (lang_defaults): Add entries for new language variants. 4053 (cpp_init_builtins): Define __STDC_VERSION__ to 201000L for C1X 4054 variants. 4055 40562010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org> 4057 4058 PR cpp/43195 4059 * files.c (report_missing_guard): Test for #pragma once. 4060 40612010-04-07 Simon Baldwin <simonb@google.com> 4062 4063 * directives.c (do_diagnostic): Add warning reason argument, 4064 call appropriate error reporting function for code. 4065 (directive_diagnostics): Call specific warning functions with 4066 warning reason where appropriate. 4067 (do_error, do_warning, do_pragma_dependency): Add warning reason 4068 argument to do_diagnostic calls. 4069 * macro.c (_cpp_warn_if_unused_macro, enter_macro_context, 4070 _cpp_create_definition): Call specific warning functions with 4071 warning reason where appropriate. 4072 * Makefile.in: Add new diagnostic functions to gettext translations. 4073 * include/cpplib.h (struct cpp_callbacks): Add warning reason code 4074 to error callback. 4075 (CPP_DL_WARNING, CPP_DL_WARNING_SYSHDR, CPP_DL_PEDWARN, CPP_DL_ERROR, 4076 CPP_DL_ICE, CPP_DL_NOTE, CPP_DL_FATAL): Replace macros with enums. 4077 (CPP_W_NONE, CPP_W_DEPRECATED, CPP_W_COMMENTS, 4078 CPP_W_MISSING_INCLUDE_DIRS, CPP_W_TRIGRAPHS, CPP_W_MULTICHAR, 4079 CPP_W_TRADITIONAL, CPP_W_LONG_LONG, CPP_W_ENDIF_LABELS, 4080 CPP_W_NUM_SIGN_CHANGE, CPP_W_VARIADIC_MACROS, 4081 CPP_W_BUILTIN_MACRO_REDEFINED, CPP_W_DOLLARS, CPP_W_UNDEF, 4082 CPP_W_UNUSED_MACROS, CPP_W_CXX_OPERATOR_NAMES, CPP_W_NORMALIZE, 4083 CPP_W_INVALID_PCH, CPP_W_WARNING_DIRECTIVE): New enums for cpp 4084 warning reason codes. 4085 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr, 4086 cpp_warning_with_line, cpp_pedwarning_with_line, 4087 cpp_warning_with_line_syshdr): New specific error reporting functions. 4088 * pch.c (cpp_valid_state): Call specific warning functions with 4089 warning reason where appropriate. 4090 * errors.c (cpp_diagnostic, cpp_diagnostic_with_line): New central 4091 diagnostic handlers. 4092 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr, 4093 cpp_warning_with_line, cpp_pedwarning_with_line, 4094 cpp_warning_with_line_syshdr): New specific error reporting functions. 4095 * expr.c (cpp_classify_number, eval_token, num_unary_op): Call 4096 specific warning functions with warning reason where appropriate. 4097 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment, 4098 warn_about_normalization, lex_identifier_intern, lex_identifier, 4099 _cpp_lex_direct): Ditto. 4100 * charset.c (_cpp_valid_ucn, convert_hex, convert_escape, 4101 narrow_str_to_charconst): Ditto. 4102 41032010-04-06 Jakub Jelinek <jakub@redhat.com> 4104 4105 PR preprocessor/43642 4106 * lex.c (lex_raw_string): Change type of TYPE variable to 4107 unsigned char. 4108 41092010-04-02 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> 4110 4111 * aclocal.m4: Regenerate. 4112 41132010-03-29 Jason Merrill <jason@redhat.com> 4114 4115 More N3077 raw string changes 4116 * charset.c (cpp_interpret_string): Don't transform UCNs in raw 4117 strings. 4118 * lex.c (bufring_append): Split out from... 4119 (lex_raw_string): ...here. Undo trigraph and line splicing 4120 transformations. Do process line notes in multi-line literals. 4121 (_cpp_process_line_notes): Ignore notes that were already handled. 4122 4123 Some raw string changes from N3077 4124 * charset.c (cpp_interpret_string): Change inner delimiters to (). 4125 * lex.c (lex_raw_string): Likewise. Also disallow '\' in delimiter. 4126 41272010-02-11 Jakub Jelinek <jakub@redhat.com> 4128 4129 * init.c (read_original_filename): Don't call read_original_directory 4130 if _cpp_handle_directive returns 0. 4131 41322010-01-01 Joseph Myers <joseph@codesourcery.com> 4133 4134 PR preprocessor/41947 4135 * expr.c (cpp_classify_number): Give error for hexadecimal 4136 floating-point constant with no digits before or after point. 4137 41382009-11-20 Arnaud Charlet <charlet@adacore.com> 4139 4140 * macro.c (enter_macro_context): Call cb.used callback if defined. 4141 * directives.c (do_idef, do_ifndef): Ditto. 4142 * include/cpplib.h (struct cpp_callbacks): Add used callback. 4143 41442009-11-11 Kai Tietz <kai.tietz@onevision.com> 4145 4146 * directives.c (do_pragma_push_macro): New pragma handler. 4147 (do_pragma_pop_macro): Likewise. 4148 (_cpp_init_internal_pragmas): Add push_macro and 4149 pop_macro handler to internal pragmas. 4150 (lex_macro_node_from_str): Removed. 4151 (cpp_push_definition): Replace lex_macro_node_from_str 4152 by _cpp_lex_identifier. 4153 (cpp_pop_definition): Likewise. 4154 * internal.h (_cpp_lex_identifier): New prototype. 4155 (def_pragma_macro): New structure. 4156 (cpp_reader): New member pushed_macros. 4157 * lex.c (_cpp_lex_identifier): New function. 4158 (lex_identifier_intern): New function. 4159 * init.c (cpp_create_reader): Initialize pushed_macros 4160 member. 4161 (cpp_destroy): Free elements in pushed_macros member. 4162 * pch.c (_cpp_save_pushed_macros): New function. 4163 (_cpp_restore_pushed_macros): Likewise. 4164 (_cpp_restore_pushed_macros): Use _cpp_save_pushed_macros. 4165 (cpp_read_state): Use _cpp_restore_pushed_macros. 4166 41672009-10-19 Jakub Jelinek <jakub@redhat.com> 4168 4169 * charset.c (cpp_init_iconv): Initialize utf8_cset_desc. 4170 (_cpp_destroy_iconv): Destroy utf8_cset_desc, char16_cset_desc 4171 and char32_cset_desc. 4172 (converter_for_type): Handle CPP_UTF8STRING. 4173 (cpp_interpret_string): Handle CPP_UTF8STRING and raw-strings. 4174 * directives.c (get__Pragma_string): Handle CPP_UTF8STRING. 4175 (parse_include): Reject raw strings. 4176 * include/cpplib.h (CPP_UTF8STRING): New token type. 4177 * internal.h (struct cpp_reader): Add utf8_cset_desc field. 4178 * lex.c (lex_raw_string): New function. 4179 (lex_string): Handle u8 string literals, call lex_raw_string 4180 for raw string literals. 4181 (_cpp_lex_direct): Call lex_string even for u8" and {,u,U,L,u8}R" 4182 sequences. 4183 * macro.c (stringify_arg): Handle CPP_UTF8STRING. 4184 41852009-10-14 Jakub Jelinek <jakub@redhat.com> 4186 4187 PR preprocessor/41543 4188 * include/line-map.h (RESERVED_LOCATION_COUNT): Define. 4189 * line-map.c (linemap_init): Initialize highest_location and 4190 highest_line to RESERVED_LOCATION_COUNT-1 instead of 0. 4191 41922009-10-09 Jason Merrill <jason@redhat.com> 4193 4194 * charset.c (_cpp_valid_ucn): Update C++0x restrictions. 4195 41962009-10-09 Neil Vachharajani <nvachhar@google.com> 4197 4198 * directives.c (DIRECTIVE_TABLE): Remove DEPRECATED from ident and 4199 sccs. 4200 42012009-09-23 Loren J. Rittle <ljrittle@acm.org> 4202 4203 * configure.ac (AC_CHECK_HEADERS after AC_LANG(C++)): Add sys/stat.h. 4204 * configure: Rebuilt. 4205 42062009-09-22 Richard Guenther <rguenther@suse.de> 4207 4208 PR pch/38987 4209 * files.c (pch_open_file): Disallow non-toplevel PCH inclusion. 4210 42112009-09-18 Chris Demetriou <cgd@google.com> 4212 4213 PR preprocessor/28435: 4214 * include/cpplib.h (struct cpp_options): Add new member 4215 deps.need_preprocessor_output. 4216 * files.c (open_file_failed): If preprocessor output is needed 4217 always report an error. 4218 42192009-09-13 Kai Tietz <kai.tietz@onevision.com> 4220 4221 * configure.ac: Set for i?86-w64-mingw* 4222 need_64bit_hwint to yes. 4223 * configure: Regenerated. 4224 42252009-09-10 Jason Merrill <jason@redhat.com> 4226 4227 * directives.c (cpp_define): constify. 4228 42292009-09-02 Ian Lance Taylor <iant@google.com> 4230 4231 * macro.c (stringify_arg): Escape CPP_WCHAR tokens. 4232 42332009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> 4234 4235 * configure.ac (AC_PREREQ): Bump to 2.64. 4236 42372009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> 4238 4239 * aclocal.m4: Regenerate. 4240 * config.in: Regenerate. 4241 * configure: Regenerate. 4242 42432009-08-17 Tom Tromey <tromey@redhat.com> 4244 4245 PR preprocessor/41067: 4246 * charset.c (convert_escape): Add missing ":" to error text. 4247 42482009-07-27 Douglas B Rupp <rupp@gnat.com> 4249 4250 * include/cpplib.h (INO_T_CPP): New macro. 4251 (struct cpp_dir): Use it. 4252 42532009-07-20 Jerry Quinn <jlquinn@optonline.net> 4254 4255 PR regression/40800 4256 * configure.ac: Use = instead of == for testing 4257 ENABLE_BUILD_WITH_CXX. 4258 * configure: Rebuild. 4259 42602009-07-17 Jerry Quinn <jlquinn@optonline.net> 4261 4262 * directives.c (do_linemarker, do_line): Use CPP_STRING for 4263 ignored enum value. 4264 * files.c (find_file_in_dir): Add cast from void* to char*. 4265 * symtab.c (ht_lookup_with_hash): Add cast from void* to char*. 4266 * Makefile.in: (WARN_CFLAGS): Use general and C-specific 4267 warnings. 4268 (CXX, CXXFLAGS, WARN_CXXFLAGS, ALL_CXXFLAGS, 4269 ENABLE_BUILD_WITH_CXX, CCDEPMODE, CXXDEPMODE, COMPILER, 4270 COMPILER_FLAGS): New. 4271 (DEPMODE): Set from CCDEPMODE or CXXDEPMODE. 4272 (COMPILE.base): Use COMPILER instead of CC. Use COMPILER_FLAGS 4273 instead of ALL_CFLAGS. 4274 * configure.ac: Invoke AC_PROG_CXX. Separate C-specific warnings 4275 from other warnings. Add -Wc++-compat to C-specific warnings. 4276 Check for --enable-build-with-cxx. Set and substitute 4277 ENABLE_BUILD_WITH_CXX. Invoke ZW_PROG_COMPILER_DEPENDENCIES 4278 according to ENABLE_BUILD_WITH_CXX. Invoke AC_LANG before 4279 AC_CHECK_HEADERS. 4280 * configure: Rebuild. 4281 * include/cpp-id-data.h: Remove extern "C". 4282 * include/line-map.h: Likewise. 4283 * include/mkdeps.h: Likewise. 4284 * include/symtab.h: Likewise. 4285 * internal.h: Likewise. 4286 42872009-06-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org> 4288 4289 * directives.c (parse_include): Add location argument. Update all 4290 calls. 4291 (parse_answer): Likewise. 4292 (do_include_common): Error with exact location. 4293 (parse_assertion): Likewise. 4294 42952009-06-18 Manuel López-Ibáñez <manu@gcc.gnu.org> 4296 4297 * expr.c (num_div_op): Take explicit location. 4298 42992009-06-17 Ian Lance Taylor <iant@google.com> 4300 4301 * include/cpplib.h (progname): Don't declare. 4302 43032009-06-12 Ian Lance Taylor <iant@google.com> 4304 4305 * include/cpplib.h (struct cpp_options): Add 4306 warn_cxx_operator_names field. 4307 (NODE_WARN_OPERATOR): Define. 4308 (struct cpp_hashnode): Increase flags field to 10 bits, decrease 4309 type to 6 bits. 4310 * init.c (mark_named_operators): Add flags parameter. 4311 (cpp_post_options): Pick flags value to pass to 4312 mark_named_operators. 4313 * lex.c (lex_identifier): If NODE_WARN_OPERATOR is set, warn that 4314 identifier is an operator name in C++. 4315 43162009-06-01 Aldy Hernandez <aldyh@redhat.com> 4317 4318 * include/line-map.h (LAST_SOURCE_COLUMN): New. 4319 43202009-06-01 Ian Lance Taylor <iant@google.com> 4321 4322 * include/cpp-id-data.h: Add extern "C". 4323 * include/line-map.h: Likewise. 4324 * include/mkdeps.h: Likewise. 4325 * include/symtab.h: Likewise. 4326 * internal.h: Likewise. 4327 43282009-05-15 Ian Lance Taylor <iant@google.com> 4329 4330 * include/cpplib.h (enum cpp_builtin_type): Rename from enum 4331 builtin_type. Change all uses. 4332 43332009-05-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org> 4334 4335 PR cpp/36674 4336 * directives (do_linemarker): Compensate for the increment in 4337 location that occurs when we reach the end of line. 4338 * files (_cpp_stack_include): Mention _cpp_find_file in the 4339 comment. 4340 43412009-05-10 Joseph Myers <joseph@codesourcery.com> 4342 4343 * include/cpplib.h (enum cpp_token_fld_kind): Add 4344 CPP_TOKEN_FLD_TOKEN_NO. 4345 (struct cpp_macro_arg, struct cpp_identifier): Define. 4346 (union cpp_token_u): Use struct cpp_identifier for identifiers. 4347 Use struct cpp_macro_arg for macro arguments. Add token_no for 4348 CPP_PASTE token numbers. 4349 * directives.c (_cpp_handle_directive, lex_macro_node, do_pragma, 4350 do_pragma_poison, parse_assertion): Use val.node.node in place of 4351 val.node. 4352 * expr.c (parse_defined, eval_token): Use val.node.node in place 4353 of val.node. 4354 * lex.c (cpp_ideq, _cpp_lex_direct, cpp_token_len, 4355 cpp_spell_token, cpp_output_token, _cpp_equiv_tokens, 4356 cpp_token_val_index): Use val.macro_arg.arg_no or val.token_no in 4357 place of val.arg_no. Use val.node.node in place of val.node. 4358 * macro.c (replace_args, cpp_get_token, parse_params, 4359 lex_expansion_token, create_iso_definition, cpp_macro_definition): 4360 Use val.macro_arg.arg_no or val.token_no in place of val.arg_no. 4361 Use val.node.node in place of val.node. 4362 43632009-05-03 Joseph Myers <joseph@codesourcery.com> 4364 4365 * charset.c (one_utf8_to_cppchar): Correct mask used for 5-byte 4366 UTF-8 sequences. 4367 43682009-04-25 Joseph Myers <joseph@codesourcery.com> 4369 4370 PR preprocessor/39559 4371 * expr.c (cpp_interpret_integer): Use a pedwarn for decimal 4372 constants larger than intmax_t in C99 mode. 4373 43742009-04-21 Taras Glek <tglek@mozilla.com> 4375 4376 * include/cpp-id-data.h: Update GTY annotations to new syntax. 4377 * include/cpplib.h: Likewise. 4378 * include/line-map.h: Likewise. 4379 * include/symtab.h: Likewise. 4380 43812009-04-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org> 4382 4383 PR c++/14875 4384 * lex.c (cpp_type2name): Take a flags parameter. Call 4385 cpp_named_operator2name for named operators and cpp_digraph2name 4386 for digraphs. 4387 (cpp_digraph2name): New. 4388 (cpp_spell_token): Use it. 4389 (cpp_output_token): Likewise. 4390 * include/cpplib.h (cpp_type2name): Update declaration. 4391 * init.c (cpp_named_operator2name): New. 4392 * internal.h (cpp_named_operator2name): Declare. 4393 43942009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org> 4395 4396 PR c++/13358 4397 * init.c (cpp_create_reader): Wlong_long is disabled by default. 4398 * expr.c (cpp_classify_number): Give different messages for C and 4399 C++ front-ends. 4400 44012009-04-19 Joseph Myers <joseph@codesourcery.com> 4402 4403 PR preprocessor/20078 4404 * include/cpp-id-data.h (struct cpp_macro): Add extra_tokens 4405 field. 4406 * include/cpplib.h (SP_DIGRAPH, SP_PREV_WHITE): Define. 4407 (struct cpp_token): Change flags to unsigned short. 4408 * lex.c (_cpp_lex_direct): Initialize arg_no for CPP_PASTE tokens. 4409 (_cpp_equiv_tokens): Check arg_no for CPP_PASTE tokens. 4410 (cpp_token_val_index): Return CPP_TOKEN_FLD_ARG_NO for CPP_PASTE 4411 tokens. 4412 * macro.c (macro_real_token_count): New. 4413 (enter_macro_context, replace_args): Use macro_real_token_count. 4414 (create_iso_definition): Record whitespace surrounding and digraph 4415 spelling of # and ## tokens using SP_PREV_WHITE and SP_DIGRAPH. 4416 Set extra_tokens and save CPP_PASTE tokens with arg_no set for 4417 multiple consecutive ## tokens. 4418 (_cpp_create_definition): Initialize extra_tokens. 4419 (cpp_macro_definition): Use macro_real_token_count. 4420 44212009-04-18 Joseph Myers <joseph@codesourcery.com> 4422 4423 * directives.c (parse_include): Pass true to check_eol. 4424 44252009-04-18 Joseph Myers <joseph@codesourcery.com> 4426 4427 PR preprocessor/39646 4428 * include/line-map.h (enum lc_reason): Add LC_RENAME_VERBATIM. 4429 * line-map.c (linemap_add): Handle LC_RENAME_VERBATIM. 4430 * directives.c (do_line, do_linemarker): Use LC_RENAME_VERBATIM in 4431 place of LC_RENAME. 4432 44332009-04-18 Joseph Myers <joseph@codesourcery.com> 4434 4435 PR preprocessor/39647 4436 * directives.c (check_eol): Add parameter expand. 4437 (do_undef, parse_include, do_line, do_linemarker, do_ident, 4438 do_pragma_once, do_pragma_system_header, do_ifdef, do_ifndef, 4439 do_else, do_endif, do_assert, do_unassert): All callers changed. 4440 Pass true from do_line, false elsewhere. 4441 44422009-04-12 Joseph Myers <joseph@codesourcery.com> 4443 4444 PR preprocessor/31869 4445 * macro.c (stringify_arg): Handle NULL source token in padding 4446 token where previous padding token did not have source token with 4447 preceding whitespace. 4448 44492009-04-09 Jakub Jelinek <jakub@redhat.com> 4450 4451 * Makefile.in: Change copyright header to refer to version 4452 3 of the GNU General Public License and to point readers at the 4453 COPYING3 file and the FSF's license web page. 4454 * charset.c: Likewise. 4455 * directives-only.c: Likewise. 4456 * directives.c: Likewise. 4457 * errors.c: Likewise. 4458 * expr.c: Likewise. 4459 * files.c: Likewise. 4460 * identifiers.c: Likewise. 4461 * include/cpp-id-data.h: Likewise. 4462 * include/cpplib.h: Likewise. 4463 * include/line-map.h: Likewise. 4464 * include/mkdeps.h: Likewise. 4465 * include/symtab.h: Likewise. 4466 * init.c: Likewise. 4467 * internal.h: Likewise. 4468 * lex.c: Likewise. 4469 * line-map.c: Likewise. 4470 * macro.c: Likewise. 4471 * makeucnid.c: Likewise. 4472 * mkdeps.c: Likewise. 4473 * pch.c: Likewise. 4474 * symtab.c: Likewise. 4475 * system.h: Likewise. 4476 * traditional.c: Likewise. 4477 * ucnid.tab: Likewise. 4478 * ucnid.h: Regenerate. 4479 44802009-04-01 Janis Johnson <janis187@us.ibm.com> 4481 4482 PR c/39027 4483 * include/cpplib.h (CPP_N_DEFAULT): Define. 4484 * expr.c (interpret_float_suffix): Recognize d or D for double, 4485 return new value for default. 4486 (cpp_classify_number): Issue pedwarn for use of d or D in suffix. 4487 4488 PR c/33466 4489 * expr.c (interpret_float_suffix): Reject invalid suffix that uses 4490 letters from decimal float and fixed-point suffixes. 4491 44922009-03-31 Joseph Myers <joseph@codesourcery.com> 4493 4494 PR preprocessor/15638 4495 * files.c (_cpp_find_file): Call open_file_failed after diagnosing 4496 invalid PCH. 4497 (open_file_failed): Make error for missing file fatal. 4498 * include/cpplib.h (CPP_DL_FATAL): Define. 4499 45002009-03-30 Sergiy Vyshnevetskiy <serg@vostok.net> 4501 4502 PR preprocessor/31932: 4503 * internal.h: Don't mention HAVE_ICONV_H. 4504 * configure, config.in: Rebuild. 4505 * configure.ac: Don't check for iconv.h. 4506 45072009-03-30 Tom Tromey <tromey@redhat.com> 4508 4509 PR preprocessor/39512: 4510 * line-map.c (linemap_init): Initialize 'reallocator' field. 4511 45122009-03-30 Jakub Jelinek <jakub@redhat.com> 4513 4514 PR target/39558 4515 * macro.c (cpp_get_token): If macro_to_expand returns NULL 4516 and used some tokens, add CPP_PADDING before next token. 4517 45182009-03-29 Joseph Myers <joseph@codesourcery.com> 4519 4520 PR preprocessor/34695 4521 * makedepend.c: Remove. 4522 * Makefile.in (makedepend_OBJS, makedepend$(EXEEXT)): Remove. 4523 (all, clean, TAGS_SOURCES, include): Remove makedepend handling. 4524 * directives.c (cpp_errors): Remove. 4525 * errors.c (print_location, _cpp_begin_message, v_message): 4526 Remove. 4527 (cpp_error, cpp_error_with_line): Always use error callback. 4528 (cpp_error, cpp_error_with_line, cpp_errno): Return bool. 4529 * include/cpplib.h (cpp_options): Remove pedantic_errors, 4530 inhibit_warnings, warn_system_headers, inhibit_errors, 4531 warnings_are_errors, client_diagnostic. 4532 (cpp_callbacks): Add extra arguments to error callback; make it 4533 return bool. 4534 (cpp_finish): Return void. 4535 (cpp_destroy): Remove inaccurate comment about return value. 4536 (cpp_errors, CPP_DL_EXTRACT, CPP_DL_WARNING_P): Remove. 4537 (CPP_DL_NOTE): Define. 4538 * include/line-map.h (linemap_print_containing_files): Remove. 4539 * init.c (cpp_finish): Do not check for or return number of 4540 errors. 4541 * internal.h (cpp_reader): Remove errors field. 4542 * line-map.c (linemap_print_containing_files): Remove. 4543 * macro.c (_cpp_create_definition): Use CPP_DL_NOTE for message 4544 about previous definition. Only emit it if previous diagnostic 4545 was emitted. 4546 45472009-03-28 Joseph Myers <joseph@codesourcery.com> 4548 4549 * Makefile.in (po/$(PACKAGE).pot): Use $(mkinstalldirs) not 4550 mkinstalldirs. 4551 45522009-03-18 Jakub Jelinek <jakub@redhat.com> 4553 4554 * include/cpplib.h (struct cpp_dir): Reorder fields for 64-bit hosts. 4555 45562009-02-21 Joseph Myers <joseph@codesourcery.com> 4557 4558 * lex.c (lex_string): Return a CPP_LESS token for missing '>' in a 4559 header name. 4560 (_cpp_lex_direct): Handle this. 4561 45622009-02-15 Richard Guenther <rguenther@suse.de> 4563 4564 Revert last change. 4565 45662009-02-13 Richard Guenther <rguenther@suse.de> 4567 4568 * configure.ac: Enable LFS. 4569 * configure: Re-generate. 4570 * config.in: Likewise. 4571 45722009-01-05 Ben Elliston <bje@au.ibm.com> 4573 4574 * Makefile.in (.po.gmo): Use mkinstalldirs, not test -d || mkdir. 4575 (.po.pox): Likewise. 4576 (po/$(PACKAGE).pot): Likewise. 4577 45782008-12-10 Alexandre Oliva <aoliva@redhat.com> 4579 4580 PR target/37033 4581 * pch.c (cpp_valid_state): Improve message for poisoned symbols. 4582 Allow for differences in __GCC_HAVE_DWARF2_CFI_ASM. 4583 45842008-11-29 Joseph Myers <joseph@codesourcery.com> 4585 4586 * lex.c (cpp_token_len): Use 6 as default length. 4587 45882008-10-31 Manuel López-Ibáñez <manu@gcc.gnu.org> 4589 4590 * expr.c (struct op): Add location. 4591 (_cpp_parse_expr): Propagate locations throught the stack 4592 of expressions. 4593 (reduce): Likewise. 4594 (check_promotion): Use explicit location in errors. 4595 45962008-10-05 Matthew Gingell <gingell@adacore.com> 4597 Arnaud Charlet <charlet@adacore.com> 4598 4599 * include/cpplib.h (cpp_comments, cpp_comment_table): New structs. 4600 (cpp_get_comments): New function. 4601 * internal.h (struct cpp_reader): Add comments field. 4602 * init.c (cpp_destroy): Free comments. 4603 * lex.c (store_comment, cpp_get_comments): New functions. 4604 (comments): New struct. 4605 (save_comment): Store comments in comments struct. 4606 46072008-09-18 Simon Baldwin <simonb@google.com> 4608 4609 * include/cpplib.h (struct cpp_options): Add new boolean flag 4610 warn_builtin_macro_redefined. 4611 * init.c (cpp_create_reader): Initialize warn_builtin_macro_redefined. 4612 * (struct builtin_operator): Split out from previous struct builtin, 4613 enhance extra const correctness. 4614 * (struct builtin_macro): Split out from previous struct builtin, add 4615 new always_warn_if_redefined flag, enhance const correctness. 4616 * (mark_named_operators): Use struct builtin_operator. 4617 * (cpp_init_special_builtins): Use struct builtin_macro, add NODE_WARN 4618 to builtins selectively. 4619 * macro.c (warn_of_redefinition): Return false if a builtin macro 4620 is not flagged with NODE_WARN. 4621 46222008-07-31 Jakub Jelinek <jakub@redhat.com> 4623 4624 PR preprocessor/36649 4625 * files.c (struct report_missing_guard_data): New type. 4626 (report_missing_guard): Put paths into an array instead of printing 4627 them right away. Return 1 rather than 0. 4628 (report_missing_guard_cmp): New function. 4629 (_cpp_report_missing_guards): Sort and print paths gathered by 4630 report_missing_guard callback. 4631 46322008-07-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org> 4633 4634 PR 28079 4635 * directives.c (strtolinenum): Handle overflow. 4636 (do_line): Give a warning if line number overflowed. 4637 (do_linemarker): Update call to strtolinenum. 4638 46392008-07-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org> 4640 4641 * include/line-map.h (linenum_type): New typedef. 4642 (struct line_map): Use it. 4643 (SOURCE_LINE): Second arguments is a LOCATION not a LINE. 4644 (SOURCE_COLUMN): Likewise. 4645 * macro.c (_cpp_builtin_macro_text): Use linenum_type. Don't store 4646 source_location values in a variable of type linenum_type. 4647 * directives.c (struct if_stack): Use linenum_type. 4648 (strtoul_for_line): Rename as strtolinenum. 4649 (do_line): Use linenum_type. 4650 (do_linemarker): Use linenum_type and strtolinenum. 4651 (_cpp_do_file_change): Use linenum_t. 4652 * line-map.c (linemap_add): Likewise. 4653 (linemap_line_start): Likewise. 4654 * traditional.c (struct fun_macro): 'line' is a source_location. 4655 * errors.c (print_location): Use linenum_type. 4656 * directives-only.c (_cpp_preprocess_dir_only): Likewise. 4657 * internal.h (CPP_INCREMENT_LINE): Likewise. 4658 * lex.c (_cpp_skip_block_comment): Use source_location. 4659 46602008-07-14 Ben Elliston <bje@au.ibm.com> 4661 4662 * include/cpplib.h (NODE_CONDITIONAL): New. 4663 (struct cpp_callbacks): New macro_to_expand field. 4664 (struct cpp_hashnode): Adjust size of flags and type fields. 4665 (cpp_peek_token): Prototype. 4666 * lex.c (cpp_peek_token): New function. 4667 (_cpp_temp_token): Protect pre-existing lookaheads. 4668 * macro.c (cpp_get_token): Expand any conditional macros. 4669 (_cpp_backup_tokens_direct): New. 4670 (_cpp_backup_tokens): Call _cpp_backup_tokens_direct. 4671 (warn_of_redefinition): Silently allow redefined conditional 4672 macros. 4673 (_cpp_create_definition): Remove the conditional flag when a user 4674 defines one of the conditional macros. 4675 * internal.h (_cpp_backup_tokens_direct): New prototype. 4676 46772008-06-13 Andrew Haley <aph@redhat.com> 4678 4679 PR preprocessor/33305 4680 * macro.c (replace_args): Print a warning for empty macro 4681 arguments in C89 and C++. 4682 46832008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> 4684 4685 * Makefile.in ($(srcdir)/aclocal.m4): Update dependencies. 4686 * configure: Regenerate. 4687 46882008-06-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> 4689 4690 * Makefile.in (datarootdir): New variable. 4691 46922008-06-12 H.J. Lu <hongjiu.lu@intel.com> 4693 4694 PR preprocessor/36479 4695 * charset.c (cpp_interpret_string_notranslate): Also set 4696 narrow_cset_desc.width. 4697 46982008-06-07 Joseph Myers <joseph@codesourcery.com> 4699 4700 * configure.ac (parisc*64*-*-*): Remove. 4701 * configure: Regenerate. 4702 47032008-05-30 Tom Tromey <tromey@redhat.com> 4704 4705 PR preprocessor/36320: 4706 * internal.h (_cpp_parse_expr): Update. 4707 * expr.c (_cpp_parse_expr): Add 'is_if' argument. Update error 4708 messages. 4709 * directives.c (do_if): Update. 4710 (do_elif): Require expression if processing group. 4711 47122008-05-30 Danny Smith <dannysmith@users.sourceforge.net> 4713 4714 * include/cpplib.h (struct cpp_dir): Add new field, canonical_name. 4715 47162008-05-21 Tom Tromey <tromey@redhat.com> 4717 4718 PR preprocessor/27777: 4719 * lex.c (cpp_output_line_to_string): New function. 4720 * internal.h (_cpp_begin_message): Don't declare. 4721 * errors.c (_cpp_begin_message): Now static. 4722 * include/cpplib.h (cpp_output_line_to_string): Declare. 4723 * directives.c (do_diagnostic): Rewrote. Use 4724 cpp_output_line_to_string. Don't use _cpp_begin_message. 4725 47262008-05-21 Tom Tromey <tromey@redhat.com> 4727 4728 * include/symtab.h (HT_ALLOCED): Remove. 4729 (ht_purge): Declare. 4730 * symtab.c (DELETED): New define. 4731 (ht_lookup): Update comment. 4732 (ht_lookup_with_hash): Handle deleted entries. Remove HT_ALLOCED 4733 code. Use subobject allocator for strings, if it exists. 4734 (ht_expand): Handle deleted entries. 4735 (ht_forall): Likewise. 4736 (ht_purge): New function. 4737 (ht_dump_statistics): Print deletion statistics. 4738 47392008-05-13 Tom Tromey <tromey@redhat.com> 4740 4741 PR preprocessor/22168: 4742 * include/cpplib.h (struct cpp_options) <objc>: Update 4743 documentation. 4744 * expr.c (eval_token): Warn for use of assertions. 4745 * directives.c (directive_diagnostics): Warn about extensions. 4746 (DEPRECATED): New define. 4747 (DIRECTIVE_TABLE): Use it. 4748 47492008-05-06 Tom Tromey <tromey@redhat.com> 4750 4751 PR preprocessor/35313, PR preprocessor/36088: 4752 * expr.c (optab) <QUERY, COMMA>: Set precedence to 4. 4753 (reduce) <case CPP_QUERY>: Special case CPP_COMMA and CPP_COLON. 4754 47552008-05-04 David S. Miller <davem@davemloft.net> 4756 4757 * configure.ac (sparc*-*-*): Always set need_64bit_hwint to yes. 4758 * configure: Regenerate. 4759 47602008-04-22 Daniel Franke <franke.daniel@gmail.com> 4761 4762 * include/cpplib.h (cpp_define_formatted): New. 4763 * directives.c (cpp_define_formatted): New. 4764 47652008-04-21 Tom Tromey <tromey@redhat.com> 4766 4767 PR libcpp/33415: 4768 * charset.c (_cpp_convert_input): Add buffer_start argument. 4769 Ignore UTF-8 BOM if seen. 4770 * internal.h (_cpp_convert_input): Add argument. 4771 * files.c (struct _cpp_file) <buffer_start>: New field. 4772 (destroy_cpp_file): Free buffer_start, not buffer. 4773 (_cpp_pop_file_buffer): Likewise. 4774 (read_file_guts): Update. 4775 47762008-04-18 Kris Van Hees <kris.van.hees@oracle.com> 4777 4778 * include/cpp-id-data.h (UC): Was U, conflicts with U"..." literal. 4779 * include/cpplib.h (CHAR16, CHAR32, STRING16, STRING32): New tokens. 4780 (struct cpp_options): Added uliterals. 4781 (cpp_interpret_string): Update prototype. 4782 (cpp_interpret_string_notranslate): Idem. 4783 * charset.c (init_iconv_desc): New width member in cset_converter. 4784 (cpp_init_iconv): Add support for char{16,32}_cset_desc. 4785 (convert_ucn): Idem. 4786 (emit_numeric_escape): Idem. 4787 (convert_hex): Idem. 4788 (convert_oct): Idem. 4789 (convert_escape): Idem. 4790 (converter_for_type): New function. 4791 (cpp_interpret_string): Use converter_for_type, support u and U prefix. 4792 (cpp_interpret_string_notranslate): Match changed prototype. 4793 (wide_str_to_charconst): Use converter_for_type. 4794 (cpp_interpret_charconst): Add support for CPP_CHAR{16,32}. 4795 * directives.c (linemarker_dir): Macro U changed to UC. 4796 (parse_include): Idem. 4797 (register_pragma_1): Idem. 4798 (restore_registered_pragmas): Idem. 4799 (get__Pragma_string): Support CPP_STRING{16,32}. 4800 * expr.c (eval_token): Support CPP_CHAR{16,32}. 4801 * init.c (struct lang_flags): Added uliterals. 4802 (lang_defaults): Idem. 4803 * internal.h (struct cset_converter) <width>: New field. 4804 (struct cpp_reader) <char16_cset_desc>: Idem. 4805 (struct cpp_reader) <char32_cset_desc>: Idem. 4806 * lex.c (digraph_spellings): Macro U changed to UC. 4807 (OP, TK): Idem. 4808 (lex_string): Add support for u'...', U'...', u"..." and U"...". 4809 (_cpp_lex_direct): Idem. 4810 * macro.c (_cpp_builtin_macro_text): Macro U changed to UC. 4811 (stringify_arg): Support CPP_CHAR{16,32} and CPP_STRING{16,32}. 4812 48132008-04-18 Paolo Bonzini <bonzini@gnu.org> 4814 4815 PR bootstrap/35457 4816 * aclocal.m4: Regenerate. 4817 * configure: Regenerate. 4818 48192008-04-17 Tom Tromey <tromey@redhat.com> 4820 4821 PR libcpp/34866: 4822 * errors.c (cpp_error): Don't reference a token before the start 4823 of the current run. 4824 48252008-04-16 Tom Tromey <tromey@redhat.com> 4826 4827 * Makefile.in (TAGS_SOURCES): New variable. 4828 (TAGS): New target. 4829 48302008-04-11 Kaz Kojima <kkojima@gcc.gnu.org> 4831 4832 * configure.ac: (need_64bit_hwint): Need 64bit hwint for sh-*-* 4833 and shbe-*-*. 4834 * configure: Rebuilt. 4835 48362008-04-02 Joseph Myers <joseph@codesourcery.com> 4837 4838 * include/cpplib.h (struct cpp_callbacks): Add used_define, 4839 used_undef and before_define. 4840 (NODE_USED): Define. 4841 * directives.c (do_define, do_undef, undefine_macros, do_ifdef, 4842 do_ifndef, cpp_pop_definition): Handle new flag and use new 4843 callbacks. 4844 * expr.c (parse_defined): Handle new flag and use new callbacks. 4845 * macro.c (enter_macro_context, _cpp_free_definition): Handle new 4846 flag and use new callbacks. 4847 48482008-04-01 Jakub Jelinek <jakub@redhat.com> 4849 4850 PR pch/13675 4851 * files.c (struct _cpp_file): Remove pch field. 4852 (pch_open_file): Don't set file->pch, just file->pchname. 4853 (should_stack_file): After pfile->cb.read_pch call 4854 free pchname and clear pchname, don't close file->fd. 4855 Test file->pchname instead of file->pch. Don't close fd after cb. 4856 (_cpp_stack_include): Test file->pchname instead of file->pch. 4857 48582008-03-28 Tom Tromey <tromey@redhat.com> 4859 4860 * Makefile.in (POSTCOMPILE): New variable. 4861 (.c.o): Use it. 4862 48632008-03-13 Tom Tromey <tromey@redhat.com> 4864 4865 PR libcpp/35322: 4866 * directives.c (destringize_and_run): Set pfile->directive. 4867 48682008-03-06 Markus Milleder <markus.milleder@generali.at> 4869 4870 PR preprocessor/35458 4871 * mkdeps.c (munge): Quote '#' with a '\'. 4872 48732008-02-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> 4874 4875 PR preprocessor/35379 4876 * mkdeps.c (deps_write): Ensure the first target always appears 4877 in the first column, without leading backslash newline. Avoid 4878 some more extra whitespace. 4879 48802008-02-25 Thiemo Seufer <ths@mips.com> 4881 4882 * Makefile.in ($(srcdir)/config.in): Depend on configure.ac. 4883 48842008-02-19 Tom Tromey <tromey@redhat.com> 4885 4886 * traditional.c (lex_identifier): Use CPP_HASHNODE. 4887 * lex.c (lex_identifier): Use CPP_HASHNODE. 4888 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Wrap in 4889 do-while. 4890 * identifiers.c (alloc_node): Change return type. 4891 (_cpp_init_hashtable): Don't cast 'alloc_node'. 4892 (proxy_assertion_broken): New declaration. 4893 (cpp_forall_identifiers): Move comment. 4894 * line-map.c (linemap_add): Comment fix. 4895 (linemap_line_start): Indentation fix. 4896 48972008-01-25 Jakub Jelinek <jakub@redhat.com> 4898 4899 PR preprocessor/34692 4900 * macro.c (collect_args): Add pragma_buff argument. Push 4901 CPP_PRAGMA ... CPP_PRAGMA_EOL tokens to *pragma_buff, rather 4902 than into arguments. Reset prevent_expansion and parsing_args 4903 state at CPP_PRAGMA_EOL/CPP_EOF. 4904 (funlike_invocation_p): Add pragma_buff argument, pass it through 4905 to collect_args. 4906 (enter_macro_context): Add result argument. Adjust 4907 funlike_invocation_p caller. Emit all deferred pragma tokens 4908 gathered during collect_args before the expansion, add a padding 4909 token. Return 2 instead of 1 if any pragma tokens were prepended. 4910 (cpp_get_token): If enter_macro_context returns 2, don't return 4911 a padding token, instead cycle to grab CPP_PRAGMA token. 4912 * directives.c (_cpp_handle_directive): If was_parsing_args 4913 in deferred pragma, leave parsing_args and prevent_expansion as is. 4914 49152008-01-22 Tom Tromey <tromey@redhat.com> 4916 4917 PR c++/34859 4918 * macro.c (_cpp_create_definition): Handle __STDC_LIMIT_MACROS and 4919 __STDC_CONSTANT_MACROS. 4920 49212008-01-07 Fred Fish <fnf@specifix.com> 4922 4923 PR preprocessor/30363 4924 * traditional.c (replace_args_and_push): Add local variable 4925 cxtquote, calculate the replacement text size assuming a 4926 worst case of every input character quoted with backslash, 4927 and properly handle output quoting of quote characters in 4928 actual arguments used in function-like macros. 4929 49302008-01-03 Tom Tromey <tromey@redhat.com> 4931 4932 PR preprocessor/34602 4933 * directives.c (do_line): Don't try to spell EOF token. 4934 (do_linemarker): Add comment. 4935 49362007-12-11 DJ Delorie <dj@redhat.com> 4937 4938 * charset.c (convert_using_iconv): Close out any shift states, 4939 returning to the initial state. 4940 49412007-12-06 Tom Tromey <tromey@redhat.com> 4942 4943 PR c/29172 4944 * internal.h (struct cpp_reader) <file_hash_entries>: Changed 4945 type. 4946 <file_hash_entries_allocated, file_hash_entries_used>: Removed. 4947 * files.c (FILE_HASH_POOL_SIZE): New macro. 4948 (struct file_hash_entry_pool): New. 4949 (destroy_all_cpp_files): New function. 4950 (allocate_file_hash_entries): Allocate a file_hash_entry_pool. 4951 (new_file_hash_entry): Update. 4952 (free_file_hash_entries): New function. 4953 (_cpp_cleanup_files): Call free_file_hash_entries and 4954 destroy_all_cpp_files. 4955 (cpp_clear_file_cache): New function. 4956 * include/cpplib.h (cpp_clear_file_cache): Declare. 4957 49582007-12-03 Tom Tromey <tromey@redhat.com> 4959 4960 PR preprocessor/34288 4961 * configure.ac, config.in: Rebuilt. 4962 * configure.ac: Check for ssize_t. 4963 49642007-11-30 Tom Tromey <tromey@redhat.com> 4965 4966 PR preprocessor/32868 4967 * macro.c (_cpp_create_definition): Special case 4968 __STDC_FORMAT_MACROS. 4969 49702007-11-16 Michael Matz <matz@suse.de> 4971 4972 * files.c (search_path_head): Fix check for absolute paths. 4973 49742007-11-11 Tom Tromey <tromey@redhat.com> 4975 4976 PR c++/17557 4977 * include/cpplib.h (cpp_included_before): Declare. 4978 * files.c (struct file_hash_entry) <location>: New field. 4979 (_cpp_find_file): Initialize new field. 4980 (make_cpp_dir): Likewise. 4981 (cpp_included_before): New function. 4982 49832007-11-01 Tom Tromey <tromey@redhat.com> 4984 4985 PR preprocessor/30805 4986 * macro.c (paste_tokens): Handle padding token. 4987 (paste_tokens): Don't abort unless padding has PASTE_LEFT flag. 4988 49892007-10-31 Tom Tromey <tromey@redhat.com> 4990 4991 PR preprocessor/30786 4992 * macro.c (builtin_macro): Return result of _cpp_do__Pragma. 4993 * directives.c (_cpp_do__Pragma): Return error status. 4994 * internal.h (_cpp_do__Pragma): Update. 4995 * directives.c (get__Pragma_string): Back up if EOF seen. 4996 49972007-09-06 Tom Tromey <tromey@redhat.com> 4998 4999 * internal.h (struct cpp_reader) <invocation_location>: New 5000 field. 5001 (struct cpp_reader) <set_invocation_location>: Likewise. 5002 * init.c (cpp_set_line_map): New function. 5003 * line-map.c (linemap_add): Use linemap's allocator. 5004 * include/line-map.h (GTY): Define. 5005 (line_map_realloc): New typedef. 5006 (struct line_map): Mark with GTY. 5007 (struct line_maps): Likewise. 5008 (struct line_maps) <maps>: Likewise. 5009 (struct line_maps) <reallocator>: New field. 5010 * include/symtab.h (GTY): Conditionally define. 5011 * include/cpplib.h (cpp_set_line_map): Declare. 5012 (cpp_get_token_with_location): Declare. 5013 * macro.c (cpp_get_token): Set invocation_location on the reader. 5014 (cpp_get_token_with_location): New function. 5015 50162007-08-30 Chao-ying Fu <fu@mips.com> 5017 5018 * expr.c (interpret_float_suffix): Support hr, r, lr, llr, uhr, ur, 5019 ulr, ullr, hk, k, lk, llk, uhk, uk, ulk, ullk. 5020 (cpp_classify_number): Support decimal fixed-point constants without 5021 exponents. 5022 Warn about fixed-point constants when -pedantic. 5023 * include/cpplib.h (CPP_N_SMALL, CPP_N_MEDIUM, CPP_N_LARGE): Change 5024 comments to support fixed-point values. 5025 (CPP_N_FRACT, CPP_N_ACCUM): Define. 5026 50272007-08-18 Tom Tromey <tromey@redhat.com> 5028 5029 PR preprocessor/32974 5030 * directives.c (parse_include): Don't check for EOL when 5031 processing #pragma dependency. 5032 50332007-07-30 Ollie Wild <aaw@google.com> 5034 5035 * directives-only.c: New file. 5036 * internal.h (struct _cpp_dir_only_callbacks): New. 5037 (_cpp_preprocess_dir_only): New function. 5038 * directives.c (_cpp_handle_directive): Check directives_only before 5039 disabling execution of indented directives. 5040 * files.c (_cpp_stack_file): Add directives_only check. 5041 * include/cpplib.h (struct cpp_options): Add directives_only. 5042 (cpp_init_special_builtins): New function. 5043 * init.c (cpp_init_special_builtins): New function. 5044 (cpp_init_builtins): Move builtin_array initialization to 5045 cpp_init_special_builtins. 5046 (post_options): Check directives_only before setting 5047 pfile->state.prevent_expansion = 1. 5048 * macro.c (_cpp_builtin_macro_text): Print an error if __COUNTER__ 5049 is expanded inside a directive while -fdirectives-only is enabled. 5050 * Makefile.in (libcpp_a_OBJS): Add directives-only.o. 5051 (libcpp_a_SOURCES): Add directives-only.c. 5052 50532007-07-04 Uros Bizjak <ubizjak@gmail.com> 5054 5055 * traditional.c (_cpp_scan_out_logical_line): Initialize 5056 fmacro.args, fmacro.node, fmacro.offset, fmacro.line and 5057 fmacro.args to prevent 'may be used uninitialized' warning. 5058 50592007-07-03 Uros Bizjak <ubizjak@gmail.com> 5060 5061 * include/cpplib.h (CPP_N_WIDTH_MD, CPP_N_MD_W, CPP_N_MD_Q): 5062 Add new constants. 5063 * expr.c (interpret_float_suffix): Process 'w', 'W', 'q' and 'Q' 5064 suffixes. Return CPP_N_MD_W for 'w' or 'W' suffixes and CPP_N_MD_Q 5065 for 'q' or 'Q' suffixes. 5066 50672007-06-17 Danny Smith <dannysmith@users.sourceforge.net 5068 5069 * files.c (open_file): Correct typo. 5070 50712007-06-16 Vladimir Prus <vladimir@codesourcery.com> 5072 5073 * files.c (open_file): Prevent the call 5074 for stat from overwriting errno. 5075 50762007-06-09 Vladimir Prus <vladimir@codesourcery.com> 5077 5078 * files.c (open_file): Account for the 5079 fact that on windows, opening a directory gives 5080 EACCES. 5081 50822007-06-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de> 5083 5084 PR preprocessor/23479 5085 * expr.c (cpp_classify_number): Implement 0b-prefixed binary 5086 integer constants. 5087 (append_digit): Likewise. 5088 * include/cpplib.h: Add CPP_N_BINARY, to be used for 0b-prefixed 5089 binary integer constants. 5090 50912007-05-31 Dave Korn <dave.korn@artimi.com> 5092 5093 PR preprocessor/14331 5094 * lex.c (_cpp_get_fresh_line): Don't warn if no newline at EOF. 5095 50962007-05-24 Ollie Wild <aaw@google.com> 5097 5098 * macro.c (_cpp_builtin_macro_text): Handle BT_COUNTER. 5099 * pch.c (cpp_write_pch_deps): Save __COUNTER__ state. 5100 (cpp_write_pch_state): Save __COUNTER__ state. 5101 (cpp_valid_state): Check valid __COUNTER__ state. 5102 (cpp_read_state): Read new __COUNTER__ state. 5103 * include/cpplib.h (enum builtin_type): Add BT_COUNTER enumerator. 5104 * init.c (builtin_array): Add __COUNTER__/BT_COUNTER. 5105 * internal.h (struct cpp_reader): Add counter member. 5106 51072007-05-23 Simon Martin <simartin@users.sourceforge.net> 5108 5109 PR preprocessor/20077 5110 * macro.c (create_iso_definition): Fixed the method to determine 5111 whether the token-pasting operator appears at the beginning or the end 5112 of a macro. 5113 51142007-05-21 Ian Lance Taylor <iant@google.com> 5115 5116 * internal.h (struct cpp_reader): Add new fields: 5117 nonexistent_file_hash and nonexistent_file_ob. 5118 * files.c: Include "obstack.h". 5119 (find_file_in_dir): Before trying to open the file, look up the 5120 path name in the hash table of nonexistent files. After failing 5121 to open the file, add the path name to the hash table. 5122 (_cpp_find_file): Cache the results of looking up the file name 5123 starting with the quote and bracket chain heads, if we can. 5124 (nonexistent_file_hash_eq): New static function. 5125 (_cpp_init_files): Initialize pfile->nonexistent_file_hash and 5126 pfile->nonexistent_file_ob. 5127 (_cpp_cleanup_files): Free pfile->nonexistent_file_hash and 5128 pfile->nonexistent_file_ob. 5129 51302007-05-14 Janis Johnson <janis187@us.ibm.com> 5131 5132 * expr.c (cpp_classify_number): Warn about dfp constant for -pedantic. 5133 5134 PR c/31924 5135 * expr.c (interpret_float_suffix): Check for invalid suffix. 5136 51372007-05-02 Eric Christopher <echristo@apple.com> 5138 5139 * expr.c (num_div_op): Don't overflow if the result is 5140 zero. 5141 51422007-05-02 Tom Tromey <tromey@redhat.com> 5143 5144 PR preprocessor/28709 5145 * macro.c (paste_tokens): Remove PASTE_LEFT from the old lhs. 5146 51472007-03-30 Michael Meissner <michael.meissner@amd.com> 5148 5149 * directives.c (lex_macro_node_from_str): Fix alloca call to be 5150 type correct. 5151 51522007-03-30 Richard Henderson <rth@redhat.com> 5153 5154 * directives.c (lex_macro_node_from_str): New. 5155 (cpp_push_definition, cpp_pop_definition): New. 5156 * include/cpplib.h (cpp_push_definition, cpp_pop_definition): Declare. 5157 51582007-03-01 Brooks Moses <brooks.moses@codesourcery.com> 5159 5160 * Makefile.in: Add dummy install-pdf target. 5161 51622007-01-30 Tom Tromey <tromey@redhat.com> 5163 5164 PR preprocessor/30468 5165 * mkdeps.c (apply_vpath): Strip successive '/'s if we stripped 5166 './'. 5167 51682007-01-30 Tom Tromey <tromey@redhat.com> 5169 5170 PR preprocessor/29966 5171 * macro.c (lex_expansion_token): Save and restore cpp_reader's 5172 cur_token. 5173 (_cpp_create_definition): Don't restore cur_token here. 5174 * lex.c (_cpp_lex_token): Added assertion. 5175 51762007-01-27 Tom Tromey <tromey@redhat.com> 5177 5178 * configure: Rebuilt. 5179 51802007-01-12 Tom Tromey <tromey@redhat.com> 5181 5182 PR preprocessor/28227 5183 * directives.c (lex_macro_node): Added 'is_def_or_undef' 5184 argument. 5185 (do_define): Update. 5186 (do_undef): Update. 5187 (do_ifdef): Update. 5188 (do_ifndef): Update. 5189 51902007-01-11 Paolo Bonzini <bonzini@gnu.org> 5191 5192 * configure: Regenerate. 5193 51942007-01-11 Paolo Bonzini <bonzini@gnu.org> 5195 5196 * configure: Regenerate. 5197 51982007-01-04 Tom Tromey <tromey@redhat.com> 5199 5200 PR preprocessor/28165 5201 * internal.h (cpp_in_primary_file): New function. 5202 * directives.c (do_include_next): Use cpp_in_primary_file. 5203 (do_pragma_once): Likewise. 5204 (do_pragma_system_header): Likewise. 5205 52062006-12-29 Ian Lance Taylor <iant@google.com> 5207 5208 * lex.c (_cpp_clean_line): Add uses of __builtin_expect. Don't 5209 look backward at the end of the line unless we saw a backslash. 5210 52112006-12-29 Jakub Jelinek <jakub@redhat.com> 5212 5213 PR preprocessor/29612 5214 * directives.c (do_linemarker): Set pfile->buffer->sysp always, not 5215 only when new_sysp is non-zero. 5216 52172006-12-28 Tom Tromey <tromey@redhat.com> 5218 5219 PR preprocessor/30001 5220 * charset.c (_cpp_convert_input): Check that to.len is greater 5221 than zero. 5222 52232006-11-20 Trevor Smigiel <Trevor_Smigiel@playstation.sony.com> 5224 5225 * configure.ac (need_64bit_hwint): Need 64bit hwint for SPU. 5226 * configure: Rebuilt. 5227 52282006-11-01 Douglas Gregor <doug.gregor@gmail.com> 5229 5230 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX0X and CLK_CXX0X 5231 for experimental C++0x mode. 5232 * init.c (lang_defaults): Add defaults for C++0x modes. C++0x has 5233 adopted the preprocessor changes introduced in C99. 5234 52352006-10-29 Joseph Myers <joseph@codesourcery.com> 5236 5237 * configure.ac (need_64bit_hwint): Set for i[34567]86-*-linux* 5238 depending on --enable-targets=all. 5239 * configure: Regenerate. 5240 52412006-10-12 Jakub Jelinek <jakub@redhat.com> 5242 5243 PR preprocessor/28709 5244 * macro.c (paste_tokens): Do error reporting here, use BUF with the 5245 spelled LHS token as opposed to spelling it again. 5246 (paste_all_tokens): Don't report errors here, just break on failure. 5247 52482006-10-10 Brooks Moses <bmoses@stanford.edu> 5249 5250 * Makefile.in: Added empty "pdf" target. 5251 52522006-09-22 Geoffrey Keating <geoffk@apple.com> 5253 5254 * configure.ac: Make need_64_bit_hwint case for x86-darwin 5255 match exactly the glob in gcc/config.gcc. 5256 * configure: Regenerate. 5257 52582006-09-13 Joseph S. Myers <joseph@codesourcery.com> 5259 5260 PR c/28768 5261 PR preprocessor/14634 5262 * lex.c (lex_string): Pedwarn for unterminated literals. 5263 52642006-09-08 Eric Christopher <echristo@apple.com> 5265 5266 * configure.ac: Add 64-bit HWI support for i?86-darwin. 5267 52682006-08-14 Steve Ellcey <sje@cup.hp.com> 5269 5270 PR c++/28288 5271 PR c++/14556 5272 * include/cpplib.h: Remove <?, >?, <?=, and >?= tokens. 5273 (CPP_LAST_EQ): Change. 5274 (CPP_LAST_PUNCTUATOR): Change. 5275 * expr.c (cpp_operator): Remove MIN and MAX. 5276 (reduce): Remove CPP_MIN and CPP_MAX. 5277 (num_binary_op): Ditto. 5278 * lex.c (_cpp_lex_direct): Ditto. 5279 (cpp_avoid_paste): Remove ? as legal symbol after > or <. 5280 52812006-06-09 Jakub Jelinek <jakub@redhat.com> 5282 5283 PR preprocessor/27746 5284 * directives.c (do_pragma): Handle pragma with valid namespace 5285 and invalid name coming from macro expansion. 5286 * directives.c (destringize_and_run): Initialize next field in 5287 context. 5288 5289 PR c/27747 5290 PR c++/27748 5291 * directives.c (destringize_and_run): Set NO_EXPAND on the 5292 tokens. 5293 5294 * macro.c (_cpp_backup_tokens): Fix comment typo. 5295 52962006-05-31 Daniel Jacobowitz <dan@codesourcery.com> 5297 5298 * Makefile.in (CATALOGS): Add po/ prefix. 5299 * configure: Regenerated. 5300 53012006-05-23 Carlos O'Donell <carlos@codesourcery.com> 5302 5303 * Makefile.in: Add install-html target. Add install-html to .PHONY 5304 53052006-02-17 Grigory Zagorodnev <grigory_zagorodnev@linux.intel.com> 5306 5307 * macro.c (_cpp_builtin_macro_text): Handle BT_TIMESTAMP. 5308 * files.c (_cpp_get_file_stat): New function. 5309 * include/cpplib.h (builtin_type): Add BT_TIMESTAMP. 5310 * init.c (builtin_array): Add support for __TIMESTAMP__/BT_TIMESTAMP. 5311 * internal.h (_cpp_get_file_stat): Prototype. 5312 (struct cpp_buffer): Add timestamp. 5313 53142006-01-23 Jakub Jelinek <jakub@redhat.com> 5315 5316 PR preprocessor/25717 5317 * init.c (cpp_init_builtins): If __STDC__ will not change value 5318 between system headers and other sources, define it as a normal 5319 macro rather than a builtin. 5320 * macro.c (_cpp_builtin_macro_text) <case BT_STDC>: Only check 5321 cpp_in_system_header condition. 5322 53232006-01-05 Paolo Bonzini <bonzini@gnu.org> 5324 5325 * Makefile.in: Use -MMD instead of -MD. 5326 53272006-01-04 Dmitry Kurochkin <dmitry.kurochkin@gmail.com> 5328 Richard Henderson <rth@redhat.com> 5329 5330 Merge from gomp branch: 5331 * directives.c (struct pragma_entry): Add is_deferred. Add ident 5332 entry to value union. 5333 (end_directive): Don't eat the line if in_deferred_pragma. 5334 (run_directive): Remove pragma hacks. 5335 (insert_pragma_entry): Remove. 5336 (new_pragma_entry): New. 5337 (register_pragma_1): Split out of register_pragma. Only handle 5338 the lookup tree and return the new entry. 5339 (cpp_register_pragma): Fill in the pragma entry here. 5340 (cpp_register_deferred_pragma): New. 5341 (register_pragma_internal): New. 5342 (_cpp_init_internal_pragmas): Use register_pragma_internal. 5343 (do_pragma): Allow pragma expansion after namespace. For deferred 5344 pragmas, don't slurp the line into a string. 5345 (destringize_and_run): Save tokens for deferred pragmas. 5346 (cpp_handle_deferred_pragma): Remove. 5347 * macro.c (builtin_macro): Remove pragma token hack. 5348 (_cpp_push_token_context): Rename from push_token_context and export. 5349 * internal.h (struct lexer_state): Add pragma_allow_expansion. 5350 (_cpp_push_token_context): Declare. 5351 * lex.c (_cpp_lex_token): Allow _cpp_handle_directive to return 5352 a token. Update the line number correctly if so. 5353 (_cpp_lex_direct): Emit CPP_PRAGMA_EOL tokens. 5354 (cpp_token_val_index): Return CPP_TOKEN_FLD_PRAGMA for pragmas. 5355 * include/cpplib.h (PRAGMA_EOL): New. 5356 (CPP_TOKEN_FLD_PRAGMA): New. 5357 (struct cpp_token): Add val.pragma. 5358 (struct cpp_options): Remove defer_pragmas. 5359 (cpp_handle_deferred_pragma): Remove. 5360 (cpp_register_deferred_pragma): Declare. 5361 53622006-01-01 Jakub Jelinek <jakub@redhat.com> 5363 5364 PR c++/25294 5365 * directives.c (do_pragma): If pragma line ends with multi-line 5366 block comment, end the saved deferred pragma string before that 5367 comment. Handle embedded '\0' chars on the pragma line. 5368 53692005-12-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de> 5370 5371 PR c++/23333 5372 * include/cpplib.h: Add PURE_ZERO to flags for the cpp_token structure. 5373 53742005-12-07 Jon Grimm <jgrimm2@us.ibm.com> 5375 Ben Elliston <bje@au.ibm.com> 5376 5377 * include/cpplib.h (CPP_N_DFLOAT): New. 5378 * expr.c (interpret_float_suffix): Identify df, dd, and dl 5379 suffixes as decimal floating point constants. 5380 (cpp_classify_number): Disallow hexadecimal DFP constants. 5381 53822005-11-14 Gerald Pfeifer <gerald@pfeifer.com> 5383 Ian Lance Taylor <ian@airs.com> 5384 5385 * include/cpplib.h (struct cpp_callbacks): Annotate error with 5386 ATTRIBUTE_FPTR_PRINTF(3,0) instead of ATTRIBUTE_PRINTF(3,0). 5387 53882005-11-09 Per Bothner <per@bothner.com> 5389 Uros Bizjak <uros@kss-loka.si> 5390 5391 PR c/24101 5392 * init.c (read_original_filename): Temporarily set 5393 state.in_directive before calling _cpp_lex_direct for 5394 CPP_HASH tokens. 5395 53962005-11-03 James E Wilson <wilson@specifix.com> 5397 5398 PR preprocessor/24202 5399 * files.c (_cpp_pop_file_buffer): Set buffer_valid to false. 5400 54012005-11-04 Joseph S. Myers <joseph@codesourcery.com> 5402 5403 * include/cpplib.h (struct cpp_callbacks): Make error take 5404 va_list* parameter. 5405 * errors.c (cpp_error): Update call to callback. 5406 54072005-11-03 Andrew Pinski <pinskia@physics.uc.edu> 5408 5409 PR preprocessor/22042 5410 * macro.c (_cpp_builtin_macro_text): Lower the needed max 5411 buffer size. 5412 (cpp_quote_string): Don't octalify non printable 5413 charactors. 5414 54152005-11-03 Joseph S. Myers <joseph@codesourcery.com> 5416 5417 PR c++/17964 5418 * include/cpplib.h (struct cpp_options): Add client_diagnostic. 5419 (struct cpp_callbacks): Add error. 5420 * errors.c (cpp_error): If client_diagnostic, use error callback. 5421 * charset.c (convert_escape): Don't use %03o in diagnostic. 5422 54232005-10-21 James E Wilson <wilson@specifix.com> 5424 5425 PR preprocessor/15220 5426 * files.c (_cpp_find_file): New parameter angle_brackets. Fix all 5427 callers. Pass to open_file_failed. 5428 (open_file_failed): New parameter angle_brackets. Fix all callers. 5429 Use in print_dep assignment. 5430 * init.c (cpp_read_main_file): Pass additional arg to _cpp_find_file. 5431 * internal.h (_cpp_find_file): Add new parm to declaration. 5432 54332005-10-08 Kazu Hirata <kazu@codesourcery.com> 5434 5435 * configure.ac: Require 64-bit int for arm*-*-*eabi*. 5436 * configure: Regenerate. 5437 54382005-10-04 Ian Lance Taylor <ian@airs.com> 5439 5440 PR preprocessor/13726 5441 * directives.c (check_eol_return_comments): New static function. 5442 (parse_include): Add buf parameter. Change all callers. 5443 (do_include_common): If not discard comments, turn on 5444 save_comments. Pass collected comments to include callback. 5445 * include/cpplib.h (struct cpp_callbacks): Add new parameter to 5446 include callback: cpp_token list. 5447 54482005-09-20 Joseph S. Myers <joseph@codesourcery.com> 5449 5450 * include/cpplib.h (struct cpp_options): Add extended_identifiers. 5451 * init.c (struct lang_flags, lang_defaults): Add 5452 extended_identifiers. 5453 (cpp_set_lang): Use it. 5454 * lex.c (forms_identifier_p): Check extended_identifiers. 5455 54562005-08-30 Jakub Jelinek <jakub@redhat.com> 5457 5458 PR preprocessor/20348 5459 PR preprocessor/20356 5460 * files.c (_cpp_find_file, search_cache): Revert 2004-06-26 and 5461 2004-06-05 changes. 5462 54632005-07-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 5464 5465 * configure.ac (ACX_PROG_CC_WARNING_OPTS): add 5466 -Wmissing-format-attribute. 5467 5468 * configure: Regenerate. 5469 54702005-06-29 Kelley Cook <kcook@gcc.gnu.org> 5471 5472 * all files: Update FSF address in copyright headers. 5473 * makeucnid.c (write_copyright): Update outputted FSF address. 5474 54752005-06-13 Zack Weinberg <zack@codesourcery.com> 5476 5477 * configure.ac: Invoke ZW_CREATE_DEPDIR and 5478 ZW_PROG_COMPILER_DEPENDENCIES. 5479 * aclocal.m4, configure: Regenerate. 5480 * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.base, COMPILE): 5481 New variables. 5482 (distclean): Clean up $(DEPDIR) and its contents. 5483 (.c.o): Use $(COMPILE). 5484 Include $(DEPDIR)/*.Po for most object->header dependencies. 5485 54862005-05-28 Gabriel Dos Reis <gdr@integrable-solutions.net> 5487 5488 * configure.ac: Check declarations for asprintf and vasprintf. 5489 * config.in: Regenerate. 5490 * configure: Likewise. 5491 5492 * charset.c (conversion_loop): Use XRESIZEVEC. 5493 (convert_no_conversion): Likewise. 5494 (convert_using_iconv): Likewise. 5495 (init_iconv_desc): Cast return value of alloca. 5496 (cpp_host_to_exec_charset): Use XNEWVEC. 5497 (emit_numeric_escape): Use XRESIZEVEC. 5498 (cpp_interpret_string): Use XNEWVEC. 5499 (cpp_interpret_string): Use XRESIZEVEC. 5500 (_cpp_interpret_identifier): Cast return value of alloca. 5501 (_cpp_convert_input): Use XNEWVEC and XRESIZEVEC. 5502 * directives.c (glue_header_name): Use XNEWVEC and XRESIZEVEC. 5503 (parse_include): Use XNEWVEC. 5504 (insert_pragma_entry): Rename local variable "new" to 5505 "new_entry". 5506 (save_registered_pragmas): Cast return value of xmemdup. 5507 (destringize_and_run): Same for alloca. 5508 (parse_assertion): Likewise. 5509 (do_assert): Cast allocated storage to proper type. 5510 (cpp_define): Likewise. 5511 (_cpp_define_builtin): Likewise. 5512 (cpp_undef): Likewise. 5513 (handle_assertion): Likewise. 5514 (cpp_push_buffer): Rename local variable "new" to "new_buffer". 5515 * expr.c (CPP_UPLUS): Cast value to type cpp_ttype. 5516 (CPP_UMINUS): Likewise. 5517 (struct cpp_operator): Rename from struct operator. 5518 (_cpp_expand_op_stack): Use XRESIZEVEC. 5519 * files.c (pch_open_file): Use XNEWVEC. 5520 (pch_open_file): Use XRESIZEVEC. 5521 (read_file_guts): Use XNEWVEC and XRESIZEVEC. 5522 (dir_name_of_file): Use XNEWVEC. 5523 (make_cpp_file): Use XCNEW. 5524 (make_cpp_dir): Likewise. 5525 (allocate_file_hash_entries): USE XNEWVEC. 5526 (cpp_included): Cast return value of htab_find_with_hash. 5527 (append_file_to_dir): Use XNEWVEC. 5528 (read_filename_string): Likewise. Use XRESIZEVEC too. 5529 (read_name_map): Cast return value of alloca. Use XRESIZEVEC. 5530 (remap_filename): Use XNEWVEC. 5531 (struct pchf_entry): Move definition out of struct pchf_data. 5532 (_cpp_save_file_entries): Use XCNEWVAR. 5533 (_cpp_read_file_entries): Use XNEWVAR. 5534 * identifiers.c (alloc_node): Use XOBNEW. 5535 * init.c (cpp_create_reader): Use XCNEW. 5536 (cpp_init_builtins): Cast of b->value to enum builtin_type. 5537 (read_original_directory): Cast return value of alloca. 5538 * lex.c (add_line_note): Use XRESIZEVEC. 5539 (warn_about_normalization): Use XNEWVEC. 5540 (_cpp_lex_direct): Cast node->directive_index to (enum cpp_ttype). 5541 (new_buff): Use XNEWVEC. 5542 * line-map.c (linemap_add): Use XRESIZEVEC. 5543 * macro.c (builtin_macro): Cast return value of alloca. 5544 (paste_tokens): Likewise. 5545 (expand_arg): Use XNEWVEC and XRESIZEVEC. 5546 (_cpp_save_parameter): Use XRESIZEVEC. 5547 (create_iso_definition): Cast allocated storage to proper type. 5548 (_cpp_create_definition): Likewise. 5549 (cpp_macro_definition): Use XRESIZEVEC. 5550 * makedepend.c (add_clm): Use XNEW. 5551 (add_dir): Likewise. 5552 * mkdeps.c (munge): Use XNEWVEC. 5553 (deps_init): Use XCNEW. 5554 (deps_add_target): Use XRESIZEVEC. 5555 (deps_add_default_target): Cast return value of alloca. 5556 (deps_add_dep): Use XRESIZEVEC. 5557 (deps_add_vpath): Likewise. Use XNEWVEC too. 5558 (deps_restore): Likewise. 5559 * pch.c (save_idents): Use XNEW and XNEWVEC. 5560 (cpp_save_state): Use XNEW. 5561 (count_defs): Cast return value of htab_find. 5562 (write_defs): Likewise. 5563 (cpp_write_pch_deps): Use XNEWVEC. 5564 (collect_ht_nodes): Use XRESIZEVEC. 5565 (cpp_valid_state): Use XNEWVEC. 5566 (save_macros): Use XRESIZEVEC. Cast return value of xmemdup. 5567 * symtab.c (ht_create): Use XCNEW. 5568 (ht_lookup_with_hash): Cast return value of obstack_copy0. 5569 (ht_expand): Use XCNEWVEC. 5570 * system.h (HAVE_DESIGNATED_INITIALIZERS): False if __cplusplus. 5571 (bool): Do not define if __cplusplus. 5572 55732005-05-12 Zack Weinberg <zack@codesourcery.com> 5574 5575 * directives.c (#sccs table entry): Mark IN_I, consistent with #ident. 5576 (do_sccs): Delete function definition, #define to do_ident. 5577 (do_ident): Don't hardwire directive name. 5578 55792005-05-12 Ryota Kunisawa <kunisawa@access.co.jp> 5580 5581 PR bootstrap/21230 5582 * configure: Regenerate. 5583 55842005-04-27 Andris Pavenis <pavenis@latnet.lv> 5585 5586 * files.c: Include io.h for DJGPP to get prototype of setmode. 5587 55882005-04-19 Per Bothner <per@bothner.com> 5589 5590 PR preprocessor/20907 5591 * line-map.c (linemap_line_start): Fix bug when we need to increse 5592 column_bits but can re-use the current line_map. 5593 55942005-04-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 5595 5596 * system.h (fopen, fdopen, freopen): Define these to the unlocked 5597 libiberty functions. 5598 55992005-04-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 5600 5601 * configure.ac (libcpp_UNLOCKED_FUNCS): New. 5602 (AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for libcpp_UNLOCKED_FUNCS. 5603 * system.h (putchar, getc, getchar, clearerr, feof, fileno, 5604 fflush, fgetc, fgets, ferror, fread): Redefine to the associated 5605 _unlocked function. 5606 (fwrite_unlocked): Fix prototype. 5607 5608 * configure, config.in: Regenerate. 5609 56102005-04-05 Jakub Jelinek <jakub@redhat.com> 5611 5612 PR preprocessor/19475 5613 * macro.c (create_iso_definition): For < ISO C99, don't 5614 pedwarn if there is no whitespace between macro name and its 5615 replacement, but the replacement starts with a basic character 5616 set character. 5617 56182005-03-28 Andreas Jaeger <aj@suse.de> 5619 5620 * lex.c (warn_about_normalization): Cast field width to int to 5621 avoid warning. 5622 56232005-03-19 Joseph S. Myers <joseph@codesourcery.com> 5624 5625 * configure.ac: Consistently use solaris2.1[0-9]* instead of 5626 solaris2.1[0-9]. 5627 * configure: Regenerate. 5628 56292005-03-15 Geoffrey Keating <geoffk@apple.com> 5630 5631 * charset.c (_cpp_valid_ucn): In identifiers, reject a partial 5632 UCN rather than printing an error. 5633 56342005-03-14 Geoffrey Keating <geoffk@apple.com> 5635 5636 * lex.c (forms_identifier_p): Disable UCNs in C89 mode. 5637 56382005-03-14 Geoffrey Keating <geoffk@apple.com> 5639 5640 * init.c (cpp_create_reader): Default warn_normalize to normalized_C. 5641 * charset.c: Update for new format of ucnid.h. 5642 (ucn_valid_in_identifier): Update for new format of ucnid.h. 5643 Add NST parameter, and update it; update callers. 5644 (cpp_valid_ucn): Add NST parameter, update callers. Replace abort 5645 with cpp_error. 5646 (convert_ucn): Pass normalize_state to cpp_valid_ucn. 5647 * internal.h (struct normalize_state): New. 5648 (INITIAL_NORMALIZE_STATE): New. 5649 (NORMALIZE_STATE_RESULT): New. 5650 (NORMALIZE_STATE_UPDATE_IDNUM): New. 5651 (_cpp_valid_ucn): New. 5652 * lex.c (warn_about_normalization): New. 5653 (forms_identifier_p): Add normalize_state parameter, update callers. 5654 (lex_identifier): Add normalize_state parameter, update callers. Keep 5655 the state current. 5656 (lex_number): Likewise. 5657 (_cpp_lex_direct): Pass normalize_state to subroutines. Check 5658 it with warn_about_normalization. 5659 * makeucnid.c: New. 5660 * ucnid.h: Replace. 5661 * ucnid.pl: Remove. 5662 * ucnid.tab: Make appropriate for input to makeucnid.c. Remove 5663 comments about obsolete version of C++. 5664 * include/cpplib.h (enum cpp_normalize_level): New. 5665 (struct cpp_options): Add warn_normalize field. 5666 56672005-03-11 Geoffrey Keating <geoffk@apple.com> 5668 5669 * directives.c (glue_header_name): Update call to cpp_spell_token. 5670 * internal.h (_cpp_interpret_identifier): New. 5671 * charset.c (_cpp_interpret_identifier): New. 5672 (_cpp_valid_ucn): Allow UCN version of '$'. 5673 * lex.c (lex_identifier): Add extra parameter to indicate if initial 5674 character was '$' or '\'. Support identifiers with UCNs. 5675 (forms_identifier_p): Allow UCNs. 5676 (_cpp_lex_direct): Pass extra parameter to lex_identifier. 5677 (utf8_to_ucn): New. 5678 (cpp_spell_token): Add FORSTRING parameter. Use it. 5679 (cpp_token_as_text): Update call to cpp_spell_token. 5680 (cpp_output_token): Write UCNs back out. 5681 (stringify_arg): Update call to cpp_spell_token. 5682 (paste_tokens): Likewise. 5683 (cpp_macro_definition): Likewise. 5684 * macro.c (stringify_arg): Likewise. 5685 (paste_tokens): Likewise. 5686 (cpp_macro_definition): Likewise. 5687 * include/cpplib.h: Add parameter to cpp_spell_token. 5688 56892005-03-04 Jakub Jelinek <jakub@redhat.com> 5690 5691 PR bootstrap/20282 5692 PR bootstrap/20305 5693 * macro.c (replace_args, cpp_get_token): Copy whole 5694 cpp_token_u instead of just cpp_string field from it. 5695 56962005-02-28 Devang Patel <dpatel@apple.com> 5697 5698 * directives.c (do_line): Save sysp early before line table is 5699 realloc'ed. 5700 57012005-02-20 Zack Weinberg <zack@codesourcery.com> 5702 5703 PR 18785 5704 * charset.c (LAST_POSSIBLY_BASIC_SOURCE_CHAR): New helper macro. 5705 (cpp_host_to_exec_charset): New function. 5706 * include/cpplib.h: Declare cpp_host_to_exec_charset. 5707 57082005-02-19 Devang Patel <dpatel@apple.com> 5709 5710 * charset.c (_cpp_convert_input): Check '\r' before inserting 5711 '\n' at the end. 5712 57132005-02-15 Eric Christopher <echristo@redhat.com> 5714 5715 PR preprocessor/19077 5716 * macro.c (cpp_macro_definition): Move handling of whitespace 5717 to PREV_WHITE conditional. Remove overloading of len 5718 variable. 5719 57202005-02-14 Kazu Hirata <kazu@cs.umass.edu> 5721 5722 * directives.c, files.c, init.c, internal.h, macro.c, pch.c, 5723 traditional.c: Update copyright. 5724 57252005-02-14 Paolo Bonzini <bonzini@gnu.org> 5726 5727 PR bootstrap/19818 5728 * configure.ac: Check for declaration of basename and getopt. 5729 * config.in: Regenerate. 5730 * configure: Regenerate. 5731 * internal.h (ustrcspn): New. 5732 * macro.c (create_iso_definition): Fix allocation of memory. 5733 (padding_token): Add cast to remove const-ness. 5734 * pch.c (cpp_read_state): Use ustrcspn. 5735 57362005-02-08 Mike Stump <mrs@apple.com> 5737 5738 * files.c (pchf_adder): Remove. 5739 (struct pchf_adder_info): Likewise. 5740 (_cpp_save_file_entries): Write out all files so that #import works. 5741 57422005-01-23 Joseph S. Myers <joseph@codesourcery.com> 5743 5744 * configure: Regenerate. 5745 57462005-01-11 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de> 5747 5748 * include/cpplib.h (c_lang): Fix comment to say cpp_create_reader. 5749 5750 * include/cpplib.h: Also update copyright years. 5751 57522005-01-03 Geoffrey Keating <geoffk@apple.com> 5753 5754 * files.c (_cpp_find_file): Add files found by search_path_exhausted 5755 to the list of all files. 5756 57572005-01-01 Gabriel Dos Reis <gdr@integrable-solutions.net> 5758 5759 * internal.h: Update references to Cpp lib filenames. 5760 * directives.c: Likewise. 5761 * init.c: Likewise. 5762 * macro.c: Likewise. 5763 * traditional.c: Likewise. 5764 57652004-12-15 Eric Botcazou <ebotcazou@libertysurf.fr> 5766 5767 PR preprocessor/15167 5768 * files.c (destroy_cpp_file): New function. 5769 (should_stack_file): Make a new file if the 5770 compared file is still stacked. 5771 57722004-11-28 Nathanael Nerode <neroden@gcc.gnu.org> 5773 5774 PR preprocessor/17610 5775 * directives.c (do_include_common): Error out if an empty filename 5776 is given for #include (or #include_next or #import). 5777 57782004-11-27 Roger Sayle <roger@eyesopen.com> 5779 Zack Weinberg <zack@codesourcery.com> 5780 5781 * internal.h: Replace all uses of uchar with unsigned char. 5782 * include/cpp-id-data.h: Likewise. Guard typedef of uchar 5783 with !IN_GCC, so uchar is only defined whilst building libcpp. 5784 57852004-11-24 Kelley Cook <kcook@gcc.gnu.org> 5786 5787 * aclocal.m4: Regenerate. 5788 57892004-11-24 Roger Sayle <roger@eyesopen.com> 5790 5791 PR preprocessor/15824 5792 * configure.ac: Correct HAVE_UCHAR test to #include <sys/types.h> 5793 directly, instead of the non-existant "system.h" and "ansidecl.h". 5794 * configure: Regenerate. 5795 57962004-11-23 Daniel Jacobowitz <dan@codesourcery.com> 5797 Joseph Myers <joseph@codesourcery.com> 5798 5799 * internal.h (struct lexer_state): Add in_deferred_pragma. 5800 * directives.c (struct pragma_entry): Add allow_expansion. 5801 (insert_pragma_entry): Take allow_expansion flag. 5802 (register_pragma): Likewise. 5803 (cpp_register_pragma): Likewise. 5804 (_cpp_init_internal_pragmas): Update calls to cpp_register_pragma. 5805 (do_pragma): Honor allow_expansion. 5806 (cpp_handle_deferred_pragma): Set in_deferred_pragma. 5807 * include/cpplib.h (cpp_register_pragma): Update prototype. 5808 58092004-11-18 Daniel Jacobowitz <dan@codesourcery.com> 5810 Mark Mitchell <mark@codesourcery.com> 5811 5812 * configure.ac (i[34567]86-*-solaris2.1[0-9]*): Set 5813 need_64bit_hwint=yes. 5814 * configure: Regenerate. 5815 58162004-11-09 Joseph S. Myers <joseph@codesourcery.com> 5817 5818 * Makefile.in ($(PACKAGE).pot): New rule. Depend on 5819 po/$(PACKAGE).pot. 5820 (po/$(PACKAGE).pot): Use ":" instead of "," in --keyword 5821 arguments. Add keywords _, N_, SYNTAX_ERROR and SYNTAX_ERROR2. 5822 Remove local srcdir path from generated file. 5823 58242004-11-04 Zack Weinberg <zack@codesourcery.com> 5825 Gerald Pfeifer <gerald@pfeifer.com> 5826 5827 * internal.h (HAVE_ICONV): Undefine if we do not have HAVE_ICONV_H 5828 as well. 5829 58302004-10-27 Zack Weinberg <zack@codesourcery.com> 5831 5832 PR 18075 5833 * directives.c (do_pragma): Do not defer pragmas which are unknown. 5834 (cpp_handle_deferred_pragma): Add cast to silence warning. 5835 58362004-10-14 Joseph S. Myers <jsm@polyomino.org.uk> 5837 5838 * errors.c (_cpp_begin_message): Print "error: " for errors. 5839 58402004-10-10 Andreas Jaeger <aj@suse.de> 5841 5842 * makedepend.c: Include mkdeps.h for prototype of deps_add_vpath. 5843 * Makefile.in (makedepend.o): Add dependency on mkdeps.h. 5844 58452004-10-08 Andrew Pinski <pinskia@physics.uc.edu> 5846 5847 * pch.c (cpp_write_pch_state): Remove variable z as it is not 5848 used. 5849 (cpp_read_state): Remove unused variables, m, d and mac_count. 5850 58512004-09-29 Per Bothner <per@bothner.com> 5852 5853 * directives.c (cpp_handle_deferred_pragma): Save, clear and restore 5854 cb.line_change. Otherwise do_pragma will call the line_change 5855 call-back with a meaningless line number. 5856 58572004-09-24 Zack Weinberg <zack@codesourcery.com> 5858 5859 * configure.ac: Move AC_PROG_MAKE_SET, AC_PROG_INSTALL to 5860 programs cluster. Use ACX_PROG_CC_WARNING_OPTS, 5861 ACX_PROG_CC_WARNING_ALMOST_PEDANTIC, ACX_PROG_CC_WARNINGS_ARE_ERRORS. 5862 * aclocal.m4, configure: Regenerate. 5863 * init.c: Include localedir.h. 5864 * Makefile.in (WARN_CFLAGS, ALL_CFLAGS): New variables. 5865 (DEFS): Delete. 5866 (.c.o): Use $(ALL_CFLAGS). 5867 (localedir.h, localedir.hs): New rules. 5868 (clean): Use rm -rf to remove directories. 5869 (distclean): Also delete localedir.h and localedir.hs. 5870 (init.o): Update dependencies. 5871 58722004-09-22 Kelley Cook <kcook@gcc.gnu.org> 5873 5874 * Makefile.in (aclocal.m4): Update dependencies. 5875 * configure.ac (AC_CONFIG_MACRO_DIR): New. 5876 * aclocal.m4, configure: Regenerate. 5877 58782004-09-17 Zack Weinberg <zack@codesourcery.com> 5879 5880 * charset.c (_cpp_destroy_iconv, emit_numeric_escape) 5881 (_cpp_convert_input, _cpp_default_encoding): Add comments. 5882 Some other comments in this file also tweaked. 5883 5884 * directives.c (do_pragma): Save current buffer position 5885 before lexing the pragma keywords; don't call 5886 _cpp_backup_tokens in the defer_pragmas case. 5887 58882004-09-15 Per Bothner <per@bothner.com> 5889 5890 * include/line-map.h (line_map_start): Add parameter names so 5891 preceding comment makes sense. 5892 (linemap_add): Remove from comment mention of non-existing parameter. 5893 58942004-09-09 Matt Austern <austern@apple.com> 5895 Zack Weinberg <zack@codesourcery.com> 5896 5897 * include/cpplib.h (TTYPE_TABLE): Remove CPP_ and SPELL_ 5898 prefixes throughout. Add entry for PRAGMA. Remove 5899 unnecessary "= 0" from EQ. 5900 (enum cpp_ttype): Adjust OP and TK definitions to restore 5901 prefixes, via token-paste. 5902 (CPP_LAST_EQ, CPP_FIRST_DIGRAPH, CPP_LAST_PUNCTUATOR, CPP_LAST_CPP_OP): 5903 Change from #defines to additional cpp_ttype enumerators. 5904 (struct cpp_options): Add defer_pragmas. 5905 (cpp_handle_deferred_pragma): Prototype new interface. 5906 5907 * internal.h (struct cpp_reader): Add directive_result. 5908 * directives.c (struct pragma_entry): Add is_internal field; 5909 give boolean fields type bool. 5910 (start_directive): Initialize pfile->directive_result.type. 5911 (_cpp_do__Pragma): Likewise. 5912 (run_directive): Do not crash if pfile->buffer->prev is NULL. 5913 (insert_pragma_entry): Add 'internal' argument; set new->is_internal 5914 from it. 5915 (register_pragma): New static function, bulk of former 5916 cpp_register_pragma here; add 'internal' argument, pass along 5917 to insert_pragma_entry. 5918 (cpp_register_pragma): Now a wrapper around register_pragma which 5919 always passes false for 'internal' argument. 5920 (_cpp_init_internal_pragmas): Call register_pragma directly, passing 5921 true for 'internal'. 5922 (do_pragma): If CPP_OPTION (pfile, defer_pragmas) and this isn't 5923 an internal pragma, save text till the end of the line as a CPP_PRAGMA 5924 token instead of executing the pragma. 5925 (cpp_handle_deferred_pragma): New interface. 5926 * lex.c (token_spellings): Adjust OP and TK definitions to 5927 match changes to cpplib.h. 5928 (_cpp_lex_token): Check for a directive-result token and 5929 return it if present. 5930 (cpp_token_val_index): Handle CPP_PRAGMA. 5931 * macro.c (cpp_builtin_macro_text): Correct comment. 5932 (builtin_macro): Handle directive-result tokens from _cpp_do__Pragma. 5933 59342004-09-06 Serge Belyshev <belyshev@lubercy.com> 5935 5936 PR preprocessor/14699 5937 * symtab.c (ht_dump_statistics): Change type of sum_of_squares 5938 from size_t to double. 5939 59402004-08-28 Andreas Schwab <schwab@suse.de> 5941 Andreas Jaeger <aj@suse.de> 5942 5943 * configure.ac: Set PACKAGE correctly. 5944 * configure: Regenerated. 5945 59462004-08-25 Paolo Bonzini <bonzini@gnu.org> 5947 5948 * Makefile.in: Add back top_builddir. 5949 59502004-08-25 Paolo Bonzini <bonzini@gnu.org> 5951 5952 * configure.ac: Replace Automake macro invocations 5953 with manual Autoconf checks and substitutions. 5954 * configure: Regenerate. 5955 * aclocal.m4: Regenerate. 5956 * config.in: Regenerate. 5957 * Makefile.am: Removed. 5958 * Makefile.in: Heavy simplification and reorganization. 5959 59602004-08-09 Mark Mitchell <mark@codesourcery.com> 5961 5962 * configure.ac (arm*-*-eabi*): New target. 5963 (arm*-*-symbianelf*): Likewise. 5964 * configure: Regenerated. 5965 59662004-07-24 Bernardo Innocenti <bernie@develer.com> 5967 5968 * internal.h (xnew, xcnew, xnewvec, xcnewvec, xobnew): Remove. 5969 * directives.c: Use XNEW-family macros from libiberty. 5970 * lex.c: Likewise. 5971 * macro.c: Likewise. 5972 * cpplib.h (cpp_deps_style): Export enum with name. 5973 59742004-07-23 Matthias Klose <doko@debian.org> 5975 5976 * init.c (init_library): Use PACKAGE for the text domain. 5977 59782004-07-16 Andris Pavenis <pavenis@latnet.lv> 5979 5980 PR preprocessor/16366 5981 * internal.h (struct cpp_reader): New field dir_hash. 5982 * files.c (make_cpp_dir): Use dir_hash, not file_hash. 5983 (_cpp_init_files, _cpp_cleanup_files): Update for new field. 5984 59852004-07-04 Neil Booth <neil@duron.akihabara.co.uk> 5986 5987 PR preprocessor/16192 5988 PR preprocessor/15913 5989 PR preprocessor/15572 5990 * expr.c (_cpp_parse_expr): Handle remaining cases where an 5991 expression is missing. 5992 * init.c (post_options): Traditional cpp doesn't do // comments. 5993 59942004-06-30 Per Bothner <per@bothner.com> 5995 5996 * include/line-map.h (fileline): Remove old typedef. 5997 * internal.h (struct cpp_reader): Use source_location typedef instead. 5998 59992004-06-26 Zack Weinberg <zack@codesourcery.com> 6000 6001 Partially revert patch of 2004-06-05. 6002 * files.c (search_cache): Remove pfile argument. Don't check 6003 for file that would be found by "" or <> search here... 6004 (_cpp_find_file): ...do it here, before calling find_file_in_dir. 6005 Do not apply directory-of-current-file correction to files 6006 found by this check. Rearrange code slightly. 6007 60082004-06-21 Geoffrey Keating <geoffk@apple.com> 6009 6010 * files.c (should_stack_file): Correct swapped parameters to call 6011 to cb.read_pch. 6012 * pch.c (cpp_valid_state): Handle -fpreprocessed. 6013 60142004-06-15 Paolo Bonzini <bonzini@gnu.org> 6015 6016 * Makefile.in: Regenerate with automake 1.8.5. 6017 * aclocal.m4: Likewise. 6018 * configure: Regenerate. 6019 60202004-06-11 Zack Weinberg <zack@codesourcery.com> 6021 6022 * configure.ac: Don't invoke ACX_HEADER_STDBOOL. 6023 * configure, config.in: Regenerate. 6024 * system.h: Unconditionally define bool as unsigned char, 6025 BOOL_BITFIELD as unsigned int. 6026 * .cvsignore: New file. 6027 60282004-06-09 Geoffrey Keating <geoffk@apple.com> 6029 6030 * traditional.c (push_replacement_text): Set macro->traditional. 6031 (save_replacement_text): Likewise. 6032 * pch.c (cpp_write_pch_state): Don't write list of defined macros. 6033 (struct save_macro_item): Delete. 6034 (struct save_macro_data): Use a character array not the previous 6035 structured format. 6036 (save_macros): Save macro as text not as internal structures. 6037 (cpp_prepare_state): Update for changes to save_macro_data. 6038 (cpp_read_state): Don't read macros defined in PCH. Restore 6039 -D macros as text. 6040 * macro.c (create_iso_definition): Honour alloc_subobject. 6041 Clear traditional flag. 6042 (_cpp_create_definition): Honour alloc_subobject. 6043 * lex.c (cpp_token_val_index): New. 6044 * internal.h: Include cpp-id-data.h. 6045 (uchar): Move definition to cpp-id-data.h. 6046 (U): Likewise. 6047 (cpp_macro): Likewise. 6048 * directives.c (struct answer): Move to cpp-id-data.h. 6049 (do_assert): Honour alloc_subobject. 6050 6051 * include/symtab.h (struct ht): Add field 'alloc_subobject'. 6052 * include/cpplib.h (struct cpp_string): Add GTY marker. 6053 (enum cpp_token_fld_kind): New. 6054 (struct cpp_token): Add GTY markers. 6055 (cpp_token_val_index): Prototype. 6056 (CPP_HASHNODE_VALUE_IDX): New. 6057 (struct cpp_hashnode): Don't skip fields of 'value' when marking. 6058 * include/cpp-id-data.h: New file. 6059 60602004-06-09 Paolo Bonzini <bonzini@gnu.org> 6061 6062 * Makefile.am (all-local): New. 6063 * Makefile.in: Regenerate. 6064 60652004-06-06 Roger Sayle <roger@eyesopen.com> 6066 6067 * Makefile.am (LIBICONV): Declare. 6068 (makedepend_LDADD): Use LIBICONV. 6069 * Makefile.in: Regenerate. 6070 60712004-06-05 Andrew Pinski <pinskia@physics.uc.edu> 6072 6073 * Makefile.am (LIBINTL): Declare 6074 (makedepend_LDADD): Use LIBINTL. 6075 * Makefile.in: Regenerate. 6076 60772004-06-05 Zack Weinberg <zack@codesourcery.com> 6078 6079 * Makefile.am: Add makedepend. 6080 * Makefile.in, aclocal.m4: Regenerate. 6081 * charset.c: Insert a space to avoid a warning. 6082 * directives.c: Include mkdeps.h. 6083 (_cpp_handle_directive): Reenable macro expander if appropriate. 6084 (undefine_macros): Inline body of _cpp_free_definition for speed. 6085 Do not call undef callback or _cpp_warn_if_unused_macro. 6086 (cpp_get_deps): New interface. 6087 * files.c (search_cache): Add pfile argument. Check for file 6088 that would be found by "" or <> search here... 6089 (_cpp_find_file): ...not here. Correct recorded start_dir of 6090 files found by directory-of-current-file search that would be 6091 found by "" or <> search. 6092 * init.c (cpp_add_dependency_target): Delete. 6093 * internal.h (struct lexer_state): Add discarding_output flag. 6094 * lex.c (lex_identifier): Compute hash function while scanning. 6095 * macro.c (cpp_scan_nooutput): Disable macro expansion outside 6096 directives. 6097 * makedepend.c: New file. 6098 * mkdeps.c (struct deps): Add vpath vector. 6099 (apply_vpath, deps_add_vpath): New function. 6100 (deps_free): Free vpath vector. 6101 (deps_add_dep, deps_add_target): Use apply_vpath. 6102 * symtab.c (calc_hash): Use HT_HASHSTEP and HT_FINISH. 6103 (ht_lookup_with_hash): New function. 6104 * cpplib.h, mkdeps.h: Update prototypes. 6105 * symtab.h: Update prototypes. 6106 (HT_HASHSTEP, HT_FINISH): New macros. 6107 61082004-05-29 Geoffrey Keating <geoffk@apple.com> 6109 6110 * symtab.c (ht_create): Set entries_owned. 6111 (ht_destroy): Honour entries_owned. 6112 (ht_expand): Likewise. 6113 (ht_load): New. 6114 * include/symtab.h (struct ht): New field 'entries_owned' 6115 (ht_load): New prototype. 6116 61172004-05-26 Paolo Bonzini <bonzini@gnu.org> 6118 6119 PR bootstrap/15651 6120 * configure.ac: Fix m4 quoting when picking 6121 the size of HOST_WIDE_INT. 6122 * configure: Regenerate. 6123 61242004-05-25 Paolo Bonzini <bonzini@gnu.org> 6125 6126 * Makefile.am: the correct directory for 6127 gettext include files is given by @INCINTL@. 6128 * Makefile.in: Regenerate. 6129 61302004-05-24 Paolo Bonzini <bonzini@gnu.org> 6131 6132 * system.h [!ENABLE_NLS]: dgettext takes two 6133 parameters. 6134 61352004-05-23 Paolo Bonzini <bonzini@gnu.org> 6136 6137 Moved libcpp from the gcc subdirectory to the toplevel. 6138 * Makefile.am: New file. 6139 * Makefile.in: Regenerate. 6140 * configure.ac: New file. 6141 * configure: Regenerate. 6142 * config.in: Regenerate. 6143 * charset.c: Moved from gcc/cppcharset.c. Add note about 6144 brokenness of input charset detection. Adjust for change 6145 in name of cppucnid.h. 6146 * errors.c: Moved from gcc/cpperror.c. Do not include intl.h. 6147 * expr.c: Moved from gcc/cppexp.c. 6148 * files.c: Moved from gcc/cppfiles.c. Do not include intl.h. 6149 Remove #define of O_BINARY, it is in system.h. 6150 * identifiers.c: Moved from gcc/cpphash.c. 6151 * internal.h: Moved from gcc/cpphash.h. Change header 6152 guard name. All other files adjusted to match name change. 6153 * init.c: Moved from gcc/cppinit.c. 6154 (init_library) [ENABLE_NLS]: Call bindtextdomain. 6155 * lex.c: Moved from gcc/cpplex.c. 6156 * directives.c: Moved from gcc/cpplib.c. 6157 * macro.c: Moved from gcc/cppmacro.c. 6158 * pch.c: Moved from gcc/cpppch.c. Do not include intl.h. 6159 * traditional.c: Moved from gcc/cpptrad.c. 6160 * ucnid.h: Moved from gcc/cppucnid.h. Change header 6161 guard name. 6162 * ucnid.pl: Moved from gcc/cppucnid.pl. 6163 * ucnid.tab: Moved from gcc/cppucnid.tab. Change header 6164 guard name. 6165 * symtab.c: Moved from gcc/hashtable.c. 6166 * line-map.c: Moved from gcc. Do not include intl.h. 6167 * mkdeps.c: Moved from gcc. 6168 * system.h: New file. 6169 * include/cpplib.h: Moved from gcc. Change header guard name. 6170 * include/line-map.h: Moved from gcc. Change header guard name. 6171 * include/mkdeps.h: Moved from gcc. Change header guard name. 6172 * include/symtab.h: Moved from gcc/hashtable.h. Change header 6173 guard name. 6174 6175Copyright (C) 2004-2020 Free Software Foundation, Inc. 6176 6177Copying and distribution of this file, with or without modification, 6178are permitted in any medium without royalty provided the copyright 6179notice and this notice are preserved. 6180