blob: 51b11e05271ad3995a1b4dcacaa8dcdd9c4e0995 [file] [log] [blame]
2023-07-07 Release Manager
* GCC 10.5.0 released.
2022-08-02 Lewis Hyatt <lhyatt@gmail.com>
Backported from master:
2022-07-10 Lewis Hyatt <lhyatt@gmail.com>
PR preprocessor/97498
* directives.c (destringize_and_run): Override the location of
the CPP_PRAGMA token from a _Pragma directive to the location of
the expansion point, as is done for the tokens lexed from it.
2022-06-28 Release Manager
* GCC 10.4.0 released.
2022-06-15 Jakub Jelinek <jakub@redhat.com>
Backported from master:
2022-05-29 Jakub Jelinek <jakub@redhat.com>
PR preprocessor/105732
* expr.c (_cpp_parse_expr): Handle CPP_PADDING by just another
token.
2022-05-10 Jakub Jelinek <jakub@redhat.com>
Backported from master:
2022-02-01 Jakub Jelinek <jakub@redhat.com>
PR preprocessor/104147
* macro.c (funlike_invocation_p): For padding prefer a token
with val.source non-NULL especially if it has PREV_WHITE set
on val.source->flags. Add gcc_assert that CPP_PADDING tokens
don't have PREV_WHITE set in flags.
2022-05-10 Jakub Jelinek <jakub@redhat.com>
Backported from master:
2022-02-01 Jakub Jelinek <jakub@redhat.com>
* directives.c (destringize_and_run): Push &pfile->avoid_paste
instead of a copy of pfile->directive_result for the CPP_PADDING
case.
2022-05-10 Jakub Jelinek <jakub@redhat.com>
Backported from master:
2021-12-30 Jakub Jelinek <jakub@redhat.com>
PR preprocessor/89971
* macro.c (replace_args): For ##__VA_OPT__, if __VA_OPT__ expands
to no tokens at all, drop PASTE_LEFT flag from the previous token.
2021-05-07 Jakub Jelinek <jakub@redhat.com>
Backported from master:
2021-05-07 Jakub Jelinek <jakub@redhat.com>
PR c/100450
* lex.c (cpp_avoid_paste): Handle token1 CPP_PRAGMA like CPP_NAME.
2021-04-13 Eric Botcazou <ebotcazou@adacore.com>
* include/line-map.h (IS_MACRO_LOC): Delete.
* line-map.c (linemap_location_from_macro_expansion_p): Test
LINEMAPS_MACRO_LOWEST_LOCATION of the linemap.
2021-04-08 Release Manager
* GCC 10.3.0 released.
2021-02-03 Nathan Sidwell <nathan@acm.org>
PR preprocessor/95253
* mkdeps.c (munge): Do not escape ':'.
2020-10-05 Jakub Jelinek <jakub@redhat.com>
Backported from master:
2020-09-26 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/97163
* lex.c (search_line_fast): Only use _ARCH_PWR8 Altivec version
for GCC >= 4.5.
2020-07-29 Tiziano Müller <tiziano.mueller@chem.uzh.ch>
* init.c (builtin_array): Add xref comment.
* traditional.c (fun_like_macro): Add HAS_INCLUDE codes.
2020-07-23 Release Manager
* GCC 10.2.0 released.
2020-05-07 Release Manager
* GCC 10.1.0 released.
2020-02-14 Jakub Jelinek <jakub@redhat.com>
Partially implement P1042R1: __VA_OPT__ wording clarifications
PR preprocessor/92319
* macro.c (expand_arg): Move declarations before vaopt_state
definition.
(class vaopt_state): Move enum update_type definition earlier. Remove
m_allowed member, add m_arg and m_update members.
(vaopt_state::vaopt_state): Change last argument from bool any_args
to macro_arg *arg, initialize m_arg and m_update instead of m_allowed.
(vaopt_state::update): When bumping m_state from 1 to 2 and m_update
is ERROR, determine if __VA_ARGS__ expansion has any non-CPP_PADDING
tokens and set m_update to INCLUDE if it has any, DROP otherwise.
Return m_update instead of m_allowed ? INCLUDE : DROP in m_state >= 2.
(replace_args, create_iso_definition): Adjust last argument to
vaopt_state ctor.
2020-02-05 Martin Sebor <msebor@redhat.com>
* include/cpplib.h (cpp_builtin_type): Remove trailing comma to
avoid pedantic warnings in C++ 98 mode.
2020-02-04 Jakub Jelinek <jakub@redhat.com>
* macro.c (builtin_has_include): Diagnose __has_include* use outside
of preprocessing directives.
PR preprocessor/93545
* macro.c (cpp_get_token_no_padding): New function.
(builtin_has_include): Use it instead of cpp_get_token. Don't check
SEEN_EOL.
2020-02-01 Andrew Burgess <andrew.burgess@embecosm.com>
* configure: Regenerate.
2020-01-28 Nathan Sidwell <nathan@acm.org>
PR preprocessor/93452
* internal.h (struct spec_nodes): Drop n__has_include{,_next}.
* directives.c (lex_macro_node): Don't check __has_include redef.
* expr.c (eval_token): Drop __has_include eval.
(parse_has_include): Move to ...
* macro.c (builtin_has_include): ... here.
(_cpp_builtin_macro_text): Eval __has_include{,_next}.
* include/cpplib.h (enum cpp_builtin_type): Add BT_HAS_INCLUDE{,_NEXT}.
* init.c (builtin_array): Add them.
(cpp_init_builtins): Drop __has_include{,_next} init here ...
* pch.c (cpp_read_state): ... and here.
* traditional.c (enum ls): Drop has_include states ...
(_cpp_scan_out_logical_line): ... and here.
2020-01-27 Andrew Burgess <andrew.burgess@embecosm.com>
* configure: Regenerate.
2020-01-24 Nathan Sidwell <nathan@acm.org>
* expr.c (parse_has_include): Remove bogus controlling macro code.
2020-01-20 Nathan Sidwell <nathan@acm.org>
PR preprocessor/80005
* include/cpplib.h (BT_HAS_ATTRIBUTE): Fix comment.
* internal.h (struct lexer_state): Delete in__has_include field.
(struct spec_nodes): Rename n__has_include{,_next}__ fields.
(_cpp_defined_macro_p): New.
(_cpp_find_file): Add has_include parm.
* directives.c (lex_macro_node): Combine defined,
__has_inline{,_next} checking.
(do_ifdef, do_ifndef): Use _cpp_defined_macro_p.
(_cpp_init_directives): Refactor.
* expr.c (parse_defined): Use _cpp_defined_macro_p.
(eval_token): Adjust parse_has_include calls.
(parse_has_include): Add OP parameter. Reimplement.
* files.c (_cpp_find_file): Add HAS_INCLUDE parm. Use it to
inhibit error message.
(_cpp_stack_include): Adjust _cpp_find_file call.
(_cpp_fake_include, _cpp_compare_file_date): Likewise.
(open_file_failed): Remove in__has_include check.
(_cpp_has_header): Adjust _cpp_find_file call.
* identifiers.c (_cpp_init_hashtable): Don't init
__has_include{,_next} here ...
* init.c (cpp_init_builtins): ... init them here. Define as
macros.
(cpp_read_main_file): Adjust _cpp_find_file call.
* pch.c (cpp_read_state): Adjust __has_include{,_next} access.
* traditional.c (_cpp_scan_out_locgical_line): Likewise.
PR preprocessor/93306
* expr.c (parse_has_include): Refactor. Check skip_eval before
looking.
2020-01-10 David Malcolm <dmalcolm@redhat.com>
* include/line-map.h (class diagnostic_path): New forward decl.
(rich_location::get_path): New accessor.
(rich_location::set_path): New function.
(rich_location::m_path): New field.
* line-map.c (rich_location::rich_location): Initialize m_path.
2020-01-01 Jakub Jelinek <jakub@redhat.com>
Update copyright years.
2019-12-18 David Malcolm <dmalcolm@redhat.com>
PR preprocessor/92982
* charset.c
(cpp_string_location_reader::cpp_string_location_reader): Delete
initialization of m_line_table.
* include/cpplib.h (cpp_string_location_reader::m_line_table):
Delete unused member.
2019-12-14 Jakub Jelinek <jakub@redhat.com>
PR preprocessor/92919
* charset.c (wide_str_to_charconst): If str contains just the
NUL terminator, punt quietly.
2019-12-09 David Malcolm <dmalcolm@redhat.com>
* include/line-map.h (label_text::label_text): Make private.
(label_text::borrow): New.
(label_text::take): New.
(label_text::take_or_copy): New.
2019-12-09 Lewis Hyatt <lhyatt@gmail.com>
PR preprocessor/49973
* generated_cpp_wcwidth.h: New file generated by
../contrib/unicode/gen_wcwidth.py, supports new cpp_wcwidth function.
* charset.c (compute_next_display_width): New function to help
implement display columns.
(cpp_byte_column_to_display_column): Likewise.
(cpp_display_column_to_byte_column): Likewise.
(cpp_wcwidth): Likewise.
* include/cpplib.h (cpp_byte_column_to_display_column): Declare.
(cpp_display_column_to_byte_column): Declare.
(cpp_wcwidth): Declare.
(cpp_display_width): New function.
2019-11-14 Joseph Myers <joseph@codesourcery.com>
* charset.c (narrow_str_to_charconst): Make CPP_UTF8CHAR constants
unsigned for C.
* init.c (lang_defaults): Set utf8_char_literals for GNUC2X and
STDC2X.
2019-11-07 Jakub Jelinek <jakub@redhat.com>
PR c++/91370 - Implement P1041R4 and P1139R2 - Stronger Unicode reqs
* charset.c (narrow_str_to_charconst): Add TYPE argument. For
CPP_UTF8CHAR diagnose whenever number of chars is > 1, using
CPP_DL_ERROR instead of CPP_DL_WARNING.
(wide_str_to_charconst): For CPP_CHAR16 or CPP_CHAR32, use
CPP_DL_ERROR instead of CPP_DL_WARNING when multiple char16_t
or char32_t chars are needed.
(cpp_interpret_charconst): Adjust narrow_str_to_charconst caller.
2019-11-05 Tim van Deurzen <tim@kompiler.org>
* cpplib.h: Add spaceship operator for C++.
* lex.c: Implement conditional lexing of spaceship operator for C++20.
2019-10-31 Jakub Jelinek <jakub@redhat.com>
PR preprocessor/92296
* internal.h (struct def_pragma_macro): Add is_builtin bitfield.
(_cpp_restore_special_builtin): Declare.
* init.c (_cpp_restore_special_builtin): New function.
* directives.c (do_pragma_push_macro): For NT_BUILTIN_MACRO
set is_builtin and don't try to grab definition.
(cpp_pop_definition): Use _cpp_restore_special_builtin to restore
builtin macros.
2019-10-15 Nathan Sidwell <nathan@acm.org>
* include/line-map.h (struct maps_info_ordinary): Make cache
mutable.
(struct maps_info_macro): Likewise.
(LINEMAPS_CACHE): Remove non-ref accessor. Constify ref accessor.
(LINEMAPS_ORDINARY_CACHE, LINEMAPS_MACRO_CACHE): Likewise.
(LINEMAPS_ORDINARY_MAP_AT, LINEMAPS_MACRO_MAP_AT): Use
LINEMAPS_USED and LINEMAPS_MAP_AT.
(linemap_lookup): Constify line_map arg.
linemap.c (linemap_ordinary_map_lookup, linemap_macro_map_lookup):
Constify line_map arg.
2019-10-11 Joseph Myers <joseph@codesourcery.com>
* include/cpplib.h (struct cpp_options): Add dfp_constants and
cpp_warn_c11_c2x_compat.
(enum cpp_warning_reason): Add CPP_W_C11_C2X_COMPAT.
* init.c (struct lang_flags): Add dfp_constants.
(lang_defaults): Set dfp_constants to 1 for GNUC2X and STDC2X and
0 for other languages.
(cpp_set_lang): Set dfp_constants from language.
(cpp_create_reader): Set cpp_warn_c11_c2x_compat to -1.
* expr.c (interpret_float_suffix): Mention DFP constants as C2X in
comment.
(cpp_classify_number): Do not diagnose DFP constants for languages
setting dfp_constants, unless cpp_warn_c11_c2x_compat.
2019-10-04 Nathan Sidwell <nathan@acm.org>
PR preprocessor/91991
* line-map.c (linemap_line_start): Clear max_column_hint if we run
out of locations.
2019-10-02 Richard Biener <rguenther@suse.de>
* internal.h (enum include_type): Remove trailing comma.
2019-10-02 Joseph Myers <joseph@codesourcery.com>
* include/cpplib.h (struct cpp_options): Add member scope.
* init.c (struct lang_flags, lang_defaults): Likewise.
(cpp_set_lang): Set scope member of pfile.
* lex.c (_cpp_lex_direct): Test CPP_OPTION (pfile, scope) not
CPP_OPTION (pfile, cplusplus) for creating CPP_SCOPE tokens.
2019-09-26 Eric Botcazou <ebotcazou@adacore.com>
* charset.c (UCS_LIMIT): New macro.
(ucn_valid_in_identifier): Use it instead of a hardcoded constant.
(_cpp_valid_ucn): Issue a pedantic warning for UCNs larger than
UCS_LIMIT outside of identifiers in C and in C++2a or later.
2019-09-19 Lewis Hyatt <lhyatt@gmail.com>
PR c/67224
* charset.c (_cpp_valid_utf8): New function to help lex UTF-8 tokens.
* internal.h (_cpp_valid_utf8): Declare.
* lex.c (forms_identifier_p): Use it to recognize UTF-8 identifiers.
(_cpp_lex_direct): Handle UTF-8 in identifiers and CPP_OTHER tokens.
Do all work in "default" case to avoid slowing down typical code paths.
Also handle $ and UCN in the default case for consistency.
2019-08-30 Nathan Sidwell <nathan@acm.org>
New # semantics for popping to "" name.
libcpp/
* directives.c (do_linemarker): Popping to "" name means get the
name from the include stack..
2019-09-05 Nathan Sidwell <nathan@acm.org>
PR preprocessor/91639
* directives.c (do_include_common): Tell lexer we're a #include.
* files.c (_cpp_stack_file): Lexer will have always incremented.
* internal.h (struct cpp_context): Extend in_directive's
semantics.
* lex.c (_cpp_lex_direct): Increment line for final \n when lexing
for an ISO #include.
* line-map.c (linemap_line_start): Remember if we overflowed.
2019-09-03 Ulrich Weigand <uweigand@de.ibm.com>
* directives.c: Remove references to spu from comments.
* expr.c: Likewise.
2019-08-29 Nathan Sidwell <nathan@acm.org>
* internal.h (enum include_type): Add IT_MAIN, IT_DIRECTIVE_HWM,
IT_HEADER_HWM.
(_cpp_stack_file): Take include_type, not a bool.
* files.c (_cpp_find_file): Refactor to not hide an if inside a
for conditional.
(should_stack_file): Break apart to ...
(is_known_idempotent_file, has_unique_contents): ... these.
(_cpp_stack_file): Replace IMPORT boolean with include_type enum.
Refactor to use new predicates. Do linemap compensation here ...
(_cpp_stack_include): ... not here.
* init.c (cpp_read_main_file): Pass IT_MAIN to _cpp_stack_file.
2019-08-28 Nathan Sidwell <nathan@acm.org>
* directives-only.c (_cpp_preprocess_dir_only): Use false, not
zero for _cpp_handle_directive call.
* directives.c (_cpp_handle_directive): Indented is bool.
* files.c (struct _cpp_file): Make bools 1 bit bitfields.
* internal.h (enum include_type): Reformat and comment.
(struct cpp_buffer): Make flags 1 bit bitfields.
(_cpp_handle_directive): Indented is bool.
2019-07-09 Martin Sebor <msebor@redhat.com>
* include/line-map.h: Change class-key from class to struct and vice
versa to match convention and avoid -Wclass-is-pod and -Wstruct-no-pod.
* mkdeps.c: Same.
2019-07-03 Martin Liska <mliska@suse.cz>
* line-map.c (linemap_get_expansion_filename): Remove
dead assignemts.
* mkdeps.c (make_write): Likewise.
2019-07-02 qing zhao <qing.zhao@oracle.com>
PR preprocessor/90581
* directives.c (do_include_common): Replace CPP_STACK_MAX with
CPP_OPTION (pfile, max_include_depth).
* include/cpplib.h (struct cpp_options): Add new field
max_include_depth.
* init.c (cpp_create_reader): Initiate new field max_include_depth.
* internal.h: Delete CPP_STACK_MAX.
2019-06-26 Nathan Sidwell <nathan@acm.org>
PR preprocessor/90927
* mkdeps.c (mkdeps::vec::operator[]): Add non-const variant.
(deps_add_target): Deal with out of order unquoted targets.
2019-05-19 Andrew Pinski <apinski@marvell.com>
PR pch/81721
* lex.c (cpp_token_val_index <case SPELL_OPERATOR>): If tok->flags
has NAMED_OP set, then return CPP_TOKEN_FLD_NODE.
2019-05-14 Martin Liska <mliska@suse.cz>
PR preprocessor/90382
* line-map.c (first_map_in_common_1): Handle ADHOC
locations.
2019-05-14 Martin Liska <mliska@suse.cz>
PR preprocessor/90382
* include/line-map.h (get_data_from_adhoc_loc): Add const to
the first argument.
(get_location_from_adhoc_loc): Likewise.
* line-map.c(get_data_from_adhoc_loc): Add const to
the first argument.
(get_location_from_adhoc_loc): Likewise.
(get_combined_adhoc_loc): Use get_location_from_adhoc_loc
(or get_data_from_adhoc_loc).
(get_range_from_adhoc_loc): Likewise.
(get_pure_location): Likewise.
(linemap_position_for_loc_and_offset): Likewise.
(linemap_lookup): Likewise.
(linemap_ordinary_map_lookup): Likewise.
(linemap_macro_map_lookup): Likewise.
(linemap_get_expansion_line): Likewise.
(linemap_get_expansion_filename): Likewise.
(linemap_location_in_system_header_p): Likewise.
(linemap_location_from_macro_expansion_p): Likewise.
(linemap_macro_loc_to_exp_point): Likewise.
(linemap_resolve_location): Likewise.
(linemap_unwind_toward_expansion): Likewise.
(linemap_unwind_to_first_non_reserved_loc): Likewise.
(linemap_expand_location): Likewise.
(linemap_dump_location): Likewise.
2019-05-07 Nathan Sidwell <nathan@acm.org>
* files.c (_cpp_stack_file): Empty filenames aren't dependencies.
* mkdeps.c (deps_add_dep): Assert not empty.
* include/mkdeps.h (deps_write): Add PHONY arg.
(deps_phony_targets): Delete.
* init.c (cpp_finish): Just call deps_write.
* mkdeps.c (struct mkdeps): Add local vector class. Reimplement
vector handling.
(munge): Munge to static buffer.
(apply_vpath): Adjust vector handling.
(deps_init, deps_free): Use new, delete.
(deps_add_target): Do not munge here. Record quoting low water mark.
(deps_add_dep): Do not munge here.
(deps_add_vpath): Adjust vector handling.
(make_write_name): New. Munge on demand here.
(make_write_vec): New.
(deps_phony_targets): Delete.
(make_write): New.
(deps_write): Forward to deps_Write.
(deps_save, deps_restore): Adjust vector handling.
2019-05-06 Nathan Sidwell <nathan@acm.org>
* include/mkdeps.h: Rename struct deps to struct mkdeps.
* mkdeps.c: Likewise.
* include/cpplib.h (cpp_get_deps): Rename return type..
* directives.c (cpp_get_deps): Likewise.
* internal.h (struct cpp_reader): Rename deps field type.
2019-04-03 Jonathan Wakely <jwakely@redhat.com>
* files.c (search_path_exhausted): Fix typo in comment.
2019-02-26 Martin Liska <mliska@suse.cz>
* symtab.c (ht_dump_statistics): Make
horizontal alignment for statistics.
2019-02-20 David Malcolm <dmalcolm@redhat.com>
PR c/89410
* include/line-map.h (linenum_arith_t): New typedef.
(compare): Use it.
2019-02-18 Martin Liska <mliska@suse.cz>
PR c++/89383
* line-map.c (linemap_line_start): Use 1UL in order
to not overflow.
2019-02-11 Martin Liska <mliska@suse.cz>
PR lto/88147
* line-map.c (linemap_line_start): Don't reuse the existing line
map if the line offset is sufficiently large to cause overflow
when computing location_t values.
2019-01-26 Jakub Jelinek <jakub@redhat.com>
PR preprocessor/88974
* directives.c (SEEN_EOL): Move macro to ...
* internal.h (SEEN_EOL): ... here.
* expr.c (parse_has_include): Don't cpp_get_token if SEEN_EOL ().
2019-01-01 Jakub Jelinek <jakub@redhat.com>
Update copyright years.
2018-11-27 Mike Gulick <mgulick@mathworks.com>
PR preprocessor/83173
* location-example.txt: Update example -fdump-internal-locations
output.
2018-11-27 Mike Gulick <mgulick@mathworks.com>
PR preprocessor/83173
* files.c (_cpp_stack_include): Check if
line_table->highest_location is past current line before
decrementing.
2018-11-13 David Malcolm <dmalcolm@redhat.com>
* charset.c: Replace "source_location" with "location_t".
* directives-only.c: Likewise.
* directives.c: Likewise.
* errors.c: Likewise.
* expr.c: Likewise.
* files.c: Likewise.
* include/cpplib.h: Likewise. Rename MAX_SOURCE_LOCATION to
MAX_LOCATION_T.
* include/line-map.h: Likewise.
* init.c: Likewise.
* internal.h: Likewise.
* lex.c: Likewise.
* line-map.c: Likewise.
* location-example.txt: Likewise.
* macro.c: Likewise.
* pch.c: Likewise.
* traditional.c: Likewise.
2018-11-07 Hafiz Abid Qadeer <abidh@codesourcery.com>
* configure: Regenerated.
2018-11-05 Martin Liska <mliska@suse.cz>
* symtab.c (ht_dump_statistics): Replace %zu with %lu format.
2018-11-05 Martin Liska <mliska@suse.cz>
* symtab.c (ht_dump_statistics): Fix format and
pass missing argument.
2018-11-05 Martin Liska <mliska@suse.cz>
* symtab.c (ht_dump_statistics): Make dump conditional
based on alloc_subobject.
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE.
* aclocal.m4, config.in, configure: Regenerate.
2018-10-31 Nathan Sidwell <nathan@acm.org>
* internal.h (struct cpp_reader): Rename forced_token_location_p
to forced_token_location and drop its pointerness.
* include/cpplib.h (cpp_force_token_locations): Take location, not
pointer to one.
* init.c (cpp_create_reader): Adjust.
* lex.c (cpp_read_main_file):
* directives.c (do_include_common): Commonize cleanup path.
(_cpp_pop_buffer): Fix leak.
* include/line-map.h (IS_ORDINARY_LOC, IS_MACRO_LOC): New
predicates.
(IS_ADHOC_LOC): Move earlier.
(MAP_ORDINARY_P): Use IS_ORDINARY_LOC.
* line-map.c (linemap_location_from_macro_expansion_p): Use
IS_MACRO_LOC.
* include/cpplib.h (cpp_macro_definition_location): Make inline.
* macro.c (warn_of_redefinition): Fix comments, examine macro
type, use C++ for.
(cpp_macro_definition_location): Don't define here.
* include/cpplib.h (HT_NODE): Don't cast NODE.
(NODE_LEN, NODE_NAME): Use HT_NODE.
* directives.c (DIRECTIVE_TABLE): Drop historical frequency
comments.
* files.c (_cpp_stack_file): Fix indentation.
2018-10-17 Joseph Myers <joseph@codesourcery.com>
* include/cpplib.h (enum c_lang): Add CLK_GNUC2X and CLK_STDC2X.
* init.c (lang_defaults): Add GNUC2X and STDC2X entries.
(cpp_init_builtins): Define __STDC_VERSION__ to 202000L for C2X.
2018-10-11 David Malcolm <dmalcolm@redhat.com>
* macro.c (_cpp_arguments_ok): If the argument count is wrong, add
a note showing the definition of the macro.
2018-10-11 Nathan Sidwell <nathan@acm.org>
* include/line-map.h (LINEMAPS_MACRO_LOWEST_LOCATION): Fix
off-by-one error.
* line-map.c (linemap_enter_macro): Use RAII. Clear all of the
macro_locations.
2018-10-09 David Malcolm <dmalcolm@redhat.com>
* charset.c (noop_error_cb): Rename to...
(noop_diagnostic_cb): ...this, converting params to enums.
(cpp_interpret_string_ranges): Update for renaming and enums.
* directives.c (check_eol_1): Convert reason to enum.
(do_diagnostic): Convert code and reason to enum.
(do_error): Use CPP_W_NONE rather than 0.
(do_pragma_dependency): Likewise.
* errors.c (cpp_diagnostic_at): Convert level and reason to enums.
Update for renaming.
(cpp_diagnostic): Convert level and reason to enums.
(cpp_error): Convert level to enum.
(cpp_warning): Convert reason to enums.
(cpp_pedwarning): Likewise.
(cpp_warning_syshdr): Likewise.
(cpp_diagnostic_with_line): Convert level and reason to enums.
Update for renaming.
(cpp_error_with_line): Convert level to enum.
(cpp_warning_with_line): Convert reason to enums.
(cpp_pedwarning_with_line): Likewise.
(cpp_warning_with_line_syshdr): Likewise.
(cpp_error_at): Convert level to enum.
(cpp_errno): Likewise.
(cpp_errno_filename): Likewise.
* include/cpplib.h (enum cpp_diagnostic_level): Name this enum,
and move to before struct cpp_callbacks.
(enum cpp_warning_reason): Likewise.
(cpp_callbacks::diagnostic): Convert params from int to enums.
(cpp_error): Convert int param to enum cpp_diagnostic_level.
(cpp_warning): Convert int param to enum cpp_warning_reason.
(cpp_pedwarning): Likewise.
(cpp_warning_syshdr): Likewise.
(cpp_errno): Convert int param to enum cpp_diagnostic_level.
(cpp_errno_filename): Likewise.
(cpp_error_with_line): Likewise.
(cpp_warning_with_line): Convert int param to enum
cpp_warning_reason.
(cpp_pedwarning_with_line): Likewise.
(cpp_warning_with_line_syshdr): Likewise.
(cpp_error_at): Convert int param to enum cpp_diagnostic_level.
* macro.c (create_iso_definition): Convert int to enum.
(_cpp_create_definition): Likewise.
2018-09-17 David Malcolm <dmalcolm@redhat.com>
* include/line-map.h (range_label::get_text): Add param
"range_idx".
2018-08-30 Nathan Sidwell <nathan@acm.org>
* include/line-map.h (enum lc_reason): Comment each member
separately.
(struct line_maps): Fix reallocator comment.
2018-08-27 David Malcolm <dmalcolm@redhat.com>
PR 87091
* include/line-map.h (enum range_display_kind): New enum.
(struct location_range): Replace field "m_show_caret_p" with
"m_range_display_kind", converting from bool to the new enum.
(class rich_location): Add example of line insertion fix-it hint.
(rich_location::add_range): Convert param "show_caret_p" from bool
to enum range_display_kind and rename to "range_display_kind",
giving it a default of SHOW_RANGE_WITHOUT_CARET.
(rich_location::set_range): Likewise, albeit without a default.
* line-map.c (rich_location::rich_location): Update for conversion
of show_caret_p to tri-state enum.
(rich_location::add_range): Likewise.
(rich_location::set_range): Likewise.
2018-08-24 H.J. Lu <hongjiu.lu@intel.com>
PR bootstrap/86872
* line-map.c (pure_location_p): Return true if linemap_lookup
returns NULL.
(linemap_add): Set start_location to 0 if we run out of line map
space.
2018-08-20 Nathan Sidwell <nathan@acm.org>
* include/cpplib.h: Fixup some whitespace.
(cpp_hashnode): Reduce type to 2 bit & flags to 8.
* include/cpplib.h (NODE_BUILTIN, NODE_MACRO_ARG): Delete.
Renumber others.
(enum node_type): Replace NT_MACRO with NT_USER_MACRO,
NT_BUILTIN_MACRO, NT_MACRO_ARG. Delete NT_ASSERTION.
(NTV_MACRO, NTV_ANSWER, NTV_BUILTIN, NTV_ARGUMENT, NTV_NONE):
Delete.
(CPP_HASHNODE_VALUE_IDX): Delete.
(union _cpp_hashnode_value): GTY tag from enum node_type directly.
(struct cpp_hashnode): Adjust GTY desc for value field.
(cpp_user_macro_p, cpp_builtin_macro_p, cpp_macro_p): Adjust.
* directives.c (undefine_macros): Clear value.anwers, adjust flag
clearing.
(_cpp_test_assertion): No need to check NT_ASSERTION.
(do_assert, do_unassert): Likewise.
* init.c (cpp_init_special_builtins): Set type not flags.
* macro.c (struct macro_arg_saved_data): Add type field.
(cpp_get_token_1): Check type not NT_VOID.
(_cpp_free_definition): Adjust flag clearing. Nullify
value.answers.
(_cpp_save_parameter, _cpp_unsave_parameters): Save and restore
type.
(lex_expansion_token): Check type not flags.
(_cpp_create_definition): Set type to NT_USER_MACRO.
(_cpp_notify_macro_use): Adjust type checking.
* pch.c (write_macdef, count_defs, write_defs, cpp_valid_state)
(save_macros): Adjust node type/flag handling.
* traditional.c (_cpp_scan_out_logical_line): Check type not flags.
* directives.c (do_undef): Use cpp_macro_p & cpp_builtin_macro_p.
* include/cpplib.h (enum cpp_macro_kind): Remove trailing comma.
(cpp_fun_like_macro_p): Make inline, define.
* macro.c (cpp_define_lazily): Use UCHAR_MAX.
(cpp_fun_like_macro_p): Delete.
* Makefile.in (TAGS_SOURCES): Remove cpp-id-data.h.
* include/cpp-id-data.h: Delete.
* internal.h: Include cpplib.h not cpp-id-data.h.
* include/cpp-id-data.h (struct answer): Delete.
* include/cpplib.h (struct answer): Don't forward-declare.
(enum cpp_macro_kind): Add cmk_assert.
(struct cpp_macro): Union parms and next assert chain.
(union _cpp_hashnode_value): 'answer' field is cpp_macro.
* directives.c (parse_answer): Convert to use cpp_macro. Return
true on success.
(parse_assertion, find_answer, _cpp_test_assertion, cpp_do_assert)
(cpp_do_unassert): Convert to use cpp_macro.
* macro.c (warn_of_redefinition, _cpp_new_macro)
(check_trad_stringification, cpp_macro_definition): Adjust macro
parm access.
* traditional.c (_cpp_replacement_text_len)
(_cpp_copy_replacement_text, _cpp_create_trad_definition): Likewise.
2018-08-17 Nathan Sidwell <nathan@acm.org>
* include/cpplib.h (struct cpp_callbacks): Replace
user_builtin_macro with user_lazy_macro.
(struct cpp_macro): add lazy field.
(enum cpp_builtin_type): Remove BT_FIRST_USER, BT_LAST_USER.
(cpp_define_lazily): Declare.
* macro.c (enter_macro_context) Use _cpp_maybe_notify_macro_use.
(warn_of_redefinition): Use cpp_builtin_macro_p, directly call
user_lazy_macro hook.
(_cpp_new_macro): Clear lazy field.
(cpp_define_lazily): Define.
(_cpp_notify_macro_use): Adjust lazy definition code.
(cpp_macro_definition): No need to do lazy definition here.
* pch.c (write_macdef, save_macros): Likewise.
* include/cpplib.h (enum cpp_macro_kind): New.
(struct cpp_macro): Make body trailing array. Add kind field,
delete traditional flag.
* internal.h (_cpp_new_macro): Declare.
(_cpp_reserve_room): New inline.
(_cpp_commit_buf): Declare.
(_cpp_create_trad_definition): Return new macro.
* lex.c (_cpp_commit_buff): New.
* macro.c (macro_real_token_count): Count backwards.
(replace_args): Pointer equality not orderedness.
(_cpp_save_parameter): Use _cpp_reserve_room.
(alloc_expansion_token): Delete.
(lex_expansion_token): Return macro pointer. Use _cpp_reserve_room.
(create_iso_definition): Allocate macro itself. Adjust for
different allocation ordering.
(_cpp_new_macro): New.
(_cpp_create_definition): Adjust for API changes.
* traditional.c (push_replacement_text): Don't set traditional
flag.
(save_replacement_text): Likewise.
(_cpp_create_trad_definition): Allocate macro itself, Adjust for
different allocation ordering.
* cpp-id-data.h (uchar, UC): Move to internal.h
(struct cpp_macro): Move to cpplib.h.
* internal.h (uchar, UC): From cpp-id-data.h.
* include/cpplib.h (struct cpp_macro): From cpp-id-data.h.
2018-08-16 Nathan Sidwell <nathan@acm.org>
* internal.h (_cpp_save_parameter): Take parmno, not macro.
(_cpp_unsave_parameters): Declare.
* macro.c (_cpp_save_parameter): Take parm number, not macro.
Return true on success.
(_cpp_unsave_parameters): New.
(parse_params): Take parm_no and variadic pointers, not macro.
Reimplement parsing logic.
(create_iso_definition): Adjust parse_params changes. Call
_cpp_unsave_parameters here.
(_cpp_create_definition): Don't unsave params here.
* traditional.c (scan_parameters): Take n_param pointer, adjust.
(_cpp_create_trad_definition): Ajust scan_parameters change. Call
_cpp_unsave_parameters.
* include/cpplib.h (cpp_user_macro_p, cpp_builtin_macro_p)
(cpp_macro_p): New inlines.
* directives.c (do_pragma_poison): Use cpp_macro_p.
(do_ifdef, do_ifndef): Likewise. Use _cpp_maybe_notify_macro_use.
(cpp_pop_definition): Use cpp_macro_p. Move _cpp_free_definition
earlier. Don't zap node directly.
* expr.c (parse_defined): Use _cpp_maybe_notify_macro_use &
cpp_macro_p.
* files.c (should_stack_file): Use cpp_macro_p.
* identifiers.c (cpp_defined): Likewise.
* internal.h (_cpp_mark_macro): Use cpp_user_macro_p.
(_cpp_notify_macro_use): Declare.
(_cpp_maybe_notify_macro_use): New inline.
* lex.c (is_macro): Use cpp_macro_p.
* macro.c (_cpp_warn_if_unused_macro): Use cpp_user_macro_p.
(enter_macro_context): Likewise.
(_cpp_create_definition): Use cpp_builtin_macro_p,
cpp_user_macro_p. Move _cpp_free_definition earlier.
(_cpp_notify_macro_use): New, broken out of multiple call sites.
* traditional.c (fun_like_macro_p): Use cpp_builtin_macro_p.
(maybe_start_funlike, _cpp_scan_out_logical_line)
(push_replacement_text): Likewise.
2018-08-15 David Malcolm <dmalcolm@redhat.com>
* include/line-map.h (struct location_range): Add "m_label" field.
(class rich_location): Add description of labels to leading
comment.
(rich_location::rich_location): Add "label" param, defaulting to
NULL.
(rich_location::add_range): Likewise.
(struct label_text): New struct.
(class range_label): New abstract base class.
* line-map.c (rich_location::rich_location): Add "label" param;
use it.
(rich_location::add_range): Likewise.
2018-08-08 Nathan Sidwell <nathan@acm.org>
Make linemap::included_from a location
libcpp/
* include/line-map.h (struct line_map_ordinary): Replace
included_from map index with included_at source_location.
(ORDINARY_MAP_INCLUDER_FILE_INDEX): Delete.
(LAST_SOURCE_LINE_LOCATION): Delete.
(LAST_SOURCE_LINE, LAST_SOURCE_COLUMN): Delete.
(linemap_included_from): New.
(linemap_included_from_linemap): Declare.
(MAIN_FILE_P): Adjust.
* line-map.c (linemap_included_from_linemap): New.
(lonemap_check_files_exited): Use linemap_included_at.
(linemap_add): Adjust inclusion setting.
(linemap_dump, linemap_dump_location): Adjust.
* directives.c (do_linemarker): Use linemap_included_at.
2018-08-07 Nathan Sidwell <nathan@acm.org>
* line-map.c: (linemap_init): Set default allocator here.
(new_linemap): Rather than here. Refactor allocation logic.
2018-07-20 David Malcolm <dmalcolm@redhat.com>
* include/line-map.h (rich_location::set_range): Remove redundant
line_maps * parameter.
* line-map.c (rich_location::set_range): Likewise.
2018-07-18 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR 69558
* macro.c (enter_macro_context): Change the location info for builtin
macros and _Pragma from location of the closing parenthesis to location
of the macro expansion point.
2018-07-17 Jason Franklin <j_fra@fastmail.us>
Jakub Jelinek <jakub@redhat.com>
* lex.c (_cpp_lex_direct): Use CPP_DL_NOTE instead of CPP_DL_PEDWARN,
CPP_DL_WARNING or CPP_DL_ERROR for note that diagnostics for C++ style
comments is reported only once per file and guard those calls on the
preceding cpp_error returning true.
2018-07-03 Nathan Sidwell <nathan@acm.org>
Reorg line_map data structures for better packing.
* include/line-map.h (enum lc_reason): Add LC_HWM.
(LINE_MAP_MAX_LOCATION): Define here.
(struct line_map): Move reason field to line_map_ordinary. Adjust
GTY tagging.
(struct line_map_ordinary): Reorder fields for less padding.
(struct line_map_macro): Likewise.
(MAP_ORDINARY_P): New.
(linemap_check_ordinary, linemap_check_macro): Adjust.
* line-map.c (LINE_MAP_MAX_SOURCE_LOCATION): Delete.
(new_linemap): Take start_location, not reason. Adjust.
(linemap_add, linemap_enter_macro): Adjust.
(linemap_line_start): Likewise.
(linemap_macro_expansion_map_p): Use MAP_ORDINARY_P.
(linemap_macro_loc_to_spelling_point): Likewise.
(linemap_macro_loc_to_def_point): Likewise.
(linemap_dump): Likewise.
2018-05-23 Jason Merrill <jason@redhat.com>
* system.h: #include <new> earlier.
2018-05-17 Jason Merrill <jason@redhat.com>
* line-map.c (linemap_init): Use placement new.
* system.h: #include <new>.
2018-03-14 David Malcolm <dmalcolm@redhat.com>
* include/line-map.h (compare): New function on linenum_type.
2018-02-28 Jonathan Wakely <jwakely@redhat.com>
PR preprocessor/84517
* lex.c (is_macro_not_literal_suffix): New function.
(lex_raw_string, lex_string): Use is_macro_not_literal_suffix to
decide when to issue -Wliteral-suffix warnings.
2018-02-16 Richard Biener <rguenther@suse.de>
PR bootstrap/82939
* line-map.c (linemap_init): Avoid broken value-init when compiling
with GCC 4.2.
2018-02-15 Jason Merrill <jason@redhat.com>
Jakub Jelinek <jakub@redhat.com>
PR preprocessor/83063 - __VA_OPT__ and ##
PR preprocessor/83708
* macro.c (vaopt_state): Reorder m_last_was_paste before m_state.
(vaopt_state::vaopt_state): Adjust.
(vaopt_state::update_flags): Add BEGIN and END.
(vaopt_state::update): Return them.
(copy_paste_flag): Factor out of replace_args.
(last_token_is): New.
(replace_args): Handle BEGIN and END. Avoid padding there.
(tokens_buff_last_token_ptr): Return NULL if no tokens.
2018-01-31 Jakub Jelinek <jakub@redhat.com>
PR preprocessor/69869
* traditional.c (skip_macro_block_comment): Return bool, true if
the macro block comment is unterminated.
(copy_comment): Use return value from skip_macro_block_comment instead
of always false.
2018-01-27 Jakub Jelinek <jakub@redhat.com>
* include/cpplib.h (enum cpp_builtin_type): Change BT_LAST_USER from
BT_FIRST_USER + 31 to BT_FIRST_USER + 63.
2018-01-18 Boris Kolpackov <boris@codesynthesis.com>
PR other/70268
* include/cpplib.h (cpp_callbacks::remap_filename): New callback.
* macro.c (_cpp_builtin_macro_text): Call remap_filename for
__FILE__ and __BASE_FILE__.
2018-01-10 Kelvin Nilsen <kelvin@gcc.gnu.org>
* lex.c (search_line_fast): Remove illegal coercion of an
unaligned pointer value to vector pointer type and replace with
use of __builtin_vec_vsx_ld () built-in function, which operates
on unaligned pointer values.
2018-01-03 Jakub Jelinek <jakub@redhat.com>
Update copyright years.
2017-12-20 Michael Weiser <michael.weiser@gmx.de>
PR preprocessor/83492
* lex.c (search_line_fast) [__ARM_NEON && __ARM_64BIT_STATE]:
Fix selection of big-endian shift parameters by using
__ARM_BIG_ENDIAN.
2017-12-14 Bernd Edlinger <bernd.edlinger@hotmail.de>
* internal.h (maybe_print_line): Change signature.
2017-12-05 Jakub Jelinek <jakub@redhat.com>
PR c++/79228
* expr.c (interpret_float_suffix): Avoid memcmp.
(interpret_int_suffix): Likewise. Don't check for if.
2017-12-01 Jason Merrill <jason@redhat.com>
PR c++/79228 - extensions hide C++14 complex literal operators
* expr.c (interpret_float_suffix): Ignore 'i' in C++14 and up.
(interpret_int_suffix): Likewise.
2017-11-28 David Malcolm <dmalcolm@redhat.com>
PR c/82050
* include/line-map.h (LINE_MAP_MAX_COLUMN_NUMBER): Move here.
* line-map.c (LINE_MAP_MAX_COLUMN_NUMBER): ...from here.
(rich_location::maybe_add_fixit): Reject fix-it hints in which
the start column exceeds the next column.
2017-11-20 Eric Gallager <egall@gwmail.gwu.edu>
PR preprocessor/81794
* macro.c (check_trad_stringification): Have warning be controlled
by -Wtraditional.
2017-11-20 David Malcolm <dmalcolm@redhat.com>
PR c++/72786
* include/cpplib.h (cpp_macro_definition_location): New decl.
* macro.c (cpp_macro_definition): New function.
2017-11-13 Tom Tromey <tom@tromey.com>
* pch.c (cpp_read_state): Set n__VA_OPT__.
* macro.c (vaopt_state): New class.
(_cpp_arguments_ok): Check va_opt flag.
(replace_args, create_iso_definition): Use vaopt_state.
* lex.c (lex_identifier_intern): Possibly issue errors for
__VA_OPT__.
(lex_identifier): Likewise.
(maybe_va_opt_error): New function.
* internal.h (struct lexer_state) <va_args_ok>: Update comment.
(struct spec_nodes) <n__VA_OPT__>: New field.
* init.c (struct lang_flags) <va_opt>: New field.
(lang_defaults): Add entries for C++2A. Update all entries for
va_opt.
(cpp_set_lang): Initialize va_opt.
* include/cpplib.h (struct cpp_options) <va_opt>: New field.
* identifiers.c (_cpp_init_hashtable): Initialize n__VA_OPT__.
2017-11-13 David Malcolm <dmalcolm@redhat.com>
* include/line-map.h (linenum_type): Move this typedef and the
comment describing column numbering to near the top of the file.
2017-11-06 Mukesh Kapoor <mukesh.kapoor@oracle.com>
PR c++/80955
* lex.c (lex_string): When checking for a valid macro for the
warning related to -Wliteral-suffix (CPP_W_LITERAL_SUFFIX),
check that the macro name does not start with an underscore
before calling is_macro().
2017-11-05 Tom de Vries <tom@codesourcery.com>
PR other/82784
* lex.c (BUF_APPEND): Remove semicolon after
"do {} while (0)".
2017-10-31 David Malcolm <dmalcolm@redhat.com>
* directives.c (_cpp_handle_directive): Update for renaming of
cpp_error_at_richloc to cpp_error_at.
* errors.c (cpp_diagnostic_at_richloc): Rename to...
(cpp_diagnostic_at): ...this, dropping the location_t-based
implementation.
(cpp_diagnostic): Update for removal of location_t-based
cpp_diagnostic_at.
(cpp_error_at): Likewise.
(cpp_error_at_richloc): Rename to...
(cpp_error_at): ...this, and update for renaming of
cpp_diagnostic_at_richloc.
* include/cpplib.h (cpp_error_at_richloc): Rename to...
(cpp_error_at): ...this.
2017-10-30 Joseph Myers <joseph@codesourcery.com>
* include/cpplib.h (enum c_lang): Add CLK_GNUC17 and CLK_STDC17.
* init.c (lang_defaults): Add GNUC17 and STDC17 data.
(cpp_init_builtins): Handle C17 value of __STDC_VERSION__.
2017-10-10 Nathan Sidwell <nathan@acm.org>
PR preprocessor/82506
* macro.c (cpp_quote_string): Escape raw LFs.
2017-09-15 Andrew Sutton <andrew.n.sutton@gmail.com>
Jakub Jelinek <jakub@redhat.com>
Add support for -std=c++2a.
* include/cpplib.h (c_lang): Add CXX2A and GNUCXX2A.
* init.c (lang_defaults): Add rows for CXX2A and GNUCXX2A.
(cpp_init_builtins): Set __cplusplus to 201709L for C++2a.
2017-09-15 Jakub Jelinek <jakub@redhat.com>
* include/cpplib.h (enum c_lang): Rename CLK_GNUCXX1Z
to CLK_GNUCXX17 and CLK_CXX1Z to CLK_CXX17.
* init.c (lang_defaults, cpp_init_builtins): Likewise.
* expr.c (cpp_classify_number): Use C++17 instead of C++1z
in diagnostics.
2017-07-07 David Malcolm <dmalcolm@redhat.com>
PR c++/79300
* line-map.c (linemap_macro_loc_to_def_point): Preserve range
information for macro expansions by delaying resolving ad-hoc
locations until within the loop.
2017-07-06 David Malcolm <dmalcolm@redhat.com>
PR c++/79300
* include/line-map.h (enum location_aspect): New enum.
(linemap_client_expand_location_to_spelling_point): Add
enum location_aspect param.
* line-map.c (rich_location::get_expanded_location): Update for
new param of linemap_client_expand_location_to_spelling_point.
(rich_location::maybe_add_fixit): Likewise.
(fixit_hint::affects_line_p): Likewise.
2017-06-21 Jakub Jelinek <jakub@redhat.com>
* line-map.c (location_adhoc_data_update): Perform addition in
uintptr_t type rather than char * type. Read *data using
ptrdiff_t type instead of int64_t.
(get_combined_adhoc_loc): Change offset type to ptrdiff_t from
int64_t.
2017-06-20 David Malcolm <dmalcolm@redhat.com>
* include/line-map.h (class rich_location): Document that attempts
to delete or replace a range *affecting* multiple lines will fail.
* line-map.c (rich_location::maybe_add_fixit): Implement this
restriction.
2017-06-09 David Malcolm <dmalcolm@redhat.com>
* include/line-map.h
(rich_location::fixits_cannot_be_auto_applied): New method.
(rich_location::fixits_can_be_auto_applied_p): New accessor.
(rich_location::m_fixits_cannot_be_auto_applied): New field.
* line-map.c (rich_location::rich_location): Initialize new field.
2017-06-05 David Malcolm <dmalcolm@redhat.com>
* include/cpplib.h (struct cpp_callbacks): Add "comment"
callback.
* lex.c (_cpp_lex_direct): Call the comment callback if non-NULL.
2017-05-02 David Malcolm <dmalcolm@redhat.com>
* include/line-map.h (class rich_location): Update description of
newline handling.
(class fixit_hint): Likewise.
(fixit_hint::ends_with_newline_p): New decl.
* line-map.c (rich_location::maybe_add_fixit): Support newlines
in fix-it hints that are insertions of single lines at the start
of a line. Don't consolidate into such fix-it hints.
(fixit_hint::ends_with_newline_p): New method.
2017-05-01 David Malcolm <dmalcolm@redhat.com>
* include/line-map.h (source_range::intersects_line_p): Delete.
(rich_location::add_fixit): Delete.
(rich_location::maybe_add_fixit): New method.
(class fixit_hint): Reimplement in terms of...
(class fixit_replace): ...this.
(class fixit_insert): Delete.
* line-map.c (linemap_position_for_loc_and_offset): Drop overzealous
linemap_assert_fails.
(source_range::intersects_line_p): Rename to...
(fixit_hint::affects_line_p): New function.
(rich_location::add_fixit_insert_before): Reimplement in terms of
maybe_add_fixit, moving validation there.
(rich_location::add_fixit_insert_after): Likewise.
(column_before_p): Delete.
(rich_location::add_fixit_replace): Reimplement in terms of
maybe_add_fixit, moving validation there. Convert closed input range
to half-open range.
(rich_location::add_fixit): Delete.
(rich_location::maybe_add_fixit): New function.
(fixit_insert::fixit_insert): Delete.
(fixit_insert::~fixit_insert): Delete.
(fixit_insert::affects_line_p): Delete.
(fixit_insert::maybe_append_replace): Delete.
(fixit_replace::fixit_replace): Rename to...
(fixit_hint::fixit_hint): ...this, rewriting as necessary.
(fixit_replace::~fixit_replace): Delete.
(fixit_replace::affects_line_p): Delete.
(fixit_replace::maybe_append_replace): Rename to...
(fixit_hint::maybe_append): ...this, rewriting as necessary.
2017-04-03 Jonathan Wakely <jwakely@redhat.com>
* include/line-map.h (LINEMAPS_MACRO_MAPS): Fix typo in comment.
* lex.c (search_line_fast): Likewise.
* pch.h (cpp_valid_state): Likewise.
2017-03-21 Andreas Schwab <schwab@suse.de>
* lex.c (search_line_fast) [__ARM_NEON && __ARM_64BIT_STATE]:
Convert 64-bit value to boolean before passing to
__builtin_expect.
2017-03-16 Jason Merrill <jason@redhat.com>
* init.c (cpp_init_builtins): Update __cplusplus for C++17.
2017-02-09 Gerald Pfeifer <gerald@pfeifer.com>
* Makefile.in (po/$(PACKAGE).pot): Adjust bug reporting URL.
2017-01-10 David Malcolm <dmalcolm@redhat.com>
PR c++/77949
* line-map.c (linemap_position_for_column): When calling
linemap_start_line, detect if a new linemap was created with
0 column bits, and bail out early if this is the case.
(linemap_position_for_loc_and_offset): Replace overzealous
linemap_assert_fails with a simple conditional; use correct
bit count.
2017-01-07 David Malcolm <dmalcolm@redhat.com>
PR c++/72803
* line-map.c (linemap_line_start): When determining if the highest
column given out so far will fit into a proposed change to the
current map, use the effective number of column bits, rather than
the total number of column + range bits.
2017-01-01 Jakub Jelinek <jakub@redhat.com>
Update copyright years.
2016-12-15 David Malcolm <dmalcolm@redhat.com>
PR preprocessor/78680
PR preprocessor/78811
* lex.c (_cpp_lex_direct): Only determine the end-location of
the token and build a range for non-reserved start locations.
Do not do it for EOF tokens.
2016-12-12 David Malcolm <dmalcolm@redhat.com>
PR preprocessor/78680
* lex.c (_cpp_lex_direct): Ensure line notes are processed before
computing the end-point of the token.
2016-11-23 Paolo Bonzini <bonzini@gnu.org>
* include/cpplib.h (struct cpp_options): Add new member
warn_expansion_to_defined.
(CPP_W_EXPANSION_TO_DEFINED): New enum member.
* expr.c (parse_defined): Warn for all uses of "defined"
in macros, and tie warning to CPP_W_EXPANSION_TO_DEFINED.
Make it a pedwarning instead of a warning.
* system.h (HAVE_DESIGNATED_INITIALIZERS): Do not use
"defined" in macros.
2016-11-17 David Malcolm <dmalcolm@redhat.com>
* charset.c (cpp_interpret_string_1): Skip locations from
loc_reader when advancing 'p' when handling raw strings.
2016-11-16 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/72823
* configure.ac (ENABLE_ASSERT_CHECKING): Define if gcc configure
would define that macro.
* configure: Regenerated.
* config.in: Regenerated.
2016-11-08 Richard Earnshaw <rearnsha@arm.com>
* lex.c (search_line_fast): New implementation for AArch64.
2016-10-25 David Malcolm <dmalcolm@redhat.com>
* files.c (destroy_cpp_file): Free file->path.
2016-10-25 David Malcolm <dmalcolm@redhat.com>
* include/line-map.h (line_maps::~line_maps): New dtor.
(location_adhoc_data_fini): Delete decl.
* line-map.c (line_maps::~line_maps): New dtor.
(location_adhoc_data_fini): Delete.
2016-10-21 Andris Pavenis <andris.pavenis@iki.fi>
PR preprocessor/71681
* files.c (remap_filename): Fix handling -remap in subdirectories.
2016-10-12 Jakub Jelinek <jakub@redhat.com>
* include/cpplib.h (struct cpp_options): Add
cpp_warn_implicit_fallthrough.
* init.c (cpp_create_reader): Initialize it to 0.
* lex.c (fallthrough_comment_p): Handle different
cpp_warn_implicit_fallthrough levels. Whitespace fixes.
2016-10-08 Jakub Jelinek <jakub@redhat.com>
* lex.c (fallthrough_comment_p): Accept Else, fallthrough.
* lex.c (fallthrough_comment_p): Extend to handle more common FALLTHRU
comment styles.
* lex.c (fallthrough_comment_p): Fix off-by-one size comparison
errors, cleanup.
(_cpp_lex_direct): Allow arbitrary comments in between
fallthrough_comment_p comment and following token.
2016-10-04 Kelvin Nilsen <kelvin@gcc.gnu.org>
PR target/77847
* lex.c (search_line_fast): Add a FALLTHROUGH comment to correct
compiler error in the version of this function that is
conditionally compiled when GCC_VERSION >= 4005 and both
__ALTIVEC__ and __BIG_ENDIAN__ symbols are defined.
2016-09-26 Marek Polacek <polacek@redhat.com>
Jakub Jelinek <jakub@redhat.com>
PR c/7652
* include/cpplib.h (PREV_FALLTHROUGH): Define.
* internal.h (CPP_FALLTHRU): Define.
* lex.c (fallthrough_comment_p): New function.
(_cpp_lex_direct): Set PREV_FALLTHROUGH on tokens succeeding a falls
through comment.
2016-09-23 David Malcolm <dmalcolm@redhat.com>
PR preprocessor/77672
* charset.c (cpp_interpret_string_1): Add a source_range for the
NUL-terminator, using the location of the trailing quote of the
final string.
2016-09-21 Jason Merrill <jason@redhat.com>
* line-map.c (linemap_location_from_macro_definition_p): New.
* line-map.h: Declare it.
2016-09-15 David Malcolm <dmalcolm@redhat.com>
* include/line-map.h (class rich_location): Note that newlines
aren't supported in fix-it text.
* line-map.c (rich_location::add_fixit_insert_before): Reject
attempts to add fix-its containing newlines.
(rich_location::add_fixit_replace): Likewise.
2016-09-13 David Malcolm <dmalcolm@redhat.com>
* include/line-map.h (class rich_location): Add description of
fix-it hints to leading comment.
(rich_location::add_fixit_insert): Rename both overloaded methods
to..
(rich_location::add_fixit_insert_before): ...this, updating their
comments.
(rich_location::add_fixit_insert_after): Two new overloaded
methods.
(rich_location::stop_supporting_fixits): New method.
* line-map.c (rich_location::add_fixit_insert): Rename both
overloaded methods to..
(rich_location::add_fixit_insert_before): ...this, updating their
comments.
(rich_location::add_fixit_insert_after): Two new methods.
(rich_location::reject_impossible_fixit): Split out
failure-handling into...
(rich_location::stop_supporting_fixits): New method.
2016-09-02 David Malcolm <dmalcolm@redhat.com>
* include/line-map.h (rich_location::seen_impossible_fixit_p): New
accessor.
2016-08-31 David Malcolm <dmalcolm@redhat.com>
* include/line-map.h (class fixit_remove): Remove stray decl.
(fixit_hint::affects_line_p): Make const.
(fixit_insert::affects_line_p): Likewise.
(fixit_replace::affects_line_p): Likewise.
* line-map.c (fixit_insert::affects_line_p): Likewise.
(fixit_replace::affects_line_p): Likewise.
2016-08-30 David Malcolm <dmalcolm@redhat.com>
* include/line-map.h (class semi_embedded_vec): New class.
(semi_embedded_vec<T, NUM_EMBEDDED>::semi_embedded_vec): New ctor.
(semi_embedded_vec<T, NUM_EMBEDDED>::~semi_embedded_vec): New
dtor.
(semi_embedded_vec<T, NUM_EMBEDDED>::operator[]): New methods.
(semi_embedded_vec<T, NUM_EMBEDDED>::push): New method.
(semi_embedded_vec<T, NUM_EMBEDDED>::truncate): New method.
(rich_location::get_num_locations): Reimplement in terms of
m_ranges.
(rich_location::get_range): Make non-inline.
(rich_location::get_num_fixit_hints): Reimplement in terms of
m_fixit_hints.
(rich_location::add_fixit): New function.
(rich_location::MAX_RANGES): Rename to...
(rich_location::STATICALLY_ALLOCATED_RANGES): ...this.
(rich_location::MAX_FIXIT_HINTS): Rename to...
(rich_location::STATICALLY_ALLOCATED_RANGES): ...this, and make
private.
(rich_location::m_num_ranges): Eliminate in favor of...
(rich_location::m_ranges): ...this, converting from a fixed-size
array to a semi_embedded_vec.
(rich_location::m_num_fixit_hints): Eliminate in favor of...
(rich_location::m_fixit_hints): ...this, converting from a
fixed-size array to a semi_embedded_vec.
* line-map.c (rich_location::rich_location): Update for above
changes.
(rich_location::~rich_location): Likewise.
(rich_location::get_loc): Likewise.
(rich_location::get_range): New methods.
(rich_location::add_range): Update for above changes.
(rich_location::set_range): Likewise.
(rich_location::add_fixit_insert): Likewise.
(rich_location::add_fixit_replace): Likewise.
(rich_location::get_last_fixit_hint): Likewise.
(rich_location::reject_impossible_fixit): Likewise.
(rich_location::add_fixit): New method.
2016-08-30 David Malcolm <dmalcolm@redhat.com>
* include/line-map.h (rich_location::add_fixit_insert): Add
comments. Add overload omitting the source_location param.
(rich_location::add_fixit_remove): Add comments. Add overloads
omitting the range, and accepting a source_location.
(rich_location::add_fixit_replace): Likewise.
* line-map.c (rich_location::add_fixit_insert): Add comments. Add
overload omitting the source_location param.
(rich_location::add_fixit_remove): Add comments. Add overloads
omitting the range, and accepting a source_location.
(rich_location::add_fixit_replace): Likewise.
2016-08-26 David Malcolm <dmalcolm@redhat.com>
* include/line-map.h (get_pure_location): New decl.
* line-map.c (get_pure_location): Move here, from gcc/input.c, adding
a line_maps * param.
(rich_location::add_fixit_insert): Call get_pure_location on "where".
(rich_location::add_fixit_replace): Call get_pure_location on the
end-points.
2016-08-26 David Malcolm <dmalcolm@redhat.com>
* include/line-map.h (rich_location): Eliminate unimplemented
constructor based on source_range.
(rich_location::get_last_fixit_hint): New method.
(rich_location::reject_impossible_fixit): New method.
(rich_location): Add fields m_line_table and
m_seen_impossible_fixit.
(fixit_hint::maybe_append_replace): New pure virtual function.
(fixit_insert::maybe_append_replace): New function.
(fixit_replace::maybe_append_replace): New function.
* line-map.c (rich_location::rich_location): Initialize
m_line_table and m_seen_impossible_fixit.
(rich_location::add_fixit_insert): Call
reject_impossible_fixit and bail out if true.
(column_before_p): New function.
(rich_location::add_fixit_replace): Call reject_impossible_fixit
and bail out if true. Attempt to consolidate with neighboring
fixits.
(rich_location::get_last_fixit_hint): New method.
(rich_location::reject_impossible_fixit): New method.
(fixit_insert::maybe_append_replace): New method.
(fixit_replace::maybe_append_replace): New method.
2016-08-23 David Malcolm <dmalcolm@redhat.com>
* include/line-map.h (source_range::from_locations): New method.
2016-08-19 David Malcolm <dmalcolm@redhat.com>
* include/line-map.h (fixit_hint::kind): Delete REPLACE.
(class fixit_remove): Delete.
* line-map.c (rich_location::add_fixit_remove): Reimplement
by calling add_fixit_replace with an empty string.
(fixit_remove::fixit_remove): Delete.
(fixit_remove::affects_line_p): Delete.
2016-08-19 Joseph Myers <joseph@codesourcery.com>
PR c/32187
* include/cpplib.h (CPP_N_FLOATN, CPP_N_FLOATNX)
(CPP_N_WIDTH_FLOATN_NX, CPP_FLOATN_SHIFT, CPP_FLOATN_MAX): New
macros.
* expr.c (interpret_float_suffix): Handle fN, fNx, FN and FNx
suffixes.
2016-08-19 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
* expr.c (eval_token): Append "evaluates to 0" to Wundef diagnostic.
2016-08-18 David Malcolm <dmalcolm@redhat.com>
* directives.c (directive_names): New array.
(_cpp_handle_directive): Offer spelling suggestions for misspelled
directives.
* errors.c (cpp_diagnostic_at_richloc): New function.
(cpp_error_at_richloc): New function.
* include/cpplib.h (struct cpp_callbacks): Add field
"get_suggestion".
(cpp_error_at_richloc): New decl.
2016-08-18 Marek Polacek <polacek@redhat.com>
PR c/7652
* pch.c (write_macdef): Add CPP_FALLTHRU.
2016-08-12 Marek Polacek <polacek@redhat.com>
PR c/7652
* lex.c (search_line_fast): Add FALLTHRU.
(_cpp_lex_direct): Likewise.
(cpp_token_val_index): Adjust fall through comment.
* macro.c (parse_params): Add FALLTHRU.
* pch.c (count_defs): Adjust fall through comment.
(write_defs): Likewise.
2016-08-06 David Malcolm <dmalcolm@redhat.com>
PR bootstrap/72823
* charset.c (_cpp_valid_ucn): Replace overzealous assert with one
that allows for char_range to be non-NULL when loc_reader is NULL.
2016-08-05 David Malcolm <dmalcolm@redhat.com>
* charset.c (cpp_substring_ranges::cpp_substring_ranges): New
constructor.
(cpp_substring_ranges::~cpp_substring_ranges): New destructor.
(cpp_substring_ranges::add_range): New method.
(cpp_substring_ranges::add_n_ranges): New method.
(_cpp_valid_ucn): Add "char_range" and "loc_reader" params; if
they are non-NULL, read position information from *loc_reader
and update char_range->m_finish accordingly.
(convert_ucn): Add "char_range", "loc_reader", and "ranges"
params. If loc_reader is non-NULL, read location information from
it, and update *ranges accordingly, using char_range.
Conditionalize the conversion into tbuf on tbuf being non-NULL.
(convert_hex): Likewise, conditionalizing the call to
emit_numeric_escape on tbuf.
(convert_oct): Likewise.
(convert_escape): Add params "loc_reader" and "ranges". If
loc_reader is non-NULL, read location information from it, and
update *ranges accordingly. Conditionalize the conversion into
tbuf on tbuf being non-NULL.
(cpp_interpret_string): Rename to...
(cpp_interpret_string_1): ...this, adding params "loc_readers" and
"out". Use "to" to conditionalize the initialization and usage of
"tbuf", such as running the converter. If "loc_readers" is
non-NULL, use the instances within it, reading location
information from them, and passing them to convert_escape; likewise
write to "out" if loc_readers is non-NULL. Check for leading
quote and issue an error if it is not present. Update boundary
check from "== limit" to ">= limit" to protect against erroneous
location values to calls that are not parsing string literals.
(cpp_interpret_string): Reimplement in terms to
cpp_interpret_string_1.
(noop_error_cb): New function.
(cpp_interpret_string_ranges): New function.
(cpp_string_location_reader::cpp_string_location_reader): New
constructor.
(cpp_string_location_reader::get_next): New method.
* include/cpplib.h (class cpp_string_location_reader): New class.
(class cpp_substring_ranges): New class.
(cpp_interpret_string_ranges): New prototype.
* internal.h (_cpp_valid_ucn): Add params "char_range" and
"loc_reader".
* lex.c (forms_identifier_p): Pass NULL for new params to
_cpp_valid_ucn.
2016-08-01 Andreas Schwab <schwab@suse.de>
* include/cpplib.h: Fix comment typo.
2016-07-27 David Malcolm <dmalcolm@redhat.com>
* include/line-map.h (source_location): Fix line numbers in
comment.
2016-07-11 David Malcolm <dmalcolm@redhat.com>
* include/line-map.h (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES):
Move here from line-map.c.
(LINE_MAP_MAX_LOCATION_WITH_COLS): Likewise.
* line-map.c (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): Move from
here to line-map.h.
(LINE_MAP_MAX_LOCATION_WITH_COLS): Likewise.
2016-06-22 David Malcolm <dmalcolm@redhat.com>
* directives.c (do_include_common): Pass on "location" to
_cpp_stack_include.
* errors.c (cpp_diagnostic): Reimplement in terms of...
(cpp_diagnostic_at): New function.
(cpp_error_at): New function.
(cpp_errno_filename): Add "loc" param and use it by using
cpp_error_at rather than cpp_error.
* files.c (find_file_in_dir): Add "loc" param and pass it to
open_file_failed.
(_cpp_find_file): Add "loc" param. Use it to convert calls to
cpp_error to cpp_error_at, and pass it to find_file_in_dir and
open_file_failed.
(read_file_guts): Add "loc" param. Use it to convert calls to
cpp_error to cpp_error_at. Pass it to cpp_errno_filename.
(read_file): Add "loc" param. Pass it to open_file_failed and
read_file_guts.
(should_stack_file): Add "loc" param. Pass it to read_file.
(_cpp_stack_file): Add "loc" param. Pass it to should_stack_file.
(_cpp_stack_include): Add "loc" param. Pass it to
_cpp_find_file and _cpp_stack_file.
(open_file_failed): Add "loc" param. Pass it to
cpp_errno_filename.
(_cpp_fake_include): Add 0 as a source_location in call to
_cpp_find_file.
(_cpp_compare_file_date): Likewise.
(cpp_push_include): Likewise for call to _cpp_stack_include.
(cpp_push_default_include): Likewise.
(_cpp_save_file_entries): Likewise for call to open_file_failed.
(_cpp_has_header): Likewise for call to _cpp_find_file.
* include/cpplib.h (cpp_errno_filename): Add source_location
param.
(cpp_error_at): New declaration.
* init.c (cpp_read_main_file): Add 0 as a source_location in calls
to _cpp_find_file and _cpp_stack_file.
* internal.h (_cpp_find_file): Add source_location param.
(_cpp_stack_file): Likewise.
(_cpp_stack_include): Likewise.
2016-06-22 David Malcolm <dmalcolm@redhat.com>
* include/line-map.h (fixit_hint::get_start_loc): New pure virtual
function.
(fixit_hint::maybe_get_end_loc): Likewise.
(fixit_insert::get_start_loc): New function, implementing
fixit_hint::get_start_loc.
(fixit_insert::maybe_get_end_loc): New function, implementing
fixit_hint::maybe_get_end_loc.
(fixit_remove::get_start_loc): New function, implementing
fixit_hint::get_start_loc.
(fixit_remove::maybe_get_end_loc): New function, implementing
fixit_hint::maybe_get_end_loc.
(fixit_replace::get_start_loc): New function, implementing
fixit_hint::get_start_loc.
(fixit_replace::maybe_get_end_loc): New function, implementing
fixit_hint::maybe_get_end_loc.
2016-06-21 John David Anglin <danglin@gcc.gnu.org>
* line-map.c (location_adhoc_data_update): Use int64_t instead of
long long.
(get_combined_adhoc_loc): Likewise.
2016-06-01 Eduard Sanou <dhole@openmailbox.org>
* include/cpplib.h (cpp_callbacks): Add get_source_date_epoch
callback.
* include/cpplib.h (cpp_init_source_date_epoch): Remove prototype.
* init.c (cpp_init_source_date_epoch): Remove function.
* init.c (cpp_create_reader): Initialize pfile->source_date_epoch.
* internal.h (cpp_reader): Extend comment about source_date_epoch.
* macro.c (_cpp_builtin_macro_text): Use get_source_date_epoch
callback only once, read pfile->source_date_epoch on future passes.
Check that get_source_date_epoch callback is not NULL.
2016-05-20 Martin Liska <mliska@suse.cz>
* config.in: Regenerated.
* configure: Likewise.
* configure.ac: Handle --enable-valgrind-annotations.
* lex.c (new_buff): Use ENABLE_VALGRIND_ANNOTATIONS instead
of ENABLE_VALGRIND_CHECKING.
(_cpp_free_buff): Likewise.
2016-04-28 Eduard Sanou <dhole@openmailbox.org>
Matthias Klose <doko@debian.org>
* include/cpplib.h (cpp_init_source_date_epoch): Prototype.
* init.c (cpp_init_source_date_epoch): New function.
* internal.h: Added source_date_epoch variable to struct
cpp_reader to store a reproducible date.
* macro.c (_cpp_builtin_macro_text): Set pfile->date timestamp from
pfile->source_date_epoch instead of localtime if source_date_epoch is
set, to be used for __DATE__ and __TIME__ macros to help reproducible
builds.
2016-04-13 Bernd Schmidt <bschmidt@redhat.com>
Patch from Roger Orr <rogero@howzatt.demon.co.uk>
PR preprocessor/69650
* directives.c (do_linemarker): Reread map after calling
cpp_get_token.
2016-04-06 Richard Henderson <rth@redhat.com>
PR preprocessor/61817
PR preprocessor/69391
* internal.h (_cpp_builtin_macro_text): Update decl.
* macro.c (_cpp_builtin_macro_text): Accept location for __LINE__.
(builtin_macro): Accept a second location for __LINE__.
(enter_macro_context): Compute both virtual and real expansion
locations for the macro.
2016-03-25 Bernd Schmidt <bschmidt@redhat.com>
PR lto/69650
* directives.c (do_linemarker): Test for file left but not entered
here.
* line-map.c (linemap_add): Not here.
2016-03-21 Jakub Jelinek <jakub@redhat.com>
PR target/70296
* include/cpplib.h (cpp_fun_like_macro_p): New prototype.
* macro.c (cpp_fun_like_macro_p): New function.
2016-03-15 Richard Henderson <rth@redhat.com>
* line-map.c (new_linemap): Make alloc_size a size_t.
2016-03-14 Jason Merrill <jason@redhat.com>
* expr.c (cpp_classify_number): Hex floats are new in C++1z.
* init.c (lang_defaults): Likewise.
2016-03-09 David Malcolm <dmalcolm@redhat.com>
PR c/68473
PR c++/70105
* line-map.c (linemap_macro_map_loc_unwind_toward_spelling): Move
decl...
* include/line-map.h
(linemap_macro_map_loc_unwind_toward_spelling): ...here,
converting from static to extern.
2016-03-09 David Malcolm <dmalcolm@redhat.com>
PR c/68473
PR c++/70105
* include/line-map.h (source_range::debug): Delete.
(struct location_range): Update comment. Replace
expanded_location fields "m_start", "m_finish", and "m_caret" with
a source_location field: "m_loc".
(class rich_location): Reword comment.
(rich_location::get_loc): Reimplement in terms of a new overloaded
variant which takes an unsigned int.
(rich_location::get_loc_addr): Delete.
(rich_location::add_range): Drop params "start" and "finish" in
favor of param "loc". Drop overloaded variants taking a
source_range or location_range *.
(rich_location::lazily_expand_location): Delete in favor of...
(rich_location::get_expanded_location): New decl.
(rich_location::m_loc): Delete field.
(rich_location::m_column_override): New field.
* line-map.c (rich_location::rich_location): Drop name of
line_maps * param. Update initializations for deletion of field
"m_loc" and addition of field "m_column_override". Reimplement
body as a call to add_range. Delete overloaded variant taking a
source_range.
(rich_location::get_loc): New function.
(rich_location::lazily_expand_location): Delete in favor of...
(rich_location::get_expanded_location): New function.
(rich_location::override_column): Reimplement.
(rich_location::add_range): Drop params "start" and "finish" in
favor of param "loc". Eliminate location expansion in favor of
simply storing loc. Drop overloaded variants taking a
source_range or location_range *.
(rich_location::set_range): Eliminate location expansion.
2016-02-29 David Malcolm <dmalcolm@redhat.com>
PR preprocessor/69985
(linemap_position_for_loc_and_offset): Rename param from "offset"
to "column_offset". Right-shift the column_offset by m_range_bits
of the pertinent ordinary map whenever offsetting a
source_location. For clarity, offset the column by the column
offset, rather than the other way around.
2016-02-23 David Malcolm <dmalcolm@redhat.com>
PR preprocessor/69126
PR preprocessor/69543
* line-map.c (linemap_compare_locations): At the function top,
replace inlined bodies of get_location_from_adhoc_loc with calls
to get_location_from_adhoc_loc. Add a pair of calls to
get_location_from_adhoc_loc at the bottom of the function, to
avoid meaningless comparisons of ad-hoc and non-ad-hoc locations.
2016-02-08 David Malcolm <dmalcolm@redhat.com>
PR preprocessor/69664
* errors.c (cpp_diagnostic_with_line): Only call
rich_location::override_column if the column is non-zero.
* line-map.c (rich_location::override_column): Update columns
within m_ranges[0]. Add assertions to verify that doing so is
sane.
2016-02-05 Jakub Jelinek <jakub@redhat.com>
PR c++/69628
* charset.c (cpp_interpret_charconst): Clear *PCHARS_SEEN
and *UNSIGNEDP if bailing out early due to errors.
2016-01-28 Jakub Jelinek <jakub@redhat.com>
PR pch/68176
* files.c (_cpp_find_file): Set file->implicit_preinclude even if
included from file->implicit_preinclude header.
* directives.c (destringize_and_run): Adjust prototype.
2016-01-27 David Malcolm <dmalcolm@redhat.com>
PR preprocessor/69126
* directives.c (destringize_and_run): Add expansion_loc param; use
it when handling unexpanded pragmas to fixup the locations of the
synthesized tokens.
(_cpp_do__Pragma): Add expansion_loc param and use it when calling
destringize_and_run.
* internal.h (_cpp_do__Pragma): Add expansion_loc param.
* macro.c (builtin_macro): Pass expansion location of _Pragma to
_cpp_do__Pragma.
2016-01-14 David Malcolm <dmalcolm@redhat.com>
PR preprocessor/69177
* line-map.c (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): New
constant.
(LINE_MAP_MAX_LOCATION_WITH_COLS): Add note about unit tests
to comment.
(can_be_stored_compactly_p): Reduce threshold from
LINE_MAP_MAX_LOCATION_WITH_COLS to
LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES.
(get_combined_adhoc_loc): Likewise.
(get_range_from_loc): Likewise.
(linemap_line_start): Ensure that a new ordinary map is created
when transitioning from range-packing being enabled to disabled,
at the LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES threshold. Set
range_bits to 0 for new ordinary maps when beyond this limit.
Prevent the "increase the column bits of a freshly created map"
optimization if the range bits has reduced.
2016-01-08 Jakub Jelinek <jakub@redhat.com>
PR c++/69145
* files.c (cpp_included_before): If IS_ADHOC_LOC (location), lookup
real location from the line_table.
2016-01-04 Jakub Jelinek <jakub@redhat.com>
Update copyright years.
2015-12-22 David Malcolm <dmalcolm@redhat.com>
* line-map.c (get_combined_adhoc_loc): Remove condition
on locus < RESERVED_LOCATION_COUNT when considering
whether a caret == start == finish location can be
simply stored as the caret location.
2015-12-07 David Malcolm <dmalcolm@redhat.com>
* include/line-map.h (rich_location::set_range): Add line_maps *
param; convert param from source_range to source_location. Drop
"overwrite_loc_p" param.
* line-map.c (rich_location::set_range): Likewise, acting as if
"overwrite_loc_p" were true, and getting range from the location.
2015-11-20 David Malcolm <dmalcolm@redhat.com>
PR 62314
* include/line-map.h (source_range::intersects_line_p): New
method.
(rich_location::~rich_location): New.
(rich_location::add_fixit_insert): New method.
(rich_location::add_fixit_remove): New method.
(rich_location::add_fixit_replace): New method.
(rich_location::get_num_fixit_hints): New accessor.
(rich_location::get_fixit_hint): New accessor.
(rich_location::MAX_FIXIT_HINTS): New constant.
(rich_location::m_num_fixit_hints): New field.
(rich_location::m_fixit_hints): New field.
(class fixit_hint): New class.
(class fixit_insert): New class.
(class fixit_remove): New class.
(class fixit_replace): New class.
* line-map.c (source_range::intersects_line_p): New method.
(rich_location::rich_location): Add initialization of
m_num_fixit_hints to both ctors.
(rich_location::~rich_location): New.
(rich_location::add_fixit_insert): New method.
(rich_location::add_fixit_remove): New method.
(rich_location::add_fixit_replace): New method.
(fixit_insert::fixit_insert): New.
(fixit_insert::~fixit_insert): New.
(fixit_insert::affects_line_p): New.
(fixit_remove::fixit_remove): New.
(fixit_remove::affects_line_p): New.
(fixit_replace::fixit_replace): New.
(fixit_replace::~fixit_replace): New.
(fixit_replace::affects_line_p): New.
2015-11-19 Jakub Jelinek <jakub@redhat.com>
PR preprocessor/60736
* include/cpplib.h (cpp_errno_filename): New prototype.
* errors.c (cpp_errno): Don't handle msgid "" specially, use
_(msgid) instead of msgid as argument to cpp_error.
(cpp_errno_filename): New function.
* files.c (read_file_guts): Use cpp_errno_filename instead of
cpp_errno.
(open_file_failed): Likewise. Use file->name if file->path is NULL
in diagnostics.
2015-11-13 David Malcolm <dmalcolm@redhat.com>
* errors.c (cpp_diagnostic): Pass pfile->line_table to
rich_location ctor.
(cpp_diagnostic_with_line): Likewise.
* include/cpplib.h (struct cpp_token): Update comment for src_loc
to indicate that the range of the token is "baked into" the
source_location.
* include/line-map.h (source_location): Update the descriptive
comment to reflect the packing scheme for short ranges, adding
worked examples of location encoding.
(struct line_map_ordinary): Drop field "column_bits" in favor
of field "m_column_and_range_bits"; add field "m_range_bits".
(ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete.
(location_adhoc_data): Add source_range field.
(struct line_maps): Add fields "default_range_bits",
"num_optimized_ranges" and "num_unoptimized_ranges".
(get_combined_adhoc_loc): Add source_range param.
(get_range_from_loc): New declaration.
(pure_location_p): New prototype.
(COMBINE_LOCATION_DATA): Add source_range param.
(SOURCE_LINE): Update for renaming of column_bits.
(SOURCE_COLUMN): Likewise. Shift the column right by the map's
range_bits.
(LAST_SOURCE_LINE_LOCATION): Update for renaming of column_bits.
(linemap_position_for_line_and_column): Add line_maps * params.
(rich_location::rich_location): Likewise.
* lex.c (_cpp_lex_direct): Capture the range of the token, baking
it into token->src_loc via a call to COMBINE_LOCATION_DATA.
* line-map.c (LINE_MAP_MAX_COLUMN_NUMBER): Reduce from 1U << 17 to
1U << 12.
(location_adhoc_data_hash): Add the src_range into
the hash value.
(location_adhoc_data_eq): Require equality of the src_range
values.
(can_be_stored_compactly_p): New function.
(get_combined_adhoc_loc): Add src_range param, and store it,
via a bit-packing scheme for short ranges, otherwise within the
lookaside table. Remove the requirement that data is non-NULL.
(get_range_from_adhoc_loc): New function.
(get_range_from_loc): New function.
(pure_location_p): New function.
(linemap_add): Ensure that start_location has zero for the
range_bits, unless we're past LINE_MAP_MAX_LOCATION_WITH_COLS.
Initialize range_bits to zero. Assert that the start_location
is "pure".
(linemap_line_start): Assert that the
column_and_range_bits >= range_bits.
Update determinination of whether we need to start a new map
using the effective column bits, without the range bits.
Use the set's default_range_bits in new maps, apart from
those with column_bits == 0, which should also have 0 range_bits.
Increase the column bits for new maps by the range bits.
When adding lines to an existing map, use set->highest_line
directly rather than offsetting highest by SOURCE_COLUMN.
Add assertions to sanity-check the return value.
(linemap_position_for_column): Offset to_column by range_bits.
Update set->highest_location if necessary.
(linemap_position_for_line_and_column): Add line_maps * param.
Update the calculation to offset the column by range_bits, and
conditionalize it on being <= LINE_MAP_MAX_LOCATION_WITH_COLS.
Bound it by LINEMAPS_MACRO_LOWEST_LOCATION. Update
set->highest_location if necessary.
(linemap_position_for_loc_and_offset): Handle ad-hoc locations;
pass "set" to linemap_position_for_line_and_column.
(linemap_macro_map_loc_unwind_toward_spelling): Add line_maps
param. Handle ad-hoc locations.
(linemap_location_in_system_header_p): Pass on "set" to call to
linemap_macro_map_loc_unwind_toward_spelling.
(linemap_macro_loc_to_spelling_point): Retain ad-hoc locations.
Pass on "set" to call to
linemap_macro_map_loc_unwind_toward_spelling.
(linemap_resolve_location): Retain ad-hoc locations. Pass on
"set" to call to linemap_macro_map_loc_unwind_toward_spelling.
(linemap_unwind_toward_expansion): Pass on "set" to call to
linemap_macro_map_loc_unwind_toward_spelling.
(linemap_expand_location): Extract the data pointer before
extracting the location.
(rich_location::rich_location): Add line_maps param; use it to
extract the range from the source_location.
* location-example.txt: Regenerate, showing new representation.
2015-11-06 David Malcolm <dmalcolm@redhat.com>
* errors.c (cpp_diagnostic): Update for change in signature
of "error" callback.
(cpp_diagnostic_with_line): Likewise, calling override_column
on the rich_location.
* include/cpplib.h (struct cpp_callbacks): Within "error"
callback, convert param from source_location to rich_location *,
and drop column_override param.
* include/line-map.h (struct source_range): New struct.
(struct location_range): New struct.
(class rich_location): New class.
(linemap_client_expand_location_to_spelling_point): New declaration.
* line-map.c (rich_location::rich_location): New ctors.
(rich_location::lazily_expand_location): New method.
(rich_location::override_column): New method.
(rich_location::add_range): New methods.
(rich_location::set_range): New method.
2015-11-06 David Malcolm <dmalcolm@redhat.com>
* include/line-map.h (struct linemap_stats): Add fields
"adhoc_table_size" and "adhoc_table_entries_used".
* line-map.c (linemap_get_statistics): Populate above fields.
2015-11-04 Mikhail Maltsev <maltsevm@gmail.com>
* config.in: Regenerate.
* configure: Regenerate.
* configure.ac: Remove ENABLE_CHECKING.
2015-11-03 Uros Bizjak <ubizjak@gmail.com>
* lex.c (search_line_sse42): Correctly advance the pointer to an
aligned address.
2015-11-02 David Malcolm <dmalcolm@redhat.com>
* include/line-map.h (source_location): In the table in the
descriptive comment, show UNKNOWN_LOCATION, BUILTINS_LOCATION,
LINE_MAP_MAX_LOCATION_WITH_COLS, LINE_MAP_MAX_SOURCE_LOCATION.
Add notes about ad-hoc values.
2015-10-21 Mikhail Maltsev <maltsevm@gmail.com>
* include/line-map.h: Use CHECKING_P instead of ENABLE_CHECKING.
* init.c: Likewise.
* macro.c (struct macro_arg_token_iter, set_arg_token,
macro_arg_token_iter_init, macro_arg_token_iter_forward,
macro_arg_token_iter_get_token, macro_arg_token_iter_get_location,
alloc_expanded_arg_mem, _cpp_backup_tokens): Likewise.
* config.in: Regenerate.
* configure: Regenerate.
* configure.ac (CHECKING_P): Define.
* system.h (fancy_abort): Declare.
(abort): Define.
(gcc_assert): Define. Use CHECKING_P.
2015-10-13 Mikhail Maltsev <maltsevm@gmail.com>
* system.h (CHECKING_P, gcc_checking_assert): Define.
2015-09-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c/66415
* line-map.c (linemap_position_for_loc_and_offset): Handle the
case of long lines encoded in multiple maps.
2015-09-07 Marek Polacek <polacek@redhat.com>
* system.h (INTTYPE_MINIMUM): Rewrite to avoid shift warning.
2015-08-06 Yaakov Selkowitz <yselkowi@redhat.com>
* configure: Regenerate.
2015-07-08 Thomas Schwinge <thomas@codesourcery.com>
* include/line-map.h (RESERVED_LOCATION_COUNT): Change type to
source_location.
2015-07-02 Paolo Carlini <paolo.carlini@oracle.com>
PR preprocessor/53690
* charset.c (_cpp_valid_ucn): Add cppchar_t * parameter and change
return type to bool. Fix encoding of \u0000 and \U00000000 in C++.
(convert_ucn): Adjust call.
* lex.c (forms_identifier_p): Likewise.
* internal.h (_cpp_valid_ucn): Adjust declaration.
2015-06-30 Edward Smith-Rowland <3dw4rd@verizon.net>
Implement N4197 - Adding u8 character literals
* include/cpplib.h (UTF8CHAR, UTF8CHAR_USERDEF): New cpp tokens;
(struct cpp_options): Add utf8_char_literals.
* init.c (struct lang_flags): Add utf8_char_literals;
(struct lang_flags lang_defaults): Add column for utf8_char_literals.
* macro.c (stringify_arg()): Treat CPP_UTF8CHAR token;
* expr.c (cpp_userdef_char_remove_type(), cpp_userdef_char_add_type()):
Treat CPP_UTF8CHAR_USERDEF, CPP_UTF8CHAR tokens;
(cpp_userdef_char_p()): Treat CPP_UTF8CHAR_USERDEF token;
(eval_token(), _cpp_parse_expr()): Treat CPP_UTF8CHAR token.
* lex.c (lex_string(), _cpp_lex_direct()): Include CPP_UTF8CHAR tokens.
* charset.c (converter_for_type(), cpp_interpret_charconst()):
Treat CPP_UTF8CHAR token.
2015-06-30 Uros Bizjak <ubizjak@gmail.com>
* lex.c (search_line_sse42) [__GCC_ASM_FLAG_OUTPUTS__]: New main
loop using asm flag outputs.
2015-06-08 Marek Polacek <polacek@redhat.com>
PR c/66415
* line-map.c (linemap_position_for_loc_and_offset): Remove
linemap_assert_fails; reverse conditions.
2015-05-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
* line-map.c (LINE_MAP_MAX_COLUMN_NUMBER
LINE_MAP_MAX_LOCATION_WITH_COLS,LINE_MAP_MAX_SOURCE_LOCATION):
New constants.
(linemap_line_start): Use them.
(linemap_position_for_column): Use them.
2015-05-20 David Malcolm <dmalcolm@redhat.com>
* include/line-map.h (MAP_START_LOCATION): Eliminate the non-const
variant, and tweak comment for the const variant.
(ORDINARY_MAP_STARTING_LINE_NUMBER): Drop the non-const variant.
(ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
(ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
(SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete.
(ORDINARY_MAP_FILE_NAME): Drop the non-const variant.
(MACRO_MAP_MACRO): Likewise.
(MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
(MACRO_MAP_LOCATIONS): Likewise.
(MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
* line-map.c (linemap_add): Replace writes through macros with
direct field accesses.
(linemap_enter_macro): Likewise.
(linemap_line_start): Likewise.
2015-05-19 David Malcolm <dmalcolm@redhat.com>
* directives.c (do_line): Strengthen local "map" from
const line_map * to const line_map_ordinary *.
(do_linemarker): Likewise.
(_cpp_do_file_change): Assert that we're not dealing with
a macro map. Introduce local "ord_map" via a call to
linemap_check_ordinary, guarded within the check for
non-NULL. Use it for typesafety.
* files.c (cpp_make_system_header): Strengthen local "map" from
const line_map * to const line_map_ordinary *.
* include/cpplib.h (struct cpp_callbacks): Likewise for second
parameter of "file_change" callback.
* include/line-map.h (struct line_map): Convert from a struct
containing a union to a base class.
(struct line_map_ordinary): Convert to a subclass of line_map.
(struct line_map_macro): Likewise.
(linemap_check_ordinary): Strengthen return type from line_map *
to line_map_ordinary *, and add a const-variant.
(linemap_check_macro): New pair of functions.
(ORDINARY_MAP_STARTING_LINE_NUMBER): Strengthen param from
const line_map * to const line_map_ordinary *, eliminating call
to linemap_check_ordinary. Likewise for the non-const variant.
(ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
(ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
(ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Likewise.
(ORDINARY_MAP_FILE_NAME): Likewise.
(MACRO_MAP_MACRO): Strengthen param from const line_map * to
const line_map_macro *. Likewise for the non-const variant.
(MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
(MACRO_MAP_LOCATIONS): Likewise.
(MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
(struct maps_info): Replace with...
(struct maps_info_ordinary):...this and...
(struct maps_info_macro): ...this.
(struct line_maps): Convert fields "info_ordinary" and
"info_macro" to the above new structs.
(LINEMAPS_MAP_INFO): Delete both functions.
(LINEMAPS_MAPS): Likewise.
(LINEMAPS_ALLOCATED): Rewrite both variants to avoid using
LINEMAPS_MAP_INFO.
(LINEMAPS_USED): Likewise.
(LINEMAPS_CACHE): Likewise.
(LINEMAPS_MAP_AT): Likewise.
(LINEMAPS_ORDINARY_MAPS): Strengthen return type from line_map *
to line_map_ordinary *.
(LINEMAPS_ORDINARY_MAP_AT): Likewise.
(LINEMAPS_LAST_ORDINARY_MAP): Likewise.
(LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise.
(LINEMAPS_MACRO_MAPS): Strengthen return type from line_map * to
line_map_macro *.
(LINEMAPS_MACRO_MAP_AT): Likewise.
(LINEMAPS_LAST_MACRO_MAP): Likewise.
(LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise.
(linemap_map_get_macro_name): Strengthen param from
const line_map * to const line_map_macro *.
(SOURCE_LINE): Strengthen first param from const line_map * to
const line_map_ordinary *, removing call to
linemap_check_ordinary.
(SOURCE_COLUMN): Likewise.
(LAST_SOURCE_LINE_LOCATION): Likewise.
(LAST_SOURCE_LINE): Strengthen first param from const line_map *
to const line_map_ordinary *.
(LAST_SOURCE_COLUMN): Likewise.
(INCLUDED_FROM): Strengthen return type from line_map * to
line_map_ordinary *., and second param from const line_map *
to const line_map_ordinary *, removing call to
linemap_check_ordinary.
(MAIN_FILE_P): Strengthen param from const line_map * to
const line_map_ordinary *, removing call to
linemap_check_ordinary.
(linemap_position_for_line_and_column): Strengthen param from
const line_map * to const line_map_ordinary *.
(LINEMAP_FILE): Strengthen param from const line_map * to
const line_map_ordinary *, removing call to
linemap_check_ordinary.
(LINEMAP_LINE): Likewise.
(LINEMAP_SYSP): Likewise.
(linemap_resolve_location): Strengthen final param from
const line_map ** to const line_map_ordinary **.
* internal.h (CPP_INCREMENT_LINE): Likewise for local "map".
(linemap_enter_macro): Strengthen return type from
const line_map * to const line_map_macro *.
(linemap_add_macro_token): Likewise for first param.
* line-map.c (linemap_check_files_exited): Strengthen local "map"
from const line_map * to const line_map_ordinary *.
(new_linemap): Introduce local "map_size" and use it when
calculating how large the buffer should be. Rewrite based
on change of info_macro and info_ordinary into distinct types.
(linemap_add): Strengthen locals "map" and "from" from line_map *
to line_map_ordinary *.
(linemap_enter_macro): Strengthen return type from
const line_map * to const line_map_macro *, and local "map" from
line_map * to line_map_macro *.
(linemap_add_macro_token): Strengthen param "map" from
const line_map * to const line_map_macro *.
(linemap_line_start): Strengthen local "map" from line_map * to
line_map_ordinary *.
(linemap_position_for_column): Likewise.
(linemap_position_for_line_and_column): Strengthen first param
from const line_map * to const line_map_ordinary *.
(linemap_position_for_loc_and_offset): Strengthen local "map" from
const line_map * to const line_map_ordinary *.
(linemap_ordinary_map_lookup): Likewise for return type and locals
"cached" and "result".
(linemap_macro_map_lookup): Strengthen return type and locals
"cached" and "result" from const line_map * to
const line_map_macro *.
(linemap_macro_map_loc_to_exp_point): Likewise for param "map".
(linemap_macro_map_loc_to_def_point): Likewise.
(linemap_macro_map_loc_unwind_toward_spelling): Likewise.
(linemap_get_expansion_line): Strengthen local "map" from
const line_map * to const line_map_ordinary *.
(linemap_get_expansion_filename): Likewise.
(linemap_map_get_macro_name): Strengthen param from
const line_map * to const line_map_macro *.
(linemap_location_in_system_header_p): Add call to
linemap_check_ordinary in region guarded by
!linemap_macro_expansion_map_p. Introduce local "macro_map" via
linemap_check_macro in other region, using it in place of "map"
for typesafety.
(first_map_in_common_1): Add calls to linemap_check_macro.
(trace_include): Strengthen param "map" from const line_map * to
const line_map_ordinary *.
(linemap_macro_loc_to_spelling_point): Strengthen final param from
const line_map ** to const line_map_ordinary **. Replace a
C-style cast with a const_cast, and add calls to
linemap_check_macro and linemap_check_ordinary.
(linemap_macro_loc_to_def_point): Likewise.
(linemap_macro_loc_to_exp_point): Likewise.
(linemap_resolve_location): Strengthen final param from
const line_map ** to const line_map_ordinary **.
(linemap_unwind_toward_expansion): Introduce local "macro_map" via
a checked cast and use it in place of *map.
(linemap_unwind_to_first_non_reserved_loc): Strengthen local
"map1" from const line_map * to const line_map_ordinary *.
(linemap_expand_location): Introduce local "ord_map" via a checked
cast and use it in place of map.
(linemap_dump): Make local "map" const. Strengthen local
"includer_map" from line_map * to const line_map_ordinary *.
Introduce locals "ord_map" and "macro_map" via checked casts and
use them in place of "map" for typesafety.
(linemap_dump_location): Strengthen local "map" from
const line_map * to const line_map_ordinary *.
(linemap_get_file_highest_location): Update for elimination of
union.
(linemap_get_statistics): Strengthen local "cur_map" from
line_map * to const line_map_macro *. Update uses of sizeof to
use the appropriate line_map subclasses.
* macro.c (_cpp_warn_if_unused_macro): Add call to
linemap_check_ordinary.
(builtin_macro): Strengthen local "map" from const line_map * to
const line_map_macro *.
(enter_macro_context): Likewise.
(replace_args): Likewise.
(tokens_buff_put_token_to): Likewise for param "map".
(tokens_buff_add_token): Likewise.
2015-05-13 David Malcolm <dmalcolm@redhat.com>
* include/line-map.h (source_location): Add a reference to
location-example.txt to the descriptive comment.
* location-example.txt: New file.
2015-05-13 David Malcolm <dmalcolm@redhat.com>
* include/line-map.h (MAX_SOURCE_LOCATION): Convert from a macro
to a const source_location.
(RESERVED_LOCATION_COUNT): Likewise.
(linemap_check_ordinary): Convert from a macro to a pair of inline
functions, for const/non-const arguments.
(MAP_START_LOCATION): Likewise.
(ORDINARY_MAP_STARTING_LINE_NUMBER): Likewise.
(ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
(ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
(ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Convert from a macro to a
pair of inline functions, for const/non-const arguments, where the
latter is named...
(SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): New function.
(ORDINARY_MAP_FILE_NAME): Convert from a macro to a pair of inline
functions, for const/non-const arguments.
(MACRO_MAP_MACRO): Likewise.
(MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
(MACRO_MAP_LOCATIONS): Likewise.
(MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
(LINEMAPS_MAP_INFO): Likewise.
(LINEMAPS_MAPS): Likewise.
(LINEMAPS_ALLOCATED): Likewise.
(LINEMAPS_USED): Likewise.
(LINEMAPS_CACHE): Likewise.
(LINEMAPS_ORDINARY_CACHE): Likewise.
(LINEMAPS_MACRO_CACHE): Likewise.
(LINEMAPS_MAP_AT): Convert from a macro to an inline function.
(LINEMAPS_LAST_MAP): Likewise.
(LINEMAPS_LAST_ALLOCATED_MAP): Likewise.
(LINEMAPS_ORDINARY_MAPS): Likewise.
(LINEMAPS_ORDINARY_MAP_AT): Likewise.
(LINEMAPS_ORDINARY_ALLOCATED): Likewise.
(LINEMAPS_ORDINARY_USED): Likewise.
(LINEMAPS_LAST_ORDINARY_MAP): Likewise.
(LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise.
(LINEMAPS_MACRO_MAPS): Likewise.
(LINEMAPS_MACRO_MAP_AT): Likewise.
(LINEMAPS_MACRO_ALLOCATED): Likewise.
(LINEMAPS_MACRO_USED): Likewise.
(LINEMAPS_MACRO_LOWEST_LOCATION): Likewise.
(LINEMAPS_LAST_MACRO_MAP): Likewise.
(LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise.
(IS_ADHOC_LOC): Likewise.
(COMBINE_LOCATION_DATA): Likewise.
(SOURCE_LINE): Likewise.
(SOURCE_COLUMN): Likewise.
(LAST_SOURCE_LINE_LOCATION): Likewise.
(LAST_SOURCE_LINE): Likewise.
(LAST_SOURCE_COLUMN): Likewise.
(LAST_SOURCE_LINE_LOCATION)
(INCLUDED_FROM): Likewise.
(MAIN_FILE_P): Likewise.
(LINEMAP_FILE): Likewise.
(LINEMAP_LINE): Likewise.
(LINEMAP_SYSP): Likewise.
(linemap_location_before_p): Likewise.
* line-map.c (linemap_check_files_exited): Make local "map" const.
(linemap_add): Use SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS.
(linemap_line_start): Likewise.
2015-05-13 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
* aclocal.m4: Regenerated with automake-1.11.6.
2015-05-13 David Malcolm <dmalcolm@redhat.com>
* include/line-map.h (linemap_assert): Move up within the file to
before all of the map accessor macros.
(linemap_assert_fails): Likewise.
(linemap_check_ordinary): Likewise.
(linemap_macro_expansion_map_p): Likewise.
2015-05-12 David Malcolm <dmalcolm@redhat.com>
* directives.c (do_line): Set seen_line_directive on line_table.
(do_linemarker): Likewise.
* include/line-map.h (struct line_maps): Add new field
"seen_line_directive".
2015-05-08 Jason Merrill <jason@redhat.com>
* include/cpplib.h: Add CPP_W_CXX11_COMPAT.
(struct cpp_options): Add cpp_warn_cxx11_compat.
* init.c (cpp_create_reader): Initialize it.
* lex.c (lex_string): Add -Wc++11-compat warning.
2015-05-05 David Malcolm <dmalcolm@redhat.com>
* pch.c (cpp_valid_state): Fix indentation so that it reflects the
block structure.
2015-05-05 David Malcolm <dmalcolm@redhat.com>
* include/line-map.h: Fix comment at the top of the file.
(source_location): Rewrite and expand the comment for this
typedef, adding an ascii-art table to clarify how source_location
values are allocated.
* line-map.c: Fix comment at the top of the file.
2015-04-09 Richard Biener <rguenther@suse.de>
PR pch/65550
* files.c (pch_open_file): Allow main and pre-included files
when trying to open a PCH.
2015-04-06 Jakub Jelinek <jakub@redhat.com>
PR preprocessor/61977
* lex.c (cpp_peek_token): If peektok is CPP_EOF, back it up
with all tokens peeked by the current function.
2015-04-02 Jakub Jelinek <jakub@redhat.com>
PR preprocessor/61977
* lex.c (cpp_peek_token): Temporarily clear pfile->cb.line_change.
2015-03-23 Jakub Jelinek <jakub@redhat.com>
PR preprocessor/65238
* internal.h (_cpp_scan_out_logical_line): Add third argument.
* directives.c (prepare_directive_trad): Pass false to it.
* traditional.c (_cpp_read_logical_line_trad,
_cpp_create_trad_definition): Likewise.
(struct fun_macro): Add paramc field.
(fun_like_macro): New function.
(maybe_start_funlike): Handle NODE_BUILTIN macros. Initialize
macro->paramc field.
(save_argument): Use macro->paramc instead of
macro->node->value.macro->paramc.
(push_replacement_text): Formatting fix.
(recursive_macro): Use fun_like_macro helper.
(_cpp_scan_out_logical_line): Likewise. Add BUILTIN_MACRO_ARG
argument. Initialize fmacro.paramc field. Handle builtin
function-like macros.
2015-03-16 Edward Smith-Rowland <3dw4rd@verizon.net>
PR c++/64626
* lex.c (lex_number): If a number ends with digit-seps (') skip back
and let lex_string take them.
2015-03-02 Markus Trippelsdorf <markus@trippelsdorf.de>
PR target/65261
* lex.c (search_line_fast): Silence ubsan errors.
2015-02-03 <dodji@redhat.com>
PR preprocessor/64803
* internal.h (cpp_reader::top_most_macro_node): New data member.
* macro.c (enter_macro_context): Pass the location of the end of
the top-most invocation of the function-like macro, or the
location of the expansion point of the top-most object-like macro.
(cpp_get_token_1): Store the top-most macro node in the new
pfile->top_most_macro_node data member.
(_cpp_pop_context): Clear the new cpp_reader::top_most_macro_node
data member.
2015-01-30 Szabolcs Nagy <szabolcs.nagy@arm.com>
* lex.c (search_line_fast): Change __ARM_NEON__ to __ARM_NEON.
2015-01-23 Marek Polacek <polacek@redhat.com>
DR#412
PR preprocessor/60570
* directives.c (do_elif): Don't evaluate #elif conditionals
when they don't need to be.
2015-01-16 Jakub Jelinek <jakub@redhat.com>
* expr.c (cpp_classify_number): Add N_() around ?: string
literals used in cpp_error_with_line call as format string.
2015-01-05 Jakub Jelinek <jakub@redhat.com>
Update copyright years.
2014-12-19 Jakub Jelinek <jakub@redhat.com>
PR preprocessor/63831
* directives.c (lex_macro_node): Remove __has_attribute__ handling.
* internal.h (struct spec_node): Remove n__has_attribute__ field.
(struct lexer_state): Remove in__has_attribute__ field.
* macro.c (_cpp_builtin_macro_text): Handle BT_HAS_ATTRIBUTE.
* identifiers.c (_cpp_init_hashtable): Remove __has_attribute__
handling.
* init.c (builtin_array): Add __has_attribute and __has_cpp_attribute.
(cpp_init_special_builtins): Don't initialize __has_attribute
or __has_cpp_attribute if CLK_ASM or pfile->cb.has_attribute is NULL.
* traditional.c (enum ls): Remove ls_has_attribute,
ls_has_attribute_close.
(_cpp_scan_out_logical_line): Remove __has_attribute__ handling.
* include/cpplib.h (enum cpp_builtin_type): Add BT_HAS_ATTRIBUTE.
* pch.c (cpp_read_state): Remove __has_attribute__ handling.
* expr.c (eval_token): Likewise.
(parse_has_attribute): Removed.
2014-12-11 Uros Bizjak <ubizjak@gmail.com>
* directives.c (cpp_define_formatted): Use xvasprintf.
2014-12-05 Manuel López-Ibáñez <manu@gcc.gnu.org>
* line-map.c (linemap_position_for_loc_and_offset): Add new
linemap_assert_fails.
2014-12-02 Manuel López-Ibáñez <manu@gcc.gnu.org>
* include/line-map.h (linemap_assert_fails): Declare.
* line-map.c (linemap_position_for_loc_and_offset): Use it.
2014-12-02 Manuel López-Ibáñez <manu@gcc.gnu.org>
* line-map.c (linemap_add): Fix typo.
(linemap_line_start): Fix whitespace.
2014-11-29 John Schmerge <jbschmerge@gmail.com>
PR preprocessor/41698
* charset.c (one_utf8_to_utf16): Do not produce surrogate pairs
for 0xffff.
2014-11-25 Jakub Jelinek <jakub@redhat.com>
PR preprocessor/60436
* line-map.c (linemap_line_start): If highest is above 0x60000000
and we are still tracking columns or highest is above 0x70000000,
force add_map.
2014-11-20 Uros Bizjak <ubizjak@gmail.com>
PR target/63966
* lex.c [__i386__ || __x86_64__]: Compile special SSE functions
only for (__GNUC__ >= 5 || !defined(__PIC__)).
2014-11-13 Manuel López-Ibáñez <manu@gcc.gnu.org>
* include/line-map.h: Include EXPR, so that unused variable warnings
do not occur.
2014-11-11 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR fortran/44054
* include/line-map.h (linemap_position_for_loc_and_offset):
Declare.
* line-map.c (linemap_position_for_loc_and_offset): New.
2014-11-11 David Malcolm <dmalcolm@redhat.com>
* ChangeLog.jit: New.
2014-11-10 Edward Smith-Rowland <3dw4rd@verizon.net>
* include/cpplib.h (cpp_callbacks): Add has_attribute.
* internal.h (lexer_state): Add in__has_attribute__.
* directives.c (lex_macro_node): Prevent use of __has_attribute__
as a macro.
* expr.c (parse_has_attribute): New function; (eval_token): Look for
__has_attribute__ and route to parse_has_attribute.
* identifiers.c (_cpp_init_hashtable): Initialize n__has_attribute__.
* pch.c (cpp_read_state): Initialize n__has_attribute__.
* traditional.c (enum ls): Add ls_has_attribute, ls_has_attribute_close;
(_cpp_scan_out_logical_line): Attend to __has_attribute__.
2014-11-06 Joseph Myers <joseph@codesourcery.com>
* include/cpp-id-data.h (struct cpp_macro): Update comment
regarding parameters.
* include/cpplib.h (struct cpp_macro_arg, struct cpp_identifier):
Add spelling fields.
(struct cpp_token): Update comment on macro_arg.
* internal.h (_cpp_save_parameter): Add extra argument.
(_cpp_spell_ident_ucns): New declaration.
* lex.c (lex_identifier): Add SPELLING argument. Set *SPELLING to
original spelling of identifier.
(_cpp_lex_direct): Update calls to lex_identifier.
(_cpp_spell_ident_ucns): New function, factored out of
cpp_spell_token.
(cpp_spell_token): Adjust FORSTRING argument semantics to return
original spelling of identifiers. Use _cpp_spell_ident_ucns in
!FORSTRING case.
(_cpp_equiv_tokens): Check spellings of identifiers and macro
arguments are identical.
* macro.c (macro_arg_saved_data): New structure.
(paste_tokens): Use original spellings of identifiers from
cpp_spell_token.
(_cpp_save_parameter): Add argument SPELLING. Save both canonical
node and its value.
(parse_params): Update calls to _cpp_save_parameter.
(lex_expansion_token): Save spelling of macro argument tokens.
(_cpp_create_definition): Extract canonical node from saved data.
(cpp_macro_definition): Use UCNs in spelling of macro name. Use
original spellings of macro argument tokens and identifiers.
* traditional.c (scan_parameters): Update call to
_cpp_save_parameter.
2014-11-05 Joseph Myers <joseph@codesourcery.com>
PR preprocessor/9449
* init.c (lang_defaults): Enable extended identifiers for C++ and
C99-based standards.
2014-10-22 Alan Modra <amodra@gmail.com>
* symtab.c (ht_create): Use obstack_specify_allocation in place of
_obstack_begin.
* files.c (_cpp_init_files): Likewise.
* init.c (cpp_create_reader): Likewise.
* identifiers.c (_cpp_init_hashtable): Likewise.
2014-10-14 Manuel López-Ibáñez <manu@gcc.gnu.org>
* include/line-map.h (linemap_location_from_macro_expansion_p):
const struct line_maps * argument.
(linemap_position_for_line_and_column): const struct line_map *
argument.
* line-map.c (linemap_add_macro_token): Use correct argument name
in comment.
(linemap_position_for_line_and_column): const struct line_map *
argument.
(linemap_macro_map_loc_to_def_point): Fix comment. Make static.
(linemap_location_from_macro_expansion_p): const struct line_maps *
argument.
(linemap_resolve_location): Fix argument names in comment.
2014-10-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* lex.c (search_line_fast): Add new version to be used for Power8
and later targets when Altivec is enabled. Restrict the existing
Altivec version to big-endian systems so that lvsr is not used on
little endian, where it is deprecated. Remove LE-specific code
from the now-BE-only version.
2014-10-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
Jeff Law <law@redhat.com>
* charset.c (convert_no_conversion): Reallocate memory with 25%
headroom.
2014-10-01 Edward Smith-Rowland <3dw4rd@verizon.net>
Implement SD-6: SG10 Feature Test Recommendations
* internal.h (lexer_state, spec_nodes): Add in__has_include__.
* directives.c: Support __has_include__ builtin.
* expr.c (parse_has_include): New function to parse __has_include__
builtin; (eval_token()): Use it.
* files.c (_cpp_has_header()): New funtion to look for header;
(open_file_failed()): Not an error to not find a header file for
__has_include__.
* identifiers.c (_cpp_init_hashtable()): Add entry for __has_include__.
* pch.c (cpp_read_state): Lookup __has_include__.
* traditional.c (enum ls, _cpp_scan_out_logical_line()): Walk through
__has_include__ statements.
2014-09-30 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR preprocessor/58893
* errors.c (cpp_diagnostic): Fix possible out of bounds access.
* files.c (_cpp_stack_include): Initialize src_loc for IT_CMDLINE.
2014-09-24 Marek Polacek <polacek@redhat.com>
PR c/61405
PR c/53874
* include/cpplib.h (enum cpp_ttype): Define CPP_KEYWORD.
2014-09-17 Jan Hubicka <hubicka@ucw.cz>
* charset.c (conversion): Rename to ...
(cpp_conversion): ... this one; update.
* files.c (file_hash_entry): Rename to ...
(cpp_file_hash_entry): ... this one ; update.
2014-09-17 Marek Polacek <polacek@redhat.com>
PR c/61854
* init.c (struct lang_flags): Remove cplusplus_comments.
(cpp_set_lang): Likewise.
(post_options): Likewise.
* lex.c (_cpp_lex_direct): Disallow C++ style comments in C90/C94.
2014-09-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
* include/cpplib.h (struct cpp_options): Declare warn_normalize as
int instead of enum.
2014-09-04 Manuel López-Ibáñez <manu@gcc.gnu.org>
* macro.c (replace_args): Use cpp_pedwarning, cpp_warning and
CPP_W flags.
* include/cpplib.h: Add CPP_W_C90_C99_COMPAT and CPP_W_PEDANTIC.
* init.c (cpp_create_reader): Do not init to -1 here.
* expr.c (num_binary_op): Use cpp_pedwarning.
2014-08-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
* directives.c (check_eol_1): New.
(check_eol_endif_labels): New.
(check_eol): Call check_eol_1.
(do_else,do_endif): Call check_eol_endif_labels.
2014-08-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
* macro.c (warn_of_redefinition): Suppress warnings for builtins
that lack the NODE_WARN flag, unless Wbuiltin-macro-redefined.
(_cpp_create_definition): Use Wbuiltin-macro-redefined for
builtins that lack the NODE_WARN flag.
* directives.c (do_undef): Likewise.
* init.c (cpp_init_special_builtins): Do not change flags
depending on Wbuiltin-macro-redefined.
2014-08-28 Edward Smith-Rowland <3dw4rd@verizon.net>
PR cpp/23827 - standard C++ should not have hex float preprocessor
tokens
* libcpp/init.c (lang_flags): Change CXX98 flag for extended numbers
from 1 to 0.
* libcpp/expr.c (cpp_classify_number): Weite error message for improper
use of hex floating literal.
2014-08-23 Edward Smith-Rowland <3dw4rd@verizon.net>
* include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Z, CLK_CXX1Z;
Rename CLK_GNUCXX1Y, CLK_CXX1Y to CLK_GNUCXX14, CLK_CXX14;
* init.c (struct lang_flags lang_defaults): Add column for trigraphs;
Add rows for CLK_GNUCXX1Z, CLK_CXX1Z; (cpp_set_lang): Set trigraphs;
(cpp_init_builtins): Set __cplusplus to 201402L for C++14;
Set __cplusplus to 201500L for C++17.
* expr.c (cpp_classify_number): Change C++1y to C++14 in binary
constants error message.
2014-08-20 Marek Polacek <polacek@redhat.com>
* include/cpplib.h (cpp_options): Use signed char.
* lex.c (_cpp_lex_direct): Don't warn in C++ mode.
2014-08-19 Marek Polacek <polacek@redhat.com>
* lex.c (_cpp_lex_direct): Fix a typo.
2014-08-19 Marek Polacek <polacek@redhat.com>
* charset.c (_cpp_valid_ucn): Warn only if -Wc90-c99-compat.
* lex.c (_cpp_lex_direct): Likewise.
* macro.c (replace_args): Likewise.
(parse_params): Likewise.
* include/cpplib.h (cpp_options): Change cpp_warn_c90_c99_compat
to char.
2014-08-10 Marek Polacek <polacek@redhat.com>
PR c/51849
* lex.c (_cpp_lex_direct): Warn when -Wc90-c99-compat is in effect.
* charset.c (_cpp_valid_ucn): Likewise.
* include/cpplib.h (cpp_options): Add cpp_warn_c90_c99_compat.
* macro.c (replace_args): Warn when -Wc90-c99-compat is in effect.
(parse_params): Likewise.
2014-07-27 Marek Polacek <polacek@redhat.com>
PR c/61861
* macro.c (builtin_macro): Add location parameter. Set
location of builtin macro to the expansion point.
(enter_macro_context): Pass location to builtin_macro.
2014-07-16 Dodji Seketeli <dodji@redhat.com>
Support location tracking for built-in macro tokens
* include/line-map.h (line_maps::builtin_location): New data
member.
(line_map_init): Add a new parameter to initialize the new
line_maps::builtin_location data member.
* line-map.c (linemap_init): Initialize the
line_maps::builtin_location data member.
* macro.c (builtin_macro): Create a macro map and track the token
resulting from the expansion of a built-in macro.
2014-07-10 Edward Smith-Rowland <3dw4rd@verizon.net>
Jonathan Wakely <jwakely@redhat.com>
PR preprocessor/61389
* macro.c (_cpp_arguments_ok, parse_params, create_iso_definition):
Warning messages mention C++11 in c++ mode and C99 in c mode.
* lex.c (lex_identifier_intern, lex_identifier): Ditto
2014-07-09 Edward Smith-Rowland <3dw4rd@verizon.net>
PR c++/58155 - -Wliteral-suffix warns about tokens which are skipped
by preprocessor
* lex.c (lex_raw_string ()): Do not warn about invalid suffix
if skipping. (lex_string ()): Ditto.
2014-06-04 Edward Smith-Rowland <3dw4rd@verizon.net>
PR c++/61038
* macro.c (stringify_arg (cpp_reader *, macro_arg *)):
Combine user-defined escape logic with the other string and char logic.
2014-05-26 Richard Biener <rguenther@suse.de>
* configure.ac: Remove long long and __int64 type checks,
add check for uint64_t and fail if that wasn't found.
* include/cpplib.h (cpp_num_part): Use uint64_t.
* config.in: Regenerate.
* configure: Likewise.
2014-05-21 Marek Polacek <polacek@redhat.com>
PR c/61212
* files.c (find_file_in_dir): Add parens around &&.
2014-05-20 Edward Smith-Rowland <3dw4rd@verizon.net>
PR c++/61038
* macro.c (stringify_arg (cpp_reader *, macro_arg *)):
Check for user-defined literal strings and user-defined literal chars
to escape necessary characters.
2014-05-20 Richard Biener <rguenther@suse.de>
* configure.ac: Copy gcc logic of detecting a 64bit type.
Remove HOST_WIDE_INT define.
* include/cpplib.h: typedef cpp_num_part to a 64bit type,
similar to how hwint.h does it.
* config.in: Regenerate.
* configure: Likewise.
2014-05-09 Joey Ye <joey.ye@arm.com>
* files.c (find_file_in_dir): Always try to shorten for DOS
non-system headers.
* init.c (ENABLE_CANONICAL_SYSTEM_HEADERS): Default enabled for DOS.
2014-05-07 Richard Biener <rguenther@suse.de>
* configure.ac: Always set need_64bit_hwint to yes.
* configure: Regenerated.
2014-04-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* lex.c: Remove Solaris 9 reference.
2014-02-24 Walter Lee <walt@tilera.com>
* configure.ac: Change "tilepro" triplet to "tilepro*".
* configure: Regenerate.
2014-02-19 Jakub Jelinek <jakub@redhat.com>
PR preprocessor/58844
* macro.c (enter_macro_context): Only push
macro_real_token_count (macro) tokens rather than
macro->count tokens, regardless of
CPP_OPTION (pfile, track-macro-expansion).
2014-02-07 Jakub Jelinek <jakub@redhat.com>
PR preprocessor/56824
* line-map.c (get_combined_adhoc_loc, linemap_get_expansion_line,
linemap_get_expansion_filename, linemap_location_in_system_header_p,
linemap_location_from_macro_expansion_p,
linemap_macro_loc_to_spelling_point, linemap_macro_loc_to_def_point,
linemap_macro_loc_to_exp_point, linemap_expand_location): Fix
formatting.
(linemap_compare_locations): Look through adhoc locations for both
l0 and l1.
2014-01-23 Dodji Seketeli <dodji@redhat.com>
PR PR preprocessor/58580
* include/line-map.h (linemap_get_file_highest_location): Declare
new function.
* line-map.c (linemap_get_file_highest_location): Define it.
2014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
Update copyright years
2013-12-09 Joseph Myers <joseph@codesourcery.com>
PR preprocessor/55715
* expr.c (num_binary_op): Implement subtraction directly rather
than with negation and falling through into addition case.
2013-11-18 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* lex.c (search_line_fast): Correct for little endian.
2013-11-15 Joseph Myers <joseph@codesourcery.com>
* ucnid.tab: Add C11 and C11NOSTART data.
* makeucnid.c (digit): Rename enum value to N99.
(C11, N11, all_languages): New enum values.
(NUM_CODE_POINTS, MAX_CODE_POINT): New macros.
(flags, decomp, combining_value): Use NUM_CODE_POINTS as array
size.
(decomp): Use unsigned int as element type.
(all_decomp): New array.
(read_ucnid): Handle C11 and C11NOSTART. Use MAX_CODE_POINT.
(read_table): Use MAX_CODE_POINT. Store all decompositions in
all_decomp.
(read_derived): Use MAX_CODE_POINT.
(write_table): Use NUM_CODE_POINTS. Print N99, C11 and N11
flags. Print whole array variable declaration rather than just
array contents.
(char_id_valid, write_context_switch): New functions.
(main): Call write_context_switch.
* ucnid.h: Regenerate.
* include/cpplib.h (struct cpp_options): Add c11_identifiers.
* init.c (struct lang_flags): Add c11_identifiers.
(cpp_set_lang): Set c11_identifiers option from selected language.
* internal.h (struct normalize_state): Document "previous" as
previous starter character.
(NORMALIZE_STATE_UPDATE_IDNUM): Take character as argument.
* charset.c (DIG): Rename enum value to N99.
(C11, N11): New enum values.
(struct ucnrange): Give name to struct. Use short for flags and
unsigned int for end of range. Include ucnid.h for whole variable
declaration.
(ucn_valid_in_identifier): Allow for characters up to 0x10FFFF.
Allow for C11 in determining valid characters and valid start
characters. Use check_nfc for non-Hangul context-dependent
checks. Only store starter characters in nst->previous.
(_cpp_valid_ucn): Pass new argument to
NORMALIZE_STATE_UPDATE_IDNUM.
* lex.c (lex_identifier): Pass new argument to
NORMALIZE_STATE_UPDATE_IDNUM. Call NORMALIZE_STATE_UPDATE_IDNUM
after initial non-UCN part of identifier.
(lex_number): Pass new argument to NORMALIZE_STATE_UPDATE_IDNUM.
2013-11-15 Joseph Myers <joseph@codesourcery.com>
* ucnid.tab: Mark C99 digits as [C99DIG].
* makeucnid.c (read_ucnid): Handle [C99DIG].
(read_table): Don't check for digit characters.
* ucnid.h: Regenerate.
2013-11-06 Tobias Burnus <burnus@net-b.de>
* macro.c (_cpp_builtin_macro_text): Correct
wording of two warnings.
2013-11-05 Tobias Burnus <burnus@net-b.de>
* include/cpplib.h (CPP_W_DATE_TIME): Added.
(cpp_options): Add warn_date_time.
* init.c (cpp_create_reader): Init it.
* macro.c (_cpp_builtin_macro_text): Warn when
__DATE__/__TIME__/__TIMESTAMP__ is used.
2013-10-31 Edward Smith-Rowland <3dw4rd@verizon.net>
Implement C++14 digit separators.
* include/cpplib.h (cpp_options): Add digit_separators flag.
* internal.h (DIGIT_SEP(c)): New macro.
* expr.c (cpp_classify_number): Check improper placement of digit sep;
(cpp_interpret_integer): Skip over digit separators.
* init.c (lang_flags): Add digit_separators flag; (lang_defaults): Add
digit separator flags per language; (cpp_set_lang): Set
digit_separators
* lex.c (lex_number): Add digits separator to allowable characters for
C++14.
2013-10-15 David Malcolm <dmalcolm@redhat.com>
* Makefile.in (PICFLAG): New.
(ALL_CFLAGS): Add PICFLAG.
(ALL_CXXFLAGS): Likewise.
* configure.ac: Add --enable-host-shared, setting up new
PICFLAG variable.
* configure: Regenerate.
2013-08-07 Richard Earnshaw <rearnsha@arm.com>
* configure.ac: Set need_64bit_hwint for all arm targets.
* configure: Regenerated.
2013-07-20 Jakub Jelinek <jakub@redhat.com>
PR preprocessor/57620
* lex.c (lex_raw_string): Undo phase1 and phase2 transformations
between R" and final " rather than only in between R"del( and )del".
2013-07-10 Jakub Jelinek <jakub@redhat.com>
PR preprocessor/57824
* lex.c (lex_raw_string): Allow reading new-lines if
in_deferred_pragma or if parsing_args and there is still
data in the current buffer.
* include/cpplib.h (cpp_token_val_index): Change parameter type to
const cpp_token *.
* lex.c (cpp_token_val_index): Likewise.
PR preprocessor/57757
* lex.c (cpp_avoid_paste): Avoid pasting CPP_{,W,UTF8}STRING
or CPP_STRING{16,32} with CPP_NAME or SPELL_LITERAL token that
starts if a-zA-Z_.
2013-06-28 Ed Smith-Rowland <3dw4rd@verizon.net>
* lex.c (lex_raw_string(), lex_string()): Constrain suffixes treated
as concatenated literal and macro to just the patterns found in
inttypes.h; (is_macro()): New.
2013-06-24 Dehao Chen <dehao@google.com>
* files.c (_cpp_stack_include): Fix the highest_location when header
file is guarded by #ifndef and is included twice.
2013-04-28 Jakub Jelinek <jakub@redhat.com>
N3472 binary constants
* include/cpplib.h (struct cpp_options): Fix a typo in user_literals
field comment. Add binary_constants field.
* init.c (struct lang_flags): Add binary_constants field.
(lang_defaults): Add bin_cst column to the table.
(cpp_set_lang): Initialize CPP_OPTION (pfile, binary_constants).
* expr.c (cpp_classify_number): Talk about C++11 instead of C++0x
in diagnostics. Accept binary constants if
CPP_OPTION (pfile, binary_constants) even when pedantic. Adjust
pedwarn message.
2013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
* include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Y and CLK_CXX1Y.
* init.c (lang_defaults): Add defaults for the latter.
(cpp_init_builtins): Define __cplusplus as 201300L for the latter.
* lex.c (_cpp_lex_direct): Update.
2013-04-03 Sebastian Huber <sebastian.huber@embedded-brains.de>
PR target/56771
* configure.ac: Require 64-bit int for arm*-*-rtems*.
* configure: Regenerate.
2013-03-06 Jakub Jelinek <jakub@redhat.com>
PR middle-end/56461
* internal.h (struct cpp_buffer): Add to_free field.
(_cpp_pop_file_buffer): Add third argument.
* files.c (_cpp_stack_file): Set buffer->to_free.
(_cpp_pop_file_buffer): Add to_free argument. Free to_free
if non-NULL, and if equal to file->buffer_start, also clear
file->buffer{,_start,_valid}.
* directives.c (_cpp_pop_buffer): Pass buffer->to_free
to _cpp_pop_file_buffer.
2013-03-01 Jakub Jelinek <jakub@redhat.com>
PR middle-end/56461
* files.c (_cpp_save_file_entries): Free result at the end.
* pch.c (cpp_string_free): New function.
(cpp_save_state): Use it in htab_create call.
(cpp_write_pch_deps): Free ss->defs. Destroy ss->definedhash.
2013-02-28 Jakub Jelinek <jakub@redhat.com>
* files.c (_cpp_find_file): If returning early, before storing
something to *hash_slot and *hash_slot is NULL, call htab_clear_slot
on it. Access *hash_slot using void * type rather than
struct file_hash_entry * to avoid aliasing issues.
* configure.ac: Don't define ENABLE_CHECKING whenever
--enable-checking is seen, instead use similar --enable-checking=yes
vs. --enable-checking=release default as gcc/ subdir has and
define ENABLE_CHECKING if ENABLE_CHECKING is defined in gcc/.
Define ENABLE_VALGRIND_CHECKING if requested.
* lex.c (new_buff): If ENABLE_VALGRIND_CHECKING, put _cpp_buff
struct first in the allocated buffer and result->base after it.
(_cpp_free_buff): If ENABLE_VALGRIND_CHECKING, free buff itself
instead of buff->base.
* config.in: Regenerated.
* configure: Regenerated.
2013-02-13 Ed Smith-Rowland <3dw4rd@verizon.net>
PR c++/55582
* lex.c (lex_raw_string): Allow string literal with suffix
beginning with 's' to be parsed as a C++11 user-defined literal.
2013-01-14 Richard Sandiford <rdsandiford@googlemail.com>
Update copyright years.
2013-01-04 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/54526 (again)
* lex.c (_cpp_lex_direct): In C++11 mode, implement 2.5 p3, bullet 2.
2013-01-03 Marc Glisse <marc.glisse@inria.fr>
PR bootstrap/50177
* line-map.c (get_combined_adhoc_loc): Cast from extern "C" type.
(new_linemap): Likewise.
(linemap_enter_macro): Likewise.
2012-12-03 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/55380
PR other/54691
* files.c (read_file_guts): Allocate extra 16 bytes instead of
1 byte at the end of buf. Pass size + 16 instead of size
to _cpp_convert_input.
* charset.c (_cpp_convert_input): Reallocate if there aren't
at least 16 bytes beyond to.len in the buffer. Clear 16 bytes
at to.text + to.len.
2012-11-21 Steve Ellcey <sellcey@mips.com>
PR pch/55399
* files.c (pch_open_file): Fix check for implicit_preinclude.
2012-11-16 Simon Baldwin <simonb@google.com>
* include/cpplib.h (struct cpp_options): Add canonical_system_headers.
* files.c (find_file_in_dir): Call maybe_shorter_path() only if
canonical_system_headers is set.
* init.c (cpp_create_reader): Initialize canonical_system_headers.
* configure.ac: Add new --enable-canonical-system-headers.
* configure: Regenerate.
* config.in: Regenerate.
2012-11-09 Ed Smith-Rowland <3dw4rd@verizon.net>
PR c++/54413
* include/cpplib.h (cpp_interpret_float_suffix): Add cpp_reader* arg.
(cpp_interpret_int_suffix): Add cpp_reader* arg.
* init.c (cpp_create_reader): Iitialize new flags.
* expr.c (interpret_float_suffix): Use new flags.
(cpp_interpret_float_suffix): Add cpp_reader* arg.
(interpret_int_suffix): Use new flags.
(cpp_interpret_int_suffix): Add cpp_reader* arg.
(cpp_classify_number): Adjust calls to interpret_x_suffix.
2012-10-23 Ian Bolton <ian.bolton@arm.com>
Jim MacArthur <jim.macarthur@arm.com>
Marcus Shawcroft <marcus.shawcroft@arm.com>
Nigel Stephens <nigel.stephens@arm.com>
Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
Richard Earnshaw <rearnsha@arm.com>
Sofiane Naci <sofiane.naci@arm.com>
Stephen Thomas <stephen.thomas@arm.com>
Tejas Belagod <tejas.belagod@arm.com>
Yufeng Zhang <yufeng.zhang@arm.com>
* configure.ac: Enable AArch64.
* configure: Regenerate.
2012-10-23 Joseph Myers <joseph@codesourcery.com>
* files.c (struct _cpp_file): Add implicit_preinclude.
(pch_open_file): Allow a previously opened implicitly included
file.
(_cpp_find_file): Add implicit_preinclude argument. Free file and
do not call open_file_failed if implicit_preinclude. Store
implicit_preinclude value.
(_cpp_stack_include, _cpp_fake_include, _cpp_compare_file_date):
Update calls to _cpp_find_file.
(_cpp_stack_include): Handle IT_DEFAULT.
(cpp_push_default_include): New.
* include/cpplib.h (cpp_push_default_include): Declare.
* init.c (cpp_read_main_file): Update call to _cpp_find_file.
* internal.h (enum include_type): Add IT_DEFAULT.
(_cpp_find_file): Update prototype.
2012-10-15 Tobias Burnus <burnus@net-b.de>
* files.c (read_file_guts, _cpp_save_file_entries): Free memory
before returning.
* lex.c (warn_about_normalization): Ditto.
* mkdeps.c (deps_save): Ditto.
* pch.c (cpp_valid_state): Ditto.
2012-10-04 Florian Weimer <fweimer@redhat.com>
* directives.c (do_pragma_warning_or_error): New.
(do_pragma_warning): New.
(do_pragma_error): New.
(_cpp_init_internal_pragmas): Register new pragmas.
2012-09-25 Dehao Chen <dehao@google.com>
PR middle-end/54704
* line-map.c (location_adhoc_data_hash): Fix the hash function.
2012-09-25 Dehao Chen <dehao@google.com>
PR middle-end/54645
* include/line-map.h (location_adhoc_data): Move location_adhoc_data
into GC.
(location_adhoc_data_map): Likewise.
(line_maps): Likewise.
(rebuild_location_adhoc_htab): New Function.
* line-map.c (+rebuild_location_adhoc_htab): new Funcion.
(get_combined_adhoc_loc): Move location_adhoc_data into GC.
(location_adhoc_data_fini): Likewise.
(linemap_init): Likewise.
(location_adhoc_data_init): Remove Function.
2012-09-19 Dehao Chen <dehao@google.com>
* include/line-map.h (MAX_SOURCE_LOCATION): New value.
(location_adhoc_data_fini): New.
(get_combined_adhoc_loc): New.
(get_data_from_adhoc_loc): New.
(get_location_from_adhoc_loc): New.
(location_adhoc_data_map): New.
(COMBINE_LOCATION_DATA): New.
(IS_ADHOC_LOC): New.
(expanded_location): New field.
(line_maps): New field.
* line-map.c (location_adhoc_data): New.
(location_adhoc_data_hash): New.
(location_adhoc_data_eq): New.
(location_adhoc_data_update): New.
(get_combined_adhoc_loc): New.
(get_data_from_adhoc_loc): New.
(get_location_from_adhoc_loc): New.
(location_adhoc_data_init): New.
(location_adhoc_data_fini): New.
(linemap_init): Initialize location_adhoc_data.
(linemap_lookup): Change to use new location.
(linemap_ordinary_map_lookup): Likewise.
(linemap_macro_map_lookup): Likewise.
(linemap_macro_map_loc_to_def_point): Likewise.
(linemap_macro_map_loc_unwind_toward_spel): Likewise.
(linemap_get_expansion_line): Likewise.
(linemap_get_expansion_filename): Likewise.
(linemap_location_in_system_header_p): Likewise.
(linemap_location_from_macro_expansion_p): Likewise.
(linemap_macro_loc_to_spelling_point): Likewise.
(linemap_macro_loc_to_def_point): Likewise.
(linemap_macro_loc_to_exp_point): Likewise.
(linemap_resolve_location): Likewise.
(linemap_unwind_toward_expansion): Likewise.
(linemap_unwind_to_first_non_reserved_loc): Likewise.
(linemap_expand_location): Likewise.
(linemap_dump_location): Likewise.
(linemap_line_start): Likewise.
2012-05-25 Dodji Seketeli <dodji@redhat.com>
PR preprocessor/53469
* directives.c (do_pragma): Use the virtual location for the
pragma token, instead of its spelling location.
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Configury.
* Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX.
* configure.ac: Likewise.
* configure: Regenerate.
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge from cxx-conversion branch. New C++ hash table.
* include/symtab.h (typedef struct ht hash_table): Change the typedef
name to cpp_hash_table. Update all users of the typedef.
2012-07-30 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* include/line-map.h (line_map_macro): Use the "atomic" GTY option
for the macro_locations field.
2011-06-19 Uros Bizjak <ubizjak@gmail.com>
* lex.c (search_line_sse42): Use __builtin_ia32_loaddqu and
__builtin_ia32_pcmpestri128 instead of asm.
2012-06-04 Dimitrios Apostolou <jimis@gmx.net>
* line-map.c (linemap_enter_macro): Don't zero max_column_hint in
every macro. This improves performance by reducing the number of
reallocations when track-macro-expansion is on.
2012-06-04 Dodji Seketeli <dodji@redhat.com>
PR preprocessor/53463
* line-map.c (linemap_location_in_system_header_p): For built-in
macro tokens, check the first expansion point location that is not
for a token coming from a built-in macro.
2012-05-29 Joseph Myers <joseph@codesourcery.com>
* directives.c: Fix typos.
* include/line-map.h: Fix typos.
* line-map.c: Fix typos.
* macro.c: Fix typos.
2012-05-25 Dodji Seketeli <dodji@redhat.com>
PR bootstrap/53459
* lex.c (search_line_fast): Avoid unused local typedefs to simulate
a static assertion.
2012-05-29 Dodji Seketeli <dodji@redhat.com>
PR preprocessor/53229
* internal.h (cpp_reader::set_invocation_location): Remove.
(cpp_reader::about_to_expand_macro_p): New member flag.
* directives.c (do_pragma): Remove Kludge as
pfile->set_invocation_location is no more.
* macro.c (cpp_get_token_1): Do away with the use of
cpp_reader::set_invocation_location. Just collect the macro
expansion point when we are about to expand the top-most macro.
Do not override cpp_reader::about_to_expand_macro_p.
This fixes gcc.dg/cpp/paste12.c by making get_token_no_padding
properly handle locations of expansion points.
(cpp_get_token_with_location): Adjust, as
cpp_reader::set_invocation_location is no more.
(paste_tokens): Take a virtual location parameter for
the LHS of the pasting operator. Use it in diagnostics. Update
comments.
(paste_all_tokens): Tighten the assert. Propagate the location of
the expansion point when no virtual locations are available.
Pass the virtual location to paste_tokens.
(in_macro_expansion_p): New static function.
(enter_macro_context): Set the cpp_reader::about_to_expand_macro_p
flag until we really start expanding the macro.
2012-05-16 Dodji Seketeli <dodji@redhat.com>
PR preprocessor/7263
* include/cpplib.h (cpp_classify_number): Take a location
parameter.
* expr.c (SYNTAX_ERROR_AT, SYNTAX_ERROR2_AT): New diagnostic
macros that take a location parameter.
(cpp_classify_number): Take a (virtual) location parameter. Use
it for diagnostics. Adjust comments.
(eval_token): Take a location parameter. Pass it to
cpp_classify_number and to diagnostic routines.
(_cpp_parse_expr): Use virtual locations of tokens when parsing
expressions. Pass a virtual location to eval_token and to
diagnostic routines.
2012-05-10 Tristan Gingold <gingold@adacore.com>
* expr.c (interpret_float_suffix): Add a guard.
2012-05-02 Dodji Seketeli <dodji@redhat.com>
Properly initialize cpp_context in destringize_and_run
* directives.c (destringize_and_run): Properly initialize the new
context.
* macro.c (_cpp_pop_context): Assert that we shouldn't try to pop
the initial base context, which has the same life time as the
current instance of cpp_file.
2012-04-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
Dodji Seketeli <dodji@seketeli.org>
PR c++/52974
* libcpp/files.c (maybe_shorter_path): New.
(find_file_in_dir): Use it.
2012-04-30 Dodji Seketeli <dodji@redhat.com>
Switch -ftrack-macro-expansion=2 on by default.
* init.c (cpp_create_reader): Switch -ftrack-macro-expansion=2 on
by default. Add comments.
Strip "<built-in>" loc from displayed expansion context
* include/line-map.h (linemap_unwind_toward_expansion): Fix typo
in comment.
(linemap_unwind_to_first_non_reserved_loc): Declare new function.
* line-map.c (linemap_unwind_to_first_non_reserved_loc): Define
new function.
Fix expansion point loc for macro-like tokens
* macro.c (macro_of_context): New static function.
(_cpp_push_token_context, push_extended_tokens_context): If the
macro argument is NULL, it means we are continuing the expansion
of the current macro, if any. Update comments.
(_cpp_pop_context): Re-enable expansion of the macro only when we
are really out of the context of the current expansion.
Fix token pasting with -ftrack-macro-expansion
* macro.c (paste_all_tokens): Put the token resulting from pasting
into an extended token context with -ftrack-macro-location is in
effect.
Fix cpp_sys_macro_p with -ftrack-macro-expansion
* macro.c (cpp_sys_macro_p): Support -ftrack-macro-expansion.
2012-04-29 Dodji Seketeli <dodji@redhat.com>
* lex.c (lex_raw_string): Change C++ style comments into C style
comments.
(lex_string): Likewise.
2012-04-27 Ollie Wild <aaw@google.com>
* include/cpplib.h (struct cpp_options): Add new field,
warn_literal_suffix.
(CPP_W_LITERAL_SUFFIX): New enum.
* init.c (cpp_create_reader): Default initialization of
warn_literal_suffix.
* lex.c (lex_raw_string): Treat user-defined literals which don't
begin with '_' as separate tokens and produce a warning.
(lex_string): Ditto.
2012-04-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
* line-map.c (linemap_resolve_location): Synchronize comments with
those in line-map.h.
* include/line-map.h (linemap_resolve_location): Fix spelling in
comment.
2012-03-22 Richard Earnshaw <rearnsha@arm.com>
* lex.c (search_line_fast): Provide Neon-optimized version for ARM.
2012-03-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* lex.c: Remove Solaris 8 reference.
2012-02-14 Walter Lee <walt@tilera.com>
* configure.ac: Require 64-bit hwint for tilegx and tilepro.
* configure: Regenerate.
2012-01-09 Richard Guenther <rguenther@suse.de>
* macro.c (_cpp_builtin_macro_text): Remove unused variable map.
2012-01-09 Gary Funck <gary@intrepid.com>
PR preprocessor/33919
* files.c (_cpp_get_file_name): New. Implement file name
access function.
* internal.h (_cpp_get_file_name): New prototype.
* macro.c (_cpp_builtin_macro_text): Call _cpp_get_file_name()
to use pfile->main_file in lieu of traversing INCLUDED_FROM chain.
2012-01-03 Olivier Hainque <hainque@adacore.com>
* system.h: Prior to #define, #undef fopen and freopen unconditionally.
2011-12-20 Joseph Myers <joseph@codesourcery.com>
* include/cpplib.h (CLK_GNUC1X): Change to CLK_GNUC11.
(CLK_STDC1X): Change to CLK_STDC11.
* init.c (lang_defaults): Update comments.
(cpp_init_builtins): Update language tests. Use 201112L for C11
__STDC_VERSION__.
2011-12-20 Andreas Schwab <schwab@linux-m68k.org>
* configure: Regenerate.
2011-12-19 Andreas Schwab <schwab@linux-m68k.org>
* configure: Regenerate.
2011-12-07 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/50237
* internal.h (_cpp_init_lexer): New prototype.
* init.c (init_library): Call it.
* lex.c (init_vectorized_lexer): Remove constructor attribute,
add inline keyword.
(HAVE_init_vectorized_lexer): Define.
(_cpp_init_lexer): New function.
2011-12-03 Dodji Seketeli <dodji@redhat.com>
* macro.c (tokens_buff_remove_last_token)
(tokens_buff_put_token_to): Add an 'inline' function specifier to
the prototype.
2011-11-22 Diego Novillo <dnovillo@google.com>
* include/line-map.h (linemap_dump): Declare.
(line_table_dump): Declare.
* line-map.c (linemap_dump): New.
(line_table_dump): New.
2011-11-21 Ed Smith-Rowland <3dw4rd@verizon.net>
PR c++/50958
* expr.c (cpp_userdef_char_remove_type): Fix typo.
2011-11-03 Michael Matz <matz@suse.de>
PR bootstrap/50857
* configure.ac: Check for -fno-exceptions -fno-rtti.
* configure: Regenerate.
* Makefile.in (NOEXCEPTION_FLAGS): New flag.
(ALL_CXXFLAGS): Use it.
2011-11-02 Paolo Carlini <paolo.carlini@oracle.com>
* internal.h (uxstrdup, ustrchr): Return const unsigned char *.
2011-11-02 Jason Merrill <jason@redhat.com>
PR c++/50810
* configure.ac: Add -Wno-narrowing to warning options.
2011-10-31 Jason Merrill <jason@redhat.com>
PR libstdc++/1773
* init.c (cpp_init_builtins): Set __cplusplus for C++11.
PR c++/50920
* include/cpplib.h (enum c_lang): Rename CLK_CXX0X to CLK_CXX11,
CLK_GNUCXX0X to CLK_GNUCXX11.
2011-10-26 Ed Smith-Rowland <3dw4rd@verizon.net>
Implement C++11 user-defined literals.
* expr.c: (cpp_interpret_float_suffix, cpp_interpret_int_suffix,
cpp_userdef_string_remove_type, cpp_userdef_string_add_type,
cpp_userdef_char_remove_type, cpp_userdef_char_add_type,
cpp_userdef_string_p, cpp_userdef_char_p, cpp_get_userdef_suffix): New.
(cpp_classify_number): Classify unrecognized tokens as user-defined
literals.
* include/cpplib.h: Add new tokens for user-defined literals.
* init.c: Add new preprocessor flag (cxx11).
* lex.c: (lex_string, lex_raw_string): Handle user-defined literals
including concatenation and promotion with suffixes.
2011-10-24 Dodji Seketeli <dodji@redhat.com>
* line-map.c (linemap_macro_map_lookup): Fix logic.
2011-10-24 Dodji Seketeli <dodji@redhat.com>
* include/line-map.h (linemap_expand_location): Take a line table
parameter. Update comment.
(linemap_resolve_location): Update comment.
(linemap_expand_location_full): Remove.
* line-map.c (linemap_resolve_location): Handle reserved
locations; return a NULL map in those cases.
(linemap_expand_location): If location is reserved, return a
zeroed expanded location. Update comment. Take a line table to
assert that the function takes non-virtual locations only.
(linemap_expand_location_full): remove.
(linemap_dump_location): Handle the fact that
linemap_resolve_location can return NULL line maps when the
location resolves to a reserved location.
* line-map.c (linemap_macro_map_lookup): Fix logic.
2011-10-22 Dodji Seketeli <dodji@redhat.com>
PR bootstrap/50778
* include/internal.h (_cpp_remaining_tokens_num_in_context): Take the
context to act upon.
* lex.c (_cpp_remaining_tokens_num_in_context): Likewise. Update
comment.
(cpp_token_from_context_at): Likewise.
(cpp_peek_token): Use the context to peek tokens from.
2011-10-20 Dodji Seketeli <dodji@redhat.com>
PR bootstrap/50801
* lex.c (_cpp_remaining_tokens_num_in_context): Fix computation of
number of tokens.
2011-10-18 Dodji Seketeli <dodji@redhat.com>
PR bootstrap/50760
* include/line-map.h (struct linemap_stats): Change the type of
the members from size_t to long.
* macro.c (macro_arg_token_iter_init): Unconditionally initialize
iter->location_ptr.
2011-10-17 Dodji Seketeli <dodji@redhat.com>
* line-map.c (linemap_macro_map_loc_to_exp_point): Avoid setting a
variable without using it if ENABLE_CHECKING is not defined. Mark
the LOCATION parameter as being unused.
2011-10-15 Tom Tromey <tromey@redhat.com>
Dodji Seketeli <dodji@redhat.com>
* include/line-map.h (struct line_maps::alloced_size_for_request):
New member.
* line-map.c (new_linemap): Use set->alloced_size_for_request to
get the actual allocated size of line maps.
2011-10-15 Tom Tromey <tromey@redhat.com>
Dodji Seketeli <dodji@redhat.com>
* line-map.h (struct linemap_stats): Declare new struct.
(linemap_get_statistics): Declare ...
* line-map.c (linemap_get_statistics): ... new function.
* macro.c (num_expanded_macros_counter, num_macro_tokens_counter):
Declare new counters.
(enter_macro_context, replace_args): Update
num_macro_tokens_counter.
(cpp_get_token_1): Update num_expanded_macros_counter.
2011-10-15 Tom Tromey <tromey@redhat.com>
Dodji Seketeli <dodji@redhat.com>
* include/cpplib.h (struct cpp_options)<debug>: New struct member.
* include/line-map.h (linemap_dump_location): Declare ...
* line-map.c (linemap_dump_location): ... new function.
2011-10-15 Tom Tromey <tromey@redhat.com>
Dodji Seketeli <dodji@redhat.com>
* include/cpplib.h (struct cpp_options)<track_macro_expansion>:
New option.
* internal.h (struct macro_context): New struct.
(enum context_tokens_kind): New enum.
(struct cpp_context)<tokens_kind>: New member of type enum
context_tokens_kind.
(struct cpp_context)<macro>: Remove this. Replace it with an enum
of macro and macro_context.
(struct cpp_context)<direct_p>: Remove.
(_cpp_remaining_tokens_num_in_context): Declare new function.
* directives.c (destringize_and_run): Adjust.
* lex.c (_cpp_remaining_tokens_num_in_context)
(_cpp_token_from_context_at): Define new functions
(cpp_peek_token): Use them.
* init.c (cpp_create_reader): Initialize the base context to zero.
(_cpp_token_from_context_at): Define new static function.
(cpp_peek_token): Use new _cpp_remaining_tokens_num_in_context and
_cpp_token_from_context_at.
* macro.c (struct macro_arg)<virt_locs, expanded_virt_locs>: New
members.
(enum macro_arg_token_kind): New enum.
(struct macro_arg_token_iter): New struct.
(maybe_adjust_loc_for_trad_cpp, push_extended_tokens_context)
(alloc_expanded_arg_mem, ensure_expanded_arg_room)
(delete_macro_args, set_arg_token, get_arg_token_location)
(arg_token_ptr_at, macro_arg_token_iter_init)
(macro_arg_token_iter_get_token)
(macro_arg_token_iter_get_location, macro_arg_token_iter_forward)
(expanded_token_index, tokens_buff_new, tokens_buff_count)
(tokens_buff_last_token_ptr, tokens_buff_put_token_to)
(tokens_buff_add_token, tokens_buff_remove_last_token)
(reached_end_of_context, consume_next_token_from_context): New
static functions.
(cpp_get_token_1): New static function. Split and extended from
cpp_get_token. Use reached_end_of_context and
consume_next_token_from_context. Unify its return point. Move
the location tweaking from cpp_get_token_with_location in here.
(cpp_get_token): Use cpp_get_token_1
(stringify_arg): Use the new arg_token_at.
(paste_all_tokens): Support tokens coming from extended tokens
contexts.
(collect_args): Return the number of collected arguments, by
parameter. Store virtual locations of tokens that constitute the
collected args.
(funlike_invocation_p): Return the number of collected arguments,
by parameter.
(enter_macro_context): Add a parameter for macro expansion point.
Pass it to replace_args and to the "used" cpp callback. Get the
number of function-like macro arguments from funlike_invocation_p,
pass it to the new delete_macro_args to free the memory used by
macro args. When -ftrack-macro-expansion is in effect, for macros
that have no arguments, create a macro map for the macro expansion
and use it to allocate proper virtual locations for tokens
resulting from the expansion. Push an extended tokens context
containing the tokens resulting from macro expansion and their
virtual locations.
(replace_args): Rename the different variables named 'count' into
variables with more meaningful names. Create a macro map;
allocate virtual locations of tokens resulting from this
expansion. Use macro_arg_token_iter to iterate over tokens of a
given macro. Handle the case of the argument of
-ftrack-macro-expansion being < 2. Don't free macro arguments
memory resulting from expand_arg here, as these are freed by the
caller of replace_arg using delete_macro_args now. Push extended
token context.
(next_context, push_ptoken_context, _cpp_push_token_context)
(_cpp_push_text_context): Properly initialize the context.
(expand_arg): Use the new alloc_expanded_arg_mem,
push_extended_tokens_context, cpp_get_token_1, and set_arg_token.
(_cpp_pop_context): Really free the memory held by the context.
Handle freeing memory used by extended tokens contexts.
(cpp_get_token_with_location): Use cpp_get_token_1.
(cpp_sys_macro_p): Adjust.
(_cpp_backup_tokens): Support the new kinds of token contexts.
* traditional.c (recursive_macro): Adjust.
2011-10-15 Tom Tromey <tromey@redhat>
Dodji Seketeli <dodji@redhat.com>
* include/line-map.h (enum lc_reason)<LC_ENTER_MACRO>: New enum
member.
(MAX_SOURCE_LOCATION): New constant.
(struct line_map_ordinary, struct line_map_macro): New structs.
(struct line_map): Turn this into a union of the two above. Add
comments.
(struct maps_info): New struct.
(struct line_maps)<info_ordinary, info_macro>: Two new fields.
These now carry the map information that was previously scattered
in struct line_maps.
(struct map_info::allocated): Fix comment.
(MAP_START_LOCATION, ORDINARY_MAP_FILE_NAME)
(ORDINARY_MAP_STARTING_LINE_NUMBER)
(ORDINARY_MAP_INCLUDER_FILE_INDEX)
(ORDINARY_MAP_IN_SYSTEM_HEADER_P)
(ORDINARY_MAP_NUMBER_OF_COLUMN_BITS, MACRO_MAP_MACRO)
(MACRO_MAP_NUM_MACRO_TOKENS MACRO_MAP_LOCATIONS)
(MACRO_MAP_EXPANSION_POINT_LOCATION)
(LOCATION_POSSIBLY_IN_MACRO_MAP_P, LINEMAPS_MAP_INFO)
(LINEMAPS_MAPS, LINEMAPS_ALLOCATE, LINEMAPS_USED, LINEMAPS_CACHE)
(LINEMAPS_LAST_MAP, LINEMAPS_LAST_ALLOCATED_MAP)
(LINEMAPS_ORDINARY_MAPS, LINEMAPS_ORDINARY_ALLOCATED)
(LINEMAPS_ORDINARY_USED, LINEMAPS_ORDINARY_CACHE)
(LINEMAPS_LAST_ORDINARY_MAP, LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP)
(LINEMAPS_MACRO_MAPS, LINEMAPS_MACRO_ALLOCATED)
(LINEMAPS_MACRO_USED, LINEMAPS_MACRO_CACHE)
(LINEMAPS_LAST_MACRO_MAP, LINEMAPS_LAST_ALLOCATED_MACRO_MAP)
(LINEMAPS_MAP_AT, LINEMAPS_ORDINARY_MAP_AT)
(LINEMAPS_MACRO_MAP_AT): New accessors for ordinary and macro map
information.
(linemap_check_ordinary, linemap_assert)
(linemap_location_before_p): New macros.
(linemap_position_for_line_and_column)
(linemap_tracks_macro_expansion_locs_p, linemap_add_macro_token)
(linemap_macro_expansion_map_p)
(linemap_macro_map_loc_to_def_point)
(linemap_macro_map_loc_unwind_once)
(linemap_macro_map_loc_to_exp_point, linemap_step_out_once)
(linemap_get_source_line linemap_get_source_column)
(linemap_map_get_macro_name, linemap_get_file_path)
(linemap_location_in_system_header_p)
(linemap_location_from_macro_expansion_p): Declare new functions.
(SOURCE_LINE, SOURCE_COLUMN, LAST_SOURCE_LINE_LOCATION)
(LINEMAP_FILE, LINEMAP_LINE, LINEMAP_SYSP): Assert that this
accessors act on ordinary maps only.
(INCLUDED_FROM): Return NULL for main files; use the new
accessors.
(LINEMAP_POSITION_FOR_COLUMN): Use the new accessors.
(struct expanded_location): Move here from gcc/input.h
(linemap_resolve_location, linemap_expand_location)
(linemap_expand_location_full): Declare new functions.
* line-map.c: Include cpplib.h, internal.h
(linemap_enter_macro, linemap_add_macro_token)
(linemap_get_expansion_line, linemap_get_expansion_filename): New
functions that are private to libcpp.
(linemap_assert): New macro.
(linemap_macro_loc_to_exp_point, linemap_macro_loc_to_exp_point)
(linemap_macro_loc_unwind, linemap_macro_map_loc_to_def_point)
(linemap_macro_map_loc_unwind_toward_spelling)
(linemap_macro_map_loc_to_exp_point)
(first_map_in_common_1, first_map_in_common): New static
functions.
(new_linemap): Define new static functions. Extracted and
enhanced from ...
(linemap_add): ... here. Use linemap_assert in lieu of abort
previously.
(linemap_tracks_macro_expansion_locs_p)
(linemap_add_macro_token, linemap_macro_expansion_map_p)
(linemap_check_ordinary, linemap_macro_map_loc_to_exp_point)
(linemap_macro_map_loc_to_def_point)
(linemap_macro_map_loc_unwind_once)
(linemap_step_out_once, linemap_map_get_index)
(linemap_get_source_line,linemap_get_source_column)
(linemap_get_file_path, linemap_map_get_macro_name)
(linemap_location_in_system_header_p)
(linemap_location_originated_from_system_header_p)
(linemap_location_from_macro_expansion_p)
(linemap_tracks_macro_expansion_locs_p)
(linemap_resolve_location, linemap_expand_location)
(linemap_expand_location_full)
(linemap_tracks_macro_expansion_locs_p)
(linemap_position_for_line_and_column, linemap_compare_locations):
Define new public functions.
(linemap_init): Initialize ordinary and macro maps information in
the map set.
(linemap_check_files_exited): Use the new accessors.
(linemap_free): Remove this dead code.
(linemap_line_start): Assert this uses an ordinary map. Adjust to
use the new ordinary map accessors and data structures. Don't
overflow past the lowest possible macro token's location.
(linemap_position_for_column): Assert the ordinary maps of the map
set are really ordinary. Use ordinary map accessors.
(linemap_lookup): Keep the same logic but generalize to allow
lookup of both ordinary and macro maps. Do not crash when called
with an empty line table.
* directives-only.c (_cpp_preprocess_dir_only): Adjust to use the
new API of line-map.h.
* directives.c (start_directive, do_line, do_linemarker)
(do_linemarker): Likewise.
* files.c (_cpp_find_file, _cpp_stack_include, open_file_failed)
(make_cpp_dir, cpp_make_system_header): Likewise.
* init.c (cpp_read_main_file): Likewise.
* internal.h (CPP_INCREMENT_LINE): Likewise.
(linemap_enter_macro, linemap_add_macro_token)
(linemap_get_expansion_line, linemap_get_expansion_filename): New
functions private to libcpp.
* lex.c (_cpp_process_line_notes, _cpp_skip_block_comment)
(skip_line_comment, skip_whitespace, lex_raw_string)
(_cpp_lex_direct): Likewise.
* macro.c (_cpp_builtin_macro_text): Likewise.
(_cpp_aligned_alloc): Initialize the new name member of the macro.
* traditional.c (copy_comment, _cpp_scan_out_logical_line):
Likewise.
* errors.c (cpp_diagnostic): Adjust to new linemap API.
2011-08-28 Dodji Seketeli <dodji@redhat.com>
* line-map.c (linemap_add): Assert that reason must not be
LC_RENAME when called for the first time on a "main input file".
2011-08-22 Gabriel Charette <gchare@google.com>
* init.c (cpp_create_reader): Inititalize forced_token_location_p.
* internal.h (struct cpp_reader): Add field forced_token_location_p.
* lex.c (_cpp_lex_direct): Use forced_token_location_p.
(cpp_force_token_locations): New.
(cpp_stop_forcing_token_locations): New.
2011-08-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
PR libstdc++/1773
* init.c (cpp_init_builtins): Define __cplusplus 19971L.
2011-08-18 Joseph Myers <joseph@codesourcery.com>
* include/cpplib.h (struct cpp_options): Fix typo.
2011-08-18 Joseph Myers <joseph@codesourcery.com>
* include/cpplib.h (struct cpp_options): Add rliterals.
* init.c (struct lang_flags, lang_defaults): Add rliterals.
(cpp_set_lang): Set rliterals option.
(cpp_init_builtins): Define __STDC_UTF_16__ and __STDC_UTF_32__.
* lex.c (_cpp_lex_direct): Only accept raw strings if rliterals.
2011-08-15 Gabriel Charette <gchare@google.com>
* include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Remove.
Update all users to use linemap_position_for_column instead.
2011-07-28 Gabriel Charette <gchare@google.com>
* include/line-map.h (struct line_maps):
Remove unused field last_listed. Update all users.
2011-07-28 H.J. Lu <hongjiu.lu@intel.com>
* configure.ac: Set need_64bit_hwint to yes for x86 targets.
* configure: Regenerated.
2011-07-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* system.h [__cplusplus]: Wrap C function declarations in extern "C".
2011-07-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
PR bootstrap/49794
* configure.ac: Test AM_ICONV with CXX.
* configure: Regenerate.
* system.h (HAVE_DESIGNATED_INITIALIZERS): Never define for C++.
2011-07-15 Dodji Seketeli <dodji@redhat.com>
* directives.c (struct if_stack): Use source_location as type
here.
* include/cpplib.h (struct cpp_callbacks)<include, define, undef,
indent, def_pragma, used_define, used_undef>: Properly use
source_location as parameter type, rather than unsigned int.
2011-07-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
PR target/39150
* configure.ac (host_wide_int): Handle x86_64-*-solaris2.1[0-9]
like i[34567]86-*-solaris2.1[0-9]*.
* configure: Regenerate.
2011-06-16 Jason Merrill <jason@redhat.com>
PR c++/45399
* lex.c (lex_raw_string): Don't check for embedded NUL.
2011-06-06 Dodji Seketeli <dodji@redhat.com>
PR preprocessor/48532
* directives.c (do_pragma): Don't forget the invocation location
when parsing the pragma name of a namespaced pragma directive.
2011-05-29 John Tytgat <John.Tytgat@aaug.net>
* files.c (read_file_guts): Add test on non-zero value of S_ISREG.
2011-05-22 Uros Bizjak <ubizjak@gmail.com>
PR target/49104
* lex.c (init_vectorized_lexer): Do not set "minimum" when __3dNOW_A__
is defined. Check bit_MMXEXT and bit_CMOV to use search_line_mmx.
2011-04-25 Jan Kratochvil <jan.kratochvil@redhat.com>
* system.h (ENUM_BITFIELD): Remove.
2011-04-24 Jakub Jelinek <jakub@redhat.com>
PR preprocessor/48740
* lex.c (lex_raw_string): When raw string ends with
??) followed by raw prefix and ", ensure it is preprocessed
with ??) rather than ??].
2011-04-20 Jim Meyering <meyering@redhat.com>
* files.c (destroy_cpp_file): Remove useless if-before-free.
* init.c (cpp_destroy): Likewise.
* macro.c (replace_args): Likewise.
* pch.c (cpp_valid_state): Likewise.
2011-03-25 Kai Tietz <ktietz@redhat.com>
* files.c (file_hash_eq): Use filename_cmp
instead of strcmp.
(nonexistent_file_hash_eq): Likewise.
(remap_filename): Likewise.
Handle absolute DOS-path,
(append_file_to_dir): Check for IS_DIR_SEPARATOR
instead of slash.
(read_name_map): Likewise.
* linemap.c (linemap_add): Use filename_cmp
instead of strcmp.
* mkdeps.c (apply_vpath): Use filename_ncmp
instead of strncmp.
(deps_restore): Use filename_cmp instead of
strcmp.
* init.c (read_original_directory): Use
IS_DIR_SEPARATOR instead of checking for slash.
2011-03-21 Michael Meissner <meissner@linux.vnet.ibm.com>
PR preprocessor/48192
* directives.c (do_ifdef): Do not consider conditional macros as
being defined.
(do_ifndef): Ditto.
* expr.c (parse_defined): Ditto.
2011-03-18 Richard Henderson <rth@redhat.com>
PR bootstrap/45381
* lex.c [ALTIVEC] (search_line_fast): Require gcc version 4.5.
2011-11-04 Eric Botcazou <ebotcazou@adacore.com>
Jakub Jelinek <jakub@redhat.com>
PR preprocessor/39213
* directives.c (end_directive): Call _cpp_remove_overlay for deferred
pragmas as well in traditional mode.
2010-11-17 Ian Lance Taylor <iant@google.com>
PR bootstrap/45538
* configure.ac: Use AC_USE_SYSTEM_EXTENSIONS. Remove switch of
AC_LANG based on ENABLE_BUILD_WITH_CXX.
2010-11-16 Kai Tietz <kai.tietz@onevision.com>
PR preprocessor/17349
* lex.c (save_comment): Handle in argument passing c++
comments special.
2010-11-02 Ian Lance Taylor <iant@google.com>
* configure.ac: Use AC_SYS_LARGEFILE.
* configure: Rebuild.
* config.in: Rebuild.
2010-10-19 Basile Starynkevitch <basile@starynkevitch.net>
* line-map.h (source_location): Remove obsolete comment
mentioning location_s.
2010-09-29 Kai Tietz <kai.tietz@onevision.com>
PR preprocessor/45362
* directives.c (cpp_pop_definition): Make static.
(do_pragma_push_macro): Reworked to store text
definition.
(do_pragma_pop_macro): Add free text definition.
(cpp_push_definition): Removed.
* include/cpplib.h (cpp_push_definition): Removed.
(cpp_pop_definition): Likewise.
* internal.h (def_pragma_macro): Remove member 'value'
and add new members 'definition', 'line',
'syshdr', 'sued' and 'is_undef'.
* pch.c (_cpp_restore_pushed_macros): Rework to work
on text definition and store additional macro flags.
(_cpp_save_pushed_macros): Likewise.
2010-09-29 Joseph Myers <joseph@codesourcery.com>
* include/cpplib.h (cpp_options): Rename warn_deprecated,
warn_traditional, warn_long_long and pedantic.
* directives.c (directive_diagnostics, _cpp_handle_directive):
Update names of cpp_options members.
* expr.c (cpp_classify_number, eval_token): Update names of
cpp_options members.
* init.c (cpp_create_reader, post_options): Update names of
cpp_options members.
* internal.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Update names of
cpp_options members.
* macro.c (parse_params): Update names of cpp_options members.
2010-09-15 Ian Lance Taylor <iant@google.com>
* init.c: Fix type name in comment.
2010-08-31 Jakub Jelinek <jakub@redhat.com>
PR preprocessor/45457
* expr.c (parse_defined): Call pfile->cb.user_builtin_macro hook if
needed.
* directives.c (do_ifdef, do_ifndef): Likewise.
2010-08-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* system.h [HAVE_INTTYPES_H]: Include inttypes.h.
2010-08-24 Richard Henderson <rth@redhat.com>
PR bootstrap/45376
* configure.ac (HAVE_SSE4): New check.
* configure, config.in: Rebuild.
* lex.c (search_line_sse42): Omit if !HAVE_SSE4.
2010-08-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* lex.c [__sun__ && __svr4__]: Disable init_vectorized_lexer
etc. on Solaris 2/x86.
2010-08-21 Richard Henderson <rth@redhat.com>
Andi Kleen <ak@linux.intel.com>
David S. Miller <davem@davemloft.net>
* configure.ac (AC_C_BIGENDIAN, AC_TYPE_UINTPTR_T): New tests.
(ssize_t): Check via AC_TYPE_SSIZE_T instead of AC_CHECK_TYPE.
(ptrdiff_t): Check via AC_CHECK_TYPE.
* config.in, configure: Rebuild.
* system.h: Include stdint.h, if available.
* lex.c (WORDS_BIGENDIAN): Provide default.
(acc_char_mask_misalign, acc_char_replicate, acc_char_cmp,
acc_char_index, search_line_acc_char, repl_chars, search_line_mmx,
search_line_sse2, search_line_sse42, init_vectorized_lexer,
search_line_fast): New.
(_cpp_clean_line): Use search_line_fast. Restructure the fast
loop to make it clear when we're leaving the loop. Stay in the
fast loop for non-trigraph '?'.
2010-06-11 Jakub Jelinek <jakub@redhat.com>
* include/cpplib.h (struct cpp_callbacks): Add user_builtin_macro
callback.
(enum cpp_builtin_type): Add BT_FIRST_USER and BT_LAST_USER.
(cpp_macro_definition): Remove const qual from second argument.
* macro.c (enter_macro_context): Call user_builtin_macro callback for
NODE_BUILTIN !NODE_USED macros.
(warn_of_redefinition): Likewise. Remove const qual from second
argument.
(cpp_macro_definition): Likewise.
* pch.c (write_macdef, save_macros): Call user_builtin_macro callback
for NODE_BUILTIN !NODE_USED macros.
2010-06-10 Joseph Myers <joseph@codesourcery.com>
* include/cpplib.h (struct cpp_options): Remove show_column.
* init.c (cpp_create_reader, post_options): Don't set show_column.
2010-06-09 Joern Rennecke <joern.rennecke@embecosm.com>
PR bootstrap/44432
* configure.ac: Before using ZW_PROG_COMPILER_DEPENDENCIES for C++,
check that C++ compiler works.
* configure: Regenerate.
2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* include/symtab.h (ht_identifier_ptr): New.
2010-06-03 Joern Rennecke <joern.rennecke@embecosm.com>
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
PR bootstrap/42798
* configure.ac: Check for declaration of 'basename(char *)'.
* configure: Regenerate.
* config.in: Regenerate.
2010-04-25 Joseph Myers <joseph@codesourcery.com>
* include/cpplib.h (enum c_lang): Add CLK_GNUC1X and CLK_STDC1X.
* init.c (lang_defaults): Add entries for new language variants.
(cpp_init_builtins): Define __STDC_VERSION__ to 201000L for C1X
variants.
2010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR cpp/43195
* files.c (report_missing_guard): Test for #pragma once.
2010-04-07 Simon Baldwin <simonb@google.com>
* directives.c (do_diagnostic): Add warning reason argument,
call appropriate error reporting function for code.
(directive_diagnostics): Call specific warning functions with
warning reason where appropriate.
(do_error, do_warning, do_pragma_dependency): Add warning reason
argument to do_diagnostic calls.
* macro.c (_cpp_warn_if_unused_macro, enter_macro_context,
_cpp_create_definition): Call specific warning functions with
warning reason where appropriate.
* Makefile.in: Add new diagnostic functions to gettext translations.
* include/cpplib.h (struct cpp_callbacks): Add warning reason code
to error callback.
(CPP_DL_WARNING, CPP_DL_WARNING_SYSHDR, CPP_DL_PEDWARN, CPP_DL_ERROR,
CPP_DL_ICE, CPP_DL_NOTE, CPP_DL_FATAL): Replace macros with enums.
(CPP_W_NONE, CPP_W_DEPRECATED, CPP_W_COMMENTS,
CPP_W_MISSING_INCLUDE_DIRS, CPP_W_TRIGRAPHS, CPP_W_MULTICHAR,
CPP_W_TRADITIONAL, CPP_W_LONG_LONG, CPP_W_ENDIF_LABELS,
CPP_W_NUM_SIGN_CHANGE, CPP_W_VARIADIC_MACROS,
CPP_W_BUILTIN_MACRO_REDEFINED, CPP_W_DOLLARS, CPP_W_UNDEF,
CPP_W_UNUSED_MACROS, CPP_W_CXX_OPERATOR_NAMES, CPP_W_NORMALIZE,
CPP_W_INVALID_PCH, CPP_W_WARNING_DIRECTIVE): New enums for cpp
warning reason codes.
(cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
cpp_warning_with_line, cpp_pedwarning_with_line,
cpp_warning_with_line_syshdr): New specific error reporting functions.
* pch.c (cpp_valid_state): Call specific warning functions with
warning reason where appropriate.
* errors.c (cpp_diagnostic, cpp_diagnostic_with_line): New central
diagnostic handlers.
(cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
cpp_warning_with_line, cpp_pedwarning_with_line,
cpp_warning_with_line_syshdr): New specific error reporting functions.
* expr.c (cpp_classify_number, eval_token, num_unary_op): Call
specific warning functions with warning reason where appropriate.
* lex.c (_cpp_process_line_notes, _cpp_skip_block_comment,
warn_about_normalization, lex_identifier_intern, lex_identifier,
_cpp_lex_direct): Ditto.
* charset.c (_cpp_valid_ucn, convert_hex, convert_escape,
narrow_str_to_charconst): Ditto.
2010-04-06 Jakub Jelinek <jakub@redhat.com>
PR preprocessor/43642
* lex.c (lex_raw_string): Change type of TYPE variable to
unsigned char.
2010-04-02 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* aclocal.m4: Regenerate.
2010-03-29 Jason Merrill <jason@redhat.com>
More N3077 raw string changes
* charset.c (cpp_interpret_string): Don't transform UCNs in raw
strings.
* lex.c (bufring_append): Split out from...
(lex_raw_string): ...here. Undo trigraph and line splicing
transformations. Do process line notes in multi-line literals.
(_cpp_process_line_notes): Ignore notes that were already handled.
Some raw string changes from N3077
* charset.c (cpp_interpret_string): Change inner delimiters to ().
* lex.c (lex_raw_string): Likewise. Also disallow '\' in delimiter.
2010-02-11 Jakub Jelinek <jakub@redhat.com>
* init.c (read_original_filename): Don't call read_original_directory
if _cpp_handle_directive returns 0.
2010-01-01 Joseph Myers <joseph@codesourcery.com>
PR preprocessor/41947
* expr.c (cpp_classify_number): Give error for hexadecimal
floating-point constant with no digits before or after point.
2009-11-20 Arnaud Charlet <charlet@adacore.com>
* macro.c (enter_macro_context): Call cb.used callback if defined.
* directives.c (do_idef, do_ifndef): Ditto.
* include/cpplib.h (struct cpp_callbacks): Add used callback.
2009-11-11 Kai Tietz <kai.tietz@onevision.com>
* directives.c (do_pragma_push_macro): New pragma handler.
(do_pragma_pop_macro): Likewise.
(_cpp_init_internal_pragmas): Add push_macro and
pop_macro handler to internal pragmas.
(lex_macro_node_from_str): Removed.
(cpp_push_definition): Replace lex_macro_node_from_str
by _cpp_lex_identifier.
(cpp_pop_definition): Likewise.
* internal.h (_cpp_lex_identifier): New prototype.
(def_pragma_macro): New structure.
(cpp_reader): New member pushed_macros.
* lex.c (_cpp_lex_identifier): New function.
(lex_identifier_intern): New function.
* init.c (cpp_create_reader): Initialize pushed_macros
member.
(cpp_destroy): Free elements in pushed_macros member.
* pch.c (_cpp_save_pushed_macros): New function.
(_cpp_restore_pushed_macros): Likewise.
(_cpp_restore_pushed_macros): Use _cpp_save_pushed_macros.
(cpp_read_state): Use _cpp_restore_pushed_macros.
2009-10-19 Jakub Jelinek <jakub@redhat.com>
* charset.c (cpp_init_iconv): Initialize utf8_cset_desc.
(_cpp_destroy_iconv): Destroy utf8_cset_desc, char16_cset_desc
and char32_cset_desc.
(converter_for_type): Handle CPP_UTF8STRING.
(cpp_interpret_string): Handle CPP_UTF8STRING and raw-strings.
* directives.c (get__Pragma_string): Handle CPP_UTF8STRING.
(parse_include): Reject raw strings.
* include/cpplib.h (CPP_UTF8STRING): New token type.
* internal.h (struct cpp_reader): Add utf8_cset_desc field.
* lex.c (lex_raw_string): New function.
(lex_string): Handle u8 string literals, call lex_raw_string
for raw string literals.
(_cpp_lex_direct): Call lex_string even for u8" and {,u,U,L,u8}R"
sequences.
* macro.c (stringify_arg): Handle CPP_UTF8STRING.
2009-10-14 Jakub Jelinek <jakub@redhat.com>
PR preprocessor/41543
* include/line-map.h (RESERVED_LOCATION_COUNT): Define.
* line-map.c (linemap_init): Initialize highest_location and