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