12024-06-20 Release Manager 2 3 * GCC 12.4.0 released. 4 52024-06-11 Jakub Jelinek <jakub@redhat.com> 6 7 Backported from master: 8 2024-02-22 Jakub Jelinek <jakub@redhat.com> 9 10 PR c/114007 11 * include/cpplib.h (COLON_SCOPE): Define to PURE_ZERO. 12 * lex.cc (_cpp_lex_direct): When lexing CPP_COLON with another 13 colon after it, if !CPP_OPTION (pfile, scope) set COLON_SCOPE 14 flag on the first CPP_COLON token. 15 162023-05-08 Release Manager 17 18 * GCC 12.3.0 released. 19 202022-08-19 Release Manager 21 22 * GCC 12.2.0 released. 23 242022-08-01 Lewis Hyatt <lhyatt@gmail.com> 25 26 Backported from master: 27 2022-07-10 Lewis Hyatt <lhyatt@gmail.com> 28 29 PR preprocessor/97498 30 * directives.cc (destringize_and_run): Override the location of 31 the CPP_PRAGMA token from a _Pragma directive to the location of 32 the expansion point, as is done for the tokens lexed from it. 33 342022-05-30 Jakub Jelinek <jakub@redhat.com> 35 36 Backported from master: 37 2022-05-29 Jakub Jelinek <jakub@redhat.com> 38 39 PR preprocessor/105732 40 * expr.cc (_cpp_parse_expr): Handle CPP_PADDING by just another 41 token. 42 432022-05-06 Release Manager 44 45 * GCC 12.1.0 released. 46 472022-02-11 Joseph Myers <joseph@codesourcery.com> 48 49 * Makefile.in (po/$(PACKAGE).pot): Also handle cpp_warning_at, 50 cpp_pedwarning_at and cpp_error_at. 51 522022-02-01 Jakub Jelinek <jakub@redhat.com> 53 54 PR preprocessor/104147 55 * macro.cc (funlike_invocation_p): For padding prefer a token 56 with val.source non-NULL especially if it has PREV_WHITE set 57 on val.source->flags. Add gcc_assert that CPP_PADDING tokens 58 don't have PREV_WHITE set in flags. 59 602022-02-01 Jakub Jelinek <jakub@redhat.com> 61 62 * directives.cc (destringize_and_run): Push &pfile->avoid_paste 63 instead of a copy of pfile->directive_result for the CPP_PADDING 64 case. 65 662022-01-24 Marek Polacek <polacek@redhat.com> 67 68 PR preprocessor/104030 69 * include/cpplib.h (enum cpp_bidirectional_level): Add 70 bidirectional_ucn. Set values explicitly. 71 * internal.h (cpp_reader): Adjust warn_bidi_p. 72 * lex.cc (maybe_warn_bidi_on_close): Don't warn about UCNs 73 unless UCN checking is on. 74 (maybe_warn_bidi_on_char): Likewise. 75 762022-01-18 Richard Biener <rguenther@suse.de> 77 78 * include/line-map.h (class line_maps): Re-arrange fields 79 to minimize padding. 80 (class rich_location): Likewise. 81 * line-map.cc (rich_location::rich_location): Adjust. 82 832022-01-17 Martin Liska <mliska@suse.cz> 84 85 * Makefile.in: Rename .c names to .cc. 86 872022-01-17 Martin Liska <mliska@suse.cz> 88 89 * Makefile.in: Rename .c names to .cc. 90 * charset.cc (convert_escape): Likewise. 91 * directives.cc (directive_diagnostics): Likewise. 92 (_cpp_handle_directive): Likewise. 93 (lex_macro_node): Likewise. 94 * include/cpplib.h (struct _cpp_file): Likewise. 95 (PURE_ZERO): Likewise. 96 (cpp_defined): Likewise. 97 (cpp_error_at): Likewise. 98 (cpp_forall_identifiers): Likewise. 99 (cpp_compare_macros): Likewise. 100 (cpp_get_converted_source): Likewise. 101 (cpp_read_state): Likewise. 102 (cpp_directive_only_process): Likewise. 103 (struct cpp_decoded_char): Likewise. 104 * include/line-map.h (enum lc_reason): Likewise. 105 (enum location_aspect): Likewise. 106 * include/mkdeps.h: Likewise. 107 * init.cc (cpp_destroy): Likewise. 108 (cpp_finish): Likewise. 109 * internal.h (struct cpp_reader): Likewise. 110 (_cpp_defined_macro_p): Likewise. 111 (_cpp_backup_tokens_direct): Likewise. 112 (_cpp_destroy_hashtable): Likewise. 113 (_cpp_has_header): Likewise. 114 (_cpp_expand_op_stack): Likewise. 115 (_cpp_commit_buff): Likewise. 116 (_cpp_restore_special_builtin): Likewise. 117 (_cpp_bracket_include): Likewise. 118 (_cpp_replacement_text_len): Likewise. 119 (ufputs): Likewise. 120 * line-map.cc (linemap_macro_loc_to_exp_point): Likewise. 121 (linemap_check_files_exited): Likewise. 122 (line_map_new_raw): Likewise. 123 * traditional.cc (enum ls): Likewise. 124 1252022-01-17 Martin Liska <mliska@suse.cz> 126 127 * charset.c: Moved to... 128 * charset.cc: ...here. 129 * directives.c: Moved to... 130 * directives.cc: ...here. 131 * errors.c: Moved to... 132 * errors.cc: ...here. 133 * expr.c: Moved to... 134 * expr.cc: ...here. 135 * files.c: Moved to... 136 * files.cc: ...here. 137 * identifiers.c: Moved to... 138 * identifiers.cc: ...here. 139 * init.c: Moved to... 140 * init.cc: ...here. 141 * lex.c: Moved to... 142 * lex.cc: ...here. 143 * line-map.c: Moved to... 144 * line-map.cc: ...here. 145 * macro.c: Moved to... 146 * macro.cc: ...here. 147 * makeucnid.c: Moved to... 148 * makeucnid.cc: ...here. 149 * mkdeps.c: Moved to... 150 * mkdeps.cc: ...here. 151 * pch.c: Moved to... 152 * pch.cc: ...here. 153 * symtab.c: Moved to... 154 * symtab.cc: ...here. 155 * traditional.c: Moved to... 156 * traditional.cc: ...here. 157 1582022-01-15 Martin Sebor <msebor@redhat.com> 159 160 * files.c (_cpp_find_file): Substitute a valid pointer for 161 an invalid one to avoid -Wuse-after-free. 162 1632022-01-12 Cl��ment Chigot <clement.chigot@atos.net> 164 165 * configure.ac: Check sizeof ino_t and dev_t. 166 * config.in: Regenerate. 167 * configure: Regenerate. 168 * include/cpplib.h (INO_T_CPP): Change for AIX. 169 (DEV_T_CPP): New macro. 170 (struct cpp_dir): Use it. 171 1722021-12-30 Jakub Jelinek <jakub@redhat.com> 173 174 PR preprocessor/89971 175 * macro.c (replace_args): For ##__VA_OPT__, if __VA_OPT__ expands 176 to no tokens at all, drop PASTE_LEFT flag from the previous token. 177 1782021-12-04 Jakub Jelinek <jakub@redhat.com> 179 180 PR preprocessor/102432 181 * lex.c (_cpp_lex_direct): If buffer->need_line while 182 pfile->state.in_deferred_pragma, return CPP_PRAGMA_EOL token instead 183 of assertion failure. 184 1852021-12-03 Jakub Jelinek <jakub@redhat.com> 186 187 PR pch/71934 188 * include/line-map.h (class line_maps): Add GTY((callback)) to 189 reallocator and round_alloc_size members. 190 1912021-12-01 Jakub Jelinek <jakub@redhat.com> 192 193 PR c++/100977 194 * init.c (struct lang_flags): Remove cxx23_identifiers. 195 (lang_defaults): Remove cxx23_identifiers initializers. 196 (cpp_set_lang): Don't copy cxx23_identifiers. 197 * include/cpplib.h (struct cpp_options): Adjust comment about 198 c11_identifiers. Remove cxx23_identifiers field. 199 * lex.c (warn_about_normalization): Use cplusplus instead of 200 cxx23_identifiers. 201 * charset.c (ucn_valid_in_identifier): Likewise. 202 2032021-12-01 Jakub Jelinek <jakub@redhat.com> 204 205 PR preprocessor/103415 206 * macro.c (stringify_arg): Remove va_opt argument and va_opt handling. 207 (paste_tokens): On successful paste or in PREV_WHITE and 208 PREV_FALLTHROUGH flags from the *plhs token to the new token. 209 (replace_args): Adjust stringify_arg callers. For #__VA_OPT__, 210 perform token pasting in a separate loop before stringify_arg call. 211 2122021-11-30 Richard Biener <rguenther@suse.de> 213 214 * charset.c (convert_escape): Remove unreachable break. 215 2162021-11-30 Jakub Jelinek <jakub@redhat.com> 217 218 PR c++/100977 219 * init.c (lang_defaults): Enable cxx23_identifiers for 220 -std={gnu,c}++{11,14,17,20} too. 221 2222021-11-29 Eric Gallager <egallager@gcc.gnu.org> 223 224 PR other/103021 225 * Makefile.in: Use ETAGS variable in TAGS target. 226 * configure: Regenerate. 227 * configure.ac: Allow ETAGS variable to be overridden. 228 2292021-11-23 Christophe Lyon <christophe.lyon@foss.st.com> 230 231 PR preprocessor/103355 232 * system.h (ATTR_LIKELY): Fix definition. 233 2342021-11-23 Marek Polacek <polacek@redhat.com> 235 Jonathan Wakely <jwakely@redhat.com> 236 237 PR preprocessor/103355 238 * lex.c: Use ATTR_LIKELY instead of [[likely]]. 239 * system.h (ATTR_LIKELY): Define. 240 2412021-11-22 Jakub Jelinek <jakub@redhat.com> 242 Tobias Burnus <tobias@codesourcery.com> 243 244 PR preprocessor/103165 245 * internal.h (struct lexer_state): Add ignore__Pragma field. 246 * macro.c (builtin_macro): Don't interpret _Pragma if 247 pfile->state.ignore__Pragma. 248 (expand_arg): Temporarily set pfile->state.ignore__Pragma to 1. 249 2502021-11-17 David Malcolm <dmalcolm@redhat.com> 251 252 PR preprocessor/103026 253 * lex.c (struct bidi::context): New. 254 (bidi::vec): Convert to a vec of context rather than unsigned 255 char. 256 (bidi::ctx_at): Rename to... 257 (bidi::pop_kind_at): ...this and reimplement for above change. 258 (bidi::current_ctx): Update for change to vec. 259 (bidi::current_ctx_ucn_p): Likewise. 260 (bidi::current_ctx_loc): New. 261 (bidi::on_char): Update for usage of context struct. Add "loc" 262 param and pass it when pushing contexts. 263 (get_location_for_byte_range_in_cur_line): New. 264 (get_bidi_utf8): Rename to... 265 (get_bidi_utf8_1): ...this, reintroducing... 266 (get_bidi_utf8): ...as a wrapper, setting *OUT when the result is 267 not NONE. 268 (get_bidi_ucn): Rename to... 269 (get_bidi_ucn_1): ...this, reintroducing... 270 (get_bidi_ucn): ...as a wrapper, setting *OUT when the result is 271 not NONE. 272 (class unpaired_bidi_rich_location): New. 273 (maybe_warn_bidi_on_close): Use unpaired_bidi_rich_location when 274 reporting on unpaired bidi chars. Split into singular vs plural 275 spellings. 276 (maybe_warn_bidi_on_char): Pass in a location_t rather than a 277 const uchar * and use it when emitting warnings, and when calling 278 bidi::on_char. 279 (_cpp_skip_block_comment): Capture location when kind is not NONE 280 and pass it to maybe_warn_bidi_on_char. 281 (skip_line_comment): Likewise. 282 (forms_identifier_p): Likewise. 283 (lex_raw_string): Likewise. 284 (lex_string): Likewise. 285 2862021-11-17 David Malcolm <dmalcolm@redhat.com> 287 288 PR preprocessor/103026 289 * lex.c (maybe_warn_bidi_on_close): Use a rich_location 290 and call set_escape_on_output (true) on it. 291 (maybe_warn_bidi_on_char): Likewise. 292 2932021-11-17 Jakub Jelinek <jakub@redhat.com> 294 295 PR preprocessor/103130 296 * lex.c (cpp_directive_only_process): Treat even \*/ as end of block 297 comment. 298 2992021-11-17 Marek Polacek <polacek@redhat.com> 300 301 PR preprocessor/103026 302 * include/cpplib.h (enum cpp_bidirectional_level): New. 303 (struct cpp_options): Add cpp_warn_bidirectional. 304 (enum cpp_warning_reason): Add CPP_W_BIDIRECTIONAL. 305 * internal.h (struct cpp_reader): Add warn_bidi_p member 306 function. 307 * init.c (cpp_create_reader): Set cpp_warn_bidirectional. 308 * lex.c (bidi): New namespace. 309 (get_bidi_utf8): New function. 310 (get_bidi_ucn): Likewise. 311 (maybe_warn_bidi_on_close): Likewise. 312 (maybe_warn_bidi_on_char): Likewise. 313 (_cpp_skip_block_comment): Implement warning about bidirectional 314 control characters. 315 (skip_line_comment): Likewise. 316 (forms_identifier_p): Likewise. 317 (lex_identifier): Likewise. 318 (lex_string): Likewise. 319 (lex_raw_string): Likewise. 320 3212021-11-01 David Malcolm <dmalcolm@redhat.com> 322 323 * charset.c (convert_escape): Use encoding_rich_location when 324 complaining about nonprintable unknown escape sequences. 325 (cpp_display_width_computation::::cpp_display_width_computation): 326 Pass in policy rather than tabstop. 327 (cpp_display_width_computation::process_next_codepoint): Add "out" 328 param and populate *out if non-NULL. 329 (cpp_display_width_computation::advance_display_cols): Pass NULL 330 to process_next_codepoint. 331 (cpp_byte_column_to_display_column): Pass in policy rather than 332 tabstop. Pass NULL to process_next_codepoint. 333 (cpp_display_column_to_byte_column): Pass in policy rather than 334 tabstop. 335 * errors.c (cpp_diagnostic_get_current_location): New function, 336 splitting out the logic from... 337 (cpp_diagnostic): ...here. 338 (cpp_warning_at): New function. 339 (cpp_pedwarning_at): New function. 340 * include/cpplib.h (cpp_warning_at): New decl for rich_location. 341 (cpp_pedwarning_at): Likewise. 342 (struct cpp_decoded_char): New. 343 (struct cpp_char_column_policy): New. 344 (cpp_display_width_computation::cpp_display_width_computation): 345 Replace "tabstop" param with "policy". 346 (cpp_display_width_computation::process_next_codepoint): Add "out" 347 param. 348 (cpp_display_width_computation::m_tabstop): Replace with... 349 (cpp_display_width_computation::m_policy): ...this. 350 (cpp_byte_column_to_display_column): Replace "tabstop" param with 351 "policy". 352 (cpp_display_width): Likewise. 353 (cpp_display_column_to_byte_column): Likewise. 354 * include/line-map.h (rich_location::escape_on_output_p): New. 355 (rich_location::set_escape_on_output): New. 356 (rich_location::m_escape_on_output): New. 357 * internal.h (cpp_diagnostic_get_current_location): New decl. 358 (class encoding_rich_location): New. 359 * lex.c (skip_whitespace): Use encoding_rich_location when 360 complaining about null characters. 361 (warn_about_normalization): Generate a source range when 362 complaining about improperly normalized tokens, rather than just a 363 point, and use encoding_rich_location so that the source code 364 is escaped on printing. 365 * line-map.c (rich_location::rich_location): Initialize 366 m_escape_on_output. 367 3682021-10-29 Tobias Burnus <tobias@codesourcery.com> 369 370 PR c++/102409 371 * directives.c (destringize_and_run): Add PRAGMA_OP to the 372 CPP_PRAGMA token's flags to mark is as coming from _Pragma. 373 * include/cpplib.h (PRAGMA_OP): #define, to be used with token flags. 374 * macro.c (collect_args): Only handle CPP_PRAGMA special if PRAGMA_OP 375 is set. 376 3772021-10-22 Eric Gallager <egallager@gcc.gnu.org> 378 379 PR other/102663 380 * Makefile.in: Add dummy install-dvi target. 381 3822021-10-18 Martin Liska <mliska@suse.cz> 383 384 * charset.c (convert_oct): Remove unused but set variable. 385 3862021-10-06 Jakub Jelinek <jakub@redhat.com> 387 388 * init.c (lang_defaults): Implement P2334R1, enable elifdef for 389 -std=c++23 and -std=gnu++23. 390 * directives.c (_cpp_handle_directive): Support elifdef/elifndef if 391 either CPP_OPTION (pfile, elifdef) or !CPP_OPTION (pfile, std). 392 (do_elif): For older non-std modes if pedantic pedwarn about 393 #elifdef/#elifndef directives that change behavior. 394 3952021-09-01 Jakub Jelinek <jakub@redhat.com> 396 397 PR c++/100977 398 * include/cpplib.h (struct cpp_options): Add cxx23_identifiers. 399 * charset.c (CXX23, NXX23): New enumerators. 400 (CID, NFC, NKC, CTX): Renumber. 401 (ucn_valid_in_identifier): Implement P1949R7 - use CXX23 and 402 NXX23 flags for cxx23_identifiers. For start character in 403 non-pedantic mode, allow characters that are allowed as start 404 characters in any of the supported language modes, rather than 405 disallowing characters allowed only as non-start characters in 406 current mode but for characters from other language modes allowing 407 them even if they are never allowed at start. 408 * init.c (struct lang_flags): Add cxx23_identifiers. 409 (lang_defaults): Add cxx23_identifiers column. 410 (cpp_set_lang): Initialize CPP_OPTION (pfile, cxx23_identifiers). 411 * lex.c (warn_about_normalization): If cxx23_identifiers, use 412 cpp_pedwarning_with_line instead of cpp_warning_with_line for 413 "is not in NFC" diagnostics. 414 * makeucnid.c: Adjust usage comment. 415 (CXX23, NXX23): New enumerators. 416 (all_languages): Add CXX23. 417 (not_NFC, not_NFKC, maybe_not_NFC): Renumber. 418 (read_derivedcore): New function. 419 (write_table): Print also CXX23 and NXX23 columns. 420 (main): Require 5 arguments instead of 4, call read_derivedcore. 421 * ucnid.h: Regenerated using Unicode 13.0.0 files. 422 4232021-09-01 Jason Merrill <jason@redhat.com> 424 425 * macro.c (replace_args): When __VA_OPT__ is on the LHS of ##, 426 remove trailing avoid_paste tokens. 427 4282021-09-01 Jakub Jelinek <jakub@redhat.com> 429 430 PR preprocessor/101488 431 * macro.c (replace_args): Fix up handling of CPP_PADDING tokens at the 432 start or end of __VA_OPT__ arguments when preceeded or followed by ##. 433 4342021-08-31 Martin Sebor <msebor@redhat.com> 435 436 * include/line-map.h (class rich_location): Disable copying and 437 assignment. 438 4392021-08-25 Lewis Hyatt <lhyatt@gmail.com> 440 441 PR other/93067 442 * charset.c (init_iconv_desc): Adapt to permit PFILE argument to 443 be NULL. 444 (_cpp_convert_input): Likewise. Also move UTF-8 BOM logic to... 445 (cpp_check_utf8_bom): ...here. New function. 446 (cpp_input_conversion_is_trivial): New function. 447 * files.c (read_file_guts): Allow PFILE argument to be NULL. Add 448 INPUT_CHARSET argument as an alternate source of this information. 449 (read_file): Pass the new argument to read_file_guts. 450 (cpp_get_converted_source): New function. 451 * include/cpplib.h (struct cpp_converted_source): Declare. 452 (cpp_get_converted_source): Declare. 453 (cpp_input_conversion_is_trivial): Declare. 454 (cpp_check_utf8_bom): Declare. 455 4562021-08-17 Jakub Jelinek <jakub@redhat.com> 457 458 * macro.c (vaopt_state): Add m_stringify member. 459 (vaopt_state::vaopt_state): Initialize it. 460 (vaopt_state::update): Overwrite it. 461 (vaopt_state::stringify): New method. 462 (stringify_arg): Replace arg argument with first, count arguments 463 and add va_opt argument. Use first instead of arg->first and 464 count instead of arg->count, for va_opt add paste_tokens handling. 465 (paste_tokens): Fix up len calculation. Don't spell rhs twice, 466 instead use %.*s to supply lhs and rhs spelling lengths. Don't call 467 _cpp_backup_tokens here. 468 (paste_all_tokens): Call it here instead. 469 (replace_args): Adjust stringify_arg caller. For vaopt_state::END 470 if stringify is true handle __VA_OPT__ stringification. 471 (create_iso_definition): Handle # __VA_OPT__ similarly to # macro_arg. 472 4732021-08-12 Jakub Jelinek <jakub@redhat.com> 474 475 PR preprocessor/101638 476 * macro.c (cpp_sys_macro_p): Return true instead of 477 crashing on builtin macros. 478 4792021-08-05 Jakub Jelinek <jakub@redhat.com> 480 481 PR c++/100977 482 * ucnid.h: Regenerated using Unicode 13.0.0 files. 483 4842021-08-05 Jakub Jelinek <jakub@redhat.com> 485 486 PR c++/100977 487 * makeucnid.c (write_table): Fix computation of last_combine. 488 * ucnid.h: Regenerated using Unicode 6.3.0 files. 489 4902021-06-16 Jason Merrill <jason@redhat.com> 491 492 PR c++/100796 493 PR preprocessor/96391 494 * line-map.c (linemap_compare_locations): Only use comparison with 495 LINE_MAP_MAX_LOCATION_WITH_COLS to avoid abort. 496 4972021-05-20 Christophe Lyon <christophe.lyon@linaro.org> 498 Torbj��rn Svensson <torbjorn.svensson@st.com> 499 500 PR c/42579 501 * include/cpplib.h (cpp_builtin_type): Add BT_FILE_NAME entry. 502 * init.c (builtin_array): Likewise. 503 * macro.c (_cpp_builtin_macro_text): Add support for BT_FILE_NAME. 504 5052021-05-20 Jakub Jelinek <jakub@redhat.com> 506 507 PR preprocessor/100646 508 * lex.c (cpp_directive_only_process): Treat end of file as termination 509 for !is_block comments. 510 5112021-05-12 Jakub Jelinek <jakub@redhat.com> 512 513 PR preprocessor/100392 514 * lex.c (cpp_directive_only_process): If buffer doesn't end with '\n', 515 add buffer->rlimit[0] character to the printed range and 516 CPP_INCREMENT_LINE and increment line_count. 517 5182021-05-11 Joseph Myers <joseph@codesourcery.com> 519 520 * include/cpplib.h (struct cpp_options): Add elifdef. 521 * init.c (struct lang_flags): Add elifdef. 522 (lang_defaults): Update to include elifdef initializers. 523 (cpp_set_lang): Set elifdef for pfile based on language. 524 * directives.c (STDC2X, ELIFDEF): New macros. 525 (EXTENSION): Increase value to 3. 526 (DIRECTIVE_TABLE): Add #elifdef and #elifndef. 527 (_cpp_handle_directive): Do not treat ELIFDEF directives as 528 directives for language versions without the #elifdef feature. 529 (do_elif): Handle #elifdef and #elifndef. 530 (do_elifdef, do_elifndef): New functions. 531 5322021-05-11 Joseph Myers <joseph@codesourcery.com> 533 534 * lex.c (cpp_avoid_paste): Do not allow pasting CPP_NUMBER with 535 CPP_CHAR. 536 5372021-05-11 Joseph Myers <joseph@codesourcery.com> 538 539 * init.c (lang_defaults): Enable digit separators for GNUC2X and 540 STDC2X. 541 5422021-05-07 Jakub Jelinek <jakub@redhat.com> 543 544 PR c/100450 545 * lex.c (cpp_avoid_paste): Handle token1 CPP_PRAGMA like CPP_NAME. 546 5472021-05-06 Joseph Myers <joseph@codesourcery.com> 548 549 PR c++/83873 550 PR preprocessor/97604 551 * lex.c (lex_number): Reject adjacent digit separators here. Do 552 not allow digit separators before '.' or an exponent with sign. 553 * expr.c (cpp_classify_number): Do not check for adjacent digit 554 separators here. 555 5562021-05-03 H.J. Lu <hjl.tools@gmail.com> 557 558 PR bootstrap/99703 559 * configure: Regenerated. 560 5612021-04-29 Joseph Myers <joseph@codesourcery.com> 562 563 PR preprocessor/82359 564 * directives.c (strtolinenum): Handle digit separators. 565 5662021-04-19 Richard Biener <rguenther@suse.de> 567 568 PR preprocessor/100142 569 * line-map.c (linemap_position_for_loc_and_offset): Revert 570 unintended s/column_offset/column/ change. 571 5722021-04-13 Nathan Sidwell <nathan@acm.org> 573 574 PR preprocessor/99446 575 * line-map.c (line-map.c): Do not advance to linemaps for 576 different files. 577 5782021-04-13 Eric Botcazou <ebotcazou@adacore.com> 579 580 * include/line-map.h (IS_MACRO_LOC): Delete. 581 * line-map.c (linemap_location_from_macro_expansion_p): Test 582 LINEMAPS_MACRO_LOWEST_LOCATION of the linemap. 583 5842021-03-02 David Malcolm <dmalcolm@redhat.com> 585 586 PR c/99323 587 * line-map.c (rich_location::maybe_add_fixit): Reject fix-it hints 588 at column 0. 589 5902021-02-24 Nathan Sidwell <nathan@acm.org> 591 592 PR c++/98718 593 * include/line-map.h 594 * line-map.c 595 5962021-02-24 Nathan Sidwell <nathan@acm.org> 597 598 PR c++/99072 599 * init.c (read_original_filename): Expunge all evidence of the 600 original filename. 601 6022021-02-18 Nathan Sidwell <nathan@acm.org> 603 604 PR c++/99023 605 * include/cpplib.h (cpp_find_header_unit): Rename to ... 606 (cpp_probe_header_unit): ... this. 607 * internal.h (_cp_find_header_unit): Declare. 608 * files.c (cpp_find_header_unit): Break apart to .. 609 (test_header_unit): ... this, and ... 610 (_cpp_find_header_unit): ... and, or and ... 611 (cpp_probe_header_unit): ... this. 612 * macro.c (cpp_get_token_1): Call _cpp_find_header_unit. 613 6142021-02-16 Nathan Sidwell <nathan@acm.org> 615 616 * files.c (_cpp_stack_file): Make buffers end in unread \n. 617 6182021-02-10 David Malcolm <dmalcolm@redhat.com> 619 620 PR preprocessor/96391 621 * line-map.c (linemap_compare_locations): Require that 622 the location be <= LINE_MAP_MAX_LOCATION_WITH_COLS when 623 treating locations as coming from the same macro expansion. 624 6252021-02-04 Jakub Jelinek <jakub@redhat.com> 626 627 * expr.c (cpp_classify_number): Use make_signed_t<size_t> instead of 628 make_signed<size_t>::type in the diagnostics. 629 6302021-02-03 Jakub Jelinek <jakub@redhat.com> 631 632 PR preprocessor/98882 633 * lex.c (cpp_directive_only_process): Don't assert that rlimit[-1] 634 is a newline, instead assert that rlimit[0] is either newline or 635 carriage return. When seeing '\\' followed by '\r', check limit 636 before accessing pos[1]. 637 6382021-02-03 Ed Smith-Rowland <3dw4rd@verizon.net> 639 640 * expr.c (interpret_int_suffix): Detect 'z' integer suffix. 641 (cpp_classify_number): Compat warning for use of 'z' suffix. 642 * include/cpplib.h (struct cpp_options): New flag. 643 (enum cpp_warning_reason): New flag. 644 (CPP_N_USERDEF): Comment C++0x -> C++11. 645 (CPP_N_SIZE_T): New flag for cpp_classify_number. 646 * init.c (cpp_set_lang): Initialize new flag. 647 6482021-01-27 liuhongt <hongtao.liu@intel.com> 649 650 PR target/98833 651 * lex.c (search_line_sse2): Replace builtins with == operator. 652 6532021-01-26 Paul Fee <paul.f.fee@gmail.com> 654 655 * include/cpplib.h (c_lang): Add CXX23 and GNUCXX23. 656 * init.c (lang_defaults): Add rows for CXX23 and GNUCXX23. 657 (cpp_init_builtins): Set __cplusplus to 202100L for C++23. 658 6592021-01-15 Nathan Sidwell <nathan@acm.org> 660 661 PR preprocessor/95253 662 * mkdeps.c (munge): Do not escape ':'. 663 6642020-12-14 Nathan Sidwell <nathan@acm.org> 665 666 * include/cpplib.h (struct cpp_macro): Add imported_p field. 667 (struct cpp_hashnode): Tweak deferred field documentation. 668 * macro.c (_cpp_new_macro): Clear new field. 669 (cpp_get_deferred_macro, get_deferred_or_lazy_macro): Assert 670 more. 671 6722020-12-10 Jason Merrill <jason@redhat.com> 673 674 * init.c (cpp_init_builtins): Update __cplusplus for C++20. 675 6762020-12-01 JeanHeyd Meneide <phdofthehouse@gmail.com> 677 678 * charset.c (init_iconv_desc): Initialize "to" and "from" fields. 679 * directives.c (cpp_get_narrow_charset_name): New function. 680 (cpp_get_wide_charset_name): Likewise. 681 * include/cpplib.h (cpp_get_narrow_charset_name): Prototype. 682 (cpp_get_wide_charset_name): Likewise. 683 * internal.h (cset_converter): Add "to" and "from" fields. 684 6852020-11-27 Joseph Myers <joseph@codesourcery.com> 686 687 PR preprocessor/97602 688 * directives.c (strtolinenum): Check for overflow before it 689 occurs. Correct comment. 690 6912020-11-24 Nathan Sidwell <nathan@acm.org> 692 693 * include/cpplib.h (struct cpp_hashnode): Add deferred field. 694 (cpp_set_deferred_macro): Define. 695 (cpp_get_deferred_macro): Declare. 696 (cpp_macro_definition): Reformat, add overload. 697 (cpp_macro_definition_location): Deal with deferred macro. 698 (cpp_alloc_token_string, cpp_compare_macro): Declare. 699 * internal.h (_cpp_notify_macro_use): Return bool 700 (_cpp_maybe_notify_macro_use): Likewise. 701 * directives.c (do_undef): Check macro is not undef before 702 warning. 703 (do_ifdef, do_ifndef): Deal with deferred macro. 704 * expr.c (parse_defined): Likewise. 705 * lex.c (cpp_allocate_token_string): Break out of ... 706 (create_literal): ... here. Call it. 707 (cpp_maybe_module_directive): Deal with deferred macro. 708 * macro.c (cpp_get_token_1): Deal with deferred macro. 709 (warn_of_redefinition): Deal with deferred macro. 710 (compare_macros): Rename to ... 711 (cpp_compare_macro): ... here. Make extern. 712 (cpp_get_deferred_macro): New. 713 (_cpp_notify_macro_use): Deal with deferred macro, return bool 714 indicating definedness. 715 (cpp_macro_definition): Deal with deferred macro. 716 7172020-11-19 Nathan Sidwell <nathan@acm.org> 718 719 * include/cpplib.h (enum cpp_main_search): New. 720 (struct cpp_options): Add main_search field. 721 (cpp_main_loc): Declare. 722 (cpp_retrofit_as_include): Declare. 723 * internal.h (struct cpp_reader): Add main_loc field. 724 (_cpp_in_main_source_file): Not main if main is a header. 725 * init.c (cpp_read_main_file): Use main_search option to locate 726 main file. Set main_loc 727 * files.c (cpp_retrofit_as_include): New. 728 7292020-11-19 Nathan Sidwell <nathan@acm.org> 730 731 * internal.h (cpp_in_system_header): Rename to ... 732 (_cpp_in_system_header): ... here. 733 (cpp_in_primary_file): Rename to ... 734 (_cpp_in_main_source_file): ... here. Compare main_file equality 735 and check main_search value. 736 * lex.c (maybe_va_opt_error, _cpp_lex_direct): Adjust for rename. 737 * macro.c (_cpp_builtin_macro_text): Likewise. 738 (replace_args): Likewise. 739 * directives.c (do_include_next): Likewise. 740 (do_pragma_once, do_pragma_system_header): Likewise. 741 * files.c (struct _cpp_file): Delete main_file field. 742 (pch_open): Check pfile->main_file equality. 743 (make_cpp_file): Drop cpp_reader parm, don't set main_file. 744 (_cpp_find_file): Adjust. 745 (_cpp_stack_file): Check pfile->main_file equality. 746 (struct report_missing_guard_data): Add cpp_reader field. 747 (report_missing_guard): Check pfile->main_file equality. 748 (_cpp_report_missing_guards): Adjust. 749 7502020-11-18 Nathan Sidwell <nathan@acm.org> 751 752 * include/cpplib.h (struct cpp_options): Add module_directives 753 option. 754 (NODE_MODULE): New node flag. 755 (struct cpp_hashnode): Make rid-code a bitfield, increase bits in 756 flags and swap with type field. 757 * init.c (post_options): Create module-directive identifier nodes. 758 * internal.h (struct lexer_state): Add directive_file_token & 759 n_modules fields. Add module node enumerator. 760 * lex.c (cpp_maybe_module_directive): New. 761 (_cpp_lex_token): Call it. 762 (cpp_output_token): Add '"' around CPP_HEADER_NAME token. 763 (do_peek_ident, do_peek_module): New. 764 (cpp_directives_only): Detect module-directive lines. 765 * macro.c (cpp_get_token_1): Deal with directive_file_token 766 triggering. 767 7682020-11-18 Nathan Sidwell <nathan@acm.org> 769 770 * files.c (struct _cpp_file): Add header_unit field. 771 (_cpp_stack_file): Add header unit support. 772 (cpp_find_header_unit): New. 773 * include/cpplib.h (cpp_find_header_unit): Declare. 774 7752020-11-18 Nathan Sidwell <nathan@acm.org> 776 777 * include/cpplib.h (struct cpp_options): Add modules to 778 dep-options. 779 * include/mkdeps.h (deps_add_module_target): Declare. 780 (deps_add_module_dep): Declare. 781 * mkdeps.c (class mkdeps): Add modules, module_name, cmi_name, 782 is_header_unit fields. Adjust cdtors. 783 (deps_add_module_target, deps_add_module_dep): New. 784 (make_write): Write module dependencies, if enabled. 785 7862020-11-17 Nathan Sidwell <nathan@acm.org> 787 788 * include/cpplib.h (struct cpp_callbacks): Add 789 user_deferred_macro & translate_include. 790 7912020-11-17 Nathan Sidwell <nathan@acm.org> 792 793 * include/line-map.h (enum lc_reason): Add LC_MODULE. 794 (MAP_MODULE_P): New. 795 (line_map_new_raw): Declare. 796 (linemap_enter_macro): Move declaration from internal.h 797 (linemap_module_loc, linemap_module_reparent) 798 (linemap_module_restore): Declare. 799 (linemap_lookup_macro_indec): Declare. 800 * internal.h (linemap_enter_macro): Moved to line-map.h. 801 * line-map.c (linemap_new_raw): New, broken out of ... 802 (new_linemap): ... here. Call it. 803 (LAST_SOURCE_LINE_LOCATION): New. 804 (liemap_module_loc, linemap_module_reparent) 805 (linemap_module_restore): New. 806 (linemap_lookup_macro_index): New, broken out of ... 807 (linemap_macro_map_lookup): ... here. Call it. 808 (linemap_dump): Add module dump. 809 8102020-11-17 Nathan Sidwell <nathan@acm.org> 811 812 PR preprocessor/97858 813 * mkdeps.c (munge): Drop varadic args, we only ever use one. 814 8152020-11-13 Joseph Myers <joseph@codesourcery.com> 816 817 * expr.c (cpp_classify_number): Update diagnostic for binary 818 constants for C. Also diagnose binary constants for 819 -Wc11-c2x-compat. 820 * init.c (lang_defaults): Enable binary constants for GNUC2X and 821 STDC2X. 822 8232020-11-13 Piotr H. Dabrowski <phd@phd.re> 824 825 PR c++/91318 826 * include/cpplib.h: Added cpp_define_unused(), cpp_define_formatted_unused() 827 * directives.c: Likewise. 828 8292020-11-12 Joseph Myers <joseph@codesourcery.com> 830 831 * include/cpplib.h (struct cpp_callbacks): Add bool argument to 832 has_attribute. 833 (enum cpp_builtin_type): Add BT_HAS_STD_ATTRIBUTE. 834 * init.c (builtin_array): Add __has_c_attribute. 835 (cpp_init_special_builtins): Handle BT_HAS_STD_ATTRIBUTE. 836 * macro.c (_cpp_builtin_macro_text): Handle BT_HAS_STD_ATTRIBUTE. 837 Update call to has_attribute for BT_HAS_ATTRIBUTE. 838 * traditional.c (fun_like_macro): Handle BT_HAS_STD_ATTRIBUTE. 839 8402020-11-12 Nicholas Guriev <guriev-ns@ya.ru> 841 842 PR pch/86674 843 * files.c (_cpp_find_file): Use CPP_DL_NOTE not CPP_DL_ERROR in call to 844 cpp_error. 845 8462020-11-07 Lewis Hyatt <lhyatt@gmail.com> 847 848 * generated_cpp_wcwidth.h: Regenerated from Unicode 13.0.0 data. 849 8502020-11-06 Nathan Sidwell <nathan@acm.org> 851 852 * include/cpplib.h (enum class CPP_time_kind): New. 853 (cpp_get_date): Declare. 854 * internal.h (struct cpp_reader): Replace source_date_epoch with 855 time_stamp and time_stamp_kind. 856 * init.c (cpp_create_reader): Initialize them. 857 * macro.c (_cpp_builtin_macro_text): Use cpp_get_date. 858 (cpp_get_date): Broken out from _cpp_builtin_macro_text and 859 genericized. 860 8612020-11-03 Nathan Sidwell <nathan@acm.org> 862 863 * lex.c (cpp_peek_token): Do not peek past CPP_PRAGMA. 864 (_cpp_lex_direct): Handle EOF in pragma when setting need_line, 865 not when needing a line. 866 8672020-11-03 Nathan Sidwell <nathan@acm.org> 868 869 * lex.c (_cpp_clean_line): Fix DOS off-by-one error. 870 8712020-11-03 Nathan Sidwell <nathan@acm.org> 872 873 * init.c (cpp_read_main_file): Use cpp_get_deps result. 874 8752020-11-03 Nathan Sidwell <nathan@acm.org> 876 877 * include/mkdeps.h: Include cpplib.h 878 (deps_write): Adjust first parm type. 879 * mkdeps.c: Include internal.h 880 (make_write): Adjust first parm type. Check phony option 881 directly. 882 (deps_write): Adjust first parm type. 883 * init.c (cpp_read_main_file): Use get_deps. 884 * directives.c (cpp_get_deps): Check option before initializing. 885 8862020-11-02 Nathan Sidwell <nathan@acm.org> 887 888 * internal.h (_cpp_notify_macro_use): Add location parm. 889 (_cpp_maybe_notify_macro_use): Likewise. 890 * directives.c (_cpp_do_file_change): Check we've not changed file 891 when optimizing a rewind. 892 (do_ifdef): Pass location to _cpp_maybe_notify_macro_use. 893 (do_ifndef): Likewise. Delete obsolete comment about powerpc. 894 * expr.c (parse_defined): Pass location to 895 _cpp_maybe_notify_macro_use. 896 * macro.c (enter_macro_context): Likewise. 897 (warn_of_redefinition): Break out helper function. Call it. 898 (compare_macros): New function broken out of warn_of_redefinition. 899 (_cpp_new_macro): Zero all fields. 900 (_cpp_notify_macro_use): Add location parameter. 901 9022020-10-20 Nathan Sidwell <nathan@acm.org> 903 904 * lex.c (_cpp_lex_direct): Do not complete EOF processing when 905 parsing_args. 906 * macro.c (collect_args): Do not unwind fake EOF. 907 (funlike_invocation_p): Do not unwind fake EOF. 908 (cpp_context): Replace abort with gcc_assert. 909 9102020-10-19 Nathan Sidwell <nathan@acm.org> 911 912 * internal.h (struct cpp_reader): Rename 'eof' field to 'endarg'. 913 * init.c (cpp_create_reader): Adjust. 914 * macro.c (collect_args): Use endarg for separator. Always rewind 915 in the not-fn case. 916 9172020-10-08 Nathan Sidwell <nathan@acm.org> 918 919 * internal.h (enum include_type): Rename IT_MAIN_INJECT to 920 IT_PRE_MAIN. 921 * init.c (cpp_read_main_file): If there is no line marker, adjust 922 the initial line marker. 923 (read_original_filename): Return bool, peek the buffer directly 924 before trying to tokenize. 925 (read_original_directory): Likewise. Directly prod the string 926 literal. 927 * files.c (_cpp_stack_file): Adjust for IT_PRE_MAIN change. 928 9292020-09-26 Jakub Jelinek <jakub@redhat.com> 930 931 PR bootstrap/97163 932 * lex.c (search_line_fast): Only use _ARCH_PWR8 Altivec version 933 for GCC >= 4.5. 934 9352020-09-17 Patrick Palka <ppalka@redhat.com> 936 937 PR c/80076 938 * include/line-map.h (first_map_in_common): Declare. 939 * line-map.c (first_map_in_common): Remove static. 940 9412020-09-07 Martin Storsj�� <martin@martin.st> 942 943 * files.c (remap_filename): Make a strchr return value pointer 944 to const. 945 9462020-07-30 H.J. Lu <hjl.tools@gmail.com> 947 948 PR bootstrap/96202 949 * configure: Regenerated. 950 9512020-07-29 Tiziano M��ller <tiziano.mueller@chem.uzh.ch> 952 953 * init.c (builtin_array): Add xref comment. 954 * traditional.c (fun_like_macro): Add HAS_INCLUDE codes. 955 9562020-07-28 Jakub Jelinek <jakub@redhat.com> 957 958 PR preprocessor/96323 959 * lex.c (lex_raw_string): For c == '\n' don't continue after reporting 960 an prefix delimiter error. 961 9622020-07-28 Nathan Sidwell <nathan@acm.org> 963 964 * init.c (cpp_read_main_file): Always use the last map for 965 the return value. 966 9672020-07-20 Nathan Sidwell <nathan@acm.org> 968 969 * line-map.c (linemap_add): Simplify column overflow calculation. 970 Add comment about range and column bit init. 971 (linemap_ordinary_map_lookup): Refactor for RAII 972 (linemap_macro_map_lookup): Likewise. 973 9742020-07-14 Lewis Hyatt <lhyatt@gmail.com> 975 976 PR preprocessor/49973 977 PR other/86904 978 * include/cpplib.h (struct cpp_options): Removed support for -ftabstop, 979 which is now handled by diagnostic_context. 980 (class cpp_display_width_computation): New class. 981 (cpp_byte_column_to_display_column): Add optional tabstop argument. 982 (cpp_display_width): Likewise. 983 (cpp_display_column_to_byte_column): Likewise. 984 * charset.c 985 (cpp_display_width_computation::cpp_display_width_computation): New 986 function. 987 (cpp_display_width_computation::advance_display_cols): Likewise. 988 (compute_next_display_width): Removed and implemented this 989 functionality in a new function... 990 (cpp_display_width_computation::process_next_codepoint): ...here. 991 (cpp_byte_column_to_display_column): Added tabstop argument. 992 Reimplemented in terms of class cpp_display_width_computation. 993 (cpp_display_column_to_byte_column): Likewise. 994 * init.c (cpp_create_reader): Remove handling of -ftabstop, which is now 995 handled by diagnostic_context. 996 9972020-07-07 Nathan Sidwell <nathan@acm.org> 998 999 * directives.c (do_linemarker): Optimize rewinding to line zero. 1000 * files.c (_cpp_stack_file): Start on line zero when about to inject 1001 headers. 1002 (cpp_push_include, cpp_push_default_include): Use highest_line as 1003 the location. 1004 * include/cpplib.h (cpp_read_main_file): Add injecting parm. 1005 * init.c (cpp_read_main_file): Likewise, inform _cpp_stack_file. 1006 * internal.h (enum include_type): Add IT_MAIN_INJECT. 1007 10082020-05-29 H.J. Lu <hjl.tools@gmail.com> 1009 1010 PR bootstrap/95413 1011 * configure: Regenerated. 1012 10132020-05-23 David Edelsohn <dje.gcc@gmail.com> 1014 1015 * Makefile.in (AR): Substitute @AR@. 1016 * configure.ac (CHECK_PROG AR): New. 1017 * configure: Regenerate. 1018 10192020-05-20 Nathan Sidwell <nathan@acm.org> 1020 1021 * internal.h (typedef _cpp_file): Delete, unnecessary in C++. 1022 (enum _cpp_find_file_kind): New. 1023 (_cpp_find_file): Use it, not 3 bools. 1024 * files.c (_cpp_find_file): Use _cpp_find_file_kind enum, not 1025 bools. 1026 (cpp_make_system_header): Break overly long line. 1027 (_cpp_stack_include, _cpp_fake_include) 1028 (_cpp_do_file_change, _cpp_compare_file_date, _cpp_has_header): Adjust. 1029 * init.c (cpp_read_main): Adjust _cpp_find_file call. 1030 10312020-05-18 Nathan Sidwell <nathan@acm.org> 1032 1033 * include/cpplib.h (cpp_get_otions, cpp_get_callbacks) 1034 (cpp_get_deps): Mark as PURE. 1035 * include/line-map.h (get_combined_adhoc_loc) 1036 (get_location_from_adhoc_loc, get_pure_location): Reformat decls. 1037 * internal.h (struct lexer_state): Clarify comment. 1038 * system.h: Remove now-unneeded bool hackery. 1039 * files.c (_cpp_find_file): Store LOC not highest_location. 1040 1041 PR preprocessor/95149 1042 * lex.c (struct lit_accum): New. 1043 (bufring_append): Replace by lit_accum::append. 1044 (lex_raw_string): Reimplement, using fragments of the old version. 1045 (lex_string): Adjust lex_raw_string call. 1046 1047 PR preprocessor/95182 1048 * macro.c (collect_args): Preserve EOFif we fell out of the main 1049 file. 1050 (cpp_get_token_1): Reformat a couple of short lines. 1051 10522020-05-14 H.J. Lu <hongjiu.lu@intel.com> 1053 1054 * configure: Regenerated. 1055 10562020-05-13 Jason Merrill <jason@redhat.com> 1057 1058 * include/cpplib.h (enum c_lang): Change CXX2A to CXX20. 1059 * init.c, lex.c: Adjust. 1060 10612020-05-12 Nathan Sidwell <nathan@acm.org> 1062 1063 EOF location is at end of file 1064 PR preprocessor/95013 1065 * lex.c (lex_raw_string): Process line notes before incrementing. 1066 Correct incrementing condition. Adjust for new 1067 _cpp_get_fresh_line EOF behaviour. 1068 (_cpp_get_fresh_line): Do not pop buffer at EOF, increment line 1069 instead. 1070 (_cpp_lex_direct): Adjust for new _cpp_get_fresh_line behaviour. 1071 (cpp_directive_only_process): Assert we got a fresh line. 1072 * traditional.c (_cpp_read_logical_line_trad): Adjust for new 1073 _cpp_get_fresh_line behaviour. 1074 10752020-05-12 H.J. Lu <hongjiu.lu@intel.com> 1076 1077 * Makefile.in (CET_HOST_FLAGS): New. 1078 (COMPILER): Add $(CET_HOST_FLAGS). 1079 * configure.ac: Add GCC_CET_HOST_FLAGS(CET_HOST_FLAGS) and 1080 AC_SUBST(CET_HOST_FLAGS). Clear CET_HOST_FLAGS if jit isn't 1081 enabled. 1082 * aclocal.m4: Regenerated. 1083 * configure: Likewise. 1084 10852020-05-08 Nathan Sidwell <nathan@acm.org> 1086 1087 Reimplement directives only processing, support raw literals. 1088 * directives-only.c: Delete. 1089 * Makefile.in (libcpp_a_OBJS, libcpp_a_SOURCES): Remove it. 1090 * include/cpplib.h (enum CPP_DO_task): New enum. 1091 (cpp_directive_only_preprocess): Declare. 1092 * internal.h (_cpp_dir_only_callbacks): Delete. 1093 (_cpp_preprocess_dir_only): Delete. 1094 * lex.c (do_peek_backslask, do_peek_next, do_peek_prev): New. 1095 (cpp_directives_only_process): New implementation. 1096 10972020-02-14 Jakub Jelinek <jakub@redhat.com> 1098 1099 Partially implement P1042R1: __VA_OPT__ wording clarifications 1100 PR preprocessor/92319 1101 * macro.c (expand_arg): Move declarations before vaopt_state 1102 definition. 1103 (class vaopt_state): Move enum update_type definition earlier. Remove 1104 m_allowed member, add m_arg and m_update members. 1105 (vaopt_state::vaopt_state): Change last argument from bool any_args 1106 to macro_arg *arg, initialize m_arg and m_update instead of m_allowed. 1107 (vaopt_state::update): When bumping m_state from 1 to 2 and m_update 1108 is ERROR, determine if __VA_ARGS__ expansion has any non-CPP_PADDING 1109 tokens and set m_update to INCLUDE if it has any, DROP otherwise. 1110 Return m_update instead of m_allowed ? INCLUDE : DROP in m_state >= 2. 1111 (replace_args, create_iso_definition): Adjust last argument to 1112 vaopt_state ctor. 1113 11142020-02-05 Martin Sebor <msebor@redhat.com> 1115 1116 * include/cpplib.h (cpp_builtin_type): Remove trailing comma to 1117 avoid pedantic warnings in C++ 98 mode. 1118 11192020-02-04 Jakub Jelinek <jakub@redhat.com> 1120 1121 * macro.c (builtin_has_include): Diagnose __has_include* use outside 1122 of preprocessing directives. 1123 1124 PR preprocessor/93545 1125 * macro.c (cpp_get_token_no_padding): New function. 1126 (builtin_has_include): Use it instead of cpp_get_token. Don't check 1127 SEEN_EOL. 1128 11292020-02-01 Andrew Burgess <andrew.burgess@embecosm.com> 1130 1131 * configure: Regenerate. 1132 11332020-01-28 Nathan Sidwell <nathan@acm.org> 1134 1135 PR preprocessor/93452 1136 * internal.h (struct spec_nodes): Drop n__has_include{,_next}. 1137 * directives.c (lex_macro_node): Don't check __has_include redef. 1138 * expr.c (eval_token): Drop __has_include eval. 1139 (parse_has_include): Move to ... 1140 * macro.c (builtin_has_include): ... here. 1141 (_cpp_builtin_macro_text): Eval __has_include{,_next}. 1142 * include/cpplib.h (enum cpp_builtin_type): Add BT_HAS_INCLUDE{,_NEXT}. 1143 * init.c (builtin_array): Add them. 1144 (cpp_init_builtins): Drop __has_include{,_next} init here ... 1145 * pch.c (cpp_read_state): ... and here. 1146 * traditional.c (enum ls): Drop has_include states ... 1147 (_cpp_scan_out_logical_line): ... and here. 1148 11492020-01-27 Andrew Burgess <andrew.burgess@embecosm.com> 1150 1151 * configure: Regenerate. 1152 11532020-01-24 Nathan Sidwell <nathan@acm.org> 1154 1155 * expr.c (parse_has_include): Remove bogus controlling macro code. 1156 11572020-01-20 Nathan Sidwell <nathan@acm.org> 1158 1159 PR preprocessor/80005 1160 * include/cpplib.h (BT_HAS_ATTRIBUTE): Fix comment. 1161 * internal.h (struct lexer_state): Delete in__has_include field. 1162 (struct spec_nodes): Rename n__has_include{,_next}__ fields. 1163 (_cpp_defined_macro_p): New. 1164 (_cpp_find_file): Add has_include parm. 1165 * directives.c (lex_macro_node): Combine defined, 1166 __has_inline{,_next} checking. 1167 (do_ifdef, do_ifndef): Use _cpp_defined_macro_p. 1168 (_cpp_init_directives): Refactor. 1169 * expr.c (parse_defined): Use _cpp_defined_macro_p. 1170 (eval_token): Adjust parse_has_include calls. 1171 (parse_has_include): Add OP parameter. Reimplement. 1172 * files.c (_cpp_find_file): Add HAS_INCLUDE parm. Use it to 1173 inhibit error message. 1174 (_cpp_stack_include): Adjust _cpp_find_file call. 1175 (_cpp_fake_include, _cpp_compare_file_date): Likewise. 1176 (open_file_failed): Remove in__has_include check. 1177 (_cpp_has_header): Adjust _cpp_find_file call. 1178 * identifiers.c (_cpp_init_hashtable): Don't init 1179 __has_include{,_next} here ... 1180 * init.c (cpp_init_builtins): ... init them here. Define as 1181 macros. 1182 (cpp_read_main_file): Adjust _cpp_find_file call. 1183 * pch.c (cpp_read_state): Adjust __has_include{,_next} access. 1184 * traditional.c (_cpp_scan_out_locgical_line): Likewise. 1185 1186 PR preprocessor/93306 1187 * expr.c (parse_has_include): Refactor. Check skip_eval before 1188 looking. 1189 11902020-01-10 David Malcolm <dmalcolm@redhat.com> 1191 1192 * include/line-map.h (class diagnostic_path): New forward decl. 1193 (rich_location::get_path): New accessor. 1194 (rich_location::set_path): New function. 1195 (rich_location::m_path): New field. 1196 * line-map.c (rich_location::rich_location): Initialize m_path. 1197 11982020-01-01 Jakub Jelinek <jakub@redhat.com> 1199 1200 Update copyright years. 1201 12022019-12-18 David Malcolm <dmalcolm@redhat.com> 1203 1204 PR preprocessor/92982 1205 * charset.c 1206 (cpp_string_location_reader::cpp_string_location_reader): Delete 1207 initialization of m_line_table. 1208 * include/cpplib.h (cpp_string_location_reader::m_line_table): 1209 Delete unused member. 1210 12112019-12-14 Jakub Jelinek <jakub@redhat.com> 1212 1213 PR preprocessor/92919 1214 * charset.c (wide_str_to_charconst): If str contains just the 1215 NUL terminator, punt quietly. 1216 12172019-12-09 David Malcolm <dmalcolm@redhat.com> 1218 1219 * include/line-map.h (label_text::label_text): Make private. 1220 (label_text::borrow): New. 1221 (label_text::take): New. 1222 (label_text::take_or_copy): New. 1223 12242019-12-09 Lewis Hyatt <lhyatt@gmail.com> 1225 1226 PR preprocessor/49973 1227 * generated_cpp_wcwidth.h: New file generated by 1228 ../contrib/unicode/gen_wcwidth.py, supports new cpp_wcwidth function. 1229 * charset.c (compute_next_display_width): New function to help 1230 implement display columns. 1231 (cpp_byte_column_to_display_column): Likewise. 1232 (cpp_display_column_to_byte_column): Likewise. 1233 (cpp_wcwidth): Likewise. 1234 * include/cpplib.h (cpp_byte_column_to_display_column): Declare. 1235 (cpp_display_column_to_byte_column): Declare. 1236 (cpp_wcwidth): Declare. 1237 (cpp_display_width): New function. 1238 12392019-11-14 Joseph Myers <joseph@codesourcery.com> 1240 1241 * charset.c (narrow_str_to_charconst): Make CPP_UTF8CHAR constants 1242 unsigned for C. 1243 * init.c (lang_defaults): Set utf8_char_literals for GNUC2X and 1244 STDC2X. 1245 12462019-11-07 Jakub Jelinek <jakub@redhat.com> 1247 1248 PR c++/91370 - Implement P1041R4 and P1139R2 - Stronger Unicode reqs 1249 * charset.c (narrow_str_to_charconst): Add TYPE argument. For 1250 CPP_UTF8CHAR diagnose whenever number of chars is > 1, using 1251 CPP_DL_ERROR instead of CPP_DL_WARNING. 1252 (wide_str_to_charconst): For CPP_CHAR16 or CPP_CHAR32, use 1253 CPP_DL_ERROR instead of CPP_DL_WARNING when multiple char16_t 1254 or char32_t chars are needed. 1255 (cpp_interpret_charconst): Adjust narrow_str_to_charconst caller. 1256 12572019-11-05 Tim van Deurzen <tim@kompiler.org> 1258 1259 * cpplib.h: Add spaceship operator for C++. 1260 * lex.c: Implement conditional lexing of spaceship operator for C++20. 1261 12622019-10-31 Jakub Jelinek <jakub@redhat.com> 1263 1264 PR preprocessor/92296 1265 * internal.h (struct def_pragma_macro): Add is_builtin bitfield. 1266 (_cpp_restore_special_builtin): Declare. 1267 * init.c (_cpp_restore_special_builtin): New function. 1268 * directives.c (do_pragma_push_macro): For NT_BUILTIN_MACRO 1269 set is_builtin and don't try to grab definition. 1270 (cpp_pop_definition): Use _cpp_restore_special_builtin to restore 1271 builtin macros. 1272 12732019-10-15 Nathan Sidwell <nathan@acm.org> 1274 1275 * include/line-map.h (struct maps_info_ordinary): Make cache 1276 mutable. 1277 (struct maps_info_macro): Likewise. 1278 (LINEMAPS_CACHE): Remove non-ref accessor. Constify ref accessor. 1279 (LINEMAPS_ORDINARY_CACHE, LINEMAPS_MACRO_CACHE): Likewise. 1280 (LINEMAPS_ORDINARY_MAP_AT, LINEMAPS_MACRO_MAP_AT): Use 1281 LINEMAPS_USED and LINEMAPS_MAP_AT. 1282 (linemap_lookup): Constify line_map arg. 1283 linemap.c (linemap_ordinary_map_lookup, linemap_macro_map_lookup): 1284 Constify line_map arg. 1285 12862019-10-11 Joseph Myers <joseph@codesourcery.com> 1287 1288 * include/cpplib.h (struct cpp_options): Add dfp_constants and 1289 cpp_warn_c11_c2x_compat. 1290 (enum cpp_warning_reason): Add CPP_W_C11_C2X_COMPAT. 1291 * init.c (struct lang_flags): Add dfp_constants. 1292 (lang_defaults): Set dfp_constants to 1 for GNUC2X and STDC2X and 1293 0 for other languages. 1294 (cpp_set_lang): Set dfp_constants from language. 1295 (cpp_create_reader): Set cpp_warn_c11_c2x_compat to -1. 1296 * expr.c (interpret_float_suffix): Mention DFP constants as C2X in 1297 comment. 1298 (cpp_classify_number): Do not diagnose DFP constants for languages 1299 setting dfp_constants, unless cpp_warn_c11_c2x_compat. 1300 13012019-10-04 Nathan Sidwell <nathan@acm.org> 1302 1303 PR preprocessor/91991 1304 * line-map.c (linemap_line_start): Clear max_column_hint if we run 1305 out of locations. 1306 13072019-10-02 Richard Biener <rguenther@suse.de> 1308 1309 * internal.h (enum include_type): Remove trailing comma. 1310 13112019-10-02 Joseph Myers <joseph@codesourcery.com> 1312 1313 * include/cpplib.h (struct cpp_options): Add member scope. 1314 * init.c (struct lang_flags, lang_defaults): Likewise. 1315 (cpp_set_lang): Set scope member of pfile. 1316 * lex.c (_cpp_lex_direct): Test CPP_OPTION (pfile, scope) not 1317 CPP_OPTION (pfile, cplusplus) for creating CPP_SCOPE tokens. 1318 13192019-09-26 Eric Botcazou <ebotcazou@adacore.com> 1320 1321 * charset.c (UCS_LIMIT): New macro. 1322 (ucn_valid_in_identifier): Use it instead of a hardcoded constant. 1323 (_cpp_valid_ucn): Issue a pedantic warning for UCNs larger than 1324 UCS_LIMIT outside of identifiers in C and in C++2a or later. 1325 13262019-09-19 Lewis Hyatt <lhyatt@gmail.com> 1327 1328 PR c/67224 1329 * charset.c (_cpp_valid_utf8): New function to help lex UTF-8 tokens. 1330 * internal.h (_cpp_valid_utf8): Declare. 1331 * lex.c (forms_identifier_p): Use it to recognize UTF-8 identifiers. 1332 (_cpp_lex_direct): Handle UTF-8 in identifiers and CPP_OTHER tokens. 1333 Do all work in "default" case to avoid slowing down typical code paths. 1334 Also handle $ and UCN in the default case for consistency. 1335 13362019-08-30 Nathan Sidwell <nathan@acm.org> 1337 1338 New # semantics for popping to "" name. 1339 libcpp/ 1340 * directives.c (do_linemarker): Popping to "" name means get the 1341 name from the include stack.. 1342 13432019-09-05 Nathan Sidwell <nathan@acm.org> 1344 1345 PR preprocessor/91639 1346 * directives.c (do_include_common): Tell lexer we're a #include. 1347 * files.c (_cpp_stack_file): Lexer will have always incremented. 1348 * internal.h (struct cpp_context): Extend in_directive's 1349 semantics. 1350 * lex.c (_cpp_lex_direct): Increment line for final \n when lexing 1351 for an ISO #include. 1352 * line-map.c (linemap_line_start): Remember if we overflowed. 1353 13542019-09-03 Ulrich Weigand <uweigand@de.ibm.com> 1355 1356 * directives.c: Remove references to spu from comments. 1357 * expr.c: Likewise. 1358 13592019-08-29 Nathan Sidwell <nathan@acm.org> 1360 1361 * internal.h (enum include_type): Add IT_MAIN, IT_DIRECTIVE_HWM, 1362 IT_HEADER_HWM. 1363 (_cpp_stack_file): Take include_type, not a bool. 1364 * files.c (_cpp_find_file): Refactor to not hide an if inside a 1365 for conditional. 1366 (should_stack_file): Break apart to ... 1367 (is_known_idempotent_file, has_unique_contents): ... these. 1368 (_cpp_stack_file): Replace IMPORT boolean with include_type enum. 1369 Refactor to use new predicates. Do linemap compensation here ... 1370 (_cpp_stack_include): ... not here. 1371 * init.c (cpp_read_main_file): Pass IT_MAIN to _cpp_stack_file. 1372 13732019-08-28 Nathan Sidwell <nathan@acm.org> 1374 1375 * directives-only.c (_cpp_preprocess_dir_only): Use false, not 1376 zero for _cpp_handle_directive call. 1377 * directives.c (_cpp_handle_directive): Indented is bool. 1378 * files.c (struct _cpp_file): Make bools 1 bit bitfields. 1379 * internal.h (enum include_type): Reformat and comment. 1380 (struct cpp_buffer): Make flags 1 bit bitfields. 1381 (_cpp_handle_directive): Indented is bool. 1382 13832019-07-09 Martin Sebor <msebor@redhat.com> 1384 1385 * include/line-map.h: Change class-key from class to struct and vice 1386 versa to match convention and avoid -Wclass-is-pod and -Wstruct-no-pod. 1387 * mkdeps.c: Same. 1388 13892019-07-03 Martin Liska <mliska@suse.cz> 1390 1391 * line-map.c (linemap_get_expansion_filename): Remove 1392 dead assignemts. 1393 * mkdeps.c (make_write): Likewise. 1394 13952019-07-02 qing zhao <qing.zhao@oracle.com> 1396 1397 PR preprocessor/90581 1398 * directives.c (do_include_common): Replace CPP_STACK_MAX with 1399 CPP_OPTION (pfile, max_include_depth). 1400 * include/cpplib.h (struct cpp_options): Add new field 1401 max_include_depth. 1402 * init.c (cpp_create_reader): Initiate new field max_include_depth. 1403 * internal.h: Delete CPP_STACK_MAX. 1404 14052019-06-26 Nathan Sidwell <nathan@acm.org> 1406 1407 PR preprocessor/90927 1408 * mkdeps.c (mkdeps::vec::operator[]): Add non-const variant. 1409 (deps_add_target): Deal with out of order unquoted targets. 1410 14112019-05-19 Andrew Pinski <apinski@marvell.com> 1412 1413 PR pch/81721 1414 * lex.c (cpp_token_val_index <case SPELL_OPERATOR>): If tok->flags 1415 has NAMED_OP set, then return CPP_TOKEN_FLD_NODE. 1416 14172019-05-14 Martin Liska <mliska@suse.cz> 1418 1419 PR preprocessor/90382 1420 * line-map.c (first_map_in_common_1): Handle ADHOC 1421 locations. 1422 14232019-05-14 Martin Liska <mliska@suse.cz> 1424 1425 PR preprocessor/90382 1426 * include/line-map.h (get_data_from_adhoc_loc): Add const to 1427 the first argument. 1428 (get_location_from_adhoc_loc): Likewise. 1429 * line-map.c(get_data_from_adhoc_loc): Add const to 1430 the first argument. 1431 (get_location_from_adhoc_loc): Likewise. 1432 (get_combined_adhoc_loc): Use get_location_from_adhoc_loc 1433 (or get_data_from_adhoc_loc). 1434 (get_range_from_adhoc_loc): Likewise. 1435 (get_pure_location): Likewise. 1436 (linemap_position_for_loc_and_offset): Likewise. 1437 (linemap_lookup): Likewise. 1438 (linemap_ordinary_map_lookup): Likewise. 1439 (linemap_macro_map_lookup): Likewise. 1440 (linemap_get_expansion_line): Likewise. 1441 (linemap_get_expansion_filename): Likewise. 1442 (linemap_location_in_system_header_p): Likewise. 1443 (linemap_location_from_macro_expansion_p): Likewise. 1444 (linemap_macro_loc_to_exp_point): Likewise. 1445 (linemap_resolve_location): Likewise. 1446 (linemap_unwind_toward_expansion): Likewise. 1447 (linemap_unwind_to_first_non_reserved_loc): Likewise. 1448 (linemap_expand_location): Likewise. 1449 (linemap_dump_location): Likewise. 1450 14512019-05-07 Nathan Sidwell <nathan@acm.org> 1452 1453 * files.c (_cpp_stack_file): Empty filenames aren't dependencies. 1454 * mkdeps.c (deps_add_dep): Assert not empty. 1455 1456 * include/mkdeps.h (deps_write): Add PHONY arg. 1457 (deps_phony_targets): Delete. 1458 * init.c (cpp_finish): Just call deps_write. 1459 * mkdeps.c (struct mkdeps): Add local vector class. Reimplement 1460 vector handling. 1461 (munge): Munge to static buffer. 1462 (apply_vpath): Adjust vector handling. 1463 (deps_init, deps_free): Use new, delete. 1464 (deps_add_target): Do not munge here. Record quoting low water mark. 1465 (deps_add_dep): Do not munge here. 1466 (deps_add_vpath): Adjust vector handling. 1467 (make_write_name): New. Munge on demand here. 1468 (make_write_vec): New. 1469 (deps_phony_targets): Delete. 1470 (make_write): New. 1471 (deps_write): Forward to deps_Write. 1472 (deps_save, deps_restore): Adjust vector handling. 1473 14742019-05-06 Nathan Sidwell <nathan@acm.org> 1475 1476 * include/mkdeps.h: Rename struct deps to struct mkdeps. 1477 * mkdeps.c: Likewise. 1478 * include/cpplib.h (cpp_get_deps): Rename return type.. 1479 * directives.c (cpp_get_deps): Likewise. 1480 * internal.h (struct cpp_reader): Rename deps field type. 1481 14822019-04-03 Jonathan Wakely <jwakely@redhat.com> 1483 1484 * files.c (search_path_exhausted): Fix typo in comment. 1485 14862019-02-26 Martin Liska <mliska@suse.cz> 1487 1488 * symtab.c (ht_dump_statistics): Make 1489 horizontal alignment for statistics. 1490 14912019-02-20 David Malcolm <dmalcolm@redhat.com> 1492 1493 PR c/89410 1494 * include/line-map.h (linenum_arith_t): New typedef. 1495 (compare): Use it. 1496 14972019-02-18 Martin Liska <mliska@suse.cz> 1498 1499 PR c++/89383 1500 * line-map.c (linemap_line_start): Use 1UL in order 1501 to not overflow. 1502 15032019-02-11 Martin Liska <mliska@suse.cz> 1504 1505 PR lto/88147 1506 * line-map.c (linemap_line_start): Don't reuse the existing line 1507 map if the line offset is sufficiently large to cause overflow 1508 when computing location_t values. 1509 15102019-01-26 Jakub Jelinek <jakub@redhat.com> 1511 1512 PR preprocessor/88974 1513 * directives.c (SEEN_EOL): Move macro to ... 1514 * internal.h (SEEN_EOL): ... here. 1515 * expr.c (parse_has_include): Don't cpp_get_token if SEEN_EOL (). 1516 15172019-01-01 Jakub Jelinek <jakub@redhat.com> 1518 1519 Update copyright years. 1520 15212018-11-27 Mike Gulick <mgulick@mathworks.com> 1522 1523 PR preprocessor/83173 1524 * location-example.txt: Update example -fdump-internal-locations 1525 output. 1526 15272018-11-27 Mike Gulick <mgulick@mathworks.com> 1528 1529 PR preprocessor/83173 1530 * files.c (_cpp_stack_include): Check if 1531 line_table->highest_location is past current line before 1532 decrementing. 1533 15342018-11-13 David Malcolm <dmalcolm@redhat.com> 1535 1536 * charset.c: Replace "source_location" with "location_t". 1537 * directives-only.c: Likewise. 1538 * directives.c: Likewise. 1539 * errors.c: Likewise. 1540 * expr.c: Likewise. 1541 * files.c: Likewise. 1542 * include/cpplib.h: Likewise. Rename MAX_SOURCE_LOCATION to 1543 MAX_LOCATION_T. 1544 * include/line-map.h: Likewise. 1545 * init.c: Likewise. 1546 * internal.h: Likewise. 1547 * lex.c: Likewise. 1548 * line-map.c: Likewise. 1549 * location-example.txt: Likewise. 1550 * macro.c: Likewise. 1551 * pch.c: Likewise. 1552 * traditional.c: Likewise. 1553 15542018-11-07 Hafiz Abid Qadeer <abidh@codesourcery.com> 1555 1556 * configure: Regenerated. 1557 15582018-11-05 Martin Liska <mliska@suse.cz> 1559 1560 * symtab.c (ht_dump_statistics): Replace %zu with %lu format. 1561 15622018-11-05 Martin Liska <mliska@suse.cz> 1563 1564 * symtab.c (ht_dump_statistics): Fix format and 1565 pass missing argument. 1566 15672018-11-05 Martin Liska <mliska@suse.cz> 1568 1569 * symtab.c (ht_dump_statistics): Make dump conditional 1570 based on alloc_subobject. 1571 15722018-10-31 Joseph Myers <joseph@codesourcery.com> 1573 1574 PR bootstrap/82856 1575 * configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE. 1576 * aclocal.m4, config.in, configure: Regenerate. 1577 15782018-10-31 Nathan Sidwell <nathan@acm.org> 1579 1580 * internal.h (struct cpp_reader): Rename forced_token_location_p 1581 to forced_token_location and drop its pointerness. 1582 * include/cpplib.h (cpp_force_token_locations): Take location, not 1583 pointer to one. 1584 * init.c (cpp_create_reader): Adjust. 1585 * lex.c (cpp_read_main_file): 1586 1587 * directives.c (do_include_common): Commonize cleanup path. 1588 (_cpp_pop_buffer): Fix leak. 1589 1590 * include/line-map.h (IS_ORDINARY_LOC, IS_MACRO_LOC): New 1591 predicates. 1592 (IS_ADHOC_LOC): Move earlier. 1593 (MAP_ORDINARY_P): Use IS_ORDINARY_LOC. 1594 * line-map.c (linemap_location_from_macro_expansion_p): Use 1595 IS_MACRO_LOC. 1596 1597 * include/cpplib.h (cpp_macro_definition_location): Make inline. 1598 * macro.c (warn_of_redefinition): Fix comments, examine macro 1599 type, use C++ for. 1600 (cpp_macro_definition_location): Don't define here. 1601 1602 * include/cpplib.h (HT_NODE): Don't cast NODE. 1603 (NODE_LEN, NODE_NAME): Use HT_NODE. 1604 1605 * directives.c (DIRECTIVE_TABLE): Drop historical frequency 1606 comments. 1607 * files.c (_cpp_stack_file): Fix indentation. 1608 16092018-10-17 Joseph Myers <joseph@codesourcery.com> 1610 1611 * include/cpplib.h (enum c_lang): Add CLK_GNUC2X and CLK_STDC2X. 1612 * init.c (lang_defaults): Add GNUC2X and STDC2X entries. 1613 (cpp_init_builtins): Define __STDC_VERSION__ to 202000L for C2X. 1614 16152018-10-11 David Malcolm <dmalcolm@redhat.com> 1616 1617 * macro.c (_cpp_arguments_ok): If the argument count is wrong, add 1618 a note showing the definition of the macro. 1619 16202018-10-11 Nathan Sidwell <nathan@acm.org> 1621 1622 * include/line-map.h (LINEMAPS_MACRO_LOWEST_LOCATION): Fix 1623 off-by-one error. 1624 * line-map.c (linemap_enter_macro): Use RAII. Clear all of the 1625 macro_locations. 1626 16272018-10-09 David Malcolm <dmalcolm@redhat.com> 1628 1629 * charset.c (noop_error_cb): Rename to... 1630 (noop_diagnostic_cb): ...this, converting params to enums. 1631 (cpp_interpret_string_ranges): Update for renaming and enums. 1632 * directives.c (check_eol_1): Convert reason to enum. 1633 (do_diagnostic): Convert code and reason to enum. 1634 (do_error): Use CPP_W_NONE rather than 0. 1635 (do_pragma_dependency): Likewise. 1636 * errors.c (cpp_diagnostic_at): Convert level and reason to enums. 1637 Update for renaming. 1638 (cpp_diagnostic): Convert level and reason to enums. 1639 (cpp_error): Convert level to enum. 1640 (cpp_warning): Convert reason to enums. 1641 (cpp_pedwarning): Likewise. 1642 (cpp_warning_syshdr): Likewise. 1643 (cpp_diagnostic_with_line): Convert level and reason to enums. 1644 Update for renaming. 1645 (cpp_error_with_line): Convert level to enum. 1646 (cpp_warning_with_line): Convert reason to enums. 1647 (cpp_pedwarning_with_line): Likewise. 1648 (cpp_warning_with_line_syshdr): Likewise. 1649 (cpp_error_at): Convert level to enum. 1650 (cpp_errno): Likewise. 1651 (cpp_errno_filename): Likewise. 1652 * include/cpplib.h (enum cpp_diagnostic_level): Name this enum, 1653 and move to before struct cpp_callbacks. 1654 (enum cpp_warning_reason): Likewise. 1655 (cpp_callbacks::diagnostic): Convert params from int to enums. 1656 (cpp_error): Convert int param to enum cpp_diagnostic_level. 1657 (cpp_warning): Convert int param to enum cpp_warning_reason. 1658 (cpp_pedwarning): Likewise. 1659 (cpp_warning_syshdr): Likewise. 1660 (cpp_errno): Convert int param to enum cpp_diagnostic_level. 1661 (cpp_errno_filename): Likewise. 1662 (cpp_error_with_line): Likewise. 1663 (cpp_warning_with_line): Convert int param to enum 1664 cpp_warning_reason. 1665 (cpp_pedwarning_with_line): Likewise. 1666 (cpp_warning_with_line_syshdr): Likewise. 1667 (cpp_error_at): Convert int param to enum cpp_diagnostic_level. 1668 * macro.c (create_iso_definition): Convert int to enum. 1669 (_cpp_create_definition): Likewise. 1670 16712018-09-17 David Malcolm <dmalcolm@redhat.com> 1672 1673 * include/line-map.h (range_label::get_text): Add param 1674 "range_idx". 1675 16762018-08-30 Nathan Sidwell <nathan@acm.org> 1677 1678 * include/line-map.h (enum lc_reason): Comment each member 1679 separately. 1680 (struct line_maps): Fix reallocator comment. 1681 16822018-08-27 David Malcolm <dmalcolm@redhat.com> 1683 1684 PR 87091 1685 * include/line-map.h (enum range_display_kind): New enum. 1686 (struct location_range): Replace field "m_show_caret_p" with 1687 "m_range_display_kind", converting from bool to the new enum. 1688 (class rich_location): Add example of line insertion fix-it hint. 1689 (rich_location::add_range): Convert param "show_caret_p" from bool 1690 to enum range_display_kind and rename to "range_display_kind", 1691 giving it a default of SHOW_RANGE_WITHOUT_CARET. 1692 (rich_location::set_range): Likewise, albeit without a default. 1693 * line-map.c (rich_location::rich_location): Update for conversion 1694 of show_caret_p to tri-state enum. 1695 (rich_location::add_range): Likewise. 1696 (rich_location::set_range): Likewise. 1697 16982018-08-24 H.J. Lu <hongjiu.lu@intel.com> 1699 1700 PR bootstrap/86872 1701 * line-map.c (pure_location_p): Return true if linemap_lookup 1702 returns NULL. 1703 (linemap_add): Set start_location to 0 if we run out of line map 1704 space. 1705 17062018-08-20 Nathan Sidwell <nathan@acm.org> 1707 1708 * include/cpplib.h: Fixup some whitespace. 1709 (cpp_hashnode): Reduce type to 2 bit & flags to 8. 1710 1711 * include/cpplib.h (NODE_BUILTIN, NODE_MACRO_ARG): Delete. 1712 Renumber others. 1713 (enum node_type): Replace NT_MACRO with NT_USER_MACRO, 1714 NT_BUILTIN_MACRO, NT_MACRO_ARG. Delete NT_ASSERTION. 1715 (NTV_MACRO, NTV_ANSWER, NTV_BUILTIN, NTV_ARGUMENT, NTV_NONE): 1716 Delete. 1717 (CPP_HASHNODE_VALUE_IDX): Delete. 1718 (union _cpp_hashnode_value): GTY tag from enum node_type directly. 1719 (struct cpp_hashnode): Adjust GTY desc for value field. 1720 (cpp_user_macro_p, cpp_builtin_macro_p, cpp_macro_p): Adjust. 1721 * directives.c (undefine_macros): Clear value.anwers, adjust flag 1722 clearing. 1723 (_cpp_test_assertion): No need to check NT_ASSERTION. 1724 (do_assert, do_unassert): Likewise. 1725 * init.c (cpp_init_special_builtins): Set type not flags. 1726 * macro.c (struct macro_arg_saved_data): Add type field. 1727 (cpp_get_token_1): Check type not NT_VOID. 1728 (_cpp_free_definition): Adjust flag clearing. Nullify 1729 value.answers. 1730 (_cpp_save_parameter, _cpp_unsave_parameters): Save and restore 1731 type. 1732 (lex_expansion_token): Check type not flags. 1733 (_cpp_create_definition): Set type to NT_USER_MACRO. 1734 (_cpp_notify_macro_use): Adjust type checking. 1735 * pch.c (write_macdef, count_defs, write_defs, cpp_valid_state) 1736 (save_macros): Adjust node type/flag handling. 1737 * traditional.c (_cpp_scan_out_logical_line): Check type not flags. 1738 1739 * directives.c (do_undef): Use cpp_macro_p & cpp_builtin_macro_p. 1740 * include/cpplib.h (enum cpp_macro_kind): Remove trailing comma. 1741 (cpp_fun_like_macro_p): Make inline, define. 1742 * macro.c (cpp_define_lazily): Use UCHAR_MAX. 1743 (cpp_fun_like_macro_p): Delete. 1744 1745 * Makefile.in (TAGS_SOURCES): Remove cpp-id-data.h. 1746 * include/cpp-id-data.h: Delete. 1747 * internal.h: Include cpplib.h not cpp-id-data.h. 1748 1749 * include/cpp-id-data.h (struct answer): Delete. 1750 * include/cpplib.h (struct answer): Don't forward-declare. 1751 (enum cpp_macro_kind): Add cmk_assert. 1752 (struct cpp_macro): Union parms and next assert chain. 1753 (union _cpp_hashnode_value): 'answer' field is cpp_macro. 1754 * directives.c (parse_answer): Convert to use cpp_macro. Return 1755 true on success. 1756 (parse_assertion, find_answer, _cpp_test_assertion, cpp_do_assert) 1757 (cpp_do_unassert): Convert to use cpp_macro. 1758 * macro.c (warn_of_redefinition, _cpp_new_macro) 1759 (check_trad_stringification, cpp_macro_definition): Adjust macro 1760 parm access. 1761 * traditional.c (_cpp_replacement_text_len) 1762 (_cpp_copy_replacement_text, _cpp_create_trad_definition): Likewise. 1763 17642018-08-17 Nathan Sidwell <nathan@acm.org> 1765 1766 * include/cpplib.h (struct cpp_callbacks): Replace 1767 user_builtin_macro with user_lazy_macro. 1768 (struct cpp_macro): add lazy field. 1769 (enum cpp_builtin_type): Remove BT_FIRST_USER, BT_LAST_USER. 1770 (cpp_define_lazily): Declare. 1771 * macro.c (enter_macro_context) Use _cpp_maybe_notify_macro_use. 1772 (warn_of_redefinition): Use cpp_builtin_macro_p, directly call 1773 user_lazy_macro hook. 1774 (_cpp_new_macro): Clear lazy field. 1775 (cpp_define_lazily): Define. 1776 (_cpp_notify_macro_use): Adjust lazy definition code. 1777 (cpp_macro_definition): No need to do lazy definition here. 1778 * pch.c (write_macdef, save_macros): Likewise. 1779 1780 * include/cpplib.h (enum cpp_macro_kind): New. 1781 (struct cpp_macro): Make body trailing array. Add kind field, 1782 delete traditional flag. 1783 * internal.h (_cpp_new_macro): Declare. 1784 (_cpp_reserve_room): New inline. 1785 (_cpp_commit_buf): Declare. 1786 (_cpp_create_trad_definition): Return new macro. 1787 * lex.c (_cpp_commit_buff): New. 1788 * macro.c (macro_real_token_count): Count backwards. 1789 (replace_args): Pointer equality not orderedness. 1790 (_cpp_save_parameter): Use _cpp_reserve_room. 1791 (alloc_expansion_token): Delete. 1792 (lex_expansion_token): Return macro pointer. Use _cpp_reserve_room. 1793 (create_iso_definition): Allocate macro itself. Adjust for 1794 different allocation ordering. 1795 (_cpp_new_macro): New. 1796 (_cpp_create_definition): Adjust for API changes. 1797 * traditional.c (push_replacement_text): Don't set traditional 1798 flag. 1799 (save_replacement_text): Likewise. 1800 (_cpp_create_trad_definition): Allocate macro itself, Adjust for 1801 different allocation ordering. 1802 1803 * cpp-id-data.h (uchar, UC): Move to internal.h 1804 (struct cpp_macro): Move to cpplib.h. 1805 * internal.h (uchar, UC): From cpp-id-data.h. 1806 * include/cpplib.h (struct cpp_macro): From cpp-id-data.h. 1807 18082018-08-16 Nathan Sidwell <nathan@acm.org> 1809 1810 * internal.h (_cpp_save_parameter): Take parmno, not macro. 1811 (_cpp_unsave_parameters): Declare. 1812 * macro.c (_cpp_save_parameter): Take parm number, not macro. 1813 Return true on success. 1814 (_cpp_unsave_parameters): New. 1815 (parse_params): Take parm_no and variadic pointers, not macro. 1816 Reimplement parsing logic. 1817 (create_iso_definition): Adjust parse_params changes. Call 1818 _cpp_unsave_parameters here. 1819 (_cpp_create_definition): Don't unsave params here. 1820 * traditional.c (scan_parameters): Take n_param pointer, adjust. 1821 (_cpp_create_trad_definition): Ajust scan_parameters change. Call 1822 _cpp_unsave_parameters. 1823 1824 * include/cpplib.h (cpp_user_macro_p, cpp_builtin_macro_p) 1825 (cpp_macro_p): New inlines. 1826 * directives.c (do_pragma_poison): Use cpp_macro_p. 1827 (do_ifdef, do_ifndef): Likewise. Use _cpp_maybe_notify_macro_use. 1828 (cpp_pop_definition): Use cpp_macro_p. Move _cpp_free_definition 1829 earlier. Don't zap node directly. 1830 * expr.c (parse_defined): Use _cpp_maybe_notify_macro_use & 1831 cpp_macro_p. 1832 * files.c (should_stack_file): Use cpp_macro_p. 1833 * identifiers.c (cpp_defined): Likewise. 1834 * internal.h (_cpp_mark_macro): Use cpp_user_macro_p. 1835 (_cpp_notify_macro_use): Declare. 1836 (_cpp_maybe_notify_macro_use): New inline. 1837 * lex.c (is_macro): Use cpp_macro_p. 1838 * macro.c (_cpp_warn_if_unused_macro): Use cpp_user_macro_p. 1839 (enter_macro_context): Likewise. 1840 (_cpp_create_definition): Use cpp_builtin_macro_p, 1841 cpp_user_macro_p. Move _cpp_free_definition earlier. 1842 (_cpp_notify_macro_use): New, broken out of multiple call sites. 1843 * traditional.c (fun_like_macro_p): Use cpp_builtin_macro_p. 1844 (maybe_start_funlike, _cpp_scan_out_logical_line) 1845 (push_replacement_text): Likewise. 1846 18472018-08-15 David Malcolm <dmalcolm@redhat.com> 1848 1849 * include/line-map.h (struct location_range): Add "m_label" field. 1850 (class rich_location): Add description of labels to leading 1851 comment. 1852 (rich_location::rich_location): Add "label" param, defaulting to 1853 NULL. 1854 (rich_location::add_range): Likewise. 1855 (struct label_text): New struct. 1856 (class range_label): New abstract base class. 1857 * line-map.c (rich_location::rich_location): Add "label" param; 1858 use it. 1859 (rich_location::add_range): Likewise. 1860 18612018-08-08 Nathan Sidwell <nathan@acm.org> 1862 1863 Make linemap::included_from a location 1864 libcpp/ 1865 * include/line-map.h (struct line_map_ordinary): Replace 1866 included_from map index with included_at source_location. 1867 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Delete. 1868 (LAST_SOURCE_LINE_LOCATION): Delete. 1869 (LAST_SOURCE_LINE, LAST_SOURCE_COLUMN): Delete. 1870 (linemap_included_from): New. 1871 (linemap_included_from_linemap): Declare. 1872 (MAIN_FILE_P): Adjust. 1873 * line-map.c (linemap_included_from_linemap): New. 1874 (lonemap_check_files_exited): Use linemap_included_at. 1875 (linemap_add): Adjust inclusion setting. 1876 (linemap_dump, linemap_dump_location): Adjust. 1877 * directives.c (do_linemarker): Use linemap_included_at. 1878 18792018-08-07 Nathan Sidwell <nathan@acm.org> 1880 1881 * line-map.c: (linemap_init): Set default allocator here. 1882 (new_linemap): Rather than here. Refactor allocation logic. 1883 18842018-07-20 David Malcolm <dmalcolm@redhat.com> 1885 1886 * include/line-map.h (rich_location::set_range): Remove redundant 1887 line_maps * parameter. 1888 * line-map.c (rich_location::set_range): Likewise. 1889 18902018-07-18 Bernd Edlinger <bernd.edlinger@hotmail.de> 1891 1892 PR 69558 1893 * macro.c (enter_macro_context): Change the location info for builtin 1894 macros and _Pragma from location of the closing parenthesis to location 1895 of the macro expansion point. 1896 18972018-07-17 Jason Franklin <j_fra@fastmail.us> 1898 Jakub Jelinek <jakub@redhat.com> 1899 1900 * lex.c (_cpp_lex_direct): Use CPP_DL_NOTE instead of CPP_DL_PEDWARN, 1901 CPP_DL_WARNING or CPP_DL_ERROR for note that diagnostics for C++ style 1902 comments is reported only once per file and guard those calls on the 1903 preceding cpp_error returning true. 1904 19052018-07-03 Nathan Sidwell <nathan@acm.org> 1906 1907 Reorg line_map data structures for better packing. 1908 * include/line-map.h (enum lc_reason): Add LC_HWM. 1909 (LINE_MAP_MAX_LOCATION): Define here. 1910 (struct line_map): Move reason field to line_map_ordinary. Adjust 1911 GTY tagging. 1912 (struct line_map_ordinary): Reorder fields for less padding. 1913 (struct line_map_macro): Likewise. 1914 (MAP_ORDINARY_P): New. 1915 (linemap_check_ordinary, linemap_check_macro): Adjust. 1916 * line-map.c (LINE_MAP_MAX_SOURCE_LOCATION): Delete. 1917 (new_linemap): Take start_location, not reason. Adjust. 1918 (linemap_add, linemap_enter_macro): Adjust. 1919 (linemap_line_start): Likewise. 1920 (linemap_macro_expansion_map_p): Use MAP_ORDINARY_P. 1921 (linemap_macro_loc_to_spelling_point): Likewise. 1922 (linemap_macro_loc_to_def_point): Likewise. 1923 (linemap_dump): Likewise. 1924 19252018-05-23 Jason Merrill <jason@redhat.com> 1926 1927 * system.h: #include <new> earlier. 1928 19292018-05-17 Jason Merrill <jason@redhat.com> 1930 1931 * line-map.c (linemap_init): Use placement new. 1932 * system.h: #include <new>. 1933 19342018-03-14 David Malcolm <dmalcolm@redhat.com> 1935 1936 * include/line-map.h (compare): New function on linenum_type. 1937 19382018-02-28 Jonathan Wakely <jwakely@redhat.com> 1939 1940 PR preprocessor/84517 1941 * lex.c (is_macro_not_literal_suffix): New function. 1942 (lex_raw_string, lex_string): Use is_macro_not_literal_suffix to 1943 decide when to issue -Wliteral-suffix warnings. 1944 19452018-02-16 Richard Biener <rguenther@suse.de> 1946 1947 PR bootstrap/82939 1948 * line-map.c (linemap_init): Avoid broken value-init when compiling 1949 with GCC 4.2. 1950 19512018-02-15 Jason Merrill <jason@redhat.com> 1952 Jakub Jelinek <jakub@redhat.com> 1953 1954 PR preprocessor/83063 - __VA_OPT__ and ## 1955 PR preprocessor/83708 1956 * macro.c (vaopt_state): Reorder m_last_was_paste before m_state. 1957 (vaopt_state::vaopt_state): Adjust. 1958 (vaopt_state::update_flags): Add BEGIN and END. 1959 (vaopt_state::update): Return them. 1960 (copy_paste_flag): Factor out of replace_args. 1961 (last_token_is): New. 1962 (replace_args): Handle BEGIN and END. Avoid padding there. 1963 (tokens_buff_last_token_ptr): Return NULL if no tokens. 1964 19652018-01-31 Jakub Jelinek <jakub@redhat.com> 1966 1967 PR preprocessor/69869 1968 * traditional.c (skip_macro_block_comment): Return bool, true if 1969 the macro block comment is unterminated. 1970 (copy_comment): Use return value from skip_macro_block_comment instead 1971 of always false. 1972 19732018-01-27 Jakub Jelinek <jakub@redhat.com> 1974 1975 * include/cpplib.h (enum cpp_builtin_type): Change BT_LAST_USER from 1976 BT_FIRST_USER + 31 to BT_FIRST_USER + 63. 1977 19782018-01-18 Boris Kolpackov <boris@codesynthesis.com> 1979 1980 PR other/70268 1981 * include/cpplib.h (cpp_callbacks::remap_filename): New callback. 1982 * macro.c (_cpp_builtin_macro_text): Call remap_filename for 1983 __FILE__ and __BASE_FILE__. 1984 19852018-01-10 Kelvin Nilsen <kelvin@gcc.gnu.org> 1986 1987 * lex.c (search_line_fast): Remove illegal coercion of an 1988 unaligned pointer value to vector pointer type and replace with 1989 use of __builtin_vec_vsx_ld () built-in function, which operates 1990 on unaligned pointer values. 1991 19922018-01-03 Jakub Jelinek <jakub@redhat.com> 1993 1994 Update copyright years. 1995 19962017-12-20 Michael Weiser <michael.weiser@gmx.de> 1997 1998 PR preprocessor/83492 1999 * lex.c (search_line_fast) [__ARM_NEON && __ARM_64BIT_STATE]: 2000 Fix selection of big-endian shift parameters by using 2001 __ARM_BIG_ENDIAN. 2002 20032017-12-14 Bernd Edlinger <bernd.edlinger@hotmail.de> 2004 2005 * internal.h (maybe_print_line): Change signature. 2006 20072017-12-05 Jakub Jelinek <jakub@redhat.com> 2008 2009 PR c++/79228 2010 * expr.c (interpret_float_suffix): Avoid memcmp. 2011 (interpret_int_suffix): Likewise. Don't check for if. 2012 20132017-12-01 Jason Merrill <jason@redhat.com> 2014 2015 PR c++/79228 - extensions hide C++14 complex literal operators 2016 * expr.c (interpret_float_suffix): Ignore 'i' in C++14 and up. 2017 (interpret_int_suffix): Likewise. 2018 20192017-11-28 David Malcolm <dmalcolm@redhat.com> 2020 2021 PR c/82050 2022 * include/line-map.h (LINE_MAP_MAX_COLUMN_NUMBER): Move here. 2023 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER): ...from here. 2024 (rich_location::maybe_add_fixit): Reject fix-it hints in which 2025 the start column exceeds the next column. 2026 20272017-11-20 Eric Gallager <egall@gwmail.gwu.edu> 2028 2029 PR preprocessor/81794 2030 * macro.c (check_trad_stringification): Have warning be controlled 2031 by -Wtraditional. 2032 20332017-11-20 David Malcolm <dmalcolm@redhat.com> 2034 2035 PR c++/72786 2036 * include/cpplib.h (cpp_macro_definition_location): New decl. 2037 * macro.c (cpp_macro_definition): New function. 2038 20392017-11-13 Tom Tromey <tom@tromey.com> 2040 2041 * pch.c (cpp_read_state): Set n__VA_OPT__. 2042 * macro.c (vaopt_state): New class. 2043 (_cpp_arguments_ok): Check va_opt flag. 2044 (replace_args, create_iso_definition): Use vaopt_state. 2045 * lex.c (lex_identifier_intern): Possibly issue errors for 2046 __VA_OPT__. 2047 (lex_identifier): Likewise. 2048 (maybe_va_opt_error): New function. 2049 * internal.h (struct lexer_state) <va_args_ok>: Update comment. 2050 (struct spec_nodes) <n__VA_OPT__>: New field. 2051 * init.c (struct lang_flags) <va_opt>: New field. 2052 (lang_defaults): Add entries for C++2A. Update all entries for 2053 va_opt. 2054 (cpp_set_lang): Initialize va_opt. 2055 * include/cpplib.h (struct cpp_options) <va_opt>: New field. 2056 * identifiers.c (_cpp_init_hashtable): Initialize n__VA_OPT__. 2057 20582017-11-13 David Malcolm <dmalcolm@redhat.com> 2059 2060 * include/line-map.h (linenum_type): Move this typedef and the 2061 comment describing column numbering to near the top of the file. 2062 20632017-11-06 Mukesh Kapoor <mukesh.kapoor@oracle.com> 2064 2065 PR c++/80955 2066 * lex.c (lex_string): When checking for a valid macro for the 2067 warning related to -Wliteral-suffix (CPP_W_LITERAL_SUFFIX), 2068 check that the macro name does not start with an underscore 2069 before calling is_macro(). 2070 20712017-11-05 Tom de Vries <tom@codesourcery.com> 2072 2073 PR other/82784 2074 * lex.c (BUF_APPEND): Remove semicolon after 2075 "do {} while (0)". 2076 20772017-10-31 David Malcolm <dmalcolm@redhat.com> 2078 2079 * directives.c (_cpp_handle_directive): Update for renaming of 2080 cpp_error_at_richloc to cpp_error_at. 2081 * errors.c (cpp_diagnostic_at_richloc): Rename to... 2082 (cpp_diagnostic_at): ...this, dropping the location_t-based 2083 implementation. 2084 (cpp_diagnostic): Update for removal of location_t-based 2085 cpp_diagnostic_at. 2086 (cpp_error_at): Likewise. 2087 (cpp_error_at_richloc): Rename to... 2088 (cpp_error_at): ...this, and update for renaming of 2089 cpp_diagnostic_at_richloc. 2090 * include/cpplib.h (cpp_error_at_richloc): Rename to... 2091 (cpp_error_at): ...this. 2092 20932017-10-30 Joseph Myers <joseph@codesourcery.com> 2094 2095 * include/cpplib.h (enum c_lang): Add CLK_GNUC17 and CLK_STDC17. 2096 * init.c (lang_defaults): Add GNUC17 and STDC17 data. 2097 (cpp_init_builtins): Handle C17 value of __STDC_VERSION__. 2098 20992017-10-10 Nathan Sidwell <nathan@acm.org> 2100 2101 PR preprocessor/82506 2102 * macro.c (cpp_quote_string): Escape raw LFs. 2103 21042017-09-15 Andrew Sutton <andrew.n.sutton@gmail.com> 2105 Jakub Jelinek <jakub@redhat.com> 2106 2107 Add support for -std=c++2a. 2108 * include/cpplib.h (c_lang): Add CXX2A and GNUCXX2A. 2109 * init.c (lang_defaults): Add rows for CXX2A and GNUCXX2A. 2110 (cpp_init_builtins): Set __cplusplus to 201709L for C++2a. 2111 21122017-09-15 Jakub Jelinek <jakub@redhat.com> 2113 2114 * include/cpplib.h (enum c_lang): Rename CLK_GNUCXX1Z 2115 to CLK_GNUCXX17 and CLK_CXX1Z to CLK_CXX17. 2116 * init.c (lang_defaults, cpp_init_builtins): Likewise. 2117 * expr.c (cpp_classify_number): Use C++17 instead of C++1z 2118 in diagnostics. 2119 21202017-07-07 David Malcolm <dmalcolm@redhat.com> 2121 2122 PR c++/79300 2123 * line-map.c (linemap_macro_loc_to_def_point): Preserve range 2124 information for macro expansions by delaying resolving ad-hoc 2125 locations until within the loop. 2126 21272017-07-06 David Malcolm <dmalcolm@redhat.com> 2128 2129 PR c++/79300 2130 * include/line-map.h (enum location_aspect): New enum. 2131 (linemap_client_expand_location_to_spelling_point): Add 2132 enum location_aspect param. 2133 * line-map.c (rich_location::get_expanded_location): Update for 2134 new param of linemap_client_expand_location_to_spelling_point. 2135 (rich_location::maybe_add_fixit): Likewise. 2136 (fixit_hint::affects_line_p): Likewise. 2137 21382017-06-21 Jakub Jelinek <jakub@redhat.com> 2139 2140 * line-map.c (location_adhoc_data_update): Perform addition in 2141 uintptr_t type rather than char * type. Read *data using 2142 ptrdiff_t type instead of int64_t. 2143 (get_combined_adhoc_loc): Change offset type to ptrdiff_t from 2144 int64_t. 2145 21462017-06-20 David Malcolm <dmalcolm@redhat.com> 2147 2148 * include/line-map.h (class rich_location): Document that attempts 2149 to delete or replace a range *affecting* multiple lines will fail. 2150 * line-map.c (rich_location::maybe_add_fixit): Implement this 2151 restriction. 2152 21532017-06-09 David Malcolm <dmalcolm@redhat.com> 2154 2155 * include/line-map.h 2156 (rich_location::fixits_cannot_be_auto_applied): New method. 2157 (rich_location::fixits_can_be_auto_applied_p): New accessor. 2158 (rich_location::m_fixits_cannot_be_auto_applied): New field. 2159 * line-map.c (rich_location::rich_location): Initialize new field. 2160 21612017-06-05 David Malcolm <dmalcolm@redhat.com> 2162 2163 * include/cpplib.h (struct cpp_callbacks): Add "comment" 2164 callback. 2165 * lex.c (_cpp_lex_direct): Call the comment callback if non-NULL. 2166 21672017-05-02 David Malcolm <dmalcolm@redhat.com> 2168 2169 * include/line-map.h (class rich_location): Update description of 2170 newline handling. 2171 (class fixit_hint): Likewise. 2172 (fixit_hint::ends_with_newline_p): New decl. 2173 * line-map.c (rich_location::maybe_add_fixit): Support newlines 2174 in fix-it hints that are insertions of single lines at the start 2175 of a line. Don't consolidate into such fix-it hints. 2176 (fixit_hint::ends_with_newline_p): New method. 2177 21782017-05-01 David Malcolm <dmalcolm@redhat.com> 2179 2180 * include/line-map.h (source_range::intersects_line_p): Delete. 2181 (rich_location::add_fixit): Delete. 2182 (rich_location::maybe_add_fixit): New method. 2183 (class fixit_hint): Reimplement in terms of... 2184 (class fixit_replace): ...this. 2185 (class fixit_insert): Delete. 2186 * line-map.c (linemap_position_for_loc_and_offset): Drop overzealous 2187 linemap_assert_fails. 2188 (source_range::intersects_line_p): Rename to... 2189 (fixit_hint::affects_line_p): New function. 2190 (rich_location::add_fixit_insert_before): Reimplement in terms of 2191 maybe_add_fixit, moving validation there. 2192 (rich_location::add_fixit_insert_after): Likewise. 2193 (column_before_p): Delete. 2194 (rich_location::add_fixit_replace): Reimplement in terms of 2195 maybe_add_fixit, moving validation there. Convert closed input range 2196 to half-open range. 2197 (rich_location::add_fixit): Delete. 2198 (rich_location::maybe_add_fixit): New function. 2199 (fixit_insert::fixit_insert): Delete. 2200 (fixit_insert::~fixit_insert): Delete. 2201 (fixit_insert::affects_line_p): Delete. 2202 (fixit_insert::maybe_append_replace): Delete. 2203 (fixit_replace::fixit_replace): Rename to... 2204 (fixit_hint::fixit_hint): ...this, rewriting as necessary. 2205 (fixit_replace::~fixit_replace): Delete. 2206 (fixit_replace::affects_line_p): Delete. 2207 (fixit_replace::maybe_append_replace): Rename to... 2208 (fixit_hint::maybe_append): ...this, rewriting as necessary. 2209 22102017-04-03 Jonathan Wakely <jwakely@redhat.com> 2211 2212 * include/line-map.h (LINEMAPS_MACRO_MAPS): Fix typo in comment. 2213 * lex.c (search_line_fast): Likewise. 2214 * pch.h (cpp_valid_state): Likewise. 2215 22162017-03-21 Andreas Schwab <schwab@suse.de> 2217 2218 * lex.c (search_line_fast) [__ARM_NEON && __ARM_64BIT_STATE]: 2219 Convert 64-bit value to boolean before passing to 2220 __builtin_expect. 2221 22222017-03-16 Jason Merrill <jason@redhat.com> 2223 2224 * init.c (cpp_init_builtins): Update __cplusplus for C++17. 2225 22262017-02-09 Gerald Pfeifer <gerald@pfeifer.com> 2227 2228 * Makefile.in (po/$(PACKAGE).pot): Adjust bug reporting URL. 2229 22302017-01-10 David Malcolm <dmalcolm@redhat.com> 2231 2232 PR c++/77949 2233 * line-map.c (linemap_position_for_column): When calling 2234 linemap_start_line, detect if a new linemap was created with 2235 0 column bits, and bail out early if this is the case. 2236 (linemap_position_for_loc_and_offset): Replace overzealous 2237 linemap_assert_fails with a simple conditional; use correct 2238 bit count. 2239 22402017-01-07 David Malcolm <dmalcolm@redhat.com> 2241 2242 PR c++/72803 2243 * line-map.c (linemap_line_start): When determining if the highest 2244 column given out so far will fit into a proposed change to the 2245 current map, use the effective number of column bits, rather than 2246 the total number of column + range bits. 2247 22482017-01-01 Jakub Jelinek <jakub@redhat.com> 2249 2250 Update copyright years. 2251 22522016-12-15 David Malcolm <dmalcolm@redhat.com> 2253 2254 PR preprocessor/78680 2255 PR preprocessor/78811 2256 * lex.c (_cpp_lex_direct): Only determine the end-location of 2257 the token and build a range for non-reserved start locations. 2258 Do not do it for EOF tokens. 2259 22602016-12-12 David Malcolm <dmalcolm@redhat.com> 2261 2262 PR preprocessor/78680 2263 * lex.c (_cpp_lex_direct): Ensure line notes are processed before 2264 computing the end-point of the token. 2265 22662016-11-23 Paolo Bonzini <bonzini@gnu.org> 2267 2268 * include/cpplib.h (struct cpp_options): Add new member 2269 warn_expansion_to_defined. 2270 (CPP_W_EXPANSION_TO_DEFINED): New enum member. 2271 * expr.c (parse_defined): Warn for all uses of "defined" 2272 in macros, and tie warning to CPP_W_EXPANSION_TO_DEFINED. 2273 Make it a pedwarning instead of a warning. 2274 * system.h (HAVE_DESIGNATED_INITIALIZERS): Do not use 2275 "defined" in macros. 2276 22772016-11-17 David Malcolm <dmalcolm@redhat.com> 2278 2279 * charset.c (cpp_interpret_string_1): Skip locations from 2280 loc_reader when advancing 'p' when handling raw strings. 2281 22822016-11-16 Jakub Jelinek <jakub@redhat.com> 2283 2284 PR bootstrap/72823 2285 * configure.ac (ENABLE_ASSERT_CHECKING): Define if gcc configure 2286 would define that macro. 2287 * configure: Regenerated. 2288 * config.in: Regenerated. 2289 22902016-11-08 Richard Earnshaw <rearnsha@arm.com> 2291 2292 * lex.c (search_line_fast): New implementation for AArch64. 2293 22942016-10-25 David Malcolm <dmalcolm@redhat.com> 2295 2296 * files.c (destroy_cpp_file): Free file->path. 2297 22982016-10-25 David Malcolm <dmalcolm@redhat.com> 2299 2300 * include/line-map.h (line_maps::~line_maps): New dtor. 2301 (location_adhoc_data_fini): Delete decl. 2302 * line-map.c (line_maps::~line_maps): New dtor. 2303 (location_adhoc_data_fini): Delete. 2304 23052016-10-21 Andris Pavenis <andris.pavenis@iki.fi> 2306 2307 PR preprocessor/71681 2308 * files.c (remap_filename): Fix handling -remap in subdirectories. 2309 23102016-10-12 Jakub Jelinek <jakub@redhat.com> 2311 2312 * include/cpplib.h (struct cpp_options): Add 2313 cpp_warn_implicit_fallthrough. 2314 * init.c (cpp_create_reader): Initialize it to 0. 2315 * lex.c (fallthrough_comment_p): Handle different 2316 cpp_warn_implicit_fallthrough levels. Whitespace fixes. 2317 23182016-10-08 Jakub Jelinek <jakub@redhat.com> 2319 2320 * lex.c (fallthrough_comment_p): Accept Else, fallthrough. 2321 2322 * lex.c (fallthrough_comment_p): Extend to handle more common FALLTHRU 2323 comment styles. 2324 2325 * lex.c (fallthrough_comment_p): Fix off-by-one size comparison 2326 errors, cleanup. 2327 (_cpp_lex_direct): Allow arbitrary comments in between 2328 fallthrough_comment_p comment and following token. 2329 23302016-10-04 Kelvin Nilsen <kelvin@gcc.gnu.org> 2331 2332 PR target/77847 2333 * lex.c (search_line_fast): Add a FALLTHROUGH comment to correct 2334 compiler error in the version of this function that is 2335 conditionally compiled when GCC_VERSION >= 4005 and both 2336 __ALTIVEC__ and __BIG_ENDIAN__ symbols are defined. 2337 23382016-09-26 Marek Polacek <polacek@redhat.com> 2339 Jakub Jelinek <jakub@redhat.com> 2340 2341 PR c/7652 2342 * include/cpplib.h (PREV_FALLTHROUGH): Define. 2343 * internal.h (CPP_FALLTHRU): Define. 2344 * lex.c (fallthrough_comment_p): New function. 2345 (_cpp_lex_direct): Set PREV_FALLTHROUGH on tokens succeeding a falls 2346 through comment. 2347 23482016-09-23 David Malcolm <dmalcolm@redhat.com> 2349 2350 PR preprocessor/77672 2351 * charset.c (cpp_interpret_string_1): Add a source_range for the 2352 NUL-terminator, using the location of the trailing quote of the 2353 final string. 2354 23552016-09-21 Jason Merrill <jason@redhat.com> 2356 2357 * line-map.c (linemap_location_from_macro_definition_p): New. 2358 * line-map.h: Declare it. 2359 23602016-09-15 David Malcolm <dmalcolm@redhat.com> 2361 2362 * include/line-map.h (class rich_location): Note that newlines 2363 aren't supported in fix-it text. 2364 * line-map.c (rich_location::add_fixit_insert_before): Reject 2365 attempts to add fix-its containing newlines. 2366 (rich_location::add_fixit_replace): Likewise. 2367 23682016-09-13 David Malcolm <dmalcolm@redhat.com> 2369 2370 * include/line-map.h (class rich_location): Add description of 2371 fix-it hints to leading comment. 2372 (rich_location::add_fixit_insert): Rename both overloaded methods 2373 to.. 2374 (rich_location::add_fixit_insert_before): ...this, updating their 2375 comments. 2376 (rich_location::add_fixit_insert_after): Two new overloaded 2377 methods. 2378 (rich_location::stop_supporting_fixits): New method. 2379 * line-map.c (rich_location::add_fixit_insert): Rename both 2380 overloaded methods to.. 2381 (rich_location::add_fixit_insert_before): ...this, updating their 2382 comments. 2383 (rich_location::add_fixit_insert_after): Two new methods. 2384 (rich_location::reject_impossible_fixit): Split out 2385 failure-handling into... 2386 (rich_location::stop_supporting_fixits): New method. 2387 23882016-09-02 David Malcolm <dmalcolm@redhat.com> 2389 2390 * include/line-map.h (rich_location::seen_impossible_fixit_p): New 2391 accessor. 2392 23932016-08-31 David Malcolm <dmalcolm@redhat.com> 2394 2395 * include/line-map.h (class fixit_remove): Remove stray decl. 2396 (fixit_hint::affects_line_p): Make const. 2397 (fixit_insert::affects_line_p): Likewise. 2398 (fixit_replace::affects_line_p): Likewise. 2399 * line-map.c (fixit_insert::affects_line_p): Likewise. 2400 (fixit_replace::affects_line_p): Likewise. 2401 24022016-08-30 David Malcolm <dmalcolm@redhat.com> 2403 2404 * include/line-map.h (class semi_embedded_vec): New class. 2405 (semi_embedded_vec<T, NUM_EMBEDDED>::semi_embedded_vec): New ctor. 2406 (semi_embedded_vec<T, NUM_EMBEDDED>::~semi_embedded_vec): New 2407 dtor. 2408 (semi_embedded_vec<T, NUM_EMBEDDED>::operator[]): New methods. 2409 (semi_embedded_vec<T, NUM_EMBEDDED>::push): New method. 2410 (semi_embedded_vec<T, NUM_EMBEDDED>::truncate): New method. 2411 (rich_location::get_num_locations): Reimplement in terms of 2412 m_ranges. 2413 (rich_location::get_range): Make non-inline. 2414 (rich_location::get_num_fixit_hints): Reimplement in terms of 2415 m_fixit_hints. 2416 (rich_location::add_fixit): New function. 2417 (rich_location::MAX_RANGES): Rename to... 2418 (rich_location::STATICALLY_ALLOCATED_RANGES): ...this. 2419 (rich_location::MAX_FIXIT_HINTS): Rename to... 2420 (rich_location::STATICALLY_ALLOCATED_RANGES): ...this, and make 2421 private. 2422 (rich_location::m_num_ranges): Eliminate in favor of... 2423 (rich_location::m_ranges): ...this, converting from a fixed-size 2424 array to a semi_embedded_vec. 2425 (rich_location::m_num_fixit_hints): Eliminate in favor of... 2426 (rich_location::m_fixit_hints): ...this, converting from a 2427 fixed-size array to a semi_embedded_vec. 2428 * line-map.c (rich_location::rich_location): Update for above 2429 changes. 2430 (rich_location::~rich_location): Likewise. 2431 (rich_location::get_loc): Likewise. 2432 (rich_location::get_range): New methods. 2433 (rich_location::add_range): Update for above changes. 2434 (rich_location::set_range): Likewise. 2435 (rich_location::add_fixit_insert): Likewise. 2436 (rich_location::add_fixit_replace): Likewise. 2437 (rich_location::get_last_fixit_hint): Likewise. 2438 (rich_location::reject_impossible_fixit): Likewise. 2439 (rich_location::add_fixit): New method. 2440 24412016-08-30 David Malcolm <dmalcolm@redhat.com> 2442 2443 * include/line-map.h (rich_location::add_fixit_insert): Add 2444 comments. Add overload omitting the source_location param. 2445 (rich_location::add_fixit_remove): Add comments. Add overloads 2446 omitting the range, and accepting a source_location. 2447 (rich_location::add_fixit_replace): Likewise. 2448 * line-map.c (rich_location::add_fixit_insert): Add comments. Add 2449 overload omitting the source_location param. 2450 (rich_location::add_fixit_remove): Add comments. Add overloads 2451 omitting the range, and accepting a source_location. 2452 (rich_location::add_fixit_replace): Likewise. 2453 24542016-08-26 David Malcolm <dmalcolm@redhat.com> 2455 2456 * include/line-map.h (get_pure_location): New decl. 2457 * line-map.c (get_pure_location): Move here, from gcc/input.c, adding 2458 a line_maps * param. 2459 (rich_location::add_fixit_insert): Call get_pure_location on "where". 2460 (rich_location::add_fixit_replace): Call get_pure_location on the 2461 end-points. 2462 24632016-08-26 David Malcolm <dmalcolm@redhat.com> 2464 2465 * include/line-map.h (rich_location): Eliminate unimplemented 2466 constructor based on source_range. 2467 (rich_location::get_last_fixit_hint): New method. 2468 (rich_location::reject_impossible_fixit): New method. 2469 (rich_location): Add fields m_line_table and 2470 m_seen_impossible_fixit. 2471 (fixit_hint::maybe_append_replace): New pure virtual function. 2472 (fixit_insert::maybe_append_replace): New function. 2473 (fixit_replace::maybe_append_replace): New function. 2474 * line-map.c (rich_location::rich_location): Initialize 2475 m_line_table and m_seen_impossible_fixit. 2476 (rich_location::add_fixit_insert): Call 2477 reject_impossible_fixit and bail out if true. 2478 (column_before_p): New function. 2479 (rich_location::add_fixit_replace): Call reject_impossible_fixit 2480 and bail out if true. Attempt to consolidate with neighboring 2481 fixits. 2482 (rich_location::get_last_fixit_hint): New method. 2483 (rich_location::reject_impossible_fixit): New method. 2484 (fixit_insert::maybe_append_replace): New method. 2485 (fixit_replace::maybe_append_replace): New method. 2486 24872016-08-23 David Malcolm <dmalcolm@redhat.com> 2488 2489 * include/line-map.h (source_range::from_locations): New method. 2490 24912016-08-19 David Malcolm <dmalcolm@redhat.com> 2492 2493 * include/line-map.h (fixit_hint::kind): Delete REPLACE. 2494 (class fixit_remove): Delete. 2495 * line-map.c (rich_location::add_fixit_remove): Reimplement 2496 by calling add_fixit_replace with an empty string. 2497 (fixit_remove::fixit_remove): Delete. 2498 (fixit_remove::affects_line_p): Delete. 2499 25002016-08-19 Joseph Myers <joseph@codesourcery.com> 2501 2502 PR c/32187 2503 * include/cpplib.h (CPP_N_FLOATN, CPP_N_FLOATNX) 2504 (CPP_N_WIDTH_FLOATN_NX, CPP_FLOATN_SHIFT, CPP_FLOATN_MAX): New 2505 macros. 2506 * expr.c (interpret_float_suffix): Handle fN, fNx, FN and FNx 2507 suffixes. 2508 25092016-08-19 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> 2510 2511 * expr.c (eval_token): Append "evaluates to 0" to Wundef diagnostic. 2512 25132016-08-18 David Malcolm <dmalcolm@redhat.com> 2514 2515 * directives.c (directive_names): New array. 2516 (_cpp_handle_directive): Offer spelling suggestions for misspelled 2517 directives. 2518 * errors.c (cpp_diagnostic_at_richloc): New function. 2519 (cpp_error_at_richloc): New function. 2520 * include/cpplib.h (struct cpp_callbacks): Add field 2521 "get_suggestion". 2522 (cpp_error_at_richloc): New decl. 2523 25242016-08-18 Marek Polacek <polacek@redhat.com> 2525 2526 PR c/7652 2527 * pch.c (write_macdef): Add CPP_FALLTHRU. 2528 25292016-08-12 Marek Polacek <polacek@redhat.com> 2530 2531 PR c/7652 2532 * lex.c (search_line_fast): Add FALLTHRU. 2533 (_cpp_lex_direct): Likewise. 2534 (cpp_token_val_index): Adjust fall through comment. 2535 * macro.c (parse_params): Add FALLTHRU. 2536 * pch.c (count_defs): Adjust fall through comment. 2537 (write_defs): Likewise. 2538 25392016-08-06 David Malcolm <dmalcolm@redhat.com> 2540 2541 PR bootstrap/72823 2542 * charset.c (_cpp_valid_ucn): Replace overzealous assert with one 2543 that allows for char_range to be non-NULL when loc_reader is NULL. 2544 25452016-08-05 David Malcolm <dmalcolm@redhat.com> 2546 2547 * charset.c (cpp_substring_ranges::cpp_substring_ranges): New 2548 constructor. 2549 (cpp_substring_ranges::~cpp_substring_ranges): New destructor. 2550 (cpp_substring_ranges::add_range): New method. 2551 (cpp_substring_ranges::add_n_ranges): New method. 2552 (_cpp_valid_ucn): Add "char_range" and "loc_reader" params; if 2553 they are non-NULL, read position information from *loc_reader 2554 and update char_range->m_finish accordingly. 2555 (convert_ucn): Add "char_range", "loc_reader", and "ranges" 2556 params. If loc_reader is non-NULL, read location information from 2557 it, and update *ranges accordingly, using char_range. 2558 Conditionalize the conversion into tbuf on tbuf being non-NULL. 2559 (convert_hex): Likewise, conditionalizing the call to 2560 emit_numeric_escape on tbuf. 2561 (convert_oct): Likewise. 2562 (convert_escape): Add params "loc_reader" and "ranges". If 2563 loc_reader is non-NULL, read location information from it, and 2564 update *ranges accordingly. Conditionalize the conversion into 2565 tbuf on tbuf being non-NULL. 2566 (cpp_interpret_string): Rename to... 2567 (cpp_interpret_string_1): ...this, adding params "loc_readers" and 2568 "out". Use "to" to conditionalize the initialization and usage of 2569 "tbuf", such as running the converter. If "loc_readers" is 2570 non-NULL, use the instances within it, reading location 2571 information from them, and passing them to convert_escape; likewise 2572 write to "out" if loc_readers is non-NULL. Check for leading 2573 quote and issue an error if it is not present. Update boundary 2574 check from "== limit" to ">= limit" to protect against erroneous 2575 location values to calls that are not parsing string literals. 2576 (cpp_interpret_string): Reimplement in terms to 2577 cpp_interpret_string_1. 2578 (noop_error_cb): New function. 2579 (cpp_interpret_string_ranges): New function. 2580 (cpp_string_location_reader::cpp_string_location_reader): New 2581 constructor. 2582 (cpp_string_location_reader::get_next): New method. 2583 * include/cpplib.h (class cpp_string_location_reader): New class. 2584 (class cpp_substring_ranges): New class. 2585 (cpp_interpret_string_ranges): New prototype. 2586 * internal.h (_cpp_valid_ucn): Add params "char_range" and 2587 "loc_reader". 2588 * lex.c (forms_identifier_p): Pass NULL for new params to 2589 _cpp_valid_ucn. 2590 25912016-08-01 Andreas Schwab <schwab@suse.de> 2592 2593 * include/cpplib.h: Fix comment typo. 2594 25952016-07-27 David Malcolm <dmalcolm@redhat.com> 2596 2597 * include/line-map.h (source_location): Fix line numbers in 2598 comment. 2599 26002016-07-11 David Malcolm <dmalcolm@redhat.com> 2601 2602 * include/line-map.h (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): 2603 Move here from line-map.c. 2604 (LINE_MAP_MAX_LOCATION_WITH_COLS): Likewise. 2605 * line-map.c (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): Move from 2606 here to line-map.h. 2607 (LINE_MAP_MAX_LOCATION_WITH_COLS): Likewise. 2608 26092016-06-22 David Malcolm <dmalcolm@redhat.com> 2610 2611 * directives.c (do_include_common): Pass on "location" to 2612 _cpp_stack_include. 2613 * errors.c (cpp_diagnostic): Reimplement in terms of... 2614 (cpp_diagnostic_at): New function. 2615 (cpp_error_at): New function. 2616 (cpp_errno_filename): Add "loc" param and use it by using 2617 cpp_error_at rather than cpp_error. 2618 * files.c (find_file_in_dir): Add "loc" param and pass it to 2619 open_file_failed. 2620 (_cpp_find_file): Add "loc" param. Use it to convert calls to 2621 cpp_error to cpp_error_at, and pass it to find_file_in_dir and 2622 open_file_failed. 2623 (read_file_guts): Add "loc" param. Use it to convert calls to 2624 cpp_error to cpp_error_at. Pass it to cpp_errno_filename. 2625 (read_file): Add "loc" param. Pass it to open_file_failed and 2626 read_file_guts. 2627 (should_stack_file): Add "loc" param. Pass it to read_file. 2628 (_cpp_stack_file): Add "loc" param. Pass it to should_stack_file. 2629 (_cpp_stack_include): Add "loc" param. Pass it to 2630 _cpp_find_file and _cpp_stack_file. 2631 (open_file_failed): Add "loc" param. Pass it to 2632 cpp_errno_filename. 2633 (_cpp_fake_include): Add 0 as a source_location in call to 2634 _cpp_find_file. 2635 (_cpp_compare_file_date): Likewise. 2636 (cpp_push_include): Likewise for call to _cpp_stack_include. 2637 (cpp_push_default_include): Likewise. 2638 (_cpp_save_file_entries): Likewise for call to open_file_failed. 2639 (_cpp_has_header): Likewise for call to _cpp_find_file. 2640 * include/cpplib.h (cpp_errno_filename): Add source_location 2641 param. 2642 (cpp_error_at): New declaration. 2643 * init.c (cpp_read_main_file): Add 0 as a source_location in calls 2644 to _cpp_find_file and _cpp_stack_file. 2645 * internal.h (_cpp_find_file): Add source_location param. 2646 (_cpp_stack_file): Likewise. 2647 (_cpp_stack_include): Likewise. 2648 26492016-06-22 David Malcolm <dmalcolm@redhat.com> 2650 2651 * include/line-map.h (fixit_hint::get_start_loc): New pure virtual 2652 function. 2653 (fixit_hint::maybe_get_end_loc): Likewise. 2654 (fixit_insert::get_start_loc): New function, implementing 2655 fixit_hint::get_start_loc. 2656 (fixit_insert::maybe_get_end_loc): New function, implementing 2657 fixit_hint::maybe_get_end_loc. 2658 (fixit_remove::get_start_loc): New function, implementing 2659 fixit_hint::get_start_loc. 2660 (fixit_remove::maybe_get_end_loc): New function, implementing 2661 fixit_hint::maybe_get_end_loc. 2662 (fixit_replace::get_start_loc): New function, implementing 2663 fixit_hint::get_start_loc. 2664 (fixit_replace::maybe_get_end_loc): New function, implementing 2665 fixit_hint::maybe_get_end_loc. 2666 26672016-06-21 John David Anglin <danglin@gcc.gnu.org> 2668 2669 * line-map.c (location_adhoc_data_update): Use int64_t instead of 2670 long long. 2671 (get_combined_adhoc_loc): Likewise. 2672 26732016-06-01 Eduard Sanou <dhole@openmailbox.org> 2674 2675 * include/cpplib.h (cpp_callbacks): Add get_source_date_epoch 2676 callback. 2677 * include/cpplib.h (cpp_init_source_date_epoch): Remove prototype. 2678 * init.c (cpp_init_source_date_epoch): Remove function. 2679 * init.c (cpp_create_reader): Initialize pfile->source_date_epoch. 2680 * internal.h (cpp_reader): Extend comment about source_date_epoch. 2681 * macro.c (_cpp_builtin_macro_text): Use get_source_date_epoch 2682 callback only once, read pfile->source_date_epoch on future passes. 2683 Check that get_source_date_epoch callback is not NULL. 2684 26852016-05-20 Martin Liska <mliska@suse.cz> 2686 2687 * config.in: Regenerated. 2688 * configure: Likewise. 2689 * configure.ac: Handle --enable-valgrind-annotations. 2690 * lex.c (new_buff): Use ENABLE_VALGRIND_ANNOTATIONS instead 2691 of ENABLE_VALGRIND_CHECKING. 2692 (_cpp_free_buff): Likewise. 2693 26942016-04-28 Eduard Sanou <dhole@openmailbox.org> 2695 Matthias Klose <doko@debian.org> 2696 2697 * include/cpplib.h (cpp_init_source_date_epoch): Prototype. 2698 * init.c (cpp_init_source_date_epoch): New function. 2699 * internal.h: Added source_date_epoch variable to struct 2700 cpp_reader to store a reproducible date. 2701 * macro.c (_cpp_builtin_macro_text): Set pfile->date timestamp from 2702 pfile->source_date_epoch instead of localtime if source_date_epoch is 2703 set, to be used for __DATE__ and __TIME__ macros to help reproducible 2704 builds. 2705 27062016-04-13 Bernd Schmidt <bschmidt@redhat.com> 2707 2708 Patch from Roger Orr <rogero@howzatt.demon.co.uk> 2709 PR preprocessor/69650 2710 * directives.c (do_linemarker): Reread map after calling 2711 cpp_get_token. 2712 27132016-04-06 Richard Henderson <rth@redhat.com> 2714 2715 PR preprocessor/61817 2716 PR preprocessor/69391 2717 * internal.h (_cpp_builtin_macro_text): Update decl. 2718 * macro.c (_cpp_builtin_macro_text): Accept location for __LINE__. 2719 (builtin_macro): Accept a second location for __LINE__. 2720 (enter_macro_context): Compute both virtual and real expansion 2721 locations for the macro. 2722 27232016-03-25 Bernd Schmidt <bschmidt@redhat.com> 2724 2725 PR lto/69650 2726 * directives.c (do_linemarker): Test for file left but not entered 2727 here. 2728 * line-map.c (linemap_add): Not here. 2729 27302016-03-21 Jakub Jelinek <jakub@redhat.com> 2731 2732 PR target/70296 2733 * include/cpplib.h (cpp_fun_like_macro_p): New prototype. 2734 * macro.c (cpp_fun_like_macro_p): New function. 2735 27362016-03-15 Richard Henderson <rth@redhat.com> 2737 2738 * line-map.c (new_linemap): Make alloc_size a size_t. 2739 27402016-03-14 Jason Merrill <jason@redhat.com> 2741 2742 * expr.c (cpp_classify_number): Hex floats are new in C++1z. 2743 * init.c (lang_defaults): Likewise. 2744 27452016-03-09 David Malcolm <dmalcolm@redhat.com> 2746 2747 PR c/68473 2748 PR c++/70105 2749 * line-map.c (linemap_macro_map_loc_unwind_toward_spelling): Move 2750 decl... 2751 * include/line-map.h 2752 (linemap_macro_map_loc_unwind_toward_spelling): ...here, 2753 converting from static to extern. 2754 27552016-03-09 David Malcolm <dmalcolm@redhat.com> 2756 2757 PR c/68473 2758 PR c++/70105 2759 * include/line-map.h (source_range::debug): Delete. 2760 (struct location_range): Update comment. Replace 2761 expanded_location fields "m_start", "m_finish", and "m_caret" with 2762 a source_location field: "m_loc". 2763 (class rich_location): Reword comment. 2764 (rich_location::get_loc): Reimplement in terms of a new overloaded 2765 variant which takes an unsigned int. 2766 (rich_location::get_loc_addr): Delete. 2767 (rich_location::add_range): Drop params "start" and "finish" in 2768 favor of param "loc". Drop overloaded variants taking a 2769 source_range or location_range *. 2770 (rich_location::lazily_expand_location): Delete in favor of... 2771 (rich_location::get_expanded_location): New decl. 2772 (rich_location::m_loc): Delete field. 2773 (rich_location::m_column_override): New field. 2774 * line-map.c (rich_location::rich_location): Drop name of 2775 line_maps * param. Update initializations for deletion of field 2776 "m_loc" and addition of field "m_column_override". Reimplement 2777 body as a call to add_range. Delete overloaded variant taking a 2778 source_range. 2779 (rich_location::get_loc): New function. 2780 (rich_location::lazily_expand_location): Delete in favor of... 2781 (rich_location::get_expanded_location): New function. 2782 (rich_location::override_column): Reimplement. 2783 (rich_location::add_range): Drop params "start" and "finish" in 2784 favor of param "loc". Eliminate location expansion in favor of 2785 simply storing loc. Drop overloaded variants taking a 2786 source_range or location_range *. 2787 (rich_location::set_range): Eliminate location expansion. 2788 27892016-02-29 David Malcolm <dmalcolm@redhat.com> 2790 2791 PR preprocessor/69985 2792 (linemap_position_for_loc_and_offset): Rename param from "offset" 2793 to "column_offset". Right-shift the column_offset by m_range_bits 2794 of the pertinent ordinary map whenever offsetting a 2795 source_location. For clarity, offset the column by the column 2796 offset, rather than the other way around. 2797 27982016-02-23 David Malcolm <dmalcolm@redhat.com> 2799 2800 PR preprocessor/69126 2801 PR preprocessor/69543 2802 * line-map.c (linemap_compare_locations): At the function top, 2803 replace inlined bodies of get_location_from_adhoc_loc with calls 2804 to get_location_from_adhoc_loc. Add a pair of calls to 2805 get_location_from_adhoc_loc at the bottom of the function, to 2806 avoid meaningless comparisons of ad-hoc and non-ad-hoc locations. 2807 28082016-02-08 David Malcolm <dmalcolm@redhat.com> 2809 2810 PR preprocessor/69664 2811 * errors.c (cpp_diagnostic_with_line): Only call 2812 rich_location::override_column if the column is non-zero. 2813 * line-map.c (rich_location::override_column): Update columns 2814 within m_ranges[0]. Add assertions to verify that doing so is 2815 sane. 2816 28172016-02-05 Jakub Jelinek <jakub@redhat.com> 2818 2819 PR c++/69628 2820 * charset.c (cpp_interpret_charconst): Clear *PCHARS_SEEN 2821 and *UNSIGNEDP if bailing out early due to errors. 2822 28232016-01-28 Jakub Jelinek <jakub@redhat.com> 2824 2825 PR pch/68176 2826 * files.c (_cpp_find_file): Set file->implicit_preinclude even if 2827 included from file->implicit_preinclude header. 2828 2829 * directives.c (destringize_and_run): Adjust prototype. 2830 28312016-01-27 David Malcolm <dmalcolm@redhat.com> 2832 2833 PR preprocessor/69126 2834 * directives.c (destringize_and_run): Add expansion_loc param; use 2835 it when handling unexpanded pragmas to fixup the locations of the 2836 synthesized tokens. 2837 (_cpp_do__Pragma): Add expansion_loc param and use it when calling 2838 destringize_and_run. 2839 * internal.h (_cpp_do__Pragma): Add expansion_loc param. 2840 * macro.c (builtin_macro): Pass expansion location of _Pragma to 2841 _cpp_do__Pragma. 2842 28432016-01-14 David Malcolm <dmalcolm@redhat.com> 2844 2845 PR preprocessor/69177 2846 * line-map.c (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): New 2847 constant. 2848 (LINE_MAP_MAX_LOCATION_WITH_COLS): Add note about unit tests 2849 to comment. 2850 (can_be_stored_compactly_p): Reduce threshold from 2851 LINE_MAP_MAX_LOCATION_WITH_COLS to 2852 LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES. 2853 (get_combined_adhoc_loc): Likewise. 2854 (get_range_from_loc): Likewise. 2855 (linemap_line_start): Ensure that a new ordinary map is created 2856 when transitioning from range-packing being enabled to disabled, 2857 at the LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES threshold. Set 2858 range_bits to 0 for new ordinary maps when beyond this limit. 2859 Prevent the "increase the column bits of a freshly created map" 2860 optimization if the range bits has reduced. 2861 28622016-01-08 Jakub Jelinek <jakub@redhat.com> 2863 2864 PR c++/69145 2865 * files.c (cpp_included_before): If IS_ADHOC_LOC (location), lookup 2866 real location from the line_table. 2867 28682016-01-04 Jakub Jelinek <jakub@redhat.com> 2869 2870 Update copyright years. 2871 28722015-12-22 David Malcolm <dmalcolm@redhat.com> 2873 2874 * line-map.c (get_combined_adhoc_loc): Remove condition 2875 on locus < RESERVED_LOCATION_COUNT when considering 2876 whether a caret == start == finish location can be 2877 simply stored as the caret location. 2878 28792015-12-07 David Malcolm <dmalcolm@redhat.com> 2880 2881 * include/line-map.h (rich_location::set_range): Add line_maps * 2882 param; convert param from source_range to source_location. Drop 2883 "overwrite_loc_p" param. 2884 * line-map.c (rich_location::set_range): Likewise, acting as if 2885 "overwrite_loc_p" were true, and getting range from the location. 2886 28872015-11-20 David Malcolm <dmalcolm@redhat.com> 2888 2889 PR 62314 2890 * include/line-map.h (source_range::intersects_line_p): New 2891 method. 2892 (rich_location::~rich_location): New. 2893 (rich_location::add_fixit_insert): New method. 2894 (rich_location::add_fixit_remove): New method. 2895 (rich_location::add_fixit_replace): New method. 2896 (rich_location::get_num_fixit_hints): New accessor. 2897 (rich_location::get_fixit_hint): New accessor. 2898 (rich_location::MAX_FIXIT_HINTS): New constant. 2899 (rich_location::m_num_fixit_hints): New field. 2900 (rich_location::m_fixit_hints): New field. 2901 (class fixit_hint): New class. 2902 (class fixit_insert): New class. 2903 (class fixit_remove): New class. 2904 (class fixit_replace): New class. 2905 * line-map.c (source_range::intersects_line_p): New method. 2906 (rich_location::rich_location): Add initialization of 2907 m_num_fixit_hints to both ctors. 2908 (rich_location::~rich_location): New. 2909 (rich_location::add_fixit_insert): New method. 2910 (rich_location::add_fixit_remove): New method. 2911 (rich_location::add_fixit_replace): New method. 2912 (fixit_insert::fixit_insert): New. 2913 (fixit_insert::~fixit_insert): New. 2914 (fixit_insert::affects_line_p): New. 2915 (fixit_remove::fixit_remove): New. 2916 (fixit_remove::affects_line_p): New. 2917 (fixit_replace::fixit_replace): New. 2918 (fixit_replace::~fixit_replace): New. 2919 (fixit_replace::affects_line_p): New. 2920 29212015-11-19 Jakub Jelinek <jakub@redhat.com> 2922 2923 PR preprocessor/60736 2924 * include/cpplib.h (cpp_errno_filename): New prototype. 2925 * errors.c (cpp_errno): Don't handle msgid "" specially, use 2926 _(msgid) instead of msgid as argument to cpp_error. 2927 (cpp_errno_filename): New function. 2928 * files.c (read_file_guts): Use cpp_errno_filename instead of 2929 cpp_errno. 2930 (open_file_failed): Likewise. Use file->name if file->path is NULL 2931 in diagnostics. 2932 29332015-11-13 David Malcolm <dmalcolm@redhat.com> 2934 2935 * errors.c (cpp_diagnostic): Pass pfile->line_table to 2936 rich_location ctor. 2937 (cpp_diagnostic_with_line): Likewise. 2938 * include/cpplib.h (struct cpp_token): Update comment for src_loc 2939 to indicate that the range of the token is "baked into" the 2940 source_location. 2941 * include/line-map.h (source_location): Update the descriptive 2942 comment to reflect the packing scheme for short ranges, adding 2943 worked examples of location encoding. 2944 (struct line_map_ordinary): Drop field "column_bits" in favor 2945 of field "m_column_and_range_bits"; add field "m_range_bits". 2946 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete. 2947 (location_adhoc_data): Add source_range field. 2948 (struct line_maps): Add fields "default_range_bits", 2949 "num_optimized_ranges" and "num_unoptimized_ranges". 2950 (get_combined_adhoc_loc): Add source_range param. 2951 (get_range_from_loc): New declaration. 2952 (pure_location_p): New prototype. 2953 (COMBINE_LOCATION_DATA): Add source_range param. 2954 (SOURCE_LINE): Update for renaming of column_bits. 2955 (SOURCE_COLUMN): Likewise. Shift the column right by the map's 2956 range_bits. 2957 (LAST_SOURCE_LINE_LOCATION): Update for renaming of column_bits. 2958 (linemap_position_for_line_and_column): Add line_maps * params. 2959 (rich_location::rich_location): Likewise. 2960 * lex.c (_cpp_lex_direct): Capture the range of the token, baking 2961 it into token->src_loc via a call to COMBINE_LOCATION_DATA. 2962 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER): Reduce from 1U << 17 to 2963 1U << 12. 2964 (location_adhoc_data_hash): Add the src_range into 2965 the hash value. 2966 (location_adhoc_data_eq): Require equality of the src_range 2967 values. 2968 (can_be_stored_compactly_p): New function. 2969 (get_combined_adhoc_loc): Add src_range param, and store it, 2970 via a bit-packing scheme for short ranges, otherwise within the 2971 lookaside table. Remove the requirement that data is non-NULL. 2972 (get_range_from_adhoc_loc): New function. 2973 (get_range_from_loc): New function. 2974 (pure_location_p): New function. 2975 (linemap_add): Ensure that start_location has zero for the 2976 range_bits, unless we're past LINE_MAP_MAX_LOCATION_WITH_COLS. 2977 Initialize range_bits to zero. Assert that the start_location 2978 is "pure". 2979 (linemap_line_start): Assert that the 2980 column_and_range_bits >= range_bits. 2981 Update determinination of whether we need to start a new map 2982 using the effective column bits, without the range bits. 2983 Use the set's default_range_bits in new maps, apart from 2984 those with column_bits == 0, which should also have 0 range_bits. 2985 Increase the column bits for new maps by the range bits. 2986 When adding lines to an existing map, use set->highest_line 2987 directly rather than offsetting highest by SOURCE_COLUMN. 2988 Add assertions to sanity-check the return value. 2989 (linemap_position_for_column): Offset to_column by range_bits. 2990 Update set->highest_location if necessary. 2991 (linemap_position_for_line_and_column): Add line_maps * param. 2992 Update the calculation to offset the column by range_bits, and 2993 conditionalize it on being <= LINE_MAP_MAX_LOCATION_WITH_COLS. 2994 Bound it by LINEMAPS_MACRO_LOWEST_LOCATION. Update 2995 set->highest_location if necessary. 2996 (linemap_position_for_loc_and_offset): Handle ad-hoc locations; 2997 pass "set" to linemap_position_for_line_and_column. 2998 (linemap_macro_map_loc_unwind_toward_spelling): Add line_maps 2999 param. Handle ad-hoc locations. 3000 (linemap_location_in_system_header_p): Pass on "set" to call to 3001 linemap_macro_map_loc_unwind_toward_spelling. 3002 (linemap_macro_loc_to_spelling_point): Retain ad-hoc locations. 3003 Pass on "set" to call to 3004 linemap_macro_map_loc_unwind_toward_spelling. 3005 (linemap_resolve_location): Retain ad-hoc locations. Pass on 3006 "set" to call to linemap_macro_map_loc_unwind_toward_spelling. 3007 (linemap_unwind_toward_expansion): Pass on "set" to call to 3008 linemap_macro_map_loc_unwind_toward_spelling. 3009 (linemap_expand_location): Extract the data pointer before 3010 extracting the location. 3011 (rich_location::rich_location): Add line_maps param; use it to 3012 extract the range from the source_location. 3013 * location-example.txt: Regenerate, showing new representation. 3014 30152015-11-06 David Malcolm <dmalcolm@redhat.com> 3016 3017 * errors.c (cpp_diagnostic): Update for change in signature 3018 of "error" callback. 3019 (cpp_diagnostic_with_line): Likewise, calling override_column 3020 on the rich_location. 3021 * include/cpplib.h (struct cpp_callbacks): Within "error" 3022 callback, convert param from source_location to rich_location *, 3023 and drop column_override param. 3024 * include/line-map.h (struct source_range): New struct. 3025 (struct location_range): New struct. 3026 (class rich_location): New class. 3027 (linemap_client_expand_location_to_spelling_point): New declaration. 3028 * line-map.c (rich_location::rich_location): New ctors. 3029 (rich_location::lazily_expand_location): New method. 3030 (rich_location::override_column): New method. 3031 (rich_location::add_range): New methods. 3032 (rich_location::set_range): New method. 3033 30342015-11-06 David Malcolm <dmalcolm@redhat.com> 3035 3036 * include/line-map.h (struct linemap_stats): Add fields 3037 "adhoc_table_size" and "adhoc_table_entries_used". 3038 * line-map.c (linemap_get_statistics): Populate above fields. 3039 30402015-11-04 Mikhail Maltsev <maltsevm@gmail.com> 3041 3042 * config.in: Regenerate. 3043 * configure: Regenerate. 3044 * configure.ac: Remove ENABLE_CHECKING. 3045 30462015-11-03 Uros Bizjak <ubizjak@gmail.com> 3047 3048 * lex.c (search_line_sse42): Correctly advance the pointer to an 3049 aligned address. 3050 30512015-11-02 David Malcolm <dmalcolm@redhat.com> 3052 3053 * include/line-map.h (source_location): In the table in the 3054 descriptive comment, show UNKNOWN_LOCATION, BUILTINS_LOCATION, 3055 LINE_MAP_MAX_LOCATION_WITH_COLS, LINE_MAP_MAX_SOURCE_LOCATION. 3056 Add notes about ad-hoc values. 3057 30582015-10-21 Mikhail Maltsev <maltsevm@gmail.com> 3059 3060 * include/line-map.h: Use CHECKING_P instead of ENABLE_CHECKING. 3061 * init.c: Likewise. 3062 * macro.c (struct macro_arg_token_iter, set_arg_token, 3063 macro_arg_token_iter_init, macro_arg_token_iter_forward, 3064 macro_arg_token_iter_get_token, macro_arg_token_iter_get_location, 3065 alloc_expanded_arg_mem, _cpp_backup_tokens): Likewise. 3066 3067 * config.in: Regenerate. 3068 * configure: Regenerate. 3069 * configure.ac (CHECKING_P): Define. 3070 * system.h (fancy_abort): Declare. 3071 (abort): Define. 3072 (gcc_assert): Define. Use CHECKING_P. 3073 30742015-10-13 Mikhail Maltsev <maltsevm@gmail.com> 3075 3076 * system.h (CHECKING_P, gcc_checking_assert): Define. 3077 30782015-09-21 Manuel L��pez-Ib����ez <manu@gcc.gnu.org> 3079 3080 PR c/66415 3081 * line-map.c (linemap_position_for_loc_and_offset): Handle the 3082 case of long lines encoded in multiple maps. 3083 30842015-09-07 Marek Polacek <polacek@redhat.com> 3085 3086 * system.h (INTTYPE_MINIMUM): Rewrite to avoid shift warning. 3087 30882015-08-06 Yaakov Selkowitz <yselkowi@redhat.com> 3089 3090 * configure: Regenerate. 3091 30922015-07-08 Thomas Schwinge <thomas@codesourcery.com> 3093 3094 * include/line-map.h (RESERVED_LOCATION_COUNT): Change type to 3095 source_location. 3096 30972015-07-02 Paolo Carlini <paolo.carlini@oracle.com> 3098 3099 PR preprocessor/53690 3100 * charset.c (_cpp_valid_ucn): Add cppchar_t * parameter and change 3101 return type to bool. Fix encoding of \u0000 and \U00000000 in C++. 3102 (convert_ucn): Adjust call. 3103 * lex.c (forms_identifier_p): Likewise. 3104 * internal.h (_cpp_valid_ucn): Adjust declaration. 3105 31062015-06-30 Edward Smith-Rowland <3dw4rd@verizon.net> 3107 3108 Implement N4197 - Adding u8 character literals 3109 * include/cpplib.h (UTF8CHAR, UTF8CHAR_USERDEF): New cpp tokens; 3110 (struct cpp_options): Add utf8_char_literals. 3111 * init.c (struct lang_flags): Add utf8_char_literals; 3112 (struct lang_flags lang_defaults): Add column for utf8_char_literals. 3113 * macro.c (stringify_arg()): Treat CPP_UTF8CHAR token; 3114 * expr.c (cpp_userdef_char_remove_type(), cpp_userdef_char_add_type()): 3115 Treat CPP_UTF8CHAR_USERDEF, CPP_UTF8CHAR tokens; 3116 (cpp_userdef_char_p()): Treat CPP_UTF8CHAR_USERDEF token; 3117 (eval_token(), _cpp_parse_expr()): Treat CPP_UTF8CHAR token. 3118 * lex.c (lex_string(), _cpp_lex_direct()): Include CPP_UTF8CHAR tokens. 3119 * charset.c (converter_for_type(), cpp_interpret_charconst()): 3120 Treat CPP_UTF8CHAR token. 3121 31222015-06-30 Uros Bizjak <ubizjak@gmail.com> 3123 3124 * lex.c (search_line_sse42) [__GCC_ASM_FLAG_OUTPUTS__]: New main 3125 loop using asm flag outputs. 3126 31272015-06-08 Marek Polacek <polacek@redhat.com> 3128 3129 PR c/66415 3130 * line-map.c (linemap_position_for_loc_and_offset): Remove 3131 linemap_assert_fails; reverse conditions. 3132 31332015-05-26 Manuel L��pez-Ib����ez <manu@gcc.gnu.org> 3134 3135 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER 3136 LINE_MAP_MAX_LOCATION_WITH_COLS,LINE_MAP_MAX_SOURCE_LOCATION): 3137 New constants. 3138 (linemap_line_start): Use them. 3139 (linemap_position_for_column): Use them. 3140 31412015-05-20 David Malcolm <dmalcolm@redhat.com> 3142 3143 * include/line-map.h (MAP_START_LOCATION): Eliminate the non-const 3144 variant, and tweak comment for the const variant. 3145 (ORDINARY_MAP_STARTING_LINE_NUMBER): Drop the non-const variant. 3146 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise. 3147 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise. 3148 (SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete. 3149 (ORDINARY_MAP_FILE_NAME): Drop the non-const variant. 3150 (MACRO_MAP_MACRO): Likewise. 3151 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise. 3152 (MACRO_MAP_LOCATIONS): Likewise. 3153 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise. 3154 * line-map.c (linemap_add): Replace writes through macros with 3155 direct field accesses. 3156 (linemap_enter_macro): Likewise. 3157 (linemap_line_start): Likewise. 3158 31592015-05-19 David Malcolm <dmalcolm@redhat.com> 3160 3161 * directives.c (do_line): Strengthen local "map" from 3162 const line_map * to const line_map_ordinary *. 3163 (do_linemarker): Likewise. 3164 (_cpp_do_file_change): Assert that we're not dealing with 3165 a macro map. Introduce local "ord_map" via a call to 3166 linemap_check_ordinary, guarded within the check for 3167 non-NULL. Use it for typesafety. 3168 * files.c (cpp_make_system_header): Strengthen local "map" from 3169 const line_map * to const line_map_ordinary *. 3170 * include/cpplib.h (struct cpp_callbacks): Likewise for second 3171 parameter of "file_change" callback. 3172 * include/line-map.h (struct line_map): Convert from a struct 3173 containing a union to a base class. 3174 (struct line_map_ordinary): Convert to a subclass of line_map. 3175 (struct line_map_macro): Likewise. 3176 (linemap_check_ordinary): Strengthen return type from line_map * 3177 to line_map_ordinary *, and add a const-variant. 3178 (linemap_check_macro): New pair of functions. 3179 (ORDINARY_MAP_STARTING_LINE_NUMBER): Strengthen param from 3180 const line_map * to const line_map_ordinary *, eliminating call 3181 to linemap_check_ordinary. Likewise for the non-const variant. 3182 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise. 3183 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise. 3184 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Likewise. 3185 (ORDINARY_MAP_FILE_NAME): Likewise. 3186 (MACRO_MAP_MACRO): Strengthen param from const line_map * to 3187 const line_map_macro *. Likewise for the non-const variant. 3188 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise. 3189 (MACRO_MAP_LOCATIONS): Likewise. 3190 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise. 3191 (struct maps_info): Replace with... 3192 (struct maps_info_ordinary):...this and... 3193 (struct maps_info_macro): ...this. 3194 (struct line_maps): Convert fields "info_ordinary" and 3195 "info_macro" to the above new structs. 3196 (LINEMAPS_MAP_INFO): Delete both functions. 3197 (LINEMAPS_MAPS): Likewise. 3198 (LINEMAPS_ALLOCATED): Rewrite both variants to avoid using 3199 LINEMAPS_MAP_INFO. 3200 (LINEMAPS_USED): Likewise. 3201 (LINEMAPS_CACHE): Likewise. 3202 (LINEMAPS_MAP_AT): Likewise. 3203 (LINEMAPS_ORDINARY_MAPS): Strengthen return type from line_map * 3204 to line_map_ordinary *. 3205 (LINEMAPS_ORDINARY_MAP_AT): Likewise. 3206 (LINEMAPS_LAST_ORDINARY_MAP): Likewise. 3207 (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise. 3208 (LINEMAPS_MACRO_MAPS): Strengthen return type from line_map * to 3209 line_map_macro *. 3210 (LINEMAPS_MACRO_MAP_AT): Likewise. 3211 (LINEMAPS_LAST_MACRO_MAP): Likewise. 3212 (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise. 3213 (linemap_map_get_macro_name): Strengthen param from 3214 const line_map * to const line_map_macro *. 3215 (SOURCE_LINE): Strengthen first param from const line_map * to 3216 const line_map_ordinary *, removing call to 3217 linemap_check_ordinary. 3218 (SOURCE_COLUMN): Likewise. 3219 (LAST_SOURCE_LINE_LOCATION): Likewise. 3220 (LAST_SOURCE_LINE): Strengthen first param from const line_map * 3221 to const line_map_ordinary *. 3222 (LAST_SOURCE_COLUMN): Likewise. 3223 (INCLUDED_FROM): Strengthen return type from line_map * to 3224 line_map_ordinary *., and second param from const line_map * 3225 to const line_map_ordinary *, removing call to 3226 linemap_check_ordinary. 3227 (MAIN_FILE_P): Strengthen param from const line_map * to 3228 const line_map_ordinary *, removing call to 3229 linemap_check_ordinary. 3230 (linemap_position_for_line_and_column): Strengthen param from 3231 const line_map * to const line_map_ordinary *. 3232 (LINEMAP_FILE): Strengthen param from const line_map * to 3233 const line_map_ordinary *, removing call to 3234 linemap_check_ordinary. 3235 (LINEMAP_LINE): Likewise. 3236 (LINEMAP_SYSP): Likewise. 3237 (linemap_resolve_location): Strengthen final param from 3238 const line_map ** to const line_map_ordinary **. 3239 * internal.h (CPP_INCREMENT_LINE): Likewise for local "map". 3240 (linemap_enter_macro): Strengthen return type from 3241 const line_map * to const line_map_macro *. 3242 (linemap_add_macro_token): Likewise for first param. 3243 * line-map.c (linemap_check_files_exited): Strengthen local "map" 3244 from const line_map * to const line_map_ordinary *. 3245 (new_linemap): Introduce local "map_size" and use it when 3246 calculating how large the buffer should be. Rewrite based 3247 on change of info_macro and info_ordinary into distinct types. 3248 (linemap_add): Strengthen locals "map" and "from" from line_map * 3249 to line_map_ordinary *. 3250 (linemap_enter_macro): Strengthen return type from 3251 const line_map * to const line_map_macro *, and local "map" from 3252 line_map * to line_map_macro *. 3253 (linemap_add_macro_token): Strengthen param "map" from 3254 const line_map * to const line_map_macro *. 3255 (linemap_line_start): Strengthen local "map" from line_map * to 3256 line_map_ordinary *. 3257 (linemap_position_for_column): Likewise. 3258 (linemap_position_for_line_and_column): Strengthen first param 3259 from const line_map * to const line_map_ordinary *. 3260 (linemap_position_for_loc_and_offset): Strengthen local "map" from 3261 const line_map * to const line_map_ordinary *. 3262 (linemap_ordinary_map_lookup): Likewise for return type and locals 3263 "cached" and "result". 3264 (linemap_macro_map_lookup): Strengthen return type and locals 3265 "cached" and "result" from const line_map * to 3266 const line_map_macro *. 3267 (linemap_macro_map_loc_to_exp_point): Likewise for param "map". 3268 (linemap_macro_map_loc_to_def_point): Likewise. 3269 (linemap_macro_map_loc_unwind_toward_spelling): Likewise. 3270 (linemap_get_expansion_line): Strengthen local "map" from 3271 const line_map * to const line_map_ordinary *. 3272 (linemap_get_expansion_filename): Likewise. 3273 (linemap_map_get_macro_name): Strengthen param from 3274 const line_map * to const line_map_macro *. 3275 (linemap_location_in_system_header_p): Add call to 3276 linemap_check_ordinary in region guarded by 3277 !linemap_macro_expansion_map_p. Introduce local "macro_map" via 3278 linemap_check_macro in other region, using it in place of "map" 3279 for typesafety. 3280 (first_map_in_common_1): Add calls to linemap_check_macro. 3281 (trace_include): Strengthen param "map" from const line_map * to 3282 const line_map_ordinary *. 3283 (linemap_macro_loc_to_spelling_point): Strengthen final param from 3284 const line_map ** to const line_map_ordinary **. Replace a 3285 C-style cast with a const_cast, and add calls to 3286 linemap_check_macro and linemap_check_ordinary. 3287 (linemap_macro_loc_to_def_point): Likewise. 3288 (linemap_macro_loc_to_exp_point): Likewise. 3289 (linemap_resolve_location): Strengthen final param from 3290 const line_map ** to const line_map_ordinary **. 3291 (linemap_unwind_toward_expansion): Introduce local "macro_map" via 3292 a checked cast and use it in place of *map. 3293 (linemap_unwind_to_first_non_reserved_loc): Strengthen local 3294 "map1" from const line_map * to const line_map_ordinary *. 3295 (linemap_expand_location): Introduce local "ord_map" via a checked 3296 cast and use it in place of map. 3297 (linemap_dump): Make local "map" const. Strengthen local 3298 "includer_map" from line_map * to const line_map_ordinary *. 3299 Introduce locals "ord_map" and "macro_map" via checked casts and 3300 use them in place of "map" for typesafety. 3301 (linemap_dump_location): Strengthen local "map" from 3302 const line_map * to const line_map_ordinary *. 3303 (linemap_get_file_highest_location): Update for elimination of 3304 union. 3305 (linemap_get_statistics): Strengthen local "cur_map" from 3306 line_map * to const line_map_macro *. Update uses of sizeof to 3307 use the appropriate line_map subclasses. 3308 * macro.c (_cpp_warn_if_unused_macro): Add call to 3309 linemap_check_ordinary. 3310 (builtin_macro): Strengthen local "map" from const line_map * to 3311 const line_map_macro *. 3312 (enter_macro_context): Likewise. 3313 (replace_args): Likewise. 3314 (tokens_buff_put_token_to): Likewise for param "map". 3315 (tokens_buff_add_token): Likewise. 3316 33172015-05-13 David Malcolm <dmalcolm@redhat.com> 3318 3319 * include/line-map.h (source_location): Add a reference to 3320 location-example.txt to the descriptive comment. 3321 * location-example.txt: New file. 3322 33232015-05-13 David Malcolm <dmalcolm@redhat.com> 3324 3325 * include/line-map.h (MAX_SOURCE_LOCATION): Convert from a macro 3326 to a const source_location. 3327 (RESERVED_LOCATION_COUNT): Likewise. 3328 (linemap_check_ordinary): Convert from a macro to a pair of inline 3329 functions, for const/non-const arguments. 3330 (MAP_START_LOCATION): Likewise. 3331 (ORDINARY_MAP_STARTING_LINE_NUMBER): Likewise. 3332 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise. 3333 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise. 3334 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Convert from a macro to a 3335 pair of inline functions, for const/non-const arguments, where the 3336 latter is named... 3337 (SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): New function. 3338 (ORDINARY_MAP_FILE_NAME): Convert from a macro to a pair of inline 3339 functions, for const/non-const arguments. 3340 (MACRO_MAP_MACRO): Likewise. 3341 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise. 3342 (MACRO_MAP_LOCATIONS): Likewise. 3343 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise. 3344 (LINEMAPS_MAP_INFO): Likewise. 3345 (LINEMAPS_MAPS): Likewise. 3346 (LINEMAPS_ALLOCATED): Likewise. 3347 (LINEMAPS_USED): Likewise. 3348 (LINEMAPS_CACHE): Likewise. 3349 (LINEMAPS_ORDINARY_CACHE): Likewise. 3350 (LINEMAPS_MACRO_CACHE): Likewise. 3351 (LINEMAPS_MAP_AT): Convert from a macro to an inline function. 3352 (LINEMAPS_LAST_MAP): Likewise. 3353 (LINEMAPS_LAST_ALLOCATED_MAP): Likewise. 3354 (LINEMAPS_ORDINARY_MAPS): Likewise. 3355 (LINEMAPS_ORDINARY_MAP_AT): Likewise. 3356 (LINEMAPS_ORDINARY_ALLOCATED): Likewise. 3357 (LINEMAPS_ORDINARY_USED): Likewise. 3358 (LINEMAPS_LAST_ORDINARY_MAP): Likewise. 3359 (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise. 3360 (LINEMAPS_MACRO_MAPS): Likewise. 3361 (LINEMAPS_MACRO_MAP_AT): Likewise. 3362 (LINEMAPS_MACRO_ALLOCATED): Likewise. 3363 (LINEMAPS_MACRO_USED): Likewise. 3364 (LINEMAPS_MACRO_LOWEST_LOCATION): Likewise. 3365 (LINEMAPS_LAST_MACRO_MAP): Likewise. 3366 (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise. 3367 (IS_ADHOC_LOC): Likewise. 3368 (COMBINE_LOCATION_DATA): Likewise. 3369 (SOURCE_LINE): Likewise. 3370 (SOURCE_COLUMN): Likewise. 3371 (LAST_SOURCE_LINE_LOCATION): Likewise. 3372 (LAST_SOURCE_LINE): Likewise. 3373 (LAST_SOURCE_COLUMN): Likewise. 3374 (LAST_SOURCE_LINE_LOCATION) 3375 (INCLUDED_FROM): Likewise. 3376 (MAIN_FILE_P): Likewise. 3377 (LINEMAP_FILE): Likewise. 3378 (LINEMAP_LINE): Likewise. 3379 (LINEMAP_SYSP): Likewise. 3380 (linemap_location_before_p): Likewise. 3381 * line-map.c (linemap_check_files_exited): Make local "map" const. 3382 (linemap_add): Use SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS. 3383 (linemap_line_start): Likewise. 3384 33852015-05-13 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com> 3386 3387 * aclocal.m4: Regenerated with automake-1.11.6. 3388 33892015-05-13 David Malcolm <dmalcolm@redhat.com> 3390 3391 * include/line-map.h (linemap_assert): Move up within the file to 3392 before all of the map accessor macros. 3393 (linemap_assert_fails): Likewise. 3394 (linemap_check_ordinary): Likewise. 3395 (linemap_macro_expansion_map_p): Likewise. 3396 33972015-05-12 David Malcolm <dmalcolm@redhat.com> 3398 3399 * directives.c (do_line): Set seen_line_directive on line_table. 3400 (do_linemarker): Likewise. 3401 * include/line-map.h (struct line_maps): Add new field 3402 "seen_line_directive". 3403 34042015-05-08 Jason Merrill <jason@redhat.com> 3405 3406 * include/cpplib.h: Add CPP_W_CXX11_COMPAT. 3407 (struct cpp_options): Add cpp_warn_cxx11_compat. 3408 * init.c (cpp_create_reader): Initialize it. 3409 * lex.c (lex_string): Add -Wc++11-compat warning. 3410 34112015-05-05 David Malcolm <dmalcolm@redhat.com> 3412 3413 * pch.c (cpp_valid_state): Fix indentation so that it reflects the 3414 block structure. 3415 34162015-05-05 David Malcolm <dmalcolm@redhat.com> 3417 3418 * include/line-map.h: Fix comment at the top of the file. 3419 (source_location): Rewrite and expand the comment for this 3420 typedef, adding an ascii-art table to clarify how source_location 3421 values are allocated. 3422 * line-map.c: Fix comment at the top of the file. 3423 34242015-04-09 Richard Biener <rguenther@suse.de> 3425 3426 PR pch/65550 3427 * files.c (pch_open_file): Allow main and pre-included files 3428 when trying to open a PCH. 3429 34302015-04-06 Jakub Jelinek <jakub@redhat.com> 3431 3432 PR preprocessor/61977 3433 * lex.c (cpp_peek_token): If peektok is CPP_EOF, back it up 3434 with all tokens peeked by the current function. 3435 34362015-04-02 Jakub Jelinek <jakub@redhat.com> 3437 3438 PR preprocessor/61977 3439 * lex.c (cpp_peek_token): Temporarily clear pfile->cb.line_change. 3440 34412015-03-23 Jakub Jelinek <jakub@redhat.com> 3442 3443 PR preprocessor/65238 3444 * internal.h (_cpp_scan_out_logical_line): Add third argument. 3445 * directives.c (prepare_directive_trad): Pass false to it. 3446 * traditional.c (_cpp_read_logical_line_trad, 3447 _cpp_create_trad_definition): Likewise. 3448 (struct fun_macro): Add paramc field. 3449 (fun_like_macro): New function. 3450 (maybe_start_funlike): Handle NODE_BUILTIN macros. Initialize 3451 macro->paramc field. 3452 (save_argument): Use macro->paramc instead of 3453 macro->node->value.macro->paramc. 3454 (push_replacement_text): Formatting fix. 3455 (recursive_macro): Use fun_like_macro helper. 3456 (_cpp_scan_out_logical_line): Likewise. Add BUILTIN_MACRO_ARG 3457 argument. Initialize fmacro.paramc field. Handle builtin 3458 function-like macros. 3459 34602015-03-16 Edward Smith-Rowland <3dw4rd@verizon.net> 3461 3462 PR c++/64626 3463 * lex.c (lex_number): If a number ends with digit-seps (') skip back 3464 and let lex_string take them. 3465 34662015-03-02 Markus Trippelsdorf <markus@trippelsdorf.de> 3467 3468 PR target/65261 3469 * lex.c (search_line_fast): Silence ubsan errors. 3470 34712015-02-03 <dodji@redhat.com> 3472 3473 PR preprocessor/64803 3474 * internal.h (cpp_reader::top_most_macro_node): New data member. 3475 * macro.c (enter_macro_context): Pass the location of the end of 3476 the top-most invocation of the function-like macro, or the 3477 location of the expansion point of the top-most object-like macro. 3478 (cpp_get_token_1): Store the top-most macro node in the new 3479 pfile->top_most_macro_node data member. 3480 (_cpp_pop_context): Clear the new cpp_reader::top_most_macro_node 3481 data member. 3482 34832015-01-30 Szabolcs Nagy <szabolcs.nagy@arm.com> 3484 3485 * lex.c (search_line_fast): Change __ARM_NEON__ to __ARM_NEON. 3486 34872015-01-23 Marek Polacek <polacek@redhat.com> 3488 3489 DR#412 3490 PR preprocessor/60570 3491 * directives.c (do_elif): Don't evaluate #elif conditionals 3492 when they don't need to be. 3493 34942015-01-16 Jakub Jelinek <jakub@redhat.com> 3495 3496 * expr.c (cpp_classify_number): Add N_() around ?: string 3497 literals used in cpp_error_with_line call as format string. 3498 34992015-01-05 Jakub Jelinek <jakub@redhat.com> 3500 3501 Update copyright years. 3502 35032014-12-19 Jakub Jelinek <jakub@redhat.com> 3504 3505 PR preprocessor/63831 3506 * directives.c (lex_macro_node): Remove __has_attribute__ handling. 3507 * internal.h (struct spec_node): Remove n__has_attribute__ field. 3508 (struct lexer_state): Remove in__has_attribute__ field. 3509 * macro.c (_cpp_builtin_macro_text): Handle BT_HAS_ATTRIBUTE. 3510 * identifiers.c (_cpp_init_hashtable): Remove __has_attribute__ 3511 handling. 3512 * init.c (builtin_array): Add __has_attribute and __has_cpp_attribute. 3513 (cpp_init_special_builtins): Don't initialize __has_attribute 3514 or __has_cpp_attribute if CLK_ASM or pfile->cb.has_attribute is NULL. 3515 * traditional.c (enum ls): Remove ls_has_attribute, 3516 ls_has_attribute_close. 3517 (_cpp_scan_out_logical_line): Remove __has_attribute__ handling. 3518 * include/cpplib.h (enum cpp_builtin_type): Add BT_HAS_ATTRIBUTE. 3519 * pch.c (cpp_read_state): Remove __has_attribute__ handling. 3520 * expr.c (eval_token): Likewise. 3521 (parse_has_attribute): Removed. 3522 35232014-12-11 Uros Bizjak <ubizjak@gmail.com> 3524 3525 * directives.c (cpp_define_formatted): Use xvasprintf. 3526 35272014-12-05 Manuel L��pez-Ib����ez <manu@gcc.gnu.org> 3528 3529 * line-map.c (linemap_position_for_loc_and_offset): Add new 3530 linemap_assert_fails. 3531 35322014-12-02 Manuel L��pez-Ib����ez <manu@gcc.gnu.org> 3533 3534 * include/line-map.h (linemap_assert_fails): Declare. 3535 * line-map.c (linemap_position_for_loc_and_offset): Use it. 3536 35372014-12-02 Manuel L��pez-Ib����ez <manu@gcc.gnu.org> 3538 3539 * line-map.c (linemap_add): Fix typo. 3540 (linemap_line_start): Fix whitespace. 3541 35422014-11-29 John Schmerge <jbschmerge@gmail.com> 3543 3544 PR preprocessor/41698 3545 * charset.c (one_utf8_to_utf16): Do not produce surrogate pairs 3546 for 0xffff. 3547 35482014-11-25 Jakub Jelinek <jakub@redhat.com> 3549 3550 PR preprocessor/60436 3551 * line-map.c (linemap_line_start): If highest is above 0x60000000 3552 and we are still tracking columns or highest is above 0x70000000, 3553 force add_map. 3554 35552014-11-20 Uros Bizjak <ubizjak@gmail.com> 3556 3557 PR target/63966 3558 * lex.c [__i386__ || __x86_64__]: Compile special SSE functions 3559 only for (__GNUC__ >= 5 || !defined(__PIC__)). 3560 35612014-11-13 Manuel L��pez-Ib����ez <manu@gcc.gnu.org> 3562 3563 * include/line-map.h: Include EXPR, so that unused variable warnings 3564 do not occur. 3565 35662014-11-11 Manuel L��pez-Ib����ez <manu@gcc.gnu.org> 3567 3568 PR fortran/44054 3569 * include/line-map.h (linemap_position_for_loc_and_offset): 3570 Declare. 3571 * line-map.c (linemap_position_for_loc_and_offset): New. 3572 35732014-11-11 David Malcolm <dmalcolm@redhat.com> 3574 3575 * ChangeLog.jit: New. 3576 35772014-11-10 Edward Smith-Rowland <3dw4rd@verizon.net> 3578 3579 * include/cpplib.h (cpp_callbacks): Add has_attribute. 3580 * internal.h (lexer_state): Add in__has_attribute__. 3581 * directives.c (lex_macro_node): Prevent use of __has_attribute__ 3582 as a macro. 3583 * expr.c (parse_has_attribute): New function; (eval_token): Look for 3584 __has_attribute__ and route to parse_has_attribute. 3585 * identifiers.c (_cpp_init_hashtable): Initialize n__has_attribute__. 3586 * pch.c (cpp_read_state): Initialize n__has_attribute__. 3587 * traditional.c (enum ls): Add ls_has_attribute, ls_has_attribute_close; 3588 (_cpp_scan_out_logical_line): Attend to __has_attribute__. 3589 35902014-11-06 Joseph Myers <joseph@codesourcery.com> 3591 3592 * include/cpp-id-data.h (struct cpp_macro): Update comment 3593 regarding parameters. 3594 * include/cpplib.h (struct cpp_macro_arg, struct cpp_identifier): 3595 Add spelling fields. 3596 (struct cpp_token): Update comment on macro_arg. 3597 * internal.h (_cpp_save_parameter): Add extra argument. 3598 (_cpp_spell_ident_ucns): New declaration. 3599 * lex.c (lex_identifier): Add SPELLING argument. Set *SPELLING to 3600 original spelling of identifier. 3601 (_cpp_lex_direct): Update calls to lex_identifier. 3602 (_cpp_spell_ident_ucns): New function, factored out of 3603 cpp_spell_token. 3604 (cpp_spell_token): Adjust FORSTRING argument semantics to return 3605 original spelling of identifiers. Use _cpp_spell_ident_ucns in 3606 !FORSTRING case. 3607 (_cpp_equiv_tokens): Check spellings of identifiers and macro 3608 arguments are identical. 3609 * macro.c (macro_arg_saved_data): New structure. 3610 (paste_tokens): Use original spellings of identifiers from 3611 cpp_spell_token. 3612 (_cpp_save_parameter): Add argument SPELLING. Save both canonical 3613 node and its value. 3614 (parse_params): Update calls to _cpp_save_parameter. 3615 (lex_expansion_token): Save spelling of macro argument tokens. 3616 (_cpp_create_definition): Extract canonical node from saved data. 3617 (cpp_macro_definition): Use UCNs in spelling of macro name. Use 3618 original spellings of macro argument tokens and identifiers. 3619 * traditional.c (scan_parameters): Update call to 3620 _cpp_save_parameter. 3621 36222014-11-05 Joseph Myers <joseph@codesourcery.com> 3623 3624 PR preprocessor/9449 3625 * init.c (lang_defaults): Enable extended identifiers for C++ and 3626 C99-based standards. 3627 36282014-10-22 Alan Modra <amodra@gmail.com> 3629 3630 * symtab.c (ht_create): Use obstack_specify_allocation in place of 3631 _obstack_begin. 3632 * files.c (_cpp_init_files): Likewise. 3633 * init.c (cpp_create_reader): Likewise. 3634 * identifiers.c (_cpp_init_hashtable): Likewise. 3635 36362014-10-14 Manuel L��pez-Ib����ez <manu@gcc.gnu.org> 3637 3638 * include/line-map.h (linemap_location_from_macro_expansion_p): 3639 const struct line_maps * argument. 3640 (linemap_position_for_line_and_column): const struct line_map * 3641 argument. 3642 * line-map.c (linemap_add_macro_token): Use correct argument name 3643 in comment. 3644 (linemap_position_for_line_and_column): const struct line_map * 3645 argument. 3646 (linemap_macro_map_loc_to_def_point): Fix comment. Make static. 3647 (linemap_location_from_macro_expansion_p): const struct line_maps * 3648 argument. 3649 (linemap_resolve_location): Fix argument names in comment. 3650 36512014-10-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> 3652 3653 * lex.c (search_line_fast): Add new version to be used for Power8 3654 and later targets when Altivec is enabled. Restrict the existing 3655 Altivec version to big-endian systems so that lvsr is not used on 3656 little endian, where it is deprecated. Remove LE-specific code 3657 from the now-BE-only version. 3658 36592014-10-02 Bernd Edlinger <bernd.edlinger@hotmail.de> 3660 Jeff Law <law@redhat.com> 3661 3662 * charset.c (convert_no_conversion): Reallocate memory with 25% 3663 headroom. 3664 36652014-10-01 Edward Smith-Rowland <3dw4rd@verizon.net> 3666 3667 Implement SD-6: SG10 Feature Test Recommendations 3668 * internal.h (lexer_state, spec_nodes): Add in__has_include__. 3669 * directives.c: Support __has_include__ builtin. 3670 * expr.c (parse_has_include): New function to parse __has_include__ 3671 builtin; (eval_token()): Use it. 3672 * files.c (_cpp_has_header()): New funtion to look for header; 3673 (open_file_failed()): Not an error to not find a header file for 3674 __has_include__. 3675 * identifiers.c (_cpp_init_hashtable()): Add entry for __has_include__. 3676 * pch.c (cpp_read_state): Lookup __has_include__. 3677 * traditional.c (enum ls, _cpp_scan_out_logical_line()): Walk through 3678 __has_include__ statements. 3679 36802014-09-30 Bernd Edlinger <bernd.edlinger@hotmail.de> 3681 3682 PR preprocessor/58893 3683 * errors.c (cpp_diagnostic): Fix possible out of bounds access. 3684 * files.c (_cpp_stack_include): Initialize src_loc for IT_CMDLINE. 3685 36862014-09-24 Marek Polacek <polacek@redhat.com> 3687 3688 PR c/61405 3689 PR c/53874 3690 * include/cpplib.h (enum cpp_ttype): Define CPP_KEYWORD. 3691 36922014-09-17 Jan Hubicka <hubicka@ucw.cz> 3693 3694 * charset.c (conversion): Rename to ... 3695 (cpp_conversion): ... this one; update. 3696 * files.c (file_hash_entry): Rename to ... 3697 (cpp_file_hash_entry): ... this one ; update. 3698 36992014-09-17 Marek Polacek <polacek@redhat.com> 3700 3701 PR c/61854 3702 * init.c (struct lang_flags): Remove cplusplus_comments. 3703 (cpp_set_lang): Likewise. 3704 (post_options): Likewise. 3705 * lex.c (_cpp_lex_direct): Disallow C++ style comments in C90/C94. 3706 37072014-09-09 Manuel L��pez-Ib����ez <manu@gcc.gnu.org> 3708 3709 * include/cpplib.h (struct cpp_options): Declare warn_normalize as 3710 int instead of enum. 3711 37122014-09-04 Manuel L��pez-Ib����ez <manu@gcc.gnu.org> 3713 3714 * macro.c (replace_args): Use cpp_pedwarning, cpp_warning and 3715 CPP_W flags. 3716 * include/cpplib.h: Add CPP_W_C90_C99_COMPAT and CPP_W_PEDANTIC. 3717 * init.c (cpp_create_reader): Do not init to -1 here. 3718 * expr.c (num_binary_op): Use cpp_pedwarning. 3719 37202014-08-29 Manuel L��pez-Ib����ez <manu@gcc.gnu.org> 3721 3722 * directives.c (check_eol_1): New. 3723 (check_eol_endif_labels): New. 3724 (check_eol): Call check_eol_1. 3725 (do_else,do_endif): Call check_eol_endif_labels. 3726 37272014-08-29 Manuel L��pez-Ib����ez <manu@gcc.gnu.org> 3728 3729 * macro.c (warn_of_redefinition): Suppress warnings for builtins 3730 that lack the NODE_WARN flag, unless Wbuiltin-macro-redefined. 3731 (_cpp_create_definition): Use Wbuiltin-macro-redefined for 3732 builtins that lack the NODE_WARN flag. 3733 * directives.c (do_undef): Likewise. 3734 * init.c (cpp_init_special_builtins): Do not change flags 3735 depending on Wbuiltin-macro-redefined. 3736 37372014-08-28 Edward Smith-Rowland <3dw4rd@verizon.net> 3738 3739 PR cpp/23827 - standard C++ should not have hex float preprocessor 3740 tokens 3741 * libcpp/init.c (lang_flags): Change CXX98 flag for extended numbers 3742 from 1 to 0. 3743 * libcpp/expr.c (cpp_classify_number): Weite error message for improper 3744 use of hex floating literal. 3745 37462014-08-23 Edward Smith-Rowland <3dw4rd@verizon.net> 3747 3748 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Z, CLK_CXX1Z; 3749 Rename CLK_GNUCXX1Y, CLK_CXX1Y to CLK_GNUCXX14, CLK_CXX14; 3750 * init.c (struct lang_flags lang_defaults): Add column for trigraphs; 3751 Add rows for CLK_GNUCXX1Z, CLK_CXX1Z; (cpp_set_lang): Set trigraphs; 3752 (cpp_init_builtins): Set __cplusplus to 201402L for C++14; 3753 Set __cplusplus to 201500L for C++17. 3754 * expr.c (cpp_classify_number): Change C++1y to C++14 in binary 3755 constants error message. 3756 37572014-08-20 Marek Polacek <polacek@redhat.com> 3758 3759 * include/cpplib.h (cpp_options): Use signed char. 3760 * lex.c (_cpp_lex_direct): Don't warn in C++ mode. 3761 37622014-08-19 Marek Polacek <polacek@redhat.com> 3763 3764 * lex.c (_cpp_lex_direct): Fix a typo. 3765 37662014-08-19 Marek Polacek <polacek@redhat.com> 3767 3768 * charset.c (_cpp_valid_ucn): Warn only if -Wc90-c99-compat. 3769 * lex.c (_cpp_lex_direct): Likewise. 3770 * macro.c (replace_args): Likewise. 3771 (parse_params): Likewise. 3772 * include/cpplib.h (cpp_options): Change cpp_warn_c90_c99_compat 3773 to char. 3774 37752014-08-10 Marek Polacek <polacek@redhat.com> 3776 3777 PR c/51849 3778 * lex.c (_cpp_lex_direct): Warn when -Wc90-c99-compat is in effect. 3779 * charset.c (_cpp_valid_ucn): Likewise. 3780 * include/cpplib.h (cpp_options): Add cpp_warn_c90_c99_compat. 3781 * macro.c (replace_args): Warn when -Wc90-c99-compat is in effect. 3782 (parse_params): Likewise. 3783 37842014-07-27 Marek Polacek <polacek@redhat.com> 3785 3786 PR c/61861 3787 * macro.c (builtin_macro): Add location parameter. Set 3788 location of builtin macro to the expansion point. 3789 (enter_macro_context): Pass location to builtin_macro. 3790 37912014-07-16 Dodji Seketeli <dodji@redhat.com> 3792 3793 Support location tracking for built-in macro tokens 3794 * include/line-map.h (line_maps::builtin_location): New data 3795 member. 3796 (line_map_init): Add a new parameter to initialize the new 3797 line_maps::builtin_location data member. 3798 * line-map.c (linemap_init): Initialize the 3799 line_maps::builtin_location data member. 3800 * macro.c (builtin_macro): Create a macro map and track the token 3801 resulting from the expansion of a built-in macro. 3802 38032014-07-10 Edward Smith-Rowland <3dw4rd@verizon.net> 3804 Jonathan Wakely <jwakely@redhat.com> 3805 3806 PR preprocessor/61389 3807 * macro.c (_cpp_arguments_ok, parse_params, create_iso_definition): 3808 Warning messages mention C++11 in c++ mode and C99 in c mode. 3809 * lex.c (lex_identifier_intern, lex_identifier): Ditto 3810 38112014-07-09 Edward Smith-Rowland <3dw4rd@verizon.net> 3812 3813 PR c++/58155 - -Wliteral-suffix warns about tokens which are skipped 3814 by preprocessor 3815 * lex.c (lex_raw_string ()): Do not warn about invalid suffix 3816 if skipping. (lex_string ()): Ditto. 3817 38182014-06-04 Edward Smith-Rowland <3dw4rd@verizon.net> 3819 3820 PR c++/61038 3821 * macro.c (stringify_arg (cpp_reader *, macro_arg *)): 3822 Combine user-defined escape logic with the other string and char logic. 3823 38242014-05-26 Richard Biener <rguenther@suse.de> 3825 3826 * configure.ac: Remove long long and __int64 type checks, 3827 add check for uint64_t and fail if that wasn't found. 3828 * include/cpplib.h (cpp_num_part): Use uint64_t. 3829 * config.in: Regenerate. 3830 * configure: Likewise. 3831 38322014-05-21 Marek Polacek <polacek@redhat.com> 3833 3834 PR c/61212 3835 * files.c (find_file_in_dir): Add parens around &&. 3836 38372014-05-20 Edward Smith-Rowland <3dw4rd@verizon.net> 3838 3839 PR c++/61038 3840 * macro.c (stringify_arg (cpp_reader *, macro_arg *)): 3841 Check for user-defined literal strings and user-defined literal chars 3842 to escape necessary characters. 3843 38442014-05-20 Richard Biener <rguenther@suse.de> 3845 3846 * configure.ac: Copy gcc logic of detecting a 64bit type. 3847 Remove HOST_WIDE_INT define. 3848 * include/cpplib.h: typedef cpp_num_part to a 64bit type, 3849 similar to how hwint.h does it. 3850 * config.in: Regenerate. 3851 * configure: Likewise. 3852 38532014-05-09 Joey Ye <joey.ye@arm.com> 3854 3855 * files.c (find_file_in_dir): Always try to shorten for DOS 3856 non-system headers. 3857 * init.c (ENABLE_CANONICAL_SYSTEM_HEADERS): Default enabled for DOS. 3858 38592014-05-07 Richard Biener <rguenther@suse.de> 3860 3861 * configure.ac: Always set need_64bit_hwint to yes. 3862 * configure: Regenerated. 3863 38642014-04-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> 3865 3866 * lex.c: Remove Solaris 9 reference. 3867 38682014-02-24 Walter Lee <walt@tilera.com> 3869 3870 * configure.ac: Change "tilepro" triplet to "tilepro*". 3871 * configure: Regenerate. 3872 38732014-02-19 Jakub Jelinek <jakub@redhat.com> 3874 3875 PR preprocessor/58844 3876 * macro.c (enter_macro_context): Only push 3877 macro_real_token_count (macro) tokens rather than 3878 macro->count tokens, regardless of 3879 CPP_OPTION (pfile, track-macro-expansion). 3880 38812014-02-07 Jakub Jelinek <jakub@redhat.com> 3882 3883 PR preprocessor/56824 3884 * line-map.c (get_combined_adhoc_loc, linemap_get_expansion_line, 3885 linemap_get_expansion_filename, linemap_location_in_system_header_p, 3886 linemap_location_from_macro_expansion_p, 3887 linemap_macro_loc_to_spelling_point, linemap_macro_loc_to_def_point, 3888 linemap_macro_loc_to_exp_point, linemap_expand_location): Fix 3889 formatting. 3890 (linemap_compare_locations): Look through adhoc locations for both 3891 l0 and l1. 3892 38932014-01-23 Dodji Seketeli <dodji@redhat.com> 3894 3895 PR PR preprocessor/58580 3896 * include/line-map.h (linemap_get_file_highest_location): Declare 3897 new function. 3898 * line-map.c (linemap_get_file_highest_location): Define it. 3899 39002014-01-02 Richard Sandiford <rdsandiford@googlemail.com> 3901 3902 Update copyright years 3903 39042013-12-09 Joseph Myers <joseph@codesourcery.com> 3905 3906 PR preprocessor/55715 3907 * expr.c (num_binary_op): Implement subtraction directly rather 3908 than with negation and falling through into addition case. 3909 39102013-11-18 Bill Schmidt <wschmidt@linux.vnet.ibm.com> 3911 3912 * lex.c (search_line_fast): Correct for little endian. 3913 39142013-11-15 Joseph Myers <joseph@codesourcery.com> 3915 3916 * ucnid.tab: Add C11 and C11NOSTART data. 3917 * makeucnid.c (digit): Rename enum value to N99. 3918 (C11, N11, all_languages): New enum values. 3919 (NUM_CODE_POINTS, MAX_CODE_POINT): New macros. 3920 (flags, decomp, combining_value): Use NUM_CODE_POINTS as array 3921 size. 3922 (decomp): Use unsigned int as element type. 3923 (all_decomp): New array. 3924 (read_ucnid): Handle C11 and C11NOSTART. Use MAX_CODE_POINT. 3925 (read_table): Use MAX_CODE_POINT. Store all decompositions in 3926 all_decomp. 3927 (read_derived): Use MAX_CODE_POINT. 3928 (write_table): Use NUM_CODE_POINTS. Print N99, C11 and N11 3929 flags. Print whole array variable declaration rather than just 3930 array contents. 3931 (char_id_valid, write_context_switch): New functions. 3932 (main): Call write_context_switch. 3933 * ucnid.h: Regenerate. 3934 * include/cpplib.h (struct cpp_options): Add c11_identifiers. 3935 * init.c (struct lang_flags): Add c11_identifiers. 3936 (cpp_set_lang): Set c11_identifiers option from selected language. 3937 * internal.h (struct normalize_state): Document "previous" as 3938 previous starter character. 3939 (NORMALIZE_STATE_UPDATE_IDNUM): Take character as argument. 3940 * charset.c (DIG): Rename enum value to N99. 3941 (C11, N11): New enum values. 3942 (struct ucnrange): Give name to struct. Use short for flags and 3943 unsigned int for end of range. Include ucnid.h for whole variable 3944 declaration. 3945 (ucn_valid_in_identifier): Allow for characters up to 0x10FFFF. 3946 Allow for C11 in determining valid characters and valid start 3947 characters. Use check_nfc for non-Hangul context-dependent 3948 checks. Only store starter characters in nst->previous. 3949 (_cpp_valid_ucn): Pass new argument to 3950 NORMALIZE_STATE_UPDATE_IDNUM. 3951 * lex.c (lex_identifier): Pass new argument to 3952 NORMALIZE_STATE_UPDATE_IDNUM. Call NORMALIZE_STATE_UPDATE_IDNUM 3953 after initial non-UCN part of identifier. 3954 (lex_number): Pass new argument to NORMALIZE_STATE_UPDATE_IDNUM. 3955 39562013-11-15 Joseph Myers <joseph@codesourcery.com> 3957 3958 * ucnid.tab: Mark C99 digits as [C99DIG]. 3959 * makeucnid.c (read_ucnid): Handle [C99DIG]. 3960 (read_table): Don't check for digit characters. 3961 * ucnid.h: Regenerate. 3962 39632013-11-06 Tobias Burnus <burnus@net-b.de> 3964 3965 * macro.c (_cpp_builtin_macro_text): Correct 3966 wording of two warnings. 3967 39682013-11-05 Tobias Burnus <burnus@net-b.de> 3969 3970 * include/cpplib.h (CPP_W_DATE_TIME): Added. 3971 (cpp_options): Add warn_date_time. 3972 * init.c (cpp_create_reader): Init it. 3973 * macro.c (_cpp_builtin_macro_text): Warn when 3974 __DATE__/__TIME__/__TIMESTAMP__ is used. 3975 39762013-10-31 Edward Smith-Rowland <3dw4rd@verizon.net> 3977 3978 Implement C++14 digit separators. 3979 * include/cpplib.h (cpp_options): Add digit_separators flag. 3980 * internal.h (DIGIT_SEP(c)): New macro. 3981 * expr.c (cpp_classify_number): Check improper placement of digit sep; 3982 (cpp_interpret_integer): Skip over digit separators. 3983 * init.c (lang_flags): Add digit_separators flag; (lang_defaults): Add 3984 digit separator flags per language; (cpp_set_lang): Set 3985 digit_separators 3986 * lex.c (lex_number): Add digits separator to allowable characters for 3987 C++14. 3988 39892013-10-15 David Malcolm <dmalcolm@redhat.com> 3990 3991 * Makefile.in (PICFLAG): New. 3992 (ALL_CFLAGS): Add PICFLAG. 3993 (ALL_CXXFLAGS): Likewise. 3994 * configure.ac: Add --enable-host-shared, setting up new 3995 PICFLAG variable. 3996 * configure: Regenerate. 3997 39982013-08-07 Richard Earnshaw <rearnsha@arm.com> 3999 4000 * configure.ac: Set need_64bit_hwint for all arm targets. 4001 * configure: Regenerated. 4002 40032013-07-20 Jakub Jelinek <jakub@redhat.com> 4004 4005 PR preprocessor/57620 4006 * lex.c (lex_raw_string): Undo phase1 and phase2 transformations 4007 between R" and final " rather than only in between R"del( and )del". 4008 40092013-07-10 Jakub Jelinek <jakub@redhat.com> 4010 4011 PR preprocessor/57824 4012 * lex.c (lex_raw_string): Allow reading new-lines if 4013 in_deferred_pragma or if parsing_args and there is still 4014 data in the current buffer. 4015 4016 * include/cpplib.h (cpp_token_val_index): Change parameter type to 4017 const cpp_token *. 4018 * lex.c (cpp_token_val_index): Likewise. 4019 4020 PR preprocessor/57757 4021 * lex.c (cpp_avoid_paste): Avoid pasting CPP_{,W,UTF8}STRING 4022 or CPP_STRING{16,32} with CPP_NAME or SPELL_LITERAL token that 4023 starts if a-zA-Z_. 4024 40252013-06-28 Ed Smith-Rowland <3dw4rd@verizon.net> 4026 4027 * lex.c (lex_raw_string(), lex_string()): Constrain suffixes treated 4028 as concatenated literal and macro to just the patterns found in 4029 inttypes.h; (is_macro()): New. 4030 40312013-06-24 Dehao Chen <dehao@google.com> 4032 4033 * files.c (_cpp_stack_include): Fix the highest_location when header 4034 file is guarded by #ifndef and is included twice. 4035 40362013-04-28 Jakub Jelinek <jakub@redhat.com> 4037 4038 N3472 binary constants 4039 * include/cpplib.h (struct cpp_options): Fix a typo in user_literals 4040 field comment. Add binary_constants field. 4041 * init.c (struct lang_flags): Add binary_constants field. 4042 (lang_defaults): Add bin_cst column to the table. 4043 (cpp_set_lang): Initialize CPP_OPTION (pfile, binary_constants). 4044 * expr.c (cpp_classify_number): Talk about C++11 instead of C++0x 4045 in diagnostics. Accept binary constants if 4046 CPP_OPTION (pfile, binary_constants) even when pedantic. Adjust 4047 pedwarn message. 4048 40492013-04-24 Paolo Carlini <paolo.carlini@oracle.com> 4050 4051 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Y and CLK_CXX1Y. 4052 * init.c (lang_defaults): Add defaults for the latter. 4053 (cpp_init_builtins): Define __cplusplus as 201300L for the latter. 4054 * lex.c (_cpp_lex_direct): Update. 4055 40562013-04-03 Sebastian Huber <sebastian.huber@embedded-brains.de> 4057 4058 PR target/56771 4059 * configure.ac: Require 64-bit int for arm*-*-rtems*. 4060 * configure: Regenerate. 4061 40622013-03-06 Jakub Jelinek <jakub@redhat.com> 4063 4064 PR middle-end/56461 4065 * internal.h (struct cpp_buffer): Add to_free field. 4066 (_cpp_pop_file_buffer): Add third argument. 4067 * files.c (_cpp_stack_file): Set buffer->to_free. 4068 (_cpp_pop_file_buffer): Add to_free argument. Free to_free 4069 if non-NULL, and if equal to file->buffer_start, also clear 4070 file->buffer{,_start,_valid}. 4071 * directives.c (_cpp_pop_buffer): Pass buffer->to_free 4072 to _cpp_pop_file_buffer. 4073 40742013-03-01 Jakub Jelinek <jakub@redhat.com> 4075 4076 PR middle-end/56461 4077 * files.c (_cpp_save_file_entries): Free result at the end. 4078 * pch.c (cpp_string_free): New function. 4079 (cpp_save_state): Use it in htab_create call. 4080 (cpp_write_pch_deps): Free ss->defs. Destroy ss->definedhash. 4081 40822013-02-28 Jakub Jelinek <jakub@redhat.com> 4083 4084 * files.c (_cpp_find_file): If returning early, before storing 4085 something to *hash_slot and *hash_slot is NULL, call htab_clear_slot 4086 on it. Access *hash_slot using void * type rather than 4087 struct file_hash_entry * to avoid aliasing issues. 4088 4089 * configure.ac: Don't define ENABLE_CHECKING whenever 4090 --enable-checking is seen, instead use similar --enable-checking=yes 4091 vs. --enable-checking=release default as gcc/ subdir has and 4092 define ENABLE_CHECKING if ENABLE_CHECKING is defined in gcc/. 4093 Define ENABLE_VALGRIND_CHECKING if requested. 4094 * lex.c (new_buff): If ENABLE_VALGRIND_CHECKING, put _cpp_buff 4095 struct first in the allocated buffer and result->base after it. 4096 (_cpp_free_buff): If ENABLE_VALGRIND_CHECKING, free buff itself 4097 instead of buff->base. 4098 * config.in: Regenerated. 4099 * configure: Regenerated. 4100 41012013-02-13 Ed Smith-Rowland <3dw4rd@verizon.net> 4102 4103 PR c++/55582 4104 * lex.c (lex_raw_string): Allow string literal with suffix 4105 beginning with 's' to be parsed as a C++11 user-defined literal. 4106 41072013-01-14 Richard Sandiford <rdsandiford@googlemail.com> 4108 4109 Update copyright years. 4110 41112013-01-04 Paolo Carlini <paolo.carlini@oracle.com> 4112 4113 PR c++/54526 (again) 4114 * lex.c (_cpp_lex_direct): In C++11 mode, implement 2.5 p3, bullet 2. 4115 41162013-01-03 Marc Glisse <marc.glisse@inria.fr> 4117 4118 PR bootstrap/50177 4119 * line-map.c (get_combined_adhoc_loc): Cast from extern "C" type. 4120 (new_linemap): Likewise. 4121 (linemap_enter_macro): Likewise. 4122 41232012-12-03 Jakub Jelinek <jakub@redhat.com> 4124 4125 PR bootstrap/55380 4126 PR other/54691 4127 * files.c (read_file_guts): Allocate extra 16 bytes instead of 4128 1 byte at the end of buf. Pass size + 16 instead of size 4129 to _cpp_convert_input. 4130 * charset.c (_cpp_convert_input): Reallocate if there aren't 4131 at least 16 bytes beyond to.len in the buffer. Clear 16 bytes 4132 at to.text + to.len. 4133 41342012-11-21 Steve Ellcey <sellcey@mips.com> 4135 4136 PR pch/55399 4137 * files.c (pch_open_file): Fix check for implicit_preinclude. 4138 41392012-11-16 Simon Baldwin <simonb@google.com> 4140 4141 * include/cpplib.h (struct cpp_options): Add canonical_system_headers. 4142 * files.c (find_file_in_dir): Call maybe_shorter_path() only if 4143 canonical_system_headers is set. 4144 * init.c (cpp_create_reader): Initialize canonical_system_headers. 4145 * configure.ac: Add new --enable-canonical-system-headers. 4146 * configure: Regenerate. 4147 * config.in: Regenerate. 4148 41492012-11-09 Ed Smith-Rowland <3dw4rd@verizon.net> 4150 4151 PR c++/54413 4152 * include/cpplib.h (cpp_interpret_float_suffix): Add cpp_reader* arg. 4153 (cpp_interpret_int_suffix): Add cpp_reader* arg. 4154 * init.c (cpp_create_reader): Iitialize new flags. 4155 * expr.c (interpret_float_suffix): Use new flags. 4156 (cpp_interpret_float_suffix): Add cpp_reader* arg. 4157 (interpret_int_suffix): Use new flags. 4158 (cpp_interpret_int_suffix): Add cpp_reader* arg. 4159 (cpp_classify_number): Adjust calls to interpret_x_suffix. 4160 41612012-10-23 Ian Bolton <ian.bolton@arm.com> 4162 Jim MacArthur <jim.macarthur@arm.com> 4163 Marcus Shawcroft <marcus.shawcroft@arm.com> 4164 Nigel Stephens <nigel.stephens@arm.com> 4165 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com> 4166 Richard Earnshaw <rearnsha@arm.com> 4167 Sofiane Naci <sofiane.naci@arm.com> 4168 Stephen Thomas <stephen.thomas@arm.com> 4169 Tejas Belagod <tejas.belagod@arm.com> 4170 Yufeng Zhang <yufeng.zhang@arm.com> 4171 4172 * configure.ac: Enable AArch64. 4173 * configure: Regenerate. 4174 41752012-10-23 Joseph Myers <joseph@codesourcery.com> 4176 4177 * files.c (struct _cpp_file): Add implicit_preinclude. 4178 (pch_open_file): Allow a previously opened implicitly included 4179 file. 4180 (_cpp_find_file): Add implicit_preinclude argument. Free file and 4181 do not call open_file_failed if implicit_preinclude. Store 4182 implicit_preinclude value. 4183 (_cpp_stack_include, _cpp_fake_include, _cpp_compare_file_date): 4184 Update calls to _cpp_find_file. 4185 (_cpp_stack_include): Handle IT_DEFAULT. 4186 (cpp_push_default_include): New. 4187 * include/cpplib.h (cpp_push_default_include): Declare. 4188 * init.c (cpp_read_main_file): Update call to _cpp_find_file. 4189 * internal.h (enum include_type): Add IT_DEFAULT. 4190 (_cpp_find_file): Update prototype. 4191 41922012-10-15 Tobias Burnus <burnus@net-b.de> 4193 4194 * files.c (read_file_guts, _cpp_save_file_entries): Free memory 4195 before returning. 4196 * lex.c (warn_about_normalization): Ditto. 4197 * mkdeps.c (deps_save): Ditto. 4198 * pch.c (cpp_valid_state): Ditto. 4199 42002012-10-04 Florian Weimer <fweimer@redhat.com> 4201 4202 * directives.c (do_pragma_warning_or_error): New. 4203 (do_pragma_warning): New. 4204 (do_pragma_error): New. 4205 (_cpp_init_internal_pragmas): Register new pragmas. 4206 42072012-09-25 Dehao Chen <dehao@google.com> 4208 4209 PR middle-end/54704 4210 * line-map.c (location_adhoc_data_hash): Fix the hash function. 4211 42122012-09-25 Dehao Chen <dehao@google.com> 4213 4214 PR middle-end/54645 4215 * include/line-map.h (location_adhoc_data): Move location_adhoc_data 4216 into GC. 4217 (location_adhoc_data_map): Likewise. 4218 (line_maps): Likewise. 4219 (rebuild_location_adhoc_htab): New Function. 4220 * line-map.c (+rebuild_location_adhoc_htab): new Funcion. 4221 (get_combined_adhoc_loc): Move location_adhoc_data into GC. 4222 (location_adhoc_data_fini): Likewise. 4223 (linemap_init): Likewise. 4224 (location_adhoc_data_init): Remove Function. 4225 42262012-09-19 Dehao Chen <dehao@google.com> 4227 4228 * include/line-map.h (MAX_SOURCE_LOCATION): New value. 4229 (location_adhoc_data_fini): New. 4230 (get_combined_adhoc_loc): New. 4231 (get_data_from_adhoc_loc): New. 4232 (get_location_from_adhoc_loc): New. 4233 (location_adhoc_data_map): New. 4234 (COMBINE_LOCATION_DATA): New. 4235 (IS_ADHOC_LOC): New. 4236 (expanded_location): New field. 4237 (line_maps): New field. 4238 * line-map.c (location_adhoc_data): New. 4239 (location_adhoc_data_hash): New. 4240 (location_adhoc_data_eq): New. 4241 (location_adhoc_data_update): New. 4242 (get_combined_adhoc_loc): New. 4243 (get_data_from_adhoc_loc): New. 4244 (get_location_from_adhoc_loc): New. 4245 (location_adhoc_data_init): New. 4246 (location_adhoc_data_fini): New. 4247 (linemap_init): Initialize location_adhoc_data. 4248 (linemap_lookup): Change to use new location. 4249 (linemap_ordinary_map_lookup): Likewise. 4250 (linemap_macro_map_lookup): Likewise. 4251 (linemap_macro_map_loc_to_def_point): Likewise. 4252 (linemap_macro_map_loc_unwind_toward_spel): Likewise. 4253 (linemap_get_expansion_line): Likewise. 4254 (linemap_get_expansion_filename): Likewise. 4255 (linemap_location_in_system_header_p): Likewise. 4256 (linemap_location_from_macro_expansion_p): Likewise. 4257 (linemap_macro_loc_to_spelling_point): Likewise. 4258 (linemap_macro_loc_to_def_point): Likewise. 4259 (linemap_macro_loc_to_exp_point): Likewise. 4260 (linemap_resolve_location): Likewise. 4261 (linemap_unwind_toward_expansion): Likewise. 4262 (linemap_unwind_to_first_non_reserved_loc): Likewise. 4263 (linemap_expand_location): Likewise. 4264 (linemap_dump_location): Likewise. 4265 (linemap_line_start): Likewise. 4266 42672012-05-25 Dodji Seketeli <dodji@redhat.com> 4268 4269 PR preprocessor/53469 4270 * directives.c (do_pragma): Use the virtual location for the 4271 pragma token, instead of its spelling location. 4272 42732012-08-14 Diego Novillo <dnovillo@google.com> 4274 4275 Merge from cxx-conversion branch. Configury. 4276 4277 * Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX. 4278 * configure.ac: Likewise. 4279 * configure: Regenerate. 4280 42812012-08-14 Lawrence Crowl <crowl@google.com> 4282 4283 Merge from cxx-conversion branch. New C++ hash table. 4284 4285 * include/symtab.h (typedef struct ht hash_table): Change the typedef 4286 name to cpp_hash_table. Update all users of the typedef. 4287 42882012-07-30 Laurynas Biveinis <laurynas.biveinis@gmail.com> 4289 4290 * include/line-map.h (line_map_macro): Use the "atomic" GTY option 4291 for the macro_locations field. 4292 42932011-06-19 Uros Bizjak <ubizjak@gmail.com> 4294 4295 * lex.c (search_line_sse42): Use __builtin_ia32_loaddqu and 4296 __builtin_ia32_pcmpestri128 instead of asm. 4297 42982012-06-04 Dimitrios Apostolou <jimis@gmx.net> 4299 4300 * line-map.c (linemap_enter_macro): Don't zero max_column_hint in 4301 every macro. This improves performance by reducing the number of 4302 reallocations when track-macro-expansion is on. 4303 43042012-06-04 Dodji Seketeli <dodji@redhat.com> 4305 4306 PR preprocessor/53463 4307 * line-map.c (linemap_location_in_system_header_p): For built-in 4308 macro tokens, check the first expansion point location that is not 4309 for a token coming from a built-in macro. 4310 43112012-05-29 Joseph Myers <joseph@codesourcery.com> 4312 4313 * directives.c: Fix typos. 4314 * include/line-map.h: Fix typos. 4315 * line-map.c: Fix typos. 4316 * macro.c: Fix typos. 4317 43182012-05-25 Dodji Seketeli <dodji@redhat.com> 4319 4320 PR bootstrap/53459 4321 * lex.c (search_line_fast): Avoid unused local typedefs to simulate 4322 a static assertion. 4323 43242012-05-29 Dodji Seketeli <dodji@redhat.com> 4325 4326 PR preprocessor/53229 4327 * internal.h (cpp_reader::set_invocation_location): Remove. 4328 (cpp_reader::about_to_expand_macro_p): New member flag. 4329 * directives.c (do_pragma): Remove Kludge as 4330 pfile->set_invocation_location is no more. 4331 * macro.c (cpp_get_token_1): Do away with the use of 4332 cpp_reader::set_invocation_location. Just collect the macro 4333 expansion point when we are about to expand the top-most macro. 4334 Do not override cpp_reader::about_to_expand_macro_p. 4335 This fixes gcc.dg/cpp/paste12.c by making get_token_no_padding 4336 properly handle locations of expansion points. 4337 (cpp_get_token_with_location): Adjust, as 4338 cpp_reader::set_invocation_location is no more. 4339 (paste_tokens): Take a virtual location parameter for 4340 the LHS of the pasting operator. Use it in diagnostics. Update 4341 comments. 4342 (paste_all_tokens): Tighten the assert. Propagate the location of 4343 the expansion point when no virtual locations are available. 4344 Pass the virtual location to paste_tokens. 4345 (in_macro_expansion_p): New static function. 4346 (enter_macro_context): Set the cpp_reader::about_to_expand_macro_p 4347 flag until we really start expanding the macro. 4348 43492012-05-16 Dodji Seketeli <dodji@redhat.com> 4350 4351 PR preprocessor/7263 4352 * include/cpplib.h (cpp_classify_number): Take a location 4353 parameter. 4354 * expr.c (SYNTAX_ERROR_AT, SYNTAX_ERROR2_AT): New diagnostic 4355 macros that take a location parameter. 4356 (cpp_classify_number): Take a (virtual) location parameter. Use 4357 it for diagnostics. Adjust comments. 4358 (eval_token): Take a location parameter. Pass it to 4359 cpp_classify_number and to diagnostic routines. 4360 (_cpp_parse_expr): Use virtual locations of tokens when parsing 4361 expressions. Pass a virtual location to eval_token and to 4362 diagnostic routines. 4363 43642012-05-10 Tristan Gingold <gingold@adacore.com> 4365 4366 * expr.c (interpret_float_suffix): Add a guard. 4367 43682012-05-02 Dodji Seketeli <dodji@redhat.com> 4369 4370 Properly initialize cpp_context in destringize_and_run 4371 * directives.c (destringize_and_run): Properly initialize the new 4372 context. 4373 * macro.c (_cpp_pop_context): Assert that we shouldn't try to pop 4374 the initial base context, which has the same life time as the 4375 current instance of cpp_file. 4376 43772012-04-30 Manuel L��pez-Ib����ez <manu@gcc.gnu.org> 4378 Dodji Seketeli <dodji@seketeli.org> 4379 4380 PR c++/52974 4381 * libcpp/files.c (maybe_shorter_path): New. 4382 (find_file_in_dir): Use it. 4383 43842012-04-30 Dodji Seketeli <dodji@redhat.com> 4385 4386 Switch -ftrack-macro-expansion=2 on by default. 4387 * init.c (cpp_create_reader): Switch -ftrack-macro-expansion=2 on 4388 by default. Add comments. 4389 4390 Strip "<built-in>" loc from displayed expansion context 4391 * include/line-map.h (linemap_unwind_toward_expansion): Fix typo 4392 in comment. 4393 (linemap_unwind_to_first_non_reserved_loc): Declare new function. 4394 * line-map.c (linemap_unwind_to_first_non_reserved_loc): Define 4395 new function. 4396 4397 Fix expansion point loc for macro-like tokens 4398 * macro.c (macro_of_context): New static function. 4399 (_cpp_push_token_context, push_extended_tokens_context): If the 4400 macro argument is NULL, it means we are continuing the expansion 4401 of the current macro, if any. Update comments. 4402 (_cpp_pop_context): Re-enable expansion of the macro only when we 4403 are really out of the context of the current expansion. 4404 4405 Fix token pasting with -ftrack-macro-expansion 4406 * macro.c (paste_all_tokens): Put the token resulting from pasting 4407 into an extended token context with -ftrack-macro-location is in 4408 effect. 4409 4410 Fix cpp_sys_macro_p with -ftrack-macro-expansion 4411 * macro.c (cpp_sys_macro_p): Support -ftrack-macro-expansion. 4412 44132012-04-29 Dodji Seketeli <dodji@redhat.com> 4414 4415 * lex.c (lex_raw_string): Change C++ style comments into C style 4416 comments. 4417 (lex_string): Likewise. 4418 44192012-04-27 Ollie Wild <aaw@google.com> 4420 4421 * include/cpplib.h (struct cpp_options): Add new field, 4422 warn_literal_suffix. 4423 (CPP_W_LITERAL_SUFFIX): New enum. 4424 * init.c (cpp_create_reader): Default initialization of 4425 warn_literal_suffix. 4426 * lex.c (lex_raw_string): Treat user-defined literals which don't 4427 begin with '_' as separate tokens and produce a warning. 4428 (lex_string): Ditto. 4429 44302012-04-26 Manuel L��pez-Ib����ez <manu@gcc.gnu.org> 4431 4432 * line-map.c (linemap_resolve_location): Synchronize comments with 4433 those in line-map.h. 4434 * include/line-map.h (linemap_resolve_location): Fix spelling in 4435 comment. 4436 44372012-03-22 Richard Earnshaw <rearnsha@arm.com> 4438 4439 * lex.c (search_line_fast): Provide Neon-optimized version for ARM. 4440 44412012-03-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> 4442 4443 * lex.c: Remove Solaris 8 reference. 4444 44452012-02-14 Walter Lee <walt@tilera.com> 4446 4447 * configure.ac: Require 64-bit hwint for tilegx and tilepro. 4448 * configure: Regenerate. 4449 44502012-01-09 Richard Guenther <rguenther@suse.de> 4451 4452 * macro.c (_cpp_builtin_macro_text): Remove unused variable map. 4453 44542012-01-09 Gary Funck <gary@intrepid.com> 4455 4456 PR preprocessor/33919 4457 * files.c (_cpp_get_file_name): New. Implement file name 4458 access function. 4459 * internal.h (_cpp_get_file_name): New prototype. 4460 * macro.c (_cpp_builtin_macro_text): Call _cpp_get_file_name() 4461 to use pfile->main_file in lieu of traversing INCLUDED_FROM chain. 4462 44632012-01-03 Olivier Hainque <hainque@adacore.com> 4464 4465 * system.h: Prior to #define, #undef fopen and freopen unconditionally. 4466 44672011-12-20 Joseph Myers <joseph@codesourcery.com> 4468 4469 * include/cpplib.h (CLK_GNUC1X): Change to CLK_GNUC11. 4470 (CLK_STDC1X): Change to CLK_STDC11. 4471 * init.c (lang_defaults): Update comments. 4472 (cpp_init_builtins): Update language tests. Use 201112L for C11 4473 __STDC_VERSION__. 4474 44752011-12-20 Andreas Schwab <schwab@linux-m68k.org> 4476 4477 * configure: Regenerate. 4478 44792011-12-19 Andreas Schwab <schwab@linux-m68k.org> 4480 4481 * configure: Regenerate. 4482 44832011-12-07 Jakub Jelinek <jakub@redhat.com> 4484 4485 PR bootstrap/50237 4486 * internal.h (_cpp_init_lexer): New prototype. 4487 * init.c (init_library): Call it. 4488 * lex.c (init_vectorized_lexer): Remove constructor attribute, 4489 add inline keyword. 4490 (HAVE_init_vectorized_lexer): Define. 4491 (_cpp_init_lexer): New function. 4492 44932011-12-03 Dodji Seketeli <dodji@redhat.com> 4494 4495 * macro.c (tokens_buff_remove_last_token) 4496 (tokens_buff_put_token_to): Add an 'inline' function specifier to 4497 the prototype. 4498 44992011-11-22 Diego Novillo <dnovillo@google.com> 4500 4501 * include/line-map.h (linemap_dump): Declare. 4502 (line_table_dump): Declare. 4503 * line-map.c (linemap_dump): New. 4504 (line_table_dump): New. 4505 45062011-11-21 Ed Smith-Rowland <3dw4rd@verizon.net> 4507 4508 PR c++/50958 4509 * expr.c (cpp_userdef_char_remove_type): Fix typo. 4510 45112011-11-03 Michael Matz <matz@suse.de> 4512 4513 PR bootstrap/50857 4514 * configure.ac: Check for -fno-exceptions -fno-rtti. 4515 * configure: Regenerate. 4516 * Makefile.in (NOEXCEPTION_FLAGS): New flag. 4517 (ALL_CXXFLAGS): Use it. 4518 45192011-11-02 Paolo Carlini <paolo.carlini@oracle.com> 4520 4521 * internal.h (uxstrdup, ustrchr): Return const unsigned char *. 4522 45232011-11-02 Jason Merrill <jason@redhat.com> 4524 4525 PR c++/50810 4526 * configure.ac: Add -Wno-narrowing to warning options. 4527 45282011-10-31 Jason Merrill <jason@redhat.com> 4529 4530 PR libstdc++/1773 4531 * init.c (cpp_init_builtins): Set __cplusplus for C++11. 4532 4533 PR c++/50920 4534 * include/cpplib.h (enum c_lang): Rename CLK_CXX0X to CLK_CXX11, 4535 CLK_GNUCXX0X to CLK_GNUCXX11. 4536 45372011-10-26 Ed Smith-Rowland <3dw4rd@verizon.net> 4538 4539 Implement C++11 user-defined literals. 4540 * expr.c: (cpp_interpret_float_suffix, cpp_interpret_int_suffix, 4541 cpp_userdef_string_remove_type, cpp_userdef_string_add_type, 4542 cpp_userdef_char_remove_type, cpp_userdef_char_add_type, 4543 cpp_userdef_string_p, cpp_userdef_char_p, cpp_get_userdef_suffix): New. 4544 (cpp_classify_number): Classify unrecognized tokens as user-defined 4545 literals. 4546 * include/cpplib.h: Add new tokens for user-defined literals. 4547 * init.c: Add new preprocessor flag (cxx11). 4548 * lex.c: (lex_string, lex_raw_string): Handle user-defined literals 4549 including concatenation and promotion with suffixes. 4550 45512011-10-24 Dodji Seketeli <dodji@redhat.com> 4552 4553 * line-map.c (linemap_macro_map_lookup): Fix logic. 4554 45552011-10-24 Dodji Seketeli <dodji@redhat.com> 4556 4557 * include/line-map.h (linemap_expand_location): Take a line table 4558 parameter. Update comment. 4559 (linemap_resolve_location): Update comment. 4560 (linemap_expand_location_full): Remove. 4561 * line-map.c (linemap_resolve_location): Handle reserved 4562 locations; return a NULL map in those cases. 4563 (linemap_expand_location): If location is reserved, return a 4564 zeroed expanded location. Update comment. Take a line table to 4565 assert that the function takes non-virtual locations only. 4566 (linemap_expand_location_full): remove. 4567 (linemap_dump_location): Handle the fact that 4568 linemap_resolve_location can return NULL line maps when the 4569 location resolves to a reserved location. 4570 4571 * line-map.c (linemap_macro_map_lookup): Fix logic. 4572 45732011-10-22 Dodji Seketeli <dodji@redhat.com> 4574 4575 PR bootstrap/50778 4576 * include/internal.h (_cpp_remaining_tokens_num_in_context): Take the 4577 context to act upon. 4578 * lex.c (_cpp_remaining_tokens_num_in_context): Likewise. Update 4579 comment. 4580 (cpp_token_from_context_at): Likewise. 4581 (cpp_peek_token): Use the context to peek tokens from. 4582 45832011-10-20 Dodji Seketeli <dodji@redhat.com> 4584 4585 PR bootstrap/50801 4586 * lex.c (_cpp_remaining_tokens_num_in_context): Fix computation of 4587 number of tokens. 4588 45892011-10-18 Dodji Seketeli <dodji@redhat.com> 4590 4591 PR bootstrap/50760 4592 * include/line-map.h (struct linemap_stats): Change the type of 4593 the members from size_t to long. 4594 * macro.c (macro_arg_token_iter_init): Unconditionally initialize 4595 iter->location_ptr. 4596 45972011-10-17 Dodji Seketeli <dodji@redhat.com> 4598 4599 * line-map.c (linemap_macro_map_loc_to_exp_point): Avoid setting a 4600 variable without using it if ENABLE_CHECKING is not defined. Mark 4601 the LOCATION parameter as being unused. 4602 46032011-10-15 Tom Tromey <tromey@redhat.com> 4604 Dodji Seketeli <dodji@redhat.com> 4605 4606 * include/line-map.h (struct line_maps::alloced_size_for_request): 4607 New member. 4608 * line-map.c (new_linemap): Use set->alloced_size_for_request to 4609 get the actual allocated size of line maps. 4610 46112011-10-15 Tom Tromey <tromey@redhat.com> 4612 Dodji Seketeli <dodji@redhat.com> 4613 4614 * line-map.h (struct linemap_stats): Declare new struct. 4615 (linemap_get_statistics): Declare ... 4616 * line-map.c (linemap_get_statistics): ... new function. 4617 * macro.c (num_expanded_macros_counter, num_macro_tokens_counter): 4618 Declare new counters. 4619 (enter_macro_context, replace_args): Update 4620 num_macro_tokens_counter. 4621 (cpp_get_token_1): Update num_expanded_macros_counter. 4622 46232011-10-15 Tom Tromey <tromey@redhat.com> 4624 Dodji Seketeli <dodji@redhat.com> 4625 4626 * include/cpplib.h (struct cpp_options)<debug>: New struct member. 4627 * include/line-map.h (linemap_dump_location): Declare ... 4628 * line-map.c (linemap_dump_location): ... new function. 4629 46302011-10-15 Tom Tromey <tromey@redhat.com> 4631 Dodji Seketeli <dodji@redhat.com> 4632 4633 * include/cpplib.h (struct cpp_options)<track_macro_expansion>: 4634 New option. 4635 * internal.h (struct macro_context): New struct. 4636 (enum context_tokens_kind): New enum. 4637 (struct cpp_context)<tokens_kind>: New member of type enum 4638 context_tokens_kind. 4639 (struct cpp_context)<macro>: Remove this. Replace it with an enum 4640 of macro and macro_context. 4641 (struct cpp_context)<direct_p>: Remove. 4642 (_cpp_remaining_tokens_num_in_context): Declare new function. 4643 * directives.c (destringize_and_run): Adjust. 4644 * lex.c (_cpp_remaining_tokens_num_in_context) 4645 (_cpp_token_from_context_at): Define new functions 4646 (cpp_peek_token): Use them. 4647 * init.c (cpp_create_reader): Initialize the base context to zero. 4648 (_cpp_token_from_context_at): Define new static function. 4649 (cpp_peek_token): Use new _cpp_remaining_tokens_num_in_context and 4650 _cpp_token_from_context_at. 4651 * macro.c (struct macro_arg)<virt_locs, expanded_virt_locs>: New 4652 members. 4653 (enum macro_arg_token_kind): New enum. 4654 (struct macro_arg_token_iter): New struct. 4655 (maybe_adjust_loc_for_trad_cpp, push_extended_tokens_context) 4656 (alloc_expanded_arg_mem, ensure_expanded_arg_room) 4657 (delete_macro_args, set_arg_token, get_arg_token_location) 4658 (arg_token_ptr_at, macro_arg_token_iter_init) 4659 (macro_arg_token_iter_get_token) 4660 (macro_arg_token_iter_get_location, macro_arg_token_iter_forward) 4661 (expanded_token_index, tokens_buff_new, tokens_buff_count) 4662 (tokens_buff_last_token_ptr, tokens_buff_put_token_to) 4663 (tokens_buff_add_token, tokens_buff_remove_last_token) 4664 (reached_end_of_context, consume_next_token_from_context): New 4665 static functions. 4666 (cpp_get_token_1): New static function. Split and extended from 4667 cpp_get_token. Use reached_end_of_context and 4668 consume_next_token_from_context. Unify its return point. Move 4669 the location tweaking from cpp_get_token_with_location in here. 4670 (cpp_get_token): Use cpp_get_token_1 4671 (stringify_arg): Use the new arg_token_at. 4672 (paste_all_tokens): Support tokens coming from extended tokens 4673 contexts. 4674 (collect_args): Return the number of collected arguments, by 4675 parameter. Store virtual locations of tokens that constitute the 4676 collected args. 4677 (funlike_invocation_p): Return the number of collected arguments, 4678 by parameter. 4679 (enter_macro_context): Add a parameter for macro expansion point. 4680 Pass it to replace_args and to the "used" cpp callback. Get the 4681 number of function-like macro arguments from funlike_invocation_p, 4682 pass it to the new delete_macro_args to free the memory used by 4683 macro args. When -ftrack-macro-expansion is in effect, for macros 4684 that have no arguments, create a macro map for the macro expansion 4685 and use it to allocate proper virtual locations for tokens 4686 resulting from the expansion. Push an extended tokens context 4687 containing the tokens resulting from macro expansion and their 4688 virtual locations. 4689 (replace_args): Rename the different variables named 'count' into 4690 variables with more meaningful names. Create a macro map; 4691 allocate virtual locations of tokens resulting from this 4692 expansion. Use macro_arg_token_iter to iterate over tokens of a 4693 given macro. Handle the case of the argument of 4694 -ftrack-macro-expansion being < 2. Don't free macro arguments 4695 memory resulting from expand_arg here, as these are freed by the 4696 caller of replace_arg using delete_macro_args now. Push extended 4697 token context. 4698 (next_context, push_ptoken_context, _cpp_push_token_context) 4699 (_cpp_push_text_context): Properly initialize the context. 4700 (expand_arg): Use the new alloc_expanded_arg_mem, 4701 push_extended_tokens_context, cpp_get_token_1, and set_arg_token. 4702 (_cpp_pop_context): Really free the memory held by the context. 4703 Handle freeing memory used by extended tokens contexts. 4704 (cpp_get_token_with_location): Use cpp_get_token_1. 4705 (cpp_sys_macro_p): Adjust. 4706 (_cpp_backup_tokens): Support the new kinds of token contexts. 4707 * traditional.c (recursive_macro): Adjust. 4708 47092011-10-15 Tom Tromey <tromey@redhat> 4710 Dodji Seketeli <dodji@redhat.com> 4711 4712 * include/line-map.h (enum lc_reason)<LC_ENTER_MACRO>: New enum 4713 member. 4714 (MAX_SOURCE_LOCATION): New constant. 4715 (struct line_map_ordinary, struct line_map_macro): New structs. 4716 (struct line_map): Turn this into a union of the two above. Add 4717 comments. 4718 (struct maps_info): New struct. 4719 (struct line_maps)<info_ordinary, info_macro>: Two new fields. 4720 These now carry the map information that was previously scattered 4721 in struct line_maps. 4722 (struct map_info::allocated): Fix comment. 4723 (MAP_START_LOCATION, ORDINARY_MAP_FILE_NAME) 4724 (ORDINARY_MAP_STARTING_LINE_NUMBER) 4725 (ORDINARY_MAP_INCLUDER_FILE_INDEX) 4726 (ORDINARY_MAP_IN_SYSTEM_HEADER_P) 4727 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS, MACRO_MAP_MACRO) 4728 (MACRO_MAP_NUM_MACRO_TOKENS MACRO_MAP_LOCATIONS) 4729 (MACRO_MAP_EXPANSION_POINT_LOCATION) 4730 (LOCATION_POSSIBLY_IN_MACRO_MAP_P, LINEMAPS_MAP_INFO) 4731 (LINEMAPS_MAPS, LINEMAPS_ALLOCATE, LINEMAPS_USED, LINEMAPS_CACHE) 4732 (LINEMAPS_LAST_MAP, LINEMAPS_LAST_ALLOCATED_MAP) 4733 (LINEMAPS_ORDINARY_MAPS, LINEMAPS_ORDINARY_ALLOCATED) 4734 (LINEMAPS_ORDINARY_USED, LINEMAPS_ORDINARY_CACHE) 4735 (LINEMAPS_LAST_ORDINARY_MAP, LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP) 4736 (LINEMAPS_MACRO_MAPS, LINEMAPS_MACRO_ALLOCATED) 4737 (LINEMAPS_MACRO_USED, LINEMAPS_MACRO_CACHE) 4738 (LINEMAPS_LAST_MACRO_MAP, LINEMAPS_LAST_ALLOCATED_MACRO_MAP) 4739 (LINEMAPS_MAP_AT, LINEMAPS_ORDINARY_MAP_AT) 4740 (LINEMAPS_MACRO_MAP_AT): New accessors for ordinary and macro map 4741 information. 4742 (linemap_check_ordinary, linemap_assert) 4743 (linemap_location_before_p): New macros. 4744 (linemap_position_for_line_and_column) 4745 (linemap_tracks_macro_expansion_locs_p, linemap_add_macro_token) 4746 (linemap_macro_expansion_map_p) 4747 (linemap_macro_map_loc_to_def_point) 4748 (linemap_macro_map_loc_unwind_once) 4749 (linemap_macro_map_loc_to_exp_point, linemap_step_out_once) 4750 (linemap_get_source_line linemap_get_source_column) 4751 (linemap_map_get_macro_name, linemap_get_file_path) 4752 (linemap_location_in_system_header_p) 4753 (linemap_location_from_macro_expansion_p): Declare new functions. 4754 (SOURCE_LINE, SOURCE_COLUMN, LAST_SOURCE_LINE_LOCATION) 4755 (LINEMAP_FILE, LINEMAP_LINE, LINEMAP_SYSP): Assert that this 4756 accessors act on ordinary maps only. 4757 (INCLUDED_FROM): Return NULL for main files; use the new 4758 accessors. 4759 (LINEMAP_POSITION_FOR_COLUMN): Use the new accessors. 4760 (struct expanded_location): Move here from gcc/input.h 4761 (linemap_resolve_location, linemap_expand_location) 4762 (linemap_expand_location_full): Declare new functions. 4763 * line-map.c: Include cpplib.h, internal.h 4764 (linemap_enter_macro, linemap_add_macro_token) 4765 (linemap_get_expansion_line, linemap_get_expansion_filename): New 4766 functions that are private to libcpp. 4767 (linemap_assert): New macro. 4768 (linemap_macro_loc_to_exp_point, linemap_macro_loc_to_exp_point) 4769 (linemap_macro_loc_unwind, linemap_macro_map_loc_to_def_point) 4770 (linemap_macro_map_loc_unwind_toward_spelling) 4771 (linemap_macro_map_loc_to_exp_point) 4772 (first_map_in_common_1, first_map_in_common): New static 4773 functions. 4774 (new_linemap): Define new static functions. Extracted and 4775 enhanced from ... 4776 (linemap_add): ... here. Use linemap_assert in lieu of abort 4777 previously. 4778 (linemap_tracks_macro_expansion_locs_p) 4779 (linemap_add_macro_token, linemap_macro_expansion_map_p) 4780 (linemap_check_ordinary, linemap_macro_map_loc_to_exp_point) 4781 (linemap_macro_map_loc_to_def_point) 4782 (linemap_macro_map_loc_unwind_once) 4783 (linemap_step_out_once, linemap_map_get_index) 4784 (linemap_get_source_line,linemap_get_source_column) 4785 (linemap_get_file_path, linemap_map_get_macro_name) 4786 (linemap_location_in_system_header_p) 4787 (linemap_location_originated_from_system_header_p) 4788 (linemap_location_from_macro_expansion_p) 4789 (linemap_tracks_macro_expansion_locs_p) 4790 (linemap_resolve_location, linemap_expand_location) 4791 (linemap_expand_location_full) 4792 (linemap_tracks_macro_expansion_locs_p) 4793 (linemap_position_for_line_and_column, linemap_compare_locations): 4794 Define new public functions. 4795 (linemap_init): Initialize ordinary and macro maps information in 4796 the map set. 4797 (linemap_check_files_exited): Use the new accessors. 4798 (linemap_free): Remove this dead code. 4799 (linemap_line_start): Assert this uses an ordinary map. Adjust to 4800 use the new ordinary map accessors and data structures. Don't 4801 overflow past the lowest possible macro token's location. 4802 (linemap_position_for_column): Assert the ordinary maps of the map 4803 set are really ordinary. Use ordinary map accessors. 4804 (linemap_lookup): Keep the same logic but generalize to allow 4805 lookup of both ordinary and macro maps. Do not crash when called 4806 with an empty line table. 4807 * directives-only.c (_cpp_preprocess_dir_only): Adjust to use the 4808 new API of line-map.h. 4809 * directives.c (start_directive, do_line, do_linemarker) 4810 (do_linemarker): Likewise. 4811 * files.c (_cpp_find_file, _cpp_stack_include, open_file_failed) 4812 (make_cpp_dir, cpp_make_system_header): Likewise. 4813 * init.c (cpp_read_main_file): Likewise. 4814 * internal.h (CPP_INCREMENT_LINE): Likewise. 4815 (linemap_enter_macro, linemap_add_macro_token) 4816 (linemap_get_expansion_line, linemap_get_expansion_filename): New 4817 functions private to libcpp. 4818 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment) 4819 (skip_line_comment, skip_whitespace, lex_raw_string) 4820 (_cpp_lex_direct): Likewise. 4821 * macro.c (_cpp_builtin_macro_text): Likewise. 4822 (_cpp_aligned_alloc): Initialize the new name member of the macro. 4823 * traditional.c (copy_comment, _cpp_scan_out_logical_line): 4824 Likewise. 4825 * errors.c (cpp_diagnostic): Adjust to new linemap API. 4826 48272011-08-28 Dodji Seketeli <dodji@redhat.com> 4828 4829 * line-map.c (linemap_add): Assert that reason must not be 4830 LC_RENAME when called for the first time on a "main input file". 4831 48322011-08-22 Gabriel Charette <gchare@google.com> 4833 4834 * init.c (cpp_create_reader): Inititalize forced_token_location_p. 4835 * internal.h (struct cpp_reader): Add field forced_token_location_p. 4836 * lex.c (_cpp_lex_direct): Use forced_token_location_p. 4837 (cpp_force_token_locations): New. 4838 (cpp_stop_forcing_token_locations): New. 4839 48402011-08-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> 4841 4842 PR libstdc++/1773 4843 * init.c (cpp_init_builtins): Define __cplusplus 19971L. 4844 48452011-08-18 Joseph Myers <joseph@codesourcery.com> 4846 4847 * include/cpplib.h (struct cpp_options): Fix typo. 4848 48492011-08-18 Joseph Myers <joseph@codesourcery.com> 4850 4851 * include/cpplib.h (struct cpp_options): Add rliterals. 4852 * init.c (struct lang_flags, lang_defaults): Add rliterals. 4853 (cpp_set_lang): Set rliterals option. 4854 (cpp_init_builtins): Define __STDC_UTF_16__ and __STDC_UTF_32__. 4855 * lex.c (_cpp_lex_direct): Only accept raw strings if rliterals. 4856 48572011-08-15 Gabriel Charette <gchare@google.com> 4858 4859 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Remove. 4860 Update all users to use linemap_position_for_column instead. 4861 48622011-07-28 Gabriel Charette <gchare@google.com> 4863 4864 * include/line-map.h (struct line_maps): 4865 Remove unused field last_listed. Update all users. 4866 48672011-07-28 H.J. Lu <hongjiu.lu@intel.com> 4868 4869 * configure.ac: Set need_64bit_hwint to yes for x86 targets. 4870 * configure: Regenerated. 4871 48722011-07-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> 4873 4874 * system.h [__cplusplus]: Wrap C function declarations in extern "C". 4875 48762011-07-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> 4877 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> 4878 4879 PR bootstrap/49794 4880 * configure.ac: Test AM_ICONV with CXX. 4881 * configure: Regenerate. 4882 * system.h (HAVE_DESIGNATED_INITIALIZERS): Never define for C++. 4883 48842011-07-15 Dodji Seketeli <dodji@redhat.com> 4885 4886 * directives.c (struct if_stack): Use source_location as type 4887 here. 4888 * include/cpplib.h (struct cpp_callbacks)<include, define, undef, 4889 indent, def_pragma, used_define, used_undef>: Properly use 4890 source_location as parameter type, rather than unsigned int. 4891 48922011-07-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> 4893 4894 PR target/39150 4895 * configure.ac (host_wide_int): Handle x86_64-*-solaris2.1[0-9] 4896 like i[34567]86-*-solaris2.1[0-9]*. 4897 * configure: Regenerate. 4898 48992011-06-16 Jason Merrill <jason@redhat.com> 4900 4901 PR c++/45399 4902 * lex.c (lex_raw_string): Don't check for embedded NUL. 4903 49042011-06-06 Dodji Seketeli <dodji@redhat.com> 4905 4906 PR preprocessor/48532 4907 * directives.c (do_pragma): Don't forget the invocation location 4908 when parsing the pragma name of a namespaced pragma directive. 4909 49102011-05-29 John Tytgat <John.Tytgat@aaug.net> 4911 4912 * files.c (read_file_guts): Add test on non-zero value of S_ISREG. 4913 49142011-05-22 Uros Bizjak <ubizjak@gmail.com> 4915 4916 PR target/49104 4917 * lex.c (init_vectorized_lexer): Do not set "minimum" when __3dNOW_A__ 4918 is defined. Check bit_MMXEXT and bit_CMOV to use search_line_mmx. 4919 49202011-04-25 Jan Kratochvil <jan.kratochvil@redhat.com> 4921 4922 * system.h (ENUM_BITFIELD): Remove. 4923 49242011-04-24 Jakub Jelinek <jakub@redhat.com> 4925 4926 PR preprocessor/48740 4927 * lex.c (lex_raw_string): When raw string ends with 4928 ??) followed by raw prefix and ", ensure it is preprocessed 4929 with ??) rather than ??]. 4930 49312011-04-20 Jim Meyering <meyering@redhat.com> 4932 4933 * files.c (destroy_cpp_file): Remove useless if-before-free. 4934 * init.c (cpp_destroy): Likewise. 4935 * macro.c (replace_args): Likewise. 4936 * pch.c (cpp_valid_state): Likewise. 4937 49382011-03-25 Kai Tietz <ktietz@redhat.com> 4939 4940 * files.c (file_hash_eq): Use filename_cmp 4941 instead of strcmp. 4942 (nonexistent_file_hash_eq): Likewise. 4943 (remap_filename): Likewise. 4944 Handle absolute DOS-path, 4945 (append_file_to_dir): Check for IS_DIR_SEPARATOR 4946 instead of slash. 4947 (read_name_map): Likewise. 4948 * linemap.c (linemap_add): Use filename_cmp 4949 instead of strcmp. 4950 * mkdeps.c (apply_vpath): Use filename_ncmp 4951 instead of strncmp. 4952 (deps_restore): Use filename_cmp instead of 4953 strcmp. 4954 * init.c (read_original_directory): Use 4955 IS_DIR_SEPARATOR instead of checking for slash. 4956 49572011-03-21 Michael Meissner <meissner@linux.vnet.ibm.com> 4958 4959 PR preprocessor/48192 4960 * directives.c (do_ifdef): Do not consider conditional macros as 4961 being defined. 4962 (do_ifndef): Ditto. 4963 * expr.c (parse_defined): Ditto. 4964 49652011-03-18 Richard Henderson <rth@redhat.com> 4966 4967 PR bootstrap/45381 4968 * lex.c [ALTIVEC] (search_line_fast): Require gcc version 4.5. 4969 49702011-11-04 Eric Botcazou <ebotcazou@adacore.com> 4971 Jakub Jelinek <jakub@redhat.com> 4972 4973 PR preprocessor/39213 4974 * directives.c (end_directive): Call _cpp_remove_overlay for deferred 4975 pragmas as well in traditional mode. 4976 49772010-11-17 Ian Lance Taylor <iant@google.com> 4978 4979 PR bootstrap/45538 4980 * configure.ac: Use AC_USE_SYSTEM_EXTENSIONS. Remove switch of 4981 AC_LANG based on ENABLE_BUILD_WITH_CXX. 4982 49832010-11-16 Kai Tietz <kai.tietz@onevision.com> 4984 4985 PR preprocessor/17349 4986 * lex.c (save_comment): Handle in argument passing c++ 4987 comments special. 4988 49892010-11-02 Ian Lance Taylor <iant@google.com> 4990 4991 * configure.ac: Use AC_SYS_LARGEFILE. 4992 * configure: Rebuild. 4993 * config.in: Rebuild. 4994 49952010-10-19 Basile Starynkevitch <basile@starynkevitch.net> 4996 4997 * line-map.h (source_location): Remove obsolete comment 4998 mentioning location_s. 4999 50002010-09-29 Kai Tietz <kai.tietz@onevision.com> 5001 5002 PR preprocessor/45362 5003 * directives.c (cpp_pop_definition): Make static. 5004 (do_pragma_push_macro): Reworked to store text 5005 definition. 5006 (do_pragma_pop_macro): Add free text definition. 5007 (cpp_push_definition): Removed. 5008 * include/cpplib.h (cpp_push_definition): Removed. 5009 (cpp_pop_definition): Likewise. 5010 * internal.h (def_pragma_macro): Remove member 'value' 5011 and add new members 'definition', 'line', 5012 'syshdr', 'sued' and 'is_undef'. 5013 * pch.c (_cpp_restore_pushed_macros): Rework to work 5014 on text definition and store additional macro flags. 5015 (_cpp_save_pushed_macros): Likewise. 5016 50172010-09-29 Joseph Myers <joseph@codesourcery.com> 5018 5019 * include/cpplib.h (cpp_options): Rename warn_deprecated, 5020 warn_traditional, warn_long_long and pedantic. 5021 * directives.c (directive_diagnostics, _cpp_handle_directive): 5022 Update names of cpp_options members. 5023 * expr.c (cpp_classify_number, eval_token): Update names of 5024 cpp_options members. 5025 * init.c (cpp_create_reader, post_options): Update names of 5026 cpp_options members. 5027 * internal.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Update names of 5028 cpp_options members. 5029 * macro.c (parse_params): Update names of cpp_options members. 5030 50312010-09-15 Ian Lance Taylor <iant@google.com> 5032 5033 * init.c: Fix type name in comment. 5034 50352010-08-31 Jakub Jelinek <jakub@redhat.com> 5036 5037 PR preprocessor/45457 5038 * expr.c (parse_defined): Call pfile->cb.user_builtin_macro hook if 5039 needed. 5040 * directives.c (do_ifdef, do_ifndef): Likewise. 5041 50422010-08-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> 5043 5044 * system.h [HAVE_INTTYPES_H]: Include inttypes.h. 5045 50462010-08-24 Richard Henderson <rth@redhat.com> 5047 5048 PR bootstrap/45376 5049 * configure.ac (HAVE_SSE4): New check. 5050 * configure, config.in: Rebuild. 5051 * lex.c (search_line_sse42): Omit if !HAVE_SSE4. 5052 50532010-08-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> 5054 5055 * lex.c [__sun__ && __svr4__]: Disable init_vectorized_lexer 5056 etc. on Solaris 2/x86. 5057 50582010-08-21 Richard Henderson <rth@redhat.com> 5059 Andi Kleen <ak@linux.intel.com> 5060 David S. Miller <davem@davemloft.net> 5061 5062 * configure.ac (AC_C_BIGENDIAN, AC_TYPE_UINTPTR_T): New tests. 5063 (ssize_t): Check via AC_TYPE_SSIZE_T instead of AC_CHECK_TYPE. 5064 (ptrdiff_t): Check via AC_CHECK_TYPE. 5065 * config.in, configure: Rebuild. 5066 * system.h: Include stdint.h, if available. 5067 * lex.c (WORDS_BIGENDIAN): Provide default. 5068 (acc_char_mask_misalign, acc_char_replicate, acc_char_cmp, 5069 acc_char_index, search_line_acc_char, repl_chars, search_line_mmx, 5070 search_line_sse2, search_line_sse42, init_vectorized_lexer, 5071 search_line_fast): New. 5072 (_cpp_clean_line): Use search_line_fast. Restructure the fast 5073 loop to make it clear when we're leaving the loop. Stay in the 5074 fast loop for non-trigraph '?'. 5075 50762010-06-11 Jakub Jelinek <jakub@redhat.com> 5077 5078 * include/cpplib.h (struct cpp_callbacks): Add user_builtin_macro 5079 callback. 5080 (enum cpp_builtin_type): Add BT_FIRST_USER and BT_LAST_USER. 5081 (cpp_macro_definition): Remove const qual from second argument. 5082 * macro.c (enter_macro_context): Call user_builtin_macro callback for 5083 NODE_BUILTIN !NODE_USED macros. 5084 (warn_of_redefinition): Likewise. Remove const qual from second 5085 argument. 5086 (cpp_macro_definition): Likewise. 5087 * pch.c (write_macdef, save_macros): Call user_builtin_macro callback 5088 for NODE_BUILTIN !NODE_USED macros. 5089 50902010-06-10 Joseph Myers <joseph@codesourcery.com> 5091 5092 * include/cpplib.h (struct cpp_options): Remove show_column. 5093 * init.c (cpp_create_reader, post_options): Don't set show_column. 5094 50952010-06-09 Joern Rennecke <joern.rennecke@embecosm.com> 5096 5097 PR bootstrap/44432 5098 * configure.ac: Before using ZW_PROG_COMPILER_DEPENDENCIES for C++, 5099 check that C++ compiler works. 5100 * configure: Regenerate. 5101 51022010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> 5103 5104 * include/symtab.h (ht_identifier_ptr): New. 5105 51062010-06-03 Joern Rennecke <joern.rennecke@embecosm.com> 5107 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> 5108 5109 PR bootstrap/42798 5110 * configure.ac: Check for declaration of 'basename(char *)'. 5111 * configure: Regenerate. 5112 * config.in: Regenerate. 5113 51142010-04-25 Joseph Myers <joseph@codesourcery.com> 5115 5116 * include/cpplib.h (enum c_lang): Add CLK_GNUC1X and CLK_STDC1X. 5117 * init.c (lang_defaults): Add entries for new language variants. 5118 (cpp_init_builtins): Define __STDC_VERSION__ to 201000L for C1X 5119 variants. 5120 51212010-04-09 Manuel L��pez-Ib����ez <manu@gcc.gnu.org> 5122 5123 PR cpp/43195 5124 * files.c (report_missing_guard): Test for #pragma once. 5125 51262010-04-07 Simon Baldwin <simonb@google.com> 5127 5128 * directives.c (do_diagnostic): Add warning reason argument, 5129 call appropriate error reporting function for code. 5130 (directive_diagnostics): Call specific warning functions with 5131 warning reason where appropriate. 5132 (do_error, do_warning, do_pragma_dependency): Add warning reason 5133 argument to do_diagnostic calls. 5134 * macro.c (_cpp_warn_if_unused_macro, enter_macro_context, 5135 _cpp_create_definition): Call specific warning functions with 5136 warning reason where appropriate. 5137 * Makefile.in: Add new diagnostic functions to gettext translations. 5138 * include/cpplib.h (struct cpp_callbacks): Add warning reason code 5139 to error callback. 5140 (CPP_DL_WARNING, CPP_DL_WARNING_SYSHDR, CPP_DL_PEDWARN, CPP_DL_ERROR, 5141 CPP_DL_ICE, CPP_DL_NOTE, CPP_DL_FATAL): Replace macros with enums. 5142 (CPP_W_NONE, CPP_W_DEPRECATED, CPP_W_COMMENTS, 5143 CPP_W_MISSING_INCLUDE_DIRS, CPP_W_TRIGRAPHS, CPP_W_MULTICHAR, 5144 CPP_W_TRADITIONAL, CPP_W_LONG_LONG, CPP_W_ENDIF_LABELS, 5145 CPP_W_NUM_SIGN_CHANGE, CPP_W_VARIADIC_MACROS, 5146 CPP_W_BUILTIN_MACRO_REDEFINED, CPP_W_DOLLARS, CPP_W_UNDEF, 5147 CPP_W_UNUSED_MACROS, CPP_W_CXX_OPERATOR_NAMES, CPP_W_NORMALIZE, 5148 CPP_W_INVALID_PCH, CPP_W_WARNING_DIRECTIVE): New enums for cpp 5149 warning reason codes. 5150 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr, 5151 cpp_warning_with_line, cpp_pedwarning_with_line, 5152 cpp_warning_with_line_syshdr): New specific error reporting functions. 5153 * pch.c (cpp_valid_state): Call specific warning functions with 5154 warning reason where appropriate. 5155 * errors.c (cpp_diagnostic, cpp_diagnostic_with_line): New central 5156 diagnostic handlers. 5157 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr, 5158 cpp_warning_with_line, cpp_pedwarning_with_line, 5159 cpp_warning_with_line_syshdr): New specific error reporting functions. 5160 * expr.c (cpp_classify_number, eval_token, num_unary_op): Call 5161 specific warning functions with warning reason where appropriate. 5162 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment, 5163 warn_about_normalization, lex_identifier_intern, lex_identifier, 5164 _cpp_lex_direct): Ditto. 5165 * charset.c (_cpp_valid_ucn, convert_hex, convert_escape, 5166 narrow_str_to_charconst): Ditto. 5167 51682010-04-06 Jakub Jelinek <jakub@redhat.com> 5169 5170 PR preprocessor/43642 5171 * lex.c (lex_raw_string): Change type of TYPE variable to 5172 unsigned char. 5173 51742010-04-02 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> 5175 5176 * aclocal.m4: Regenerate. 5177 51782010-03-29 Jason Merrill <jason@redhat.com> 5179 5180 More N3077 raw string changes 5181 * charset.c (cpp_interpret_string): Don't transform UCNs in raw 5182 strings. 5183 * lex.c (bufring_append): Split out from... 5184 (lex_raw_string): ...here. Undo trigraph and line splicing 5185 transformations. Do process line notes in multi-line literals. 5186 (_cpp_process_line_notes): Ignore notes that were already handled. 5187 5188 Some raw string changes from N3077 5189 * charset.c (cpp_interpret_string): Change inner delimiters to (). 5190 * lex.c (lex_raw_string): Likewise. Also disallow '\' in delimiter. 5191 51922010-02-11 Jakub Jelinek <jakub@redhat.com> 5193 5194 * init.c (read_original_filename): Don't call read_original_directory 5195 if _cpp_handle_directive returns 0. 5196 51972010-01-01 Joseph Myers <joseph@codesourcery.com> 5198 5199 PR preprocessor/41947 5200 * expr.c (cpp_classify_number): Give error for hexadecimal 5201 floating-point constant with no digits before or after point. 5202 52032009-11-20 Arnaud Charlet <charlet@adacore.com> 5204 5205 * macro.c (enter_macro_context): Call cb.used callback if defined. 5206 * directives.c (do_idef, do_ifndef): Ditto. 5207 * include/cpplib.h (struct cpp_callbacks): Add used callback. 5208 52092009-11-11 Kai Tietz <kai.tietz@onevision.com> 5210 5211 * directives.c (do_pragma_push_macro): New pragma handler. 5212 (do_pragma_pop_macro): Likewise. 5213 (_cpp_init_internal_pragmas): Add push_macro and 5214 pop_macro handler to internal pragmas. 5215 (lex_macro_node_from_str): Removed. 5216 (cpp_push_definition): Replace lex_macro_node_from_str 5217 by _cpp_lex_identifier. 5218 (cpp_pop_definition): Likewise. 5219 * internal.h (_cpp_lex_identifier): New prototype. 5220 (def_pragma_macro): New structure. 5221 (cpp_reader): New member pushed_macros. 5222 * lex.c (_cpp_lex_identifier): New function. 5223 (lex_identifier_intern): New function. 5224 * init.c (cpp_create_reader): Initialize pushed_macros 5225 member. 5226 (cpp_destroy): Free elements in pushed_macros member. 5227 * pch.c (_cpp_save_pushed_macros): New function. 5228 (_cpp_restore_pushed_macros): Likewise. 5229 (_cpp_restore_pushed_macros): Use _cpp_save_pushed_macros. 5230 (cpp_read_state): Use _cpp_restore_pushed_macros. 5231 52322009-10-19 Jakub Jelinek <jakub@redhat.com> 5233 5234 * charset.c (cpp_init_iconv): Initialize utf8_cset_desc. 5235 (_cpp_destroy_iconv): Destroy utf8_cset_desc, char16_cset_desc 5236 and char32_cset_desc. 5237 (converter_for_type): Handle CPP_UTF8STRING. 5238 (cpp_interpret_string): Handle CPP_UTF8STRING and raw-strings. 5239 * directives.c (get__Pragma_string): Handle CPP_UTF8STRING. 5240 (parse_include): Reject raw strings. 5241 * include/cpplib.h (CPP_UTF8STRING): New token type. 5242 * internal.h (struct cpp_reader): Add utf8_cset_desc field. 5243 * lex.c (lex_raw_string): New function. 5244 (lex_string): Handle u8 string literals, call lex_raw_string 5245 for raw string literals. 5246 (_cpp_lex_direct): Call lex_string even for u8" and {,u,U,L,u8}R" 5247 sequences. 5248 * macro.c (stringify_arg): Handle CPP_UTF8STRING. 5249 52502009-10-14 Jakub Jelinek <jakub@redhat.com> 5251 5252 PR preprocessor/41543 5253 * include/line-map.h (RESERVED_LOCATION_COUNT): Define. 5254 * line-map.c (linemap_init): Initialize highest_location and 5255 highest_line to RESERVED_LOCATION_COUNT-1 instead of 0. 5256 52572009-10-09 Jason Merrill <jason@redhat.com> 5258 5259 * charset.c (_cpp_valid_ucn): Update C++0x restrictions. 5260 52612009-10-09 Neil Vachharajani <nvachhar@google.com> 5262 5263 * directives.c (DIRECTIVE_TABLE): Remove DEPRECATED from ident and 5264 sccs. 5265 52662009-09-23 Loren J. Rittle <ljrittle@acm.org> 5267 5268 * configure.ac (AC_CHECK_HEADERS after AC_LANG(C++)): Add sys/stat.h. 5269 * configure: Rebuilt. 5270 52712009-09-22 Richard Guenther <rguenther@suse.de> 5272 5273 PR pch/38987 5274 * files.c (pch_open_file): Disallow non-toplevel PCH inclusion. 5275 52762009-09-18 Chris Demetriou <cgd@google.com> 5277 5278 PR preprocessor/28435: 5279 * include/cpplib.h (struct cpp_options): Add new member 5280 deps.need_preprocessor_output. 5281 * files.c (open_file_failed): If preprocessor output is needed 5282 always report an error. 5283 52842009-09-13 Kai Tietz <kai.tietz@onevision.com> 5285 5286 * configure.ac: Set for i?86-w64-mingw* 5287 need_64bit_hwint to yes. 5288 * configure: Regenerated. 5289 52902009-09-10 Jason Merrill <jason@redhat.com> 5291 5292 * directives.c (cpp_define): constify. 5293 52942009-09-02 Ian Lance Taylor <iant@google.com> 5295 5296 * macro.c (stringify_arg): Escape CPP_WCHAR tokens. 5297 52982009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> 5299 5300 * configure.ac (AC_PREREQ): Bump to 2.64. 5301 53022009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> 5303 5304 * aclocal.m4: Regenerate. 5305 * config.in: Regenerate. 5306 * configure: Regenerate. 5307 53082009-08-17 Tom Tromey <tromey@redhat.com> 5309 5310 PR preprocessor/41067: 5311 * charset.c (convert_escape): Add missing ":" to error text. 5312 53132009-07-27 Douglas B Rupp <rupp@gnat.com> 5314 5315 * include/cpplib.h (INO_T_CPP): New macro. 5316 (struct cpp_dir): Use it. 5317 53182009-07-20 Jerry Quinn <jlquinn@optonline.net> 5319 5320 PR regression/40800 5321 * configure.ac: Use = instead of == for testing 5322 ENABLE_BUILD_WITH_CXX. 5323 * configure: Rebuild. 5324 53252009-07-17 Jerry Quinn <jlquinn@optonline.net> 5326 5327 * directives.c (do_linemarker, do_line): Use CPP_STRING for 5328 ignored enum value. 5329 * files.c (find_file_in_dir): Add cast from void* to char*. 5330 * symtab.c (ht_lookup_with_hash): Add cast from void* to char*. 5331 * Makefile.in: (WARN_CFLAGS): Use general and C-specific 5332 warnings. 5333 (CXX, CXXFLAGS, WARN_CXXFLAGS, ALL_CXXFLAGS, 5334 ENABLE_BUILD_WITH_CXX, CCDEPMODE, CXXDEPMODE, COMPILER, 5335 COMPILER_FLAGS): New. 5336 (DEPMODE): Set from CCDEPMODE or CXXDEPMODE. 5337 (COMPILE.base): Use COMPILER instead of CC. Use COMPILER_FLAGS 5338 instead of ALL_CFLAGS. 5339 * configure.ac: Invoke AC_PROG_CXX. Separate C-specific warnings 5340 from other warnings. Add -Wc++-compat to C-specific warnings. 5341 Check for --enable-build-with-cxx. Set and substitute 5342 ENABLE_BUILD_WITH_CXX. Invoke ZW_PROG_COMPILER_DEPENDENCIES 5343 according to ENABLE_BUILD_WITH_CXX. Invoke AC_LANG before 5344 AC_CHECK_HEADERS. 5345 * configure: Rebuild. 5346 * include/cpp-id-data.h: Remove extern "C". 5347 * include/line-map.h: Likewise. 5348 * include/mkdeps.h: Likewise. 5349 * include/symtab.h: Likewise. 5350 * internal.h: Likewise. 5351 53522009-06-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org> 5353 5354 * directives.c (parse_include): Add location argument. Update all 5355 calls. 5356 (parse_answer): Likewise. 5357 (do_include_common): Error with exact location. 5358 (parse_assertion): Likewise. 5359 53602009-06-18 Manuel L��pez-Ib����ez <manu@gcc.gnu.org> 5361 5362 * expr.c (num_div_op): Take explicit location. 5363 53642009-06-17 Ian Lance Taylor <iant@google.com> 5365 5366 * include/cpplib.h (progname): Don't declare. 5367 53682009-06-12 Ian Lance Taylor <iant@google.com> 5369 5370 * include/cpplib.h (struct cpp_options): Add 5371 warn_cxx_operator_names field. 5372 (NODE_WARN_OPERATOR): Define. 5373 (struct cpp_hashnode): Increase flags field to 10 bits, decrease 5374 type to 6 bits. 5375 * init.c (mark_named_operators): Add flags parameter. 5376 (cpp_post_options): Pick flags value to pass to 5377 mark_named_operators. 5378 * lex.c (lex_identifier): If NODE_WARN_OPERATOR is set, warn that 5379 identifier is an operator name in C++. 5380 53812009-06-01 Aldy Hernandez <aldyh@redhat.com> 5382 5383 * include/line-map.h (LAST_SOURCE_COLUMN): New. 5384 53852009-06-01 Ian Lance Taylor <iant@google.com> 5386 5387 * include/cpp-id-data.h: Add extern "C". 5388 * include/line-map.h: Likewise. 5389 * include/mkdeps.h: Likewise. 5390 * include/symtab.h: Likewise. 5391 * internal.h: Likewise. 5392 53932009-05-15 Ian Lance Taylor <iant@google.com> 5394 5395 * include/cpplib.h (enum cpp_builtin_type): Rename from enum 5396 builtin_type. Change all uses. 5397 53982009-05-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org> 5399 5400 PR cpp/36674 5401 * directives (do_linemarker): Compensate for the increment in 5402 location that occurs when we reach the end of line. 5403 * files (_cpp_stack_include): Mention _cpp_find_file in the 5404 comment. 5405 54062009-05-10 Joseph Myers <joseph@codesourcery.com> 5407 5408 * include/cpplib.h (enum cpp_token_fld_kind): Add 5409 CPP_TOKEN_FLD_TOKEN_NO. 5410 (struct cpp_macro_arg, struct cpp_identifier): Define. 5411 (union cpp_token_u): Use struct cpp_identifier for identifiers. 5412 Use struct cpp_macro_arg for macro arguments. Add token_no for 5413 CPP_PASTE token numbers. 5414 * directives.c (_cpp_handle_directive, lex_macro_node, do_pragma, 5415 do_pragma_poison, parse_assertion): Use val.node.node in place of 5416 val.node. 5417 * expr.c (parse_defined, eval_token): Use val.node.node in place 5418 of val.node. 5419 * lex.c (cpp_ideq, _cpp_lex_direct, cpp_token_len, 5420 cpp_spell_token, cpp_output_token, _cpp_equiv_tokens, 5421 cpp_token_val_index): Use val.macro_arg.arg_no or val.token_no in 5422 place of val.arg_no. Use val.node.node in place of val.node. 5423 * macro.c (replace_args, cpp_get_token, parse_params, 5424 lex_expansion_token, create_iso_definition, cpp_macro_definition): 5425 Use val.macro_arg.arg_no or val.token_no in place of val.arg_no. 5426 Use val.node.node in place of val.node. 5427 54282009-05-03 Joseph Myers <joseph@codesourcery.com> 5429 5430 * charset.c (one_utf8_to_cppchar): Correct mask used for 5-byte 5431 UTF-8 sequences. 5432 54332009-04-25 Joseph Myers <joseph@codesourcery.com> 5434 5435 PR preprocessor/39559 5436 * expr.c (cpp_interpret_integer): Use a pedwarn for decimal 5437 constants larger than intmax_t in C99 mode. 5438 54392009-04-21 Taras Glek <tglek@mozilla.com> 5440 5441 * include/cpp-id-data.h: Update GTY annotations to new syntax. 5442 * include/cpplib.h: Likewise. 5443 * include/line-map.h: Likewise. 5444 * include/symtab.h: Likewise. 5445 54462009-04-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org> 5447 5448 PR c++/14875 5449 * lex.c (cpp_type2name): Take a flags parameter. Call 5450 cpp_named_operator2name for named operators and cpp_digraph2name 5451 for digraphs. 5452 (cpp_digraph2name): New. 5453 (cpp_spell_token): Use it. 5454 (cpp_output_token): Likewise. 5455 * include/cpplib.h (cpp_type2name): Update declaration. 5456 * init.c (cpp_named_operator2name): New. 5457 * internal.h (cpp_named_operator2name): Declare. 5458 54592009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org> 5460 5461 PR c++/13358 5462 * init.c (cpp_create_reader): Wlong_long is disabled by default. 5463 * expr.c (cpp_classify_number): Give different messages for C and 5464 C++ front-ends. 5465 54662009-04-19 Joseph Myers <joseph@codesourcery.com> 5467 5468 PR preprocessor/20078 5469 * include/cpp-id-data.h (struct cpp_macro): Add extra_tokens 5470 field. 5471 * include/cpplib.h (SP_DIGRAPH, SP_PREV_WHITE): Define. 5472 (struct cpp_token): Change flags to unsigned short. 5473 * lex.c (_cpp_lex_direct): Initialize arg_no for CPP_PASTE tokens. 5474 (_cpp_equiv_tokens): Check arg_no for CPP_PASTE tokens. 5475 (cpp_token_val_index): Return CPP_TOKEN_FLD_ARG_NO for CPP_PASTE 5476 tokens. 5477 * macro.c (macro_real_token_count): New. 5478 (enter_macro_context, replace_args): Use macro_real_token_count. 5479 (create_iso_definition): Record whitespace surrounding and digraph 5480 spelling of # and ## tokens using SP_PREV_WHITE and SP_DIGRAPH. 5481 Set extra_tokens and save CPP_PASTE tokens with arg_no set for 5482 multiple consecutive ## tokens. 5483 (_cpp_create_definition): Initialize extra_tokens. 5484 (cpp_macro_definition): Use macro_real_token_count. 5485 54862009-04-18 Joseph Myers <joseph@codesourcery.com> 5487 5488 * directives.c (parse_include): Pass true to check_eol. 5489 54902009-04-18 Joseph Myers <joseph@codesourcery.com> 5491 5492 PR preprocessor/39646 5493 * include/line-map.h (enum lc_reason): Add LC_RENAME_VERBATIM. 5494 * line-map.c (linemap_add): Handle LC_RENAME_VERBATIM. 5495 * directives.c (do_line, do_linemarker): Use LC_RENAME_VERBATIM in 5496 place of LC_RENAME. 5497 54982009-04-18 Joseph Myers <joseph@codesourcery.com> 5499 5500 PR preprocessor/39647 5501 * directives.c (check_eol): Add parameter expand. 5502 (do_undef, parse_include, do_line, do_linemarker, do_ident, 5503 do_pragma_once, do_pragma_system_header, do_ifdef, do_ifndef, 5504 do_else, do_endif, do_assert, do_unassert): All callers changed. 5505 Pass true from do_line, false elsewhere. 5506 55072009-04-12 Joseph Myers <joseph@codesourcery.com> 5508 5509 PR preprocessor/31869 5510 * macro.c (stringify_arg): Handle NULL source token in padding 5511 token where previous padding token did not have source token with 5512 preceding whitespace. 5513 55142009-04-09 Jakub Jelinek <jakub@redhat.com> 5515 5516 * Makefile.in: Change copyright header to refer to version 5517 3 of the GNU General Public License and to point readers at the 5518 COPYING3 file and the FSF's license web page. 5519 * charset.c: Likewise. 5520 * directives-only.c: Likewise. 5521 * directives.c: Likewise. 5522 * errors.c: Likewise. 5523 * expr.c: Likewise. 5524 * files.c: Likewise. 5525 * identifiers.c: Likewise. 5526 * include/cpp-id-data.h: Likewise. 5527 * include/cpplib.h: Likewise. 5528 * include/line-map.h: Likewise. 5529 * include/mkdeps.h: Likewise. 5530 * include/symtab.h: Likewise. 5531 * init.c: Likewise. 5532 * internal.h: Likewise. 5533 * lex.c: Likewise. 5534 * line-map.c: Likewise. 5535 * macro.c: Likewise. 5536 * makeucnid.c: Likewise. 5537 * mkdeps.c: Likewise. 5538 * pch.c: Likewise. 5539 * symtab.c: Likewise. 5540 * system.h: Likewise. 5541 * traditional.c: Likewise. 5542 * ucnid.tab: Likewise. 5543 * ucnid.h: Regenerate. 5544 55452009-04-01 Janis Johnson <janis187@us.ibm.com> 5546 5547 PR c/39027 5548 * include/cpplib.h (CPP_N_DEFAULT): Define. 5549 * expr.c (interpret_float_suffix): Recognize d or D for double, 5550 return new value for default. 5551 (cpp_classify_number): Issue pedwarn for use of d or D in suffix. 5552 5553 PR c/33466 5554 * expr.c (interpret_float_suffix): Reject invalid suffix that uses 5555 letters from decimal float and fixed-point suffixes. 5556 55572009-03-31 Joseph Myers <joseph@codesourcery.com> 5558 5559 PR preprocessor/15638 5560 * files.c (_cpp_find_file): Call open_file_failed after diagnosing 5561 invalid PCH. 5562 (open_file_failed): Make error for missing file fatal. 5563 * include/cpplib.h (CPP_DL_FATAL): Define. 5564 55652009-03-30 Sergiy Vyshnevetskiy <serg@vostok.net> 5566 5567 PR preprocessor/31932: 5568 * internal.h: Don't mention HAVE_ICONV_H. 5569 * configure, config.in: Rebuild. 5570 * configure.ac: Don't check for iconv.h. 5571 55722009-03-30 Tom Tromey <tromey@redhat.com> 5573 5574 PR preprocessor/39512: 5575 * line-map.c (linemap_init): Initialize 'reallocator' field. 5576 55772009-03-30 Jakub Jelinek <jakub@redhat.com> 5578 5579 PR target/39558 5580 * macro.c (cpp_get_token): If macro_to_expand returns NULL 5581 and used some tokens, add CPP_PADDING before next token. 5582 55832009-03-29 Joseph Myers <joseph@codesourcery.com> 5584 5585 PR preprocessor/34695 5586 * makedepend.c: Remove. 5587 * Makefile.in (makedepend_OBJS, makedepend$(EXEEXT)): Remove. 5588 (all, clean, TAGS_SOURCES, include): Remove makedepend handling. 5589 * directives.c (cpp_errors): Remove. 5590 * errors.c (print_location, _cpp_begin_message, v_message): 5591 Remove. 5592 (cpp_error, cpp_error_with_line): Always use error callback. 5593 (cpp_error, cpp_error_with_line, cpp_errno): Return bool. 5594 * include/cpplib.h (cpp_options): Remove pedantic_errors, 5595 inhibit_warnings, warn_system_headers, inhibit_errors, 5596 warnings_are_errors, client_diagnostic. 5597 (cpp_callbacks): Add extra arguments to error callback; make it 5598 return bool. 5599 (cpp_finish): Return void. 5600 (cpp_destroy): Remove inaccurate comment about return value. 5601 (cpp_errors, CPP_DL_EXTRACT, CPP_DL_WARNING_P): Remove. 5602 (CPP_DL_NOTE): Define. 5603 * include/line-map.h (linemap_print_containing_files): Remove. 5604 * init.c (cpp_finish): Do not check for or return number of 5605 errors. 5606 * internal.h (cpp_reader): Remove errors field. 5607 * line-map.c (linemap_print_containing_files): Remove. 5608 * macro.c (_cpp_create_definition): Use CPP_DL_NOTE for message 5609 about previous definition. Only emit it if previous diagnostic 5610 was emitted. 5611 56122009-03-28 Joseph Myers <joseph@codesourcery.com> 5613 5614 * Makefile.in (po/$(PACKAGE).pot): Use $(mkinstalldirs) not 5615 mkinstalldirs. 5616 56172009-03-18 Jakub Jelinek <jakub@redhat.com> 5618 5619 * include/cpplib.h (struct cpp_dir): Reorder fields for 64-bit hosts. 5620 56212009-02-21 Joseph Myers <joseph@codesourcery.com> 5622 5623 * lex.c (lex_string): Return a CPP_LESS token for missing '>' in a 5624 header name. 5625 (_cpp_lex_direct): Handle this. 5626 56272009-02-15 Richard Guenther <rguenther@suse.de> 5628 5629 Revert last change. 5630 56312009-02-13 Richard Guenther <rguenther@suse.de> 5632 5633 * configure.ac: Enable LFS. 5634 * configure: Re-generate. 5635 * config.in: Likewise. 5636 56372009-01-05 Ben Elliston <bje@au.ibm.com> 5638 5639 * Makefile.in (.po.gmo): Use mkinstalldirs, not test -d || mkdir. 5640 (.po.pox): Likewise. 5641 (po/$(PACKAGE).pot): Likewise. 5642 56432008-12-10 Alexandre Oliva <aoliva@redhat.com> 5644 5645 PR target/37033 5646 * pch.c (cpp_valid_state): Improve message for poisoned symbols. 5647 Allow for differences in __GCC_HAVE_DWARF2_CFI_ASM. 5648 56492008-11-29 Joseph Myers <joseph@codesourcery.com> 5650 5651 * lex.c (cpp_token_len): Use 6 as default length. 5652 56532008-10-31 Manuel L��pez-Ib����ez <manu@gcc.gnu.org> 5654 5655 * expr.c (struct op): Add location. 5656 (_cpp_parse_expr): Propagate locations throught the stack 5657 of expressions. 5658 (reduce): Likewise. 5659 (check_promotion): Use explicit location in errors. 5660 56612008-10-05 Matthew Gingell <gingell@adacore.com> 5662 Arnaud Charlet <charlet@adacore.com> 5663 5664 * include/cpplib.h (cpp_comments, cpp_comment_table): New structs. 5665 (cpp_get_comments): New function. 5666 * internal.h (struct cpp_reader): Add comments field. 5667 * init.c (cpp_destroy): Free comments. 5668 * lex.c (store_comment, cpp_get_comments): New functions. 5669 (comments): New struct. 5670 (save_comment): Store comments in comments struct. 5671 56722008-09-18 Simon Baldwin <simonb@google.com> 5673 5674 * include/cpplib.h (struct cpp_options): Add new boolean flag 5675 warn_builtin_macro_redefined. 5676 * init.c (cpp_create_reader): Initialize warn_builtin_macro_redefined. 5677 * (struct builtin_operator): Split out from previous struct builtin, 5678 enhance extra const correctness. 5679 * (struct builtin_macro): Split out from previous struct builtin, add 5680 new always_warn_if_redefined flag, enhance const correctness. 5681 * (mark_named_operators): Use struct builtin_operator. 5682 * (cpp_init_special_builtins): Use struct builtin_macro, add NODE_WARN 5683 to builtins selectively. 5684 * macro.c (warn_of_redefinition): Return false if a builtin macro 5685 is not flagged with NODE_WARN. 5686 56872008-07-31 Jakub Jelinek <jakub@redhat.com> 5688 5689 PR preprocessor/36649 5690 * files.c (struct report_missing_guard_data): New type. 5691 (report_missing_guard): Put paths into an array instead of printing 5692 them right away. Return 1 rather than 0. 5693 (report_missing_guard_cmp): New function. 5694 (_cpp_report_missing_guards): Sort and print paths gathered by 5695 report_missing_guard callback. 5696 56972008-07-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org> 5698 5699 PR 28079 5700 * directives.c (strtolinenum): Handle overflow. 5701 (do_line): Give a warning if line number overflowed. 5702 (do_linemarker): Update call to strtolinenum. 5703 57042008-07-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org> 5705 5706 * include/line-map.h (linenum_type): New typedef. 5707 (struct line_map): Use it. 5708 (SOURCE_LINE): Second arguments is a LOCATION not a LINE. 5709 (SOURCE_COLUMN): Likewise. 5710 * macro.c (_cpp_builtin_macro_text): Use linenum_type. Don't store 5711 source_location values in a variable of type linenum_type. 5712 * directives.c (struct if_stack): Use linenum_type. 5713 (strtoul_for_line): Rename as strtolinenum. 5714 (do_line): Use linenum_type. 5715 (do_linemarker): Use linenum_type and strtolinenum. 5716 (_cpp_do_file_change): Use linenum_t. 5717 * line-map.c (linemap_add): Likewise. 5718 (linemap_line_start): Likewise. 5719 * traditional.c (struct fun_macro): 'line' is a source_location. 5720 * errors.c (print_location): Use linenum_type. 5721 * directives-only.c (_cpp_preprocess_dir_only): Likewise. 5722 * internal.h (CPP_INCREMENT_LINE): Likewise. 5723 * lex.c (_cpp_skip_block_comment): Use source_location. 5724 57252008-07-14 Ben Elliston <bje@au.ibm.com> 5726 5727 * include/cpplib.h (NODE_CONDITIONAL): New. 5728 (struct cpp_callbacks): New macro_to_expand field. 5729 (struct cpp_hashnode): Adjust size of flags and type fields. 5730 (cpp_peek_token): Prototype. 5731 * lex.c (cpp_peek_token): New function. 5732 (_cpp_temp_token): Protect pre-existing lookaheads. 5733 * macro.c (cpp_get_token): Expand any conditional macros. 5734 (_cpp_backup_tokens_direct): New. 5735 (_cpp_backup_tokens): Call _cpp_backup_tokens_direct. 5736 (warn_of_redefinition): Silently allow redefined conditional 5737 macros. 5738 (_cpp_create_definition): Remove the conditional flag when a user 5739 defines one of the conditional macros. 5740 * internal.h (_cpp_backup_tokens_direct): New prototype. 5741 57422008-06-13 Andrew Haley <aph@redhat.com> 5743 5744 PR preprocessor/33305 5745 * macro.c (replace_args): Print a warning for empty macro 5746 arguments in C89 and C++. 5747 57482008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> 5749 5750 * Makefile.in ($(srcdir)/aclocal.m4): Update dependencies. 5751 * configure: Regenerate. 5752 57532008-06-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> 5754 5755 * Makefile.in (datarootdir): New variable. 5756 57572008-06-12 H.J. Lu <hongjiu.lu@intel.com> 5758 5759 PR preprocessor/36479 5760 * charset.c (cpp_interpret_string_notranslate): Also set 5761 narrow_cset_desc.width. 5762 57632008-06-07 Joseph Myers <joseph@codesourcery.com> 5764 5765 * configure.ac (parisc*64*-*-*): Remove. 5766 * configure: Regenerate. 5767 57682008-05-30 Tom Tromey <tromey@redhat.com> 5769 5770 PR preprocessor/36320: 5771 * internal.h (_cpp_parse_expr): Update. 5772 * expr.c (_cpp_parse_expr): Add 'is_if' argument. Update error 5773 messages. 5774 * directives.c (do_if): Update. 5775 (do_elif): Require expression if processing group. 5776 57772008-05-30 Danny Smith <dannysmith@users.sourceforge.net> 5778 5779 * include/cpplib.h (struct cpp_dir): Add new field, canonical_name. 5780 57812008-05-21 Tom Tromey <tromey@redhat.com> 5782 5783 PR preprocessor/27777: 5784 * lex.c (cpp_output_line_to_string): New function. 5785 * internal.h (_cpp_begin_message): Don't declare. 5786 * errors.c (_cpp_begin_message): Now static. 5787 * include/cpplib.h (cpp_output_line_to_string): Declare. 5788 * directives.c (do_diagnostic): Rewrote. Use 5789 cpp_output_line_to_string. Don't use _cpp_begin_message. 5790 57912008-05-21 Tom Tromey <tromey@redhat.com> 5792 5793 * include/symtab.h (HT_ALLOCED): Remove. 5794 (ht_purge): Declare. 5795 * symtab.c (DELETED): New define. 5796 (ht_lookup): Update comment. 5797 (ht_lookup_with_hash): Handle deleted entries. Remove HT_ALLOCED 5798 code. Use subobject allocator for strings, if it exists. 5799 (ht_expand): Handle deleted entries. 5800 (ht_forall): Likewise. 5801 (ht_purge): New function. 5802 (ht_dump_statistics): Print deletion statistics. 5803 58042008-05-13 Tom Tromey <tromey@redhat.com> 5805 5806 PR preprocessor/22168: 5807 * include/cpplib.h (struct cpp_options) <objc>: Update 5808 documentation. 5809 * expr.c (eval_token): Warn for use of assertions. 5810 * directives.c (directive_diagnostics): Warn about extensions. 5811 (DEPRECATED): New define. 5812 (DIRECTIVE_TABLE): Use it. 5813 58142008-05-06 Tom Tromey <tromey@redhat.com> 5815 5816 PR preprocessor/35313, PR preprocessor/36088: 5817 * expr.c (optab) <QUERY, COMMA>: Set precedence to 4. 5818 (reduce) <case CPP_QUERY>: Special case CPP_COMMA and CPP_COLON. 5819 58202008-05-04 David S. Miller <davem@davemloft.net> 5821 5822 * configure.ac (sparc*-*-*): Always set need_64bit_hwint to yes. 5823 * configure: Regenerate. 5824 58252008-04-22 Daniel Franke <franke.daniel@gmail.com> 5826 5827 * include/cpplib.h (cpp_define_formatted): New. 5828 * directives.c (cpp_define_formatted): New. 5829 58302008-04-21 Tom Tromey <tromey@redhat.com> 5831 5832 PR libcpp/33415: 5833 * charset.c (_cpp_convert_input): Add buffer_start argument. 5834 Ignore UTF-8 BOM if seen. 5835 * internal.h (_cpp_convert_input): Add argument. 5836 * files.c (struct _cpp_file) <buffer_start>: New field. 5837 (destroy_cpp_file): Free buffer_start, not buffer. 5838 (_cpp_pop_file_buffer): Likewise. 5839 (read_file_guts): Update. 5840 58412008-04-18 Kris Van Hees <kris.van.hees@oracle.com> 5842 5843 * include/cpp-id-data.h (UC): Was U, conflicts with U"..." literal. 5844 * include/cpplib.h (CHAR16, CHAR32, STRING16, STRING32): New tokens. 5845 (struct cpp_options): Added uliterals. 5846 (cpp_interpret_string): Update prototype. 5847 (cpp_interpret_string_notranslate): Idem. 5848 * charset.c (init_iconv_desc): New width member in cset_converter. 5849 (cpp_init_iconv): Add support for char{16,32}_cset_desc. 5850 (convert_ucn): Idem. 5851 (emit_numeric_escape): Idem. 5852 (convert_hex): Idem. 5853 (convert_oct): Idem. 5854 (convert_escape): Idem. 5855 (converter_for_type): New function. 5856 (cpp_interpret_string): Use converter_for_type, support u and U prefix. 5857 (cpp_interpret_string_notranslate): Match changed prototype. 5858 (wide_str_to_charconst): Use converter_for_type. 5859 (cpp_interpret_charconst): Add support for CPP_CHAR{16,32}. 5860 * directives.c (linemarker_dir): Macro U changed to UC. 5861 (parse_include): Idem. 5862 (register_pragma_1): Idem. 5863 (restore_registered_pragmas): Idem. 5864 (get__Pragma_string): Support CPP_STRING{16,32}. 5865 * expr.c (eval_token): Support CPP_CHAR{16,32}. 5866 * init.c (struct lang_flags): Added uliterals. 5867 (lang_defaults): Idem. 5868 * internal.h (struct cset_converter) <width>: New field. 5869 (struct cpp_reader) <char16_cset_desc>: Idem. 5870 (struct cpp_reader) <char32_cset_desc>: Idem. 5871 * lex.c (digraph_spellings): Macro U changed to UC. 5872 (OP, TK): Idem. 5873 (lex_string): Add support for u'...', U'...', u"..." and U"...". 5874 (_cpp_lex_direct): Idem. 5875 * macro.c (_cpp_builtin_macro_text): Macro U changed to UC. 5876 (stringify_arg): Support CPP_CHAR{16,32} and CPP_STRING{16,32}. 5877 58782008-04-18 Paolo Bonzini <bonzini@gnu.org> 5879 5880 PR bootstrap/35457 5881 * aclocal.m4: Regenerate. 5882 * configure: Regenerate. 5883 58842008-04-17 Tom Tromey <tromey@redhat.com> 5885 5886 PR libcpp/34866: 5887 * errors.c (cpp_error): Don't reference a token before the start 5888 of the current run. 5889 58902008-04-16 Tom Tromey <tromey@redhat.com> 5891 5892 * Makefile.in (TAGS_SOURCES): New variable. 5893 (TAGS): New target. 5894 58952008-04-11 Kaz Kojima <kkojima@gcc.gnu.org> 5896 5897 * configure.ac: (need_64bit_hwint): Need 64bit hwint for sh-*-* 5898 and shbe-*-*. 5899 * configure: Rebuilt. 5900 59012008-04-02 Joseph Myers <joseph@codesourcery.com> 5902 5903 * include/cpplib.h (struct cpp_callbacks): Add used_define, 5904 used_undef and before_define. 5905 (NODE_USED): Define. 5906 * directives.c (do_define, do_undef, undefine_macros, do_ifdef, 5907 do_ifndef, cpp_pop_definition): Handle new flag and use new 5908 callbacks. 5909 * expr.c (parse_defined): Handle new flag and use new callbacks. 5910 * macro.c (enter_macro_context, _cpp_free_definition): Handle new 5911 flag and use new callbacks. 5912 59132008-04-01 Jakub Jelinek <jakub@redhat.com> 5914 5915 PR pch/13675 5916 * files.c (struct _cpp_file): Remove pch field. 5917 (pch_open_file): Don't set file->pch, just file->pchname. 5918 (should_stack_file): After pfile->cb.read_pch call 5919 free pchname and clear pchname, don't close file->fd. 5920 Test file->pchname instead of file->pch. Don't close fd after cb. 5921 (_cpp_stack_include): Test file->pchname instead of file->pch. 5922 59232008-03-28 Tom Tromey <tromey@redhat.com> 5924 5925 * Makefile.in (POSTCOMPILE): New variable. 5926 (.c.o): Use it. 5927 59282008-03-13 Tom Tromey <tromey@redhat.com> 5929 5930 PR libcpp/35322: 5931 * directives.c (destringize_and_run): Set pfile->directive. 5932 59332008-03-06 Markus Milleder <markus.milleder@generali.at> 5934 5935 PR preprocessor/35458 5936 * mkdeps.c (munge): Quote '#' with a '\'. 5937 59382008-02-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> 5939 5940 PR preprocessor/35379 5941 * mkdeps.c (deps_write): Ensure the first target always appears 5942 in the first column, without leading backslash newline. Avoid 5943 some more extra whitespace. 5944 59452008-02-25 Thiemo Seufer <ths@mips.com> 5946 5947 * Makefile.in ($(srcdir)/config.in): Depend on configure.ac. 5948 59492008-02-19 Tom Tromey <tromey@redhat.com> 5950 5951 * traditional.c (lex_identifier): Use CPP_HASHNODE. 5952 * lex.c (lex_identifier): Use CPP_HASHNODE. 5953 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Wrap in 5954 do-while. 5955 * identifiers.c (alloc_node): Change return type. 5956 (_cpp_init_hashtable): Don't cast 'alloc_node'. 5957 (proxy_assertion_broken): New declaration. 5958 (cpp_forall_identifiers): Move comment. 5959 * line-map.c (linemap_add): Comment fix. 5960 (linemap_line_start): Indentation fix. 5961 59622008-01-25 Jakub Jelinek <jakub@redhat.com> 5963 5964 PR preprocessor/34692 5965 * macro.c (collect_args): Add pragma_buff argument. Push 5966 CPP_PRAGMA ... CPP_PRAGMA_EOL tokens to *pragma_buff, rather 5967 than into arguments. Reset prevent_expansion and parsing_args 5968 state at CPP_PRAGMA_EOL/CPP_EOF. 5969 (funlike_invocation_p): Add pragma_buff argument, pass it through 5970 to collect_args. 5971 (enter_macro_context): Add result argument. Adjust 5972 funlike_invocation_p caller. Emit all deferred pragma tokens 5973 gathered during collect_args before the expansion, add a padding 5974 token. Return 2 instead of 1 if any pragma tokens were prepended. 5975 (cpp_get_token): If enter_macro_context returns 2, don't return 5976 a padding token, instead cycle to grab CPP_PRAGMA token. 5977 * directives.c (_cpp_handle_directive): If was_parsing_args 5978 in deferred pragma, leave parsing_args and prevent_expansion as is. 5979 59802008-01-22 Tom Tromey <tromey@redhat.com> 5981 5982 PR c++/34859 5983 * macro.c (_cpp_create_definition): Handle __STDC_LIMIT_MACROS and 5984 __STDC_CONSTANT_MACROS. 5985 59862008-01-07 Fred Fish <fnf@specifix.com> 5987 5988 PR preprocessor/30363 5989 * traditional.c (replace_args_and_push): Add local variable 5990 cxtquote, calculate the replacement text size assuming a 5991 worst case of every input character quoted with backslash, 5992 and properly handle output quoting of quote characters in 5993 actual arguments used in function-like macros. 5994 59952008-01-03 Tom Tromey <tromey@redhat.com> 5996 5997 PR preprocessor/34602 5998 * directives.c (do_line): Don't try to spell EOF token. 5999 (do_linemarker): Add comment. 6000 60012007-12-11 DJ Delorie <dj@redhat.com> 6002 6003 * charset.c (convert_using_iconv): Close out any shift states, 6004 returning to the initial state. 6005 60062007-12-06 Tom Tromey <tromey@redhat.com> 6007 6008 PR c/29172 6009 * internal.h (struct cpp_reader) <file_hash_entries>: Changed 6010 type. 6011 <file_hash_entries_allocated, file_hash_entries_used>: Removed. 6012 * files.c (FILE_HASH_POOL_SIZE): New macro. 6013 (struct file_hash_entry_pool): New. 6014 (destroy_all_cpp_files): New function. 6015 (allocate_file_hash_entries): Allocate a file_hash_entry_pool. 6016 (new_file_hash_entry): Update. 6017 (free_file_hash_entries): New function. 6018 (_cpp_cleanup_files): Call free_file_hash_entries and 6019 destroy_all_cpp_files. 6020 (cpp_clear_file_cache): New function. 6021 * include/cpplib.h (cpp_clear_file_cache): Declare. 6022 60232007-12-03 Tom Tromey <tromey@redhat.com> 6024 6025 PR preprocessor/34288 6026 * configure.ac, config.in: Rebuilt. 6027 * configure.ac: Check for ssize_t. 6028 60292007-11-30 Tom Tromey <tromey@redhat.com> 6030 6031 PR preprocessor/32868 6032 * macro.c (_cpp_create_definition): Special case 6033 __STDC_FORMAT_MACROS. 6034 60352007-11-16 Michael Matz <matz@suse.de> 6036 6037 * files.c (search_path_head): Fix check for absolute paths. 6038 60392007-11-11 Tom Tromey <tromey@redhat.com> 6040 6041 PR c++/17557 6042 * include/cpplib.h (cpp_included_before): Declare. 6043 * files.c (struct file_hash_entry) <location>: New field. 6044 (_cpp_find_file): Initialize new field. 6045 (make_cpp_dir): Likewise. 6046 (cpp_included_before): New function. 6047 60482007-11-01 Tom Tromey <tromey@redhat.com> 6049 6050 PR preprocessor/30805 6051 * macro.c (paste_tokens): Handle padding token. 6052 (paste_tokens): Don't abort unless padding has PASTE_LEFT flag. 6053 60542007-10-31 Tom Tromey <tromey@redhat.com> 6055 6056 PR preprocessor/30786 6057 * macro.c (builtin_macro): Return result of _cpp_do__Pragma. 6058 * directives.c (_cpp_do__Pragma): Return error status. 6059 * internal.h (_cpp_do__Pragma): Update. 6060 * directives.c (get__Pragma_string): Back up if EOF seen. 6061 60622007-09-06 Tom Tromey <tromey@redhat.com> 6063 6064 * internal.h (struct cpp_reader) <invocation_location>: New 6065 field. 6066 (struct cpp_reader) <set_invocation_location>: Likewise. 6067 * init.c (cpp_set_line_map): New function. 6068 * line-map.c (linemap_add): Use linemap's allocator. 6069 * include/line-map.h (GTY): Define. 6070 (line_map_realloc): New typedef. 6071 (struct line_map): Mark with GTY. 6072 (struct line_maps): Likewise. 6073 (struct line_maps) <maps>: Likewise. 6074 (struct line_maps) <reallocator>: New field. 6075 * include/symtab.h (GTY): Conditionally define. 6076 * include/cpplib.h (cpp_set_line_map): Declare. 6077 (cpp_get_token_with_location): Declare. 6078 * macro.c (cpp_get_token): Set invocation_location on the reader. 6079 (cpp_get_token_with_location): New function. 6080 60812007-08-30 Chao-ying Fu <fu@mips.com> 6082 6083 * expr.c (interpret_float_suffix): Support hr, r, lr, llr, uhr, ur, 6084 ulr, ullr, hk, k, lk, llk, uhk, uk, ulk, ullk. 6085 (cpp_classify_number): Support decimal fixed-point constants without 6086 exponents. 6087 Warn about fixed-point constants when -pedantic. 6088 * include/cpplib.h (CPP_N_SMALL, CPP_N_MEDIUM, CPP_N_LARGE): Change 6089 comments to support fixed-point values. 6090 (CPP_N_FRACT, CPP_N_ACCUM): Define. 6091 60922007-08-18 Tom Tromey <tromey@redhat.com> 6093 6094 PR preprocessor/32974 6095 * directives.c (parse_include): Don't check for EOL when 6096 processing #pragma dependency. 6097 60982007-07-30 Ollie Wild <aaw@google.com> 6099 6100 * directives-only.c: New file. 6101 * internal.h (struct _cpp_dir_only_callbacks): New. 6102 (_cpp_preprocess_dir_only): New function. 6103 * directives.c (_cpp_handle_directive): Check directives_only before 6104 disabling execution of indented directives. 6105 * files.c (_cpp_stack_file): Add directives_only check. 6106 * include/cpplib.h (struct cpp_options): Add directives_only. 6107 (cpp_init_special_builtins): New function. 6108 * init.c (cpp_init_special_builtins): New function. 6109 (cpp_init_builtins): Move builtin_array initialization to 6110 cpp_init_special_builtins. 6111 (post_options): Check directives_only before setting 6112 pfile->state.prevent_expansion = 1. 6113 * macro.c (_cpp_builtin_macro_text): Print an error if __COUNTER__ 6114 is expanded inside a directive while -fdirectives-only is enabled. 6115 * Makefile.in (libcpp_a_OBJS): Add directives-only.o. 6116 (libcpp_a_SOURCES): Add directives-only.c. 6117 61182007-07-04 Uros Bizjak <ubizjak@gmail.com> 6119 6120 * traditional.c (_cpp_scan_out_logical_line): Initialize 6121 fmacro.args, fmacro.node, fmacro.offset, fmacro.line and 6122 fmacro.args to prevent 'may be used uninitialized' warning. 6123 61242007-07-03 Uros Bizjak <ubizjak@gmail.com> 6125 6126 * include/cpplib.h (CPP_N_WIDTH_MD, CPP_N_MD_W, CPP_N_MD_Q): 6127 Add new constants. 6128 * expr.c (interpret_float_suffix): Process 'w', 'W', 'q' and 'Q' 6129 suffixes. Return CPP_N_MD_W for 'w' or 'W' suffixes and CPP_N_MD_Q 6130 for 'q' or 'Q' suffixes. 6131 61322007-06-17 Danny Smith <dannysmith@users.sourceforge.net 6133 6134 * files.c (open_file): Correct typo. 6135 61362007-06-16 Vladimir Prus <vladimir@codesourcery.com> 6137 6138 * files.c (open_file): Prevent the call 6139 for stat from overwriting errno. 6140 61412007-06-09 Vladimir Prus <vladimir@codesourcery.com> 6142 6143 * files.c (open_file): Account for the 6144 fact that on windows, opening a directory gives 6145 EACCES. 6146 61472007-06-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de> 6148 6149 PR preprocessor/23479 6150 * expr.c (cpp_classify_number): Implement 0b-prefixed binary 6151 integer constants. 6152 (append_digit): Likewise. 6153 * include/cpplib.h: Add CPP_N_BINARY, to be used for 0b-prefixed 6154 binary integer constants. 6155 61562007-05-31 Dave Korn <dave.korn@artimi.com> 6157 6158 PR preprocessor/14331 6159 * lex.c (_cpp_get_fresh_line): Don't warn if no newline at EOF. 6160 61612007-05-24 Ollie Wild <aaw@google.com> 6162 6163 * macro.c (_cpp_builtin_macro_text): Handle BT_COUNTER. 6164 * pch.c (cpp_write_pch_deps): Save __COUNTER__ state. 6165 (cpp_write_pch_state): Save __COUNTER__ state. 6166 (cpp_valid_state): Check valid __COUNTER__ state. 6167 (cpp_read_state): Read new __COUNTER__ state. 6168 * include/cpplib.h (enum builtin_type): Add BT_COUNTER enumerator. 6169 * init.c (builtin_array): Add __COUNTER__/BT_COUNTER. 6170 * internal.h (struct cpp_reader): Add counter member. 6171 61722007-05-23 Simon Martin <simartin@users.sourceforge.net> 6173 6174 PR preprocessor/20077 6175 * macro.c (create_iso_definition): Fixed the method to determine 6176 whether the token-pasting operator appears at the beginning or the end 6177 of a macro. 6178 61792007-05-21 Ian Lance Taylor <iant@google.com> 6180 6181 * internal.h (struct cpp_reader): Add new fields: 6182 nonexistent_file_hash and nonexistent_file_ob. 6183 * files.c: Include "obstack.h". 6184 (find_file_in_dir): Before trying to open the file, look up the 6185 path name in the hash table of nonexistent files. After failing 6186 to open the file, add the path name to the hash table. 6187 (_cpp_find_file): Cache the results of looking up the file name 6188 starting with the quote and bracket chain heads, if we can. 6189 (nonexistent_file_hash_eq): New static function. 6190 (_cpp_init_files): Initialize pfile->nonexistent_file_hash and 6191 pfile->nonexistent_file_ob. 6192 (_cpp_cleanup_files): Free pfile->nonexistent_file_hash and 6193 pfile->nonexistent_file_ob. 6194 61952007-05-14 Janis Johnson <janis187@us.ibm.com> 6196 6197 * expr.c (cpp_classify_number): Warn about dfp constant for -pedantic. 6198 6199 PR c/31924 6200 * expr.c (interpret_float_suffix): Check for invalid suffix. 6201 62022007-05-02 Eric Christopher <echristo@apple.com> 6203 6204 * expr.c (num_div_op): Don't overflow if the result is 6205 zero. 6206 62072007-05-02 Tom Tromey <tromey@redhat.com> 6208 6209 PR preprocessor/28709 6210 * macro.c (paste_tokens): Remove PASTE_LEFT from the old lhs. 6211 62122007-03-30 Michael Meissner <michael.meissner@amd.com> 6213 6214 * directives.c (lex_macro_node_from_str): Fix alloca call to be 6215 type correct. 6216 62172007-03-30 Richard Henderson <rth@redhat.com> 6218 6219 * directives.c (lex_macro_node_from_str): New. 6220 (cpp_push_definition, cpp_pop_definition): New. 6221 * include/cpplib.h (cpp_push_definition, cpp_pop_definition): Declare. 6222 62232007-03-01 Brooks Moses <brooks.moses@codesourcery.com> 6224 6225 * Makefile.in: Add dummy install-pdf target. 6226 62272007-01-30 Tom Tromey <tromey@redhat.com> 6228 6229 PR preprocessor/30468 6230 * mkdeps.c (apply_vpath): Strip successive '/'s if we stripped 6231 './'. 6232 62332007-01-30 Tom Tromey <tromey@redhat.com> 6234 6235 PR preprocessor/29966 6236 * macro.c (lex_expansion_token): Save and restore cpp_reader's 6237 cur_token. 6238 (_cpp_create_definition): Don't restore cur_token here. 6239 * lex.c (_cpp_lex_token): Added assertion. 6240 62412007-01-27 Tom Tromey <tromey@redhat.com> 6242 6243 * configure: Rebuilt. 6244 62452007-01-12 Tom Tromey <tromey@redhat.com> 6246 6247 PR preprocessor/28227 6248 * directives.c (lex_macro_node): Added 'is_def_or_undef' 6249 argument. 6250 (do_define): Update. 6251 (do_undef): Update. 6252 (do_ifdef): Update. 6253 (do_ifndef): Update. 6254 62552007-01-11 Paolo Bonzini <bonzini@gnu.org> 6256 6257 * configure: Regenerate. 6258 62592007-01-11 Paolo Bonzini <bonzini@gnu.org> 6260 6261 * configure: Regenerate. 6262 62632007-01-04 Tom Tromey <tromey@redhat.com> 6264 6265 PR preprocessor/28165 6266 * internal.h (cpp_in_primary_file): New function. 6267 * directives.c (do_include_next): Use cpp_in_primary_file. 6268 (do_pragma_once): Likewise. 6269 (do_pragma_system_header): Likewise. 6270 62712006-12-29 Ian Lance Taylor <iant@google.com> 6272 6273 * lex.c (_cpp_clean_line): Add uses of __builtin_expect. Don't 6274 look backward at the end of the line unless we saw a backslash. 6275 62762006-12-29 Jakub Jelinek <jakub@redhat.com> 6277 6278 PR preprocessor/29612 6279 * directives.c (do_linemarker): Set pfile->buffer->sysp always, not 6280 only when new_sysp is non-zero. 6281 62822006-12-28 Tom Tromey <tromey@redhat.com> 6283 6284 PR preprocessor/30001 6285 * charset.c (_cpp_convert_input): Check that to.len is greater 6286 than zero. 6287 62882006-11-20 Trevor Smigiel <Trevor_Smigiel@playstation.sony.com> 6289 6290 * configure.ac (need_64bit_hwint): Need 64bit hwint for SPU. 6291 * configure: Rebuilt. 6292 62932006-11-01 Douglas Gregor <doug.gregor@gmail.com> 6294 6295 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX0X and CLK_CXX0X 6296 for experimental C++0x mode. 6297 * init.c (lang_defaults): Add defaults for C++0x modes. C++0x has 6298 adopted the preprocessor changes introduced in C99. 6299 63002006-10-29 Joseph Myers <joseph@codesourcery.com> 6301 6302 * configure.ac (need_64bit_hwint): Set for i[34567]86-*-linux* 6303 depending on --enable-targets=all. 6304 * configure: Regenerate. 6305 63062006-10-12 Jakub Jelinek <jakub@redhat.com> 6307 6308 PR preprocessor/28709 6309 * macro.c (paste_tokens): Do error reporting here, use BUF with the 6310 spelled LHS token as opposed to spelling it again. 6311 (paste_all_tokens): Don't report errors here, just break on failure. 6312 63132006-10-10 Brooks Moses <bmoses@stanford.edu> 6314 6315 * Makefile.in: Added empty "pdf" target. 6316 63172006-09-22 Geoffrey Keating <geoffk@apple.com> 6318 6319 * configure.ac: Make need_64_bit_hwint case for x86-darwin 6320 match exactly the glob in gcc/config.gcc. 6321 * configure: Regenerate. 6322 63232006-09-13 Joseph S. Myers <joseph@codesourcery.com> 6324 6325 PR c/28768 6326 PR preprocessor/14634 6327 * lex.c (lex_string): Pedwarn for unterminated literals. 6328 63292006-09-08 Eric Christopher <echristo@apple.com> 6330 6331 * configure.ac: Add 64-bit HWI support for i?86-darwin. 6332 63332006-08-14 Steve Ellcey <sje@cup.hp.com> 6334 6335 PR c++/28288 6336 PR c++/14556 6337 * include/cpplib.h: Remove <?, >?, <?=, and >?= tokens. 6338 (CPP_LAST_EQ): Change. 6339 (CPP_LAST_PUNCTUATOR): Change. 6340 * expr.c (cpp_operator): Remove MIN and MAX. 6341 (reduce): Remove CPP_MIN and CPP_MAX. 6342 (num_binary_op): Ditto. 6343 * lex.c (_cpp_lex_direct): Ditto. 6344 (cpp_avoid_paste): Remove ? as legal symbol after > or <. 6345 63462006-06-09 Jakub Jelinek <jakub@redhat.com> 6347 6348 PR preprocessor/27746 6349 * directives.c (do_pragma): Handle pragma with valid namespace 6350 and invalid name coming from macro expansion. 6351 * directives.c (destringize_and_run): Initialize next field in 6352 context. 6353 6354 PR c/27747 6355 PR c++/27748 6356 * directives.c (destringize_and_run): Set NO_EXPAND on the 6357 tokens. 6358 6359 * macro.c (_cpp_backup_tokens): Fix comment typo. 6360 63612006-05-31 Daniel Jacobowitz <dan@codesourcery.com> 6362 6363 * Makefile.in (CATALOGS): Add po/ prefix. 6364 * configure: Regenerated. 6365 63662006-05-23 Carlos O'Donell <carlos@codesourcery.com> 6367 6368 * Makefile.in: Add install-html target. Add install-html to .PHONY 6369 63702006-02-17 Grigory Zagorodnev <grigory_zagorodnev@linux.intel.com> 6371 6372 * macro.c (_cpp_builtin_macro_text): Handle BT_TIMESTAMP. 6373 * files.c (_cpp_get_file_stat): New function. 6374 * include/cpplib.h (builtin_type): Add BT_TIMESTAMP. 6375 * init.c (builtin_array): Add support for __TIMESTAMP__/BT_TIMESTAMP. 6376 * internal.h (_cpp_get_file_stat): Prototype. 6377 (struct cpp_buffer): Add timestamp. 6378 63792006-01-23 Jakub Jelinek <jakub@redhat.com> 6380 6381 PR preprocessor/25717 6382 * init.c (cpp_init_builtins): If __STDC__ will not change value 6383 between system headers and other sources, define it as a normal 6384 macro rather than a builtin. 6385 * macro.c (_cpp_builtin_macro_text) <case BT_STDC>: Only check 6386 cpp_in_system_header condition. 6387 63882006-01-05 Paolo Bonzini <bonzini@gnu.org> 6389 6390 * Makefile.in: Use -MMD instead of -MD. 6391 63922006-01-04 Dmitry Kurochkin <dmitry.kurochkin@gmail.com> 6393 Richard Henderson <rth@redhat.com> 6394 6395 Merge from gomp branch: 6396 * directives.c (struct pragma_entry): Add is_deferred. Add ident 6397 entry to value union. 6398 (end_directive): Don't eat the line if in_deferred_pragma. 6399 (run_directive): Remove pragma hacks. 6400 (insert_pragma_entry): Remove. 6401 (new_pragma_entry): New. 6402 (register_pragma_1): Split out of register_pragma. Only handle 6403 the lookup tree and return the new entry. 6404 (cpp_register_pragma): Fill in the pragma entry here. 6405 (cpp_register_deferred_pragma): New. 6406 (register_pragma_internal): New. 6407 (_cpp_init_internal_pragmas): Use register_pragma_internal. 6408 (do_pragma): Allow pragma expansion after namespace. For deferred 6409 pragmas, don't slurp the line into a string. 6410 (destringize_and_run): Save tokens for deferred pragmas. 6411 (cpp_handle_deferred_pragma): Remove. 6412 * macro.c (builtin_macro): Remove pragma token hack. 6413 (_cpp_push_token_context): Rename from push_token_context and export. 6414 * internal.h (struct lexer_state): Add pragma_allow_expansion. 6415 (_cpp_push_token_context): Declare. 6416 * lex.c (_cpp_lex_token): Allow _cpp_handle_directive to return 6417 a token. Update the line number correctly if so. 6418 (_cpp_lex_direct): Emit CPP_PRAGMA_EOL tokens. 6419 (cpp_token_val_index): Return CPP_TOKEN_FLD_PRAGMA for pragmas. 6420 * include/cpplib.h (PRAGMA_EOL): New. 6421 (CPP_TOKEN_FLD_PRAGMA): New. 6422 (struct cpp_token): Add val.pragma. 6423 (struct cpp_options): Remove defer_pragmas. 6424 (cpp_handle_deferred_pragma): Remove. 6425 (cpp_register_deferred_pragma): Declare. 6426 64272006-01-01 Jakub Jelinek <jakub@redhat.com> 6428 6429 PR c++/25294 6430 * directives.c (do_pragma): If pragma line ends with multi-line 6431 block comment, end the saved deferred pragma string before that 6432 comment. Handle embedded '\0' chars on the pragma line. 6433 64342005-12-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de> 6435 6436 PR c++/23333 6437 * include/cpplib.h: Add PURE_ZERO to flags for the cpp_token structure. 6438 64392005-12-07 Jon Grimm <jgrimm2@us.ibm.com> 6440 Ben Elliston <bje@au.ibm.com> 6441 6442 * include/cpplib.h (CPP_N_DFLOAT): New. 6443 * expr.c (interpret_float_suffix): Identify df, dd, and dl 6444 suffixes as decimal floating point constants. 6445 (cpp_classify_number): Disallow hexadecimal DFP constants. 6446 64472005-11-14 Gerald Pfeifer <gerald@pfeifer.com> 6448 Ian Lance Taylor <ian@airs.com> 6449 6450 * include/cpplib.h (struct cpp_callbacks): Annotate error with 6451 ATTRIBUTE_FPTR_PRINTF(3,0) instead of ATTRIBUTE_PRINTF(3,0). 6452 64532005-11-09 Per Bothner <per@bothner.com> 6454 Uros Bizjak <uros@kss-loka.si> 6455 6456 PR c/24101 6457 * init.c (read_original_filename): Temporarily set 6458 state.in_directive before calling _cpp_lex_direct for 6459 CPP_HASH tokens. 6460 64612005-11-03 James E Wilson <wilson@specifix.com> 6462 6463 PR preprocessor/24202 6464 * files.c (_cpp_pop_file_buffer): Set buffer_valid to false. 6465 64662005-11-04 Joseph S. Myers <joseph@codesourcery.com> 6467 6468 * include/cpplib.h (struct cpp_callbacks): Make error take 6469 va_list* parameter. 6470 * errors.c (cpp_error): Update call to callback. 6471 64722005-11-03 Andrew Pinski <pinskia@physics.uc.edu> 6473 6474 PR preprocessor/22042 6475 * macro.c (_cpp_builtin_macro_text): Lower the needed max 6476 buffer size. 6477 (cpp_quote_string): Don't octalify non printable 6478 charactors. 6479 64802005-11-03 Joseph S. Myers <joseph@codesourcery.com> 6481 6482 PR c++/17964 6483 * include/cpplib.h (struct cpp_options): Add client_diagnostic. 6484 (struct cpp_callbacks): Add error. 6485 * errors.c (cpp_error): If client_diagnostic, use error callback. 6486 * charset.c (convert_escape): Don't use %03o in diagnostic. 6487 64882005-10-21 James E Wilson <wilson@specifix.com> 6489 6490 PR preprocessor/15220 6491 * files.c (_cpp_find_file): New parameter angle_brackets. Fix all 6492 callers. Pass to open_file_failed. 6493 (open_file_failed): New parameter angle_brackets. Fix all callers. 6494 Use in print_dep assignment. 6495 * init.c (cpp_read_main_file): Pass additional arg to _cpp_find_file. 6496 * internal.h (_cpp_find_file): Add new parm to declaration. 6497 64982005-10-08 Kazu Hirata <kazu@codesourcery.com> 6499 6500 * configure.ac: Require 64-bit int for arm*-*-*eabi*. 6501 * configure: Regenerate. 6502 65032005-10-04 Ian Lance Taylor <ian@airs.com> 6504 6505 PR preprocessor/13726 6506 * directives.c (check_eol_return_comments): New static function. 6507 (parse_include): Add buf parameter. Change all callers. 6508 (do_include_common): If not discard comments, turn on 6509 save_comments. Pass collected comments to include callback. 6510 * include/cpplib.h (struct cpp_callbacks): Add new parameter to 6511 include callback: cpp_token list. 6512 65132005-09-20 Joseph S. Myers <joseph@codesourcery.com> 6514 6515 * include/cpplib.h (struct cpp_options): Add extended_identifiers. 6516 * init.c (struct lang_flags, lang_defaults): Add 6517 extended_identifiers. 6518 (cpp_set_lang): Use it. 6519 * lex.c (forms_identifier_p): Check extended_identifiers. 6520 65212005-08-30 Jakub Jelinek <jakub@redhat.com> 6522 6523 PR preprocessor/20348 6524 PR preprocessor/20356 6525 * files.c (_cpp_find_file, search_cache): Revert 2004-06-26 and 6526 2004-06-05 changes. 6527 65282005-07-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 6529 6530 * configure.ac (ACX_PROG_CC_WARNING_OPTS): add 6531 -Wmissing-format-attribute. 6532 6533 * configure: Regenerate. 6534 65352005-06-29 Kelley Cook <kcook@gcc.gnu.org> 6536 6537 * all files: Update FSF address in copyright headers. 6538 * makeucnid.c (write_copyright): Update outputted FSF address. 6539 65402005-06-13 Zack Weinberg <zack@codesourcery.com> 6541 6542 * configure.ac: Invoke ZW_CREATE_DEPDIR and 6543 ZW_PROG_COMPILER_DEPENDENCIES. 6544 * aclocal.m4, configure: Regenerate. 6545 * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.base, COMPILE): 6546 New variables. 6547 (distclean): Clean up $(DEPDIR) and its contents. 6548 (.c.o): Use $(COMPILE). 6549 Include $(DEPDIR)/*.Po for most object->header dependencies. 6550 65512005-05-28 Gabriel Dos Reis <gdr@integrable-solutions.net> 6552 6553 * configure.ac: Check declarations for asprintf and vasprintf. 6554 * config.in: Regenerate. 6555 * configure: Likewise. 6556 6557 * charset.c (conversion_loop): Use XRESIZEVEC. 6558 (convert_no_conversion): Likewise. 6559 (convert_using_iconv): Likewise. 6560 (init_iconv_desc): Cast return value of alloca. 6561 (cpp_host_to_exec_charset): Use XNEWVEC. 6562 (emit_numeric_escape): Use XRESIZEVEC. 6563 (cpp_interpret_string): Use XNEWVEC. 6564 (cpp_interpret_string): Use XRESIZEVEC. 6565 (_cpp_interpret_identifier): Cast return value of alloca. 6566 (_cpp_convert_input): Use XNEWVEC and XRESIZEVEC. 6567 * directives.c (glue_header_name): Use XNEWVEC and XRESIZEVEC. 6568 (parse_include): Use XNEWVEC. 6569 (insert_pragma_entry): Rename local variable "new" to 6570 "new_entry". 6571 (save_registered_pragmas): Cast return value of xmemdup. 6572 (destringize_and_run): Same for alloca. 6573 (parse_assertion): Likewise. 6574 (do_assert): Cast allocated storage to proper type. 6575 (cpp_define): Likewise. 6576 (_cpp_define_builtin): Likewise. 6577 (cpp_undef): Likewise. 6578 (handle_assertion): Likewise. 6579 (cpp_push_buffer): Rename local variable "new" to "new_buffer". 6580 * expr.c (CPP_UPLUS): Cast value to type cpp_ttype. 6581 (CPP_UMINUS): Likewise. 6582 (struct cpp_operator): Rename from struct operator. 6583 (_cpp_expand_op_stack): Use XRESIZEVEC. 6584 * files.c (pch_open_file): Use XNEWVEC. 6585 (pch_open_file): Use XRESIZEVEC. 6586 (read_file_guts): Use XNEWVEC and XRESIZEVEC. 6587 (dir_name_of_file): Use XNEWVEC. 6588 (make_cpp_file): Use XCNEW. 6589 (make_cpp_dir): Likewise. 6590 (allocate_file_hash_entries): USE XNEWVEC. 6591 (cpp_included): Cast return value of htab_find_with_hash. 6592 (append_file_to_dir): Use XNEWVEC. 6593 (read_filename_string): Likewise. Use XRESIZEVEC too. 6594 (read_name_map): Cast return value of alloca. Use XRESIZEVEC. 6595 (remap_filename): Use XNEWVEC. 6596 (struct pchf_entry): Move definition out of struct pchf_data. 6597 (_cpp_save_file_entries): Use XCNEWVAR. 6598 (_cpp_read_file_entries): Use XNEWVAR. 6599 * identifiers.c (alloc_node): Use XOBNEW. 6600 * init.c (cpp_create_reader): Use XCNEW. 6601 (cpp_init_builtins): Cast of b->value to enum builtin_type. 6602 (read_original_directory): Cast return value of alloca. 6603 * lex.c (add_line_note): Use XRESIZEVEC. 6604 (warn_about_normalization): Use XNEWVEC. 6605 (_cpp_lex_direct): Cast node->directive_index to (enum cpp_ttype). 6606 (new_buff): Use XNEWVEC. 6607 * line-map.c (linemap_add): Use XRESIZEVEC. 6608 * macro.c (builtin_macro): Cast return value of alloca. 6609 (paste_tokens): Likewise. 6610 (expand_arg): Use XNEWVEC and XRESIZEVEC. 6611 (_cpp_save_parameter): Use XRESIZEVEC. 6612 (create_iso_definition): Cast allocated storage to proper type. 6613 (_cpp_create_definition): Likewise. 6614 (cpp_macro_definition): Use XRESIZEVEC. 6615 * makedepend.c (add_clm): Use XNEW. 6616 (add_dir): Likewise. 6617 * mkdeps.c (munge): Use XNEWVEC. 6618 (deps_init): Use XCNEW. 6619 (deps_add_target): Use XRESIZEVEC. 6620 (deps_add_default_target): Cast return value of alloca. 6621 (deps_add_dep): Use XRESIZEVEC. 6622 (deps_add_vpath): Likewise. Use XNEWVEC too. 6623 (deps_restore): Likewise. 6624 * pch.c (save_idents): Use XNEW and XNEWVEC. 6625 (cpp_save_state): Use XNEW. 6626 (count_defs): Cast return value of htab_find. 6627 (write_defs): Likewise. 6628 (cpp_write_pch_deps): Use XNEWVEC. 6629 (collect_ht_nodes): Use XRESIZEVEC. 6630 (cpp_valid_state): Use XNEWVEC. 6631 (save_macros): Use XRESIZEVEC. Cast return value of xmemdup. 6632 * symtab.c (ht_create): Use XCNEW. 6633 (ht_lookup_with_hash): Cast return value of obstack_copy0. 6634 (ht_expand): Use XCNEWVEC. 6635 * system.h (HAVE_DESIGNATED_INITIALIZERS): False if __cplusplus. 6636 (bool): Do not define if __cplusplus. 6637 66382005-05-12 Zack Weinberg <zack@codesourcery.com> 6639 6640 * directives.c (#sccs table entry): Mark IN_I, consistent with #ident. 6641 (do_sccs): Delete function definition, #define to do_ident. 6642 (do_ident): Don't hardwire directive name. 6643 66442005-05-12 Ryota Kunisawa <kunisawa@access.co.jp> 6645 6646 PR bootstrap/21230 6647 * configure: Regenerate. 6648 66492005-04-27 Andris Pavenis <pavenis@latnet.lv> 6650 6651 * files.c: Include io.h for DJGPP to get prototype of setmode. 6652 66532005-04-19 Per Bothner <per@bothner.com> 6654 6655 PR preprocessor/20907 6656 * line-map.c (linemap_line_start): Fix bug when we need to increse 6657 column_bits but can re-use the current line_map. 6658 66592005-04-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 6660 6661 * system.h (fopen, fdopen, freopen): Define these to the unlocked 6662 libiberty functions. 6663 66642005-04-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 6665 6666 * configure.ac (libcpp_UNLOCKED_FUNCS): New. 6667 (AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for libcpp_UNLOCKED_FUNCS. 6668 * system.h (putchar, getc, getchar, clearerr, feof, fileno, 6669 fflush, fgetc, fgets, ferror, fread): Redefine to the associated 6670 _unlocked function. 6671 (fwrite_unlocked): Fix prototype. 6672 6673 * configure, config.in: Regenerate. 6674 66752005-04-05 Jakub Jelinek <jakub@redhat.com> 6676 6677 PR preprocessor/19475 6678 * macro.c (create_iso_definition): For < ISO C99, don't 6679 pedwarn if there is no whitespace between macro name and its 6680 replacement, but the replacement starts with a basic character 6681 set character. 6682 66832005-03-28 Andreas Jaeger <aj@suse.de> 6684 6685 * lex.c (warn_about_normalization): Cast field width to int to 6686 avoid warning. 6687 66882005-03-19 Joseph S. Myers <joseph@codesourcery.com> 6689 6690 * configure.ac: Consistently use solaris2.1[0-9]* instead of 6691 solaris2.1[0-9]. 6692 * configure: Regenerate. 6693 66942005-03-15 Geoffrey Keating <geoffk@apple.com> 6695 6696 * charset.c (_cpp_valid_ucn): In identifiers, reject a partial 6697 UCN rather than printing an error. 6698 66992005-03-14 Geoffrey Keating <geoffk@apple.com> 6700 6701 * lex.c (forms_identifier_p): Disable UCNs in C89 mode. 6702 67032005-03-14 Geoffrey Keating <geoffk@apple.com> 6704 6705 * init.c (cpp_create_reader): Default warn_normalize to normalized_C. 6706 * charset.c: Update for new format of ucnid.h. 6707 (ucn_valid_in_identifier): Update for new format of ucnid.h. 6708 Add NST parameter, and update it; update callers. 6709 (cpp_valid_ucn): Add NST parameter, update callers. Replace abort 6710 with cpp_error. 6711 (convert_ucn): Pass normalize_state to cpp_valid_ucn. 6712 * internal.h (struct normalize_state): New. 6713 (INITIAL_NORMALIZE_STATE): New. 6714 (NORMALIZE_STATE_RESULT): New. 6715 (NORMALIZE_STATE_UPDATE_IDNUM): New. 6716 (_cpp_valid_ucn): New. 6717 * lex.c (warn_about_normalization): New. 6718 (forms_identifier_p): Add normalize_state parameter, update callers. 6719 (lex_identifier): Add normalize_state parameter, update callers. Keep 6720 the state current. 6721 (lex_number): Likewise. 6722 (_cpp_lex_direct): Pass normalize_state to subroutines. Check 6723 it with warn_about_normalization. 6724 * makeucnid.c: New. 6725 * ucnid.h: Replace. 6726 * ucnid.pl: Remove. 6727 * ucnid.tab: Make appropriate for input to makeucnid.c. Remove 6728 comments about obsolete version of C++. 6729 * include/cpplib.h (enum cpp_normalize_level): New. 6730 (struct cpp_options): Add warn_normalize field. 6731 67322005-03-11 Geoffrey Keating <geoffk@apple.com> 6733 6734 * directives.c (glue_header_name): Update call to cpp_spell_token. 6735 * internal.h (_cpp_interpret_identifier): New. 6736 * charset.c (_cpp_interpret_identifier): New. 6737 (_cpp_valid_ucn): Allow UCN version of '$'. 6738 * lex.c (lex_identifier): Add extra parameter to indicate if initial 6739 character was '$' or '\'. Support identifiers with UCNs. 6740 (forms_identifier_p): Allow UCNs. 6741 (_cpp_lex_direct): Pass extra parameter to lex_identifier. 6742 (utf8_to_ucn): New. 6743 (cpp_spell_token): Add FORSTRING parameter. Use it. 6744 (cpp_token_as_text): Update call to cpp_spell_token. 6745 (cpp_output_token): Write UCNs back out. 6746 (stringify_arg): Update call to cpp_spell_token. 6747 (paste_tokens): Likewise. 6748 (cpp_macro_definition): Likewise. 6749 * macro.c (stringify_arg): Likewise. 6750 (paste_tokens): Likewise. 6751 (cpp_macro_definition): Likewise. 6752 * include/cpplib.h: Add parameter to cpp_spell_token. 6753 67542005-03-04 Jakub Jelinek <jakub@redhat.com> 6755 6756 PR bootstrap/20282 6757 PR bootstrap/20305 6758 * macro.c (replace_args, cpp_get_token): Copy whole 6759 cpp_token_u instead of just cpp_string field from it. 6760 67612005-02-28 Devang Patel <dpatel@apple.com> 6762 6763 * directives.c (do_line): Save sysp early before line table is 6764 realloc'ed. 6765 67662005-02-20 Zack Weinberg <zack@codesourcery.com> 6767 6768 PR 18785 6769 * charset.c (LAST_POSSIBLY_BASIC_SOURCE_CHAR): New helper macro. 6770 (cpp_host_to_exec_charset): New function. 6771 * include/cpplib.h: Declare cpp_host_to_exec_charset. 6772 67732005-02-19 Devang Patel <dpatel@apple.com> 6774 6775 * charset.c (_cpp_convert_input): Check '\r' before inserting 6776 '\n' at the end. 6777 67782005-02-15 Eric Christopher <echristo@redhat.com> 6779 6780 PR preprocessor/19077 6781 * macro.c (cpp_macro_definition): Move handling of whitespace 6782 to PREV_WHITE conditional. Remove overloading of len 6783 variable. 6784 67852005-02-14 Kazu Hirata <kazu@cs.umass.edu> 6786 6787 * directives.c, files.c, init.c, internal.h, macro.c, pch.c, 6788 traditional.c: Update copyright. 6789 67902005-02-14 Paolo Bonzini <bonzini@gnu.org> 6791 6792 PR bootstrap/19818 6793 * configure.ac: Check for declaration of basename and getopt. 6794 * config.in: Regenerate. 6795 * configure: Regenerate. 6796 * internal.h (ustrcspn): New. 6797 * macro.c (create_iso_definition): Fix allocation of memory. 6798 (padding_token): Add cast to remove const-ness. 6799 * pch.c (cpp_read_state): Use ustrcspn. 6800 68012005-02-08 Mike Stump <mrs@apple.com> 6802 6803 * files.c (pchf_adder): Remove. 6804 (struct pchf_adder_info): Likewise. 6805 (_cpp_save_file_entries): Write out all files so that #import works. 6806 68072005-01-23 Joseph S. Myers <joseph@codesourcery.com> 6808 6809 * configure: Regenerate. 6810 68112005-01-11 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de> 6812 6813 * include/cpplib.h (c_lang): Fix comment to say cpp_create_reader. 6814 6815 * include/cpplib.h: Also update copyright years. 6816 68172005-01-03 Geoffrey Keating <geoffk@apple.com> 6818 6819 * files.c (_cpp_find_file): Add files found by search_path_exhausted 6820 to the list of all files. 6821 68222005-01-01 Gabriel Dos Reis <gdr@integrable-solutions.net> 6823 6824 * internal.h: Update references to Cpp lib filenames. 6825 * directives.c: Likewise. 6826 * init.c: Likewise. 6827 * macro.c: Likewise. 6828 * traditional.c: Likewise. 6829 68302004-12-15 Eric Botcazou <ebotcazou@libertysurf.fr> 6831 6832 PR preprocessor/15167 6833 * files.c (destroy_cpp_file): New function. 6834 (should_stack_file): Make a new file if the 6835 compared file is still stacked. 6836 68372004-11-28 Nathanael Nerode <neroden@gcc.gnu.org> 6838 6839 PR preprocessor/17610 6840 * directives.c (do_include_common): Error out if an empty filename 6841 is given for #include (or #include_next or #import). 6842 68432004-11-27 Roger Sayle <roger@eyesopen.com> 6844 Zack Weinberg <zack@codesourcery.com> 6845 6846 * internal.h: Replace all uses of uchar with unsigned char. 6847 * include/cpp-id-data.h: Likewise. Guard typedef of uchar 6848 with !IN_GCC, so uchar is only defined whilst building libcpp. 6849 68502004-11-24 Kelley Cook <kcook@gcc.gnu.org> 6851 6852 * aclocal.m4: Regenerate. 6853 68542004-11-24 Roger Sayle <roger@eyesopen.com> 6855 6856 PR preprocessor/15824 6857 * configure.ac: Correct HAVE_UCHAR test to #include <sys/types.h> 6858 directly, instead of the non-existant "system.h" and "ansidecl.h". 6859 * configure: Regenerate. 6860 68612004-11-23 Daniel Jacobowitz <dan@codesourcery.com> 6862 Joseph Myers <joseph@codesourcery.com> 6863 6864 * internal.h (struct lexer_state): Add in_deferred_pragma. 6865 * directives.c (struct pragma_entry): Add allow_expansion. 6866 (insert_pragma_entry): Take allow_expansion flag. 6867 (register_pragma): Likewise. 6868 (cpp_register_pragma): Likewise. 6869 (_cpp_init_internal_pragmas): Update calls to cpp_register_pragma. 6870 (do_pragma): Honor allow_expansion. 6871 (cpp_handle_deferred_pragma): Set in_deferred_pragma. 6872 * include/cpplib.h (cpp_register_pragma): Update prototype. 6873 68742004-11-18 Daniel Jacobowitz <dan@codesourcery.com> 6875 Mark Mitchell <mark@codesourcery.com> 6876 6877 * configure.ac (i[34567]86-*-solaris2.1[0-9]*): Set 6878 need_64bit_hwint=yes. 6879 * configure: Regenerate. 6880 68812004-11-09 Joseph S. Myers <joseph@codesourcery.com> 6882 6883 * Makefile.in ($(PACKAGE).pot): New rule. Depend on 6884 po/$(PACKAGE).pot. 6885 (po/$(PACKAGE).pot): Use ":" instead of "," in --keyword 6886 arguments. Add keywords _, N_, SYNTAX_ERROR and SYNTAX_ERROR2. 6887 Remove local srcdir path from generated file. 6888 68892004-11-04 Zack Weinberg <zack@codesourcery.com> 6890 Gerald Pfeifer <gerald@pfeifer.com> 6891 6892 * internal.h (HAVE_ICONV): Undefine if we do not have HAVE_ICONV_H 6893 as well. 6894 68952004-10-27 Zack Weinberg <zack@codesourcery.com> 6896 6897 PR 18075 6898 * directives.c (do_pragma): Do not defer pragmas which are unknown. 6899 (cpp_handle_deferred_pragma): Add cast to silence warning. 6900 69012004-10-14 Joseph S. Myers <jsm@polyomino.org.uk> 6902 6903 * errors.c (_cpp_begin_message): Print "error: " for errors. 6904 69052004-10-10 Andreas Jaeger <aj@suse.de> 6906 6907 * makedepend.c: Include mkdeps.h for prototype of deps_add_vpath. 6908 * Makefile.in (makedepend.o): Add dependency on mkdeps.h. 6909 69102004-10-08 Andrew Pinski <pinskia@physics.uc.edu> 6911 6912 * pch.c (cpp_write_pch_state): Remove variable z as it is not 6913 used. 6914 (cpp_read_state): Remove unused variables, m, d and mac_count. 6915 69162004-09-29 Per Bothner <per@bothner.com> 6917 6918 * directives.c (cpp_handle_deferred_pragma): Save, clear and restore 6919 cb.line_change. Otherwise do_pragma will call the line_change 6920 call-back with a meaningless line number. 6921 69222004-09-24 Zack Weinberg <zack@codesourcery.com> 6923 6924 * configure.ac: Move AC_PROG_MAKE_SET, AC_PROG_INSTALL to 6925 programs cluster. Use ACX_PROG_CC_WARNING_OPTS, 6926 ACX_PROG_CC_WARNING_ALMOST_PEDANTIC, ACX_PROG_CC_WARNINGS_ARE_ERRORS. 6927 * aclocal.m4, configure: Regenerate. 6928 * init.c: Include localedir.h. 6929 * Makefile.in (WARN_CFLAGS, ALL_CFLAGS): New variables. 6930 (DEFS): Delete. 6931 (.c.o): Use $(ALL_CFLAGS). 6932 (localedir.h, localedir.hs): New rules. 6933 (clean): Use rm -rf to remove directories. 6934 (distclean): Also delete localedir.h and localedir.hs. 6935 (init.o): Update dependencies. 6936 69372004-09-22 Kelley Cook <kcook@gcc.gnu.org> 6938 6939 * Makefile.in (aclocal.m4): Update dependencies. 6940 * configure.ac (AC_CONFIG_MACRO_DIR): New. 6941 * aclocal.m4, configure: Regenerate. 6942 69432004-09-17 Zack Weinberg <zack@codesourcery.com> 6944 6945 * charset.c (_cpp_destroy_iconv, emit_numeric_escape) 6946 (_cpp_convert_input, _cpp_default_encoding): Add comments. 6947 Some other comments in this file also tweaked. 6948 6949 * directives.c (do_pragma): Save current buffer position 6950 before lexing the pragma keywords; don't call 6951 _cpp_backup_tokens in the defer_pragmas case. 6952 69532004-09-15 Per Bothner <per@bothner.com> 6954 6955 * include/line-map.h (line_map_start): Add parameter names so 6956 preceding comment makes sense. 6957 (linemap_add): Remove from comment mention of non-existing parameter. 6958 69592004-09-09 Matt Austern <austern@apple.com> 6960 Zack Weinberg <zack@codesourcery.com> 6961 6962 * include/cpplib.h (TTYPE_TABLE): Remove CPP_ and SPELL_ 6963 prefixes throughout. Add entry for PRAGMA. Remove 6964 unnecessary "= 0" from EQ. 6965 (enum cpp_ttype): Adjust OP and TK definitions to restore 6966 prefixes, via token-paste. 6967 (CPP_LAST_EQ, CPP_FIRST_DIGRAPH, CPP_LAST_PUNCTUATOR, CPP_LAST_CPP_OP): 6968 Change from #defines to additional cpp_ttype enumerators. 6969 (struct cpp_options): Add defer_pragmas. 6970 (cpp_handle_deferred_pragma): Prototype new interface. 6971 6972 * internal.h (struct cpp_reader): Add directive_result. 6973 * directives.c (struct pragma_entry): Add is_internal field; 6974 give boolean fields type bool. 6975 (start_directive): Initialize pfile->directive_result.type. 6976 (_cpp_do__Pragma): Likewise. 6977 (run_directive): Do not crash if pfile->buffer->prev is NULL. 6978 (insert_pragma_entry): Add 'internal' argument; set new->is_internal 6979 from it. 6980 (register_pragma): New static function, bulk of former 6981 cpp_register_pragma here; add 'internal' argument, pass along 6982 to insert_pragma_entry. 6983 (cpp_register_pragma): Now a wrapper around register_pragma which 6984 always passes false for 'internal' argument. 6985 (_cpp_init_internal_pragmas): Call register_pragma directly, passing 6986 true for 'internal'. 6987 (do_pragma): If CPP_OPTION (pfile, defer_pragmas) and this isn't 6988 an internal pragma, save text till the end of the line as a CPP_PRAGMA 6989 token instead of executing the pragma. 6990 (cpp_handle_deferred_pragma): New interface. 6991 * lex.c (token_spellings): Adjust OP and TK definitions to 6992 match changes to cpplib.h. 6993 (_cpp_lex_token): Check for a directive-result token and 6994 return it if present. 6995 (cpp_token_val_index): Handle CPP_PRAGMA. 6996 * macro.c (cpp_builtin_macro_text): Correct comment. 6997 (builtin_macro): Handle directive-result tokens from _cpp_do__Pragma. 6998 69992004-09-06 Serge Belyshev <belyshev@lubercy.com> 7000 7001 PR preprocessor/14699 7002 * symtab.c (ht_dump_statistics): Change type of sum_of_squares 7003 from size_t to double. 7004 70052004-08-28 Andreas Schwab <schwab@suse.de> 7006 Andreas Jaeger <aj@suse.de> 7007 7008 * configure.ac: Set PACKAGE correctly. 7009 * configure: Regenerated. 7010 70112004-08-25 Paolo Bonzini <bonzini@gnu.org> 7012 7013 * Makefile.in: Add back top_builddir. 7014 70152004-08-25 Paolo Bonzini <bonzini@gnu.org> 7016 7017 * configure.ac: Replace Automake macro invocations 7018 with manual Autoconf checks and substitutions. 7019 * configure: Regenerate. 7020 * aclocal.m4: Regenerate. 7021 * config.in: Regenerate. 7022 * Makefile.am: Removed. 7023 * Makefile.in: Heavy simplification and reorganization. 7024 70252004-08-09 Mark Mitchell <mark@codesourcery.com> 7026 7027 * configure.ac (arm*-*-eabi*): New target. 7028 (arm*-*-symbianelf*): Likewise. 7029 * configure: Regenerated. 7030 70312004-07-24 Bernardo Innocenti <bernie@develer.com> 7032 7033 * internal.h (xnew, xcnew, xnewvec, xcnewvec, xobnew): Remove. 7034 * directives.c: Use XNEW-family macros from libiberty. 7035 * lex.c: Likewise. 7036 * macro.c: Likewise. 7037 * cpplib.h (cpp_deps_style): Export enum with name. 7038 70392004-07-23 Matthias Klose <doko@debian.org> 7040 7041 * init.c (init_library): Use PACKAGE for the text domain. 7042 70432004-07-16 Andris Pavenis <pavenis@latnet.lv> 7044 7045 PR preprocessor/16366 7046 * internal.h (struct cpp_reader): New field dir_hash. 7047 * files.c (make_cpp_dir): Use dir_hash, not file_hash. 7048 (_cpp_init_files, _cpp_cleanup_files): Update for new field. 7049 70502004-07-04 Neil Booth <neil@duron.akihabara.co.uk> 7051 7052 PR preprocessor/16192 7053 PR preprocessor/15913 7054 PR preprocessor/15572 7055 * expr.c (_cpp_parse_expr): Handle remaining cases where an 7056 expression is missing. 7057 * init.c (post_options): Traditional cpp doesn't do // comments. 7058 70592004-06-30 Per Bothner <per@bothner.com> 7060 7061 * include/line-map.h (fileline): Remove old typedef. 7062 * internal.h (struct cpp_reader): Use source_location typedef instead. 7063 70642004-06-26 Zack Weinberg <zack@codesourcery.com> 7065 7066 Partially revert patch of 2004-06-05. 7067 * files.c (search_cache): Remove pfile argument. Don't check 7068 for file that would be found by "" or <> search here... 7069 (_cpp_find_file): ...do it here, before calling find_file_in_dir. 7070 Do not apply directory-of-current-file correction to files 7071 found by this check. Rearrange code slightly. 7072 70732004-06-21 Geoffrey Keating <geoffk@apple.com> 7074 7075 * files.c (should_stack_file): Correct swapped parameters to call 7076 to cb.read_pch. 7077 * pch.c (cpp_valid_state): Handle -fpreprocessed. 7078 70792004-06-15 Paolo Bonzini <bonzini@gnu.org> 7080 7081 * Makefile.in: Regenerate with automake 1.8.5. 7082 * aclocal.m4: Likewise. 7083 * configure: Regenerate. 7084 70852004-06-11 Zack Weinberg <zack@codesourcery.com> 7086 7087 * configure.ac: Don't invoke ACX_HEADER_STDBOOL. 7088 * configure, config.in: Regenerate. 7089 * system.h: Unconditionally define bool as unsigned char, 7090 BOOL_BITFIELD as unsigned int. 7091 * .cvsignore: New file. 7092 70932004-06-09 Geoffrey Keating <geoffk@apple.com> 7094 7095 * traditional.c (push_replacement_text): Set macro->traditional. 7096 (save_replacement_text): Likewise. 7097 * pch.c (cpp_write_pch_state): Don't write list of defined macros. 7098 (struct save_macro_item): Delete. 7099 (struct save_macro_data): Use a character array not the previous 7100 structured format. 7101 (save_macros): Save macro as text not as internal structures. 7102 (cpp_prepare_state): Update for changes to save_macro_data. 7103 (cpp_read_state): Don't read macros defined in PCH. Restore 7104 -D macros as text. 7105 * macro.c (create_iso_definition): Honour alloc_subobject. 7106 Clear traditional flag. 7107 (_cpp_create_definition): Honour alloc_subobject. 7108 * lex.c (cpp_token_val_index): New. 7109 * internal.h: Include cpp-id-data.h. 7110 (uchar): Move definition to cpp-id-data.h. 7111 (U): Likewise. 7112 (cpp_macro): Likewise. 7113 * directives.c (struct answer): Move to cpp-id-data.h. 7114 (do_assert): Honour alloc_subobject. 7115 7116 * include/symtab.h (struct ht): Add field 'alloc_subobject'. 7117 * include/cpplib.h (struct cpp_string): Add GTY marker. 7118 (enum cpp_token_fld_kind): New. 7119 (struct cpp_token): Add GTY markers. 7120 (cpp_token_val_index): Prototype. 7121 (CPP_HASHNODE_VALUE_IDX): New. 7122 (struct cpp_hashnode): Don't skip fields of 'value' when marking. 7123 * include/cpp-id-data.h: New file. 7124 71252004-06-09 Paolo Bonzini <bonzini@gnu.org> 7126 7127 * Makefile.am (all-local): New. 7128 * Makefile.in: Regenerate. 7129 71302004-06-06 Roger Sayle <roger@eyesopen.com> 7131 7132 * Makefile.am (LIBICONV): Declare. 7133 (makedepend_LDADD): Use LIBICONV. 7134 * Makefile.in: Regenerate. 7135 71362004-06-05 Andrew Pinski <pinskia@physics.uc.edu> 7137 7138 * Makefile.am (LIBINTL): Declare 7139 (makedepend_LDADD): Use LIBINTL. 7140 * Makefile.in: Regenerate. 7141 71422004-06-05 Zack Weinberg <zack@codesourcery.com> 7143 7144 * Makefile.am: Add makedepend. 7145 * Makefile.in, aclocal.m4: Regenerate. 7146 * charset.c: Insert a space to avoid a warning. 7147 * directives.c: Include mkdeps.h. 7148 (_cpp_handle_directive): Reenable macro expander if appropriate. 7149 (undefine_macros): Inline body of _cpp_free_definition for speed. 7150 Do not call undef callback or _cpp_warn_if_unused_macro. 7151 (cpp_get_deps): New interface. 7152 * files.c (search_cache): Add pfile argument. Check for file 7153 that would be found by "" or <> search here... 7154 (_cpp_find_file): ...not here. Correct recorded start_dir of 7155 files found by directory-of-current-file search that would be 7156 found by "" or <> search. 7157 * init.c (cpp_add_dependency_target): Delete. 7158 * internal.h (struct lexer_state): Add discarding_output flag. 7159 * lex.c (lex_identifier): Compute hash function while scanning. 7160 * macro.c (cpp_scan_nooutput): Disable macro expansion outside 7161 directives. 7162 * makedepend.c: New file. 7163 * mkdeps.c (struct deps): Add vpath vector. 7164 (apply_vpath, deps_add_vpath): New function. 7165 (deps_free): Free vpath vector. 7166 (deps_add_dep, deps_add_target): Use apply_vpath. 7167 * symtab.c (calc_hash): Use HT_HASHSTEP and HT_FINISH. 7168 (ht_lookup_with_hash): New function. 7169 * cpplib.h, mkdeps.h: Update prototypes. 7170 * symtab.h: Update prototypes. 7171 (HT_HASHSTEP, HT_FINISH): New macros. 7172 71732004-05-29 Geoffrey Keating <geoffk@apple.com> 7174 7175 * symtab.c (ht_create): Set entries_owned. 7176 (ht_destroy): Honour entries_owned. 7177 (ht_expand): Likewise. 7178 (ht_load): New. 7179 * include/symtab.h (struct ht): New field 'entries_owned' 7180 (ht_load): New prototype. 7181 71822004-05-26 Paolo Bonzini <bonzini@gnu.org> 7183 7184 PR bootstrap/15651 7185 * configure.ac: Fix m4 quoting when picking 7186 the size of HOST_WIDE_INT. 7187 * configure: Regenerate. 7188 71892004-05-25 Paolo Bonzini <bonzini@gnu.org> 7190 7191 * Makefile.am: the correct directory for 7192 gettext include files is given by @INCINTL@. 7193 * Makefile.in: Regenerate. 7194 71952004-05-24 Paolo Bonzini <bonzini@gnu.org> 7196 7197 * system.h [!ENABLE_NLS]: dgettext takes two 7198 parameters. 7199 72002004-05-23 Paolo Bonzini <bonzini@gnu.org> 7201 7202 Moved libcpp from the gcc subdirectory to the toplevel. 7203 * Makefile.am: New file. 7204 * Makefile.in: Regenerate. 7205 * configure.ac: New file. 7206 * configure: Regenerate. 7207 * config.in: Regenerate. 7208 * charset.c: Moved from gcc/cppcharset.c. Add note about 7209 brokenness of input charset detection. Adjust for change 7210 in name of cppucnid.h. 7211 * errors.c: Moved from gcc/cpperror.c. Do not include intl.h. 7212 * expr.c: Moved from gcc/cppexp.c. 7213 * files.c: Moved from gcc/cppfiles.c. Do not include intl.h. 7214 Remove #define of O_BINARY, it is in system.h. 7215 * identifiers.c: Moved from gcc/cpphash.c. 7216 * internal.h: Moved from gcc/cpphash.h. Change header 7217 guard name. All other files adjusted to match name change. 7218 * init.c: Moved from gcc/cppinit.c. 7219 (init_library) [ENABLE_NLS]: Call bindtextdomain. 7220 * lex.c: Moved from gcc/cpplex.c. 7221 * directives.c: Moved from gcc/cpplib.c. 7222 * macro.c: Moved from gcc/cppmacro.c. 7223 * pch.c: Moved from gcc/cpppch.c. Do not include intl.h. 7224 * traditional.c: Moved from gcc/cpptrad.c. 7225 * ucnid.h: Moved from gcc/cppucnid.h. Change header 7226 guard name. 7227 * ucnid.pl: Moved from gcc/cppucnid.pl. 7228 * ucnid.tab: Moved from gcc/cppucnid.tab. Change header 7229 guard name. 7230 * symtab.c: Moved from gcc/hashtable.c. 7231 * line-map.c: Moved from gcc. Do not include intl.h. 7232 * mkdeps.c: Moved from gcc. 7233 * system.h: New file. 7234 * include/cpplib.h: Moved from gcc. Change header guard name. 7235 * include/line-map.h: Moved from gcc. Change header guard name. 7236 * include/mkdeps.h: Moved from gcc. Change header guard name. 7237 * include/symtab.h: Moved from gcc/hashtable.h. Change header 7238 guard name. 7239 7240Copyright (C) 2004-2022 Free Software Foundation, Inc. 7241 7242Copying and distribution of this file, with or without modification, 7243are permitted in any medium without royalty provided the copyright 7244notice and this notice are preserved. 7245