2020-02-14 09:04:14 +01:00
|
|
|
|
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-06 01:11:38 +01:00
|
|
|
|
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 13:38:16 +01:00
|
|
|
|
2020-02-04 Jakub Jelinek <jakub@redhat.com>
|
|
|
|
|
|
2020-02-04 13:39:59 +01:00
|
|
|
|
* macro.c (builtin_has_include): Diagnose __has_include* use outside
|
|
|
|
|
of preprocessing directives.
|
|
|
|
|
|
2020-02-04 13:38:16 +01:00
|
|
|
|
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-01-30 13:18:13 +01:00
|
|
|
|
2020-02-01 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
|
2020-01-28 16:58:29 +01:00
|
|
|
|
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.
|
|
|
|
|
|
gcc: Add new configure options to allow static libraries to be selected
The motivation behind this change is to make it easier for a user to
link against static libraries on a target where dynamic libraries are
the default library type (for example GNU/Linux).
Further, my motivation is really for linking libraries into GDB,
however, the binutils-gdb/config/ directory is a copy of gcc/config/
so changes for GDB need to be approved by the GCC project first.
After making this change in the gcc/config/ directory I've run
autoreconf on all of the configure scripts in the GCC tree and a
couple have been updated, so I'll use one of these to describe what my
change does.
Consider libcpp, this library links against libiconv. Currently if
the user builds on a system with both static and dynamic libiconv
installed then autotools will pick up the dynamic libiconv by
default. This is almost certainly the right thing to do.
However, if the user wants to link against static libiconv then things
are a little harder, they could remove the dynamic libiconv from their
system, but this is probably a bad idea (other things might depend on
that library), or the user can build their own version of libiconv,
install it into a unique prefix, and then configure gcc using the
--with-libiconv-prefix=DIR flag. This works fine, but is somewhat
annoying, the static library available, I just can't get autotools to
use it.
My change then adds a new flag --with-libiconv-type=TYPE, where type
is either auto, static, or shared. The default auto, ensures we keep
the existing behaviour unchanged.
If the user configures with --with-libiconv-type=static then the
configure script will ignore any dynamic libiconv it finds, and will
only look for a static libiconv, if no static libiconv is found then
the configure will continue as though there is no libiconv at all
available.
Similarly a user can specify --with-libiconv-type=shared and force the
use of shared libiconv, any static libiconv will be ignored.
As I've implemented this change within the AC_LIB_LINKFLAGS_BODY macro
then only libraries configured using the AC_LIB_LINKFLAGS or
AC_LIB_HAVE_LINKFLAGS macros will gain the new configure flag.
If this is accepted into GCC then there will be follow on patches for
binutils and GDB to regenerate some configure scripts in those
projects.
For GCC only two configure scripts needed updated after this commit,
libcpp and libstdc++-v3, both of which link against libiconv.
config/ChangeLog:
* lib-link.m4 (AC_LIB_LINKFLAGS_BODY): Add new
--with-libXXX-type=... option. Use this to guide the selection of
either a shared library or a static library.
libcpp/ChangeLog:
* configure: Regenerate.
libstdc++-v3/ChangeLog:
* configure: Regenerate.
2020-01-22 15:54:26 +01:00
|
|
|
|
2020-01-27 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
|
2020-01-24 13:19:36 +01:00
|
|
|
|
2020-01-24 Nathan Sidwell <nathan@acm.org>
|
|
|
|
|
|
|
|
|
|
* expr.c (parse_has_include): Remove bogus controlling macro code.
|
|
|
|
|
|
[PR 80005] Fix __has_include
__has_include is funky in that it is macro-like from the POV of #ifdef and
friends, but lexes its parenthesize argument #include-like. We were
failing the second part of that, because we used a forwarding macro to an
internal name, and hence always lexed the argument in macro-parameter
context. We componded that by not setting the right flag when lexing, so
it didn't even know. Mostly users got lucky.
This reimplements the handline.
1) Remove the forwarding, but declare object-like macros that
expand to themselves. This satisfies the #ifdef requirement
2) Correctly set angled_brackets when lexing the parameter. This tells
the lexer (a) <...> is a header name and (b) "..." is too (not a string).
3) Remove the in__has_include lexer state, just tell find_file that that's
what's happenning, so it doesn't emit an error.
We lose the (undocumented) ability to #undef __has_include. That may well
have been an accident of implementation. There are no tests for it.
We gain __has_include behaviour for all users of the preprocessors -- not
just the C-family ones that defined a forwarding macro.
libcpp/
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.
gcc/c-family/
PR preprocessor/80005
* c-cppbuiltins.c (c_cpp_builtins): Don't define __has_include{,_next}.
gcc/testsuite/
PR preprocessor/80005
* g++.dg/cpp1y/feat-cxx14.C: Adjust.
* g++.dg/cpp1z/feat-cxx17.C: Adjust.
* g++.dg/cpp2a/feat-cxx2a.C: Adjust.
* g++.dg/cpp/pr80005.C: New.
2020-01-20 14:39:59 +01:00
|
|
|
|
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.
|
2020-01-17 14:39:47 +01:00
|
|
|
|
|
|
|
|
|
PR preprocessor/93306
|
|
|
|
|
* expr.c (parse_has_include): Refactor. Check skip_eval before
|
|
|
|
|
looking.
|
|
|
|
|
|
Add diagnostic paths
This patch adds support for associating a "diagnostic_path" with a
diagnostic: a sequence of events predicted by the compiler that leads to
the problem occurring, with their locations in the user's source,
text descriptions, and stack information (for handling interprocedural
paths).
For example, the following (hypothetical) error has a 3-event
intraprocedural path:
test.c: In function 'demo':
test.c:29:5: error: passing NULL as argument 1 to 'PyList_Append' which
requires a non-NULL parameter
29 | PyList_Append(list, item);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
'demo': events 1-3
|
| 25 | list = PyList_New(0);
| | ^~~~~~~~~~~~~
| | |
| | (1) when 'PyList_New' fails, returning NULL
| 26 |
| 27 | for (i = 0; i < count; i++) {
| | ~~~
| | |
| | (2) when 'i < count'
| 28 | item = PyLong_FromLong(random());
| 29 | PyList_Append(list, item);
| | ~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | (3) when calling 'PyList_Append', passing NULL from (1) as argument 1
|
The patch adds a new "%@" format code for printing event IDs, so that
in the above, the description of event (3) mentions event (1), showing
the user where the bogus NULL value comes from (the event IDs are
colorized to draw the user's attention to them).
There is a separation between data vs presentation: the above shows how
the diagnostic-printing code has consolidated the path into a single run
of events, since all the events are near each other and within the same
function; more complicated examples (such as interprocedural paths)
might be printed as multiple runs of events.
Examples of how interprocedural paths are printed can be seen in the
test suite (which uses a plugin to exercise the code without relying
on specific warnings using this functionality).
Other output formats include
- JSON,
- printing each event as a separate "note", and
- to not emit paths.
gcc/ChangeLog:
* Makefile.in (OBJS): Add tree-diagnostic-path.o.
* common.opt (fdiagnostics-path-format=): New option.
(diagnostic_path_format): New enum.
(fdiagnostics-show-path-depths): New option.
* coretypes.h (diagnostic_event_id_t): New forward decl.
* diagnostic-color.c (color_dict): Add "path".
* diagnostic-event-id.h: New file.
* diagnostic-format-json.cc (json_from_expanded_location): Make
non-static.
(json_end_diagnostic): Call context->make_json_for_path if it
exists and the diagnostic has a path.
(diagnostic_output_format_init): Clear context->print_path.
* diagnostic-path.h: New file.
* diagnostic-show-locus.c (colorizer::set_range): Special-case
when printing a run of events in a diagnostic_path so that they
all get the same color.
(layout::m_diagnostic_path_p): New field.
(layout::layout): Initialize it.
(layout::print_any_labels): Don't colorize the label text for an
event in a diagnostic_path.
(gcc_rich_location::add_location_if_nearby): Add
"restrict_to_current_line_spans" and "label" params. Pass the
former to layout.maybe_add_location_range; pass the latter
when calling add_range.
* diagnostic.c: Include "diagnostic-path.h".
(diagnostic_initialize): Initialize context->path_format and
context->show_path_depths.
(diagnostic_show_any_path): New function.
(diagnostic_path::interprocedural_p): New function.
(diagnostic_report_diagnostic): Call diagnostic_show_any_path.
(simple_diagnostic_path::num_events): New function.
(simple_diagnostic_path::get_event): New function.
(simple_diagnostic_path::add_event): New function.
(simple_diagnostic_event::simple_diagnostic_event): New ctor.
(simple_diagnostic_event::~simple_diagnostic_event): New dtor.
(debug): New overload taking a diagnostic_path *.
* diagnostic.def (DK_DIAGNOSTIC_PATH): New.
* diagnostic.h (enum diagnostic_path_format): New enum.
(json::value): New forward decl.
(diagnostic_context::path_format): New field.
(diagnostic_context::show_path_depths): New field.
(diagnostic_context::print_path): New callback field.
(diagnostic_context::make_json_for_path): New callback field.
(diagnostic_show_any_path): New decl.
(json_from_expanded_location): New decl.
* doc/invoke.texi (-fdiagnostics-path-format=): New option.
(-fdiagnostics-show-path-depths): New option.
(-fdiagnostics-color): Add "path" to description of default
GCC_COLORS; describe it.
(-fdiagnostics-format=json): Document how diagnostic paths are
represented in the JSON output format.
* gcc-rich-location.h (gcc_rich_location::add_location_if_nearby):
Add optional params "restrict_to_current_line_spans" and "label".
* opts.c (common_handle_option): Handle
OPT_fdiagnostics_path_format_ and
OPT_fdiagnostics_show_path_depths.
* pretty-print.c: Include "diagnostic-event-id.h".
(pp_format): Implement "%@" format code for printing
diagnostic_event_id_t *.
(selftest::test_pp_format): Add tests for "%@".
* selftest-run-tests.c (selftest::run_tests): Call
selftest::tree_diagnostic_path_cc_tests.
* selftest.h (selftest::tree_diagnostic_path_cc_tests): New decl.
* toplev.c (general_init): Initialize global_dc->path_format and
global_dc->show_path_depths.
* tree-diagnostic-path.cc: New file.
* tree-diagnostic.c (maybe_unwind_expanded_macro_loc): Make
non-static. Drop "diagnostic" param in favor of storing the
original value of "where" and re-using it.
(virt_loc_aware_diagnostic_finalizer): Update for dropped param of
maybe_unwind_expanded_macro_loc.
(tree_diagnostics_defaults): Initialize context->print_path and
context->make_json_for_path.
* tree-diagnostic.h (default_tree_diagnostic_path_printer): New
decl.
(default_tree_make_json_for_path): New decl.
(maybe_unwind_expanded_macro_loc): New decl.
gcc/c-family/ChangeLog:
* c-format.c (local_event_ptr_node): New.
(PP_FORMAT_CHAR_TABLE): Add entry for "%@".
(init_dynamic_diag_info): Initialize local_event_ptr_node.
* c-format.h (T_EVENT_PTR): New define.
gcc/testsuite/ChangeLog:
* gcc.dg/format/gcc_diag-10.c (diagnostic_event_id_t): New
typedef.
(test_diag): Add coverage of "%@".
* gcc.dg/plugin/diagnostic-path-format-default.c: New test.
* gcc.dg/plugin/diagnostic-path-format-inline-events-1.c: New test.
* gcc.dg/plugin/diagnostic-path-format-inline-events-2.c: New test.
* gcc.dg/plugin/diagnostic-path-format-inline-events-3.c: New test.
* gcc.dg/plugin/diagnostic-path-format-none.c: New test.
* gcc.dg/plugin/diagnostic-test-paths-1.c: New test.
* gcc.dg/plugin/diagnostic-test-paths-2.c: New test.
* gcc.dg/plugin/diagnostic-test-paths-3.c: New test.
* gcc.dg/plugin/diagnostic-test-paths-4.c: New test.
* gcc.dg/plugin/diagnostic_plugin_test_paths.c: New.
* gcc.dg/plugin/plugin.exp: Add the new plugin and test cases.
libcpp/ChangeLog:
* 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.
From-SVN: r280142
2020-01-10 22:22:12 +01:00
|
|
|
|
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 12:51:42 +01:00
|
|
|
|
2020-01-01 Jakub Jelinek <jakub@redhat.com>
|
|
|
|
|
|
|
|
|
|
Update copyright years.
|
|
|
|
|
|
2019-12-18 18:26:01 +01:00
|
|
|
|
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 23:18:53 +01:00
|
|
|
|
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-10 03:02:38 +01:00
|
|
|
|
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 21:03:47 +01:00
|
|
|
|
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.
|
|
|
|
|
|
Support UTF-8 character constants for C2x.
C2x adds u8'' character constants to C. This patch adds the
corresponding GCC support.
Most of the support was already present for C++ and just needed
enabling for C2x. However, in C2x these constants have type unsigned
char, which required corresponding adjustments in the compiler and the
preprocessor to give them that type for C.
For C, it seems clear to me that having type unsigned char means the
constants are unsigned in the preprocessor (and thus treated as having
type uintmax_t in #if conditionals), so this patch implements that. I
included a conditional in the libcpp change to avoid affecting
signedness for C++, but I'm not sure if in fact these constants should
also be unsigned in the preprocessor for C++ in which case that
!CPP_OPTION (pfile, cplusplus) conditional would not be needed.
Bootstrapped with no regressions on x86_64-pc-linux-gnu.
gcc/c:
* c-parser.c (c_parser_postfix_expression)
(c_parser_check_literal_zero): Handle CPP_UTF8CHAR.
* gimple-parser.c (c_parser_gimple_postfix_expression): Likewise.
gcc/c-family:
* c-lex.c (lex_charconst): Make CPP_UTF8CHAR constants unsigned
char for C.
gcc/testsuite:
* gcc.dg/c11-utf8char-1.c, gcc.dg/c2x-utf8char-1.c,
gcc.dg/c2x-utf8char-2.c, gcc.dg/c2x-utf8char-3.c,
gcc.dg/gnu2x-utf8char-1.c: New tests.
libcpp:
* 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.
From-SVN: r278265
2019-11-14 21:18:33 +01:00
|
|
|
|
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 21:24:38 +01:00
|
|
|
|
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.
|
|
|
|
|
|
Implement C++20 operator<=>.
There are three major pieces to this support: scalar operator<=>,
synthesis of comparison operators, and rewritten/reversed overload
resolution (e.g. a < b becomes 0 > b <=> a).
Unlike other defaulted functions, where we use synthesized_method_walk to
semi-simulate what the definition of the function will be like, this patch
determines the characteristics of a comparison operator by trying to define
it.
My handling of non-dependent rewritten operators in templates can still use
some work: build_min_non_dep_op_overload can't understand the rewrites and
crashes, so I'm avoiding it for now by clearing *overload. This means we'll
do name lookup again at instantiation time, which can incorrectly mean a
different result. I'll poke at this more in stage 3.
I'm leaving out a fourth section ("strong structural equality") even though
I've implemented it, because it seems likely to change radically tomorrow.
Thanks to Tim van Deurzen and Jakub for implementing lexing of the <=>
operator, and Jonathan for the initial <compare> header.
gcc/cp/
* cp-tree.h (struct lang_decl_fn): Add maybe_deleted bitfield.
(DECL_MAYBE_DELETED): New.
(enum special_function_kind): Add sfk_comparison.
(LOOKUP_REWRITTEN, LOOKUP_REVERSED): New.
* call.c (struct z_candidate): Add rewritten and reversed methods.
(add_builtin_candidate): Handle SPACESHIP_EXPR.
(add_builtin_candidates): Likewise.
(add_candidates): Don't add a reversed candidate if the parms are
the same.
(add_operator_candidates): Split out from build_new_op_1. Handle
rewritten and reversed candidates.
(add_candidate): Swap conversions of reversed candidate.
(build_new_op_1): Swap them back. Build a second operation for
rewritten candidates.
(extract_call_expr): Handle rewritten calls.
(same_fn_or_template): New.
(joust): Handle rewritten and reversed candidates.
* class.c (add_implicitly_declared_members): Add implicit op==.
(classtype_has_op, classtype_has_defaulted_op): New.
* constexpr.c (cxx_eval_binary_expression): Handle SPACESHIP_EXPR.
(cxx_eval_constant_expression, potential_constant_expression_1):
Likewise.
* cp-gimplify.c (genericize_spaceship): New.
(cp_genericize_r): Use it.
* cp-objcp-common.c (cp_common_init_ts): Handle SPACESHIP_EXPR.
* decl.c (finish_function): Handle deleted function.
* decl2.c (grokfield): SET_DECL_FRIEND_CONTEXT on defaulted friend.
(mark_used): Check DECL_MAYBE_DELETED. Remove assumption that
defaulted functions are non-static members.
* error.c (dump_expr): Handle SPACESHIP_EXPR.
* method.c (type_has_trivial_fn): False for sfk_comparison.
(enum comp_cat_tag, struct comp_cat_info_t): New types.
(comp_cat_cache): New array variable.
(lookup_comparison_result, lookup_comparison_category)
(is_cat, cat_tag_for, spaceship_comp_cat)
(spaceship_type, genericize_spaceship)
(common_comparison_type, early_check_defaulted_comparison)
(comp_info, build_comparison_op): New.
(synthesize_method): Handle sfk_comparison. Handle deleted.
(get_defaulted_eh_spec, maybe_explain_implicit_delete)
(explain_implicit_non_constexpr, implicitly_declare_fn)
(defaulted_late_check, defaultable_fn_check): Handle sfk_comparison.
* name-lookup.c (get_std_name_hint): Add comparison categories.
* tree.c (special_function_p): Add sfk_comparison.
* typeck.c (cp_build_binary_op): Handle SPACESHIP_EXPR.
2019-11-05 Tim van Deurzen <tim@kompiler.org>
Add new tree code for the spaceship operator.
gcc/cp/
* cp-tree.def: Add new tree code.
* operators.def: New binary operator.
* parser.c: Add new token and tree code.
libcpp/
* cpplib.h: Add spaceship operator for C++.
* lex.c: Implement conditional lexing of spaceship operator for C++20.
2019-11-05 Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/
* libsupc++/compare: New header.
* libsupc++/Makefile.am (std_HEADERS): Add compare.
* include/std/version: Define __cpp_lib_three_way_comparison.
* include/std/functional: #include <compare>.
From-SVN: r277865
2019-11-06 00:56:18 +01:00
|
|
|
|
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 18:38:44 +01:00
|
|
|
|
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 14:03:04 +02:00
|
|
|
|
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.
|
|
|
|
|
|
Support decimal floating-point constants in C2x.
ISO C2x adds decimal floating point as an optional standard feature.
This patch accordingly makes GCC accept DFP constants (DF, DD, DL, df,
dd, dl suffixes) in strict C2X mode, with a pedwarn-if-pedantic for
older standards and a warning with -Wc11-c2x-compat even in C2x mode
(which in turn requires -Wc11-c2x-compat to be newly passed through to
libcpp).
Bootstrapped with no regressions on x86_64-pc-linux-gnu.
gcc/c-family:
* c.opt (Wc11-c2x-compat): Add CPP(cpp_warn_c11_c2x_compat)
CppReason(CPP_W_C11_C2X_COMPAT).
gcc/testsuite:
* gcc.dg/dfp/c11-constants-1.c, gcc.dg/dfp/c11-constants-2.c,
gcc.dg/dfp/c2x-constants-1.c, gcc.dg/dfp/c2x-constants-2.c: New
tests.
* gcc.dg/dfp/constants-pedantic.c: Use -std=gnu17 explicitly.
Update expected diagnostics.
libcpp:
* 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.
From-SVN: r276908
2019-10-12 00:22:52 +02:00
|
|
|
|
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 21:08:09 +02:00
|
|
|
|
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 12:22:05 +02:00
|
|
|
|
2019-10-02 Richard Biener <rguenther@suse.de>
|
|
|
|
|
|
|
|
|
|
* internal.h (enum include_type): Remove trailing comma.
|
|
|
|
|
|
Handle :: tokens in C for C2x.
As part of adding [[]]-style attributes, C2x adds the token :: for use
in scoped attribute names.
This patch adds corresponding support for that token in C to GCC. The
token is supported both for C2x and for older gnu* standards (on the
basis that extensions are normally supported in older gnu* versions;
people will expect to be able to use [[]] attributes, before C2x is
the default, without needing to use -std=gnu2x).
There are no cases in older C standards where the token : can be
followed by a token starting with : in syntactically valid sources;
the only cases the :: token could break in older standard C thus are
ones involving concatenation of pp-tokens where the result does not
end up as tokens (e.g., gets stringized). In GNU C extensions, the
main case where :: might appear in existing sources is in asm
statements, and the C parser is thus made to handle it like two
consecutive : tokens, which the C++ parser already does. A limited
test of various positionings of :: in asm statements is added to the
testsuite (in particular, to cover the syntax error when :: means too
many colons but a single : would be OK), but existing tests cover a
variety of styles there anyway.
Technically there are cases in Objective-C and OpenMP for which this
also changes how previously valid code is lexed: the objc-selector-arg
syntax allows multiple consecutive : tokens (although I don't think
they are particularly useful there), while OpenMP syntax includes
array section syntax such as [:] which, before :: was a token, could
also be written as [::> (there might be other OpenMP cases potentially
affected, I didn't check all the OpenMP syntax in detail). I don't
think either of those cases affects the basis for supporting the ::
token in all -std=gnu* modes, or that there is any obvious need to
special-case handling of CPP_SCOPE tokens for those constructs the way
there is for asm statements.
cpp_avoid_paste, which determines when spaces need adding between
tokens in preprocessed output where there wouldn't otherwise be
whitespace between them (e.g. if stringized), already inserts space
between : and : unconditionally, rather than only for C++, so no
change is needed there (but a C2x test is added that such space is
indeed inserted).
Bootstrapped with no regressions on x86-64-pc-linux-gnu.
gcc/c:
* c-parser.c (c_parser_asm_statement): Handle CPP_SCOPE like two
CPP_COLON tokens.
gcc/testsuite:
* gcc.dg/asm-scope-1.c, gcc.dg/cpp/c11-scope-1.c,
gcc.dg/cpp/c17-scope-1.c, gcc.dg/cpp/c2x-scope-1.c,
gcc.dg/cpp/c2x-scope-2.c, gcc.dg/cpp/c90-scope-1.c,
gcc.dg/cpp/c94-scope-1.c, gcc.dg/cpp/c99-scope-1.c,
gcc.dg/cpp/gnu11-scope-1.c, gcc.dg/cpp/gnu17-scope-1.c,
gcc.dg/cpp/gnu89-scope-1.c, gcc.dg/cpp/gnu99-scope-1.c: New tests.
libcpp:
* 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.
From-SVN: r276434
2019-10-02 02:08:40 +02:00
|
|
|
|
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 23:43:51 +02:00
|
|
|
|
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 21:56:11 +02:00
|
|
|
|
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-09-06 14:54:19 +02:00
|
|
|
|
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 13:23:48 +02:00
|
|
|
|
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 17:08:28 +02:00
|
|
|
|
2019-09-03 Ulrich Weigand <uweigand@de.ibm.com>
|
|
|
|
|
|
|
|
|
|
* directives.c: Remove references to spu from comments.
|
|
|
|
|
* expr.c: Likewise.
|
|
|
|
|
|
2019-08-29 16:06:32 +02:00
|
|
|
|
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 20:43:37 +02:00
|
|
|
|
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 18:36:00 +02:00
|
|
|
|
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 10:34:20 +02:00
|
|
|
|
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 22:23:30 +02:00
|
|
|
|
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 14:58:39 +02:00
|
|
|
|
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-20 08:59:06 +02:00
|
|
|
|
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 13:41:53 +02:00
|
|
|
|
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 13:41:40 +02:00
|
|
|
|
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 14:39:59 +02:00
|
|
|
|
2019-05-07 Nathan Sidwell <nathan@acm.org>
|
|
|
|
|
|
2019-05-07 20:13:57 +02:00
|
|
|
|
* files.c (_cpp_stack_file): Empty filenames aren't dependencies.
|
|
|
|
|
* mkdeps.c (deps_add_dep): Assert not empty.
|
|
|
|
|
|
2019-05-07 14:39:59 +02:00
|
|
|
|
* 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 13:34:47 +02:00
|
|
|
|
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 19:56:41 +02:00
|
|
|
|
2019-04-03 Jonathan Wakely <jwakely@redhat.com>
|
|
|
|
|
|
|
|
|
|
* files.c (search_path_exhausted): Fix typo in comment.
|
|
|
|
|
|
2019-02-26 18:27:52 +01:00
|
|
|
|
2019-02-26 Martin Liska <mliska@suse.cz>
|
|
|
|
|
|
|
|
|
|
* symtab.c (ht_dump_statistics): Make
|
|
|
|
|
horizontal alignment for statistics.
|
|
|
|
|
|
2019-02-20 21:07:20 +01:00
|
|
|
|
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 10:46:19 +01:00
|
|
|
|
2019-02-18 Martin Liska <mliska@suse.cz>
|
|
|
|
|
|
|
|
|
|
PR c++/89383
|
|
|
|
|
* line-map.c (linemap_line_start): Use 1UL in order
|
|
|
|
|
to not overflow.
|
|
|
|
|
|
linemap_line_start: protect against location_t overflow (PR lto/88147)
PR lto/88147 reports an assertion failure due to a bogus location_t value
when adding a line to a pre-existing line map, when there's a large
difference between the two line numbers.
For some "large differences", this leads to a location_t value that exceeds
LINE_MAP_MAX_LOCATION, in which case linemap_line_start returns 0. This
isn't ideal, but at least should lead to safe degradation of location
information.
However, if the difference is very large, it's possible for the line
number offset (relative to the start of the map) to be sufficiently large
that overflow occurs when left-shifted by the column-bits, and hence
the check against the LINE_MAP_MAX_LOCATION limit fails, leading to
a seemingly-valid location_t value, but encoding the wrong location. This
triggers the assertion failure:
linemap_assert (SOURCE_LINE (map, r) == to_line);
The fix (thanks to Martin) is to check for overflow when determining
whether to reuse an existing map, and to not reuse it if it would occur.
gcc/ChangeLog: David Malcolm <dmalcolm@redhat.com>
PR lto/88147
* input.c (selftest::test_line_offset_overflow): New selftest.
(selftest::input_c_tests): Call it.
libcpp/ChangeLog: 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.
From-SVN: r268789
2019-02-12 02:09:31 +01:00
|
|
|
|
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 11:08:00 +01:00
|
|
|
|
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 13:31:55 +01:00
|
|
|
|
2019-01-01 Jakub Jelinek <jakub@redhat.com>
|
|
|
|
|
|
|
|
|
|
Update copyright years.
|
|
|
|
|
|
2018-11-27 17:04:31 +01:00
|
|
|
|
2018-11-27 Mike Gulick <mgulick@mathworks.com>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/83173
|
|
|
|
|
* location-example.txt: Update example -fdump-internal-locations
|
|
|
|
|
output.
|
|
|
|
|
|
2018-11-27 16:49:43 +01:00
|
|
|
|
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 21:05:03 +01:00
|
|
|
|
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 23:41:21 +01:00
|
|
|
|
2018-11-07 Hafiz Abid Qadeer <abidh@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* configure: Regenerated.
|
|
|
|
|
|
2018-11-05 15:32:13 +01:00
|
|
|
|
2018-11-05 Martin Liska <mliska@suse.cz>
|
|
|
|
|
|
|
|
|
|
* symtab.c (ht_dump_statistics): Replace %zu with %lu format.
|
|
|
|
|
|
2018-11-05 15:25:37 +01:00
|
|
|
|
2018-11-05 Martin Liska <mliska@suse.cz>
|
|
|
|
|
|
|
|
|
|
* symtab.c (ht_dump_statistics): Fix format and
|
|
|
|
|
pass missing argument.
|
|
|
|
|
|
2018-11-05 14:35:09 +01:00
|
|
|
|
2018-11-05 Martin Liska <mliska@suse.cz>
|
|
|
|
|
|
|
|
|
|
* symtab.c (ht_dump_statistics): Make dump conditional
|
|
|
|
|
based on alloc_subobject.
|
|
|
|
|
|
Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856).
This patch updates GCC to use autoconf 2.69 and automake 1.15.1.
(That's not the latest automake version, but it's the one used by
binutils-gdb, with which consistency is desirable, and in any case
seems a useful incremental update that should make a future update to
1.16.1 easier.)
The changes are generally similar to the binutils-gdb ones, and are
copied from there where shared files and directories are involved
(there are some further changes to such shared directories, however,
which I'd expect to apply to binutils-gdb once this patch is in GCC).
Largely, obsolete AC_PREREQ calls are removed, while many
AC_LANG_SOURCE calls are added to avoid warnings from aclocal and
autoconf. Multilib support is no longer included in core automake,
meaning that multilib.am needs copying from automake's contrib
directory into the GCC source tree. Autoconf 2.69 has Go support, so
local copies of that support are removed. I hope the D support will
soon be submitted to upstream autoconf so the local copy of that can
be removed in a future update. Changes to how automake generates
runtest calls mean quotes are removed from RUNTEST definitions in five
lib*/testsuite/Makefile.am files (libatomic, libgomp, libitm,
libphobos, libvtv; some others have RUNTEST definitions without
quotes, which are still OK); libgo and libphobos also get
-Wno-override added to AM_INIT_AUTOMAKE so those overrides of RUNTEST
do not generate automake warnings.
Note that the regeneration did not include regeneration of
fixincludes/config.h.in (attempting such regeneration resulted in all
the USED_FOR_TARGET conditionals disappearing; and I don't see
anything in the fixincludes/ directory that would result in such
conditionals being generated, unlike in the gcc/ directory). Also
note that libvtv/testsuite/other-tests/Makefile.in was not
regenerated; that directory is not listed as a subdirectory for which
Makefile.in gets regenerated by calling "automake" in libvtv/, so I'm
not sure how it's meant to be regenerated.
While I mostly fixed warnings should running aclocal / automake /
autoconf, there were various such warnings from automake in the
libgfortran, libgo, libgomp, liboffloadmic, libsanitizer, libphobos
directories that I did not fix, preferring to leave those to the
relevant subsystem maintainers. Specifically, most of those warnings
were of the following form (example from libgfortran):
Makefile.am:48: warning: source file 'caf/single.c' is in a subdirectory,
Makefile.am:48: but option 'subdir-objects' is disabled
automake: warning: possible forward-incompatibility.
automake: At least a source file is in a subdirectory, but the 'subdir-objects'
automake: automake option hasn't been enabled. For now, the corresponding output
automake: object file(s) will be placed in the top-level directory. However,
automake: this behaviour will change in future Automake versions: they
will
automake: unconditionally cause object files to be placed in the same subdirectory
automake: of the corresponding sources.
automake: You are advised to start using 'subdir-objects' option throughout your
automake: project, to avoid future incompatibilities.
I think it's best for the relevant maintainers to add subdir-objects
and do any other associated Makefile.am changes needed. In some cases
the paths in the warnings involved ../; I don't know if that adds any
extra complications to the use of subdir-objects.
I've tested this with native, cross and Canadian cross builds. The
risk of any OS-specific issues should I hope be rather lower than if a
libtool upgrade were included (we *should* do such an upgrade at some
point, but it's more complicated - it involves identifying all our
local libtool changes to see if any aren't included in the upstream
version we update to, and reverting an upstream libtool patch that's
inappropriate for use in GCC); I think it would be better to get this
update into GCC so that people can test in different configurations
and we can fix any issues found, rather than to try to get more and
more testing done before it goes in.
top level:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* multilib.am: New file. From automake.
Merge from binutils-gdb:
2018-06-19 Simon Marchi <simon.marchi@ericsson.com>
* libtool.m4: Use AC_LANG_SOURCE.
* configure.ac: Remove AC_PREREQ, use AC_LANG_SOURCE.
* ar-lib: New file.
* test-driver: New file.
* configure: Re-generate.
config:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* math.m4, tls.m4: Use AC_LANG_SOURCE.
Merge from binutils-gdb:
2018-06-19 Simon Marchi <simon.marchi@ericsson.com>
* override.m4 (_GCC_AUTOCONF_VERSION): Bump from 2.64 to 2.69.
fixincludes:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* configure.ac: Remove AC_PREREQ.
* aclocal.m4, configure: Regenerate.
gcc:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE. Use single
line for second argument of AC_DEFINE_UNQUOTED.
* doc/install.texi (Tools/packages necessary for modifying GCC):
Update to autoconf 2.69 and automake 1.15.1.
* aclocal.m4, config.in, configure: Regenerate.
gnattools:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* configure.ac: Remove AC_PREREQ.
* configure: Regenerate.
gotools:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* config/go.m4: Remove file.
* Makefile.am (ACLOCAL_AMFLAGS): Do not use -I ./config.
* configure.ac: Remove AC_PREREQ. Do not include config/go.m4.
* Makefile.in, aclocal.m4, configure: Regenerate.
intl:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
Merge from binutils-gdb:
2018-06-19 Simon Marchi <simon.marchi@ericsson.com>
* configure.ac: Add AC_USE_SYSTEM_EXTENSIONS, remove AC_PREREQ.
* configure: Re-generate.
* config.h.in: Re-generate.
* aclocal.m4: Re-generate.
libada:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* configure.ac: Remove AC_PREREQ.
* configure: Regenerate.
libatomic:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
* acinclude.m4: Use AC_LANG_SOURCE.
* configure.ac: Remove AC_PREREQ.
* testsuite/Makefile.am (RUNTEST): Remove quotes.
* Makefile.in, aclocal.m4, configure, testsuite/Makefile.in:
Regenerate.
libbacktrace:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
* configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE.
* Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.
libcc1:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* configure.ac: Remove AC_PREREQ.
* Makefile.in, aclocal.m4, configure: Regenerate.
libcpp:
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.
libdecnumber:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
Merge from binutils-gdb:
2018-06-19 Simon Marchi <simon.marchi@ericsson.com>
* configure.ac: Remove AC_PREREQ.
* configure: Re-generate.
* aclocal.m4.
libffi:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
(AUTOMAKE_OPTIONS): Add info-in-builddir.
(CLEANFILES): Remove doc/libffi.info.
* configure.ac: Remove AC_PREREQ.
* Makefile.in, aclocal.m4, configure, fficonfig.h.in,
include/Makefile.in, man/Makefile.in, testsuite/Makefile.in:
Regenerate.
libgcc:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE.
* configure: Regenerate.
libgfortran:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
* configure.ac: Remove AC_PREREQ.
* Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.
libgo [logically part of this change but omitted from the commit]:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
* config/go.m4: Remove file.
* config/libtool.m4: Use AC_LANG_SOURCE.
* configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE. Use
-Wno-override in AM_INIT_AUTOMAKE call.
* Makefile.in, aclocal.m4, configure, testsuite/Makefile.in:
Regenerate.
libgomp:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am
(AUTOMAKE_OPTIONS): Add info-in-builddir.
(CLEANFILES): Remove libgomp.info.
* configure.ac: Remove AC_PREREQ.
* testsuite/Makefile.am (RUNTEST): Remove quotes.
* Makefile.in, aclocal.m4, configure, testsuite/Makefile.in:
Regenerate.
libhsail-rt:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* configure.ac: Remove AC_PREREQ.
* Makefile.in, aclocal.m4, configure: Regenerate.
libiberty:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
Merge from binutils-gdb:
2018-06-19 Simon Marchi <simon.marchi@ericsson.com>
* configure.ac: Remove AC_PREREQ.
* configure: Re-generate.
* config.in: Re-generate.
libitm:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
(AUTOMAKE_OPTIONS): Add info-in-builddir.
(CLEANFILES): Remove libitm.info.
* configure.ac: Remove AC_PREREQ.
* testsuite/Makefile.am (RUNTEST): Remove quotes.
* Makefile.in, aclocal.m4, configure, testsuite/Makefile.in:
Regenerate.
libobjc:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* configure.ac: Remove AC_PREREQ.
* aclocal.m4, config.h.in, configure: Regenerate.
liboffloadmic:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
* configure.ac: Remove AC_PREREQ.
* plugin/Makefile.am: Include multilib.am.
* plugin/configure.ac: Remove AC_PREREQ.
* Makefile.in, aclocal.m4, configure, plugin/Makefile.in,
plugin/aclocal.m4, plugin/configure: Regenerate.
libphobos:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
* configure.ac: Remove AC_PREREQ. Use -Wno-override in
AM_INIT_AUTOMAKE call.
* m4/autoconf.m4: Add extra argument to AC_LANG_DEFINE call.
* m4/druntime/os.m4: Use AC_LANG_SOURCE.
* testsuite/Makefile.am (RUNTEST): Remove quotes.
* Makefile.in, aclocal.m4, configure, libdruntime/Makefile.in,
src/Makefile.in, testsuite/Makefile.in: Regenerate.
libquadmath:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
(AUTOMAKE_OPTIONS): Remove 1.8. Add info-in-builddir.
(all-local): Define outside conditional code.
(CLEANFILES): Remove libquadmath.info.
* configure.ac: Remove AC_PREREQ.
* Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.
libsanitizer:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
* configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE.
* Makefile.in, aclocal.m4, asan/Makefile.in, configure,
interception/Makefile.in, libbacktrace/Makefile.in,
lsan/Makefile.in, sanitizer_common/Makefile.in, tsan/Makefile.in,
ubsan/Makefile.in: Regenerate.
libssp:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
(AUTOMAKE_OPTIONS): Remove 1.9.5.
* configure.ac: Remove AC_PREREQ. Quote argument to
AC_RUN_IFELSE.
* Makefile.in, aclocal.m4, configure: Regenerate.
libstdc++-v3:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
* configure.ac: Remove AC_PREREQ.
* Makefile.in, aclocal.m4, configure, doc/Makefile.in,
include/Makefile.in, libsupc++/Makefile.in, po/Makefile.in,
python/Makefile.in, src/Makefile.in, src/c++11/Makefile.in,
src/c++17/Makefile.in, src/c++98/Makefile.in,
src/filesystem/Makefile.in, testsuite/Makefile.in: Regenerate.
libvtv:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
* configure.ac: Remove AC_PREREQ.
* testsuite/Makefile.am (RUNTEST): Remove quotes.
* Makefile.in, aclocal.m4, configure, testsuite/Makefile.in:
Regenerate.
lto-plugin:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE.
* Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.
zlib:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
Merge from binutils-gdb:
2018-06-19 Simon Marchi <simon.marchi@ericsson.com>
* configure.ac: Modernize AC_INIT call, remove AC_PREREQ.
* Makefile.am (AUTOMAKE_OPTIONS): Remove 1.8, cygnus, add foreign.
* Makefile.in: Re-generate.
* aclocal.m4: Re-generate.
* configure: Re-generate.
From-SVN: r265695
2018-10-31 18:03:16 +01:00
|
|
|
|
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 15:41:35 +01:00
|
|
|
|
2018-10-31 Nathan Sidwell <nathan@acm.org>
|
|
|
|
|
|
2018-10-31 16:26:28 +01:00
|
|
|
|
* 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):
|
|
|
|
|
|
2018-10-31 16:03:04 +01:00
|
|
|
|
* directives.c (do_include_common): Commonize cleanup path.
|
|
|
|
|
(_cpp_pop_buffer): Fix leak.
|
|
|
|
|
|
2018-10-31 15:57:13 +01:00
|
|
|
|
* 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.
|
|
|
|
|
|
2018-10-31 15:51:54 +01:00
|
|
|
|
* 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.
|
|
|
|
|
|
2018-10-31 15:46:39 +01:00
|
|
|
|
* include/cpplib.h (HT_NODE): Don't cast NODE.
|
|
|
|
|
(NODE_LEN, NODE_NAME): Use HT_NODE.
|
|
|
|
|
|
2018-10-31 15:41:35 +01:00
|
|
|
|
* directives.c (DIRECTIVE_TABLE): Drop historical frequency
|
|
|
|
|
comments.
|
|
|
|
|
* files.c (_cpp_stack_file): Fix indentation.
|
|
|
|
|
|
Add -std=c2x, -std=gnu2x, -Wc11-c2x-compat, C2X _Static_assert support.
Now new features are starting to be added to a C2X draft (in the C2x
branch of the C standard git repository, no public WG14 document yet),
it's time to add -std=c2x and associated options to GCC for use in
enabling C2X features.
This patch adds the expected set of options: -std=c2x, -std=gnu2x,
-Wc11-c2x-compat. A first C2X feature is added (the only one so far
in the repository that's obviously relevant to GCC): support (as in
C++) for the string constant to be omitted in _Static_assert. This
feature is duly also supported as an extension in earlier standard
modes (diagnosed with -pedantic, unless -Wno-c11-c2x-compat is given,
or with -Wc11-c2x-compat even in C2X mode).
Bootstrapped with no regressions on x86_64-pc-linux-gnu.
gcc/
* doc/cpp.texi (__STDC_VERSION__): Document C2X handling.
* doc/invoke.texi (-std=c2x, -std=gnu2x): Document new options.
* doc/standards.texi (C Language): Document C2X.
* dwarf2out.c (highest_c_language), config/rl78/rl78.c
(rl78_option_override): Handle "GNU C2X" language name.
gcc/c/
* c-errors.c (pedwarn_c11): New function.
* c-parser.c (disable_extension_diagnostics): Save
warn_c11_c2x_compat and set it to 0.
(restore_extension_diagnostics): Restore warn_c11_c2x_compat.
(c_parser_static_assert_declaration_no_semi): Handle
_Static_assert without string constant.
* c-tree.h (pedwarn_c11): New prototype.
gcc/c-family/
* c-common.c (flag_isoc2x): New variable.
* c-common.h (clk_c): Update comment to reference C2X.
(flag_isoc99, flag_isoc11): Update comments to reference future
standard versions in general.
(flag_isoc2x): Declare.
* c-opts.c (set_std_c2x): New function.
(c_common_handle_option): Handle -std=c2x and -std=gnu2x.
(set_std_c89, set_std_c99, set_std_c11, set_std_c17): Set
flag_isoc2x to 0.
* c.opt (Wc11-c2x-compat, std=c2x, std=gnu2x): New options.
gcc/testsuite/
* gcc.dg/c11-static-assert-7.c, gcc.dg/c11-static-assert-8.c,
gcc.dg/c11-static-assert-9.c, gcc.dg/c2x-static-assert-1.c,
gcc.dg/c2x-static-assert-2.c, gcc.dg/c99-static-assert-2.c,
gcc.dg/gnu2x-static-assert-1.c: New tests.
* gcc.dg/missing-symbol-3.c: Update expected fix-it text.
libcpp/
* 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.
From-SVN: r265251
2018-10-18 01:58:54 +02:00
|
|
|
|
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.
|
|
|
|
|
|
libcpp: show macro definition when used with wrong argument count
Consider:
demo.c: In function 'test':
demo.c:5:40: error: macro "LOG_2" requires 3 arguments, but only 2 given
5 | LOG_2 ("loading file: %s\n", filename);
| ^
This patch adds a note showing the definition of the macro in
question, giving:
demo.c: In function 'test':
demo.c:5:40: error: macro "LOG_2" requires 3 arguments, but only 2 given
5 | LOG_2 ("loading file: %s\n", filename);
| ^
In file included from demo.c:1:
logging.h:1: note: macro "LOG_2" defined here
1 | #define LOG_2(FMT, ARG0, ARG1) do { fprintf (stderr, (FMT), (ARG0), (ARG1)); }
|
gcc/testsuite/ChangeLog:
* g++.dg/diagnostic/macro-arg-count.C: Move to...
* c-c++-common/cpp/macro-arg-count-1.c: ...here, generalizing
output for C vs C++. Expect notes showing the definitions of the
macros.
* c-c++-common/cpp/macro-arg-count-2.c: New test, adapted from the
above.
libcpp/ChangeLog:
* macro.c (_cpp_arguments_ok): If the argument count is wrong, add
a note showing the definition of the macro.
From-SVN: r265040
2018-10-11 15:21:28 +02:00
|
|
|
|
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 14:42:37 +02:00
|
|
|
|
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.
|
|
|
|
|
|
Cleanup of libcpp diagnostic callbacks
This patch renames the "error" callback within libcpp
to "diagnostic", and uses the pair of enums in cpplib.h, rather
than passing two different kinds of "int" around.
gcc/c-family/ChangeLog:
* c-common.c (c_option_controlling_cpp_error): Rename to...
(c_option_controlling_cpp_diagnostic): ...this, and convert
"reason" from int to enum.
(c_cpp_error): Rename to...
(c_cpp_diagnostic): ...this, converting level and reason to enums.
* c-common.h (c_cpp_error): Rename to...
(c_cpp_diagnostic): ...this, converting level and reason to enums.
* c-opts.c (c_common_init_options): Update for renaming.
gcc/fortran/ChangeLog:
* cpp.c (gfc_cpp_init_0): Update for renamings.
(cb_cpp_error): Rename to...
(cb_cpp_diagnostic): ...this, converting level and reason to
enums.
gcc/ChangeLog:
* genmatch.c (error_cb): Rename to...
(diagnostic_cb): ...this, converting int params to enums.
(fatal_at): Update for renaming.
(warning_at): Likewise.
(main): Likewise.
* input.c (selftest::ebcdic_execution_charset::apply):
Update for renaming of...
(selftest::ebcdic_execution_charset::on_error): ...this, renaming
to...
(selftest::ebcdic_execution_charset::on_diagnostic): ...this,
converting level and reason to enums.
(class selftest::lexer_error_sink): Rename to...
(class selftest::lexer_test_options): ...this, renaming field
"m_errors" to "m_diagnostics".
(selftest::lexer_test_options::apply): Update for renaming of...
(selftest::lexer_test_options::on_error): ...this, renaming to...
(selftest::lexer_test_options::on_diagnostic): ...this
converting level and reason to enums.
(selftest::test_lexer_string_locations_raw_string_unterminated):
Update for renamings.
* opth-gen.awk (struct cpp_reason_option_codes_t): Use enum for
"reason".
libcpp/ChangeLog:
* 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.
From-SVN: r264999
2018-10-10 01:37:19 +02:00
|
|
|
|
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-18 01:32:12 +02:00
|
|
|
|
2018-09-17 David Malcolm <dmalcolm@redhat.com>
|
|
|
|
|
|
|
|
|
|
* include/line-map.h (range_label::get_text): Add param
|
|
|
|
|
"range_idx".
|
|
|
|
|
|
2018-08-30 17:16:21 +02:00
|
|
|
|
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.
|
|
|
|
|
|
Less verbose fix-it hints for missing header files (PR 87091)
This patch tweaks maybe_add_include_fixit so that if we're emitting a note
about adding the header file, the note's primary location will be replaced
by that of the fix-it hint, to avoid repeating a location we've already
emitted (or one close to it).
For example, this simplifies:
../x86_64-pc-linux-gnu/libstdc++-v3/include/vector:87:27: error: msg 1
87 | using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
| ^~~~~~
../x86_64-pc-linux-gnu/libstdc++-v3/include/vector:87:22: note: msg 2
73 | # include <debug/vector>
+++ |+#include <vector>
74 | #endif
....
87 | using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
| ^~~
to:
../x86_64-pc-linux-gnu/libstdc++-v3/include/vector:87:27: error: msg 1
87 | using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
| ^~~~~~
../x86_64-pc-linux-gnu/libstdc++-v3/include/vector:74:1: note: msg 2
73 | # include <debug/vector>
+++ |+#include <vector>
74 | #endif
eliminating the repetition of line 87 in the note.
Doing so requires converting show_caret_p to a tri-state, to avoid
meaninglessly printing a caret for the first column in the next line
(and colorizing it):
../x86_64-pc-linux-gnu/libstdc++-v3/include/vector:74:1: note: msg 2
73 | # include <debug/vector>
+++ |+#include <vector>
74 | #endif
| ^
gcc/c-family/ChangeLog:
PR 87091
* c-common.c (c_cpp_error): Update for conversion of show_caret_p
to a tri-state.
(maybe_suggest_missing_token_insertion): Likewise.
(maybe_add_include_fixit): Add param "override_location". If set,
and source-printing is enabled, then override the rich_location's
primary location with that of the insertion point for the fix-it
hint, marking it with SHOW_LINES_WITHOUT_RANGE.
* c-common.h (extern void maybe_add_include_fixit): Add bool
param.
* c-format.c (selftest::test_type_mismatch_range_labels): Update
for conversion of show_caret_p to a tri-state.
* c-warn.c (warn_for_restrict): Likewise.
* known-headers.cc
(suggest_missing_header::~suggest_missing_header): Update call to
maybe_add_include_fixit to suggest overriding the location, as it
is for a note.
gcc/c/ChangeLog:
PR 87091
* c-decl.c (implicitly_declare): Update call to
maybe_add_include_fixit to suggest overriding the location, as it
is for a note.
* c-objc-common.c (c_tree_printer): Update for conversion of
show_caret_p to a tri-state.
gcc/cp/ChangeLog:
PR 87091
* decl.c (grokdeclarator): Update for conversion of show_caret_p
to a tri-state.
* error.c (cp_printer): Likewise.
* name-lookup.c (maybe_suggest_missing_std_header): Update call to
maybe_add_include_fixit to suggest overriding the location, as it
is for a note.
* parser.c (cp_parser_string_literal): Update for conversion of
show_caret_p to a tri-state.
(cp_parser_elaborated_type_specifier): Likewise.
(set_and_check_decl_spec_loc): Likewise.
* pt.c (listify): Update call to maybe_add_include_fixit to not
override the location, as it is for an error.
* rtti.c (typeid_ok_p): Likewise.
gcc/ChangeLog:
PR 87091
* diagnostic-show-locus.c (class layout_range): Update for
conversion of show_caret_p to a tri-state.
(layout_range::layout_range): Likewise.
(make_range): Likewise.
(layout::maybe_add_location_range): Likewise.
(layout::should_print_annotation_line_p): Don't show annotation
lines for ranges that are SHOW_LINES_WITHOUT_RANGE.
(layout::get_state_at_point): Update for conversion of
show_caret_p to a tri-state. Bail out early for
SHOW_LINES_WITHOUT_RANGE, so that such ranges don't affect
underlining or source colorization.
(gcc_rich_location::add_location_if_nearby): Update for conversion
of show_caret_p to a tri-state.
(selftest::test_one_liner_multiple_carets_and_ranges): Likewise.
(selftest::test_one_liner_fixit_replace_equal_secondary_range):
Likewise.
(selftest::test_one_liner_labels): Likewise.
* gcc-rich-location.c (gcc_rich_location::add_expr): Update for
conversion of show_caret_p to a tri-state.
* pretty-print.c (text_info::set_location): Likewise.
* pretty-print.h (text_info::set_location): Likewise.
* substring-locations.c (format_warning_n_va): Likewise.
* tree-diagnostic.c (default_tree_printer): Likewise.
* tree-pretty-print.c (newline_and_indent): Likewise.
gcc/fortran/ChangeLog:
PR 87091
* error.c (gfc_format_decoder): Update for conversion of
show_caret_p to a tri-state.
gcc/testsuite/ChangeLog:
PR 87091
* gcc.dg/empty.h: New file.
* gcc.dg/fixits-pr84852-1.c: Update for move of fix-it hint to
top of file and removal of redundant second printing of warning
location.
* gcc.dg/fixits-pr84852-2.c: Likewise.
* gcc.dg/missing-header-fixit-3.c: Likewise.
* gcc.dg/missing-header-fixit-4.c: New test.
* gcc.dg/plugin/diagnostic_plugin_test_show_locus.c: Update for
conversion of show_caret_p to a tri-state.
libcpp/ChangeLog:
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.
From-SVN: r263885
2018-08-27 16:02:05 +02:00
|
|
|
|
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-25 01:37:53 +02:00
|
|
|
|
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 14:39:36 +02:00
|
|
|
|
2018-08-20 Nathan Sidwell <nathan@acm.org>
|
|
|
|
|
|
2018-08-20 19:45:42 +02:00
|
|
|
|
* include/cpplib.h: Fixup some whitespace.
|
|
|
|
|
(cpp_hashnode): Reduce type to 2 bit & flags to 8.
|
|
|
|
|
|
[CPP PATCH] node type
https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01164.html
* 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.
From-SVN: r263667
2018-08-20 18:32:29 +02:00
|
|
|
|
* 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.
|
|
|
|
|
|
2018-08-20 17:28:15 +02:00
|
|
|
|
* 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.
|
|
|
|
|
|
2018-08-20 16:20:04 +02:00
|
|
|
|
* 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.
|
|
|
|
|
|
2018-08-20 14:39:36 +02:00
|
|
|
|
* 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 14:04:13 +02:00
|
|
|
|
2018-08-17 Nathan Sidwell <nathan@acm.org>
|
|
|
|
|
|
2018-08-18 01:18:11 +02:00
|
|
|
|
* 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.
|
|
|
|
|
|
2018-08-17 18:07:19 +02:00
|
|
|
|
* 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.
|
|
|
|
|
|
2018-08-17 14:04:13 +02:00
|
|
|
|
* 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 15:51:38 +02:00
|
|
|
|
2018-08-16 Nathan Sidwell <nathan@acm.org>
|
|
|
|
|
|
2018-08-16 21:18:42 +02:00
|
|
|
|
* 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.
|
|
|
|
|
|
2018-08-16 15:51:38 +02:00
|
|
|
|
* 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.
|
|
|
|
|
|
diagnostics: add labeling of source ranges
This patch adds the ability to label source ranges within a rich_location,
to be printed by diagnostic_show_locus.
For example:
pr69554-1.c:11:18: error: invalid operands to binary + (have 'const char *' and 'const char *')
11 | return (p + 1) + (q + 1);
| ~~~~~~~ ^ ~~~~~~~
| | |
| | const char *
| const char *
The patch implements labels for various type mismatch errors in the C and
C++ frontends, and in -Wformat. I implemented it wherever accurate location
information was guaranteed (there are other places that could benefit, but
we need better location information in those places).
The labels can be disabled via -fno-diagnostics-show-labels.
Similarly:
param-type-mismatch.C: In function 'int test_1(int, int, float)':
param-type-mismatch.C:11:27: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
11 | return callee_1 (first, second, third);
| ^~~~~~
| |
| int
param-type-mismatch.C:7:43: note: initializing argument 2 of 'int callee_1(int, const char*, float)'
7 | extern int callee_1 (int one, const char *two, float three);
| ~~~~~~~~~~~~^~~
where the first "error" describing the bad argument gets a label
describing the type inline (since it's non-obvious from "second").
The "note" describing the type of the param of the callee *doesn't*
get a label, since that information is explicit there in the
source ("const char *two").
The idea is that in any diagnostic where two aspects of the source aren't
in sync it ought to be easier for the user if we directly show them the
mismatching aspects inline (e.g. types).
As well as type mismatch errors, perhaps labels could also be used for
buffer overflow warnings, for describing the capacity of the destination
buffer vs the size of what's being written:
sprintf (buf, "filename: %s\n", file);
^~~ ~~~~~~~~~~~^~~
| |
capacity: 32 10 + strlen(file) + 2
or somesuch. Another idea might be for macro expansion warnings:
warning: repeated side effects in macro expansion...
x = MIN (p++, q++);
~~~~^~~~~~~~~~
note: ...expanded here as
#define MIN(X,Y) (X<Y?X:Y)
^~~ ~ ~ ~ ~ ~ ~
| | | | | |
| | | | | q++
| | | | p++
| | | q++
| q++ p++
p++
The patch removes some logic from multiline.exp which special-cased
lines ending with a '|' character (thus complicating testing of this
patch). I believe that this was a vestige from experiments I did to
support strippng dg directives from the output; it was present in the
earliest version of multiline.exp I posted:
"[RFC, stage1] Richer source location information for gcc 6 (location ranges etc)"
https://gcc.gnu.org/ml/gcc-patches/2015-03/msg00837.html
and I believe was neved used.
gcc/c-family/ChangeLog:
* c-format.c: Include "selftest-diagnostic.h" and
"gcc-rich-location.h".
(format_warning_at_char): Pass NULL for new label params of
format_warning_va.
(class indirection_suffix): New class.
(class range_label_for_format_type_mismatch): New class.
(format_type_warning): Move logic for generating "*" suffix to
class indirection_suffix. Create "fmt_label" and "param_label"
to show their types, and pass them to the
format_warning_at_substring calls.
(selftest::test_type_mismatch_range_labels): New test.
(selftest::c_format_c_tests): Call it.
gcc/c/ChangeLog:
* c-objc-common.c: Include "gcc-rich-location.h".
(c_tree_printer): Move implemenation of '%T' to...
(print_type): ...this new function.
(range_label_for_type_mismatch::get_text): New function.
* c-typeck.c (convert_for_assignment): Add type labels to the rhs
range for the various ic_argpass cases.
(class maybe_range_label_for_tree_type_mismatch): New class.
(build_binary_op): Use it when calling binary_op_error.
gcc/cp/ChangeLog:
* call.c: Include "gcc-rich-location.h".
(convert_like_real): Add range label for "invalid conversion"
diagnostic.
(perform_implicit_conversion_flags): Add type label to the
"could not convert" error.
* error.c: Include "gcc-rich-location.h".
(range_label_for_type_mismatch::get_text): New function.
* typeck.c (convert_for_assignment): Add type label to
the "cannot convert" error if a location is available.
gcc/ChangeLog:
* common.opt (fdiagnostics-show-labels): New option.
* diagnostic-show-locus.c (class layout_range): Add field
"m_label".
(class layout): Add field "m_show_labels_p".
(layout_range::layout_range): Add param "label" and use it to
initialize m_label.
(make_range): Pass in NULL for new "label" param of layout_range's
ctor.
(layout::layout): Initialize m_show_labels_p.
(layout::maybe_add_location_range): Pass in loc_range->m_label
when constructing layout_range instances.
(struct line_label): New struct.
(layout::print_any_labels): New member function.
(layout::print_line): Call it if label-printing is enabled.
(selftest::test_one_liner_labels): New test.
(selftest::test_diagnostic_show_locus_one_liner): Call it.
* diagnostic.c (diagnostic_initialize): Initialize
context->show_labels_p.
* diagnostic.h (struct diagnostic_context): Add field
"show_labels_p".
* doc/invoke.texi (Diagnostic Message Formatting Options): Add
-fno-diagnostics-show-labels.
* dwarf2out.c (gen_producer_string): Add
OPT_fdiagnostics_show_labels to the ignored options.
* gcc-rich-location.c (gcc_rich_location::add_expr): Add "label"
param.
(gcc_rich_location::maybe_add_expr): Likewise.
* gcc-rich-location.h (gcc_rich_location::gcc_rich_location): Add
label" param, defaulting to NULL.
(gcc_rich_location::add_expr): Add "label" param.
(gcc_rich_location::maybe_add_expr): Likewise.
(class text_range_label): New class.
(class range_label_for_type_mismatch): New class.
* gimple-ssa-sprintf.c (fmtwarn): Pass NULL for new label params
of format_warning_va.
(fmtwarn_n): Likewise for new params of format_warning_n_va.
* lto-wrapper.c (merge_and_complain): Add
OPT_fdiagnostics_show_labels to the "pick one setting" options.
(append_compiler_options): Likewise to the dropped options.
(append_diag_options): Likewise to the passed-on options.
* opts.c (common_handle_option): Handle the new option.
* selftest-diagnostic.c
(test_diagnostic_context::test_diagnostic_context): Enable
show_labels_p.
* substring-locations.c: Include "gcc-rich-location.h".
(format_warning_n_va): Add "fmt_label" and "param_label" params
and use them as appropriate.
(format_warning_va): Add "fmt_label" and "param_label" params,
passing them on to format_warning_n_va.
(format_warning_at_substring): Likewise.
(format_warning_at_substring_n): Likewise.
* substring-locations.h (format_warning_va): Add "fmt_label" and
"param_label" params.
(format_warning_n_va): Likewise.
(format_warning_at_substring): Likewise.
(format_warning_at_substring_n): Likewise.
* toplev.c (general_init): Initialize global_dc->show_labels_p.
gcc/testsuite/ChangeLog:
* g++.dg/diagnostic/aka3.C: New test.
* g++.dg/diagnostic/param-type-mismatch-2.C: Update expected
output to show range labels.
* g++.dg/diagnostic/param-type-mismatch.C: Likewise.
* g++.dg/plugin/plugin.exp (plugin_test_list): Add...
* g++.dg/plugin/show-template-tree-color-labels.C: New test.
* gcc.dg/bad-binary-ops.c: Update expected output to show range
labels. Add an "aka" example.
* gcc.dg/cpp/pr66415-1.c: Update expected output to show range
labels.
* gcc.dg/format/diagnostic-ranges.c: Likewise.
* gcc.dg/format/pr72858.c: Likewise.
* gcc.dg/format/pr78498.c: Likewise.
* gcc.dg/param-type-mismatch.c: Add "-Wpointer-sign" to options.
Update expected output to show range labels. Add examples of
-Wincompatible-pointer-types and -Wpointer-sign for parameters.
* gcc.dg/plugin/diagnostic-test-show-locus-bw-line-numbers.c:
Update expected output to show range labels.
* gcc.dg/plugin/diagnostic-test-show-locus-bw.c: Likewise.
(test_very_wide_line): Adjust so that label is at left-clipping
boundary.
(test_very_wide_line_2): New test.
* gcc.dg/plugin/diagnostic-test-show-locus-color-line-numbers.c:
Update expected output to show range labels.
* gcc.dg/plugin/diagnostic-test-show-locus-color.c: Likewise.
* gcc.dg/plugin/diagnostic-test-show-locus-no-labels.c: New test.
* gcc.dg/plugin/diagnostic_plugin_show_trees.c (show_tree): Update
for new param to gcc_rich_location::add_expr.
* gcc.dg/plugin/diagnostic_plugin_test_show_locus.c (add_range):
Add "label" param.
(test_show_locus): Add examples of labels to various tests. Tweak
the "very wide_line" test case and duplicate it, to cover the
boundary values for clipping of labels against the left-margin.
* gcc.dg/plugin/plugin.exp (plugin_test_list): Add
diagnostic-test-show-locus-no-labels.c.
* gcc.dg/pr69554-1.c: Update expected output to show range labels.
Update line numbers of dg-locus directives.
* gcc.dg/pr69627.c: Update expected output to show range labels.
* lib/multiline.exp (proc _build_multiline_regex): Remove
special-case handling of lines with trailing '|'.
libcpp/ChangeLog:
* 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.
From-SVN: r263564
2018-08-15 20:09:35 +02:00
|
|
|
|
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 20:13:00 +02:00
|
|
|
|
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 23:28:51 +02:00
|
|
|
|
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 23:39:14 +02:00
|
|
|
|
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 21:36:01 +02:00
|
|
|
|
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 20:10:57 +02:00
|
|
|
|
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 16:47:11 +02:00
|
|
|
|
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 19:13:30 +02:00
|
|
|
|
2018-05-23 Jason Merrill <jason@redhat.com>
|
|
|
|
|
|
|
|
|
|
* system.h: #include <new> earlier.
|
|
|
|
|
|
2018-05-18 01:28:34 +02:00
|
|
|
|
2018-05-17 Jason Merrill <jason@redhat.com>
|
|
|
|
|
|
|
|
|
|
* line-map.c (linemap_init): Use placement new.
|
|
|
|
|
* system.h: #include <new>.
|
|
|
|
|
|
Fix ICE for missing header fix-it hints with overlarge #line directives (PR c/84852)
PR c/84852 reports an ICE inside diagnostic_show_locus when printing
a diagnostic for a source file with a #line >= 2^31:
#line 7777777777
int foo (void) { return strlen(""); }
where we're attempting to print a fix-it hint at the top of the file
and underline the "strlen" (two "line spans").
The
#line 7777777777
won't fix within the 32-bit linenum_type, and is truncated from
0x1cf977871
to
0xcf977871
i.e. 3482810481 in decimal.
Such a #line is reported by -pedantic and -pedantic-errors, but we
shouldn't ICE.
The ICE is an assertion failure within layout::calculate_line_spans,
where the line spans have not been properly sorted.
The layout_ranges are stored as int, rather than linenum_type,
giving line -812156815 for the error, and line 1 for the fix-it hint.
However, line_span uses linenum_type rather than int.
line_span::comparator compares these values as int, and hence
decides that (linenum_type)3482810481 aka (int)-812156815 is less
than line 1.
This leads to this assertion failing in layout::calculate_line_spans:
1105 gcc_assert (next->m_first_line >= current->m_first_line);
since it isn't the case that 1 >= 3482810481.
The underlying problem is the mix of types for storing line numbers:
in parts of libcpp and diagnostic-show-locus.c we use linenum_type;
in other places (including libcpp's expanded_location) we use int.
I looked at using linenum_type throughout, but doing so turned into
a large patch, so this patch fixes the ICE in a less invasive way
by merely using linenum_type more consistently just within
diagnostic-show-locus.c, and fixing line_span::comparator to properly
handle line numbers (and line number differences) >= 2^31, by using
a new helper function for linenum_type differences, computing the
difference using long long, and using the sign of the difference
(as the difference might not fit in the "int" return type imposed
by qsort).
gcc/ChangeLog:
PR c/84852
* diagnostic-show-locus.c (class layout_point): Convert m_line
from int to linenum_type.
(line_span::comparator): Use linenum "compare" function when
comparing line numbers.
(test_line_span): New function.
(layout_range::contains_point): Convert param "row" from int to
linenum_type.
(layout_range::intersects_line_p): Likewise.
(layout::will_show_line_p): Likewise.
(layout::print_source_line): Likewise.
(layout::should_print_annotation_line_p): Likewise.
(layout::print_annotation_line): Likewise.
(layout::print_leading_fixits): Likewise.
(layout::annotation_line_showed_range_p): Likewise.
(struct line_corrections): Likewise for field m_row.
(line_corrections::line_corrections): Likewise for param "row".
(layout::print_trailing_fixits): Likewise.
(layout::get_state_at_point): Likewise.
(layout::get_x_bound_for_row): Likewise.
(layout::print_line): Likewise.
(diagnostic_show_locus): Likewise for locals "last_line" and
"row".
(selftest::diagnostic_show_locus_c_tests): Call test_line_span.
* input.c (selftest::test_linenum_comparisons): New function.
(selftest::input_c_tests): Call it.
* selftest.c (selftest::test_assertions): Test ASSERT_GT,
ASSERT_GT_AT, ASSERT_LT, and ASSERT_LT_AT.
* selftest.h (ASSERT_GT): New macro.
(ASSERT_GT_AT): New macro.
(ASSERT_LT): New macro.
(ASSERT_LT_AT): New macro.
gcc/testsuite/ChangeLog:
PR c/84852
* gcc.dg/fixits-pr84852-1.c: New test.
* gcc.dg/fixits-pr84852-2.c: New test.
libcpp/ChangeLog:
* include/line-map.h (compare): New function on linenum_type.
From-SVN: r258526
2018-03-14 14:58:13 +01:00
|
|
|
|
2018-03-14 David Malcolm <dmalcolm@redhat.com>
|
|
|
|
|
|
|
|
|
|
* include/line-map.h (compare): New function on linenum_type.
|
|
|
|
|
|
2018-02-28 16:27:17 +01:00
|
|
|
|
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 13:02:34 +01:00
|
|
|
|
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 18:43:01 +01:00
|
|
|
|
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 09:31:52 +01:00
|
|
|
|
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 07:27:47 +01:00
|
|
|
|
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.
|
|
|
|
|
|
Add ability to remap file names in __FILE__, etc (PR other/70268)
This commit adds the -fmacro-prefix-map option that allows remapping of file
names in __FILE__, __BASE_FILE__, and __builtin_FILE(), similar to how
-fdebug-prefix-map allows to do the same for debug information.
Additionally, it adds -ffile-prefix-map which can be used to specify both
mappings with a single option (and, should we need to add more -f*-prefix-map
options in the future, those as well).
libcpp/ChangeLog:
2018-01-18 Boris Kolpackov <boris@codesynthesis.com>
PR other/70268
* include/cpplib.h (cpp_callbacks::remap_filename): New callback.
* libcpp/macro.c (_cpp_builtin_macro_text): Call remap_filename for
__FILE__ and __BASE_FILE__.
gcc/ChangeLog:
2018-01-18 Boris Kolpackov <boris@codesynthesis.com>
PR other/70268
* common.opt: (-ffile-prefix-map): New option.
* opts.c (common_handle_option): Defer it.
* opts-global.c (handle_common_deferred_options): Handle it.
* debug.h (remap_debug_filename, add_debug_prefix_map): Move to...
* file-prefix-map.h: New file.
(remap_debug_filename, add_debug_prefix_map): ...here.
(add_macro_prefix_map, add_file_prefix_map, remap_macro_filename): New.
* final.c (debug_prefix_map, add_debug_prefix_map
remap_debug_filename): Move to...
* file-prefix-map.c: New file.
(file_prefix_map, add_prefix_map, remap_filename) ...here and rename,
generalize, get rid of alloca(), use strrchr() instead of strchr().
(add_macro_prefix_map, add_debug_prefix_map, add_file_prefix_map):
Implement in terms of add_prefix_map().
(remap_macro_filename, remap_debug_filename): Implement in term of
remap_filename().
* Makefile.in (OBJS, PLUGIN_HEADERS): Add new files.
* builtins.c (fold_builtin_FILE): Call remap_macro_filename().
* dbxout.c: Include file-prefix-map.h.
* varasm.c: Likewise.
* vmsdbgout.c: Likewise.
* xcoffout.c: Likewise.
* dwarf2out.c: Likewise plus omit new options from DW_AT_producer.
* doc/cppopts.texi (-fmacro-prefix-map): Document.
* doc/invoke.texi (-ffile-prefix-map): Document.
(-fdebug-prefix-map): Update description.
gcc/c-family/ChangeLog:
2018-01-18 Boris Kolpackov <boris@codesynthesis.com>
PR other/70268
* c-family/c.opt (-fmacro-prefix-map): New option.
* c-family/c-opts.c (c_common_handle_option): Handle it.
* c-family/c-lex.c (init_c_lex): Set remap_filename cpp callback.
* c-family/c-ppoutput.c (init_pp_output): Likewise.
gcc/testsuite/ChangeLog:
2018-01-18 Boris Kolpackov <boris@codesynthesis.com>
PR other/70268
* c-c++-common/ffile-prefix-map.c: New test.
* c-c++-common/fmacro-prefix-map.c: New test.
* c-c++-common/cpp/ffile-prefix-map.c: New test.
* c-c++-common/cpp/fmacro-prefix-map.c: New test.
From-SVN: r256847
2018-01-18 14:17:37 +01:00
|
|
|
|
2018-01-18 Boris Kolpackov <boris@codesynthesis.com>
|
|
|
|
|
|
2018-08-27 16:04:23 +02:00
|
|
|
|
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__.
|
Add ability to remap file names in __FILE__, etc (PR other/70268)
This commit adds the -fmacro-prefix-map option that allows remapping of file
names in __FILE__, __BASE_FILE__, and __builtin_FILE(), similar to how
-fdebug-prefix-map allows to do the same for debug information.
Additionally, it adds -ffile-prefix-map which can be used to specify both
mappings with a single option (and, should we need to add more -f*-prefix-map
options in the future, those as well).
libcpp/ChangeLog:
2018-01-18 Boris Kolpackov <boris@codesynthesis.com>
PR other/70268
* include/cpplib.h (cpp_callbacks::remap_filename): New callback.
* libcpp/macro.c (_cpp_builtin_macro_text): Call remap_filename for
__FILE__ and __BASE_FILE__.
gcc/ChangeLog:
2018-01-18 Boris Kolpackov <boris@codesynthesis.com>
PR other/70268
* common.opt: (-ffile-prefix-map): New option.
* opts.c (common_handle_option): Defer it.
* opts-global.c (handle_common_deferred_options): Handle it.
* debug.h (remap_debug_filename, add_debug_prefix_map): Move to...
* file-prefix-map.h: New file.
(remap_debug_filename, add_debug_prefix_map): ...here.
(add_macro_prefix_map, add_file_prefix_map, remap_macro_filename): New.
* final.c (debug_prefix_map, add_debug_prefix_map
remap_debug_filename): Move to...
* file-prefix-map.c: New file.
(file_prefix_map, add_prefix_map, remap_filename) ...here and rename,
generalize, get rid of alloca(), use strrchr() instead of strchr().
(add_macro_prefix_map, add_debug_prefix_map, add_file_prefix_map):
Implement in terms of add_prefix_map().
(remap_macro_filename, remap_debug_filename): Implement in term of
remap_filename().
* Makefile.in (OBJS, PLUGIN_HEADERS): Add new files.
* builtins.c (fold_builtin_FILE): Call remap_macro_filename().
* dbxout.c: Include file-prefix-map.h.
* varasm.c: Likewise.
* vmsdbgout.c: Likewise.
* xcoffout.c: Likewise.
* dwarf2out.c: Likewise plus omit new options from DW_AT_producer.
* doc/cppopts.texi (-fmacro-prefix-map): Document.
* doc/invoke.texi (-ffile-prefix-map): Document.
(-fdebug-prefix-map): Update description.
gcc/c-family/ChangeLog:
2018-01-18 Boris Kolpackov <boris@codesynthesis.com>
PR other/70268
* c-family/c.opt (-fmacro-prefix-map): New option.
* c-family/c-opts.c (c_common_handle_option): Handle it.
* c-family/c-lex.c (init_c_lex): Set remap_filename cpp callback.
* c-family/c-ppoutput.c (init_pp_output): Likewise.
gcc/testsuite/ChangeLog:
2018-01-18 Boris Kolpackov <boris@codesynthesis.com>
PR other/70268
* c-c++-common/ffile-prefix-map.c: New test.
* c-c++-common/fmacro-prefix-map.c: New test.
* c-c++-common/cpp/ffile-prefix-map.c: New test.
* c-c++-common/cpp/fmacro-prefix-map.c: New test.
From-SVN: r256847
2018-01-18 14:17:37 +01:00
|
|
|
|
|
2018-01-14 06:19:29 +01:00
|
|
|
|
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 11:03:58 +01:00
|
|
|
|
2018-01-03 Jakub Jelinek <jakub@redhat.com>
|
|
|
|
|
|
|
|
|
|
Update copyright years.
|
|
|
|
|
|
2017-12-20 16:07:01 +01:00
|
|
|
|
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 19:59:24 +01:00
|
|
|
|
2017-12-14 Bernd Edlinger <bernd.edlinger@hotmail.de>
|
|
|
|
|
|
|
|
|
|
* internal.h (maybe_print_line): Change signature.
|
Add ability to remap file names in __FILE__, etc (PR other/70268)
This commit adds the -fmacro-prefix-map option that allows remapping of file
names in __FILE__, __BASE_FILE__, and __builtin_FILE(), similar to how
-fdebug-prefix-map allows to do the same for debug information.
Additionally, it adds -ffile-prefix-map which can be used to specify both
mappings with a single option (and, should we need to add more -f*-prefix-map
options in the future, those as well).
libcpp/ChangeLog:
2018-01-18 Boris Kolpackov <boris@codesynthesis.com>
PR other/70268
* include/cpplib.h (cpp_callbacks::remap_filename): New callback.
* libcpp/macro.c (_cpp_builtin_macro_text): Call remap_filename for
__FILE__ and __BASE_FILE__.
gcc/ChangeLog:
2018-01-18 Boris Kolpackov <boris@codesynthesis.com>
PR other/70268
* common.opt: (-ffile-prefix-map): New option.
* opts.c (common_handle_option): Defer it.
* opts-global.c (handle_common_deferred_options): Handle it.
* debug.h (remap_debug_filename, add_debug_prefix_map): Move to...
* file-prefix-map.h: New file.
(remap_debug_filename, add_debug_prefix_map): ...here.
(add_macro_prefix_map, add_file_prefix_map, remap_macro_filename): New.
* final.c (debug_prefix_map, add_debug_prefix_map
remap_debug_filename): Move to...
* file-prefix-map.c: New file.
(file_prefix_map, add_prefix_map, remap_filename) ...here and rename,
generalize, get rid of alloca(), use strrchr() instead of strchr().
(add_macro_prefix_map, add_debug_prefix_map, add_file_prefix_map):
Implement in terms of add_prefix_map().
(remap_macro_filename, remap_debug_filename): Implement in term of
remap_filename().
* Makefile.in (OBJS, PLUGIN_HEADERS): Add new files.
* builtins.c (fold_builtin_FILE): Call remap_macro_filename().
* dbxout.c: Include file-prefix-map.h.
* varasm.c: Likewise.
* vmsdbgout.c: Likewise.
* xcoffout.c: Likewise.
* dwarf2out.c: Likewise plus omit new options from DW_AT_producer.
* doc/cppopts.texi (-fmacro-prefix-map): Document.
* doc/invoke.texi (-ffile-prefix-map): Document.
(-fdebug-prefix-map): Update description.
gcc/c-family/ChangeLog:
2018-01-18 Boris Kolpackov <boris@codesynthesis.com>
PR other/70268
* c-family/c.opt (-fmacro-prefix-map): New option.
* c-family/c-opts.c (c_common_handle_option): Handle it.
* c-family/c-lex.c (init_c_lex): Set remap_filename cpp callback.
* c-family/c-ppoutput.c (init_pp_output): Likewise.
gcc/testsuite/ChangeLog:
2018-01-18 Boris Kolpackov <boris@codesynthesis.com>
PR other/70268
* c-c++-common/ffile-prefix-map.c: New test.
* c-c++-common/fmacro-prefix-map.c: New test.
* c-c++-common/cpp/ffile-prefix-map.c: New test.
* c-c++-common/cpp/fmacro-prefix-map.c: New test.
From-SVN: r256847
2018-01-18 14:17:37 +01:00
|
|
|
|
|
2017-12-05 22:00:15 +01:00
|
|
|
|
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 21:19:07 +01:00
|
|
|
|
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 20:24:35 +01:00
|
|
|
|
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-21 01:57:29 +01:00
|
|
|
|
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-21 01:40:53 +01:00
|
|
|
|
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 21:17:42 +01:00
|
|
|
|
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 20:07:26 +01:00
|
|
|
|
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 11:33:41 +01:00
|
|
|
|
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 10:58:16 +01:00
|
|
|
|
2017-11-05 Tom de Vries <tom@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
PR other/82784
|
|
|
|
|
* lex.c (BUF_APPEND): Remove semicolon after
|
|
|
|
|
"do {} while (0)".
|
|
|
|
|
|
diagnostics: get rid of *_at_rich_loc in favor of overloading
Adding a fix-it hint currently involves changing e.g.:
error_at (token->location,
"unknown type name %qE; did you mean %qs?",
token->value, hint);
to:
gcc_rich_location richloc (token->location);
richloc.add_fixit_replace (hint);
error_at_rich_loc (&richloc,
"unknown type name %qE; did you mean %qs?",
token->value, hint);
to make the change from taking a location_t to a rich_location *.
This patch renames the "*_at_rich_loc" diagnostic entrypoints to use
the same function names for rich_location * as for location_t,
via overloading, to simplify the above change to just changing from:
error_at (token->location,
"unknown type name %qE; did you mean %qs?",
token->value, hint);
to:
gcc_rich_location richloc (token->location);
richloc.add_fixit_replace (hint);
error_at (&richloc,
"unknown type name %qE; did you mean %qs?",
token->value, hint);
thus saving space (and typing) and usually avoiding the need to reindent
the "error_at" invocation.
With this change, 0 is no longer acceptable as a location_t to these
entrypoints, as e.g.:
../../src/gcc/auto-profile.c:855:37: error: call of overloaded
'inform(int, const char [18])' is ambiguous
inform (0, "Not expected TAG.");
^
In file included from ../../src/gcc/auto-profile.c:35:0:
../../src/gcc/diagnostic-core.h:88:13: note: candidate:
'void inform(location_t, const char*, ...)'
extern void inform (location_t, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
^~~~~~
../../src/gcc/diagnostic-core.h:89:13: note: candidate:
'void inform(rich_location*, const char*, ...)'
extern void inform (rich_location *, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
^~~~~~
Such locations now need to be spelled out as UNKNOWN_LOCATION,
rather than 0.
I considered making the API take a rich_location & rather than a
rich_location *, but doing so would mean replacing
diagnostic_set_info
and
diagnostic_set_info_translated
with a constructor for diagnostic_info, which was a more invasive
change. Maybe in the future.
gcc/ChangeLog:
* auto-profile.c (autofdo_source_profile::read): Use
UNKNOWN_LOCATION rather than 0.
* diagnostic-core.h (warning_at_rich_loc): Rename to...
(warning_at): ...this overload.
(warning_at_rich_loc_n): Rename to...
(warning_n): ...this overload.
(error_at_rich_loc): Rename to...
(error_at): ...this overload.
(pedwarn_at_rich_loc): Rename to...
(pedwarn): ...this overload.
(permerror_at_rich_loc): Rename to...
(permerror): ...this overload.
(inform_at_rich_loc): Rename to...
(inform): ...this overload.
* diagnostic.c: (diagnostic_n_impl): Delete location_t-based decl.
(diagnostic_n_impl_richloc): Rename to...
(diagnostic_n_impl): ...this rich_location *-based decl.
(inform_at_rich_loc): Rename to...
(inform): ...this, and add an assertion.
(inform_n): Update for removal of location_t-based diagnostic_n_impl.
(warning_at_rich_loc): Rename to...
(warning_at): ...this, and add an assertion.
(warning_at_rich_loc_n): Rename to...
(warning_n): ...this, and add an assertion.
(warning_n): Update location_t-based implementation for removal of
location_t-based diagnostic_n_impl.
(pedwarn_at_rich_loc): Rename to...
(pedwarn): ...this, and add an assertion.
(permerror_at_rich_loc): Rename to...
(permerror): ...this, and add an assertion.
(error_n): Update for removal of location_t-based diagnostic_n_impl.
(error_at_rich_loc): Rename to...
(error_at): ...this, and add an assertion.
* gcc.c (do_spec_1): Use UNKNOWN_LOCATION rather than 0.
(driver::do_spec_on_infiles): Likewise.
* substring-locations.c (format_warning_va): Update for renaming
of inform_at_rich_loc.
gcc/c-family/ChangeLog:
* c-common.c (binary_op_error): Update for renaming of
error_at_rich_loc.
(c_parse_error): Likewise.
* c-warn.c (warn_logical_not_parentheses): Likewise for
renaming of inform_at_rich_loc.
(warn_for_restrict): Likewise for renaming of
warning_at_rich_loc_n.
gcc/c/ChangeLog:
* c-decl.c (implicit_decl_warning): Update for renaming of
pedwarn_at_rich_loc and warning_at_rich_loc.
(implicitly_declare): Likewise for renaming of inform_at_rich_loc.
(undeclared_variable): Likewise for renaming of error_at_rich_loc.
* c-parser.c (c_parser_declaration_or_fndef): Likewise.
(c_parser_struct_or_union_specifier): Likewise for renaming of
pedwarn_at_rich_loc.
(c_parser_parameter_declaration): Likewise for renaming of
error_at_rich_loc.
* c-typeck.c (build_component_ref): Likewise.
(build_unary_op): Likewise for renaming of inform_at_rich_loc.
(pop_init_level): Likewise for renaming of warning_at_rich_loc.
(set_init_label): Likewise for renaming of error_at_rich_loc.
gcc/cp/ChangeLog:
* class.c (explain_non_literal_class): Use UNKNOWN_LOCATION rather
than 0.
* name-lookup.c (suggest_alternatives_for): Update for renaming of
inform_at_rich_loc.
(maybe_suggest_missing_header): Likewise.
(suggest_alternative_in_explicit_scope): Likewise.
* parser.c (cp_parser_diagnose_invalid_type_name): Likewise for
renaming of error_at_rich_loc.
(cp_parser_string_literal): Likewise.
(cp_parser_nested_name_specifier_opt): Likewise.
(cp_parser_cast_expression): Likewise for renaming of
warning_at_rich_loc.
(cp_parser_decl_specifier_seq): Likewise for renaming of
error_at_rich_loc and warning_at_rich_loc.
(cp_parser_elaborated_type_specifier): Likewise for renaming of
pedwarn_at_rich_loc.
(cp_parser_cv_qualifier_seq_opt): Likewise for renaming of
error_at_rich_loc.
(cp_parser_virt_specifier_seq_opt): Likewise.
(cp_parser_class_specifier_1): Likewise.
(cp_parser_class_head): Likewise.
(cp_parser_member_declaration): Likewise for renaming of
pedwarn_at_rich_loc, warning_at_rich_loc, and error_at_rich_loc.
(cp_parser_enclosed_template_argument_list): Likewise for renaming
of error_at_rich_loc.
(set_and_check_decl_spec_loc): Likewise.
* pt.c (listify): Likewise.
* rtti.c (typeid_ok_p): Likewise.
* semantics.c (process_outer_var_ref): Use UNKNOWN_LOCATION rather
than 0.
* typeck.c (access_failure_info::maybe_suggest_accessor): Update
for renaming of inform_at_rich_loc.
(finish_class_member_access_expr): Likewise for renaming of
error_at_rich_loc.
gcc/objc/ChangeLog:
* objc-gnu-runtime-abi-01.c (objc_gnu_runtime_abi_01_init): Use
UNKNOWN_LOCATION rather than 0.
gcc/testsuite/ChangeLog:
* gcc.dg/plugin/diagnostic_plugin_show_trees.c (show_tree): Update
for renaming of error_at_rich_loc and inform_at_rich_loc.
* gcc.dg/plugin/diagnostic_plugin_test_show_locus.c
(test_show_locus): Likewise for renaming of warning_at_rich_loc.
libcpp/ChangeLog:
* 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.
From-SVN: r254280
2017-10-31 21:21:58 +01:00
|
|
|
|
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.
|
|
|
|
|
|
Add -std=c17, -std=gnu17.
C17, a bug-fix version of the C11 standard with DR resolutions
integrated, will soon go to ballot. This patch adds corresponding
options -std=c17, -std=gnu17 (new default version, replacing
-std=gnu11 as the default), -std=iso9899:2017. As a bug-fix version
of the standard, there is no need for flag_isoc17 or any options for
compatibility warnings; however, there is a new __STDC_VERSION__
value, so new cpplib languages CLK_GNUC17 and CLK_STDC17 are added to
support using that new value with the new options. (If the standard
ends up being published in 2018 and being known as C18, option aliases
can be added. Note however that -std=iso9899:199409 corresponds to a
__STDC_VERSION__ value rather than a publication date.)
(There are a couple of DR resolutions needing implementing in GCC, but
that's independent of the new options.)
(I'd propose to add -std=c2x / -std=gnu2x / -Wc11-c2x-compat for the
next major C standard revision once there are actually C2x drafts
being issued with new features included.)
Bootstrapped with no regressions for x86_64-pc-linux-gnu.
gcc:
* doc/invoke.texi (C Dialect Options): Document -std=c17,
-std=iso9899:2017 and -std=gnu17.
* doc/standards.texi (C Language): Document C17 support.
* doc/cpp.texi (Overview): Mention -std=c17.
(Standard Predefined Macros): Document C11 and C17 values of
__STDC_VERSION__. Do not refer to C99 support as incomplete.
* doc/extend.texi (Inline): Do not list individual options for
standards newer than C99.
* dwarf2out.c (highest_c_language, gen_compile_unit_die): Handle
"GNU C17".
* config/rl78/rl78.c (rl78_option_override): Handle "GNU C17"
language name.
gcc/c-family:
* c.opt (std=c17, std=gnu17, std=iso9899:2017): New options.
* c-opts.c (set_std_c17): New function.
(c_common_init_options): Use gnu17 as default C version.
(c_common_handle_option): Handle -std=c17 and -std=gnu17.
gcc/testsuite:
* gcc.dg/c17-version-1.c, gcc.dg/c17-version-2.c: New tests.
libcpp:
* 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__.
From-SVN: r254216
2017-10-30 13:17:40 +01:00
|
|
|
|
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 20:56:31 +02:00
|
|
|
|
2017-10-10 Nathan Sidwell <nathan@acm.org>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/82506
|
|
|
|
|
* macro.c (cpp_quote_string): Escape raw LFs.
|
|
|
|
|
|
2017-09-15 23:16:37 +02:00
|
|
|
|
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.
|
|
|
|
|
|
invoke.texi: Document -std=c++17 and -std=gnu++17 and document c++1z and gnu++1z as deprecated.
* doc/invoke.texi: Document -std=c++17 and -std=gnu++17 and document
c++1z and gnu++1z as deprecated. Change other references to
-std=c++1z to -std=c++17 and -std=gnu++1z to -std=gnu++17.
Change -Wc++1z-compat to -Wc++17-compat.
* doc/cpp.texi: Document -std=c++17 defines __cplusplus 201703L.
* dwarf2out.c (highest_c_language): Handle C++17.
(gen_compile_unit_die): Likewise.
c-family/
* c.opt (Wc++1z-compat): Change from option to undocumented alias.
(Wc++17-compat): Change from undocumented alias to option.
(Wnoexcept-type): Enable by Wc++17-compat instead of Wc++1z-compat,
change C++1z to C++17 in description.
(std=c++1z, std=gnu++1z): Change from option to undocumented
deprecated alias.
(std=c++17, std=gnu++17): Change from undocumented alias to option.
Adjust description.
* c-common.h (enum cxx_dialect): Rename cxx1z to cxx17.
* c-opts.c (set_std_cxx1z): Rename to ...
(set_std_cxx17): ... this.
(c_common_handle_option): Rename OPT_std_c__1z to OPT_std_c__17
and OPT_std_gnu__1z to OPT_std_gnu__17. Adjust set_std_cxx1z
caller.
(c_common_post_options): Use cxx17 instead of cxx1z. Adjust
comments.
cp/
* decl.c (redeclaration_error_message): Use cxx17 instead of cxx1z,
adjust diagnostics refering to C++1z or -std=gnu++1z or -std=c++1z
to C++17 or -std=gnu++17 or -std=c++17. Adjust comments.
(cxx_init_decl_processing, next_initializable_field,
is_direct_enum_init, check_initializer, cp_finish_decl,
mark_inline_variable, grokdeclarator, grokparms, xref_basetypes,
finish_function): Likewise.
* cp-tree.h (DECL_INLINE_VAR_P): Likewise.
* pt.c (mark_template_parm, convert_nontype_argument,
instantiate_class_template_1, type_unification_real, unify,
get_partial_spec_bindings, dependent_type_p_r): Likewise.
* typeck.c (cp_build_unary_op): Likewise.
* constexpr.c (var_in_maybe_constexpr_fn): Likewise.
* call.c (build_user_type_conversion_1, build_over_call,
build_special_member_call): Likewise.
* lambda.c (begin_lambda_type): Likewise.
* typeck2.c (process_init_constructor_record): Likewise.
* class.c (build_base_field, finalize_literal_type_property,
explain_non_literal_class): Likewise.
* parser.c (cp_parser_diagnose_invalid_type_name,
cp_parser_primary_expression, cp_parser_lambda_introducer,
cp_parser_lambda_declarator_opt, cp_parser_selection_statement,
cp_convert_range_for, cp_parser_perform_range_for_lookup,
cp_parser_decomposition_declaration, cp_parser_linkage_specification,
cp_parser_static_assert, cp_parser_simple_type_specifier,
cp_parser_namespace_definition, cp_parser_using_declaration,
cp_parser_init_declarator, cp_parser_type_parameter_key,
cp_parser_exception_specification_opt, cp_parser_std_attribute_spec,
cp_parser_constructor_declarator_p): Likewise.
* mangle.c (struct globals): Rename need_cxx1z_warning to
need_cxx17_warning.
(write_exception_spec, start_mangling, mangle_decl): Likewise.
* Make-lang.in (check-c++1z): Rename to check-c++17, depend on
it.
(check-c++17): New goal. Use 17 instead of 1z.
(check-c++-all): Use 17 instead of 1z.
testsuite/
* lib/g++-dg.exp (g++-dg-runtest): Use 17 instead of 1z.
* lib/target-supports.exp (check_effective_target_c++14): Use
check_effective_target_c++17 instead of check_effective_target_c++1z.
(check_effective_target_c++14_down): Likewise.
(check_effective_target_c++1z_only): Rename to ...
(check_effective_target_c++17_only): ... this.
(check_effective_target_c++1z): Rename to ...
(check_effective_target_c++17): ... this.
* g++.dg/debug/dwarf2/inline-var-1.C: Use -std=c++17 or -std=gnu++17
instead of -std=c++1z or -std=gnu++1z. Use c++17 instead of c++1z
and c++17_only instead of c++1z_only. Adjust expected diagnostics
and comments refering to 1z to 17.
* g++.dg/debug/dwarf2/inline-var-2.C: Likewise.
* g++.dg/template/partial5.C: Likewise.
* g++.dg/template/nontype8.C: Likewise.
* g++.dg/cpp1z/noexcept-type5.C: Likewise.
* g++.dg/cpp1z/nontype3a.C: Likewise.
* g++.dg/cpp1z/constexpr-lambda4.C: Likewise.
* g++.dg/cpp1z/noexcept-type16.C: Likewise.
* g++.dg/cpp1z/class-deduction32.C: Likewise.
* g++.dg/cpp1z/pr78771.C: Likewise.
* g++.dg/cpp1z/elide1.C: Likewise.
* g++.dg/cpp1z/fold3.C: Likewise.
* g++.dg/cpp1z/class-deduction2.C: Likewise.
* g++.dg/cpp1z/noexcept-type12.C: Likewise.
* g++.dg/cpp1z/inline-var2.C: Likewise.
* g++.dg/cpp1z/eval-order2.C: Likewise.
* g++.dg/cpp1z/decomp21.C: Likewise.
* g++.dg/cpp1z/constexpr-lambda11.C: Likewise.
* g++.dg/cpp1z/constexpr-lambda9.C: Likewise.
* g++.dg/cpp1z/utf8-neg.C: Likewise.
* g++.dg/cpp1z/class-deduction41.C: Likewise.
* g++.dg/cpp1z/class-deduction23.C: Likewise.
* g++.dg/cpp1z/nodiscard3.C: Likewise.
* g++.dg/cpp1z/static_assert-nomsg.C: Likewise.
* g++.dg/cpp1z/noexcept-type9.C: Likewise.
* g++.dg/cpp1z/class-deduction21.C: Likewise.
* g++.dg/cpp1z/range-for1.C: Likewise.
* g++.dg/cpp1z/init-statement4.C: Likewise.
* g++.dg/cpp1z/udlit-utf8char.C: Likewise.
* g++.dg/cpp1z/decomp30.C: Likewise.
* g++.dg/cpp1z/class-deduction39.C: Likewise.
* g++.dg/cpp1z/register2.C: Likewise.
* g++.dg/cpp1z/decomp9.C: Likewise.
* g++.dg/cpp1z/regress1.C: Likewise.
* g++.dg/cpp1z/direct-enum-init1.C: Likewise.
* g++.dg/cpp1z/class-deduction30.C: Likewise.
* g++.dg/cpp1z/abbrev2.C: Likewise.
* g++.dg/cpp1z/nontype-auto6.C: Likewise.
* g++.dg/cpp1z/regress2.C: Likewise.
* g++.dg/cpp1z/decomp16.C: Likewise.
* g++.dg/cpp1z/bool-increment1.C: Likewise.
* g++.dg/cpp1z/aligned-new1.C: Likewise.
* g++.dg/cpp1z/decomp3.C: Likewise.
* g++.dg/cpp1z/register1.C: Likewise.
* g++.dg/cpp1z/namespace-attribs.C: Likewise.
* g++.dg/cpp1z/class-deduction1.C: Likewise.
* g++.dg/cpp1z/decomp10.C: Likewise.
* g++.dg/cpp1z/constexpr-if11.C: Likewise.
* g++.dg/cpp1z/constexpr-lambda10.C: Likewise.
* g++.dg/cpp1z/decomp27.C: Likewise.
* g++.dg/cpp1z/noexcept-type2.C: Likewise.
* g++.dg/cpp1z/constexpr-lambda6.C: Likewise.
* g++.dg/cpp1z/class-deduction9.C: Likewise.
* g++.dg/cpp1z/attributes-enum-1.C: Likewise.
* g++.dg/cpp1z/decomp11.C: Likewise.
* g++.dg/cpp1z/aligned-new3.C: Likewise.
* g++.dg/cpp1z/utf8-2.C: Likewise.
* g++.dg/cpp1z/lambda-this3.C: Likewise.
* g++.dg/cpp1z/decomp-constexpr1.C: Likewise.
* g++.dg/cpp1z/byte1.C: Likewise.
* g++.dg/cpp1z/nontype-auto9.C: Likewise.
* g++.dg/cpp1z/aggr-base4.C: Likewise.
* g++.dg/cpp1z/constexpr-lambda1.C: Likewise.
* g++.dg/cpp1z/nontype-auto3.C: Likewise.
* g++.dg/cpp1z/utf8-2a.C: Likewise.
* g++.dg/cpp1z/constexpr-lambda7.C: Likewise.
* g++.dg/cpp1z/aggr-base6.C: Likewise.
* g++.dg/cpp1z/cplusplus.C: Likewise.
* g++.dg/cpp1z/class-deduction20.C: Likewise.
* g++.dg/cpp1z/aggr-base2.C: Likewise.
* g++.dg/cpp1z/class-deduction6.C: Likewise.
* g++.dg/cpp1z/noexcept-type3.C: Likewise.
* g++.dg/cpp1z/class-deduction31.C: Likewise.
* g++.dg/cpp1z/class-deduction25.C: Likewise.
* g++.dg/cpp1z/class-deduction18.C: Likewise.
* g++.dg/cpp1z/fold9.C: Likewise.
* g++.dg/cpp1z/noexcept-type8.C: Likewise.
* g++.dg/cpp1z/abbrev1.C: Likewise.
* g++.dg/cpp1z/constexpr-if10.C: Likewise.
* g++.dg/cpp1z/utf8.C: Likewise.
* g++.dg/cpp1z/noexcept-type7.C: Likewise.
* g++.dg/cpp1z/aggr-base3.C: Likewise.
* g++.dg/cpp1z/constexpr-lambda8.C: Likewise.
* g++.dg/cpp1z/init-statement2.C: Likewise.
* g++.dg/cpp1z/nontype-auto4.C: Likewise.
* g++.dg/cpp1z/constexpr-if12.C: Likewise.
* g++.dg/cpp1z/class-deduction40.C: Likewise.
* g++.dg/cpp1z/nontype3.C: Likewise.
* g++.dg/cpp1z/class-deduction14.C: Likewise.
* g++.dg/cpp1z/fold7.C: Likewise.
* g++.dg/cpp1z/nontype2.C: Likewise.
* g++.dg/cpp1z/class-deduction15.C: Likewise.
* g++.dg/cpp1z/nested-namespace-def1.C: Likewise.
* g++.dg/cpp1z/class-deduction13.C: Likewise.
* g++.dg/cpp1z/aligned-new7.C: Likewise.
* g++.dg/cpp1z/noexcept-type1.C: Likewise.
* g++.dg/cpp1z/nontype1.C: Likewise.
* g++.dg/cpp1z/init-statement5.C: Likewise.
* g++.dg/cpp1z/nontype-auto2.C: Likewise.
* g++.dg/cpp1z/decomp17.C: Likewise.
* g++.dg/cpp1z/fold4.C: Likewise.
* g++.dg/cpp1z/constexpr-lambda2.C: Likewise.
* g++.dg/cpp1z/fold7a.C: Likewise.
* g++.dg/cpp1z/nontype-auto5.C: Likewise.
* g++.dg/cpp1z/init-statement7.C: Likewise.
* g++.dg/cpp1z/aggr-base5.C: Likewise.
* g++.dg/cpp1z/constexpr-lambda5.C: Likewise.
* g++.dg/cpp1z/pr79143.C: Likewise.
* g++.dg/cpp1z/class-deduction38.C: Likewise.
* g++.dg/cpp1z/nontype-auto8.C: Likewise.
* g++.dg/cpp1z/class-deduction12.C: Likewise.
* g++.dg/cpp1z/decomp20.C: Likewise.
* g++.dg/cpp1z/class-deduction22.C: Likewise.
* g++.dg/cpp1z/class-deduction29.C: Likewise.
* g++.dg/cpp1z/class-deduction8.C: Likewise.
* g++.dg/cpp1z/class-deduction43.C: Likewise.
* g++.dg/cpp1z/feat-cxx1z.C: Likewise.
* g++.dg/cpp1z/fold8.C: Likewise.
* g++.dg/cpp1z/init-statement3.C: Likewise.
* g++.dg/cpp1z/nontype-auto10.C: Likewise.
* g++.dg/cpp1z/class-deduction36.C: Likewise.
* g++.dg/cpp1z/noexcept-type17.C: Likewise.
* g++.dg/cpp1z/fallthrough1.C: Likewise.
* g++.dg/cpp1z/fold1.C: Likewise.
* g++.dg/cpp1z/class-deduction26.C: Likewise.
* g++.dg/cpp1z/fold-ice1.C: Likewise.
* g++.dg/cpp1z/fold5.C: Likewise.
* g++.dg/cpp1z/class-deduction34.C: Likewise.
* g++.dg/cpp1z/noexcept-type6.C: Likewise.
* g++.dg/cpp1z/class-deduction7.C: Likewise.
* g++.dg/cpp1z/class-deduction16.C: Likewise.
* g++.dg/cpp1z/class-deduction10.C: Likewise.
* g++.dg/cpp1z/eval-order3.C: Likewise.
* g++.dg/cpp1z/constexpr-lambda13.C: Likewise.
* g++.dg/cpp1z/aggr-base2a.C: Likewise.
* g++.dg/cpp1z/nontype-auto1.C: Likewise.
* g++.dg/cpp1z/constexpr-lambda3.C: Likewise.
* g++.dg/cpp1z/nontype-auto7.C: Likewise.
* g++.dg/cpp1z/decomp15.C: Likewise.
* g++.dg/cpp1z/noexcept-type4.C: Likewise.
* g++.dg/cpp1z/fold-mangle.C: Likewise.
* g++.dg/cpp1z/class-deduction35.C: Likewise.
* g++.dg/cpp1z/decomp4.C: Likewise.
* g++.dg/cpp1z/class-deduction42.C: Likewise.
* g++.dg/cpp1z/init-statement8.C: Likewise.
* g++.dg/cpp1z/inline-var1a.C: Likewise.
* g++.dg/cpp1z/init-statement6.C: Likewise.
* g++.dg/cpp1z/class-deduction17.C: Likewise.
* g++.dg/cpp1z/class-deduction28.C: Likewise.
* g++.dg/cpp1z/class-deduction27.C: Likewise.
* g++.dg/cpp1z/decomp-bitfield1.C: Likewise.
* g++.dg/cpp1z/attributes-enum-1a.C: Likewise.
* g++.dg/cpp1z/class-deduction11.C: Likewise.
* g++.dg/cpp1z/constexpr-lambda12.C: Likewise.
* g++.dg/cpp1z/init-statement9.C: Likewise.
* g++.dg/cpp1z/class-deduction19.C: Likewise.
* g++.dg/cpp1z/class-deduction5.C: Likewise.
* g++.dg/cpp1z/fold2.C: Likewise.
* g++.dg/cpp1z/class-deduction33.C: Likewise.
* g++.dg/cpp1z/class-deduction24.C: Likewise.
* g++.dg/cpp1z/aggr-base1.C: Likewise.
* g++.dg/cpp1z/fold6.C: Likewise.
* g++.dg/cpp1z/decomp12.C: Likewise.
* g++.dg/cpp1z/class-deduction4.C: Likewise.
* g++.dg/cpp1z/inline-var1.C: Likewise.
* g++.dg/cpp1z/aligned-new2.C: Likewise.
* g++.dg/cpp1z/class-deduction3.C: Likewise.
* g++.dg/other/error3.C: Likewise.
* g++.dg/init/new25.C: Likewise.
* g++.dg/init/new13.C: Likewise.
* g++.dg/tls/diag-2.C: Likewise.
* g++.dg/tls/diag-4.C: Likewise.
* g++.dg/opt/noreturn-1.C: Likewise.
* g++.dg/eh/async-unwind2.C: Likewise.
* g++.dg/eh/spec9.C: Likewise.
* g++.dg/eh/spec7.C: Likewise.
* g++.dg/eh/template1.C: Likewise.
* g++.dg/eh/cond4.C: Likewise.
* g++.dg/eh/pr41819.C: Likewise.
* g++.dg/eh/delete1.C: Likewise.
* g++.dg/eh/spec3.C: Likewise.
* g++.dg/eh/forced4.C: Likewise.
* g++.dg/eh/spec2.C: Likewise.
* g++.dg/eh/shadow1.C: Likewise.
* g++.dg/eh/pr38662.C: Likewise.
* g++.dg/eh/ehopt1.C: Likewise.
* g++.dg/eh/spec8.C: Likewise.
* g++.dg/eh/init-temp2.C: Likewise.
* g++.dg/rtti/crash3.C: Likewise.
* g++.dg/warn/Wreturn-type-3.C: Likewise.
* g++.dg/warn/register-parm-1.C: Likewise.
* g++.dg/warn/register-var-2.C: Likewise.
* g++.dg/gcov/gcov-7.C: Likewise.
* g++.dg/tree-ssa/pr45605.C: Likewise.
* g++.dg/cpp/pr23827_cxx98_neg.C: Likewise.
* g++.dg/lookup/exception1.C: Likewise.
* g++.dg/ubsan/pr79589.C: Likewise.
* g++.dg/tm/pr47340.C: Likewise.
* g++.dg/tm/pr46567.C: Likewise.
* g++.dg/expr/bitfield5.C: Likewise.
* g++.dg/expr/bool1.C: Likewise.
* g++.dg/expr/lval3.C: Likewise.
* g++.dg/expr/lval4.C: Likewise.
* g++.dg/expr/bitfield4.C: Likewise.
* g++.dg/expr/bitfield6.C: Likewise.
* g++.dg/expr/bool3.C: Likewise.
* g++.dg/ext/has_nothrow_constructor.C: Likewise.
* g++.dg/ext/has_nothrow_copy-7.C: Likewise.
* g++.dg/ext/has_nothrow_copy-1.C: Likewise.
* g++.dg/ext/has_nothrow_copy-2.C: Likewise.
* g++.dg/ext/has_nothrow_copy-4.C: Likewise.
* g++.dg/ext/has_nothrow_copy-5.C: Likewise.
* g++.dg/ext/has_nothrow_copy-6.C: Likewise.
* g++.dg/ext/has_nothrow_assign.C: Likewise.
* g++.dg/parse/register1.C: Likewise.
* g++.dg/parse/error15.C: Likewise.
* g++.dg/parse/linkage2.C: Likewise.
* g++.dg/concepts/intro2.C: Likewise.
* g++.dg/concepts/class.C: Likewise.
* g++.dg/concepts/traits1.C: Likewise.
* g++.dg/concepts/req5.C: Likewise.
* g++.dg/concepts/var-concept5.C: Likewise.
* g++.dg/concepts/fn-concept2.C: Likewise.
* g++.dg/concepts/traits2.C: Likewise.
* g++.dg/concepts/placeholder2.C: Likewise.
* g++.dg/concepts/class6.C: Likewise.
* g++.dg/concepts/memtmpl1.C: Likewise.
* g++.dg/concepts/friend2.C: Likewise.
* g++.dg/concepts/template-parm3.C: Likewise.
* g++.dg/concepts/template-parm10.C: Likewise.
* g++.dg/concepts/explicit-spec1.C: Likewise.
* g++.dg/concepts/explicit-spec3.C: Likewise.
* g++.dg/concepts/var-templ2.C: Likewise.
* g++.dg/concepts/intro5.C: Likewise.
* g++.dg/concepts/deduction-constraint1.C: Likewise.
* g++.dg/concepts/iconv1.C: Likewise.
* g++.dg/concepts/constrained-parm.C: Likewise.
* g++.dg/concepts/template-template-parm1.C: Likewise.
* g++.dg/concepts/var-concept3.C: Likewise.
* g++.dg/concepts/class3.C: Likewise.
* g++.dg/concepts/memfun2.C: Likewise.
* g++.dg/concepts/req1.C: Likewise.
* g++.dg/concepts/disjunction1.C: Likewise.
* g++.dg/concepts/req17.C: Likewise.
* g++.dg/concepts/pr65848.C: Likewise.
* g++.dg/concepts/placeholder4.C: Likewise.
* g++.dg/concepts/decl-diagnose.C: Likewise.
* g++.dg/concepts/intro7.C: Likewise.
* g++.dg/concepts/pr68683.C: Likewise.
* g++.dg/concepts/partial-spec4.C: Likewise.
* g++.dg/concepts/template-parm5.C: Likewise.
* g++.dg/concepts/explicit-inst1.C: Likewise.
* g++.dg/concepts/class-deduction1.C: Likewise.
* g++.dg/concepts/class1.C: Likewise.
* g++.dg/concepts/req15.C: Likewise.
* g++.dg/concepts/memfun.C: Likewise.
* g++.dg/concepts/pr68434.C: Likewise.
* g++.dg/concepts/inherit-ctor4.C: Likewise.
* g++.dg/concepts/partial-spec6.C: Likewise.
* g++.dg/concepts/var-templ1.C: Likewise.
* g++.dg/concepts/template-parm8.C: Likewise.
* g++.dg/concepts/explicit-inst3.C: Likewise.
* g++.dg/concepts/class4.C: Likewise.
* g++.dg/concepts/req6.C: Likewise.
* g++.dg/concepts/fn8.C: Likewise.
* g++.dg/concepts/class5.C: Likewise.
* g++.dg/concepts/placeholder5.C: Likewise.
* g++.dg/concepts/req16.C: Likewise.
* g++.dg/concepts/req10.C: Likewise.
* g++.dg/concepts/var-concept2.C: Likewise.
* g++.dg/concepts/auto3.C: Likewise.
* g++.dg/concepts/generic-fn-err.C: Likewise.
* g++.dg/concepts/pr65552.C: Likewise.
* g++.dg/concepts/partial-concept-id2.C: Likewise.
* g++.dg/concepts/fn1.C: Likewise.
* g++.dg/concepts/partial-spec.C: Likewise.
* g++.dg/concepts/template-parm12.C: Likewise.
* g++.dg/concepts/diagnostic1.C: Likewise.
* g++.dg/concepts/intro1.C: Likewise.
* g++.dg/concepts/explicit-inst4.C: Likewise.
* g++.dg/concepts/req18.C: Likewise.
* g++.dg/concepts/explicit-spec5.C: Likewise.
* g++.dg/concepts/var-concept6.C: Likewise.
* g++.dg/concepts/fn9.C: Likewise.
* g++.dg/concepts/req2.C: Likewise.
* g++.dg/concepts/template-parm7.C: Likewise.
* g++.dg/concepts/req14.C: Likewise.
* g++.dg/concepts/template-parm6.C: Likewise.
* g++.dg/concepts/variadic4.C: Likewise.
* g++.dg/concepts/fn6.C: Likewise.
* g++.dg/concepts/req-neg1.C: Likewise.
* g++.dg/concepts/alias3.C: Likewise.
* g++.dg/concepts/expression2.C: Likewise.
* g++.dg/concepts/partial-spec3.C: Likewise.
* g++.dg/concepts/expression3.C: Likewise.
* g++.dg/concepts/memfun-err.C: Likewise.
* g++.dg/concepts/pr66091.C: Likewise.
* g++.dg/concepts/explicit-spec2.C: Likewise.
* g++.dg/concepts/equiv.C: Likewise.
* g++.dg/concepts/friend1.C: Likewise.
* g++.dg/concepts/fn4.C: Likewise.
* g++.dg/concepts/var-templ3.C: Likewise.
* g++.dg/concepts/explicit-inst2.C: Likewise.
* g++.dg/concepts/alias2.C: Likewise.
* g++.dg/concepts/regress/alias-decl-42.C: Likewise.
* g++.dg/concepts/placeholder6.C: Likewise.
* g++.dg/concepts/fn10.C: Likewise.
* g++.dg/concepts/req3.C: Likewise.
* g++.dg/concepts/variadic2.C: Likewise.
* g++.dg/concepts/pr65636.C: Likewise.
* g++.dg/concepts/intro6.C: Likewise.
* g++.dg/concepts/class2.C: Likewise.
* g++.dg/concepts/fn2.C: Likewise.
* g++.dg/concepts/req20.C: Likewise.
* g++.dg/concepts/req8.C: Likewise.
* g++.dg/concepts/placeholder1.C: Likewise.
* g++.dg/concepts/pr65854.C: Likewise.
* g++.dg/concepts/member-concept.C: Likewise.
* g++.dg/concepts/template-parm2.C: Likewise.
* g++.dg/concepts/variadic1.C: Likewise.
* g++.dg/concepts/fn7.C: Likewise.
* g++.dg/concepts/intro4.C: Likewise.
* g++.dg/concepts/req13.C: Likewise.
* g++.dg/concepts/inherit-ctor3.C: Likewise.
* g++.dg/concepts/explicit-spec6.C: Likewise.
* g++.dg/concepts/auto1.C: Likewise.
* g++.dg/concepts/alias1.C: Likewise.
* g++.dg/concepts/fn-concept1.C: Likewise.
* g++.dg/concepts/template-parm11.C: Likewise.
* g++.dg/concepts/explicit-spec4.C: Likewise.
* g++.dg/concepts/partial-concept-id1.C: Likewise.
* g++.dg/concepts/req9.C: Likewise.
* g++.dg/concepts/req4.C: Likewise.
* g++.dg/concepts/pr65681.C: Likewise.
* g++.dg/concepts/req7.C: Likewise.
* g++.dg/concepts/req12.C: Likewise.
* g++.dg/concepts/fn5.C: Likewise.
* g++.dg/concepts/alias4.C: Likewise.
* g++.dg/concepts/generic-fn.C: Likewise.
* g++.dg/concepts/feature-macro.C: Likewise.
* g++.dg/concepts/req19.C: Likewise.
* g++.dg/concepts/placeholder3.C: Likewise.
* g++.dg/concepts/intro3.C: Likewise.
* g++.dg/concepts/partial-spec5.C: Likewise.
* g++.dg/concepts/template-parm4.C: Likewise.
* g++.dg/concepts/dr1430.C: Likewise.
* g++.dg/concepts/pr65634.C: Likewise.
* g++.dg/concepts/var-concept4.C: Likewise.
* g++.dg/concepts/pr67249.C: Likewise.
* g++.dg/concepts/expression.C: Likewise.
* g++.dg/concepts/pr65575.C: Likewise.
* g++.dg/concepts/partial-spec2.C: Likewise.
* g++.dg/concepts/template-parm9.C: Likewise.
* g++.dg/concepts/inherit-ctor1.C: Likewise.
* g++.dg/concepts/equiv2.C: Likewise.
* g++.dg/concepts/req11.C: Likewise.
* g++.dg/concepts/template-parm1.C: Likewise.
* g++.dg/concepts/inherit-ctor2.C: Likewise.
* g++.dg/concepts/var-concept1.C: Likewise.
* g++.dg/concepts/fn3.C: Likewise.
* g++.dg/torture/pr46364.C: Likewise.
* g++.dg/torture/stackalign/eh-alloca-1.C: Likewise.
* g++.dg/torture/stackalign/eh-fastcall-1.C: Likewise.
* g++.dg/torture/stackalign/eh-vararg-1.C: Likewise.
* g++.dg/torture/stackalign/eh-vararg-2.C: Likewise.
* g++.dg/torture/stackalign/eh-global-1.C: Likewise.
* g++.dg/torture/stackalign/eh-thiscall-1.C: Likewise.
* g++.dg/torture/stackalign/eh-inline-2.C: Likewise.
* g++.dg/torture/stackalign/eh-inline-1.C: Likewise.
* g++.dg/torture/pr52918-1.C: Likewise.
* g++.dg/torture/pr49394.C: Likewise.
* g++.dg/torture/pr57190.C: Likewise.
* g++.dg/cpp0x/static_assert8.C: Likewise.
* g++.dg/cpp0x/noexcept19.C: Likewise.
* g++.dg/cpp0x/variadic-throw.C: Likewise.
* g++.dg/cpp0x/variadic73.C: Likewise.
* g++.dg/cpp0x/noexcept02.C: Likewise.
* g++.dg/cpp0x/defaulted23.C: Likewise.
* g++.dg/cpp0x/noexcept08.C: Likewise.
* g++.dg/cpp0x/auto9.C: Likewise.
* g++.dg/cpp0x/lambda/lambda-eh2.C: Likewise.
* g++.dg/cpp0x/error5.C: Likewise.
* c-c++-common/gomp/atomic-12.c: Likewise.
* c-c++-common/gomp/atomic-13.c: Likewise.
* c-c++-common/gomp/atomic-14.c: Likewise.
* c-c++-common/Wvarargs-2.c: Likewise.
* c-c++-common/Wvarargs.c: Likewise.
* c-c++-common/vector-subscript-2.c: Likewise.
* g++.old-deja/g++.robertl/eb123.C: Likewise.
* g++.old-deja/g++.eh/tmpl3.C: Likewise.
* g++.old-deja/g++.eh/cleanup2.C: Likewise.
* g++.old-deja/g++.eh/badalloc1.C: Likewise.
* g++.old-deja/g++.eh/throw2.C: Likewise.
* g++.old-deja/g++.eh/throw1.C: Likewise.
* g++.old-deja/g++.eh/tmpl1.C: Likewise.
* g++.old-deja/g++.other/new7.C: Likewise.
* g++.old-deja/g++.other/crash30.C: Likewise.
* g++.old-deja/g++.other/regstack.C: Likewise.
* g++.old-deja/g++.other/crash28.C: Likewise.
* g++.old-deja/g++.jason/bool5.C: Likewise.
* g++.old-deja/g++.mike/p10416.C: Likewise.
* g++.old-deja/g++.mike/eh25.C: Likewise.
* g++.old-deja/g++.mike/eh55.C: Likewise.
libcpp/
* 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.
libstdc++-v3/
* testsuite/libstdc++-prettyprinters/cxx17.cc: Use -std=c++17 or
-std=gnu++17 instead of -std=c++1z or -std=gnu++1z. Use c++17 instead
of c++1z and c++17_only instead of c++1z_only. Adjust expected
diagnostics and comments refering to 1z to 17.
* testsuite/30_threads/lock_guard/cons/deduction.cc: Likewise.
* testsuite/30_threads/scoped_lock/cons/deduction.cc: Likewise.
* testsuite/30_threads/scoped_lock/cons/1.cc: Likewise.
* testsuite/30_threads/scoped_lock/requirements/typedefs.cc: Likewise.
* testsuite/30_threads/scoped_lock/requirements/explicit_instantiation.cc:
Likewise.
* testsuite/30_threads/unique_lock/cons/deduction.cc: Likewise.
* testsuite/18_support/launder/1.cc (test02): Likewise.
* testsuite/18_support/launder/requirements_neg.cc: Likewise.
* testsuite/18_support/launder/requirements.cc: Likewise.
* testsuite/18_support/byte/requirements.cc: Likewise.
* testsuite/18_support/byte/ops.cc: Likewise.
* testsuite/18_support/byte/global_neg.cc: Likewise.
* testsuite/18_support/uncaught_exceptions/uncaught_exceptions.cc:
Likewise.
* testsuite/27_io/types/4.cc: Likewise.
* testsuite/25_algorithms/sample/81221.cc: Likewise.
* testsuite/25_algorithms/sample/1.cc: Likewise.
* testsuite/25_algorithms/sample/2.cc: Likewise.
* testsuite/25_algorithms/search/searcher.cc: Likewise.
* testsuite/28_regex/basic_regex/ctors/deduction.cc: Likewise.
* testsuite/experimental/filesystem/path/construct/string_view.cc:
Likewise.
* testsuite/24_iterators/range_access_cpp17.cc: Likewise.
* testsuite/24_iterators/container_access.cc: Likewise.
* testsuite/ext/pb_ds/regression/hash_map_rand.cc: Likewise.
* testsuite/ext/pb_ds/regression/trie_set_rand.cc: Likewise.
* testsuite/ext/pb_ds/regression/hash_set_rand.cc: Likewise.
* testsuite/ext/pb_ds/regression/list_update_set_rand.cc: Likewise.
* testsuite/ext/pb_ds/regression/list_update_map_rand.cc: Likewise.
* testsuite/ext/pb_ds/regression/priority_queue_rand.cc: Likewise.
* testsuite/ext/pb_ds/regression/tree_set_rand.cc: Likewise.
* testsuite/ext/pb_ds/regression/tree_map_rand.cc: Likewise.
* testsuite/ext/pb_ds/regression/trie_map_rand.cc: Likewise.
* testsuite/20_util/shared_ptr/casts/reinterpret.cc: Likewise.
* testsuite/20_util/shared_ptr/cons/deduction.cc: Likewise.
* testsuite/20_util/shared_ptr/cons/array.cc: Likewise.
* testsuite/20_util/shared_ptr/observers/array.cc (struct A): Likewise.
* testsuite/20_util/pair/cons/deduction.cc: Likewise.
* testsuite/20_util/variant/deduction.cc: Likewise.
* testsuite/20_util/tuple/78939.cc: Likewise.
* testsuite/20_util/tuple/cons/deduction.cc: Likewise.
* testsuite/20_util/void_t/1.cc: Likewise.
* testsuite/20_util/duration/arithmetic/constexpr_c++17.cc: Likewise.
* testsuite/20_util/unique_ptr/cons/deduction_neg.cc: Likewise.
* testsuite/20_util/addressof/requirements/constexpr.cc: Likewise.
* testsuite/20_util/weak_ptr/cons/deduction.cc: Likewise.
* testsuite/20_util/has_unique_object_representations/requirements/typedefs.cc:
Likewise.
* testsuite/20_util/has_unique_object_representations/requirements/explicit_instantiation.cc:
Likewise.
* testsuite/20_util/has_unique_object_representations/value.cc:
Likewise.
* testsuite/20_util/time_point/arithmetic/constexpr.cc: Likewise.
* testsuite/20_util/function_objects/invoke/59768.cc: Likewise.
* testsuite/20_util/function_objects/mem_fn/80478.cc: Likewise.
* testsuite/20_util/function/cons/deduction.cc: Likewise.
* testsuite/20_util/specialized_algorithms/memory_management_tools/destroy_neg.cc:
Likewise.
* testsuite/20_util/is_aggregate/requirements/typedefs.cc: Likewise.
* testsuite/20_util/is_aggregate/requirements/explicit_instantiation.cc:
Likewise.
* testsuite/20_util/is_aggregate/value.cc: Likewise.
* testsuite/26_numerics/lcm/1.cc: Likewise.
* testsuite/26_numerics/lcm/lcm_neg.cc: Likewise.
* testsuite/26_numerics/gcd/1.cc: Likewise.
* testsuite/26_numerics/gcd/gcd_neg.cc: Likewise.
* testsuite/26_numerics/valarray/deduction.cc: Likewise.
* testsuite/26_numerics/headers/cmath/types_std_c++0x_neg.cc: Likewise.
* testsuite/26_numerics/headers/cmath/hypot.cc: Likewise.
* testsuite/23_containers/queue/members/emplace_cxx17_return.cc:
Likewise.
* testsuite/23_containers/array/cons/deduction.cc: Likewise.
* testsuite/23_containers/array/cons/deduction_neg.cc: Likewise.
* testsuite/23_containers/deque/modifiers/emplace/cxx17_return.cc:
Likewise.
* testsuite/23_containers/deque/cons/deduction.cc: Likewise.
* testsuite/23_containers/stack/members/emplace_cxx17_return.cc:
Likewise.
* testsuite/23_containers/list/modifiers/emplace/cxx17_return.cc:
Likewise.
* testsuite/23_containers/list/cons/deduction.cc: Likewise.
* testsuite/23_containers/forward_list/modifiers/emplace_cxx17_return.cc:
Likewise.
* testsuite/23_containers/forward_list/cons/deduction.cc: Likewise.
* testsuite/23_containers/unordered_set/allocator/ext_ptr.cc: Likewise.
* testsuite/23_containers/vector/modifiers/emplace/cxx17_return.cc:
Likewise.
* testsuite/23_containers/vector/cons/deduction.cc: Likewise.
* testsuite/23_containers/vector/bool/emplace_cxx17_return.cc:
Likewise.
* testsuite/21_strings/basic_string/cons/char/9.cc: Likewise.
* testsuite/21_strings/basic_string/cons/char/deduction.cc: Likewise.
* testsuite/21_strings/basic_string/cons/char/79162.cc: Likewise.
* testsuite/21_strings/basic_string/cons/wchar_t/9.cc: Likewise.
* testsuite/21_strings/basic_string/cons/wchar_t/deduction.cc:
Likewise.
* testsuite/21_strings/basic_string/cons/wchar_t/79162.cc: Likewise.
* testsuite/21_strings/basic_string_view/modifiers/swap/char/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/modifiers/swap/wchar_t/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/compare/char/2.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/compare/char/70483.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/compare/wchar_t/2.cc:
Likewise.
* testsuite/21_strings/char_traits/requirements/constexpr_functions_c++17.cc:
Likewise.
From-SVN: r252826
2017-09-15 18:15:46 +02:00
|
|
|
|
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 20:49:09 +02:00
|
|
|
|
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 16:17:24 +02:00
|
|
|
|
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 12:59:12 +02:00
|
|
|
|
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 12:40:38 +02:00
|
|
|
|
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 22:57:38 +02:00
|
|
|
|
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 22:53:06 +02:00
|
|
|
|
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 21:03:56 +02:00
|
|
|
|
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.
|
|
|
|
|
|
Eliminate fixit_hint class hierarchy
The original implementation of fix-it hints (r230674) had an abstract
base class "fixit_hint" and three subclasses, representing
each of insertions, replacements, and deletions.
Having multiple classes for fix-it hints was a nuisance, as it required
per-class logic everywhere that the hints were handled.
In r239632 I eliminated the deletion subclass in favor of replacement
with the empty string (two subclasses are easier than three).
This patch eliminates the class hierarchy altogether by implementing
insertion in terms of replacement, by representing replacements via
a half-open interval (so that for an insertion, start == next location,
and we're effectively replacing an empty range at the insertion point
with the new string).
This greatly simplifies the code for handling fix-it hints; for example
it allows removal of a parallel class hierarchy of line_event within
edit-context.c.
It also improves consolidation of hints: we can now consolidate
insertions at the same location, affecting a couple of tests
(selftest::test_one_liner_many_fixits and
gcc.dg/Wmissing-braces-fixits.c).
gcc/ChangeLog:
* diagnostic-show-locus.c (layout::get_expanded_location): Rewrite
to use new fixit_hint representation, using the "replace" logic.
(get_line_span_for_fixit_hint): Likewise.
(layout::print_any_fixits): Likewise.
(selftest::test_one_liner_many_fixits): Rename to...
(selftest::test_one_liner_many_fixits_1): ...this, and update
comment and expected output to reflect that the multiple fix-it
hints are now consolidated into one insertion.
(selftest::test_one_liner_many_fixits_2): New test.
(selftest::test_diagnostic_show_locus_one_liner): Update for
above.
(selftest::test_fixit_consolidation): Update for fix-it API
change.
* diagnostic.c (print_parseable_fixits): Likewise.
* edit-context.c (edited_line::m_line_events): Convert from
auto_vec <line_event *> to auto_vec <line_event>.
(class line_event): Convert from abstract base class to a concrete
class, taking over the role of replace_event.
(class insert_event): Delete.
(class replace_event): Rename to class line_event. Convert to
half-open range.
(edit_context::add_fixits): Reimplement.
(edit_context::apply_insert): Delete.
(edit_context::apply_replace): Rename to...
(edit_context::apply_fixit): ...this. Convert to half-open range.
(edited_file::apply_insert): Delete.
(edited_file::apply_replace): Rename to...
(edited_file::apply_fixit): ...this.
(edited_line::~edited_line): Drop deletion of events.
(edited_line::apply_insert): Delete.
(edited_line::apply_replace): Rename to...
(edited_line::apply_fixit): ...this. Convert to half-open range.
Update for change to type of m_line_events.
* edit-context.h (edit_context::apply_insert): Delete.
(edit_context::apply_replace): Rename to...
(edit_context::apply_fixit): ...this.
gcc/testsuite/ChangeLog:
* gcc.dg/Wmissing-braces-fixits.c: Update expected output to
reflect insertion fix-it hints at the same location now being
consolidated.
libcpp/ChangeLog:
* 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.
From-SVN: r247445
2017-05-01 21:15:36 +02:00
|
|
|
|
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-04 00:30:56 +02:00
|
|
|
|
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 12:10:17 +01:00
|
|
|
|
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 22:16:39 +01:00
|
|
|
|
2017-03-16 Jason Merrill <jason@redhat.com>
|
|
|
|
|
|
|
|
|
|
* init.c (cpp_init_builtins): Update __cplusplus for C++17.
|
|
|
|
|
|
2017-02-09 09:55:46 +01:00
|
|
|
|
2017-02-09 Gerald Pfeifer <gerald@pfeifer.com>
|
|
|
|
|
|
|
|
|
|
* Makefile.in (po/$(PACKAGE).pot): Adjust bug reporting URL.
|
|
|
|
|
|
Fix issues with unrepresentable column numbers (PR c++/77949)
PR c++/77949 identifies an ICE when the C++ frontend attempts to emit a
fix-it hint inserting a missing semicolon at column 4097 of a source file.
This column value exceeds LINE_MAP_MAX_COLUMN_NUMBER and hence isn't
representable using a location_t.
Attempting to do so leads to these problems, which this patch fixes:
(a) when encountering a column number > LINE_MAP_MAX_COLUMN_NUMBER we
create a new linemap with m_column_and_range_bits == 0, but
linemap_position_for_column doesn't check for this, and hence can emit
a bogus location_t value that's calculated relative to the previous
linemap start, but which will be decoded relative to the new linemap,
leading to very large incorrect line values.
(b) when encountering a column number that can't be represented, and
for which the linemap was pre-existing, the code would hit this assertion:
if (linemap_assert_fails (column < (1u << map->m_column_and_range_bits)))
around a bail-out condition. The patch replaces this assertion with a
simple conditional, to stop the ICE when this occurs, and fixes the
bit count (effective column bits, vs column+range bits)
(c) the C++ frontend wasn't checking for failure of
linemap_position_for_loc_and_offset when considering emitting the fix-it
hint. The patch adds a conditional, so that no fix-it hint is emitted
if the location is bogus.
gcc/cp/ChangeLog:
PR c++/77949
* parser.c (cp_parser_class_specifier_1): Only suggest inserting
a missing semicolon if we have a valid insertion location for
the fix-it hint.
gcc/ChangeLog:
PR c++/77949
* input.c (selftest::test_accessing_ordinary_linemaps): Verify
that we correctly handle column numbers greater than
LINE_MAP_MAX_COLUMN_NUMBER.
gcc/testsuite/ChangeLog:
PR c++/77949
* g++.dg/diagnostic/pr77949.C: New test case.
libcpp/ChangeLog:
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.
From-SVN: r244292
2017-01-10 22:54:09 +01:00
|
|
|
|
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.
|
|
|
|
|
|
Fix linemap corruption after very wide source lines (PR c++/72803)
PR c++/72803 describes an issue where a fix-it hint is to be emitted at
column 512 of a 511-column source line, leading to an ICE.
The root cause is a bug in linemap_line_start, when transitioning from
lines >= 512 in width to narrow lines.
The wide line in the reproducer has a line map with:
m_column_and_range_bits = 15, m_range_bits = 5
giving 10 effective bits for representing columns, so that columns <= 1023
can be represented.
When parsing the following line,
linemap_line_start (..., ..., max_column_hint=0);
is called. This leads to the "add_map" logic, due to this condition:
|| (max_column_hint <= 80 && effective_column_bits >= 10)
i.e. the new line is sufficiently narrower than the old one to
potentially use a new linemap (so as to conserve values within the
location_t space).
It then attempts to avoid allocating a new line map. Part of the logic
to determine if we really need a new line map is this condition:
SOURCE_COLUMN (map, highest) >= (1U << column_bits)
The above condition is incorrect: we need to determine if the highest
column we've handed out will fit within the proposed *effective* column
bits, but "column_bits" here is the column plus the range bits, rather
than just the column bits.
Hence in this case linemap_line_start erroneously decides that we don't
need a new line map, and updates the column bits within the existing
line map, so any location_t values we've already handed out within it
that are offset from the start by
>= (1<<new_column_and_range_bits)
effectively change meaning, leading to incorrect line&column information
when decoding them, and various "interesting" ways for the linemap
code to fail.
The fix is to use the effective column bits in the above conditional.
gcc/ChangeLog:
PR c++/72803
* input.c (selftest::test_accessing_ordinary_linemaps): Verify
that the transition from a max line width >= 1<<10 to narrower
lines works correctly.
gcc/testsuite/ChangeLog:
PR c++/72803
* g++.dg/diagnostic/pr72803.C: New test case.
libcpp/ChangeLog:
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.
From-SVN: r244199
2017-01-07 22:33:59 +01:00
|
|
|
|
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 13:07:43 +01:00
|
|
|
|
2017-01-01 Jakub Jelinek <jakub@redhat.com>
|
|
|
|
|
|
|
|
|
|
Update copyright years.
|
|
|
|
|
|
2016-12-15 19:05:05 +01:00
|
|
|
|
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.
|
|
|
|
|
|
re PR preprocessor/78680 (ICE in get_substring_ranges_for_loc, at input.c:1398)
Fix for PR preprocessor/78680
PR preprocessor/78680 identifies a crash when attempting to issue
a -Wformat warning, where the format string includes a string token
split across multiple physical source lines via backslash-continued
lines.
The issue is that libcpp is generating bogus range information for
such tokens.
For example, in:
void fn1() {
__builtin_printf("\
%ld.\n\
2\n"); };
the range of the string token is printed as:
__builtin_printf("\
^~
whereas the range ought to be:
__builtin_printf("\
^~
%ld.\n\
~~~~~~~
2\n"); };
~~~~
The root cause is that the line notes expressing the update
of the buffer in lex.c aren't yet updated when the end-point of
the token is computed
3095 tok_range.m_finish
3096 = linemap_position_for_column (pfile->line_table,
3097 CPP_BUF_COLUMN (buffer, buffer->cur));
so that the physical line is still regarded as that of the start
of the token, and, where CPP_BUF_COLUMN uses (BUF)->line_base,
line_base is still the location of the first physical line in the
and hence the column information is too large (as if it were the
offset in the *logical* line).
(the printed range is somewhat misleading; the actual buggy range
extends beyond the "\ in the line, but within diagnostic-show-locus.c
layout::print_annotation_line only prints up to the xbound set by
layout::print_source_line and so truncates most of the buggy range).
The fix is to ensure that line notes are handled before calculating
the end-point of the token range.
This leads to the range for the string token being correctly
computed, as:
__builtin_printf("\
^~
%ld.\n\
~~~~~~~
2\n"); };
~~~~
and this leads to get_substring_ranges_for_loc failing gracefully,
rather than crashing.
gcc/testsuite/ChangeLog:
PR preprocessor/78680
* gcc.dg/format/pr78680.c: New test case.
* gcc.dg/plugin/diagnostic-test-expressions-1.c
(test_multiline_token): New function.
* gcc.dg/plugin/diagnostic-test-string-literals-1.c
(test_backslash_continued_logical_lines): New function.
libcpp/ChangeLog:
PR preprocessor/78680
* lex.c (_cpp_lex_direct): Ensure line notes are processed before
computing the end-point of the token.
From-SVN: r243567
2016-12-12 18:37:48 +01:00
|
|
|
|
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 11:06:07 +01:00
|
|
|
|
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 16:55:26 +01:00
|
|
|
|
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 21:10:27 +01:00
|
|
|
|
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 14:29:32 +01:00
|
|
|
|
2016-11-08 Richard Earnshaw <rearnsha@arm.com>
|
|
|
|
|
|
|
|
|
|
* lex.c (search_line_fast): New implementation for AArch64.
|
|
|
|
|
|
2016-10-25 21:24:01 +02:00
|
|
|
|
2016-10-25 David Malcolm <dmalcolm@redhat.com>
|
|
|
|
|
|
|
|
|
|
* files.c (destroy_cpp_file): Free file->path.
|
|
|
|
|
|
Implement ~line_maps ()
line_maps instances such as the global line_table are
GC-managed, but the htab within location_adhoc_data_map.htab
is not GC-managed.
Previously this was deleted manually by a call to
location_adhoc_data_fini within toplev::main.
However, on adding a call to forcibly_ggc_collect after the
selftests, all of the htabs for the various line_tables
created during the selftests start showing up as leaks
in "make selftest-valgrind", e.g.:
13,536 (1,344 direct, 12,192 indirect) bytes in 12 blocks are definitely lost in loss record 1,065 of 1,086
at 0x4A081D4: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x16DB3B0: xcalloc (xmalloc.c:163)
by 0x16D8D34: htab_create_typed_alloc (hashtab.c:358)
by 0x16D8DBD: htab_create_alloc (hashtab.c:286)
by 0x16A2CCC: linemap_init(line_maps*, unsigned int) (line-map.c:353)
by 0x1685605: selftest::line_table_test::line_table_test(selftest::line_table_case const&) (input.c:1624)
by 0x167D09C: selftest::test_applying_fixits_modernize_named_init(selftest::line_table_case const&) (edit-context.c:1430)
by 0x1686827: selftest::for_each_line_table_case(void (*)(selftest::line_table_case const&)) (input.c:3227)
by 0x167F067: selftest::edit_context_c_tests() (edit-context.c:1658)
by 0x1616E67: selftest::run_tests() (selftest-run-tests.c:71)
by 0xC0DB25: toplev::run_self_tests() (toplev.c:2076)
by 0x618EB4: toplev::main(int, char**) (toplev.c:2153)
This patch removes the manual one-time cleanup in favor of
adding a destructor to class line_maps, which cleans up
the non-GC-managed htab.
Doing so improves "make selftest-valgrind" from:
==61118== LEAK SUMMARY:
==61118== definitely lost: 121,248 bytes in 1,515 blocks
==61118== indirectly lost: 974,344 bytes in 959 blocks
==61118== possibly lost: 0 bytes in 0 blocks
==61118== still reachable: 1,332,599 bytes in 3,684 blocks
==61118== suppressed: 0 bytes in 0 blocks
to:
==57182== LEAK SUMMARY:
==57182== definitely lost: 13,840 bytes in 556 blocks
==57182== indirectly lost: 0 bytes in 0 blocks
==57182== possibly lost: 0 bytes in 0 blocks
==57182== still reachable: 1,355,703 bytes in 3,684 blocks
==57182== suppressed: 0 bytes in 0 blocks
gcc/ChangeLog:
* toplev.c (toplev::main): Remove call to
location_adhoc_data_fini.
libcpp/ChangeLog:
* 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.
From-SVN: r241533
2016-10-25 20:10:44 +02:00
|
|
|
|
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 17:52:25 +02:00
|
|
|
|
2016-10-21 Andris Pavenis <andris.pavenis@iki.fi>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/71681
|
|
|
|
|
* files.c (remap_filename): Fix handling -remap in subdirectories.
|
|
|
|
|
|
2016-10-12 01:19:06 +02:00
|
|
|
|
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 12:48:54 +02:00
|
|
|
|
2016-10-08 Jakub Jelinek <jakub@redhat.com>
|
|
|
|
|
|
2016-10-08 12:54:27 +02:00
|
|
|
|
* lex.c (fallthrough_comment_p): Accept Else, fallthrough.
|
|
|
|
|
|
2016-10-08 12:53:05 +02:00
|
|
|
|
* lex.c (fallthrough_comment_p): Extend to handle more common FALLTHRU
|
|
|
|
|
comment styles.
|
|
|
|
|
|
2016-10-08 12:48:54 +02:00
|
|
|
|
* 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-05 14:36:48 +02:00
|
|
|
|
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 11:42:50 +02:00
|
|
|
|
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 16:14:52 +02:00
|
|
|
|
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 21:59:29 +02:00
|
|
|
|
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-16 01:57:01 +02:00
|
|
|
|
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 18:08:59 +02:00
|
|
|
|
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 20:00:57 +02:00
|
|
|
|
2016-09-02 David Malcolm <dmalcolm@redhat.com>
|
|
|
|
|
|
|
|
|
|
* include/line-map.h (rich_location::seen_impossible_fixit_p): New
|
|
|
|
|
accessor.
|
|
|
|
|
|
2016-08-31 20:54:55 +02:00
|
|
|
|
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.
|
|
|
|
|
|
Remove arbitrary limits from rich_location
This patch eliminates the hard-coded limits within rich_location
(up to 3 ranges, up to 2 fixits). The common case is still
handled by embedding the values inside rich_location - it only
uses dynamic allocation if these limits are exceeded, so
creation of rich_location instances on the stack should still
be fast. This is implemented via a new container class,
semi_embedded_vec <T, N>.
gcc/ChangeLog:
* diagnostic-show-locus.c (colorizer::begin_state): Support more
than 3 ranges per diagnostic by alternating between color 1 and
color 2.
(layout::layout): Replace use of rich_location::MAX_RANGES
with richloc->get_num_locations ().
(layout::calculate_line_spans): Replace use of
rich_location::MAX_RANGES with m_layout_ranges.length ().
(layout::print_annotation_line): Handle arbitrary numbers of
ranges in caret-printing by defaulting to '^'.
(selftest::test_one_liner_many_fixits): New function.
(test_diagnostic_show_locus_one_liner): Call it.
* diagnostic.c (diagnostic_initialize): Update for renaming
of rich_location::MAX_RANGES to
rich_location::STATICALLY_ALLOCATED_RANGES.
* diagnostic.h (struct diagnostic_context): Likewise.
gcc/testsuite/ChangeLog:
* gcc.dg/plugin/diagnostic-test-show-locus-bw.c
(test_many_nested_locations): New function.
* gcc.dg/plugin/diagnostic_plugin_test_show_locus.c
(test_show_locus): Handle "test_many_nested_locations".
libcpp/ChangeLog:
* 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.
From-SVN: r239879
2016-08-31 02:35:01 +02:00
|
|
|
|
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.
|
|
|
|
|
|
rich_location: add convenience overloads for adding fix-it hints
Adding a fix-it hint to a diagnostic usually follows one of these
patterns:
(a) an insertion fix-its, with the insertion at the primary caret location
(b) a removals/replacements, affecting the range of the primary location
(other cases are possible, e.g. multiple fix-its, and affecting other
locations, but these are the common ones)
Given these common cases, this patch adds overloads of the rich_location
methods for adding fix-it hints, so that the location information can
be omitted if it matches that of the primary location within the
rich_location.
Similarly when adding "remove" and "replace" fix-it hints to a diagnostic,
it's tedious to have to extract the source_range from a location_t
(aka source_location). To make this more convenient, this patch
adds overload of the rich_location::add_fixit_remove/replace methods,
accepting a source_location directly.
The patch updates the various in-tree users of fix-it hints to use
the new simpler API where appropriate. I didn't touch the case where
there are multiple fix-its in one rich_location, as it seems better to
be more explicit about locations for this case (adding a pair of parens
in warn_logical_not_parentheses).
The above makes the gcc_rich_location::add_fixit_misspelled_id overload
taking a const char * rather redundant, so I eliminated it.
gcc/c/ChangeLog:
* c-decl.c (implicit_decl_warning): Use add_fixit_replace
rather than add_fixit_misspelled_id.
(undeclared_variable): Likewise.
* c-parser.c (c_parser_declaration_or_fndef): Likewise. Remove
now-redundant "here" params from add_fixit_insert method calls.
(c_parser_parameter_declaration): Likewise.
* c-typeck.c (build_component_ref): Remove now-redundant range
param from add_fixit_replace method calls.
gcc/cp/ChangeLog:
* name-lookup.c (suggest_alternatives_for): Use add_fixit_replace
rather than add_fixit_misspelled_id.
* parser.c (cp_parser_diagnose_invalid_type_name): Likewise.
gcc/ChangeLog:
* diagnostic-show-locus.c (test_one_liner_fixit_insert): Remove
redundant location param.
(test_one_liner_fixit_remove): Likewise.
(test_one_liner_fixit_replace): Likewise.
(test_one_liner_fixit_replace_equal_secondary_range): Likewise.
* gcc-rich-location.c
(gcc_rich_location::add_fixit_misspelled_id): Eliminate call to
get_range_from_loc. Drop overload taking a const char *.
* gcc-rich-location.h
(gcc_rich_location::add_fixit_misspelled_id): Drop overload taking
a const char *.
libcpp/ChangeLog:
* 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.
From-SVN: r239861
2016-08-30 15:54:48 +02:00
|
|
|
|
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-29 22:42:57 +02:00
|
|
|
|
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.
|
|
|
|
|
|
Add validation and consolidation of fix-it hints
The first aspect of this patch is to add some checking of fix-it hints.
The idea is to put this checking within the rich_location machinery,
rather than requiring every diagnostic to implement it for itself.
The fixits within a rich_location are "atomic": all must be valid for
any to be applicable.
We reject any fixits involving locations above
LINE_MAP_MAX_LOCATION_WITH_COLS.
There's no guarantee that it's sane to modify a macro, so we reject
any fix-its that touch them.
For example, note the attempt to provide a fix-it for the definition
of the macro FIELD:
spellcheck-fields-2.c: In function ‘test_macro’:
spellcheck-fields-2.c:26:15: error: ‘union u’ has no member named ‘colour’; did you mean ‘color’?
#define FIELD colour
^
color
spellcheck-fields-2.c:27:15: note: in expansion of macro ‘FIELD’
return ptr->FIELD;
^~~~~
After this patch, the fixit is not displayed:
spellcheck-fields-2.c: In function ‘test_macro’:
spellcheck-fields-2.c:26:15: error: ‘union u’ has no member named ‘colour’; did you mean ‘color’?
#define FIELD colour
^
spellcheck-fields-2.c:27:15: note: in expansion of macro ‘FIELD’
return ptr->FIELD;
^~~~~
We might want some way for a diagnostic to opt-in to fix-its that
affect macros, but for now it's simplest to reject them.
The other aspect of this patch is fix-it consolidation: in some cases
neighboring fix-its can be merged. For example, in a diagnostic to
modernize old-style struct initializers from:
struct s example = {
- foo: 1,
+ .foo = 1,
};
one approach would be to replace the "foo" with ".foo" and the ":"
with " =". This would give two "replace" fix-its:
foo: 1,
--- FIXIT 1
.foo
- FIXIT 2
=
This patch allows them to be consolidated into a single "replace" fix-it:
foo: 1,
----
.foo =
gcc/ChangeLog:
* diagnostic-show-locus.c
(selftest::test_fixit_consolidation): New function.
(selftest::diagnostic_show_locus_c_tests): Call it.
* gcc-rich-location.h (gcc_rich_location): Eliminate unused
constructor based on source_range.
gcc/testsuite/ChangeLog:
* gcc.dg/spellcheck-fields-2.c (test): Move
dg-begin/end-multiline-output within function body.
(test_macro): New function.
libcpp/ChangeLog:
* 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.
From-SVN: r239789
2016-08-26 23:25:41 +02:00
|
|
|
|
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 22:20:48 +02:00
|
|
|
|
2016-08-23 David Malcolm <dmalcolm@redhat.com>
|
|
|
|
|
|
|
|
|
|
* include/line-map.h (source_range::from_locations): New method.
|
|
|
|
|
|
2016-08-19 23:18:05 +02:00
|
|
|
|
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.
|
|
|
|
|
|
Implement C _FloatN, _FloatNx types.
ISO/IEC TS 18661-3:2015 defines C bindings to IEEE interchange and
extended types, in the form of _FloatN and _FloatNx type names with
corresponding fN/FN and fNx/FNx constant suffixes and FLTN_* / FLTNX_*
<float.h> macros. This patch implements support for this feature in
GCC.
The _FloatN types, for N = 16, 32, 64 or >= 128 and a multiple of 32,
are types encoded according to the corresponding IEEE interchange
format (endianness unspecified; may use either the NaN conventions
recommended in IEEE 754-2008, or the MIPS NaN conventions, since the
choice of convention is only an IEEE recommendation, not a
requirement). The _FloatNx types, for N = 32, 64 and 128, are IEEE
"extended" types: types extending a narrower format with range and
precision at least as big as those specified in IEEE 754 for each
extended type (and with unspecified representation, but still
following IEEE semantics for their values and operations - and with
the set of values being determined by the precision and the maximum
exponent, which means that while Intel "extended" is suitable for
_Float64x, m68k "extended" is not). These types are always distinct
from and not compatible with each other and the standard floating
types float, double, long double; thus, double, _Float64 and _Float32x
may all have the same ABI, but they are three still distinct types.
The type names may be used with _Complex to construct corresponding
complex types (unlike __float128, which acts more like a typedef name
than a keyword - thus, this patch may be considered to fix PR
c/32187). The new suffixes can be combined with GNU "i" and "j"
suffixes for constants of complex types (e.g. 1.0if128, 2.0f64i).
The set of types supported is implementation-defined. In this GCC
patch, _Float32 is SFmode if that is suitable; _Float32x and _Float64
are DFmode if that is suitable; _Float128 is TFmode if that is
suitable; _Float64x is XFmode if that is suitable, and otherwise
TFmode if that is suitable. There is a target hook to override the
choices if necessary. "Suitable" means both conforming to the
requirements of that type, and supported as a scalar type including in
libgcc. The ABI is whatever the back end does for scalars of that
mode (but note that _Float32 is passed without promotion in variable
arguments, unlike float). All the existing issues with exceptions and
rounding modes for existing types apply equally to the new type names.
No GCC port supports a floating-point format suitable for _Float128x.
Although there is HFmode support for ARM and AArch64, use of that for
_Float16 is not enabled. Supporting _Float16 would require additional
work on the excess precision aspects of TS 18661-3: there are new
values of FLT_EVAL_METHOD, which are not currently supported in GCC,
and FLT_EVAL_METHOD == 0 now means that operations and constants on
types narrower than float are evaluated to the range and precision of
float. Implementing that, so that _Float16 gets evaluated with excess
range and precision, would involve changes to the excess precision
infrastructure so that the _Float16 case is enabled by default, unlike
the x87 case which is only enabled for -fexcess-precision=standard.
Other differences between _Float16 and __fp16 would also need to be
disentangled.
GCC has some prior support for nonstandard floating-point types in the
form of __float80 and __float128. Where these were previously types
distinct from long double, they are made by this patch into aliases
for _Float64x / _Float128 if those types have the required properties.
In principle the set of possible _FloatN types is infinite. This
patch hardcodes the four such types for N <= 128, but with as much
code as possible using loops over types to minimize the number of
places with such hardcoding. I don't think it's likely any further
such types will be of use in future (or indeed that formats suitable
for _Float128x will actually be implemented). There is a corner case
that all _FloatN, for N >= 128 and a multiple of 32, should be treated
as keywords even when the corresponding type is not supported; I
intend to deal with that in a followup patch.
Tests are added for various functionality of the new types, mostly
using type-generic headers. The tests use dg-add-options to pass any
extra options needed to enable the types; this is wired up to use the
same options as for __float128 on powerpc to enable _Float128 and
_Float64x, and effective-target keywords for runtime support do the
same hardware test as for __float128 to make sure the VSX instructions
generated by those options are supported. (Corresponding additions
would be needed for _Float16 on ARM as well if that were enabled with
-mfp16-format=ieee required to use it rather than unconditionally
available. Of course, -mfp16-format=alternative enables use of a
format which is not compatible with the requirements of the _Float16
type.)
C++ note: no support for the new types or constant suffixes is added
for C++. C++ decimal floating-point support was very different from
the C support, using class types, and the same may well apply to any
future C++ bindings for IEEE interchange and extended types. There is
a case, however, for supporting at least *f128 constants in C++, so
that code using __float128 can use the newer style for constants
throughout rather than needing to use the older *q constants in C++.
Also, if built-in functions are added that may provide a way in which
the types could leak into C++ code.
Fortran note: the float128_type_node used in the Fortran front end is
renamed to gfc_float128_type_node, since the semantics are different:
in particular, if long double has binary128 format, then the new
language-independent float128_type_node is a distinct type that also
has binary128 format, but the Fortran node is expected to be NULL in
that case. Likewise, Fortran's complex_float128_type_node is renamed
to gfc_complex_float128_type_node.
PowerPC note: the back end had an inconsistency that if TFmode was
binary128, *q constants were TFmode instead of KFmode but __float128
was KFmode. This patch follows the same logic as for *q constants, so
that _Float128 prefers TFmode (and __float128 becomes an alias for
_Float128).
ARM note: __fp16 is promoted to double (by convert_arguments) when
passed without a prototype / in variable arguments. But this is only
about the argument promotion; it is not handled as promoting in
c-common.c:self_promoting_args_p / c-typeck.c:c_type_promotes_to,
meaning that a K&R function definition for an argument of type __fp16
corresponds to a prototype with an argument of that type, not to one
with an argument of type double, whereas a float argument in a K&R
function definition corresponds to a double prototype argument - and
the same functions are also what's involved in making va_arg give a
warning and generate a call to abort when called with type float.
This is preserved by this patch, while arranging for _Float16 not to
be promoted when passed without a prototype / in variable arguments
(the promotion of float being considered a legacy feature, not applied
to any new types in C99 or later).
TS 18661-3 extends the set of decimal floating-point types similarly,
and adds new constant suffixes for the existing types, but this patch
does not do anything regarding that extension.
This patch does nothing regarding built-in functions, although
type-generic functions such as __builtin_isinf work for the new types
and associated tests are included. There are at least two levels of
built-in function support possible for these types. The minimal
level, implemented in
<https://gcc.gnu.org/ml/gcc-patches/2016-06/msg01702.html> (which
needs updating to use dg-add-options), adds built-in functions similar
to those x86 has for __float128: __builtin_inf* __builtin_huge_val*,
__builtin_nan*, __builtin_nans*, __builtin_fabs*, __builtin_copysign*.
That would be sufficient for glibc to use the *f128 names for built-in
functions by default with *q used only for backwards compatibility
when using older GCC versions. That would also allow c_cpp_builtins's
flag_building_libgcc code, defining __LIBGCC_%s_FUNC_EXT__, to use
such suffixes rather than the present code hardcoding logic about
target-specific constant suffixes and how those relate to function
suffixes.
Full built-in function support would cover the full range of built-in
functions for existing floating-point types, adding variants for all
the new types, except for a few obsolescent functions and
non-type-generic variants of type-generic functions. Some but not all
references to such functions in GCC use macros such as CASE_FLT_FN to
be type-generic; a fair amount of work would be needed to identify all
places to update. Adding all those functions would enable
optimizations (for constant arguments and otherwise) for TS 18661-3
functions, but it would also substantially expand the enum listing
built-in functions (and we've had problems with the size of that enum
in the past), and increase the amount of built-in function
initialization to do - I don't know what the startup cost involved in
built-in function initialization is, but it would be something to
consider when adding such a large set of functions.
There are also a range of optimizations, in match.pd and elsewhere,
that only operate on the three standard floating-point types. Ideally
those would be made generic to all floating-point types, but this
patch does nothing in that regard. Special care would be needed
regarding making sure library functions to which calls are generated
actually exist. For example, if sqrt is called on an argument of type
_Float32, and the result converted to _Float32, this is equivalent to
doing a square root operation directly on _Float32. But if the user's
libm does not have the sqrtf32 function, or the name is not reserved
because __STDC_WANT_IEC_60559_TYPES_EXT__ was not defined before
including <math.h>, you can only do that optimization if you convert
to a call to sqrtf instead.
DECIMAL_DIG now relates to all supported floating-point formats, not
just float, double and long double; I've raised the question with WG14
of how this relates to the formula for DECIMAL_DIG in C11 not
considering this. TS 18661-3 says it also covers non-arithmetic
formats only supported by library conversion functions; this patch
does not add any target hooks to allow for the case where there are
such formats wider than any supported for arithmetic types (where
e.g. libc supports conversions involving the binary128 representation,
but the _Float128 type is not supported).
GCC provides its own <tgmath.h> for some targets. No attempt is made
to adapt this to handle the new types.
Nothing is done regarding debug info for the new types (see the
"Debugger support for __float128 type?" thread on gcc@, Sep/Oct 2015).
No __SIZEOF_*__ macros are added for the new types.
Nothing is done with do_warn_double_promotion.
Nothing is done to include the new types in those determining
max_align_t, although properly it should be sufficiently aligned for
any of those types.
The logic for usual arithmetic conversions in c_common_type relies on
TYPE_PRECISION for floating-point types, which is less than ideal
(doesn't necessarily correspond to whether one type's values are
subset of another); looking in more detail at the formats might be
better. But since I included code in build_common_tree_nodes to work
around rs6000 KFmode having precision 113 not 128, I think it should
work. Ideally one might have errors in generic code for the case
where the two types do not have one type's values a subset of the
other (which is undefined behavior). But the only case where this can
actually occur is mixing IBM long double with binary128 on powerpc,
and rs6000_invalid_binary_op deals with that at present. TS 18661-3
does not fully specify the type resulting from the usual arithmetic
conversions in the case where two _FloatNx types have the same set of
values; I arranged the code to prefer the greater value of N in that
case.
The __FP_FAST_FMA* macros are not extended to cover the new types,
since there are no corresponding built-in functions (if built-in
fmafN, fmafNx are added, the macros should be extended, and the new
macros documented). Also, only a limited set of modes is handled in
mode_has_fma.
Diagnostics relating to the use of the new types with -pedantic do not
try to distinguish them from purely nonstandard types such as __int128
and constant suffixes such as *q.
If you use an unsupported _FloatN / _FloatNx type you get a warning
about the type defaulting to int after the warning about the type not
being supported. That's less than ideal, but it's also a pre-existing
condition if you use __int128 on a 32-bit system where it's
unsupported.
Bootstrapped with no regressions on x86_64-pc-linux-gnu. Other
back-end changes minimally tested by building cc1 for ia64-linux-gnu,
powerpc64le-linux-gnu, pdp11-none (the last failed for unrelated
reasons).
PR c/32187
gcc:
* tree-core.h (TI_COMPLEX_FLOAT16_TYPE)
(TI_COMPLEX_FLOATN_NX_TYPE_FIRST, TI_COMPLEX_FLOAT32_TYPE)
(TI_COMPLEX_FLOAT64_TYPE, TI_COMPLEX_FLOAT128_TYPE)
(TI_COMPLEX_FLOAT32X_TYPE, TI_COMPLEX_FLOAT64X_TYPE)
(TI_COMPLEX_FLOAT128X_TYPE, TI_FLOAT16_TYPE, TI_FLOATN_TYPE_FIRST)
(TI_FLOATN_NX_TYPE_FIRST, TI_FLOAT32_TYPE, TI_FLOAT64_TYPE)
(TI_FLOAT128_TYPE, TI_FLOATN_TYPE_LAST, TI_FLOAT32X_TYPE)
(TI_FLOATNX_TYPE_FIRST, TI_FLOAT64X_TYPE, TI_FLOAT128X_TYPE)
(TI_FLOATNX_TYPE_LAST, TI_FLOATN_NX_TYPE_LAST): New enum
tree_index values.
(NUM_FLOATN_TYPES, NUM_FLOATNX_TYPES, NUM_FLOATN_NX_TYPES): New
macros.
(struct floatn_type_info): New structure type.
(floatn_nx_types): New variable declaration.
* tree.h (FLOATN_TYPE_NODE, FLOATN_NX_TYPE_NODE)
(FLOATNX_TYPE_NODE, float128_type_node, float64x_type_node)
(COMPLEX_FLOATN_NX_TYPE_NODE): New macros.
* tree.c (floatn_nx_types): New variable.
(build_common_tree_nodes): Initialize _FloatN, _FloatNx and
corresponding complex types.
* target.def (floatn_mode): New hook.
* targhooks.c: Include "real.h".
(default_floatn_mode): New function.
* targhooks.h (default_floatn_mode): New prototype.
* doc/extend.texi (Floating Types): Document _FloatN and _FloatNx
types.
* doc/sourcebuild.texi (float@var{n}, float@var{n}x): Document new
effective-target and dg-add-options keywords.
(float@var{n}_runtime, float@var{n}x_runtime, floatn_nx_runtime):
Document new effective-target keywords.
* doc/tm.texi.in (TARGET_FLOATN_MODE): New @hook.
* doc/tm.texi: Regenerate.
* ginclude/float.h (LDBL_DECIMAL_DIG): Define to
__LDBL_DECIMAL_DIG__, not __DECIMAL_DIG__.
[__STDC_WANT_IEC_60559_TYPES_EXT__]: Define macros from TS
18661-3.
* real.h (struct real_format): Add field ieee_bits.
* real.c (ieee_single_format, mips_single_format)
(motorola_single_format, spu_single_format, ieee_double_format)
(mips_double_format, motorola_double_format)
(ieee_extended_motorola_format, ieee_extended_intel_96_format)
(ieee_extended_intel_128_format)
(ieee_extended_intel_96_round_53_format, ibm_extended_format)
(mips_extended_format, ieee_quad_format, mips_quad_format)
(vax_f_format, vax_d_format, vax_g_format, decimal_single_format)
(decimal_double_format, decimal_quad_format, ieee_half_format)
(arm_half_format, real_internal_format: Initialize ieee_bits
field.
* config/i386/i386.c (ix86_init_builtin_types): Do not initialize
float128_type_node. Set float80_type_node to float64x_type_node
if appropriate and long_double_type_node not appropriate.
* config/ia64/ia64.c (ia64_init_builtins): Likewise.
* config/pdp11/pdp11.c (pdp11_f_format, pdp11_d_format):
Initialize ieee_bits field.
* config/rs6000/rs6000.c (TARGET_FLOATN_MODE): New macro.
(rs6000_init_builtins): Set ieee128_float_type_node to
float128_type_node.
(rs6000_floatn_mode): New function.
gcc/c:
* c-tree.h (cts_floatn_nx): New enum c_typespec_keyword value.
(struct c_declspecs): Add field floatn_nx_idx.
* c-decl.c (declspecs_add_type, finish_declspecs): Handle _FloatN
and _FloatNx type specifiers.
* c-parser.c (c_keyword_starts_typename, c_token_starts_declspecs)
(c_parser_declspecs, c_parser_attribute_any_word)
(c_parser_objc_selector): Use CASE_RID_FLOATN_NX.
* c-typeck.c (c_common_type): Handle _FloatN and _FloatNx types.
(convert_arguments): Avoid promoting _FloatN and _FloatNx types
narrower than double.
gcc/c-family:
* c-common.h (RID_FLOAT16, RID_FLOATN_NX_FIRST, RID_FLOAT32)
(RID_FLOAT64, RID_FLOAT128, RID_FLOAT32X, RID_FLOAT64X)
(RID_FLOAT128X): New enum rid values.
(CASE_RID_FLOATN_NX): New macro.
* c-common.c (c_common_reswords): Add _FloatN and _FloatNx
keywords.
(c_common_type_for_mode): Check for _FloatN and _FloatNx and
corresponding complex types.
(c_common_nodes_and_builtins): For non-C++, register _FloatN and
_FloatNx and corresponding complex types.
(keyword_begins_type_specifier): Use CASE_RID_FLOATN_NX.
* c-cppbuiltin.c (builtin_define_float_constants): Check _FloatN
and _FloatNx types for the widest type for determining
DECIMAL_DIG. Define __LDBL_DECIMAL_DIG__ as well as
__DECIMAL_DIG__ for long double. Handle FMA_SUFFIX being NULL.
(c_cpp_builtins): Call builtin_define_float_constants for _FloatN
and _FloatNx types.
* c-lex.c (interpret_float): Handle _FloatN and _FloatNx
constants.
* c-pretty-print.c (pp_c_floating_constant): Handle _FloatN and
_FloatNx types.
gcc/fortran:
* trans-types.h (float128_type_node): Rename to
gfc_float128_type_node.
(complex_float128_type_node): Rename to
gfc_complex_float128_type_node.
* iso-c-binding.def, trans-intrinsic.c, trans-types.c: All users
changed.
gcc/testsuite:
* lib/target-supports.exp (check_effective_target_float16)
(check_effective_target_float32, check_effective_target_float64)
(check_effective_target_float128, check_effective_target_float32x)
(check_effective_target_float64x)
(check_effective_target_float128x)
(check_effective_target_float16_runtime)
(check_effective_target_float32_runtime)
(check_effective_target_float64_runtime)
(check_effective_target_float128_runtime)
(check_effective_target_float32x_runtime)
(check_effective_target_float64x_runtime)
(check_effective_target_float128x_runtime)
(check_effective_target_floatn_nx_runtime)
(add_options_for_float16, add_options_for_float32)
(add_options_for_float64, add_options_for_float128)
(add_options_for_float32x, add_options_for_float64x)
(add_options_for_float128x): New procedures.
* gcc.dg/dfp/floatn.c, gcc.dg/float128-typeof.c,
gcc.dg/float128x-typeof.c, gcc.dg/float16-typeof.c,
gcc.dg/float32-typeof.c, gcc.dg/float32x-typeof.c,
gcc.dg/float64-typeof.c, gcc.dg/float64x-typeof.c,
gcc.dg/floatn-arithconv.c, gcc.dg/floatn-errs.c,
gcc.dg/floatn-typeof.h, gcc.dg/torture/float128-basic.c,
gcc.dg/torture/float128-complex.c,
gcc.dg/torture/float128-floath.c, gcc.dg/torture/float128-tg.c,
gcc.dg/torture/float128x-basic.c,
gcc.dg/torture/float128x-complex.c,
gcc.dg/torture/float128x-floath.c, gcc.dg/torture/float128x-tg.c,
gcc.dg/torture/float16-basic.c, gcc.dg/torture/float16-complex.c,
gcc.dg/torture/float16-floath.c, gcc.dg/torture/float16-tg.c,
gcc.dg/torture/float32-basic.c, gcc.dg/torture/float32-complex.c,
gcc.dg/torture/float32-floath.c, gcc.dg/torture/float32-tg.c,
gcc.dg/torture/float32x-basic.c,
gcc.dg/torture/float32x-complex.c,
gcc.dg/torture/float32x-floath.c, gcc.dg/torture/float32x-tg.c,
gcc.dg/torture/float64-basic.c, gcc.dg/torture/float64-complex.c,
gcc.dg/torture/float64-floath.c, gcc.dg/torture/float64-tg.c,
gcc.dg/torture/float64x-basic.c,
gcc.dg/torture/float64x-complex.c,
gcc.dg/torture/float64x-floath.c, gcc.dg/torture/float64x-tg.c,
gcc.dg/torture/floatn-basic.h, gcc.dg/torture/floatn-complex.h,
gcc.dg/torture/floatn-convert.c, gcc.dg/torture/floatn-floath.h,
gcc.dg/torture/floatn-tg.h,
gcc.dg/torture/fp-int-convert-float128-ieee-timode.c,
gcc.dg/torture/fp-int-convert-float128-ieee.c,
gcc.dg/torture/fp-int-convert-float128x-timode.c,
gcc.dg/torture/fp-int-convert-float128x.c,
gcc.dg/torture/fp-int-convert-float16-timode.c,
gcc.dg/torture/fp-int-convert-float16.c,
gcc.dg/torture/fp-int-convert-float32-timode.c,
gcc.dg/torture/fp-int-convert-float32.c,
gcc.dg/torture/fp-int-convert-float32x-timode.c,
gcc.dg/torture/fp-int-convert-float32x.c,
gcc.dg/torture/fp-int-convert-float64-timode.c,
gcc.dg/torture/fp-int-convert-float64.c,
gcc.dg/torture/fp-int-convert-float64x-timode.c,
gcc.dg/torture/fp-int-convert-float64x.c: New tests.
* gcc.dg/torture/fp-int-convert.h (TEST_I_F): Add argument for
maximum exponent of floating-point type. Use it in testing
whether 0x8...0 fits in the floating-point type. Always treat -1
(signed 0xf...f) as fitting in the floating-point type.
(M_OK1): New macro.
* gcc.dg/torture/fp-int-convert-double.c,
gcc.dg/torture/fp-int-convert-float.c,
gcc.dg/torture/fp-int-convert-float128-timode.c,
gcc.dg/torture/fp-int-convert-float128.c,
gcc.dg/torture/fp-int-convert-float80-timode.c,
gcc.dg/torture/fp-int-convert-float80.c,
gcc.dg/torture/fp-int-convert-long-double.c,
gcc.dg/torture/fp-int-convert-timode.c: Update calls to TEST_I_F.
libcpp:
* 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.
From-SVN: r239625
2016-08-19 19:43:26 +02:00
|
|
|
|
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 15:17:09 +02:00
|
|
|
|
2016-08-19 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
|
|
|
|
|
|
|
|
|
|
* expr.c (eval_token): Append "evaluates to 0" to Wundef diagnostic.
|
|
|
|
|
|
2016-08-18 20:52:43 +02:00
|
|
|
|
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 12:28:03 +02:00
|
|
|
|
2016-08-18 Marek Polacek <polacek@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR c/7652
|
|
|
|
|
* pch.c (write_macdef): Add CPP_FALLTHRU.
|
|
|
|
|
|
2016-08-12 12:30:47 +02:00
|
|
|
|
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 20:06:30 +02:00
|
|
|
|
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.
|
|
|
|
|
|
On-demand locations within string-literals
gcc/c-family/ChangeLog:
* c-common.c: Include "substring-locations.h".
(get_cpp_ttype_from_string_type): New function.
(g_string_concat_db): New global.
(substring_loc::get_range): New method.
* c-common.h (g_string_concat_db): New declaration.
(class substring_loc): New class.
* c-lex.c (lex_string): When concatenating strings, capture the
locations of all tokens using a new obstack, and record the
concatenation locations within g_string_concat_db.
* c-opts.c (c_common_init_options): Construct g_string_concat_db
on the ggc-heap.
gcc/ChangeLog:
* input.c (string_concat::string_concat): New constructor.
(string_concat_db::string_concat_db): New constructor.
(string_concat_db::record_string_concatenation): New method.
(string_concat_db::get_string_concatenation): New method.
(string_concat_db::get_key_loc): New method.
(class auto_cpp_string_vec): New class.
(get_substring_ranges_for_loc): New function.
(get_source_range_for_substring): New function.
(get_num_source_ranges_for_substring): New function.
(class selftest::lexer_test_options): New class.
(struct selftest::lexer_test): New struct.
(class selftest::ebcdic_execution_charset): New class.
(selftest::ebcdic_execution_charset::s_singleton): New variable.
(selftest::lexer_test::lexer_test): New constructor.
(selftest::lexer_test::~lexer_test): New destructor.
(selftest::lexer_test::get_token): New method.
(selftest::assert_char_at_range): New function.
(ASSERT_CHAR_AT_RANGE): New macro.
(selftest::assert_num_substring_ranges): New function.
(ASSERT_NUM_SUBSTRING_RANGES): New macro.
(selftest::assert_has_no_substring_ranges): New function.
(ASSERT_HAS_NO_SUBSTRING_RANGES): New macro.
(selftest::test_lexer_string_locations_simple): New function.
(selftest::test_lexer_string_locations_ebcdic): New function.
(selftest::test_lexer_string_locations_hex): New function.
(selftest::test_lexer_string_locations_oct): New function.
(selftest::test_lexer_string_locations_letter_escape_1): New function.
(selftest::test_lexer_string_locations_letter_escape_2): New function.
(selftest::test_lexer_string_locations_ucn4): New function.
(selftest::test_lexer_string_locations_ucn8): New function.
(selftest::uint32_from_big_endian): New function.
(selftest::test_lexer_string_locations_wide_string): New function.
(selftest::uint16_from_big_endian): New function.
(selftest::test_lexer_string_locations_string16): New function.
(selftest::test_lexer_string_locations_string32): New function.
(selftest::test_lexer_string_locations_u8): New function.
(selftest::test_lexer_string_locations_utf8_source): New function.
(selftest::test_lexer_string_locations_concatenation_1): New
function.
(selftest::test_lexer_string_locations_concatenation_2): New
function.
(selftest::test_lexer_string_locations_concatenation_3): New
function.
(selftest::test_lexer_string_locations_macro): New function.
(selftest::test_lexer_string_locations_stringified_macro_argument):
New function.
(selftest::test_lexer_string_locations_non_string): New function.
(selftest::test_lexer_string_locations_long_line): New function.
(selftest::test_lexer_char_constants): New function.
(selftest::input_c_tests): Call the new test functions once per
case within the line_table test matrix.
* input.h (struct string_concat): New struct.
(struct location_hash): New struct.
(class string_concat_db): New class.
* substring-locations.h: New header.
gcc/testsuite/ChangeLog:
* gcc.dg/plugin/diagnostic-test-string-literals-1.c: New file.
* gcc.dg/plugin/diagnostic-test-string-literals-2.c: New file.
* gcc.dg/plugin/diagnostic_plugin_test_string_literals.c: New file.
* gcc.dg/plugin/plugin.exp (plugin_test_list): Add the above new files.
libcpp/ChangeLog:
* 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.
From-SVN: r239175
2016-08-05 20:08:33 +02:00
|
|
|
|
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 14:45:32 +02:00
|
|
|
|
2016-08-01 Andreas Schwab <schwab@suse.de>
|
|
|
|
|
|
|
|
|
|
* include/cpplib.h: Fix comment typo.
|
|
|
|
|
|
2016-07-27 19:21:20 +02:00
|
|
|
|
2016-07-27 David Malcolm <dmalcolm@redhat.com>
|
|
|
|
|
|
|
|
|
|
* include/line-map.h (source_location): Fix line numbers in
|
|
|
|
|
comment.
|
|
|
|
|
|
2016-07-11 18:02:20 +02:00
|
|
|
|
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 17:29:21 +02:00
|
|
|
|
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 16:42:30 +02:00
|
|
|
|
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-22 03:46:06 +02:00
|
|
|
|
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 18:42:41 +02:00
|
|
|
|
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 10:03:25 +02:00
|
|
|
|
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 11:12:05 +02:00
|
|
|
|
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.
|
Add ability to remap file names in __FILE__, etc (PR other/70268)
This commit adds the -fmacro-prefix-map option that allows remapping of file
names in __FILE__, __BASE_FILE__, and __builtin_FILE(), similar to how
-fdebug-prefix-map allows to do the same for debug information.
Additionally, it adds -ffile-prefix-map which can be used to specify both
mappings with a single option (and, should we need to add more -f*-prefix-map
options in the future, those as well).
libcpp/ChangeLog:
2018-01-18 Boris Kolpackov <boris@codesynthesis.com>
PR other/70268
* include/cpplib.h (cpp_callbacks::remap_filename): New callback.
* libcpp/macro.c (_cpp_builtin_macro_text): Call remap_filename for
__FILE__ and __BASE_FILE__.
gcc/ChangeLog:
2018-01-18 Boris Kolpackov <boris@codesynthesis.com>
PR other/70268
* common.opt: (-ffile-prefix-map): New option.
* opts.c (common_handle_option): Defer it.
* opts-global.c (handle_common_deferred_options): Handle it.
* debug.h (remap_debug_filename, add_debug_prefix_map): Move to...
* file-prefix-map.h: New file.
(remap_debug_filename, add_debug_prefix_map): ...here.
(add_macro_prefix_map, add_file_prefix_map, remap_macro_filename): New.
* final.c (debug_prefix_map, add_debug_prefix_map
remap_debug_filename): Move to...
* file-prefix-map.c: New file.
(file_prefix_map, add_prefix_map, remap_filename) ...here and rename,
generalize, get rid of alloca(), use strrchr() instead of strchr().
(add_macro_prefix_map, add_debug_prefix_map, add_file_prefix_map):
Implement in terms of add_prefix_map().
(remap_macro_filename, remap_debug_filename): Implement in term of
remap_filename().
* Makefile.in (OBJS, PLUGIN_HEADERS): Add new files.
* builtins.c (fold_builtin_FILE): Call remap_macro_filename().
* dbxout.c: Include file-prefix-map.h.
* varasm.c: Likewise.
* vmsdbgout.c: Likewise.
* xcoffout.c: Likewise.
* dwarf2out.c: Likewise plus omit new options from DW_AT_producer.
* doc/cppopts.texi (-fmacro-prefix-map): Document.
* doc/invoke.texi (-ffile-prefix-map): Document.
(-fdebug-prefix-map): Update description.
gcc/c-family/ChangeLog:
2018-01-18 Boris Kolpackov <boris@codesynthesis.com>
PR other/70268
* c-family/c.opt (-fmacro-prefix-map): New option.
* c-family/c-opts.c (c_common_handle_option): Handle it.
* c-family/c-lex.c (init_c_lex): Set remap_filename cpp callback.
* c-family/c-ppoutput.c (init_pp_output): Likewise.
gcc/testsuite/ChangeLog:
2018-01-18 Boris Kolpackov <boris@codesynthesis.com>
PR other/70268
* c-c++-common/ffile-prefix-map.c: New test.
* c-c++-common/fmacro-prefix-map.c: New test.
* c-c++-common/cpp/ffile-prefix-map.c: New test.
* c-c++-common/cpp/fmacro-prefix-map.c: New test.
From-SVN: r256847
2018-01-18 14:17:37 +01:00
|
|
|
|
* 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
|
2016-04-28 11:12:05 +02:00
|
|
|
|
builds.
|
|
|
|
|
|
2016-04-13 13:40:37 +02:00
|
|
|
|
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 20:35:16 +02:00
|
|
|
|
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 17:15:39 +01:00
|
|
|
|
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 16:41:13 +01:00
|
|
|
|
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-16 00:08:45 +01:00
|
|
|
|
2016-03-15 Richard Henderson <rth@redhat.com>
|
|
|
|
|
|
|
|
|
|
* line-map.c (new_linemap): Make alloc_size a size_t.
|
|
|
|
|
|
2016-03-15 13:08:31 +01:00
|
|
|
|
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 19:23:27 +01:00
|
|
|
|
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 19:14:43 +01:00
|
|
|
|
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-03-01 02:02:49 +01:00
|
|
|
|
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 18:44:28 +01:00
|
|
|
|
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 18:33:45 +01:00
|
|
|
|
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 20:39:48 +01:00
|
|
|
|
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 15:33:55 +01:00
|
|
|
|
2016-01-28 Jakub Jelinek <jakub@redhat.com>
|
|
|
|
|
|
2016-01-28 23:35:20 +01:00
|
|
|
|
PR pch/68176
|
|
|
|
|
* files.c (_cpp_find_file): Set file->implicit_preinclude even if
|
|
|
|
|
included from file->implicit_preinclude header.
|
|
|
|
|
|
2016-01-28 15:33:55 +01:00
|
|
|
|
* directives.c (destringize_and_run): Adjust prototype.
|
|
|
|
|
|
2016-01-27 19:57:51 +01:00
|
|
|
|
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 20:10:17 +01:00
|
|
|
|
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 07:43:31 +01:00
|
|
|
|
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 15:30:50 +01:00
|
|
|
|
2016-01-04 Jakub Jelinek <jakub@redhat.com>
|
|
|
|
|
|
|
|
|
|
Update copyright years.
|
|
|
|
|
|
2015-12-22 23:06:00 +01:00
|
|
|
|
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 17:07:00 +01:00
|
|
|
|
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 21:08:47 +01:00
|
|
|
|
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 09:27:12 +01:00
|
|
|
|
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.
|
|
|
|
|
|
Source range tracking in libcpp and C FE, with bit-packing optimization
This patch combines:
[PATCH 05/10] Add ranges to libcpp tokens (via ad-hoc data, unoptimized)
[PATCH 06/10] Track expression ranges in C frontend
[PATCH 07/10] Add plugin to recursively dump the source-ranges in a tree (v2)
[PATCH 08/10] Wire things up so that libcpp users get token underlines
[PATCH 09/10] Delay some resolution of ad-hoc locations, preserving ranges
[PATCH 10/10] Compress short ranges into source_location
[PATCH] libcpp: add examples to source_location description
along with fixes for the nits identified during review.
gcc/ChangeLog:
* Makefile.in (OBJS): Add gcc-rich-location.o.
* diagnostic.c (diagnostic_append_note): Pass line_table to
rich_location ctor.
(emit_diagnostic): Likewise.
(inform): Likewise.
(inform_n): Likewise.
(warning): Likewise.
(warning_at): Likewise.
(warning_n): Likewise.
(pedwarn): Likewise.
(permerror): Likewise.
(error): Likewise.
(error_n): Likewise.
(error_at): Likewise.
(sorry): Likewise.
(fatal_error): Likewise.
(internal_error): Likewise.
(internal_error_no_backtrace): Likewise.
(source_range::debug): Likewise.
* gcc-rich-location.c: New file.
* gcc-rich-location.h: New file.
* genmatch.c (fatal_at): Pass line_table to rich_location ctor.
(warning_at): Likewise.
* gimple.h (gimple_set_block): Use set_block function.
* input.c (dump_line_table_statistics): Dump stats on how many
ranges were optimized vs how many needed ad-hoc table.
(write_digit_row): Add "map" param; use its range_bits
to calculate the per-character offset.
(dump_location_info): Print the range and column bits for each
ordinary map. Use the range bits to calculate the per-character
offset. Pass the map as a new param to the various calls to
write_digit_row. Eliminate uses of
ORDINARY_MAP_NUMBER_OF_COLUMN_BITS.
* print-tree.c (print_node): Print any source range information.
* rtl-error.c (diagnostic_for_asm): Likewise.
* toplev.c (general_init): Initialize line_table's
default_range_bits.
* tree-cfg.c (move_block_to_fn): Likewise.
(move_block_to_fn): Likewise.
* tree-inline.c (copy_phis_for_bb): Likewise.
* tree.c (tree_set_block): Likewise.
(get_pure_location): New function.
(set_source_range): New functions.
(set_block): New function.
(set_source_range): New functions.
* tree.h (CAN_HAVE_RANGE_P): New.
(EXPR_LOCATION_RANGE): New.
(EXPR_HAS_RANGE): New.
(get_expr_source_range): New inline function.
(DECL_LOCATION_RANGE): New.
(set_source_range): New decls.
(get_decl_source_range): New inline function.
gcc/ada/ChangeLog:
* gcc-interface/trans.c (Sloc_to_locus): Add line_table param when
calling linemap_position_for_line_and_column.
gcc/c-family/ChangeLog:
* c-common.c (c_fully_fold_internal): Capture existing souce_range,
and store it on the result.
* c-opts.c (c_common_init_options): Set
global_dc->colorize_source_p.
gcc/c/ChangeLog:
* c-decl.c (warn_defaults_to): Pass line_table to
rich_location ctor.
* c-errors.c (pedwarn_c99): Likewise.
(pedwarn_c90): Likewise.
* c-parser.c (set_c_expr_source_range): New functions.
(c_token::get_range): New method.
(c_token::get_finish): New method.
(c_parser_expr_no_commas): Call set_c_expr_source_range on the ret
based on the range from the start of the LHS to the end of the
RHS.
(c_parser_conditional_expression): Likewise, based on the range
from the start of the cond.value to the end of exp2.value.
(c_parser_binary_expression): Call set_c_expr_source_range on
the stack values for TRUTH_ANDIF_EXPR and TRUTH_ORIF_EXPR.
(c_parser_cast_expression): Call set_c_expr_source_range on ret
based on the cast_loc through to the end of the expr.
(c_parser_unary_expression): Likewise, based on the
op_loc through to the end of op.
(c_parser_sizeof_expression) Likewise, based on the start of the
sizeof token through to either the closing paren or the end of
expr.
(c_parser_postfix_expression): Likewise, using the token range,
or from the open paren through to the close paren for
parenthesized expressions.
(c_parser_postfix_expression_after_primary): Likewise, for
various kinds of expression.
* c-tree.h (struct c_expr): Add field "src_range".
(c_expr::get_start): New method.
(c_expr::get_finish): New method.
(set_c_expr_source_range): New decls.
* c-typeck.c (parser_build_unary_op): Call set_c_expr_source_range
on ret for prefix unary ops.
(parser_build_binary_op): Likewise, running from the start of
arg1.value through to the end of arg2.value.
gcc/cp/ChangeLog:
* error.c (pedwarn_cxx98): Pass line_table to rich_location ctor.
gcc/fortran/ChangeLog:
* error.c (gfc_warning): Pass line_table to rich_location ctor.
(gfc_warning_now_at): Likewise.
(gfc_warning_now): Likewise.
(gfc_error_now): Likewise.
(gfc_fatal_error): Likewise.
(gfc_error): Likewise.
(gfc_internal_error): Likewise.
gcc/testsuite/ChangeLog:
* gcc.dg/diagnostic-token-ranges.c: New file.
* gcc.dg/diagnostic-tree-expr-ranges-2.c: New file.
* gcc.dg/plugin/diagnostic-test-expressions-1.c: New file.
* gcc.dg/plugin/diagnostic-test-show-trees-1.c: New file.
* gcc.dg/plugin/diagnostic_plugin_show_trees.c: New file.
* gcc.dg/plugin/diagnostic_plugin_test_show_locus.c (get_loc): Add
line_table param when calling
linemap_position_for_line_and_column.
(test_show_locus): Pass line_table to rich_location ctors.
(plugin_init): Remove setting of global_dc->colorize_source_p.
* gcc.dg/plugin/diagnostic_plugin_test_tree_expression_range.c:
New file.
* gcc.dg/plugin/plugin.exp (plugin_test_list): Add
diagnostic_plugin_test_tree_expression_range.c,
diagnostic-test-expressions-1.c, diagnostic_plugin_show_trees.c,
and diagnostic-test-show-trees-1.c.
libcpp/ChangeLog:
* 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.
From-SVN: r230331
2015-11-13 17:29:59 +01:00
|
|
|
|
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 20:50:50 +01:00
|
|
|
|
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 19:40:56 +01:00
|
|
|
|
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 16:01:46 +01:00
|
|
|
|
2015-11-04 Mikhail Maltsev <maltsevm@gmail.com>
|
|
|
|
|
|
|
|
|
|
* config.in: Regenerate.
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
* configure.ac: Remove ENABLE_CHECKING.
|
|
|
|
|
|
2015-11-03 20:05:50 +01:00
|
|
|
|
2015-11-03 Uros Bizjak <ubizjak@gmail.com>
|
|
|
|
|
|
|
|
|
|
* lex.c (search_line_sse42): Correctly advance the pointer to an
|
|
|
|
|
aligned address.
|
|
|
|
|
|
2015-11-02 20:47:03 +01:00
|
|
|
|
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 23:16:31 +02:00
|
|
|
|
2015-10-21 Mikhail Maltsev <maltsevm@gmail.com>
|
|
|
|
|
|
2015-10-22 00:22:03 +02:00
|
|
|
|
* 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.
|
|
|
|
|
|
2015-10-21 23:16:31 +02:00
|
|
|
|
* 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 23:31:48 +02:00
|
|
|
|
2015-10-13 Mikhail Maltsev <maltsevm@gmail.com>
|
|
|
|
|
|
|
|
|
|
* system.h (CHECKING_P, gcc_checking_assert): Define.
|
|
|
|
|
|
2015-09-21 16:52:09 +02:00
|
|
|
|
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 11:11:17 +02:00
|
|
|
|
2015-09-07 Marek Polacek <polacek@redhat.com>
|
|
|
|
|
|
|
|
|
|
* system.h (INTTYPE_MINIMUM): Rewrite to avoid shift warning.
|
|
|
|
|
|
2015-08-07 07:13:52 +02:00
|
|
|
|
2015-08-06 Yaakov Selkowitz <yselkowi@redhat.com>
|
|
|
|
|
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
|
2015-07-08 16:48:11 +02:00
|
|
|
|
2015-07-08 Thomas Schwinge <thomas@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* include/line-map.h (RESERVED_LOCATION_COUNT): Change type to
|
|
|
|
|
source_location.
|
|
|
|
|
|
2015-07-02 20:54:41 +02:00
|
|
|
|
2015-07-02 Paolo Carlini <paolo.carlini@oracle.com>
|
|
|
|
|
|
2015-07-03 11:42:52 +02:00
|
|
|
|
PR preprocessor/53690
|
2015-07-02 20:54:41 +02:00
|
|
|
|
* 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 14:58:48 +02:00
|
|
|
|
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.
|
2015-07-02 20:54:41 +02:00
|
|
|
|
* macro.c (stringify_arg()): Treat CPP_UTF8CHAR token;
|
2015-06-30 14:58:48 +02:00
|
|
|
|
* 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 10:26:57 +02:00
|
|
|
|
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 17:16:12 +02:00
|
|
|
|
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 19:12:28 +02:00
|
|
|
|
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 11:13:19 +02:00
|
|
|
|
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.
|
|
|
|
|
|
Replace line_map union with C++ class hierarchy
gcc/ChangeLog:
* diagnostic.c (diagnostic_report_current_module): Strengthen
local "new_map" from const line_map * to
const line_map_ordinary *.
* genmatch.c (error_cb): Likewise for local "map".
(output_line_directive): Likewise for local "map".
* input.c (expand_location_1): Likewise for local "map".
Pass NULL rather than &map to
linemap_unwind_to_first_non_reserved_loc, since the value is never
read from there, and the value written back not read from here.
(is_location_from_builtin_token): Strengthen local "map" from
const line_map * to const line_map_ordinary *.
(dump_location_info): Strengthen locals "map" from
line_map *, one to const line_map_ordinary *, the other
to const line_map_macro *.
* tree-diagnostic.c (loc_map_pair): Strengthen field "map" from
const line_map * to const line_map_macro *.
(maybe_unwind_expanded_macro_loc): Add a call to
linemap_check_macro when writing to the "map" field of the
loc_map_pair.
Introduce local const line_map_ordinary * "ord_map", using it in
place of "map" in the part of the function where we know we have
an ordinary map. Strengthen local "m" from const line_map * to
const line_map_ordinary *.
gcc/ada/ChangeLog:
* gcc-interface/trans.c (Sloc_to_locus1): Strenghthen local "map"
from line_map * to line_map_ordinary *.
gcc/c-family/ChangeLog:
* c-common.h (fe_file_change): Strengthen param from
const line_map * to const line_map_ordinary *.
(pp_file_change): Likewise.
* c-lex.c (fe_file_change): Likewise.
(cb_define): Use linemap_check_ordinary when invoking
SOURCE_LINE.
(cb_undef): Likewise.
* c-opts.c (c_finish_options): Use linemap_check_ordinary when
invoking cb_file_change.
(c_finish_options): Likewise.
(push_command_line_include): Likewise.
(cb_file_change): Strengthen param "new_map" from
const line_map * to const line_map_ordinary *.
* c-ppoutput.c (cb_define): Likewise for local "map".
(pp_file_change): Likewise for param "map" and local "from".
gcc/fortran/ChangeLog:
* cpp.c (maybe_print_line): Strengthen local "map" from
const line_map * to const line_map_ordinary *.
(cb_file_change): Likewise for param "map" and local "from".
(cb_line_change): Likewise for local "map".
libcpp/ChangeLog:
* 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.
From-SVN: r223365
2015-05-19 15:18:01 +02:00
|
|
|
|
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 15:58:18 +02:00
|
|
|
|
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 13:51:03 +02:00
|
|
|
|
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 13:02:17 +02:00
|
|
|
|
2015-05-13 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
|
|
|
|
|
|
|
|
|
|
* aclocal.m4: Regenerated with automake-1.11.6.
|
|
|
|
|
|
2015-05-13 12:24:30 +02:00
|
|
|
|
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 22:57:38 +02:00
|
|
|
|
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-09 06:50:10 +02:00
|
|
|
|
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 21:41:11 +02:00
|
|
|
|
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 16:21:02 +02:00
|
|
|
|
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 15:37:53 +02:00
|
|
|
|
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 19:01:50 +02:00
|
|
|
|
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 13:57:02 +02:00
|
|
|
|
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 09:02:39 +01:00
|
|
|
|
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-17 01:50:55 +01:00
|
|
|
|
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-04 18:28:56 +01:00
|
|
|
|
2015-03-02 Markus Trippelsdorf <markus@trippelsdorf.de>
|
|
|
|
|
|
|
|
|
|
PR target/65261
|
|
|
|
|
* lex.c (search_line_fast): Silence ubsan errors.
|
|
|
|
|
|
PR preprocessor/64803 - __LINE__ inside macro is not constant
Consider the example code mentionned in this PR:
$ cat -n test.c
1 #define C(a, b) a ## b
2 #define L(x) C(L, x)
3 #define M(a) goto L(__LINE__); __LINE__; L(__LINE__):
4 M(a /* --> this is the line of the expansion point of M. */
5 ); /* --> this is the line of the end of the invocation of M. */
$
"cc1 -quiet -E test.c" yields:
goto L5; 5; L4:
;
Notice how we have a 'L4' there, where it should be L5. That is the issue.
My understanding is that during the *second* expansion of __LINE__
(the one between the two L(__LINE__)), builtin_macro() is called by
enter_macro_context() with the location of the expansion point of M
(which is at line 4). Then _cpp_builtin_macro_text() expands __LINE__
into the line number of the location of the last token that has been
lexed, which is the location of the closing parenthesis of the
invocation of M, at line 5. So that invocation of __LINE__ is
expanded into 5.
Now let's see why the last invocation of __LINE__ is expanded into 4.
In builtin_macro(), we have this code at some point:
/* Set pfile->cur_token as required by _cpp_lex_direct. */
pfile->cur_token = _cpp_temp_token (pfile);
cpp_token *token = _cpp_lex_direct (pfile);
/* We should point to the expansion point of the builtin macro. */
token->src_loc = loc;
The first two statements insert a new token in the stream of lexed
token and pfile->cur_token[-1], is the "new" last token that has been
lexed. But the location of pfile->cur_token[-1] is the same location
as the location of the "previous" pfile->cur_token[-1], by courtesy of
_cpp_temp_token(). So normally, in subsequent invocations of
builtin_macro(), the location of pfile->cur_token[-1] should always be
the location of the closing parenthesis of the invocation of M at line
5. Except that that code in master now has the statement
"token->src_loc = loc;" on the next line. That statement actually
sets the location of pfile->cur_token[-1] to 'loc'. Which is the
location of the expansion point of M, which is on line 4.
So in the subsequent call to builtin_macro() (for the last expansion
of __LINE__ in L(__LINE__)), for _cpp_builtin_macro_text(),
pfile->cur_token[-1].src_loc is going to have a line number of 4.
I think the core issue here is that the location that is passed to
builtin_macro() from enter_macro_context() is not correct when we are
in presence of a top-most function-like macro invocation; in that
case, that location should be the location of the closing parenthesis
of the macro invocation. Otherwise, if we are in presence of a a
top-most object-like macro invocation then the location passed down
to builtin_macro should be the location of the expansion point of the
macro.
That way, in the particular case of the input code above, the location
received by builtin_macro() will always have line number 5.
Boostrapped and tested on x86_64-unknown-linux-gnu against trunk.
libcpp/ChangeLog:
* 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.
gcc/testsuite/ChangeLog:
* gcc.dg/cpp/builtin-macro-1.c: New test case.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
From-SVN: r220367
2015-02-03 10:26:46 +01:00
|
|
|
|
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 15:07:00 +01:00
|
|
|
|
2015-01-30 Szabolcs Nagy <szabolcs.nagy@arm.com>
|
|
|
|
|
|
|
|
|
|
* lex.c (search_line_fast): Change __ARM_NEON__ to __ARM_NEON.
|
|
|
|
|
|
2015-01-23 12:57:43 +01:00
|
|
|
|
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 18:40:15 +01:00
|
|
|
|
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 13:33:28 +01:00
|
|
|
|
2015-01-05 Jakub Jelinek <jakub@redhat.com>
|
|
|
|
|
|
|
|
|
|
Update copyright years.
|
|
|
|
|
|
2014-12-19 13:20:58 +01:00
|
|
|
|
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 09:15:37 +01:00
|
|
|
|
2014-12-11 Uros Bizjak <ubizjak@gmail.com>
|
|
|
|
|
|
|
|
|
|
* directives.c (cpp_define_formatted): Use xvasprintf.
|
|
|
|
|
|
2014-12-05 00:35:29 +01:00
|
|
|
|
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 17:03:31 +01:00
|
|
|
|
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 17:00:33 +01:00
|
|
|
|
2014-12-02 Manuel López-Ibáñez <manu@gcc.gnu.org>
|
|
|
|
|
|
2015-11-03 20:05:50 +01:00
|
|
|
|
* line-map.c (linemap_add): Fix typo.
|
|
|
|
|
(linemap_line_start): Fix whitespace.
|
2014-12-02 17:00:33 +01:00
|
|
|
|
|
2014-11-29 02:56:06 +01:00
|
|
|
|
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 12:16:27 +01:00
|
|
|
|
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 11:43:45 +01:00
|
|
|
|
2014-11-20 Uros Bizjak <ubizjak@gmail.com>
|
|
|
|
|
|
|
|
|
|
PR target/63966
|
2014-11-20 13:10:12 +01:00
|
|
|
|
* lex.c [__i386__ || __x86_64__]: Compile special SSE functions
|
|
|
|
|
only for (__GNUC__ >= 5 || !defined(__PIC__)).
|
2014-11-20 11:43:45 +01:00
|
|
|
|
|
2014-11-13 11:46:56 +01:00
|
|
|
|
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 23:50:48 +01:00
|
|
|
|
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 22:55:52 +01:00
|
|
|
|
2014-11-11 David Malcolm <dmalcolm@redhat.com>
|
|
|
|
|
|
|
|
|
|
* ChangeLog.jit: New.
|
|
|
|
|
|
2014-11-10 16:53:12 +01:00
|
|
|
|
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__.
|
|
|
|
|
|
Preserve original spellings of extended identifiers.
This patch makes cpplib track the original spellings of extended
identifiers, as well as the canonical UTF-8 version, in order to
follow standard semantics properly without needing a convoluted and
undocumented canonicalization in translation phase 1 (see bug 9449
comments 39-46 regarding such a canonicalization).
The spelling is tracked in cpp_identifier and cpp_macro_arg without
making cpp_token any larger. The original spelling is used for checks
of duplicate macro definitions, stringizing (see the C++ tests added;
this case is only an issue for C++ not C because C makes it
implementation-defined whether a \ is inserted before the \ of a UCN
in a string or character constant when stringizing, while C++ does
not), pasting (relevant when the result is then stringized for C++)
and when macro definitions are output as text (e.g. for -d options).
Once a macro has been defined, only the original spelling of the
argument names needs keeping in the argument list. While it is being
defined, however, both spellings are needed: the original one for
subsequent saving for checks of duplicate macro definitions, and the
canonical one which is the node marked specially to generate macro
argument tokens rather than normal identifier tokens. The buffer that
is used to save the original values of the identifier tokens is
changed so that it stores both those original values and a pointer to
the canonical hash nodes, so that those canonical nodes can be found
when their values need restoring after the macro definition has been
parsed.
I believe this covers the known standards issues in extended
identifiers support (the remaining unimplemented C99 areas in GCC all
being floating-point-related), except for C++ translation of extended
characters to UCNs in phase 1 (which I have no plans to work on).
There are however probably issues left with handling of extended
identifiers in other places, as listed in
<https://gcc.gnu.org/ml/gcc-patches/2014-11/msg00337.html> (those
issues are generally the sort of thing that could be addressed as bugs
outside development stage 1). (The bulk of the potential issues Zack
was concerned about in 2003-5, that resulted in extended identifiers
being disabled in the absence of -fextended-identifiers, were
effectively eliminated by the audit and fixes I did in 2009, however;
that todo list reflects what was left over after that audit.)
Bootstrapped with no regressions on x86_64-unknown-linux-gnu.
libcpp:
* 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.
gcc:
* doc/invoke.texi (-std=c99, -std=c11): Don't refer to corner
cases of extended identifiers.
gcc/testsuite:
* g++.dg/cpp/ucnid-2.C, g++.dg/cpp/ucnid-3.C,
gcc.dg/cpp/ucnid-11.c, gcc.dg/cpp/ucnid-12.c,
gcc.dg/cpp/ucnid-13.c, gcc.dg/cpp/ucnid-14.c,
gcc.dg/cpp/ucnid-15.c: New tests.
From-SVN: r217202
2014-11-06 22:08:52 +01:00
|
|
|
|
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.
|
|
|
|
|
|
Enable -fextended-identifiers by default.
As proposed at <https://gcc.gnu.org/ml/gcc/2014-11/msg00014.html>,
this patch enables -fextended-identifiers by default for all standard
versions including this feature (all C++ versions, C99 and above for
C, but not C90 / C94 / gnu89 / preprocessing assembler). It adds a
couple of tests for areas where I previously noted testsuite coverage
for extended identifiers was lacking, removes -fextended-identifiers
from existing tests, adds -g to various such tests to verify that
extended identifiers don't break debug info generation and removes the
test that was only there to verify that the feature was off by
default.
The current state of the feature may not correspond exactly to any
particular checklist from 2004/5 (see bug 9449) of what was wanted
before enabling the feature by default, but I don't think it's any
worse than plenty of other features supported by default before every
corner case is fully functional, and think problems can readily be
fixed incrementally.
The following aspects of extended identifiers could still do with more
work (and should be straightforward):
* C -aux-info (output should use UCNs).
* ObjC -gen-decls (output should use UCNs; associated diagnostics from
the ObjC front end should use extended characters or UCNs as
appropriate to the locale, via using %qE or identifier_to_locale).
* Use DW_AT_use_UTF8 in DWARF-3 debug info for compilation units built
with extended identifiers enabled (or unconditionally).
* cpplib diagnostics (outputting characters or UCNs as appropriate
depending on the locale, as done for identifiers in non-cpplib
diagnostics).
* C++ test for UCN linking with C and extern "C".
* Check GDB support / file issues for support if needed.
* Actual UTF-8 in identifiers (?). (Be careful about not affecting
performance for the normal fast path of lexing identifiers, if
possible.)
The following may be trickier:
* cpplib spelling preservation (required to diagnose macro
redefinition with different spellings of the same identifier in the
definition or argument names; different spellings of the name of the
macro itself are OK, however; also required for correct handling of
multiple stringizing in C++); correct output for -d (UCNs), DWARF
debug info for macros (UCNs), PCH and PCH tests. (Spelling
preservation is the issue that needs fixing to remove references to
corner cases in the documentation of -std=c99 and -std=c11 and in
c99status.html.) The idea would be to add a second pointer to
cpp_identifier that stores the original spelling (whether for
extended identifiers only, or for all identifiers); this does not
enlarge cpp_token because the resulting larger cpp_identifier
structure is no bigger than cpp_string.
* C++ translation of extended characters (including $@` and various
control characters) to UCNs in phase 1 (note diagnostics thus
needed, but not for C++11, for control characters in strings /
character constants as those UCNs invalid); a likely implementation
approach is to do translation when identifiers / strings / character
constants are lexed, together with errors for stray $@` / control
characters in program as not being valid UCNs in identifiers ($ only
if not accepted in identifiers); note that this translation should
not take place inside raw string literals.
Bootstrapped with no regressions on x86_64-unknown-linux-gnu.
libcpp:
PR preprocessor/9449
* init.c (lang_defaults): Enable extended identifiers for C++ and
C99-based standards.
gcc:
PR preprocessor/9449
* doc/cpp.texi (Character sets, Tokenization)
(Implementation-defined behavior): Don't refer to UCNs in
identifiers requiring -fextended-identifiers.
* doc/cppopts.texi (-fextended-identifiers): Document as enabled
by default for C99 and later and C++.
* doc/invoke.texi (-std=c99, -std=c11): Don't refer to extended
identifiers needing -fextended-identifiers.
gcc/testsuite:
PR preprocessor/9449
* lib/target-supports.exp (check_effective_target_ucn_nocache):
Don't use -fextended-identifiers.
* c-c++-common/cpp/normalize-3.c, c-c++-common/cpp/ucnid-2011-1.c,
g++.dg/cpp/ucn-1.C, g++.dg/cpp/ucnid-1.C, g++.dg/other/ucnid-1.C,
gcc.dg/cpp/normalize-1.c, gcc.dg/cpp/normalize-2.c,
gcc.dg/cpp/normalize-4.c: Don't use -fextended-identifiers.
* gcc.dg/cpp/ucnid-1.c: Don't use -fextended-identifiers. Use
-g3.
* gcc.dg/cpp/ucnid-10.c, gcc.dg/cpp/ucnid-2.c,
gcc.dg/cpp/ucnid-3.c, gcc.dg/cpp/ucnid-4.c, gcc.dg/cpp/ucnid-5.c,
gcc.dg/cpp/ucnid-7.c, gcc.dg/cpp/ucnid-9.c,
gcc.dg/cpp/warn-normalized-1.c, gcc.dg/cpp/warn-normalized-2.c,
gcc.dg/cpp/warn-normalized-3.c: Don't use -fextended-identifiers.
* gcc.dg/ucnid-1.c, gcc.dg/ucnid-2.c, gcc.dg/ucnid-3.c,
gcc.dg/ucnid-4.c, gcc.dg/ucnid-5.c, gcc.dg/ucnid-6.c: Don't use
-fextended-identifiers. Use -g.
* gcc.dg/ucnid-7.c, gcc.dg/ucnid-8.c: Don't use
-fextended-identifiers.
* gcc.dg/ucnid-9.c: Don't use -fextended-identifiers. Use -g.
* gcc.dg/ucnid-10.c: Don't use -fextended-identifiers.
* gcc.dg/ucnid-11.c, gcc.dg/ucnid-12.c: Don't use
-fextended-identifiers. Use -g.
* gcc.dg/ucnid-13.c: Don't use -fextended-identifiers.
* gcc.dg/cpp/ucnid-8.c: Remove test.
* gcc.dg/cpp/ucnid-10.c, gcc.dg/ucnid-14.c: New tests.
From-SVN: r217144
2014-11-05 17:19:10 +01:00
|
|
|
|
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 03:41:31 +02:00
|
|
|
|
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 16:45:36 +02:00
|
|
|
|
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 22:06:38 +02:00
|
|
|
|
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 02:06:28 +02:00
|
|
|
|
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 13:49:23 +02:00
|
|
|
|
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 18:08:53 +02:00
|
|
|
|
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 19:23:56 +02:00
|
|
|
|
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-22 21:43:02 +02:00
|
|
|
|
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 23:49:46 +02:00
|
|
|
|
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 23:41:43 +02:00
|
|
|
|
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.
|
|
|
|
|
|
options.texi: Document that Var and Init are required if CPP is given.
gcc/ChangeLog:
2014-09-04 Manuel López-Ibáñez <manu@gcc.gnu.org>
* doc/options.texi: Document that Var and Init are required if CPP
is given.
* optc-gen.awk: Require Var and Init if CPP is given.
* common.opt (Wpedantic): Use Init.
libcpp/ChangeLog:
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.
gcc/c-family/ChangeLog:
2014-09-04 Manuel López-Ibáñez <manu@gcc.gnu.org>
* c.opt (Wc90-c99-compat,Wc++-compat,Wcomment,Wendif-labels,
Winvalid-pch,Wlong-long,Wmissing-include-dirs,Wmultichar,Wpedantic,
(Wdate-time,Wtraditional,Wundef,Wvariadic-macros): Add CPP, Var
and Init.
* c-opts.c (c_common_handle_option): Do not handle here.
(sanitize_cpp_opts): Likewise.
* c-common.c (struct reason_option_codes_t): Handle
CPP_W_C90_C99_COMPAT and CPP_W_PEDANTIC.
gcc/testsuite/ChangeLog:
2014-09-04 Manuel López-Ibáñez <manu@gcc.gnu.org>
* gcc.dg/cpp/endif-pedantic2.c: More general options do not
override specific ones, but specific ones do.
From-SVN: r214904
2014-09-04 17:13:40 +02:00
|
|
|
|
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 18:06:19 +02:00
|
|
|
|
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 17:28:45 +02:00
|
|
|
|
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 04:38:24 +02:00
|
|
|
|
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.
|
|
|
|
|
|
cpplib.h (enum c_lang): Add CLK_GNUCXX1Z, CLK_CXX1Z...
libcpp/
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.
gcc/c-family/
2014-08-23 Edward Smith-Rowland <3dw4rd@verizon.net>
* c-common.h (enum cxx_dialect): Add cxx14.
* c-opts.c (set_std_cxx1y): Rename to set_std_cxx14; Use cxx14.
* c-ubsan.c (ubsan_instrument_shift): Change comment and logic from
cxx_dialect == cxx11 || cxx_dialect == cxx1y to cxx_dialect >= cxx11.
gcc/cp/
2014-08-23 Edward Smith-Rowland <3dw4rd@verizon.net>
* decl.c (compute_array_index_type, grokdeclarator,
undeduced_auto_decl): Change from cxx1y to cxx14.
*lambda.c(add_capture()): Change error message from C++1y to C++14.
* parser.c (cp_parser_unqualified_id, cp_parser_pseudo_destructor_name,
cp_parser_lambda_introducer, cp_parser_lambda_declarator_opt,
cp_parser_decltype, cp_parser_conversion_type_id,
cp_parser_simple_type_specifier, cp_parser_type_id_1,
cp_parser_template_type_arg, cp_parser_std_attribute,
cp_parser_template_declaration_after_export): Ditto.
* pt.c (tsubst): Ditto.
* semantics.c (force_paren_expr, finish_decltype_type): Ditto.
* tree.c: Change comment.
* typeck.c (comp_template_parms_position, cxx_sizeof_or_alignof_type,
cp_build_addr_expr_1, maybe_warn_about_useless_cast): Ditto.
gcc/
2014-08-23 Edward Smith-Rowland <3dw4rd@verizon.net>
* doc/invoke.texi: Change c++1y to c++14 and gnu++1y to gnu++14.
Deprecate c++1y. Change language to reflect greater confidence in C++14.
gcc/testsuite/
2014-08-23 Edward Smith-Rowland <3dw4rd@verizon.net>
* g++.dg/cpp0x/cplusplus.C: New.
* g++.dg/cpp0x/cplusplus_0x.C: New.
* g++.dg/cpp0x/auto3.C: Change c++1y to c++14.
* g++.dg/cpp0x/auto41.C: Ditto.
* g++.dg/cpp0x/auto9.C: Ditto.
* g++.dg/cpp0x/initlist26.C: Ditto.
* g++.dg/cpp0x/pr59111.C: Ditto.
* g++.dg/cpp0x/trailing2.C: Ditto.
* g++.dg/cpp1y/attr-deprecated.C: Ditto.
* g++.dg/cpp1y/auto-dtor1.C: Ditto.
* g++.dg/cpp1y/auto-fn1.C: Ditto.
* g++.dg/cpp1y/auto-fn2.C: Ditto.
* g++.dg/cpp1y/auto-fn3.C: Ditto.
* g++.dg/cpp1y/auto-fn4.C: Ditto.
* g++.dg/cpp1y/auto-fn5.C: Ditto.
* g++.dg/cpp1y/auto-fn6.C: Ditto.
* g++.dg/cpp1y/auto-fn7.C: Ditto.
* g++.dg/cpp1y/auto-fn8.C: Ditto.
* g++.dg/cpp1y/auto-fn9.C: Ditto.
* g++.dg/cpp1y/auto-fn10.C: Ditto.
* g++.dg/cpp1y/auto-fn11.C: Ditto.
* g++.dg/cpp1y/auto-fn12.C: Ditto.
* g++.dg/cpp1y/auto-fn13.C: Ditto.
* g++.dg/cpp1y/auto-fn14.C: Ditto.
* g++.dg/cpp1y/auto-fn15.C: Ditto.
* g++.dg/cpp1y/auto-fn16.C: Ditto.
* g++.dg/cpp1y/auto-fn17.C: Ditto.
* g++.dg/cpp1y/auto-fn18.C: Ditto.
* g++.dg/cpp1y/auto-fn19.C: Ditto.
* g++.dg/cpp1y/auto-fn20.C: Ditto.
* g++.dg/cpp1y/auto-fn21.C: Ditto.
* g++.dg/cpp1y/auto-fn22.C: Ditto.
* g++.dg/cpp1y/auto-fn23.C: Ditto.
* g++.dg/cpp1y/auto-fn24.C: Ditto.
* g++.dg/cpp1y/auto-fn25.C: Ditto.
* g++.dg/cpp1y/auto-mangle1.C: Ditto.
* g++.dg/cpp1y/auto-neg1.C: Ditto.
* g++.dg/cpp1y/digit-sep.C: Ditto.
* g++.dg/cpp1y/digit-sep-neg.C: Ditto.
* g++.dg/cpp1y/digit-sep-cxx11-neg.C: Ditto.
* g++.dg/cpp1y/fn-generic-member-ool.C: Ditto.
* g++.dg/cpp1y/lambda-deduce-mult.C: Ditto.
* g++.dg/cpp1y/lambda-generic.C: Ditto.
* g++.dg/cpp1y/lambda-generic-cfun.C: Ditto.
* g++.dg/cpp1y/lambda-generic-dep.C: Ditto.
* g++.dg/cpp1y/lambda-generic-mixed.C: Ditto.
* g++.dg/cpp1y/lambda-generic-udt.C: Ditto.
* g++.dg/cpp1y/lambda-generic-variadic.C: Ditto.
* g++.dg/cpp1y/lambda-generic-vla1.C: Ditto.
* g++.dg/cpp1y/lambda-generic-x.C: Ditto.
* g++.dg/cpp1y/lambda-generic-xcfun.C: Ditto.
* g++.dg/cpp1y/lambda-generic-xudt.C: Ditto.
* g++.dg/cpp1y/lambda-init.C: Ditto.
* g++.dg/cpp1y/lambda-init1.C: Ditto.
* g++.dg/cpp1y/lambda-init2.C: Ditto.
* g++.dg/cpp1y/lambda-init3.C: Ditto.
* g++.dg/cpp1y/lambda-init4.C: Ditto.
* g++.dg/cpp1y/lambda-init5.C: Ditto.
* g++.dg/cpp1y/lambda-init6.C: Ditto.
* g++.dg/cpp1y/lambda-init7.C: Ditto.
* g++.dg/cpp1y/lambda-init8.C: Ditto.
* g++.dg/cpp1y/lambda-init9.C: Ditto.
* g++.dg/cpp1y/mangle1.C: Ditto.
* g++.dg/cpp1y/pr57640.C: Ditto.
* g++.dg/cpp1y/pr57644.C: Ditto.
* g++.dg/cpp1y/pr58500.C: Ditto.
* g++.dg/cpp1y/pr58533.C: Ditto.
* g++.dg/cpp1y/pr58534.C: Ditto.
* g++.dg/cpp1y/pr58535.C: Ditto.
* g++.dg/cpp1y/pr58536.C: Ditto.
* g++.dg/cpp1y/pr58548.C: Ditto.
* g++.dg/cpp1y/pr58549.C: Ditto.
* g++.dg/cpp1y/pr58637.C: Ditto.
* g++.dg/cpp1y/pr58708.C: Ditto.
* g++.dg/cpp1y/pr59110.C: Ditto.
* g++.dg/cpp1y/pr59112.C: Ditto.
* g++.dg/cpp1y/pr59113.C: Ditto.
* g++.dg/cpp1y/pr59629.C: Ditto.
* g++.dg/cpp1y/pr59635.C: Ditto.
* g++.dg/cpp1y/pr59636.C: Ditto.
* g++.dg/cpp1y/pr59638.C: Ditto.
* g++.dg/cpp1y/pr59867.C: Ditto.
* g++.dg/cpp1y/pr60033.C: Ditto.
* g++.dg/cpp1y/pr60052.C: Ditto.
* g++.dg/cpp1y/pr60053.C: Ditto.
* g++.dg/cpp1y/pr60054.C: Ditto.
* g++.dg/cpp1y/pr60064.C: Ditto.
* g++.dg/cpp1y/pr60065.C: Ditto.
* g++.dg/cpp1y/pr60190.C: Ditto.
* g++.dg/cpp1y/pr60311.C: Ditto.
* g++.dg/cpp1y/pr60332.C: Ditto.
* g++.dg/cpp1y/pr60376.C: Ditto.
* g++.dg/cpp1y/pr60377.C: Ditto.
* g++.dg/cpp1y/pr60384.C: Ditto.
* g++.dg/cpp1y/pr60390.C: Ditto.
* g++.dg/cpp1y/pr60391.C: Ditto.
* g++.dg/cpp1y/pr60393.C: Ditto.
* g++.dg/cpp1y/pr60573.C: Ditto.
* g++.dg/cpp1y/pr60626.C: Ditto.
* g++.dg/cpp1y/pr60627.C: Ditto.
* g++.dg/cpp1y/regress1.C: Ditto.
* g++.dg/cpp1y/system-binary-constants-1.C: Ditto.
* g++.dg/cpp1y/udlit-char-template.C: Ditto.
* g++.dg/cpp1y/udlit-char-template-neg.C: Ditto.
* g++.dg/cpp1y/udlit-empty-string-neg.C: Ditto.
* g++.dg/cpp1y/udlit-enc-prefix-neg.C: Ditto.
* g++.dg/cpp1y/udlit-userdef-string.C: Ditto.
* g++.dg/cpp1y/var-templ1.C: Ditto.
* g++.dg/cpp1y/var-templ2.C: Ditto.
* g++.dg/cpp1y/var-templ3.C: Ditto.
* g++.dg/cpp1y/var-templ4.C: Ditto.
* g++.dg/cpp1y/var-templ5.C: Ditto.
* g++.dg/cpp1y/var-templ6.C: Ditto.
* g++.dg/cpp1y/var-templ7.C: Ditto.
* g++.dg/cpp1y/vla1.C: Ditto.
* g++.dg/cpp1y/vla2.C: Ditto.
* g++.dg/cpp1y/vla3.C: Ditto.
* g++.dg/cpp1y/vla4.C: Ditto.
* g++.dg/cpp1y/vla5.C: Ditto.
* g++.dg/cpp1y/vla8.C: Ditto.
* g++.dg/cpp1y/vla9.C: Ditto.
* g++.dg/cpp1y/vla10.C: Ditto.
* g++.dg/cpp1y/vla11.C: Ditto.
* g++.dg/cpp1y/vla12.C: Ditto.
* g++.dg/cpp1y/vla13.C: Ditto.
* g++.dg/cpp1y/vla-initlist1.C: Ditto.
* g++.dg/ext/vector23.C: Ditto.
* g++.dg/ext/vla11.C: Ditto.
* gcc/testsuite/g++.dg/ubsan/cxx1y-vla.C: Ditto.
* g++.dg/warn/Wvla-2.C: Ditto.
* g++.dg/debug/dwarf2/auto1.C: Ditto.
* g++.dg/cpp1z/typename-tmpl-tmpl-parm-ped-neg.C: Ditto.
* g++.dg/cpp1y/cplusplus.C: Check for exact date.
* g++.dg/cpp1y/system-binary-constants-1.C: Check C++14 instead of C++1y
in error message.
* g++.dg/system-binary-constants-1.C: Ditto.
* g++.dg/cpp1y/cplusplus_1y.C: New.
* g++.dg/cpp1z/cplusplus.C: New.
* lib/target-supports.exp:
(check_effective_target_c++1y*): Rename to check_effective_target_c++14*
(check_effective_target_c++11_only): Call check_effective_target_c++14;
(check_effective_target_c++11_down): Ditto.
From-SVN: r214400
2014-08-23 18:50:22 +02:00
|
|
|
|
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 06:12:58 +02:00
|
|
|
|
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 17:52:02 +02:00
|
|
|
|
2014-08-19 Marek Polacek <polacek@redhat.com>
|
|
|
|
|
|
|
|
|
|
* lex.c (_cpp_lex_direct): Fix a typo.
|
|
|
|
|
|
2014-08-19 07:34:31 +02:00
|
|
|
|
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 08:10:49 +02:00
|
|
|
|
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 19:09:38 +02:00
|
|
|
|
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 12:33:27 +02:00
|
|
|
|
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-11 00:26:50 +02:00
|
|
|
|
2014-07-10 Edward Smith-Rowland <3dw4rd@verizon.net>
|
|
|
|
|
Jonathan Wakely <jwakely@redhat.com>
|
|
|
|
|
|
2014-07-11 16:49:27 +02:00
|
|
|
|
PR preprocessor/61389
|
2014-07-11 00:26:50 +02:00
|
|
|
|
* 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 15:33:58 +02:00
|
|
|
|
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-05 13:17:25 +02:00
|
|
|
|
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 10:19:02 +02:00
|
|
|
|
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 20:54:12 +02:00
|
|
|
|
2014-05-21 Marek Polacek <polacek@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR c/61212
|
|
|
|
|
* files.c (find_file_in_dir): Add parens around &&.
|
|
|
|
|
|
2014-05-21 02:35:29 +02:00
|
|
|
|
2014-05-20 Edward Smith-Rowland <3dw4rd@verizon.net>
|
|
|
|
|
|
2014-05-21 20:54:12 +02:00
|
|
|
|
PR c++/61038
|
2014-05-21 02:35:29 +02:00
|
|
|
|
* 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 10:01:32 +02:00
|
|
|
|
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 10:50:22 +02:00
|
|
|
|
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 12:24:38 +02:00
|
|
|
|
2014-05-07 Richard Biener <rguenther@suse.de>
|
|
|
|
|
|
|
|
|
|
* configure.ac: Always set need_64bit_hwint to yes.
|
|
|
|
|
* configure: Regenerated.
|
|
|
|
|
|
2014-04-22 14:30:59 +02:00
|
|
|
|
2014-04-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
|
|
|
|
|
|
|
|
|
|
* lex.c: Remove Solaris 9 reference.
|
|
|
|
|
|
2014-02-24 16:08:00 +01:00
|
|
|
|
2014-02-24 Walter Lee <walt@tilera.com>
|
|
|
|
|
|
|
|
|
|
* configure.ac: Change "tilepro" triplet to "tilepro*".
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
|
2014-02-19 07:05:55 +01:00
|
|
|
|
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 17:42:24 +01:00
|
|
|
|
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.
|
|
|
|
|
|
PR preprocessor/58580 - preprocessor goes OOM with warning for zero literals
In this problem report, the compiler is fed a (bogus) translation unit
in which some literals contain bytes whose value is zero. The
preprocessor detects that and proceeds to emit diagnostics for that
king of bogus literals. But then when the diagnostics machinery
re-reads the input file again to display the bogus literals with a
caret, it attempts to calculate the length of each of the lines it got
using fgets. The line length calculation is done using strlen. But
that doesn't work well when the content of the line can have several
zero bytes. The result is that the read_line never sees the end of
the line because strlen repeatedly reports that the line ends before
the end-of-line character; so read_line thinks its buffer for reading
the line is too small; it thus increases the buffer, leading to a huge
memory consumption and disaster.
Here is what this patch does.
location_get_source_line is modified to return the length of a source
line that can now contain bytes with zero value.
diagnostic_show_locus() is then modified to consider that a line can
have characters of value zero, and so just shows a white space when
instructed to display one of these characters.
Additionally location_get_source_line is modified to avoid re-reading
each and every line from the beginning of the file until it reaches
the line number N that it is instructed to get; this was leading to
annoying quadratic behaviour when reading adjacent lines near the end
of (big) files. So a cache is now associated to the file opened in
text mode. When the content of the file is read, that content is
stashed in the file cache. That file cache is searched for line
delimiters. A number of line positions are saved in the cache and a
number of file caches are kept in memory. That way when
location_get_source_line is asked to read line N + 1, it just has to
start reading from line N that it has already read.
libcpp/ChangeLog:
* include/line-map.h (linemap_get_file_highest_location): Declare
new function.
* line-map.c (linemap_get_file_highest_location): Define it.
gcc/ChangeLog:
* input.h (location_get_source_line): Take an additional line_size
parameter.
(void diagnostics_file_cache_fini): Declare new function.
* input.c (struct fcache): New type.
(fcache_tab_size, fcache_buffer_size, fcache_line_record_size):
New static constants.
(diagnostic_file_cache_init, total_lines_num)
(lookup_file_in_cache_tab, evicted_cache_tab_entry)
(add_file_to_cache_tab, lookup_or_add_file_to_cache_tab)
(needs_read, needs_grow, maybe_grow, read_data, maybe_read_data)
(get_next_line, read_next_line, goto_next_line, read_line_num):
New static function definitions.
(diagnostic_file_cache_fini): New function.
(location_get_source_line): Take an additional output line_len
parameter. Re-write using lookup_or_add_file_to_cache_tab and
read_line_num.
* diagnostic.c (diagnostic_finish): Call
diagnostic_file_cache_fini.
(adjust_line): Take an additional input parameter for the length
of the line, rather than calculating it with strlen.
(diagnostic_show_locus): Adjust the use of
location_get_source_line and adjust_line with respect to their new
signature. While displaying a line now, do not stop at the first
null byte. Rather, display the zero byte as a space and keep
going until we reach the size of the line.
* Makefile.in: Add vec.o to OBJS-libcommon
gcc/testsuite/ChangeLog:
* c-c++-common/cpp/warning-zero-in-literals-1.c: New test file.
Signed-off-by: Dodji Seketeli <dodji@seketeli.org>
From-SVN: r206957
2014-01-23 10:13:08 +01:00
|
|
|
|
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 23:24:45 +01:00
|
|
|
|
2014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
|
|
|
|
|
|
|
|
|
|
Update copyright years
|
|
|
|
|
|
2013-12-10 02:23:37 +01:00
|
|
|
|
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 17:21:42 +01:00
|
|
|
|
2013-11-18 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* lex.c (search_line_fast): Correct for little endian.
|
|
|
|
|
|
2013-11-16 01:05:08 +01:00
|
|
|
|
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 03:15:26 +01:00
|
|
|
|
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 23:28:08 +01:00
|
|
|
|
2013-11-06 Tobias Burnus <burnus@net-b.de>
|
|
|
|
|
|
|
|
|
|
* macro.c (_cpp_builtin_macro_text): Correct
|
|
|
|
|
wording of two warnings.
|
|
|
|
|
|
2013-11-05 21:27:22 +01:00
|
|
|
|
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 15:01:23 +01:00
|
|
|
|
2013-10-31 Edward Smith-Rowland <3dw4rd@verizon.net>
|
|
|
|
|
|
2013-11-05 21:27:22 +01:00
|
|
|
|
Implement C++14 digit separators.
|
2013-10-31 15:01:23 +01:00
|
|
|
|
* 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 22:33:55 +02:00
|
|
|
|
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 15:51:38 +02:00
|
|
|
|
2013-08-07 Richard Earnshaw <rearnsha@arm.com>
|
|
|
|
|
|
|
|
|
|
* configure.ac: Set need_64bit_hwint for all arm targets.
|
|
|
|
|
* configure: Regenerated.
|
|
|
|
|
|
2013-07-21 04:28:03 +02:00
|
|
|
|
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 18:40:49 +02:00
|
|
|
|
2013-07-10 Jakub Jelinek <jakub@redhat.com>
|
|
|
|
|
|
2013-07-10 18:52:19 +02:00
|
|
|
|
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.
|
|
|
|
|
|
2013-07-10 18:49:24 +02:00
|
|
|
|
* include/cpplib.h (cpp_token_val_index): Change parameter type to
|
|
|
|
|
const cpp_token *.
|
|
|
|
|
* lex.c (cpp_token_val_index): Likewise.
|
|
|
|
|
|
2013-07-10 18:40:49 +02:00
|
|
|
|
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-29 05:41:58 +02:00
|
|
|
|
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 19:31:45 +02:00
|
|
|
|
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 23:36:57 +02:00
|
|
|
|
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 21:33:54 +02:00
|
|
|
|
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 17:11:54 +02:00
|
|
|
|
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 17:18:40 +01:00
|
|
|
|
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 22:06:04 +01:00
|
|
|
|
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 10:58:47 +01:00
|
|
|
|
2013-02-28 Jakub Jelinek <jakub@redhat.com>
|
|
|
|
|
|
2013-02-28 20:57:56 +01:00
|
|
|
|
* 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.
|
|
|
|
|
|
2013-02-28 10:58:47 +01:00
|
|
|
|
* 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-14 03:55:42 +01:00
|
|
|
|
2013-02-13 Ed Smith-Rowland <3dw4rd@verizon.net>
|
|
|
|
|
|
|
|
|
|
PR c++/55582
|
2013-04-24 21:33:54 +02:00
|
|
|
|
* lex.c (lex_raw_string): Allow string literal with suffix
|
2013-02-14 03:55:42 +01:00
|
|
|
|
beginning with 's' to be parsed as a C++11 user-defined literal.
|
|
|
|
|
|
2013-01-14 19:13:59 +01:00
|
|
|
|
2013-01-14 Richard Sandiford <rdsandiford@googlemail.com>
|
|
|
|
|
|
|
|
|
|
Update copyright years.
|
|
|
|
|
|
2013-01-04 16:30:24 +01:00
|
|
|
|
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 21:06:49 +01:00
|
|
|
|
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 18:19:47 +01:00
|
|
|
|
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 22:28:30 +01:00
|
|
|
|
2012-11-21 Steve Ellcey <sellcey@mips.com>
|
|
|
|
|
|
|
|
|
|
PR pch/55399
|
|
|
|
|
* files.c (pch_open_file): Fix check for implicit_preinclude.
|
|
|
|
|
|
2012-11-16 18:14:05 +01:00
|
|
|
|
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-10 01:08:49 +01:00
|
|
|
|
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 19:24:58 +02:00
|
|
|
|
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.
|
|
|
|
|
|
gcc:
* config.gcc (*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu |
*-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu): Use
glibc-c.o in c_target_objs and cxx_target_objs. Use t-glibc in
tmake_file. Set target_has_targetcm.
(tilegx-*-linux*, tilepro-*-linux*): Append to c_target_objs and
cxx_target_objs rather than overriding previous value.
* config/glibc-c.c, config/t-glibc: New.
* doc/tm.texi.in (TARGET_C_PREINCLUDE): New @hook.
* doc/tm.texi: Regenerate.
* hooks.c (hook_constcharptr_void_null): New.
* hooks.h (hook_constcharptr_void_null): Declare.
gcc/c-family:
* c-common.h (pch_cpp_save_state): Declare.
* c-target.def (c_preinclude): New hook.
* c-opts.c (done_preinclude): New.
(push_command_line_include): Handle default preincluded header.
(cb_file_change): Call pch_cpp_save_state when calling
push_command_line_include.
* c-pch.c (pch_ready_to_save_cpp_state, pch_cpp_state_saved)
(pch_cpp_save_state): New.
(pch_init): Call pch_cpp_save_state conditionally, instead of
calling cpp_save_state.
gcc/testsuite:
* gcc.dg/c99-predef-1.c: New test.
* gcc.dg/cpp/cmdlne-dU-1.c, gcc.dg/cpp/cmdlne-dU-2.c,
gcc.dg/cpp/cmdlne-dU-3.c, gcc.dg/cpp/cmdlne-dU-4.c,
gcc.dg/cpp/cmdlne-dU-5.c, gcc.dg/cpp/cmdlne-dU-6.c,
gcc.dg/cpp/cmdlne-dU-7.c, gcc.dg/cpp/cmdlne-dU-8.c,
gcc.dg/cpp/cmdlne-dU-9.c, gcc.dg/cpp/cmdlne-dU-10.c,
gcc.dg/cpp/cmdlne-dU-11.c, gcc.dg/cpp/cmdlne-dU-12.c,
gcc.dg/cpp/cmdlne-dU-13.c, gcc.dg/cpp/cmdlne-dU-14.c,
gcc.dg/cpp/cmdlne-dU-15.c, gcc.dg/cpp/cmdlne-dU-16.c,
gcc.dg/cpp/cmdlne-dU-17.c, gcc.dg/cpp/cmdlne-dU-18.c,
gcc.dg/cpp/cmdlne-dU-19.c, gcc.dg/cpp/cmdlne-dU-20.c,
gcc.dg/cpp/cmdlne-dU-21.c, gcc.dg/cpp/cmdlne-dU-22.c,
gcc.dg/cpp/mi5.c, gcc.dg/cpp/multiline.c: Add -nostdinc to
dg-options.
libcpp:
* 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.
From-SVN: r192715
2012-10-23 16:55:55 +02:00
|
|
|
|
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 22:08:57 +02:00
|
|
|
|
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 17:33:11 +02:00
|
|
|
|
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 23:32:29 +02:00
|
|
|
|
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 15:19:33 +02:00
|
|
|
|
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 21:56:42 +02:00
|
|
|
|
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-08-27 17:41:38 +02:00
|
|
|
|
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.
|
|
|
|
|
|
backport: As described in http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html...
Merge from cxx-conversion branch (http://gcc.gnu.org/wiki/cxx-conversion).
As described in http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html, this patch
changes the default bootstrap process so that stage 1 always builds with a C++
compiler.
Other than the bootstrap change, the patch makes no functional changes to the
compiler. Everything should build as it does now in trunk. The main
changes in this patch are:
1- Configuration changes.
2- Re-write of VEC.
3- Re-write of gengtype to support C++ templates and
user-provided marking functions.
4- New hash table class.
5- Re-write double_int.
6- Implement tree macros as inline functions so they can be
called from gdb.
As discussed before, several of these changes do not fully change
the call sites to use the new APIs.
The bootstrap changes have already been tested on a wide range of
targets (http://gcc.gnu.org/wiki/CppBuildStatus). Additionally,
I have tested the merged trunk on: x86_64-unknown-linux-gnu,
mips64el-unknown-linux-gnu, powerpc64-unknown-linux-gnu,
i686-pc-linux-gnu, and ia64-unknown-linux-gnu.
ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch.
* Makefile.tpl (STAGE[+id+]_CXXFLAGS): Remove
POSTSTAGE1_CONFIGURE_FLAGS.
* Makefile.in: Regenerate.
* configure.ac (ENABLE_BUILD_WITH_CXX): Remove. Update all users.
Force C++ when bootstrapping.
* configure: Regenerate.
libcpp/ChangeLog
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.
gcc/ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Configury.
* configure.ac (CXX_FOR_BUILD): Define and substitute.
(BUILD_CXXFLAGS): Define.
Remove all handlers of ENABLE_BUILD_WITH_CXX.
Force all build to be with C++.
* Makefile.in (BUILD_CXXFLAGS): Use it.
Remove all handlers of ENABLE_BUILD_WITH_CXX.
* configure: Regenerate.
* config.in: Regenerate.
* doc/install.texi: Remove documentation for --enable-build-with-cxx
and --enable-build-poststage1-with-cxx.
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Re-implement VEC in C++.
* vec.c (vec_heap_free): Convert into a template function.
(vec_gc_o_reserve_1): Make extern.
(vec_gc_p_reserve): Remove.
(vec_gc_p_reserve_exact): Remove.
(vec_gc_o_reserve): Remove.
(vec_gc_o_reserve_exact): Remove.
(vec_heap_o_reserve_1): Make extern.
(vec_heap_p_reserve): Remove.
(vec_heap_p_reserve_exact): Remove.
(vec_heap_o_reserve): Remove.
(vec_heap_o_reserve_exact): Remove.
(vec_stack_p_reserve): Remove.
(vec_stack_p_reserve_exact): Remove.
* vec.h (VEC_CHECK_INFO, VEC_CHECK_DECL, VEC_CHECK_PASS,
VEC_ASSERT, VEC_ASSERT_FAIL, vec_assert_fail): Move earlier
in the file.
(VEC): Define to vec_t<T>.
(vec_allocation_t): Define.
(struct vec_prefix): Move earlier in the file.
(vec_t<T>): New template.
(DEF_VEC_I, DEF_VECL_ALLOC_I, DEF_VEC_P, DEF_VEC_ALLOC_P,
DEF_VEC_O, DEF_VEC_ALLOC_P, DEF_VEC_O, DEF_VEC_ALLOC_O,
DEF_VEC_ALLOC_P_STACK, DEF_VEC_ALLOC_O_STACK,
DEF_VEC_ALLOC_I_STACK): Expand to 'struct vec_swallow_trailing_semi'.
(DEF_VEC_A): Provide template instantiations for
GC/PCH markers that do not traverse the vector.
(vec_stack_p_reserve): Remove.
(vec_stack_p_reserve_exact): Remove.
(vec_stack_p_reserve_exact_1): Remove.
(vec_stack_o_reserve): Remove.
(vec_stack_o_reserve_exact): Remove.
(vec_stack_free): Re-write as a template function.
(vec_reserve): New template function.
(vec_reserve_exact): New template function.
(vec_heap_free): New template function if GATHER_STATISTICS is
defined. Otherwise, macro that expands to free().
(VEC_length_1): New template function.
(VEC_length): Call it.
(VEC_empty_1): New template function.
(VEC_empty): Call it.
(VEC_address_1): New template function.
(VEC_address): Call it.
(VEC_last_1): New template function.
(VEC_last): Call it. Change return type to T&.
Change all users that used VEC_Os.
(VEC_index_1): New template function.
(VEC_index): Call it. Return a T& instead of a T*.
Update all callers that were using VEC_O before.
(VEC_iterate_1): New template function.
(VEC_iterate): Call it.
(VEC_embedded_size_1): New template function.
(VEC_embedded_size): Call it.
(VEC_embedded_init_1): New template function.
(VEC_embedded_init): Call it.
(VEC_alloc_1): New template function.
(VEC_alloc): Call it. If A is 'stack', call XALLOCAVAR to
do the allocation.
(VEC_free_1): New template function.
(VEC_free): Call it.
(VEC_copy_1): New template function.
(VEC_copy): Call it.
(VEC_space_1): New template function
(VEC_space): Call it.
(VEC_reserve_1): New template function.
(VEC_reserve): Call it.
(VEC_reserve_exact_1): New template function.
(VEC_reserve_exact): Call it.
(VEC_splice_1): New template function.
(VEC_splice): Call it.
(VEC_safe_splice_1): New template function.
(VEC_safe_splice): Call it.
(VEC_quick_push_1): New template function. Create two overloads, one
accepting T, the other accepting T *. Update all callers
where T and T * are ambiguous.
(VEC_quick_push): Call it.
(VEC_safe_push_1): New template function. Create two overloads, one
accepting T, the other accepting T *. Update all callers
where T and T * are ambiguous.
(VEC_safe_push): Call it.
(VEC_pop_1): New template function.
(VEC_pop): Call it.
(VEC_truncate_1): New template function.
(VEC_truncate): Call it.
(VEC_safe_grow_1): New template function.
(VEC_safe_grow): Call it.
(VEC_safe_grow_cleared_1): New template function.
(VEC_safe_grow_cleared): Call it.
(VEC_replace_1): New template function.
(VEC_replace): Call it. Always accept T instead of T*.
Update all callers that used VEC_Os.
(VEC_quick_insert_1): New template function.
(VEC_quick_insert): Call it.
(VEC_safe_insert_1): New template function.
(VEC_safe_insert): Call it.
(VEC_ordered_remove_1): New template function.
(VEC_ordered_remove): Call it.
(VEC_unordered_remove_1): New template function.
(VEC_unordered_remove): Call it.
(VEC_block_remove_1): New template function.
(VEC_block_remove): Call it.
(VEC_lower_bound_1): New template function.
(VEC_lower_bound): Call it.
(VEC_OP): Remove.
(DEF_VEC_FUNC_P): Remove.
(DEF_VEC_ALLOC_FUNC_P): Remove.
(DEF_VEC_NONALLOC_FUNCS_P): Remove.
(DEF_VEC_FUNC_O): Remove.
(DEF_VEC_ALLOC_FUNC_O): Remove.
(DEF_VEC_NONALLOC_FUNCS_O): Remove.
(DEF_VEC_ALLOC_FUNC_I): Remove.
(DEF_VEC_NONALLOC_FUNCS_I): Remove.
(DEF_VEC_ALLOC_FUNC_P_STACK): Remove.
(DEF_VEC_ALLOC_FUNC_O_STACK): Remove.
(DEF_VEC_ALLOC_FUNC_I_STACK): Remove.
(vec_reserve_exact): New template function.
* gengtype-lex.l (DEF_VEC_ALLOC_[IOP]/{EOID}): Remove.
* gengtype-parse.c (token_names): Remove DEF_VEC_ALLOC_[IOP].
(typedef_name): Emit vec_t<C1> instead of VEC_C1_C2.
(def_vec_alloc): Remove. Update all callers.
* gengtype.c (filter_type_name): New.
(output_mangled_typename): Call it.
(write_func_for_structure): Likewise.
(write_types): Likewise.
(write_root): Likewise.
(write_typed_alloc_def): Likewise.
(note_def_vec): Emit vec_t<TYPE_NAME> instead of VEC_TYPE_NAME_base.
(note_def_vec_alloc): Remove.
* gengtype.h (note_def_vec_alloc): Remove.
(DEFVEC_ALLOC): Remove token code.
* df-scan.c (df_bb_verify): Remove call to df_free_collection_rec
inside the insn traversal loop.
* gimplify.c (gimplify_compound_lval): Rename STACK to EXPR_STACK.
* ipa-inline.c (inline_small_functions): Rename HEAP to EDGE_HEAP.
* reg-stack.c (stack): Rename to STACK_PTR. Update all users.
* tree-vrp.c (stack): Rename to EQUIV_STACK. Update all users.
* config/bfin/bfin.c (hwloop_optimize): Update some calls to
VEC_* for vectors of non-pointers.
* config/c6x/c6x.c (try_rename_operands): Likewise.
(reshuffle_units): Likewise.
* config/mips/mips.c (mips_multi_start): Likewise.
(mips_multi_add): Likewise.
(mips_multi_copy_insn): Likewise.
(mips_multi_set_operand): Likewise.
* hw-doloop.c (discover_loop): Likewise.
(discover_loops): Likewise.
(reorg_loops): Likewise.
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. C++ support in gengtype.
* coretypes.h (gt_pointer_operator): Move from ...
* ggc.h: ... here.
* doc/gty.texi: Document support for C++ templates and
user-provided markers.
* gcc/gengtype-lex.l: Update copyright year.
Remove support for recognizing DEF_VEC_O, DEF_VEC_P and
DEFVEC_I.
* gengtype-parse.c: Update copyright year.
(token_names): Remove DEF_VEC_O, DEF_VEC_P and DEF_VEC_I.
(require_template_declaration): New.
(typedef_name): Call it.
(type): Replace IS_UNION with KIND. Replace all users.
(def_vec): Remove. Update all users.
* gengtype-state.c (type_lineloc): Handle TYPE_USER_STRUCT.
(write_state_user_struct_type): New.
(write_state_type): Call it.
(read_state_user_struct_type): New.
(read_state_type): Call it.
* gengtype.c: Update copyright year.
(dump_pair): Move declaration to the top.
(dump_type): Likewise.
(dump_type_list): Likewise.
(dbgprint_count_type_at): Handle TYPE_USER_STRUCT.
(create_user_defined_type): New.
(resolve_typedef): Call it.
(new_structure): Replace argument ISUNION with KIND.
Change users to refer to KIND directly.
Update all callers.
(find_structure): Likewise.
(set_gc_used_type): Handle TYPE_USER_STRUCT.
(create_file): Update HDR to include new copyright year.
(struct walk_type_data): Add field IN_PTR_FIELD.
(output_mangled_typename): Handle TYPE_USER_STRUCT.
(walk_type): Set D->IN_PTR_FIELD when walking a TYPE_POINTER.
Clear it afterwards.
Handle TYPE_USER_STRUCT.
(write_types_process_field): Handle TYPE_USER_STRUCT.
(get_type_specifier): Move earlier in the file.
(write_type_decl): New.
(write_marker_function_name): New.
(write_user_func_for_structure_ptr): New.
(write_user_func_for_structure_body): New.
(write_user_marking_functions): New.
(write_func_for_structure): Call write_marker_function_name
and write_type_decl.
Do not call walk_type for TYPE_USER_STRUCT. Emit a call to the user
function directly.
Call write_user_marking_functions on TYPE_USER_STRUCTs.
(write_types_local_user_process_field): New.
(write_pch_user_walking_for_structure_body): New.
(write_pch_user_walking_functions): New.
(write_types_local_process_field): Handle TYPE_USER_STRUCT.
(write_local_func_for_structure): Do not call walk_type for
TYPE_USER_STRUCT. Instead, emit the call to gt_pch_nx directly.
Call write_pch_user_walking_functions for TYPE_USER_STRUCTs.
(write_root): Handle TYPE_USER_STRUCT.
(vec_prefix_type): Remove. Update all users.
(note_def_vec): Remove. Update all users.
(dump_typekind): Handle TYPE_USER_STRUCT.
(dump_type): Initialize SEEN_TYPES, if needed.
Handle TYPE_USER_STRUCT.
(dump_everything): Do not initialize SEEN_TYPES.
* gengtype.h: Update copyright year.
(enum typekind): Add TYPE_USER_STRUCT.
(union_or_struct_p): Rename from UNION_OR_STRUCT_P.
Convert into function.
Add an overload taking const_type_p.
Update all callers.
(new_structure): Change second field to type enum typekind.
Update all users.
(find_structure): Likewise.
(note_def_vec): Remove.
(DEFVEC_OP): Remove.
(DEFVEC_I): Remove.
* ggc-page.c (gt_ggc_mx): Add entry points for marking
'const char *&', 'unsigned char *&' and 'unsigned char&'.
* ggc-zone.c (gt_ggc_mx): Add entry points for marking
'const char *&' and 'unsigned char *&'.
* stringpool.c (gt_pch_nx): Add entry points for marking
'const char *&', 'unsigned char *&' and 'unsigned char&'.
Add an entry point for the overload taking arguments 'unsigned char
*', 'gt_pointer_operator' and 'void *'.
* vec.h (struct vec_prefix): Remove GTY marker.
(struct vec_t): Remove GTY((length)) attribute from field 'vec'.
(gt_ggc_mx (vec_t<T> *)): New template function.
(gt_pch_nx (vec_t<T> *)): New template function.
(gt_pch_nx (vec_t<T *> *, gt_pointer_operator, void *)): New template
function.
(gt_pch_nx (vec_t<T> *, gt_pointer_operator, void *)): New template
function.
* basic-block.h (struct edge_def): Mark GTY((user)).
Remove all GTY markers from fields.
(gt_ggc_mx): Declare.
(gt_pch_nx): Declare.
* tree-cfg.c (gt_ggc_mx): New.
(gt_pch_nx): New.
* gengtype-lex.l (USER_GTY): Add pattern for "user".
* gengtype-parse.c (option): Handle USER_GTY.
(opts_have): New.
(type): Call it.
If the keyword 'user' is used, do not walk the fields
of the structure.
* gengtype.h (USER_GTY): Add.
* doc/gty.texi: Update.
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge cxx-conversion branch. Implement C++ hash table.
* hash-table.h: New. Implementation borrowed from libiberty/hashtab.c.
* hash-table.c: Likewise.
* tree-ssa-tail-merge.c: Include hash-table.h instead of hashtab.h.
(static htab_t same_succ_htab): Change type to hash_table;
move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(same_succ_print_traverse): Make extern ssa_.... Change callers.
Remove void* casting.
(same_succ_hash): Likewise.
(same_succ_equal): Likewise.
(same_succ_delete): Likewise.
* tree-ssa-threadupdate.c: Include hash-table.h.
(struct local_info): Rename to ssa_local_info_t to avoid overloading
the type name local_info with the variable name local_info.
(static htab_t redirection_data): Change type to hash_table.
Move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(redirection_data_hash): Make extern ssa_.... Change callers.
Remove void* casting.
(redirection_data_eq): Likewise.
(fix_duplicate_block_edges): Likewise.
(create_duplicates): Likewise.
(fixup_template_block): Likewise.
(redirect_edges): Likewise.
(lookup_redirection_data): Change types associated with the hash table
from void* to their actual type. Remove unnecessary casts.
* tree-ssa-ccp.c: Include hash-table.h.
(typedef gimple_htab): New. Uses hash_table. Replace specific uses
of htab_t with gimple_htab. Change users to invoke member functions.
Move specification of helper functions from create call to declaration.
* tree-ssa-coalesce.c: Include hash-table.h instead of hashtab.h.
(hash_ssa_name_by_var): Make extern. Remove void* casting.
(eq_ssa_name_by_var): Likewise.
(coalesce_ssa_name): Change type of local static htab_t ssa_name_hash
to hash_table. Change users to invoke member functions.
Move specification of helper functions from create call to declaration.
* coverage.c: Include hash-table.h instead of hashtab.h.
(static htab_t counts_hash): Change type to hash_table;
move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(htab_counts_entry_hash): Make extern. Rename with coverage_... instead
of htab_... Remove void* casting.
(htab_counts_entry_eq): Likewise.
(htab_counts_entry_del): Likewise.
* tree-ssa-pre.c: Include hash-table.h instead of hashtab.h.
(static htab_t expression_to_id): Change type to hash_table.
Move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(static htab_t phi_translate_table): Likewise.
(pre_expr_eq): Make extern ssa_.... Change callers.
Remove void* casting.
(pre_expr_hash): Likewise.
(expr_pred_trans_hash): Likewise.
(expr_pred_trans_eq): Likewise.
(alloc_expression_id): Change types associated with the hash table
from void* to their actual type. Remove unnecessary casts.
(lookup_expression_id): Likewise.
(phi_trans_lookup): Likewise.
(phi_trans_add): Likewise.
* stringpool.c: Rename uses of libcpp typedef hash_table to
cpp_hash_table.
* Makefile.in: Add hash-table.o to OBJS-libcommon-target.
Add $(HASH_TABLE_H). Add new dependences on $(HASH_TABLE_H).
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge from cxx-conversion branch. Re-write double_int in C++.
* hash-table.h
(typedef double_int): Change to struct (POD).
(double_int::make): New overloads for int to double-int conversion.
(double_int::mask): New.
(double_int::max_value): New.
(double_int::min_value): New.
(double_int::operator ++): New.
(double_int::operator --): New.
(double_int::operator *=): New.
(double_int::operator +=): New.
(double_int::operator -=): New.
(double_int::to_signed): New.
(double_int::to_unsigned): New.
(double_int::fits_unsigned): New.
(double_int::fits_signed): New.
(double_int::fits): New.
(double_int::trailing_zeros): New.
(double_int::popcount): New.
(double_int::multiple_of): New.
(double_int::set_bit): New.
(double_int::mul_with_sign): New.
(double_int::operator * (binary)): New.
(double_int::operator + (binary)): New.
(double_int::operator - (binary)): New.
(double_int::operator - (unary)): New.
(double_int::operator ~ (unary)): New.
(double_int::operator & (binary)): New.
(double_int::operator | (binary)): New.
(double_int::operator ^ (binary)): New.
(double_int::and_not): New.
(double_int::lshift): New.
(double_int::rshift): New.
(double_int::alshift): New.
(double_int::arshift): New.
(double_int::llshift): New.
(double_int::lrshift): New.
(double_int::lrotate): New.
(double_int::rrotate): New.
(double_int::div): New.
(double_int::sdiv): New.
(double_int::udiv): New.
(double_int::mod): New.
(double_int::smod): New.
(double_int::umod): New.
(double_int::divmod): New.
(double_int::sdivmod): New.
(double_int::udivmod): New.
(double_int::ext): New.
(double_int::zext): New.
(double_int::sext): New.
(double_int::is_zero): New.
(double_int::is_one): New.
(double_int::is_minus_one): New.
(double_int::is_negative): New.
(double_int::cmp): New.
(double_int::ucmp): New.
(double_int::scmp): New.
(double_int::ult): New.
(double_int::ugt): New.
(double_int::slt): New.
(double_int::sgt): New.
(double_int::max): New.
(double_int::smax): New.
(double_int::umax): New.
(double_int::min): New.
(double_int::smin): New.
(double_int::umin): New.
(double_int::operator ==): New.
(double_int::operator !=): New.
(shwi_to_double_int): Change implementation to use member function.
(double_int_minus_one): Likewise.
(double_int_zero): Likewise.
(double_int_one): Likewise.
(double_int_two): Likewise.
(double_int_ten): Likewise.
(uhwi_to_double_int): Likewise.
(double_int_to_shwi): Likewise.
(double_int_to_uhwi): Likewise.
(double_int_fits_in_uhwi_p): Likewise.
(double_int_fits_in_shwi_p): Likewise.
(double_int_fits_in_hwi_p): Likewise.
(double_int_mul): Likewise.
(double_int_mul_with_sign): Likewise.
(double_int_add): Likewise.
(double_int_sub): Likewise.
(double_int_neg): Likewise.
(double_int_div): Likewise.
(double_int_sdiv): Likewise.
(double_int_udiv): Likewise.
(double_int_mod): Likewise.
(double_int_smod): Likewise.
(double_int_umod): Likewise.
(double_int_divmod): Likewise.
(double_int_sdivmod): Likewise.
(double_int_udivmod): Likewise.
(double_int_multiple_of): Likewise.
(double_int_setbit): Likewise.
(double_int_ctz): Likewise.
(double_int_not): Likewise.
(double_int_ior): Likewise.
(double_int_and): Likewise.
(double_int_and_not): Likewise.
(double_int_xor): Likewise.
(double_int_lshift): Likewise.
(double_int_rshift): Likewise.
(double_int_lrotate): Likewise.
(double_int_rrotate): Likewise.
(double_int_cmp): Likewise.
(double_int_scmp): Likewise.
(double_int_ucmp): Likewise.
(double_int_max): Likewise.
(double_int_smax): Likewise.
(double_int_umax): Likewise.
(double_int_min): Likewise.
(double_int_smin): Likewise.
(double_int_umin): Likewise.
(double_int_ext): Likewise.
(double_int_sext): Likewise.
(double_int_zext): Likewise.
(double_int_mask): Likewise.
(double_int_max_value): Likewise.
(double_int_min_value): Likewise.
(double_int_zero_p): Likewise.
(double_int_one_p): Likewise.
(double_int_minus_one_p): Likewise.
(double_int_equal_p): Likewise.
(double_int_popcount): Likewise.
* hash-table.c
(double_int_mask): Reuse implementation for double_int::mask.
(double_int_max_value): Likewise.
(double_int_min_value): Likewise.
(double_int_ext): Likewise.
(double_int_zext): Likewise.
(double_int_sext): Likewise.
(double_int_mul_with_sign): Likewise.
(double_int_divmod): Likewise.
(double_int_sdivmod): Likewise.
(double_int_udivmod): Likewise.
(double_int_div): Likewise.
(double_int_sdiv): Likewise.
(double_int_udiv): Likewise.
(double_int_mod): Likewise.
(double_int_smod): Likewise.
(double_int_umod): Likewise.
(double_int_multiple_of): Likewise.
(double_int_lshift): Likewise.
(double_int_rshift): Likewise.
(double_int_lrotate): Likewise.
(double_int_rrotate): Likewise.
(double_int_cmp): Likewise.
(double_int_ucmp): Likewise.
(double_int_scmp): Likewise.
(double_int_max): Likewise.
(double_int_smax): Likewise.
(double_int_umax): Likewise.
(double_int_min): Likewise.
(double_int_smin): Likewise.
(double_int_umin): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int::alshift): New.
(double_int::arshift): New.
(double_int::llshift): New.
(double_int::lrshift): New.
(double_int::ult): New.
(double_int::ugt): New.
(double_int::slt): New.
(double_int::sgt): New.
(double_int_setbit): Reuse implementation for double_int::set_bit,
which avoids a name conflict with a macro.
(double_int_double_int_ctz): Reuse implementation for
double_int::trailing_zeros.
(double_int_fits_in_shwi_p): Reuse implementation for
double_int::fits_signed.
(double_int_fits_in_hwi_p): Reuse implementation for double_int::fits.
(double_int_mul): Reuse implementation for binary
double_int::operator *.
(double_int_add): Likewise.
(double_int_sub): Likewise.
(double_int_neg): Reuse implementation for unary
double_int::operator -.
(double_int_max_value): Likewise.
* fixed-value.c: Change to use member functions introduced above.
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge cxx-conversion branch. Support tree macro calling
from gdb.
* tree.h (tree_check): New.
(TREE_CHECK): Use inline function above instead of __extension__.
(tree_not_check): New.
(TREE_NOT_CHECK): Use inline function above instead of __extension__.
(tree_check2): New.
(TREE_CHECK2): Use inline function above instead of __extension__.
(tree_not_check2): New.
(TREE_NOT_CHECK2): Use inline function above instead of __extension__.
(tree_check3): New.
(TREE_CHECK3): Use inline function above instead of __extension__.
(tree_not_check3): New.
(TREE_NOT_CHECK3): Use inline function above instead of __extension__.
(tree_check4): New.
(TREE_CHECK4): Use inline function above instead of __extension__.
(tree_not_check4): New.
(TREE_NOT_CHECK4): Use inline function above instead of __extension__.
(tree_check5): New.
(TREE_CHECK5): Use inline function above instead of __extension__.
(tree_not_check5): New.
(TREE_NOT_CHECK5): Use inline function above instead of __extension__.
(contains_struct_check): New.
(CONTAINS_STRUCT_CHECK): Use inline function above instead of
__extension__.
(tree_class_check): New.
(TREE_CLASS_CHECK): Use inline function above instead of __extension__.
(tree_range_check): New.
(TREE_RANGE_CHECK): Use inline function above instead of __extension__.
(omp_clause_subcode_check): New.
(OMP_CLAUSE_SUBCODE_CHECK): Use inline function above instead of
__extension__.
(omp_clause_range_check): New.
(OMP_CLAUSE_RANGE_CHECK): Use inline function above instead of
__extension__.
(expr_check): New.
(EXPR_CHECK): Use inline function above instead of __extension__.
(non_type_check): New.
(NON_TYPE_CHECK): Use inline function above instead of __extension__.
(tree_vec_elt_check): New.
(TREE_VEC_ELT_CHECK): Use inline function above instead of
__extension__.
(omp_clause_elt_check): New.
(OMP_CLAUSE_ELT_CHECK): Use inline function above instead of
__extension__.
(tree_operand_check): New.
(TREE_OPERAND_CHECK): Use inline function above instead of
__extension__.
(tree_operand_check_code): New.
(TREE_OPERAND_CHECK_CODE): Use inline function above instead of
__extension__.
(TREE_CHAIN): Simplify implementation.
(TREE_TYPE): Simplify implementation.
(tree_operand_length): Move for compilation dependences.
* gdbinit.in: (macro define __FILE__): New.
(macro define __LINE__): New.
(skip "tree.h"): New.
gcc/cp/ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Re-write VEC in C++.
* call.c (add_function_candidate): Remove const qualifier
from call to VEC_index.
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Configury.
* go-c.h: Remove all handlers of ENABLE_BUILD_WITH_CXX.
* go-gcc.cc: Likewise.
* go-system.h: Likewise.
From-SVN: r190402
2012-08-15 03:56:07 +02:00
|
|
|
|
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 04:30:52 +02:00
|
|
|
|
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.
|
|
|
|
|
|
2012-06-19 18:28:50 +02:00
|
|
|
|
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-05 16:25:46 +02:00
|
|
|
|
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.
|
|
|
|
|
|
PR preprocessor/53463 - Fix system header detection for built-in macro tokens
The location for a built-in macro token is BUILTIN_LOCATION. When we
see that location value, we cannot know if that token was used in a
system header or not. And that can trigger some unwanted warnings on
e.g, the use of __LONG_LONG_MAX__ built-in macro in system headers
when we compile with -pedantic, like in the test case accompanying
this patch.
In that case, I think we ought to step-up to see where the built-in
macro has been expanded, until we see a location that is not for a
built-in macro. Then we can check if the resulting location is in a
system header or not.
Now that we step up to the location of first non-built-in-macro token,
it appeared that for
testsuite/c-c++-common/dfp/convert-int-saturate.c, G++ then fails to
emit the warning in:
volatile unsigned int usi;
int
main ()
{
usi = DEC32_MAX; /* { dg-warning "overflow in implicit constant conversion" } */
...
}
Because DEC32_MAX is defined in the system header float.h as a
built-in macro:
#define DEC32_MAX __DEC32_MAX__
And during the parsing of the assignment expression that should have
led to the warning above, input_location is set to the location for
the DEC32_MAX, which is actually the location for the built-in
__DECL32_MAX_EXP.
A possible fix is to use the location of the "=" operator as the
default location for assignment expressions. This is what the patch
does.
I had to adjust a couple of tests to arrange for this.
Bootstrapped and tested on x86_64-unknown-linux-gnu against trunk.
libcpp/
PR preprocessor/53463
* line-map.c (linemap_location_in_system_header_p): For built-in
macro tokens, check the first expansion point location for that is
not for a token coming from a built-in macro.
gcc/cp/
PR preprocessor/53463
* parser.c (cp_parser_assignment_expression): Use the location
for the LHS as the default location for the expression.
gcc/testsuite/
PR preprocessor/53463
* g++.dg/cpp/limits.C: New test.
* g++.dg/parse/error19.C: Adjust.
* g++.dg/warn/Wconversion-real-integer2.C: Likewise.
* g++.dg/warn/pr35635.C: Likewise.
* g++.old-deja/g++.pt/assign1.C: Likewise.
From-SVN: r188203
2012-06-04 21:19:58 +02:00
|
|
|
|
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 16:53:50 +02:00
|
|
|
|
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-29 11:42:39 +02:00
|
|
|
|
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.
|
|
|
|
|
|
PR preprocessor/53229 - Fix diagnostics location when pasting tokens
As stated in the audit trail of this problem report, consider this
test case:
$ cat test.c
1 struct x {
2 int i;
3 };
4 struct x x;
5
6 #define TEST(X) x.##X
7
8 void foo (void)
9 {
10 TEST(i) = 0;
11 }
$
$ cc1 -quiet test.c
test.c: In function 'foo':
test.c:10:1: error: pasting "." and "i" does not give a valid preprocessing token
TEST(i) = 0;
^
$
So, when pasting tokens, the error diagnostic uses the global and
imprecise input_location variable, leading to an imprecise output.
To properly fix this, I think libcpp should keep the token of the
pasting operator '##', instead of representing it with flag on the LHS
operand's token. That way, it could use its location. Doing that
would be quite intrusive though. So this patch just uses the location
of the LHS of the pasting operator, for now. It's IMHO better than
the current situation.
The patch makes paste_tokens take a location parameter that is used in
the diagnostics. This change can still be useful later when we can
use the location of the pasting operator, because paste_tokens will
just be passed the new, more precise location.
Incidentally, it appeared that when getting tokens from within
preprocessor directives (like what is done in gcc.dg/cpp/paste12.c),
with -ftrack-macro-expansion disabled, the location of the expansion
point of macros was being lost because
cpp_reader::set_invocation_location wasn't being properly set. It's
because when cpp_get_token_1 calls enter_macro_context, there is a
little period of time between the beginning of that later function and
when the macro is really pushed (and thus when the macro is really
expanded) where we wrongly consider that we are not expanding the
macro because macro_of_context is still NULL. In that period of time,
in the occurrences of indirect recursive calls to cpp_get_token_1,
this later function wrongly sets cpp_reader::invocation_location
because cpp_reader::set_invocation_location is not being properly set.
To avoid that confusion the patch does away with
cpp_reader::set_invocation_location and introduces a new flag
cpp_reader::about_to_expand_macro_p that is set in the small time
interval exposed earlier. A new in_macro_expansion_p is introduced as
well, so that cpp_get_token_1 can now accurately detect when we are in
the process of expanding a macro, and thus correctly collect the
location of the expansion point.
People seem to like screenshots.
Thus, after the patch, we now have:
$ cc1 -quiet test.c
test.c: In function 'foo':
test.c:6:18: error: pasting "." and "i" does not give a valid preprocessing token
#define TEST(X) x.##X
^
test.c:10:3: note: in expansion of macro 'TEST'
TEST(i) = 0;
^
$
Bootstrapped and tested on x86_64-unknown-linux-gnu against trunk.
libcpp/
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.
gcc/testsuite/
PR preprocessor/53229
* gcc.dg/cpp/paste6.c: Force to run without
-ftrack-macro-expansion.
* gcc.dg/cpp/paste8.c: Likewise.
* gcc.dg/cpp/paste8-2.c: New test, like paste8.c but run with
-ftrack-macro-expansion.
* gcc.dg/cpp/paste12.c: Force to run without
-ftrack-macro-expansion.
* gcc.dg/cpp/paste12-2.c: New test, like paste12.c but run with
-ftrack-macro-expansion.
* gcc.dg/cpp/paste13.c: Likewise.
* gcc.dg/cpp/paste14.c: Likewise.
* gcc.dg/cpp/paste14-2.c: New test, like paste14.c but run with
-ftrack-macro-expansion.
* gcc.dg/cpp/paste18.c: New test.
From-SVN: r187945
2012-05-29 11:36:29 +02:00
|
|
|
|
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.
|
|
|
|
|
|
PR preprocessor/7263 - Avoid pedantic warnings on system headers macro tokens
Now that we track token locations accross macro expansions, it would
be cool to be able to fix PR preprocessor/7263 for real. That is,
consider this example where we have a system header named header.h
like this:
#define _Complex __complex__ #define _Complex_I 1.0iF
and then a normal C file like this:
#include "header.h"
static _Complex float c = _Complex_I;
If we compile the file with -pedantic, the usages of _Complex or
_Complex_I should not trigger any warning, even though __complex__ and
the complex literal are extensions to the standard C.
They shouldn't trigger any warning because _Complex and _Complex_I are
defined in a system header (and expanded in normal user code).
To be able to handle this, we must address two separate concerns.
First, warnings about non-standard usage of numerical literals are emitted
directly from within libcpp. So we must teach libcpp's parser for numerical
literals to use virtual locations, instead of the spelling
location it uses today. Once we have that, as the diagnostics machinery
already knows how to avoid emitting errors happening on tokens that come from
system headers, we win.
Second, there is the issue of tracking locations for declaration
specifiers, like the "_Complex" in the declaration:
static _Complex float c;
For that, we need to arrange for each possible declaration specifier
to have its own location, because otherwise, we'd warn on e.g, on:
_Complex float c;
but not on:
static _Complex float c;
So this patch addresses the two concerns above. It's actually a
follow-up on an earlier patch[1] I wrote as part of my initial work on
virtual locations. We then agreed[2] that the second concern was
important to address before the patch could get a chance to go in.
[1]: http://gcc.gnu.org/ml/gcc-patches/2011-09/msg00957.html
[2]: http://gcc.gnu.org/ml/gcc-patches/2011-10/msg00264.html
Bootstrapped and tested on x86_64-unknown-linux-gnu against trunk.
libcpp/
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.
gcc/c-family/
PR preprocessor/7263
* c-lex.c (c_lex_with_flags): Pass a virtual location to the call
to cpp_classify_number. For diagnostics, use the precise location
instead of the global input_location.
gcc/
PR preprocessor/7263
* c-tree.h (enum c_declspec_word): Declare new enum.
(struct c_declspecs::locations): New member.
(declspecs_add_qual, declspecs_add_scspec)
(declspecs_add_addrspace, declspecs_add_alignas): Take a new
location parameter.
* c-decl.c (build_null_declspecs): Initialize the new struct
c_declspecs::locations member.
(declspecs_add_addrspace): Take a location parameter for the
address space. Store it onto declaration specifiers.
(declspecs_add_qual): Likewise, take a location parameter for the
qualifier.
(declspecs_add_type): Likewise, take a location parameter for the
type specifier.
(declspecs_add_scspec): Likewise, take a location parameter for
the storage class specifier.
(declspecs_add_attrs): Likewise, take a location parameter for the
first attribute.
(declspecs_add_alignas): Likewise, take a location parameter for
the alignas token.
(finish_declspecs): For diagnostics, use the location of the
relevant declspec, instead of the global input_location.
* c-parser.c (c_parser_parameter_declaration): Pass the precise
virtual location of the declspec to the declspecs-setters.
(c_parser_declspecs): Likewise. Avoid calling c_parser_peek_token
repeatedly.
gcc/cp/
PR preprocessor/7263
* cp-tree.h (enum cp_decl_spec): Add new enumerators to cover all
the possible declarator specifiers so far.
(struct cp_decl_specifier_seq::locations): Declare new member.
(cp_decl_specifier_seq::{specs, type_location}): Remove.
(decl_spec_seq_has_spec_p): Declare new function.
* parser.c (cp_parser_check_decl_spec): Remove.
(set_and_check_decl_spec_loc): Define new static function.
(decl_spec_seq_has_spec_p): Define new public function.
(cp_parser_decl_specifier_seq, cp_parser_function_specifier_opt)
(cp_parser_type_specifier, cp_parser_simple_type_specifier)
(cp_parser_set_storage_class, cp_parser_set_decl_spec_type)
(cp_parser_alias_declaration): Set the locations for each
declspec, using set_and_check_decl_spec_loc.
(cp_parser_explicit_instantiation, cp_parser_init_declarator)
(cp_parser_member_declaration, cp_parser_init_declarator): Use the
new declspec location for specifiers. Use the new
decl_spec_seq_has_spec_p.
(cp_parser_type_specifier_seq): Use the new
set_and_check_decl_spec_loc. Stop using
cp_parser_check_decl_spec. Use the new decl_spec_seq_has_spec_p.
(, cp_parser_init_declarator): Use the new
set_and_check_decl_spec_loc.
(cp_parser_single_declaration, cp_parser_friend_p)
(cp_parser_objc_class_ivars, cp_parser_objc_struct_declaration):
Use the new decl_spec_seq_has_spec_p.
* decl.c (check_tag_decl): Use new decl_spec_seq_has_spec_p. Use
the more precise ds_redefined_builtin_type_spec location for
diagnostics about re-declaring C++ built-in types.
(start_decl, grokvardecl, grokdeclarator): Use the new
decl_spec_seq_has_spec_p.
gcc/testsuite/
PR preprocessor/7263
* gcc.dg/binary-constants-2.c: Run without tracking locations
accross macro expansion.
* gcc.dg/binary-constants-3.c: Likewise.
* gcc.dg/cpp/sysmac2.c: Likewise.
* testsuite/gcc.dg/nofixed-point-2.c: Adjust for more precise
location.
* gcc.dg/cpp/syshdr3.c: New test.
* gcc.dg/cpp/syshdr3.h: New header for the new test above.
* gcc.dg/system-binary-constants-1.c: New test.
* gcc.dg/system-binary-constants-1.h: New header for the new test
above.
* g++.dg/cpp/syshdr3.C: New test.
* g++.dg/cpp/syshdr3.h: New header the new test above.
* g++.dg/system-binary-constants-1.C: New test.
* g++.dg/system-binary-constants-1.h: New header the new test
above.
From-SVN: r187587
2012-05-16 12:51:15 +02:00
|
|
|
|
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 10:04:18 +02:00
|
|
|
|
2012-05-10 Tristan Gingold <gingold@adacore.com>
|
|
|
|
|
|
|
|
|
|
* expr.c (interpret_float_suffix): Add a guard.
|
|
|
|
|
|
2012-05-02 18:55:19 +02:00
|
|
|
|
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 18:57:22 +02:00
|
|
|
|
2012-04-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
|
|
|
|
|
Dodji Seketeli <dodji@seketeli.org>
|
|
|
|
|
|
2012-04-30 19:03:02 +02:00
|
|
|
|
PR c++/52974
|
2012-04-30 18:57:22 +02:00
|
|
|
|
* libcpp/files.c (maybe_shorter_path): New.
|
|
|
|
|
(find_file_in_dir): Use it.
|
|
|
|
|
|
2012-04-30 13:41:08 +02:00
|
|
|
|
2012-04-30 Dodji Seketeli <dodji@redhat.com>
|
|
|
|
|
|
2012-04-30 13:43:43 +02:00
|
|
|
|
Switch -ftrack-macro-expansion=2 on by default.
|
|
|
|
|
* init.c (cpp_create_reader): Switch -ftrack-macro-expansion=2 on
|
|
|
|
|
by default. Add comments.
|
|
|
|
|
|
2012-04-30 13:42:12 +02:00
|
|
|
|
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
Consider the test case gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c.
Its interesting part is:
#define A(x) vari x /* line 7. */
#define vari(x)
#define B , varj
int A(B) ; /* line 10. */
In its initial version, this test was being pre-processed as:
# 1 "gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c"
# 1 "build/gcc//"
# 1 "<command-line>"
# 1 "gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c"
# 10 "gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c"
int
# 7 "gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c"
vari
, varj ;
Note how "int" and "vari" are on separate lines, whereas "int" and
", varj" are on the same line.
This looks like a bug to me, even independantly from the macro
location tracking work.
With macro location tracking turned on, the preprocessed output
becomes:
# 1 "gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c"
# 1 "<command-line>"
# 1 "gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c"
# 10 "gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c"
int vari , varj ;
Which, IMO, is what we'd expect.
This is due to an unexpected side effect of enter_macro_context when
passed a token that might look like a function-like macro at first
sight, but that it eventually considers to not be a macro after all.
This is the case for the "vari" token which looks like a macro when it
is first lexed, but is eventually considered to be a normal token by
enter_macro_context because it's not used as a function-like macro
invocation.
In that case, besides returning NULL, enter_macro_context sets
pfile->context->c.macro to NULL, making cpp_get_token_1 forget to set
the location of the "vari" to the expansion point of A.
enter_macro_context sets pfile->context->c.macro to NULL in that case
because funlike_invocation_p reads one token pass "foo", sees that
there is no '(' token, so we are not invoking the function-like
parameter. It then puts the tokens (which it has read after "foo")
back into the tokens stream by calling _cpp_push_token_context on it,
which sets pfile->context->c.macro to NULL, saying in essence that the
current macro expansion context is "stopped".
The fix here is to teach _cpp_push_token and
push_extended_tokens_context to continue the current macro context
when passed a NULL macro. But then, now that there can be several
continguous contexts associated with the same macro, we need to teach
_cpp_pop_context to re-enable the expansion of the current macro only
when we are really out of expanding the current macro. Otherwise we
can run in cases where we have recursive expansions of the same macro.
Tested on x86_64-unknown-linux-gnu against trunk. Now this test has
the same output with and without tracking locations accross macro
expansions.
Note that the bootstrap with -ftrack-macro-expansion exhibits other
separate issues that are addressed in subsequent patches. This patch
just fixes one class of problems.
The patch does pass bootstrap with -ftrack-macro-expansion turned off,
though.
libcpp/
* 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.
gcc/testsuite/
* gcc.dg/debug/dwarf2/pr41445-5.c: Adjust.
* gcc.dg/debug/dwarf2/pr41445-6.c: Likewise.
From-SVN: r186968
2012-04-30 13:41:46 +02:00
|
|
|
|
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.
|
|
|
|
|
|
2012-04-30 13:41:21 +02:00
|
|
|
|
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.
|
|
|
|
|
|
2012-04-30 13:41:08 +02:00
|
|
|
|
Fix cpp_sys_macro_p with -ftrack-macro-expansion
|
|
|
|
|
* macro.c (cpp_sys_macro_p): Support -ftrack-macro-expansion.
|
|
|
|
|
|
2012-04-29 18:27:08 +02:00
|
|
|
|
2012-04-29 Dodji Seketeli <dodji@redhat.com>
|
|
|
|
|
|
|
|
|
|
* lex.c (lex_raw_string): Change C++ style comments into C style
|
|
|
|
|
comments.
|
2014-10-22 03:41:31 +02:00
|
|
|
|
(lex_string): Likewise.
|
2012-04-29 18:27:08 +02:00
|
|
|
|
|
2012-04-27 16:29:32 +02:00
|
|
|
|
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 09:14:01 +02:00
|
|
|
|
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 18:54:55 +01:00
|
|
|
|
2012-03-22 Richard Earnshaw <rearnsha@arm.com>
|
|
|
|
|
|
|
|
|
|
* lex.c (search_line_fast): Provide Neon-optimized version for ARM.
|
|
|
|
|
|
2012-03-14 18:08:03 +01:00
|
|
|
|
2012-03-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
|
|
|
|
|
|
|
|
|
|
* lex.c: Remove Solaris 8 reference.
|
|
|
|
|
|
2012-02-14 11:02:21 +01:00
|
|
|
|
2012-02-14 Walter Lee <walt@tilera.com>
|
|
|
|
|
|
|
|
|
|
* configure.ac: Require 64-bit hwint for tilegx and tilepro.
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
|
2012-01-09 15:15:25 +01:00
|
|
|
|
2012-01-09 Richard Guenther <rguenther@suse.de>
|
|
|
|
|
|
|
|
|
|
* macro.c (_cpp_builtin_macro_text): Remove unused variable map.
|
|
|
|
|
|
2012-01-09 09:48:43 +01:00
|
|
|
|
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 12:44:34 +01:00
|
|
|
|
2012-01-03 Olivier Hainque <hainque@adacore.com>
|
|
|
|
|
|
|
|
|
|
* system.h: Prior to #define, #undef fopen and freopen unconditionally.
|
|
|
|
|
|
gcc:
* c-decl.c (diagnose_mismatched_decls, grokdeclarator, grokfield)
(finish_struct): Refer to C11 in comments. Use flag_isoc11.
* c-parser.c (c_parser_static_assert_declaration)
(c_parser_static_assert_declaration_no_semi, c_parser_declspecs)
(c_parser_alignas_specifier, c_parser_alignof_expression): Refer
to C11 in comments. Use flag_isoc11.
* c-typeck.c (comptypes_check_different_types): Refer to C11 in
comment.
* doc/cpp.texi (Overview): Refer to -std=c11 instead of -std=c1x.
* doc/cppopts.texi (-std=c11, -std=gnu11): Document in preference
to -std=c1x and -std=gnu1x.
* doc/extend.texi (Inline, Alternate Keywords, Other Builtins)
(__builtin_complex, Unnamed Fields): Refer to -std=c11 and C11
instead of -std=c1x and C1X.
* doc/invoke.texi (-std=c11, -std=iso9899:2011): Document in
preference to -std=c1x.
(-std=gnu11): Document in preference to -std=gnu1x.
* doc/standards.texi: Document C11 instead of C1X. Document C11
as actual standard. Document headers required from freestanding
C11 implementations.
* ginclude/float.h, ginclude/stddef.h: Test __STDC_VERSION__ >=
201112L for C11. Update comments to refer to C11.
gcc/c-family:
* c-common.c (flag_isoc99): Update comment to refer to C11.
(flag_isoc1x): Change to flag_isoc11.
* c-common.h (flag_isoc99): Update comment to refer to C11.
(flag_isoc1x): Change to flag_isoc11.
* c-cppbuiltin.c (cpp_atomic_builtins): Change comment to refer to
C11.
* c-opts.c (set_std_c1x): Change to set_std_c11.
(c_common_handle_option): Handle OPT_std_c11 and OPT_std_gnu11.
Call set_std_c11.
(set_std_c89, set_std_c99, set_std_c11): Use flag_isoc11.
(set_std_c1): Use CLK_STDC11 and CLK_GNUC11.
* c.opt (std=c1x): Change to std=c11. Document as non-draft
standard.
(std=c1x, std=iso9899:2011): Add as aliases of std=c11.
(std=gnu1x): Change to std=gnu11. Refer to non-draft standard.
(std=gnu1x): Make alias of std=gnu11.
gcc/testsuite:
* gcc.dg/c11-version-1.c, gcc.dg/c11-version-2.c,
gcc.dg/c94-version-1.c, gcc.dg/c99-version-1.c,
gcc.dg/gnu11-version-1.c: New tests.
libcpp:
* 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__.
From-SVN: r182551
2011-12-20 21:44:13 +01:00
|
|
|
|
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 17:54:12 +01:00
|
|
|
|
2011-12-20 Andreas Schwab <schwab@linux-m68k.org>
|
|
|
|
|
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
|
2011-12-19 14:12:26 +01:00
|
|
|
|
2011-12-19 Andreas Schwab <schwab@linux-m68k.org>
|
|
|
|
|
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
|
2011-12-07 23:05:59 +01:00
|
|
|
|
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-05 10:20:59 +01:00
|
|
|
|
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 17:13:00 +01:00
|
|
|
|
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 20:27:30 +01:00
|
|
|
|
2011-11-21 Ed Smith-Rowland <3dw4rd@verizon.net>
|
|
|
|
|
|
|
|
|
|
PR c++/50958
|
|
|
|
|
* expr.c (cpp_userdef_char_remove_type): Fix typo.
|
|
|
|
|
|
2011-11-03 18:17:07 +01:00
|
|
|
|
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 21:22:53 +01:00
|
|
|
|
2011-11-02 Paolo Carlini <paolo.carlini@oracle.com>
|
|
|
|
|
|
|
|
|
|
* internal.h (uxstrdup, ustrchr): Return const unsigned char *.
|
|
|
|
|
|
2011-11-02 21:16:43 +01:00
|
|
|
|
2011-11-02 Jason Merrill <jason@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR c++/50810
|
|
|
|
|
* configure.ac: Add -Wno-narrowing to warning options.
|
|
|
|
|
|
2011-10-31 20:34:14 +01:00
|
|
|
|
2011-10-31 Jason Merrill <jason@redhat.com>
|
|
|
|
|
|
2011-10-31 20:34:26 +01:00
|
|
|
|
PR libstdc++/1773
|
|
|
|
|
* init.c (cpp_init_builtins): Set __cplusplus for C++11.
|
|
|
|
|
|
2011-10-31 20:34:14 +01:00
|
|
|
|
PR c++/50920
|
|
|
|
|
* include/cpplib.h (enum c_lang): Rename CLK_CXX0X to CLK_CXX11,
|
|
|
|
|
CLK_GNUCXX0X to CLK_GNUCXX11.
|
|
|
|
|
|
Implement C++11 user-defined literals.
libcpp/
* 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.
c-family/
* c-common.c (build_userdef_literal): New.
* c-common.def: New tree code.
* c-common.h (tree_userdef_literal): New tree struct and accessors.
* c-lex.c (interpret_float): Add suffix parm.
(c_lex_with_flags): Build literal tokens.
cp/
* cp-objcp-common.c: (cp_tree_size) Return size of USERDEF_LITERAL tree.
* cp-tree.h: (UDLIT_OP_*, UDLIT_OPER_P): Literal operator
name tools. New tree code for user-defined literals.
* cxx-pretty-print.h: (pp_cxx_userdef_literal) New.
* cxx-pretty-print.c: (pp_cxx_userdef_literal) New.
(pp_cxx_primary_expression, pp_cxx_expression): Use it.
* decl.c: (cp_tree_node_structure): Return new tree code.
(duplicate_decls): Check for raw vs. template operator conflicts.
(grokfndecl, grokdeclarator): New checks for literal operators.
* error.c: (dump_expr): Warn about user-defined literals
in C++98 mode. (dump_function_name): Pretty printing.
* mangle.c: (write_literal_operator_name): New.
(write_unqualified_id, write_unqualified_name): Use it.
* parser.c: (cp_parser_operator): Handle operator"".
(cp_parser_userdef_char_literal, cp_parser_userdef_numeric_literal,
cp_parser_userdef_string_literal): New.
(cp_parser_primary_expression): Handle new user-defined literal tokens
with new functions.
* semantics.c: (potential_constant_expression_1): Add
user-defined literals.
* typeck.c (check_raw_literal_operator,
check_literal_operator_args): New.
From-SVN: r180536
2011-10-26 21:30:59 +02:00
|
|
|
|
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-25 10:59:07 +02:00
|
|
|
|
2011-10-24 Dodji Seketeli <dodji@redhat.com>
|
|
|
|
|
|
|
|
|
|
* line-map.c (linemap_macro_map_lookup): Fix logic.
|
|
|
|
|
|
2011-10-25 10:58:54 +02:00
|
|
|
|
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 19:49:18 +02:00
|
|
|
|
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 10:49:29 +02:00
|
|
|
|
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 10:44:49 +02:00
|
|
|
|
2011-10-18 Dodji Seketeli <dodji@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR bootstrap/50760
|
|
|
|
|
* include/line-map.h (struct linemap_stats): Change the type of
|
2014-10-22 03:41:31 +02:00
|
|
|
|
the members from size_t to long.
|
2011-10-18 10:44:49 +02:00
|
|
|
|
* macro.c (macro_arg_token_iter_init): Unconditionally initialize
|
2014-10-22 03:41:31 +02:00
|
|
|
|
iter->location_ptr.
|
2011-10-18 10:44:49 +02:00
|
|
|
|
|
2011-10-17 16:01:37 +02:00
|
|
|
|
2011-10-17 Dodji Seketeli <dodji@redhat.com>
|
|
|
|
|
|
|
|
|
|
* line-map.c (linemap_macro_map_loc_to_exp_point): Avoid setting a
|
2014-10-22 03:41:31 +02:00
|
|
|
|
variable without using it if ENABLE_CHECKING is not defined. Mark
|
|
|
|
|
the LOCATION parameter as being unused.
|
2011-10-17 16:01:37 +02:00
|
|
|
|
|
2011-10-17 12:00:07 +02:00
|
|
|
|
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-17 11:59:52 +02:00
|
|
|
|
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-17 11:59:40 +02:00
|
|
|
|
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-17 11:59:12 +02:00
|
|
|
|
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.
|
|
|
|
|
|
Linemap infrastructure for virtual locations
This is the first instalment of a set which goal is to track locations
of tokens across macro expansions. Tom Tromey did the original work
and attached the patch to PR preprocessor/7263. This opus is a
derivative of that original work.
This patch modifies the linemap module of libcpp to add virtual
locations support.
A virtual location is a mapped location that can resolve to several
different physical locations. It can always resolve to the spelling
location of a token. For tokens resulting from macro expansion it can
resolve to:
- either the location of the expansion point of the macro.
- or the location of the token in the definition of the
macro
- or, if the token is an argument of a function-like macro,
the location of the use of the matching macro parameter in
the definition of the macro
The patch creates a new type of line map called a macro map. For every
single macro expansion, there is a macro map that generates a virtual
location for every single resulting token of the expansion.
The good old type of line map we all know is now called an ordinary
map. That one still encodes spelling locations as it has always had.
As a result linemap_lookup as been extended to return a macro map when
given a virtual location resulting from a macro expansion. The layout
of structs line_map has changed to support this new type of map. So
did the layout of struct line_maps. Accessor macros have been
introduced to avoid messing with the implementation details of these
datastructures directly. This helped already as we have been testing
different ways of arranging these datastructure. Having to constantly
adjust client code that is too tied with the internals of line_map and
line_maps would have been even more painful.
Of course, many new public functions have been added to the linemap
module to handle the resolution of virtual locations.
This patch introduces the infrastructure but no part of the compiler
uses virtual locations yet.
However the client code of the linemap data structures has been
adjusted as per the changes. E.g, it's not anymore reliable for a
client code to manipulate struct line_map directly if it just wants to
deal with spelling locations, because struct line_map can now
represent a macro map as well. In that case, it's better to use the
convenient API to resolve the initial (possibly virtual) location to a
spelling location (or to an ordinary map) and use that.
This is the reason why the patch adjusts the Java, Ada and Fortran
front ends.
Also, note that virtual locations are not supposed to be ordered for
relations '<' and '>' anymore. To test if a virtual location appears
"before" another one, one has to use a new operator exposed by the
line map interface. The patch updates the only spot (in the
diagnostics module) I have found that was making the assumption that
locations were ordered for these relations. This is the only change
that introduces a use of the new line map API in this patch, so I am
adding a regression test for it only.
From-SVN: r180081
2011-10-17 11:58:56 +02:00
|
|
|
|
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.
|
2014-10-22 03:41:31 +02:00
|
|
|
|
(struct line_map): Turn this into a union of the two above. Add
|
Linemap infrastructure for virtual locations
This is the first instalment of a set which goal is to track locations
of tokens across macro expansions. Tom Tromey did the original work
and attached the patch to PR preprocessor/7263. This opus is a
derivative of that original work.
This patch modifies the linemap module of libcpp to add virtual
locations support.
A virtual location is a mapped location that can resolve to several
different physical locations. It can always resolve to the spelling
location of a token. For tokens resulting from macro expansion it can
resolve to:
- either the location of the expansion point of the macro.
- or the location of the token in the definition of the
macro
- or, if the token is an argument of a function-like macro,
the location of the use of the matching macro parameter in
the definition of the macro
The patch creates a new type of line map called a macro map. For every
single macro expansion, there is a macro map that generates a virtual
location for every single resulting token of the expansion.
The good old type of line map we all know is now called an ordinary
map. That one still encodes spelling locations as it has always had.
As a result linemap_lookup as been extended to return a macro map when
given a virtual location resulting from a macro expansion. The layout
of structs line_map has changed to support this new type of map. So
did the layout of struct line_maps. Accessor macros have been
introduced to avoid messing with the implementation details of these
datastructures directly. This helped already as we have been testing
different ways of arranging these datastructure. Having to constantly
adjust client code that is too tied with the internals of line_map and
line_maps would have been even more painful.
Of course, many new public functions have been added to the linemap
module to handle the resolution of virtual locations.
This patch introduces the infrastructure but no part of the compiler
uses virtual locations yet.
However the client code of the linemap data structures has been
adjusted as per the changes. E.g, it's not anymore reliable for a
client code to manipulate struct line_map directly if it just wants to
deal with spelling locations, because struct line_map can now
represent a macro map as well. In that case, it's better to use the
convenient API to resolve the initial (possibly virtual) location to a
spelling location (or to an ordinary map) and use that.
This is the reason why the patch adjusts the Java, Ada and Fortran
front ends.
Also, note that virtual locations are not supposed to be ordered for
relations '<' and '>' anymore. To test if a virtual location appears
"before" another one, one has to use a new operator exposed by the
line map interface. The patch updates the only spot (in the
diagnostics module) I have found that was making the assumption that
locations were ordered for these relations. This is the only change
that introduces a use of the new line map API in this patch, so I am
adding a regression test for it only.
From-SVN: r180081
2011-10-17 11:58:56 +02:00
|
|
|
|
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 22:14:46 +02:00
|
|
|
|
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 22:41:07 +02:00
|
|
|
|
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 19:29:10 +02:00
|
|
|
|
2011-08-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
|
|
|
|
|
|
|
|
|
|
PR libstdc++/1773
|
|
|
|
|
* init.c (cpp_init_builtins): Define __cplusplus 19971L.
|
|
|
|
|
|
2011-08-18 17:24:45 +02:00
|
|
|
|
2011-08-18 Joseph Myers <joseph@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* include/cpplib.h (struct cpp_options): Fix typo.
|
|
|
|
|
|
2011-08-18 17:13:49 +02:00
|
|
|
|
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 22:35:58 +02:00
|
|
|
|
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 22:57:20 +02:00
|
|
|
|
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 16:29:38 +02:00
|
|
|
|
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 16:26:58 +02:00
|
|
|
|
2011-07-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
|
|
|
|
|
|
|
|
|
|
* system.h [__cplusplus]: Wrap C function declarations in extern "C".
|
|
|
|
|
|
2011-07-22 10:58:25 +02:00
|
|
|
|
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 23:34:02 +02:00
|
|
|
|
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 11:24:16 +02:00
|
|
|
|
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-17 00:09:12 +02:00
|
|
|
|
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 13:33:42 +02:00
|
|
|
|
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-06-02 19:57:44 +02:00
|
|
|
|
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 20:53:32 +02:00
|
|
|
|
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 20:05:37 +02:00
|
|
|
|
2011-04-25 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* system.h (ENUM_BITFIELD): Remove.
|
|
|
|
|
|
2011-04-24 01:32:09 +02:00
|
|
|
|
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 20:19:03 +02:00
|
|
|
|
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 20:11:26 +01:00
|
|
|
|
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 17:21:30 +01:00
|
|
|
|
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 21:20:35 +01:00
|
|
|
|
2011-03-18 Richard Henderson <rth@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR bootstrap/45381
|
|
|
|
|
* lex.c [ALTIVEC] (search_line_fast): Require gcc version 4.5.
|
|
|
|
|
|
2011-01-05 00:18:12 +01:00
|
|
|
|
2011-11-04 Eric Botcazou <ebotcazou@adacore.com>
|
2014-10-22 03:41:31 +02:00
|
|
|
|
Jakub Jelinek <jakub@redhat.com>
|
2011-01-05 00:18:12 +01:00
|
|
|
|
|
|
|
|
|
PR preprocessor/39213
|
|
|
|
|
* directives.c (end_directive): Call _cpp_remove_overlay for deferred
|
|
|
|
|
pragmas as well in traditional mode.
|
|
|
|
|
|
2010-11-18 08:35:34 +01:00
|
|
|
|
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 20:50:17 +01:00
|
|
|
|
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-03 03:45:25 +01:00
|
|
|
|
2010-11-02 Ian Lance Taylor <iant@google.com>
|
|
|
|
|
|
|
|
|
|
* configure.ac: Use AC_SYS_LARGEFILE.
|
|
|
|
|
* configure: Rebuild.
|
|
|
|
|
* config.in: Rebuild.
|
|
|
|
|
|
2010-10-19 08:57:24 +02:00
|
|
|
|
2010-10-19 Basile Starynkevitch <basile@starynkevitch.net>
|
2010-11-03 03:45:25 +01:00
|
|
|
|
|
2010-10-19 08:57:24 +02:00
|
|
|
|
* line-map.h (source_location): Remove obsolete comment
|
|
|
|
|
mentioning location_s.
|
|
|
|
|
|
2010-09-29 20:18:38 +02:00
|
|
|
|
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.
|
|
|
|
|
|
optc-gen.awk: Generate global_options initializer instead of individual variables.
gcc:
* optc-gen.awk: Generate global_options initializer instead of
individual variables. Add x_ prefix to names of structure
members.
* opth-gen.awk: Generate gcc_options structure. Add x_ prefix to
names of structure members.
* doc/tm.texi.in (HARD_FRAME_POINTER_IS_FRAME_POINTER,
HARD_FRAME_POINTER_IS_ARG_POINTER): Document.
* doc/tm.texi: Regenerate.
* alias.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER
* builtins.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER.
* c-parser.c (disable_extension_diagnostics,
restore_extension_diagnostics): Update names of cpp_options
members.
* combine.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER
* common.opt (fcompare-debug-second): Don't use Var.
* config/alpha/alpha.h (target_flags): Remove.
* config/arm/arm.h (HARD_FRAME_POINTER_IS_FRAME_POINTER,
HARD_FRAME_POINTER_IS_ARG_POINTER): Define.
* config/bfin/bfin.h (target_flags): Remove.
* config/cris/cris.h (target_flags): Remove.
* config/i386/i386-c.c (ix86_pragma_target_parse): Update names of
cl_target_option members.
* config/i386/i386.c (ix86_force_align_arg_pointer): Remove.
(ix86_function_specific_print, ix86_valid_target_attribute_tree,
ix86_can_inline_p): Update names of cl_target_option members.
* config/i386/i386.h (ix86_isa_flags): Remove.
* config/lm32/lm32.h (target_flags): Remove.
* config/mcore/mcore.h (mcore_stack_increment): Remove.
* config/mcore/mcore.md (addsi3): Remove extern declaration of
flag_omit_frame_pointer.
* config/mep/mep.h (target_flags): Remove.
* config/mips/mips.h (HARD_FRAME_POINTER_IS_FRAME_POINTER,
HARD_FRAME_POINTER_IS_ARG_POINTER): Define.
* config/mmix/mmix.h (target_flags): Remove.
* config/rs6000/rs6000.h (rs6000_xilinx_fpu, flag_pic,
flag_expensive_optimizations): Remove.
* config/s390/s390.h (flag_pic): Remove.
* config/score/score-conv.h (target_flags): Remove.
* config/sh/sh.h (sh_fixed_range_str): Remove.
* config/spu/spu.h (target_flags, spu_fixed_range_string): Remove.
* dbxout.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER
* df-scan.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
* diagnostic.c (diagnostic_initialize): Update names of
diagnostic_context members.
* diagnostic.h (diagnostic_context): Rename inhibit_warnings and
warn_system_headers.
(diagnostic_report_warnings_p): Update for new names.
* dwarf2out.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER
* emit-rtl.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER and
HARD_FRAME_POINTER_IS_ARG_POINTER.
* flags.h (flag_compare_debug): Declare.
* ira.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER
* opts.c (flag_compare_debug): Define.
(common_handle_option): Update names of diagnostic_context
members. Handle -fcompare-debug-second.
(fast_math_flags_struct_set_p): Update names of cl_optimization
members.
* reginfo.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
* regrename.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
* reload.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
* reload1.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
* resource.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
* rtl.h (HARD_FRAME_POINTER_IS_FRAME_POINTER,
HARD_FRAME_POINTER_IS_ARG_POINTER): Define and use.
* sel-sched.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER
* stmt.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER.
gcc/c-family:
* c-common.c (c_cpp_error): Update names of diagnostic_context
members.
* c-cppbuiltin.c (c_cpp_builtins_optimize_pragma): Update names of
cl_optimization members.
* c-opts.c (warning_as_error_callback, c_common_handle_option,
sanitize_cpp_opts, finish_options): Update names of cpp_options
members.
gcc/fortran:
* cpp.c (cpp_define_builtins): Update names of gfc_option_t
members.
(gfc_cpp_post_options): Update names of cpp_options members.
(cb_cpp_error): Update names of diagnostic_context members.
* f95-lang.c (gfc_init_builtin_functions): Update names of
gfc_option_t members.
* gfortran.h (gfc_option_t): Rename warn_conversion and
flag_openmp.
* intrinsic.c (gfc_convert_type_warn): Update names of
gfc_option_t members.
* options.c (gfc_init_options, gfc_post_options, set_Wall,
gfc_handle_option): Update names of gfc_option_t members.
* parse.c (next_free, next_fixed): Update names of gfc_option_t
members.
* scanner.c (pedantic): Remove extern declaration.
(skip_free_comments, skip_fixed_comments, include_line): Update
names of gfc_option_t members.
* trans-decl.c (gfc_generate_function_code): Update names of
gfc_option_t members.
gcc/java:
* java-tree.h (flag_filelist_file, flag_assert, flag_jni,
flag_force_classes_archive_check, flag_redundant, flag_newer,
flag_use_divide_subroutine, flag_use_atomic_builtins,
flag_use_boehm_gc, flag_hash_synchronization,
flag_check_references, flag_optimize_sci, flag_indirect_classes,
flag_indirect_dispatch, flag_store_check,
flag_reduced_reflection): Remove.
* jcf-dump.c (flag_newer): Remove.
* jcf.h (quiet_flag): Remove.
* parse.h (quiet_flag): Remove.
libcpp:
* 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.
From-SVN: r164723
2010-09-29 16:49:14 +02:00
|
|
|
|
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 16:41:31 +02:00
|
|
|
|
2010-09-15 Ian Lance Taylor <iant@google.com>
|
|
|
|
|
|
|
|
|
|
* init.c: Fix type name in comment.
|
|
|
|
|
|
2010-09-01 00:47:25 +02:00
|
|
|
|
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 19:58:31 +02:00
|
|
|
|
2010-08-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
|
|
|
|
|
|
|
|
|
|
* system.h [HAVE_INTTYPES_H]: Include inttypes.h.
|
|
|
|
|
|
2010-08-24 23:08:05 +02:00
|
|
|
|
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 19:23:35 +02:00
|
|
|
|
2010-08-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
|
|
|
|
|
|
|
|
|
|
* lex.c [__sun__ && __svr4__]: Disable init_vectorized_lexer
|
|
|
|
|
etc. on Solaris 2/x86.
|
|
|
|
|
|
Vectorize fast path of _cpp_clean_line.
* 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 '?'.
Co-Authored-By: Andi Kleen <ak@linux.intel.com>
Co-Authored-By: David S. Miller <davem@davemloft.net>
From-SVN: r163446
2010-08-21 21:05:40 +02:00
|
|
|
|
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 20:37:34 +02:00
|
|
|
|
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 17:10:11 +02:00
|
|
|
|
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 12:32:23 +02:00
|
|
|
|
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.
|
|
|
|
|
|
utils.c (init_gnat_to_gnu): Use typed GC allocation.
gcc/ada:
2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* gcc-interface/utils.c (init_gnat_to_gnu): Use typed GC
allocation.
(init_dummy_type): Likewise.
(gnat_pushlevel): Likewise.
* gcc-interface/trans.c (Attribute_to_gnu): Likewise.
(Subprogram_Body_to_gnu): Likewise.
(Compilation_Unit_to_gnu): Likewise.
(start_stmt_group): Likewise.
(extract_encoding): Likewise.
(decode_name): Likewise.
* gcc-interface/misc.c (gnat_printable_name): Likewise.
* gcc-interface/decl.c (annotate_value): Likewise.
* gcc-interface/ada-tree.h (struct lang_type): Add variable_size
GTY option.
(struct lang_decl): Likewise.
(SET_TYPE_LANG_SPECIFIC): Use typed GC allocation.
(SET_DECL_LANG_SPECIFIC): Likewise.
gcc/c-family:
2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* c-pragma.c (push_alignment): Use typed GC allocation.
(handle_pragma_push_options): Likewise.
* c-common.c (parse_optimize_options): Likewise.
* c-common.h (struct sorted_fields_type): Add variable_size GTY
option.
gcc/cp:
2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* typeck2.c (abstract_virtuals_error): Likewise.
* pt.c (maybe_process_partial_specialization): Likewise.
(register_specialization): Likewise.
(add_pending_template): Likewise.
(lookup_template_class): Likewise.
(push_tinst_level): Likewise.
* parser.c (cp_lexer_new_main): Likewise.
(cp_lexer_new_from_tokens): Likewise.
(cp_token_cache_new): Likewise.
(cp_parser_context_new): Likewise.
(cp_parser_new): Likewise.
(cp_parser_nested_name_specifier_opt): Likewise.
(cp_parser_template_id): Likewise.
* name-lookup.c (binding_entry_make): Likewise.
(binding_table_construct): Likewise.
(binding_table_new): Likewise.
(cxx_binding_make): Likewise.
(pushdecl_maybe_friend): Likewise.
(begin_scope): Likewise.
(push_to_top_level): Likewise.
* lex.c (init_reswords): Likewise.
(retrofit_lang_decl): Likewise.
(cxx_dup_lang_specific_decl): Likewise.
(copy_lang_type): Likewise.
(cxx_make_type): Likewise.
* decl.c (make_label_decl): Likewise.
(check_goto): Likewise.
(start_preparsed_function): Likewise.
(save_function_data): Likewise.
* cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Likewise.
* cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise.
* class.c (finish_struct_1): Likewise.
* cp-tree.h (struct lang_type): Add variable_size GTY option.
(struct lang_decl): Likewise.
* parser.c (cp_parser_new): Update comment to not reference
ggc_alloc.
gcc/fortran:
2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* trans-types.c (gfc_get_nodesc_array_type): Use typed GC
allocation.
(gfc_get_array_type_bounds): Likewise.
* trans-decl.c (gfc_allocate_lang_decl): Likewise.
(gfc_find_module): Likewise.
* f95-lang.c (pushlevel): Likewise.
* trans.h (struct lang_type): Add variable_size GTY option.
(struct lang_decl): Likewise.
gcc/java:
2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* jcf-reader.c (jcf_parse_constant_pool): Use typed GC allocation.
* jcf-parse.c (java_parse_file): Likewise.
(process_zip_dir): Likewise.
* java-tree.h (MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): Likewise.
(MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Likewise.
* expr.c (add_type_assertion): Likewise.
* decl.c (make_binding_level): Likewise.
(java_dup_lang_specific_decl): Likewise.
* constants.c (set_constant_entry): Likewise.
(cpool_for_class): Likewise.
* class.c (add_method_1): Likewise.
(java_treetreehash_new): Likewise.
* java-tree.h (struct lang_type): Add variable_size GTY option.
(struct lang_decl): Likewise.
* jch.h (struct cpool_entry): Likewise.
* java-tree.h (java_treetreehash_create): Remove parameter ggc.
* except.c (prepare_eh_table_type): Update
java_treetreehash_create call.
* class.c (add_method_1): Update java_treetreehash_create call.
(java_treetreehash_create): Remove parameter gc. Use
htab_create_ggc.
gcc/lto:
2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* lto.c (lto_read_in_decl_state): Use typed GC allocation.
(lto_file_read): Likewise.
(new_partition): Likewise.
(read_cgraph_and_symbols): Likewise.
gcc/objc:
2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* objc-act.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Use typed GC
allocation.
* objc-act.c (objc_volatilize_decl): Likewise.
(objc_build_string_object): Likewise.
(hash_init): Likewise.
(hash_enter): Likewise.
(hash_add_attr): Likewise.
(add_class): Likewise.
(start_class): Likewise.
gcc/objcp:
2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* objcp-decl.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Use typed GC
allocation.
gcc:
2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* doc/tm.texi (Per-Function Data): Do not reference ggc_alloc.
* doc/gty.texi (GTY Options): Document typed GC allocation and
variable_size GTY option.
* ggc-internal.h: New.
* ggc.h: Update copyright year.
(digit_string): Move to stringpool.c.
(ggc_mark_stringpool, ggc_purge_stringpool, ggc_mark_roots)
(gt_pch_save_stringpool, gt_pch_fixup_stringpool)
(gt_pach_restore_stringpool, gt_pch_p_S, gt_pch_note_object)
(init_ggc_pch, ggc_pch_count_object, ggc_pch_total_size)
(ggc_pch_this_base, ggc_pch_alloc_object, ggc_pch_prepare_write)
(ggc_pch_write_object, ggc_pch_finish, ggc_pch_read)
(ggc_force_collect, ggc_get_size, ggc_statistics)
(ggc_print_common_statistics): Move to ggc-internal.h.
(digit_vector, new_ggc_zone, destroy_ggc_zone, ggc_alloc_stat)
(ggc_alloc, ggc_alloc_cleared, ggc_realloc, ggc_calloc, GGC_NEW)
(GGC_CNEW, GGC_NEWVEC, GGC_CNEWVEC, GGC_NEWVAR, ggc_alloc_rtvec)
(ggc_alloc_tree, gt_pch_save, ggc_min_expand_heuristic)
(ggc_min_heapsize_heuristic, ggc_alloc_zone)
(ggc_alloc_zone_pass_stat): Remove.
(ggc_internal_alloc_stat, ggc_internal_alloc)
(ggc_internal_cleared_alloc_stat): New.
(GGC_RESIZEVEC, GGC_RESIZEVAR): Redefine.
(ggc_internal_vec_alloc_stat)
(ggc_internal_cleared_vec_alloc_stat)
(ggc_internal_vec_alloc_stat, ggc_internal_cleared_vec_alloc)
(ggc_alloc_atomic_stat, ggc_alloc_atomic)
(ggc_alloc_cleared_atomic, ggc_cleared_alloc_htab_ignore_args)
(ggc_cleared_alloc_ptr_array_two_args): New.
(htab_create_ggc, splay_tree_new_ggc): Redefine.
(ggc_splay_alloc): Change the type of the first argument to
enum gt_types_enum.
(ggc_alloc_string): Make macro.
(ggc_alloc_string_stat): New.
(ggc_strdup): Redefine.
(rtl_zone, tree_zone, tree_id_zone): Declare unconditionally.
(ggc_alloc_rtvec_sized): New.
(ggc_alloc_zone_stat): Rename to ggc_internal_alloc_zone_stat.
(ggc_internal_alloc_zone_pass_stat, ggc_internal_alloc_zone_stat)
(ggc_internal_cleared_alloc_zone_stat)
(ggc_internal_zone_alloc_stat)
(ggc_internal_zone_cleared_alloc_stat)
(ggc_internal_zone_vec_alloc_stat)
(ggc_alloc_zone_rtx_def_stat)
(ggc_alloc_zone_tree_node_stat)
(ggc_alloc_zone_cleared_tree_node_stat)
(ggc_alloc_cleared_gimple_statement_d_stat): New.
* ggc-common.c: Include ggc-internal.h.
(ggc_internal_cleared_alloc_stat): Rename from
ggc_alloc_cleared_stat.
(ggc_realloc_stat): Use ggc_internal_alloc_stat.
(ggc_calloc): Remove.
(ggc_cleared_alloc_htab_ignore_args): New.
(ggc_cleared_alloc_ptr_array_two_args): New.
(ggc_splay_alloc): Add obj_type parameter.
(init_ggc_heuristics): Formatting fixes.
* ggc-none.c: Update copyright year.
(ggc_alloc_stat): Rename to ggc_alloc_stat.
(ggc_alloc_cleared_stat): Rename to
ggc_internal_cleared_alloc_stat.
(struct alloc_zone, rtl_zone, tree_zone, tree_id_zone): New.
* ggc-page.c: Update copyright year. Include ggc-internal.h.
Remove references to ggc_alloc in comments.
(ggc_alloc_typed_stat): Call ggc_internal_alloc_stat.
(ggc_alloc_stat): Rename to ggc_internal_alloc_stat.
(new_ggc_zone, destroy_ggc_zone): Remove.
(struct alloc_zone, rtl_zone, tree_zone, tree_id_zone): New.
* ggc-zone.c: Include ggc-internal.h. Remove references to
ggc_alloc in comments.
(ggc_alloc_zone_stat): ggc_internal_alloc_zone_stat.
(ggc_internal_alloc_zone_pass_stat): New.
(ggc_internal_cleared_alloc_zone_stat): New.
(ggc_alloc_typed_stat): Use ggc_internal_alloc_zone_pass_stat.
(ggc_alloc_stat): Rename ggc_internal_alloc_stat.
(new_ggc_zone, destroy_ggc_zone): Remove.
* stringpool.c: Update copyright year. Include ggc-internal.h
(digit_vector): Make static.
(digit_string): Moved from ggc.h.
(stringpool_ggc_alloc): Use ggc_alloc_atomic.
(ggc_alloc_string): Rename to ggc_alloc_string_stat.
* Makefile.in (GGC_INTERNAL_H): New.
(ggc_common.o, ggc-page.o, ggc-zone.o, stringpool.o): Add
$(GGC_INTERNAL_H) to dependencies.
* gentype.c: Update copyright year.
(walk_type): Accept variable_size GTY option.
(USED_BY_TYPED_GC_P): New macro.
(write_enum_defn): Use USED_BY_TYPED_GC_P. Do not output
whitespace at the end of strings.
(get_type_specifier, variable_size_p): New functions.
(alloc_quantity, alloc_zone): New enums.
(write_typed_alloc_def): New function.
(write_typed_struct_alloc_def): Likewise.
(write_typed_typed_typedef_alloc_def): Likewise.
(write_typed_alloc_defns): Likewise.
(output_typename, write_splay_tree_allocator_def): Likewise.
(write_splay_tree_allocators): Likewise.
(main): Call write_typed_alloc_defns and
write_splay_tree_allocators.
* lto-streamer.h (lto_file_decl_data_ptr): New.
* passes.c (order): Define using cgraph_node_ptr.
* strinpool.c (struct string_pool_data): Declare nested_ptr using
ht_identifier_ptr.
* gimple.h (union gimple_statement_d): Likewise.
* rtl.h (struct rtx_def): Likewise.
(struct rtvec_def): Likewise.
* tree.h (union tree_node): Likewise.
* tree-ssa-operands.h (struct ssa_operand_memory_d): Likewise.
* cfgloop.c (record_loop_exits): Use htab_create_ggc.
* tree-scalar-evolution.c (scev_initialize): Likewise.
* alias.c (record_alias_subset): Update splay_tree_new_ggc call.
* dwarf2asm.c (dw2_force_const_mem): Likewise.
* omp-low.c (lower_omp_critical): Likewise.
* bitmap.h (struct bitmap_head_def): Update comment to not
reference ggc_alloc.
* config/pa/pa.c (get_deferred_label): Use GGC_RESIZEVEC.
* ira.c (fix_reg_equiv_init): Use GGC_RESIZEVEC.
* ipa-prop.c (duplicate_ggc_array): Rename to
duplicate_ipa_jump_func_array. Use typed GC allocation.
(ipa_edge_duplication_hook): Call duplicate_ipa_jump_func_array.
* gimple.c (gimple_alloc_stat): Use
ggc_alloc_cleared_gimple_statement_d_stat.
* varasm.c (create_block_symbol): Use ggc_alloc_zone_rtx_def.
* tree.c (make_node_stat): Use
ggc_alloc_zone_cleared_tree_node_stat.
(make_tree_vec_stat): Likewise.
(build_vl_exp_stat): Likewise.
(copy_node_stat): Use ggc_alloc_zone_tree_node_stat.
(make_tree_binfo_stat): Likewise.
(tree_cons_stat): Likewise.
* rtl.c (rtx_alloc_stat): Use ggc_alloc_zone_rtx_def_stat.
(shallow_copy_rtx_stat): Likewise.
(make_node_stat): Likewise.
* lto-symtab.c: Fix comment.
* tree-cfg.c (create_bb): Update comment to not reference
ggc_alloc_cleared.
* tree-ssa-structalias.c (struct heapvar_for_stmt): Fix param_is
value.
* varpool.c (varpool_node): Use typed GC allocation.
(varpool_extra_name_alias): Likewise.
* varasm.c (emutls_decl): Likewise.
(get_unnamed_section): Likewise.
(get_noswitch_section): Likewise.
(get_section): Likewise.
(get_block_for_section): Likewise.
(build_constant_desc): Likewise.
(create_constant_pool): Likewise.
(force_const_mem): Likewise.
* tree.c (build_vl_exp_stat): Likewise.
(build_real): Likewise.
(build_string): Likewise.
(decl_debug_expr_insert): Likewise.
(decl_value_expr_insert): Likewise.
(type_hash_add): Likewise.
(build_omp_clause): Likewise.
* tree-ssanames.c (duplicate_ssa_name_ptr_info): Likewise.
* tree-ssa.c (init_tree_ssa): Likewise.
* tree-ssa-structalias.c (heapvar_insert): Likewise.
* tree-ssa-operands.c (ssa_operand_alloc): Likewise.
* tree-ssa-loop-niter.c (record_estimate): Likewise.
* tree-ssa-alias.c (get_ptr_info): Likewise.
* tree-scalar-evolution.c (new_scev_info_str): Likewise.
* tree-phinodes.c (allocate_phi_node): Likewise.
* tree-iterator.c (tsi_link_before): Likewise.
(tsi_link_after): Likewise.
* tree-eh.c (add_stmt_to_eh_lp_fn): Likewise.
* tree-dfa.c (create_var_ann): Likewise.
* tree-cfg.c (create_bb): Likewise.
* toplev.c (alloc_for_identifier_to_locale): Likewise.
(general_init): Likewise.
* stringpool.c (stringpool_ggc_alloc): Likewise.
(gt_pch_save_stringpool): Likewise.
* sese.c (if_region_set_false_region): Likewise.
* passes.c (do_per_function_toporder): Likewise.
* optabs.c (set_optab_libfunc): Likewise.
(set_conv_libfunc): Likewise.
* lto-symtab.c (lto_symtab_register_decl): Likewise.
* lto-streamer-in.c (lto_input_eh_catch_list): Likewise.
(input_eh_region): Likewise.
(input_eh_lp): Likewise.
(make_new_block): Likewise.
(unpack_ts_real_cst_value_fields): Likewise.
* lto-section-in.c (lto_new_in_decl_state): Likewise.
* lto-cgraph.c (input_node_opt_summary): Likewise.
* loop-init.c (loop_optimizer_init): Likewise.
* lambda.h (lambda_vector_new): Likewise.
* lambda-code.c (replace_uses_equiv_to_x_with_y): Likewise.
* ira.c (update_equiv_regs): Likewise.
* ipa.c (cgraph_node_set_new): Likewise.
(cgraph_node_set_add): Likewise.
(varpool_node_set_new): Likewise.
(varpool_node_set_add): Likewise.
* ipa-prop.c (ipa_compute_jump_functions_for_edge): Likewise.
(duplicate_ipa_jump_func_array): Likewise.
(ipa_read_node_info): Likewise.
* ipa-cp.c (ipcp_create_replace_map): Likewise.
* integrate.c (get_hard_reg_initial_val): Likewise.
* gimple.c (gimple_alloc_stat): Likewise.
(gimple_build_omp_for): Likewise.
(gimple_seq_alloc): Likewise.
(gimple_copy): Likewise.
* gimple-iterator.c (gsi_insert_before_without_update): Likewise.
(gsi_insert_after_without_update): Likewise.
* function.c (add_frame_space): Likewise.
(insert_temp_slot_address): Likewise.
(assign_stack_temp_for_type): Likewise.
(allocate_struct_function): Likewise.
(types_used_by_var_decl_insert): Likewise.
* except.c (init_eh_for_function): Likewise.
(gen_eh_region): Likewise.
(gen_eh_region_catch): Likewise.
(gen_eh_landing_pad): Likewise.
(add_call_site): Likewise.
* emit-rtl.c (get_mem_attrs): Likewise.
(get_reg_attrs): Likewise.
(start_sequence): Likewise.
(init_emit): Likewise.
* dwarf2out.c (new_cfi): Likewise.
(queue_reg_save): Likewise.
(dwarf2out_frame_init): Likewise.
(new_loc_descr): Likewise.
(find_AT_string): Likewise.
(new_die): Likewise.
(add_var_loc_to_decl): Likewise.
(clone_die): Likewise.
(clone_as_declaration): Likewise.
(break_out_comdat_types): Likewise.
(new_loc_list): Likewise.
(loc_descriptor): Likewise.
(add_loc_descr_to_each): Likewise.
(add_const_value_attribute): Likewise.
(tree_add_const_value_attribute): Likewise.
(add_comp_dir_attribute): Likewise.
(add_name_and_src_coords_attributes): Likewise.
(lookup_filename): Likewise.
(store_vcall_insn): Likewise.
(dwarf2out_init): Likewise.
* dbxout.c (dbxout_init): Likewise.
* config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise.
* config/sparc/sparc.c (sparc_init_machine_status): Likewise.
* config/score/score7.c (score7_output_external): Likewise.
* config/score/score3.c (score3_output_external): Likewise.
* config/s390/s390.c (s390_init_machine_status): Likewise.
* config/rs6000/rs6000.c (builtin_function_type): Likewise.
(rs6000_init_machine_status): Likewise.
(output_toc): Likewise.
* config/pa/pa.c (pa_init_machine_status): Likewise.
(get_deferred_plabel): Likewise.
* config/moxie/moxie.c (moxie_init_machine_status): Likewise.
* config/mmix/mmix.c (mmix_init_machine_status): Likewise.
* config/mips/mips.c (mflip_mips16_use_mips16_p): Likewise.
* config/mep/mep.c (mep_init_machine_status): Likewise.
(mep_note_pragma_flag): Likewise.
* config/m32c/m32c.c (m32c_init_machine_status): Likewise.
* config/iq2000/iq2000.c (iq2000_init_machine_status): Likewise.
* config/ia64/ia64.c (ia64_init_machine_status): Likewise.
* config/i386/winnt.c (i386_pe_record_external_function): Likewise.
(i386_pe_maybe_record_exported_symbol): Likewise.
* config/i386/i386.c (get_dllimport_decl): Likewise.
(ix86_init_machine_status): Likewise.
(assign_386_stack_local): Likewise.
* config/frv/frv.c (frv_init_machine_status): Likewise.
* config/darwin.c (machopic_indirection_name): Likewise.
* config/cris/cris.c (cris_init_machine_status): Likewise.
* config/bfin/bfin.c (bfin_init_machine_status): Likewise.
* config/avr/avr.c (avr_init_machine_status): Likewise.
* config/arm/arm.c (arm_init_machine_status): Likewise.
* config/alpha/alpha.c (alpha_init_machine_status): Likewise.
(alpha_need_linkage): Likewise.
(alpha_use_linkage): Likewise.
* cgraph.c (cgraph_allocate_node): Likewise.
(cgraph_create_edge_1): Likewise.
(cgraph_create_indirect_edge): Likewise.
(cgraph_add_asm_node): Likewise.
* cfgrtl.c (init_rtl_bb_info): Likewise.
* cfgloop.c (alloc_loop): Likewise.
(rescan_loop_exit): Likewise.
* cfg.c (init_flow): Likewise.
(alloc_block): Likewise.
(unchecked_make_edge): Likewise.
* c-parser.c (c_parse_init): Likewise.
(c_parse_file): Likewise.
* c-decl.c (bind): Likewise.
(record_inline_static): Likewise.
(push_scope): Likewise.
(make_label): Likewise.
(lookup_label_for_goto): Likewise.
(finish_struct): Likewise.
(finish_enum): Likewise.
(c_push_function_context): Likewise.
* bitmap.c (bitmap_element_allocate): Likewise.
(bitmap_gc_alloc_stat): Likewise.
* alias.c (record_alias_subset): Likewise.
(init_alias_analysis): Likewise.
include:
2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* splay-tree.h: Update copyright years.
(splay_tree_s): Document fields.
(splay_tree_new_typed_alloc): New.
* hashtab.h: Update copyright years.
(htab_create_typed_alloc): New.
libcpp:
2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* include/symtab.h (ht_identifier_ptr): New.
libiberty:
2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* splay-tree.c: Update copyright years.
(splay_tree_new_typed_alloc): New.
(splay_tree_new_with_allocator): Use it.
* hashtab.c: Update copyright years.
(htab_create_typed_alloc): New.
(htab_create_alloc): Use it.
* functions.texi: Regenerate.
From-SVN: r160425
2010-06-08 09:25:24 +02:00
|
|
|
|
2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
|
|
|
|
|
|
|
|
|
|
* include/symtab.h (ht_identifier_ptr): New.
|
|
|
|
|
|
2010-06-03 08:45:02 +02:00
|
|
|
|
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.
|
|
|
|
|
|
c-common.c (flag_isoc1x): New.
gcc:
* c-common.c (flag_isoc1x): New.
(flag_isoc99): Update comment.
* c-common.h (flag_isoc1x): New.
(flag_isoc99): Update comment.
* c-cppbuiltin.c (builtin_define_float_constants): Also define
__<type>_DECIMAL_DIG__.
* c-opts.c (set_std_c1x): New.
(c_common_handle_option): Handle -std=c1x and -std=gnu1x.
(set_std_c89, set_std_c99): Also set flag_isoc1x to 0.
* c.opt (-std=c1x, -std=gnu1x): New options.
* doc/cpp.texi: Mention -std=c1x.
* doc/cppopts.texi (-std=c1x, -std=gnu1x): Document.
* doc/extend.texi: Mention -std=c1x and -std=gnu1x.
* doc/invoke.texi (-std=c1x, -std=gnu1x): Document.
* doc/standards.texi: Mention C1X.
* ginclude/float.h (FLT_DECIMAL_DIG, DBL_DECIMAL_DIG,
LDBL_DECIMAL_DIG, FLT_HAS_SUBNORM, DBL_HAS_SUBNORM,
LDBL_HAS_SUBNORM, FLT_TRUE_MIN, DBL_TRUE_MIN, LDBL_TRUE_MIN):
Define for C1X.
gcc/testsuite:
* gcc.dg/c90-float-1.c: Also test that C1X macros are not defined.
* gcc.dg/c99-float-1.c: Also test that C1X macros are not defined.
* gcc.dg/c1x-float-1.c: New test.
libcpp:
* 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.
From-SVN: r158711
2010-04-25 23:54:22 +02:00
|
|
|
|
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 18:08:42 +02:00
|
|
|
|
2010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
|
|
|
|
|
|
|
|
|
|
PR cpp/43195
|
|
|
|
|
* files.c (report_missing_guard): Test for #pragma once.
|
|
|
|
|
|
diagnostic.h (diagnostic_override_option_index): New macro to set a diagnostic's option_index.
* diagnostic.h (diagnostic_override_option_index): New macro to
set a diagnostic's option_index.
* c-tree.h (c_cpp_error): Add warning reason argument.
* opts.c (_warning_as_error_callback): New.
(register_warning_as_error_callback): Store callback for
warnings enabled via enable_warning_as_error.
(enable_warning_as_error): Call callback, minor code tidy.
* opts.h (register_warning_as_error_callback): Declare.
* c-opts.c (warning_as_error_callback): New, set cpp_opts flag in
response to -Werror=.
(c_common_init_options): Register warning_as_error_callback in opts.c.
* common.opt: Add -Wno-cpp option.
* c-common.c (struct reason_option_codes_t): Map cpp warning
reason codes to gcc option indexes.
* (c_option_controlling_cpp_error): New function, lookup the gcc
option index for a cpp warning reason code.
* (c_cpp_error): Add warning reason argument, call
c_option_controlling_cpp_error for diagnostic_override_option_index.
* doc/invoke.texi: Document -Wno-cpp.
* cpp.c (cb_cpp_error): Add warning reason argument, set a value
for diagnostic_override_option_index if CPP_W_WARNING_DIRECTIVE.
* 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.
* gcc.dg/cpp/warn-undef-2.c: New.
* gcc.dg/cpp/warn-traditional-2.c: New.
* gcc.dg/cpp/warn-comments-2.c: New.
* gcc.dg/cpp/warning-directive-1.c: New.
* gcc.dg/cpp/warn-long-long.c: New.
* gcc.dg/cpp/warn-traditional.c: New.
* gcc.dg/cpp/warn-variadic-2.c: New.
* gcc.dg/cpp/warn-undef.c: New.
* gcc.dg/cpp/warn-normalized-1.c: New.
* gcc.dg/cpp/warning-directive-2.c: New.
* gcc.dg/cpp/warn-long-long-2.c: New.
* gcc.dg/cpp/warn-variadic.c: New.
* gcc.dg/cpp/warn-normalized-2.c: New.
* gcc.dg/cpp/warning-directive-3.c: New.
* gcc.dg/cpp/warn-deprecated-2.c: New.
* gcc.dg/cpp/warn-trigraphs-1.c: New.
* gcc.dg/cpp/warn-multichar-2.c: New.
* gcc.dg/cpp/warn-normalized-3.c: New.
* gcc.dg/cpp/warning-directive-4.c: New.
* gcc.dg/cpp/warn-unused-macros.c: New.
* gcc.dg/cpp/warn-trigraphs-2.c: New.
* gcc.dg/cpp/warn-cxx-compat-2.c: New.
* gcc.dg/cpp/warn-cxx-compat.c: New.
* gcc.dg/cpp/warn-redefined.c: New.
* gcc.dg/cpp/warn-trigraphs-3.c: New.
* gcc.dg/cpp/warn-unused-macros-2.c: New.
* gcc.dg/cpp/warn-deprecated.c: New.
* gcc.dg/cpp/warn-trigraphs-4.c: New.
* gcc.dg/cpp/warn-redefined-2.c: New.
* gcc.dg/cpp/warn-comments.c: New.
* gcc.dg/cpp/warn-multichar.c: New.
* g++.dg/cpp/warning-directive-1.C: New.
* g++.dg/cpp/warning-directive-2.C: New.
* g++.dg/cpp/warning-directive-3.C: New.
* g++.dg/cpp/warning-directive-4.C: New.
* gfortran.dg/warning-directive-1.F90: New.
* gfortran.dg/warning-directive-3.F90: New.
* gfortran.dg/warning-directive-2.F90: New.
* gfortran.dg/warning-directive-4.F90: New.
From-SVN: r158079
2010-04-07 19:18:10 +02:00
|
|
|
|
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 09:02:40 +02:00
|
|
|
|
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 20:18:06 +02:00
|
|
|
|
2010-04-02 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
|
|
|
|
|
|
|
|
|
|
* aclocal.m4: Regenerate.
|
|
|
|
|
|
2010-03-29 17:00:43 +02:00
|
|
|
|
2010-03-29 Jason Merrill <jason@redhat.com>
|
|
|
|
|
|
2010-03-29 22:07:29 +02:00
|
|
|
|
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.
|
|
|
|
|
|
2010-03-29 17:00:43 +02:00
|
|
|
|
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 20:49:17 +01:00
|
|
|
|
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 19:08:17 +01:00
|
|
|
|
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 09:18:16 +01:00
|
|
|
|
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 19:37:19 +01:00
|
|
|
|
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 23:41:15 +02:00
|
|
|
|
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 12:04:22 +02:00
|
|
|
|
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
|
|
|
|
|
highest_line to RESERVED_LOCATION_COUNT-1 instead of 0.
|
|
|
|
|
|
2009-10-10 02:39:46 +02:00
|
|
|
|
2009-10-09 Jason Merrill <jason@redhat.com>
|
|
|
|
|
|
|
|
|
|
* charset.c (_cpp_valid_ucn): Update C++0x restrictions.
|
|
|
|
|
|
2009-10-10 02:34:21 +02:00
|
|
|
|
2009-10-09 Neil Vachharajani <nvachhar@google.com>
|
|
|
|
|
|
|
|
|
|
* directives.c (DIRECTIVE_TABLE): Remove DEPRECATED from ident and
|
|
|
|
|
sccs.
|
|
|
|
|
|
2009-09-23 17:21:42 +02:00
|
|
|
|
2009-09-23 Loren J. Rittle <ljrittle@acm.org>
|
|
|
|
|
|
|
|
|
|
* configure.ac (AC_CHECK_HEADERS after AC_LANG(C++)): Add sys/stat.h.
|
|
|
|
|
* configure: Rebuilt.
|
|
|
|
|
|
2009-09-22 10:37:31 +02:00
|
|
|
|
2009-09-22 Richard Guenther <rguenther@suse.de>
|
|
|
|
|
|
|
|
|
|
PR pch/38987
|
|
|
|
|
* files.c (pch_open_file): Disallow non-toplevel PCH inclusion.
|
|
|
|
|
|
2009-09-19 08:15:21 +02:00
|
|
|
|
2009-09-18 Chris Demetriou <cgd@google.com>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/28435:
|
|
|
|
|
* include/cpplib.h (struct cpp_options): Add new member
|
|
|
|
|
deps.need_preprocessor_output.
|
|
|
|
|
* files.c (open_file_failed): If preprocessor output is needed
|
|
|
|
|
always report an error.
|
|
|
|
|
|
2009-09-13 15:08:20 +02:00
|
|
|
|
2009-09-13 Kai Tietz <kai.tietz@onevision.com>
|
|
|
|
|
|
|
|
|
|
* configure.ac: Set for i?86-w64-mingw*
|
|
|
|
|
need_64bit_hwint to yes.
|
|
|
|
|
* configure: Regenerated.
|
|
|
|
|
|
2009-09-12 21:46:45 +02:00
|
|
|
|
2009-09-10 Jason Merrill <jason@redhat.com>
|
|
|
|
|
|
|
|
|
|
* directives.c (cpp_define): constify.
|
|
|
|
|
|
2009-09-02 19:35:30 +02:00
|
|
|
|
2009-09-02 Ian Lance Taylor <iant@google.com>
|
|
|
|
|
|
|
|
|
|
* macro.c (stringify_arg): Escape CPP_WCHAR tokens.
|
|
|
|
|
|
2009-08-24 21:08:51 +02:00
|
|
|
|
2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
|
|
|
|
|
|
|
|
|
|
* configure.ac (AC_PREREQ): Bump to 2.64.
|
|
|
|
|
|
2009-08-22 15:22:20 +02:00
|
|
|
|
2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
|
|
|
|
|
|
|
|
|
|
* aclocal.m4: Regenerate.
|
|
|
|
|
* config.in: Regenerate.
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
|
2009-08-17 19:34:53 +02:00
|
|
|
|
2009-08-17 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/41067:
|
|
|
|
|
* charset.c (convert_escape): Add missing ":" to error text.
|
|
|
|
|
|
2009-07-27 19:27:10 +02:00
|
|
|
|
2009-07-27 Douglas B Rupp <rupp@gnat.com>
|
|
|
|
|
|
|
|
|
|
* include/cpplib.h (INO_T_CPP): New macro.
|
|
|
|
|
(struct cpp_dir): Use it.
|
|
|
|
|
|
2009-07-20 20:09:33 +02:00
|
|
|
|
2009-07-20 Jerry Quinn <jlquinn@optonline.net>
|
|
|
|
|
|
|
|
|
|
PR regression/40800
|
|
|
|
|
* configure.ac: Use = instead of == for testing
|
|
|
|
|
ENABLE_BUILD_WITH_CXX.
|
|
|
|
|
* configure: Rebuild.
|
|
|
|
|
|
directives.c (do_linemarker, do_line): Use CPP_STRING for ignored enum value.
2009-07-17 Jerry Quinn <jlquinn@optonline.net>
* directives.c (do_linemarker, do_line): Use CPP_STRING for
ignored enum value.
* files.c (find_file_in_dir): Add cast from void* to char*.
* symtab.c (ht_lookup_with_hash): Add cast from void* to char*.
* Makefile.in: (WARN_CFLAGS): Use general and C-specific
warnings.
(CXX, CXXFLAGS, WARN_CXXFLAGS, ALL_CXXFLAGS,
ENABLE_BUILD_WITH_CXX, CCDEPMODE, CXXDEPMODE, COMPILER,
COMPILER_FLAGS): New.
(DEPMODE): Set from CCDEPMODE or CXXDEPMODE.
(COMPILE.base): Use COMPILER instead of CC. Use COMPILER_FLAGS
instead of ALL_CFLAGS.
* configure.ac: Invoke AC_PROG_CXX. Separate C-specific warnings
from other warnings. Add -Wc++-compat to C-specific warnings.
Check for --enable-build-with-cxx. Set and substitute
ENABLE_BUILD_WITH_CXX. Invoke ZW_PROG_COMPILER_DEPENDENCIES
according to ENABLE_BUILD_WITH_CXX. Invoke AC_LANG before
AC_CHECK_HEADERS.
* configure: Rebuild.
* include/cpp-id-data.h: Remove extern "C".
* include/line-map.h: Likewise.
* include/mkdeps.h: Likewise.
* include/symtab.h: Likewise.
* internal.h: Likewise.
From-SVN: r149763
2009-07-18 05:22:16 +02:00
|
|
|
|
2009-07-17 Jerry Quinn <jlquinn@optonline.net>
|
|
|
|
|
|
|
|
|
|
* directives.c (do_linemarker, do_line): Use CPP_STRING for
|
|
|
|
|
ignored enum value.
|
|
|
|
|
* files.c (find_file_in_dir): Add cast from void* to char*.
|
|
|
|
|
* symtab.c (ht_lookup_with_hash): Add cast from void* to char*.
|
|
|
|
|
* Makefile.in: (WARN_CFLAGS): Use general and C-specific
|
|
|
|
|
warnings.
|
|
|
|
|
(CXX, CXXFLAGS, WARN_CXXFLAGS, ALL_CXXFLAGS,
|
|
|
|
|
ENABLE_BUILD_WITH_CXX, CCDEPMODE, CXXDEPMODE, COMPILER,
|
|
|
|
|
COMPILER_FLAGS): New.
|
|
|
|
|
(DEPMODE): Set from CCDEPMODE or CXXDEPMODE.
|
|
|
|
|
(COMPILE.base): Use COMPILER instead of CC. Use COMPILER_FLAGS
|
|
|
|
|
instead of ALL_CFLAGS.
|
|
|
|
|
* configure.ac: Invoke AC_PROG_CXX. Separate C-specific warnings
|
|
|
|
|
from other warnings. Add -Wc++-compat to C-specific warnings.
|
|
|
|
|
Check for --enable-build-with-cxx. Set and substitute
|
|
|
|
|
ENABLE_BUILD_WITH_CXX. Invoke ZW_PROG_COMPILER_DEPENDENCIES
|
|
|
|
|
according to ENABLE_BUILD_WITH_CXX. Invoke AC_LANG before
|
|
|
|
|
AC_CHECK_HEADERS.
|
|
|
|
|
* configure: Rebuild.
|
|
|
|
|
* include/cpp-id-data.h: Remove extern "C".
|
|
|
|
|
* include/line-map.h: Likewise.
|
|
|
|
|
* include/mkdeps.h: Likewise.
|
|
|
|
|
* include/symtab.h: Likewise.
|
|
|
|
|
* internal.h: Likewise.
|
|
|
|
|
|
2009-06-23 18:30:58 +02:00
|
|
|
|
2009-06-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
|
|
|
|
|
|
|
|
|
|
* directives.c (parse_include): Add location argument. Update all
|
|
|
|
|
calls.
|
|
|
|
|
(parse_answer): Likewise.
|
|
|
|
|
(do_include_common): Error with exact location.
|
|
|
|
|
(parse_assertion): Likewise.
|
|
|
|
|
|
2009-06-18 17:10:23 +02:00
|
|
|
|
2009-06-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
|
|
|
|
|
|
|
|
|
|
* expr.c (num_div_op): Take explicit location.
|
|
|
|
|
|
2009-06-17 22:22:02 +02:00
|
|
|
|
2009-06-17 Ian Lance Taylor <iant@google.com>
|
|
|
|
|
|
|
|
|
|
* include/cpplib.h (progname): Don't declare.
|
|
|
|
|
|
2009-06-12 21:43:25 +02:00
|
|
|
|
2009-06-12 Ian Lance Taylor <iant@google.com>
|
|
|
|
|
|
|
|
|
|
* include/cpplib.h (struct cpp_options): Add
|
|
|
|
|
warn_cxx_operator_names field.
|
|
|
|
|
(NODE_WARN_OPERATOR): Define.
|
|
|
|
|
(struct cpp_hashnode): Increase flags field to 10 bits, decrease
|
|
|
|
|
type to 6 bits.
|
|
|
|
|
* init.c (mark_named_operators): Add flags parameter.
|
|
|
|
|
(cpp_post_options): Pick flags value to pass to
|
|
|
|
|
mark_named_operators.
|
|
|
|
|
* lex.c (lex_identifier): If NODE_WARN_OPERATOR is set, warn that
|
|
|
|
|
identifier is an operator name in C++.
|
|
|
|
|
|
2009-06-01 18:09:33 +02:00
|
|
|
|
2009-06-01 Aldy Hernandez <aldyh@redhat.com>
|
|
|
|
|
|
|
|
|
|
* include/line-map.h (LAST_SOURCE_COLUMN): New.
|
|
|
|
|
|
2009-06-01 17:37:03 +02:00
|
|
|
|
2009-06-01 Ian Lance Taylor <iant@google.com>
|
|
|
|
|
|
|
|
|
|
* include/cpp-id-data.h: Add extern "C".
|
|
|
|
|
* include/line-map.h: Likewise.
|
|
|
|
|
* include/mkdeps.h: Likewise.
|
|
|
|
|
* include/symtab.h: Likewise.
|
|
|
|
|
* internal.h: Likewise.
|
|
|
|
|
|
2009-05-16 08:54:11 +02:00
|
|
|
|
2009-05-15 Ian Lance Taylor <iant@google.com>
|
|
|
|
|
|
|
|
|
|
* include/cpplib.h (enum cpp_builtin_type): Rename from enum
|
|
|
|
|
builtin_type. Change all uses.
|
|
|
|
|
|
2009-05-14 01:17:55 +02:00
|
|
|
|
2009-05-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
|
|
|
|
|
|
|
|
|
|
PR cpp/36674
|
|
|
|
|
* directives (do_linemarker): Compensate for the increment in
|
|
|
|
|
location that occurs when we reach the end of line.
|
|
|
|
|
* files (_cpp_stack_include): Mention _cpp_find_file in the
|
|
|
|
|
comment.
|
|
|
|
|
|
c-lex.c (c_lex_with_flags): Expect cpp_hashnode in tok->val.node.node.
gcc:
* c-lex.c (c_lex_with_flags): Expect cpp_hashnode in
tok->val.node.node.
libcpp:
* include/cpplib.h (enum cpp_token_fld_kind): Add
CPP_TOKEN_FLD_TOKEN_NO.
(struct cpp_macro_arg, struct cpp_identifier): Define.
(union cpp_token_u): Use struct cpp_identifier for identifiers.
Use struct cpp_macro_arg for macro arguments. Add token_no for
CPP_PASTE token numbers.
* directives.c (_cpp_handle_directive, lex_macro_node, do_pragma,
do_pragma_poison, parse_assertion): Use val.node.node in place of
val.node.
* expr.c (parse_defined, eval_token): Use val.node.node in place
of val.node.
* lex.c (cpp_ideq, _cpp_lex_direct, cpp_token_len,
cpp_spell_token, cpp_output_token, _cpp_equiv_tokens,
cpp_token_val_index): Use val.macro_arg.arg_no or val.token_no in
place of val.arg_no. Use val.node.node in place of val.node.
* macro.c (replace_args, cpp_get_token, parse_params,
lex_expansion_token, create_iso_definition, cpp_macro_definition):
Use val.macro_arg.arg_no or val.token_no in place of val.arg_no.
Use val.node.node in place of val.node.
From-SVN: r147341
2009-05-10 16:27:32 +02:00
|
|
|
|
2009-05-10 Joseph Myers <joseph@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* include/cpplib.h (enum cpp_token_fld_kind): Add
|
|
|
|
|
CPP_TOKEN_FLD_TOKEN_NO.
|
|
|
|
|
(struct cpp_macro_arg, struct cpp_identifier): Define.
|
|
|
|
|
(union cpp_token_u): Use struct cpp_identifier for identifiers.
|
|
|
|
|
Use struct cpp_macro_arg for macro arguments. Add token_no for
|
|
|
|
|
CPP_PASTE token numbers.
|
|
|
|
|
* directives.c (_cpp_handle_directive, lex_macro_node, do_pragma,
|
|
|
|
|
do_pragma_poison, parse_assertion): Use val.node.node in place of
|
|
|
|
|
val.node.
|
|
|
|
|
* expr.c (parse_defined, eval_token): Use val.node.node in place
|
|
|
|
|
of val.node.
|
|
|
|
|
* lex.c (cpp_ideq, _cpp_lex_direct, cpp_token_len,
|
|
|
|
|
cpp_spell_token, cpp_output_token, _cpp_equiv_tokens,
|
|
|
|
|
cpp_token_val_index): Use val.macro_arg.arg_no or val.token_no in
|
|
|
|
|
place of val.arg_no. Use val.node.node in place of val.node.
|
|
|
|
|
* macro.c (replace_args, cpp_get_token, parse_params,
|
|
|
|
|
lex_expansion_token, create_iso_definition, cpp_macro_definition):
|
|
|
|
|
Use val.macro_arg.arg_no or val.token_no in place of val.arg_no.
|
|
|
|
|
Use val.node.node in place of val.node.
|
|
|
|
|
|
2009-05-03 13:59:26 +02:00
|
|
|
|
2009-05-03 Joseph Myers <joseph@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* charset.c (one_utf8_to_cppchar): Correct mask used for 5-byte
|
|
|
|
|
UTF-8 sequences.
|
|
|
|
|
|
2009-04-25 20:46:03 +02:00
|
|
|
|
2009-04-25 Joseph Myers <joseph@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/39559
|
|
|
|
|
* expr.c (cpp_interpret_integer): Use a pedwarn for decimal
|
|
|
|
|
constants larger than intmax_t in C99 mode.
|
|
|
|
|
|
2009-04-22 20:29:36 +02:00
|
|
|
|
2009-04-21 Taras Glek <tglek@mozilla.com>
|
|
|
|
|
|
|
|
|
|
* include/cpp-id-data.h: Update GTY annotations to new syntax.
|
|
|
|
|
* include/cpplib.h: Likewise.
|
|
|
|
|
* include/line-map.h: Likewise.
|
|
|
|
|
* include/symtab.h: Likewise.
|
|
|
|
|
|
2009-04-22 17:32:18 +02:00
|
|
|
|
2009-04-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
|
|
|
|
|
|
|
|
|
|
PR c++/14875
|
|
|
|
|
* lex.c (cpp_type2name): Take a flags parameter. Call
|
|
|
|
|
cpp_named_operator2name for named operators and cpp_digraph2name
|
|
|
|
|
for digraphs.
|
|
|
|
|
(cpp_digraph2name): New.
|
|
|
|
|
(cpp_spell_token): Use it.
|
|
|
|
|
(cpp_output_token): Likewise.
|
|
|
|
|
* include/cpplib.h (cpp_type2name): Update declaration.
|
|
|
|
|
* init.c (cpp_named_operator2name): New.
|
|
|
|
|
* internal.h (cpp_named_operator2name): Declare.
|
|
|
|
|
|
2009-04-21 00:12:52 +02:00
|
|
|
|
2009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
|
|
|
|
|
|
|
|
|
|
PR c++/13358
|
|
|
|
|
* init.c (cpp_create_reader): Wlong_long is disabled by default.
|
|
|
|
|
* expr.c (cpp_classify_number): Give different messages for C and
|
|
|
|
|
C++ front-ends.
|
|
|
|
|
|
2009-04-19 19:10:56 +02:00
|
|
|
|
2009-04-19 Joseph Myers <joseph@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/20078
|
|
|
|
|
* include/cpp-id-data.h (struct cpp_macro): Add extra_tokens
|
|
|
|
|
field.
|
|
|
|
|
* include/cpplib.h (SP_DIGRAPH, SP_PREV_WHITE): Define.
|
|
|
|
|
(struct cpp_token): Change flags to unsigned short.
|
|
|
|
|
* lex.c (_cpp_lex_direct): Initialize arg_no for CPP_PASTE tokens.
|
|
|
|
|
(_cpp_equiv_tokens): Check arg_no for CPP_PASTE tokens.
|
|
|
|
|
(cpp_token_val_index): Return CPP_TOKEN_FLD_ARG_NO for CPP_PASTE
|
|
|
|
|
tokens.
|
|
|
|
|
* macro.c (macro_real_token_count): New.
|
|
|
|
|
(enter_macro_context, replace_args): Use macro_real_token_count.
|
|
|
|
|
(create_iso_definition): Record whitespace surrounding and digraph
|
|
|
|
|
spelling of # and ## tokens using SP_PREV_WHITE and SP_DIGRAPH.
|
|
|
|
|
Set extra_tokens and save CPP_PASTE tokens with arg_no set for
|
|
|
|
|
multiple consecutive ## tokens.
|
|
|
|
|
(_cpp_create_definition): Initialize extra_tokens.
|
|
|
|
|
(cpp_macro_definition): Use macro_real_token_count.
|
|
|
|
|
|
2009-04-18 22:25:07 +02:00
|
|
|
|
2009-04-18 Joseph Myers <joseph@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* directives.c (parse_include): Pass true to check_eol.
|
|
|
|
|
|
2009-04-18 19:36:28 +02:00
|
|
|
|
2009-04-18 Joseph Myers <joseph@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/39646
|
|
|
|
|
* include/line-map.h (enum lc_reason): Add LC_RENAME_VERBATIM.
|
|
|
|
|
* line-map.c (linemap_add): Handle LC_RENAME_VERBATIM.
|
|
|
|
|
* directives.c (do_line, do_linemarker): Use LC_RENAME_VERBATIM in
|
|
|
|
|
place of LC_RENAME.
|
|
|
|
|
|
re PR preprocessor/39647 (Syntax checks in #line not quite right)
libcpp:
PR preprocessor/39647
* directives.c (check_eol): Add parameter expand.
(do_undef, parse_include, do_line, do_linemarker, do_ident,
do_pragma_once, do_pragma_system_header, do_ifdef, do_ifndef,
do_else, do_endif, do_assert, do_unassert): All callers changed.
Pass true from do_line, false elsewhere.
gcc/testsuite:
* gcc.dg/cpp/line7.c: New test.
From-SVN: r146316
2009-04-18 17:28:40 +02:00
|
|
|
|
2009-04-18 Joseph Myers <joseph@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/39647
|
|
|
|
|
* directives.c (check_eol): Add parameter expand.
|
|
|
|
|
(do_undef, parse_include, do_line, do_linemarker, do_ident,
|
|
|
|
|
do_pragma_once, do_pragma_system_header, do_ifdef, do_ifndef,
|
|
|
|
|
do_else, do_endif, do_assert, do_unassert): All callers changed.
|
|
|
|
|
Pass true from do_line, false elsewhere.
|
|
|
|
|
|
2009-04-13 00:20:02 +02:00
|
|
|
|
2009-04-12 Joseph Myers <joseph@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/31869
|
|
|
|
|
* macro.c (stringify_arg): Handle NULL source token in padding
|
|
|
|
|
token where previous padding token did not have source token with
|
|
|
|
|
preceding whitespace.
|
|
|
|
|
|
2009-04-09 17:00:19 +02:00
|
|
|
|
2009-04-09 Jakub Jelinek <jakub@redhat.com>
|
|
|
|
|
|
|
|
|
|
* Makefile.in: Change copyright header to refer to version
|
|
|
|
|
3 of the GNU General Public License and to point readers at the
|
|
|
|
|
COPYING3 file and the FSF's license web page.
|
|
|
|
|
* charset.c: Likewise.
|
|
|
|
|
* directives-only.c: Likewise.
|
|
|
|
|
* directives.c: Likewise.
|
|
|
|
|
* errors.c: Likewise.
|
|
|
|
|
* expr.c: Likewise.
|
|
|
|
|
* files.c: Likewise.
|
|
|
|
|
* identifiers.c: Likewise.
|
|
|
|
|
* include/cpp-id-data.h: Likewise.
|
|
|
|
|
* include/cpplib.h: Likewise.
|
|
|
|
|
* include/line-map.h: Likewise.
|
|
|
|
|
* include/mkdeps.h: Likewise.
|
|
|
|
|
* include/symtab.h: Likewise.
|
|
|
|
|
* init.c: Likewise.
|
|
|
|
|
* internal.h: Likewise.
|
|
|
|
|
* lex.c: Likewise.
|
|
|
|
|
* line-map.c: Likewise.
|
|
|
|
|
* macro.c: Likewise.
|
|
|
|
|
* makeucnid.c: Likewise.
|
|
|
|
|
* mkdeps.c: Likewise.
|
|
|
|
|
* pch.c: Likewise.
|
|
|
|
|
* symtab.c: Likewise.
|
|
|
|
|
* system.h: Likewise.
|
|
|
|
|
* traditional.c: Likewise.
|
|
|
|
|
* ucnid.tab: Likewise.
|
|
|
|
|
* ucnid.h: Regenerate.
|
|
|
|
|
|
2009-04-01 19:04:42 +02:00
|
|
|
|
2009-04-01 Janis Johnson <janis187@us.ibm.com>
|
|
|
|
|
|
2009-04-01 19:31:26 +02:00
|
|
|
|
PR c/39027
|
|
|
|
|
* include/cpplib.h (CPP_N_DEFAULT): Define.
|
|
|
|
|
* expr.c (interpret_float_suffix): Recognize d or D for double,
|
|
|
|
|
return new value for default.
|
|
|
|
|
(cpp_classify_number): Issue pedwarn for use of d or D in suffix.
|
|
|
|
|
|
2009-04-01 19:04:42 +02:00
|
|
|
|
PR c/33466
|
|
|
|
|
* expr.c (interpret_float_suffix): Reject invalid suffix that uses
|
|
|
|
|
letters from decimal float and fixed-point suffixes.
|
|
|
|
|
|
2009-03-31 14:43:29 +02:00
|
|
|
|
2009-03-31 Joseph Myers <joseph@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/15638
|
|
|
|
|
* files.c (_cpp_find_file): Call open_file_failed after diagnosing
|
|
|
|
|
invalid PCH.
|
|
|
|
|
(open_file_failed): Make error for missing file fatal.
|
|
|
|
|
* include/cpplib.h (CPP_DL_FATAL): Define.
|
|
|
|
|
|
2009-03-30 22:54:18 +02:00
|
|
|
|
2009-03-30 Sergiy Vyshnevetskiy <serg@vostok.net>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/31932:
|
|
|
|
|
* internal.h: Don't mention HAVE_ICONV_H.
|
|
|
|
|
* configure, config.in: Rebuild.
|
|
|
|
|
* configure.ac: Don't check for iconv.h.
|
|
|
|
|
|
2009-03-30 17:25:42 +02:00
|
|
|
|
2009-03-30 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/39512:
|
|
|
|
|
* line-map.c (linemap_init): Initialize 'reallocator' field.
|
|
|
|
|
|
2009-03-30 17:00:52 +02:00
|
|
|
|
2009-03-30 Jakub Jelinek <jakub@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR target/39558
|
|
|
|
|
* macro.c (cpp_get_token): If macro_to_expand returns NULL
|
|
|
|
|
and used some tokens, add CPP_PADDING before next token.
|
|
|
|
|
|
re PR preprocessor/34695 (Preprocessor warning->error conversion from -Werror is silent)
PR preprocessor/34695
gcc:
* Makefile.in (c-opts.o): Depend on c-tree.h.
* c-common.c: Move down include of diagnostic.h.
(done_lexing, c_cpp_error): New.
* c-common.h (done_lexing): Declare.
* c-decl.c (c_write_global_declarations): Don't check cpp_errors
(parse_in).
* c-opts.c: Include c-tree.h.
(c_common_init_options): Set preprocessor error callback.
(c_common_handle_option): Do not set preprocessor
inhibit_warnings, warnings_are_errors, warn_system_headers,
pedantic_errors or inhibit_warnings flags.
(c_common_post_options): Do not check cpp_errors (parse_in).
(c_common_finish): Do not output dependencies if there were
errors. Do not check return value of cpp_finish.
* c-ppoutput.c (pp_file_change): Set input_location.
* c-tree.h (c_cpp_error): Declare.
* diagnostic.c (diagnostic_set_info_translated): Also initialize
override_column.
(diagnostic_build_prefix): Check override_column.
* diagnostic.h (diagnostic_info): Add override_column field.
(diagnostic_override_column): Define.
gcc/cp:
* cp-tree.h (cp_cpp_error): Remove.
* error.c (cp_cpp_error): Remove.
* parser.c (cp_lexer_new_main): Set done_lexing instead of
client_diagnostic and error callback.
gcc/fortran:
* cpp.c (cb_cpp_error): New.
(gfc_cpp_post_options): Don't set cpp_option->inhibit_warnings.
Don't check cpp_errors (cpp_in).
(gfc_cpp_init_0): Set cb->error.
gcc/testsuite:
* gcc.dg/builtin-redefine.c, gcc.dg/cpp/redef2.c,
gcc.dg/cpp/redef3.c, gcc.dg/cpp/trad/redef2.c: Use dg-message
instead of dg-warning for "previous definition" messages.
* gcc.dg/cpp/Wvariadic-1.c, gcc.dg/cpp/Wvariadic-3.c: Expect
"warnings being treated as errors" message.
* gcc.dg/fltconst-1.c: Use -fshow-column.
libcpp:
* makedepend.c: Remove.
* Makefile.in (makedepend_OBJS, makedepend$(EXEEXT)): Remove.
(all, clean, TAGS_SOURCES, include): Remove makedepend handling.
* directives.c (cpp_errors): Remove.
* errors.c (print_location, _cpp_begin_message, v_message):
Remove.
(cpp_error, cpp_error_with_line): Always use error callback.
(cpp_error, cpp_error_with_line, cpp_errno): Return bool.
* include/cpplib.h (cpp_options): Remove pedantic_errors,
inhibit_warnings, warn_system_headers, inhibit_errors,
warnings_are_errors, client_diagnostic.
(cpp_callbacks): Add extra arguments to error callback; make it
return bool.
(cpp_finish): Return void.
(cpp_destroy): Remove inaccurate comment about return value.
(cpp_errors, CPP_DL_EXTRACT, CPP_DL_WARNING_P): Remove.
(CPP_DL_NOTE): Define.
* include/line-map.h (linemap_print_containing_files): Remove.
* init.c (cpp_finish): Do not check for or return number of
errors.
* internal.h (cpp_reader): Remove errors field.
* line-map.c (linemap_print_containing_files): Remove.
* macro.c (_cpp_create_definition): Use CPP_DL_NOTE for message
about previous definition. Only emit it if previous diagnostic
was emitted.
From-SVN: r145263
2009-03-30 00:56:07 +02:00
|
|
|
|
2009-03-29 Joseph Myers <joseph@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/34695
|
|
|
|
|
* makedepend.c: Remove.
|
|
|
|
|
* Makefile.in (makedepend_OBJS, makedepend$(EXEEXT)): Remove.
|
|
|
|
|
(all, clean, TAGS_SOURCES, include): Remove makedepend handling.
|
|
|
|
|
* directives.c (cpp_errors): Remove.
|
|
|
|
|
* errors.c (print_location, _cpp_begin_message, v_message):
|
|
|
|
|
Remove.
|
|
|
|
|
(cpp_error, cpp_error_with_line): Always use error callback.
|
|
|
|
|
(cpp_error, cpp_error_with_line, cpp_errno): Return bool.
|
|
|
|
|
* include/cpplib.h (cpp_options): Remove pedantic_errors,
|
|
|
|
|
inhibit_warnings, warn_system_headers, inhibit_errors,
|
|
|
|
|
warnings_are_errors, client_diagnostic.
|
|
|
|
|
(cpp_callbacks): Add extra arguments to error callback; make it
|
|
|
|
|
return bool.
|
|
|
|
|
(cpp_finish): Return void.
|
|
|
|
|
(cpp_destroy): Remove inaccurate comment about return value.
|
|
|
|
|
(cpp_errors, CPP_DL_EXTRACT, CPP_DL_WARNING_P): Remove.
|
|
|
|
|
(CPP_DL_NOTE): Define.
|
|
|
|
|
* include/line-map.h (linemap_print_containing_files): Remove.
|
|
|
|
|
* init.c (cpp_finish): Do not check for or return number of
|
|
|
|
|
errors.
|
|
|
|
|
* internal.h (cpp_reader): Remove errors field.
|
|
|
|
|
* line-map.c (linemap_print_containing_files): Remove.
|
|
|
|
|
* macro.c (_cpp_create_definition): Use CPP_DL_NOTE for message
|
|
|
|
|
about previous definition. Only emit it if previous diagnostic
|
|
|
|
|
was emitted.
|
|
|
|
|
|
2009-03-28 07:57:44 +01:00
|
|
|
|
2009-03-28 Joseph Myers <joseph@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* Makefile.in (po/$(PACKAGE).pot): Use $(mkinstalldirs) not
|
|
|
|
|
mkinstalldirs.
|
|
|
|
|
|
2009-03-18 18:04:26 +01:00
|
|
|
|
2009-03-18 Jakub Jelinek <jakub@redhat.com>
|
|
|
|
|
|
|
|
|
|
* include/cpplib.h (struct cpp_dir): Reorder fields for 64-bit hosts.
|
|
|
|
|
|
2009-02-21 22:25:39 +01:00
|
|
|
|
2009-02-21 Joseph Myers <joseph@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* lex.c (lex_string): Return a CPP_LESS token for missing '>' in a
|
|
|
|
|
header name.
|
|
|
|
|
(_cpp_lex_direct): Handle this.
|
|
|
|
|
|
2009-02-15 12:11:13 +01:00
|
|
|
|
2009-02-15 Richard Guenther <rguenther@suse.de>
|
|
|
|
|
|
|
|
|
|
Revert last change.
|
|
|
|
|
|
2009-02-13 11:52:08 +01:00
|
|
|
|
2009-02-13 Richard Guenther <rguenther@suse.de>
|
|
|
|
|
|
|
|
|
|
* configure.ac: Enable LFS.
|
|
|
|
|
* configure: Re-generate.
|
|
|
|
|
* config.in: Likewise.
|
|
|
|
|
|
2009-01-05 11:35:40 +01:00
|
|
|
|
2009-01-05 Ben Elliston <bje@au.ibm.com>
|
|
|
|
|
|
|
|
|
|
* Makefile.in (.po.gmo): Use mkinstalldirs, not test -d || mkdir.
|
|
|
|
|
(.po.pox): Likewise.
|
|
|
|
|
(po/$(PACKAGE).pot): Likewise.
|
|
|
|
|
|
2008-12-10 18:31:07 +01:00
|
|
|
|
2008-12-10 Alexandre Oliva <aoliva@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR target/37033
|
|
|
|
|
* pch.c (cpp_valid_state): Improve message for poisoned symbols.
|
|
|
|
|
Allow for differences in __GCC_HAVE_DWARF2_CFI_ASM.
|
|
|
|
|
|
2008-11-29 13:21:10 +01:00
|
|
|
|
2008-11-29 Joseph Myers <joseph@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* lex.c (cpp_token_len): Use 6 as default length.
|
|
|
|
|
|
2008-10-31 23:00:37 +01:00
|
|
|
|
2008-10-31 Manuel López-Ibáñez <manu@gcc.gnu.org>
|
|
|
|
|
|
|
|
|
|
* expr.c (struct op): Add location.
|
|
|
|
|
(_cpp_parse_expr): Propagate locations throught the stack
|
|
|
|
|
of expressions.
|
|
|
|
|
(reduce): Likewise.
|
|
|
|
|
(check_promotion): Use explicit location in errors.
|
|
|
|
|
|
2008-10-05 14:35:36 +02:00
|
|
|
|
2008-10-05 Matthew Gingell <gingell@adacore.com>
|
|
|
|
|
Arnaud Charlet <charlet@adacore.com>
|
|
|
|
|
|
|
|
|
|
* include/cpplib.h (cpp_comments, cpp_comment_table): New structs.
|
|
|
|
|
(cpp_get_comments): New function.
|
|
|
|
|
* internal.h (struct cpp_reader): Add comments field.
|
|
|
|
|
* init.c (cpp_destroy): Free comments.
|
|
|
|
|
* lex.c (store_comment, cpp_get_comments): New functions.
|
|
|
|
|
(comments): New struct.
|
|
|
|
|
(save_comment): Store comments in comments struct.
|
|
|
|
|
|
2008-09-18 17:39:08 +02:00
|
|
|
|
2008-09-18 Simon Baldwin <simonb@google.com>
|
|
|
|
|
|
|
|
|
|
* include/cpplib.h (struct cpp_options): Add new boolean flag
|
|
|
|
|
warn_builtin_macro_redefined.
|
|
|
|
|
* init.c (cpp_create_reader): Initialize warn_builtin_macro_redefined.
|
|
|
|
|
* (struct builtin_operator): Split out from previous struct builtin,
|
|
|
|
|
enhance extra const correctness.
|
|
|
|
|
* (struct builtin_macro): Split out from previous struct builtin, add
|
|
|
|
|
new always_warn_if_redefined flag, enhance const correctness.
|
|
|
|
|
* (mark_named_operators): Use struct builtin_operator.
|
|
|
|
|
* (cpp_init_special_builtins): Use struct builtin_macro, add NODE_WARN
|
|
|
|
|
to builtins selectively.
|
|
|
|
|
* macro.c (warn_of_redefinition): Return false if a builtin macro
|
|
|
|
|
is not flagged with NODE_WARN.
|
|
|
|
|
|
2008-07-31 21:12:14 +02:00
|
|
|
|
2008-07-31 Jakub Jelinek <jakub@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/36649
|
|
|
|
|
* files.c (struct report_missing_guard_data): New type.
|
|
|
|
|
(report_missing_guard): Put paths into an array instead of printing
|
|
|
|
|
them right away. Return 1 rather than 0.
|
|
|
|
|
(report_missing_guard_cmp): New function.
|
|
|
|
|
(_cpp_report_missing_guards): Sort and print paths gathered by
|
|
|
|
|
report_missing_guard callback.
|
|
|
|
|
|
2008-07-22 11:45:58 +02:00
|
|
|
|
2008-07-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
|
|
|
|
|
|
|
|
|
|
PR 28079
|
|
|
|
|
* directives.c (strtolinenum): Handle overflow.
|
|
|
|
|
(do_line): Give a warning if line number overflowed.
|
|
|
|
|
(do_linemarker): Update call to strtolinenum.
|
|
|
|
|
|
2008-07-21 11:33:38 +02:00
|
|
|
|
2008-07-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
|
|
|
|
|
|
|
|
|
|
* include/line-map.h (linenum_type): New typedef.
|
|
|
|
|
(struct line_map): Use it.
|
|
|
|
|
(SOURCE_LINE): Second arguments is a LOCATION not a LINE.
|
|
|
|
|
(SOURCE_COLUMN): Likewise.
|
|
|
|
|
* macro.c (_cpp_builtin_macro_text): Use linenum_type. Don't store
|
|
|
|
|
source_location values in a variable of type linenum_type.
|
|
|
|
|
* directives.c (struct if_stack): Use linenum_type.
|
|
|
|
|
(strtoul_for_line): Rename as strtolinenum.
|
|
|
|
|
(do_line): Use linenum_type.
|
|
|
|
|
(do_linemarker): Use linenum_type and strtolinenum.
|
|
|
|
|
(_cpp_do_file_change): Use linenum_t.
|
|
|
|
|
* line-map.c (linemap_add): Likewise.
|
|
|
|
|
(linemap_line_start): Likewise.
|
|
|
|
|
* traditional.c (struct fun_macro): 'line' is a source_location.
|
|
|
|
|
* errors.c (print_location): Use linenum_type.
|
|
|
|
|
* directives-only.c (_cpp_preprocess_dir_only): Likewise.
|
|
|
|
|
* internal.h (CPP_INCREMENT_LINE): Likewise.
|
|
|
|
|
* lex.c (_cpp_skip_block_comment): Use source_location.
|
2014-10-22 03:41:31 +02:00
|
|
|
|
|
2008-07-14 07:09:48 +02:00
|
|
|
|
2008-07-14 Ben Elliston <bje@au.ibm.com>
|
|
|
|
|
|
|
|
|
|
* include/cpplib.h (NODE_CONDITIONAL): New.
|
|
|
|
|
(struct cpp_callbacks): New macro_to_expand field.
|
|
|
|
|
(struct cpp_hashnode): Adjust size of flags and type fields.
|
|
|
|
|
(cpp_peek_token): Prototype.
|
|
|
|
|
* lex.c (cpp_peek_token): New function.
|
|
|
|
|
(_cpp_temp_token): Protect pre-existing lookaheads.
|
|
|
|
|
* macro.c (cpp_get_token): Expand any conditional macros.
|
|
|
|
|
(_cpp_backup_tokens_direct): New.
|
|
|
|
|
(_cpp_backup_tokens): Call _cpp_backup_tokens_direct.
|
|
|
|
|
(warn_of_redefinition): Silently allow redefined conditional
|
|
|
|
|
macros.
|
|
|
|
|
(_cpp_create_definition): Remove the conditional flag when a user
|
|
|
|
|
defines one of the conditional macros.
|
|
|
|
|
* internal.h (_cpp_backup_tokens_direct): New prototype.
|
|
|
|
|
|
2008-07-03 12:31:50 +02:00
|
|
|
|
2008-06-13 Andrew Haley <aph@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/33305
|
|
|
|
|
* macro.c (replace_args): Print a warning for empty macro
|
|
|
|
|
arguments in C89 and C++.
|
|
|
|
|
|
2008-06-18 01:13:35 +02:00
|
|
|
|
2008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
|
|
|
|
|
|
|
|
|
|
* Makefile.in ($(srcdir)/aclocal.m4): Update dependencies.
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
|
2008-06-16 19:58:14 +02:00
|
|
|
|
2008-06-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
|
|
|
|
|
|
|
|
|
|
* Makefile.in (datarootdir): New variable.
|
|
|
|
|
|
2008-06-12 19:03:41 +02:00
|
|
|
|
2008-06-12 H.J. Lu <hongjiu.lu@intel.com>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/36479
|
|
|
|
|
* charset.c (cpp_interpret_string_notranslate): Also set
|
|
|
|
|
narrow_cset_desc.width.
|
|
|
|
|
|
MAINTAINERS (mt port): Remove.
* MAINTAINERS (mt port): Remove.
(sco5, unixware, sco udk): Remove.
(Kean Johnston): Add to Write After Approval.
fixincludes:
* inclhack.def (AAB_svr4_replace_byteorder,
AAB_ultrix_ansi_compat, AAB_ultrix_limits, AAB_ultrix_memory,
libc1_G_va_list, libc1_ifdefd_memx, nested_motorola,
ptx_sys_mc_param_h, sco_regset, sco_static_func, sco_utime,
solaris_mutex_init_1, solaris_socket, solaris_unistd,
solaris_widec, svr4_krnl, ultrix_atexit_param, ultrix_atof_param,
ultrix_const3, ultrix_fix_fixproto, ultrix_ifdef, ultrix_locale,
ultrix_math_ifdef, ultrix_nested_ioctl, ultrix_nested_svc,
ultrix_stat, ultrix_static, ultrix_stdlib, ultrix_strings,
ultrix_strings2, ultrix_sys_time, ultrix_unistd,
unicosmk_restrict, uw7_byteorder_fix, windiss_math1,
windiss_math2, windiss_valist): Remove.
* fixincl.x: Regenerate.
* mkfixinc.sh: (arm-semi-aof, hppa1.1-*-osf*, hppa1.1-*-bsd*,
i370-*-openedition, i?86-*-moss*, i?86-*-uwin*,
powerpc-*-eabiaix*): Remove.
* tests/base/math.h: Update.
* tests/base/pthread.h: Update.
* tests/base/stdio.h: Update.
* tests/base/stdlib.h: Update.
* tests/base/string.h: Update.
* tests/base/strings.h: Update.
* tests/base/sys/file.h: Update.
* tests/base/sys/limits.h: Update.
* tests/base/sys/socket.h: Update.
* tests/base/sys/stat.h: Update.
* tests/base/sys/time.h: Update.
* tests/base/testing.h: Update.
* tests/base/unistd.h: Update.
* tests/base/_G_config.h: Remove.
* tests/base/arpa: Remove directory.
* tests/base/fs: Remove directory.
* tests/base/locale.h: Remove.
* tests/base/machine: Remove directory.
* tests/base/rpc/svc.h: Remove.
* tests/base/sys/ioctl.h: Remove.
* tests/base/sys/regset.h: Remove.
* tests/base/sys/times.h: Remove.
* tests/base/sys/utsname.h: Remove.
* tests/base/widec.h: Remove.
gcc:
* config.gcc (Obsolete configurations): Remove list of
configurations.
(Unsupported targets list): Add *-*-linux*aout*, *-*-linux*libc1*,
*-*-solaris2.[0-6], *-*-solaris2.[0-6].*, *-*-sysv*. Remove other
targets matched by those patterns.
(strongarm*-*-*, ep9312*-*-*, xscale-*-*, parisc*-*-*,
m680[012]0-*-*, *-*-linux*libc1*, *-*-linux*aout*,
alpha*-*-unicosmk*, strongarm*-*-freebsd*, ep9312-*-elf,
arm*-*-kaos*, cris-*-aout, parisc*64*-*-linux*, parisc*-*-linux*,
hppa1.1-*-pro*, hppa1.1-*-osf*, hppa1.1-*-bsd*,
i[34567]86-sequent-ptx4*, i[34567]86-sequent-sysv4*,
i[34567]86-*-beoself*, i[34567]86-*-beos*, i[34567]86-*-sco3.2v5*,
i[34567]86-*-sysv5*, i[34567]86-*-sysv4*, i[34567]86-*-uwin*,
i[34567]86-*-kaos*, m68020-*-elf*, m68010-*-netbsdelf*,
mips-wrs-windiss, mt-*-elf, powerpc-*-beos*, powerpc-*-chorusos*,
powerpc-wrs-windiss*, powerpcle-*-sysv*, powerpc-*-kaos*,
powerpcle-*-kaos*, sh*-*-kaos*, sparc-*-sysv4*, strongarm-*-elf*,
strongarm-*-pe, strongarm-*-kaos*, vax-*-bsd*, vax-*-sysv*,
vax-*-ultrix*, xscale-*-elf, xscale-*-coff,
i[34567]86-*-linux*aout*, i[34567]86-*-linux*libc1): Remove.
Make code for Solaris 7 and greater unconditional for Solaris.
(ep9312-*-*, parisc1*, m680[012]0-*-*, parisc*-*-*, mt-*-*):
Remove --with-* handling.
* config/rs6000/sysv4.h (-mwindiss): Remove from all specs.
(LIB_WINDISS_SPEC, CPP_OS_WINDISS_SPEC, STARTFILE_WINDISS_SPEC,
ENDFILE_WINDISS_SPEC, LINK_START_WINDISS_SPEC,
LINK_OS_WINDISS_SPEC): Remove.
* config/rs6000/sysv4.opt (mwindiss): Remove.
* configure.ac (strongarm*-*-*, xscale*-*-*): Remove.
* configure: Regenerate.
* doc/cpp.texi: Don't mention BeOS.
* doc/extend.texi (interrupt): Don't mention MS1.
* doc/install.texi: (i386-@var{any}-sysv, m68k-bull-sysv,
m68k-hp-hpux, m68000-hp-hpux, m68000-att-sysv,
alphaev5-cray-unicosmk*, xscale-*-*, i?86-*-linux*aout,
i?86-*-sco3.2v5*, i?86-*-udk, m68k-hp-hpux, powerpc-*-sysv4,
powerpc-*-sysv4, powerpcle-*-sysv4, *-*-sysv*, vax-dec-ultrix):
Remove.
* doc/invoke.texi (MT Options): Remove.
(-mwindiss): Remove.
(CRIS Options): Remove cris-axis-aout references.
(HPPA Options): Don't mention hppa1.1-*-pro.
* doc/md.texi: (MorphoTech family): Remove.
* libgcc2.c: Don't handle UWIN.
* config/alpha/t-unicosmk: Remove.
* config/alpha/unicosmk.h: Remove.
* config/arm/kaos-arm.h: Remove.
* config/arm/kaos-strongarm.h: Remove.
* config/arm/strongarm-coff.h: Remove.
* config/arm/strongarm-elf.h: Remove.
* config/arm/strongarm-pe.h: Remove.
* config/arm/t-strongarm-pe: Remove.
* config/arm/t-xscale-coff: Remove.
* config/arm/t-xscale-elf: Remove.
* config/arm/xscale-coff.h: Remove.
* config/arm/xscale-elf.h: Remove.
* config/chorus.h: Remove.
* config/cris/aout.h: Remove.
* config/cris/aout.opt: Remove.
* config/cris/t-aout: Remove.
* config/i386/beos-elf.h: Remove.
* config/i386/kaos-i386.h: Remove.
* config/i386/ptx4-i.h: Remove.
* config/i386/sco5.h: Remove.
* config/i386/sco5.opt: Remove.
* config/i386/sysv4-cpp.h: Remove.
* config/i386/sysv5.h: Remove.
* config/i386/t-beos: Remove.
* config/i386/t-sco5: Remove.
* config/i386/t-uwin: Remove.
* config/i386/uwin.asm: Remove.
* config/i386/uwin.h: Remove.
* config/kaos.h: Remove.
* config/mips/windiss.h: Remove.
* config/mt: Remove directory.
* config/pa/pa-osf.h: Remove.
* config/pa/pa-pro-end.h: Remove.
* config/pa/t-pro: Remove.
* config/ptx4.h: Remove.
* config/rs6000/beos.h: Remove.
* config/rs6000/kaos-ppc.h: Remove.
* config/rs6000/t-beos: Remove.
* config/rs6000/windiss.h: Remove.
* config/sh/kaos-sh.h: Remove.
* config/sol2-6.h: Remove.
* config/sparc/sol26-sld.h: Remove.
* config/sparc/sysv4-only.h: Remove.
* config/vax/bsd.h: Remove.
* config/vax/t-memfuncs: Remove.
* config/vax/ultrix.h: Remove.
* config/vax/vaxv.h: Remove.
* config/windiss.h: Remove.
gcc/testsuite:
* g++.dg/abi/arm_cxa_vec1.C: Don't handle xscale*-*-*.
* g++.dg/eh/spbp.C: Don't handle *-*-solaris2.[56]*.
* g++.dg/warn/miss-format-1.C: Don't handle Solaris before Solaris
7.
* gcc.c-torture/compile/981006-1.c: Don't handle xscale*-*-*,
strongarm*-*-* and cris-*-aout*.
* gcc.c-torture/execute/941014-1.x: Don't handle xscale*-*-* and
strongarm*-*-*.
* gcc.dg/20030909-1.c: Don't handle xscale*-*-* and
strongarm*-*-*.
* gcc.dg/20031108-1.c: Don't handle xscale*-*-* and
strongarm*-*-*.
* gcc.dg/20040813-1.c: Don't handle *-*-sysv5*.
* gcc.dg/arm-asm.c: Don't handle strongarm*-*-* and xscale*-*-*.
* gcc.dg/arm-scd42-1.c: Use target arm*-*-*.
* gcc.dg/arm-scd42-3.c: Use target arm*-*-*.
* gcc.dg/cpp/assert4.c: Don't handle BeOS.
* gcc.dg/debug/pr35154.c: Don't handle *-*-sysv5*.
* gcc.dg/intmax_t-1.c: Don't handle *-*-solaris2.5.1 and
xscale*-*-elf*.
* gcc.dg/pragma-align.c: Don't handle i?86-*-sco3.2v5*.
* gcc.dg/pthread-init-2.c: Don't handle *-*-solaris2.5.1.
* gcc.misc-tests/arm-isr.exp: Use target arm*-*-*.
* gcc.target/powerpc/ppc-sdata-1.c: Don't handle powerpc-*-sysv*.
* gcc.target/powerpc/ppc-sdata-2.c: Don't handle powerpc-*-sysv*.
* gcc.target/powerpc/ppc-stackalign-1.c: Don't handle
powerpc-*-sysv*.
* gfortran.dg/debug/pr35154-stabs.f: Don't handle *-*-sysv5*.
* lib/target-supports.exp: Don't handle strongarm*-*-elf,
xscale*-*-elf and *-*-windiss.
* obj-c++.dg/dwarf-2.mm: Don't handle *-*-solaris2.[56]*.
* objc.dg/dwarf-1.m: Don't handle *-*-solaris2.[56]*.
* objc.dg/dwarf-2.m: Don't handle *-*-solaris2.[56]*.
* gcc.dg/mt-loopi1.c: Remove.
gnattools:
* configure.ac (xscale*-wrs-vx*, xscale*-wrs-coff): Remove.
* configure: Regenerate.
libcpp:
* configure.ac (parisc*64*-*-*): Remove.
* configure: Regenerate.
libffi:
* configure.ac (parisc*-*-linux*, powerpc-*-sysv*,
powerpc-*-beos*): Remove.
* configure: Regenerate.
libgcc:
* config.host (strongarm*-*-*, ep9312*-*-*, xscale-*-*,
parisc*-*-*, m680[012]0-*-*, *-*-linux*libc1*, *-*-linux*aout*,
alpha*-*-unicosmk*, strongarm*-*-freebsd*, ep9312-*-elf,
arm*-*-kaos*, cris-*-aout, parisc*64*-*-linux*, parisc*-*-linux*,
hppa1.1-*-pro*, hppa1.1-*-osf*, hppa1.1-*-bsd*,
i[34567]86-sequent-ptx4*, i[34567]86-sequent-sysv4*,
i[34567]86-*-beoself*, i[34567]86-*-beos*, i[34567]86-*-sco3.2v5*,
i[34567]86-*-sysv5*, i[34567]86-*-sysv4*, i[34567]86-*-uwin*,
i[34567]86-*-kaos*, m68020-*-elf*, m68010-*-netbsdelf*,
mips-wrs-windiss, mt-*-elf, powerpc-*-beos*, powerpc-*-chorusos*,
powerpc-wrs-windiss*, powerpcle-*-sysv*, powerpc-*-kaos*,
powerpcle-*-kaos*, sh*-*-kaos*, sparc-*-sysv4*, strongarm-*-elf*,
strongarm-*-pe, strongarm-*-kaos*, vax-*-bsd*, vax-*-sysv*,
vax-*-ultrix*, xscale-*-elf, xscale-*-coff): Remove.
libjava:
* configure.host (strongarm*-elf, xscale*-elf): Remove.
libstdc++-v3:
* configure.host (xscale, ep9312, m680[246]0, solaris2.5,
solaris2.5.[0-9], solaris2.6, windiss*): Remove.
* crossconfig.m4 (*-solaris2.5, *-solaris2.6, *-windiss*): Remove.
* configure: Regenerate.
* config/os/solaris/solaris2.5: Remove directory.
* config/os/solaris/solaris2.6: Remove directory.
* config/os/windiss: Remove directory.
From-SVN: r136534
2008-06-07 20:00:15 +02:00
|
|
|
|
2008-06-07 Joseph Myers <joseph@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* configure.ac (parisc*64*-*-*): Remove.
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
|
2008-05-30 16:25:09 +02:00
|
|
|
|
2008-05-30 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/36320:
|
|
|
|
|
* internal.h (_cpp_parse_expr): Update.
|
|
|
|
|
* expr.c (_cpp_parse_expr): Add 'is_if' argument. Update error
|
|
|
|
|
messages.
|
|
|
|
|
* directives.c (do_if): Update.
|
|
|
|
|
(do_elif): Require expression if processing group.
|
|
|
|
|
|
2008-05-30 02:57:56 +02:00
|
|
|
|
2008-05-30 Danny Smith <dannysmith@users.sourceforge.net>
|
|
|
|
|
|
|
|
|
|
* include/cpplib.h (struct cpp_dir): Add new field, canonical_name.
|
|
|
|
|
|
2008-05-21 23:52:57 +02:00
|
|
|
|
2008-05-21 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/27777:
|
|
|
|
|
* lex.c (cpp_output_line_to_string): New function.
|
|
|
|
|
* internal.h (_cpp_begin_message): Don't declare.
|
|
|
|
|
* errors.c (_cpp_begin_message): Now static.
|
|
|
|
|
* include/cpplib.h (cpp_output_line_to_string): Declare.
|
|
|
|
|
* directives.c (do_diagnostic): Rewrote. Use
|
|
|
|
|
cpp_output_line_to_string. Don't use _cpp_begin_message.
|
|
|
|
|
|
2008-05-21 17:00:59 +02:00
|
|
|
|
2008-05-21 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
|
|
|
|
* include/symtab.h (HT_ALLOCED): Remove.
|
|
|
|
|
(ht_purge): Declare.
|
|
|
|
|
* symtab.c (DELETED): New define.
|
|
|
|
|
(ht_lookup): Update comment.
|
|
|
|
|
(ht_lookup_with_hash): Handle deleted entries. Remove HT_ALLOCED
|
|
|
|
|
code. Use subobject allocator for strings, if it exists.
|
|
|
|
|
(ht_expand): Handle deleted entries.
|
|
|
|
|
(ht_forall): Likewise.
|
|
|
|
|
(ht_purge): New function.
|
|
|
|
|
(ht_dump_statistics): Print deletion statistics.
|
|
|
|
|
|
2008-05-13 16:50:27 +02:00
|
|
|
|
2008-05-13 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/22168:
|
|
|
|
|
* include/cpplib.h (struct cpp_options) <objc>: Update
|
|
|
|
|
documentation.
|
|
|
|
|
* expr.c (eval_token): Warn for use of assertions.
|
|
|
|
|
* directives.c (directive_diagnostics): Warn about extensions.
|
|
|
|
|
(DEPRECATED): New define.
|
|
|
|
|
(DIRECTIVE_TABLE): Use it.
|
|
|
|
|
|
2008-05-06 19:15:07 +02:00
|
|
|
|
2008-05-06 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/35313, PR preprocessor/36088:
|
|
|
|
|
* expr.c (optab) <QUERY, COMMA>: Set precedence to 4.
|
|
|
|
|
(reduce) <case CPP_QUERY>: Special case CPP_COMMA and CPP_COLON.
|
|
|
|
|
|
2008-05-04 13:25:30 +02:00
|
|
|
|
2008-05-04 David S. Miller <davem@davemloft.net>
|
|
|
|
|
|
|
|
|
|
* configure.ac (sparc*-*-*): Always set need_64bit_hwint to yes.
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
|
2008-04-22 20:04:32 +02:00
|
|
|
|
2008-04-22 Daniel Franke <franke.daniel@gmail.com>
|
|
|
|
|
|
|
|
|
|
* include/cpplib.h (cpp_define_formatted): New.
|
|
|
|
|
* directives.c (cpp_define_formatted): New.
|
|
|
|
|
|
2008-04-21 16:02:00 +02:00
|
|
|
|
2008-04-21 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR libcpp/33415:
|
|
|
|
|
* charset.c (_cpp_convert_input): Add buffer_start argument.
|
|
|
|
|
Ignore UTF-8 BOM if seen.
|
|
|
|
|
* internal.h (_cpp_convert_input): Add argument.
|
|
|
|
|
* files.c (struct _cpp_file) <buffer_start>: New field.
|
|
|
|
|
(destroy_cpp_file): Free buffer_start, not buffer.
|
|
|
|
|
(_cpp_pop_file_buffer): Likewise.
|
|
|
|
|
(read_file_guts): Update.
|
|
|
|
|
|
cpp-id-data.h (UC): Was U, conflicts with U...
libcpp/ChangeLog:
2008-04-14 Kris Van Hees <kris.van.hees@oracle.com>
* include/cpp-id-data.h (UC): Was U, conflicts with U... literal.
* include/cpplib.h (CHAR16, CHAR32, STRING16, STRING32): New tokens.
(struct cpp_options): Added uliterals.
(cpp_interpret_string): Update prototype.
(cpp_interpret_string_notranslate): Idem.
* charset.c (init_iconv_desc): New width member in cset_converter.
(cpp_init_iconv): Add support for char{16,32}_cset_desc.
(convert_ucn): Idem.
(emit_numeric_escape): Idem.
(convert_hex): Idem.
(convert_oct): Idem.
(convert_escape): Idem.
(converter_for_type): New function.
(cpp_interpret_string): Use converter_for_type, support u and U prefix.
(cpp_interpret_string_notranslate): Match changed prototype.
(wide_str_to_charconst): Use converter_for_type.
(cpp_interpret_charconst): Add support for CPP_CHAR{16,32}.
* directives.c (linemarker_dir): Macro U changed to UC.
(parse_include): Idem.
(register_pragma_1): Idem.
(restore_registered_pragmas): Idem.
(get__Pragma_string): Support CPP_STRING{16,32}.
* expr.c (eval_token): Support CPP_CHAR{16,32}.
* init.c (struct lang_flags): Added uliterals.
(lang_defaults): Idem.
* internal.h (struct cset_converter) <width>: New field.
(struct cpp_reader) <char16_cset_desc>: Idem.
(struct cpp_reader) <char32_cset_desc>: Idem.
* lex.c (digraph_spellings): Macro U changed to UC.
(OP, TK): Idem.
(lex_string): Add support for u'...', U'...', u... and U....
(_cpp_lex_direct): Idem.
* macro.c (_cpp_builtin_macro_text): Macro U changed to UC.
(stringify_arg): Support CPP_CHAR{16,32} and CPP_STRING{16,32}.
gcc/ChangeLog:
2008-04-14 Kris Van Hees <kris.van.hees@oracle.com>
* c-common.c (CHAR16_TYPE, CHAR32_TYPE): New macros.
(fname_as_string): Match updated cpp_interpret_string prototype.
(fix_string_type): Support char16_t* and char32_t*.
(c_common_nodes_and_builtins): Add char16_t and char32_t (and
derivative) nodes. Register as builtin if C++0x.
(c_parse_error): Support CPP_CHAR{16,32}.
* c-common.h (RID_CHAR16, RID_CHAR32): New elements.
(enum c_tree_index) <CTI_CHAR16_TYPE, CTI_SIGNED_CHAR16_TYPE,
CTI_UNSIGNED_CHAR16_TYPE, CTI_CHAR32_TYPE, CTI_SIGNED_CHAR32_TYPE,
CTI_UNSIGNED_CHAR32_TYPE, CTI_CHAR16_ARRAY_TYPE,
CTI_CHAR32_ARRAY_TYPE>: New elements.
(char16_type_node, signed_char16_type_node, unsigned_char16_type_node,
char32_type_node, signed_char32_type_node, char16_array_type_node,
char32_array_type_node): New defines.
* c-lex.c (cb_ident): Match updated cpp_interpret_string prototype.
(c_lex_with_flags): Support CPP_CHAR{16,32} and CPP_STRING{16,32}.
(lex_string): Support CPP_STRING{16,32}, match updated
cpp_interpret_string and cpp_interpret_string_notranslate prototypes.
(lex_charconst): Support CPP_CHAR{16,32}.
* c-parser.c (c_parser_postfix_expression): Support CPP_CHAR{16,32}
and CPP_STRING{16,32}.
gcc/cp/ChangeLog:
2008-04-14 Kris Van Hees <kris.van.hees@oracle.com>
* cvt.c (type_promotes_to): Support char16_t and char32_t.
* decl.c (grokdeclarator): Disallow signed/unsigned/short/long on
char16_t and char32_t.
* lex.c (reswords): Add char16_t and char32_t (for c++0x).
* mangle.c (write_builtin_type): Mangle char16_t/char32_t as vendor
extended builtin type u8char32_t.
* parser.c (cp_lexer_next_token_is_decl_specifier_keyword): Support
RID_CHAR{16,32}.
(cp_lexer_print_token): Support CPP_STRING{16,32}.
(cp_parser_is_string_literal): Idem.
(cp_parser_string_literal): Idem.
(cp_parser_primary_expression): Support CPP_CHAR{16,32} and
CPP_STRING{16,32}.
(cp_parser_simple_type_specifier): Support RID_CHAR{16,32}.
* tree.c (char_type_p): Support char16_t and char32_t as char types.
* typeck.c (string_conv_p): Support char16_t and char32_t.
gcc/testsuite/ChangeLog:
2008-04-14 Kris Van Hees <kris.van.hees@oracle.com>
Tests for char16_t and char32_t support.
* g++.dg/ext/utf-cvt.C: New
* g++.dg/ext/utf-cxx0x.C: New
* g++.dg/ext/utf-cxx98.C: New
* g++.dg/ext/utf-dflt.C: New
* g++.dg/ext/utf-gnuxx0x.C: New
* g++.dg/ext/utf-gnuxx98.C: New
* g++.dg/ext/utf-mangle.C: New
* g++.dg/ext/utf-typedef-cxx0x.C: New
* g++.dg/ext/utf-typedef-
* g++.dg/ext/utf-typespec.C: New
* g++.dg/ext/utf16-1.C: New
* g++.dg/ext/utf16-2.C: New
* g++.dg/ext/utf16-3.C: New
* g++.dg/ext/utf16-4.C: New
* g++.dg/ext/utf32-1.C: New
* g++.dg/ext/utf32-2.C: New
* g++.dg/ext/utf32-3.C: New
* g++.dg/ext/utf32-4.C: New
* gcc.dg/utf-cvt.c: New
* gcc.dg/utf-dflt.c: New
* gcc.dg/utf16-1.c: New
* gcc.dg/utf16-2.c: New
* gcc.dg/utf16-3.c: New
* gcc.dg/utf16-4.c: New
* gcc.dg/utf32-1.c: New
* gcc.dg/utf32-2.c: New
* gcc.dg/utf32-3.c: New
* gcc.dg/utf32-4.c: New
libiberty/ChangeLog:
2008-04-14 Kris Van Hees <kris.van.hees@oracle.com>
* testsuite/demangle-expected: Added tests for char16_t and char32_t.
From-SVN: r134438
2008-04-18 15:58:08 +02:00
|
|
|
|
2008-04-18 Kris Van Hees <kris.van.hees@oracle.com>
|
|
|
|
|
|
|
|
|
|
* include/cpp-id-data.h (UC): Was U, conflicts with U"..." literal.
|
|
|
|
|
* include/cpplib.h (CHAR16, CHAR32, STRING16, STRING32): New tokens.
|
|
|
|
|
(struct cpp_options): Added uliterals.
|
|
|
|
|
(cpp_interpret_string): Update prototype.
|
|
|
|
|
(cpp_interpret_string_notranslate): Idem.
|
|
|
|
|
* charset.c (init_iconv_desc): New width member in cset_converter.
|
|
|
|
|
(cpp_init_iconv): Add support for char{16,32}_cset_desc.
|
|
|
|
|
(convert_ucn): Idem.
|
|
|
|
|
(emit_numeric_escape): Idem.
|
|
|
|
|
(convert_hex): Idem.
|
|
|
|
|
(convert_oct): Idem.
|
|
|
|
|
(convert_escape): Idem.
|
|
|
|
|
(converter_for_type): New function.
|
|
|
|
|
(cpp_interpret_string): Use converter_for_type, support u and U prefix.
|
|
|
|
|
(cpp_interpret_string_notranslate): Match changed prototype.
|
|
|
|
|
(wide_str_to_charconst): Use converter_for_type.
|
|
|
|
|
(cpp_interpret_charconst): Add support for CPP_CHAR{16,32}.
|
|
|
|
|
* directives.c (linemarker_dir): Macro U changed to UC.
|
|
|
|
|
(parse_include): Idem.
|
|
|
|
|
(register_pragma_1): Idem.
|
|
|
|
|
(restore_registered_pragmas): Idem.
|
|
|
|
|
(get__Pragma_string): Support CPP_STRING{16,32}.
|
|
|
|
|
* expr.c (eval_token): Support CPP_CHAR{16,32}.
|
|
|
|
|
* init.c (struct lang_flags): Added uliterals.
|
|
|
|
|
(lang_defaults): Idem.
|
|
|
|
|
* internal.h (struct cset_converter) <width>: New field.
|
|
|
|
|
(struct cpp_reader) <char16_cset_desc>: Idem.
|
|
|
|
|
(struct cpp_reader) <char32_cset_desc>: Idem.
|
|
|
|
|
* lex.c (digraph_spellings): Macro U changed to UC.
|
|
|
|
|
(OP, TK): Idem.
|
|
|
|
|
(lex_string): Add support for u'...', U'...', u"..." and U"...".
|
|
|
|
|
(_cpp_lex_direct): Idem.
|
|
|
|
|
* macro.c (_cpp_builtin_macro_text): Macro U changed to UC.
|
|
|
|
|
(stringify_arg): Support CPP_CHAR{16,32} and CPP_STRING{16,32}.
|
|
|
|
|
|
2008-04-18 12:28:53 +02:00
|
|
|
|
2008-04-18 Paolo Bonzini <bonzini@gnu.org>
|
|
|
|
|
|
|
|
|
|
PR bootstrap/35457
|
|
|
|
|
* aclocal.m4: Regenerate.
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
|
2008-04-18 02:58:58 +02:00
|
|
|
|
2008-04-17 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR libcpp/34866:
|
|
|
|
|
* errors.c (cpp_error): Don't reference a token before the start
|
|
|
|
|
of the current run.
|
|
|
|
|
|
2008-04-16 23:10:37 +02:00
|
|
|
|
2008-04-16 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
|
|
|
|
* Makefile.in (TAGS_SOURCES): New variable.
|
|
|
|
|
(TAGS): New target.
|
|
|
|
|
|
2008-04-11 06:21:18 +02:00
|
|
|
|
2008-04-11 Kaz Kojima <kkojima@gcc.gnu.org>
|
|
|
|
|
|
|
|
|
|
* configure.ac: (need_64bit_hwint): Need 64bit hwint for sh-*-*
|
|
|
|
|
and shbe-*-*.
|
|
|
|
|
* configure: Rebuilt.
|
|
|
|
|
|
cppopts.texi (-dU): Document.
gcc:
* doc/cppopts.texi (-dU): Document.
* c-common.h (flag_dump_macros): Update comment.
* c-opts.c (handle_OPT_d): Handle -dU.
* c-ppoutput.c (macro_queue, define_queue, undef_queue,
dump_queued_macros, cb_used_define, cb_used_undef): New.
(init_pp_output): Handle -dU.
(cb_line_change): Call dump_queued_macros.
* toplev.c (decode_d_option): Accept -dU as preprocessor option.
gcc/testsuite:
* gcc.dg/cpp/cmdlne-dU-1.c, gcc.dg/cpp/cmdlne-dU-2.c,
gcc.dg/cpp/cmdlne-dU-3.c, gcc.dg/cpp/cmdlne-dU-4.c,
gcc.dg/cpp/cmdlne-dU-5.c, gcc.dg/cpp/cmdlne-dU-6.c,
gcc.dg/cpp/cmdlne-dU-7.c, gcc.dg/cpp/cmdlne-dU-8.c,
gcc.dg/cpp/cmdlne-dU-9.c, gcc.dg/cpp/cmdlne-dU-10.c,
gcc.dg/cpp/cmdlne-dU-11.c, gcc.dg/cpp/cmdlne-dU-12.c,
gcc.dg/cpp/cmdlne-dU-13.c, gcc.dg/cpp/cmdlne-dU-14.c,
gcc.dg/cpp/cmdlne-dU-15.c, gcc.dg/cpp/cmdlne-dU-16.c,
gcc.dg/cpp/cmdlne-dU-17.c, gcc.dg/cpp/cmdlne-dU-18.c,
gcc.dg/cpp/cmdlne-dU-19.c, gcc.dg/cpp/cmdlne-dU-20.c,
gcc.dg/cpp/cmdlne-dU-21.c, gcc.dg/cpp/cmdlne-dU-22.c: New tests.
libcpp:
* include/cpplib.h (struct cpp_callbacks): Add used_define,
used_undef and before_define.
(NODE_USED): Define.
* directives.c (do_define, do_undef, undefine_macros, do_ifdef,
do_ifndef, cpp_pop_definition): Handle new flag and use new
callbacks.
* expr.c (parse_defined): Handle new flag and use new callbacks.
* macro.c (enter_macro_context, _cpp_free_definition): Handle new
flag and use new callbacks.
From-SVN: r133847
2008-04-02 21:42:53 +02:00
|
|
|
|
2008-04-02 Joseph Myers <joseph@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* include/cpplib.h (struct cpp_callbacks): Add used_define,
|
|
|
|
|
used_undef and before_define.
|
|
|
|
|
(NODE_USED): Define.
|
|
|
|
|
* directives.c (do_define, do_undef, undefine_macros, do_ifdef,
|
|
|
|
|
do_ifndef, cpp_pop_definition): Handle new flag and use new
|
|
|
|
|
callbacks.
|
|
|
|
|
* expr.c (parse_defined): Handle new flag and use new callbacks.
|
|
|
|
|
* macro.c (enter_macro_context, _cpp_free_definition): Handle new
|
|
|
|
|
flag and use new callbacks.
|
|
|
|
|
|
2008-04-01 12:58:02 +02:00
|
|
|
|
2008-04-01 Jakub Jelinek <jakub@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR pch/13675
|
|
|
|
|
* files.c (struct _cpp_file): Remove pch field.
|
|
|
|
|
(pch_open_file): Don't set file->pch, just file->pchname.
|
|
|
|
|
(should_stack_file): After pfile->cb.read_pch call
|
|
|
|
|
free pchname and clear pchname, don't close file->fd.
|
|
|
|
|
Test file->pchname instead of file->pch. Don't close fd after cb.
|
|
|
|
|
(_cpp_stack_include): Test file->pchname instead of file->pch.
|
|
|
|
|
|
2008-03-28 14:32:47 +01:00
|
|
|
|
2008-03-28 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
|
|
|
|
* Makefile.in (POSTCOMPILE): New variable.
|
|
|
|
|
(.c.o): Use it.
|
|
|
|
|
|
2008-03-13 22:10:07 +01:00
|
|
|
|
2008-03-13 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR libcpp/35322:
|
|
|
|
|
* directives.c (destringize_and_run): Set pfile->directive.
|
|
|
|
|
|
2008-03-06 19:08:40 +01:00
|
|
|
|
2008-03-06 Markus Milleder <markus.milleder@generali.at>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/35458
|
|
|
|
|
* mkdeps.c (munge): Quote '#' with a '\'.
|
|
|
|
|
|
2008-02-27 22:42:23 +01:00
|
|
|
|
2008-02-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/35379
|
|
|
|
|
* mkdeps.c (deps_write): Ensure the first target always appears
|
|
|
|
|
in the first column, without leading backslash newline. Avoid
|
|
|
|
|
some more extra whitespace.
|
|
|
|
|
|
2008-02-26 12:41:01 +01:00
|
|
|
|
2008-02-25 Thiemo Seufer <ths@mips.com>
|
|
|
|
|
|
2008-02-27 22:42:23 +01:00
|
|
|
|
* Makefile.in ($(srcdir)/config.in): Depend on configure.ac.
|
2008-02-26 12:41:01 +01:00
|
|
|
|
|
2008-02-20 03:16:43 +01:00
|
|
|
|
2008-02-19 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
|
|
|
|
* traditional.c (lex_identifier): Use CPP_HASHNODE.
|
|
|
|
|
* lex.c (lex_identifier): Use CPP_HASHNODE.
|
|
|
|
|
* include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Wrap in
|
|
|
|
|
do-while.
|
|
|
|
|
* identifiers.c (alloc_node): Change return type.
|
|
|
|
|
(_cpp_init_hashtable): Don't cast 'alloc_node'.
|
|
|
|
|
(proxy_assertion_broken): New declaration.
|
|
|
|
|
(cpp_forall_identifiers): Move comment.
|
|
|
|
|
* line-map.c (linemap_add): Comment fix.
|
|
|
|
|
(linemap_line_start): Indentation fix.
|
|
|
|
|
|
2008-01-25 10:01:27 +01:00
|
|
|
|
2008-01-25 Jakub Jelinek <jakub@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/34692
|
|
|
|
|
* macro.c (collect_args): Add pragma_buff argument. Push
|
|
|
|
|
CPP_PRAGMA ... CPP_PRAGMA_EOL tokens to *pragma_buff, rather
|
|
|
|
|
than into arguments. Reset prevent_expansion and parsing_args
|
|
|
|
|
state at CPP_PRAGMA_EOL/CPP_EOF.
|
|
|
|
|
(funlike_invocation_p): Add pragma_buff argument, pass it through
|
|
|
|
|
to collect_args.
|
|
|
|
|
(enter_macro_context): Add result argument. Adjust
|
|
|
|
|
funlike_invocation_p caller. Emit all deferred pragma tokens
|
|
|
|
|
gathered during collect_args before the expansion, add a padding
|
|
|
|
|
token. Return 2 instead of 1 if any pragma tokens were prepended.
|
|
|
|
|
(cpp_get_token): If enter_macro_context returns 2, don't return
|
|
|
|
|
a padding token, instead cycle to grab CPP_PRAGMA token.
|
|
|
|
|
* directives.c (_cpp_handle_directive): If was_parsing_args
|
|
|
|
|
in deferred pragma, leave parsing_args and prevent_expansion as is.
|
|
|
|
|
|
2008-01-22 22:43:49 +01:00
|
|
|
|
2008-01-22 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
2008-01-25 10:01:27 +01:00
|
|
|
|
PR c++/34859
|
2008-01-22 22:43:49 +01:00
|
|
|
|
* macro.c (_cpp_create_definition): Handle __STDC_LIMIT_MACROS and
|
|
|
|
|
__STDC_CONSTANT_MACROS.
|
|
|
|
|
|
2008-01-07 18:23:40 +01:00
|
|
|
|
2008-01-07 Fred Fish <fnf@specifix.com>
|
|
|
|
|
|
2008-01-25 10:01:27 +01:00
|
|
|
|
PR preprocessor/30363
|
2008-01-07 18:23:40 +01:00
|
|
|
|
* traditional.c (replace_args_and_push): Add local variable
|
2014-10-22 03:41:31 +02:00
|
|
|
|
cxtquote, calculate the replacement text size assuming a
|
2008-01-07 18:23:40 +01:00
|
|
|
|
worst case of every input character quoted with backslash,
|
|
|
|
|
and properly handle output quoting of quote characters in
|
|
|
|
|
actual arguments used in function-like macros.
|
|
|
|
|
|
2008-01-03 18:58:26 +01:00
|
|
|
|
2008-01-03 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
2008-01-25 10:01:27 +01:00
|
|
|
|
PR preprocessor/34602
|
2008-01-03 18:58:26 +01:00
|
|
|
|
* directives.c (do_line): Don't try to spell EOF token.
|
|
|
|
|
(do_linemarker): Add comment.
|
|
|
|
|
|
2007-12-12 02:38:10 +01:00
|
|
|
|
2007-12-11 DJ Delorie <dj@redhat.com>
|
|
|
|
|
|
|
|
|
|
* charset.c (convert_using_iconv): Close out any shift states,
|
|
|
|
|
returning to the initial state.
|
|
|
|
|
|
2007-12-06 19:56:26 +01:00
|
|
|
|
2007-12-06 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
2008-01-25 10:01:27 +01:00
|
|
|
|
PR c/29172
|
2007-12-06 19:56:26 +01:00
|
|
|
|
* internal.h (struct cpp_reader) <file_hash_entries>: Changed
|
|
|
|
|
type.
|
|
|
|
|
<file_hash_entries_allocated, file_hash_entries_used>: Removed.
|
|
|
|
|
* files.c (FILE_HASH_POOL_SIZE): New macro.
|
|
|
|
|
(struct file_hash_entry_pool): New.
|
|
|
|
|
(destroy_all_cpp_files): New function.
|
|
|
|
|
(allocate_file_hash_entries): Allocate a file_hash_entry_pool.
|
|
|
|
|
(new_file_hash_entry): Update.
|
|
|
|
|
(free_file_hash_entries): New function.
|
|
|
|
|
(_cpp_cleanup_files): Call free_file_hash_entries and
|
|
|
|
|
destroy_all_cpp_files.
|
|
|
|
|
(cpp_clear_file_cache): New function.
|
|
|
|
|
* include/cpplib.h (cpp_clear_file_cache): Declare.
|
|
|
|
|
|
2007-12-03 22:04:47 +01:00
|
|
|
|
2007-12-03 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
2008-01-25 10:01:27 +01:00
|
|
|
|
PR preprocessor/34288
|
2007-12-03 22:04:47 +01:00
|
|
|
|
* configure.ac, config.in: Rebuilt.
|
|
|
|
|
* configure.ac: Check for ssize_t.
|
|
|
|
|
|
2007-11-30 19:24:01 +01:00
|
|
|
|
2007-11-30 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
2008-01-25 10:01:27 +01:00
|
|
|
|
PR preprocessor/32868
|
2007-11-30 19:24:01 +01:00
|
|
|
|
* macro.c (_cpp_create_definition): Special case
|
|
|
|
|
__STDC_FORMAT_MACROS.
|
|
|
|
|
|
2007-11-16 14:46:57 +01:00
|
|
|
|
2007-11-16 Michael Matz <matz@suse.de>
|
|
|
|
|
|
|
|
|
|
* files.c (search_path_head): Fix check for absolute paths.
|
|
|
|
|
|
2007-11-12 01:38:48 +01:00
|
|
|
|
2007-11-11 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
2008-01-25 10:01:27 +01:00
|
|
|
|
PR c++/17557
|
2007-11-12 01:38:48 +01:00
|
|
|
|
* include/cpplib.h (cpp_included_before): Declare.
|
|
|
|
|
* files.c (struct file_hash_entry) <location>: New field.
|
|
|
|
|
(_cpp_find_file): Initialize new field.
|
|
|
|
|
(make_cpp_dir): Likewise.
|
|
|
|
|
(cpp_included_before): New function.
|
|
|
|
|
|
2007-11-01 19:20:48 +01:00
|
|
|
|
2007-11-01 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
2008-01-25 10:01:27 +01:00
|
|
|
|
PR preprocessor/30805
|
2007-11-01 19:20:48 +01:00
|
|
|
|
* macro.c (paste_tokens): Handle padding token.
|
|
|
|
|
(paste_tokens): Don't abort unless padding has PASTE_LEFT flag.
|
|
|
|
|
|
2007-10-31 15:50:13 +01:00
|
|
|
|
2007-10-31 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
2008-01-25 10:01:27 +01:00
|
|
|
|
PR preprocessor/30786
|
2007-10-31 15:50:13 +01:00
|
|
|
|
* macro.c (builtin_macro): Return result of _cpp_do__Pragma.
|
|
|
|
|
* directives.c (_cpp_do__Pragma): Return error status.
|
|
|
|
|
* internal.h (_cpp_do__Pragma): Update.
|
|
|
|
|
* directives.c (get__Pragma_string): Back up if EOF seen.
|
|
|
|
|
|
2007-09-06 18:24:05 +02:00
|
|
|
|
2007-09-06 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
|
|
|
|
* internal.h (struct cpp_reader) <invocation_location>: New
|
|
|
|
|
field.
|
|
|
|
|
(struct cpp_reader) <set_invocation_location>: Likewise.
|
|
|
|
|
* init.c (cpp_set_line_map): New function.
|
|
|
|
|
* line-map.c (linemap_add): Use linemap's allocator.
|
|
|
|
|
* include/line-map.h (GTY): Define.
|
|
|
|
|
(line_map_realloc): New typedef.
|
|
|
|
|
(struct line_map): Mark with GTY.
|
|
|
|
|
(struct line_maps): Likewise.
|
|
|
|
|
(struct line_maps) <maps>: Likewise.
|
|
|
|
|
(struct line_maps) <reallocator>: New field.
|
|
|
|
|
* include/symtab.h (GTY): Conditionally define.
|
|
|
|
|
* include/cpplib.h (cpp_set_line_map): Declare.
|
|
|
|
|
(cpp_get_token_with_location): Declare.
|
|
|
|
|
* macro.c (cpp_get_token): Set invocation_location on the reader.
|
|
|
|
|
(cpp_get_token_with_location): New function.
|
|
|
|
|
|
expr.c (interpret_float_suffix): Support hr, r, lr, llr, uhr, ur, ulr, ullr, hk, k, lk, llk, uhk, uk, ulk, ullk.
* expr.c (interpret_float_suffix): Support hr, r, lr, llr, uhr, ur,
ulr, ullr, hk, k, lk, llk, uhk, uk, ulk, ullk.
(cpp_classify_number): Support decimal fixed-point constants without
exponents.
Warn about fixed-point constants when -pedantic.
* include/cpplib.h (CPP_N_SMALL, CPP_N_MEDIUM, CPP_N_LARGE): Change
comments to support fixed-point values.
(CPP_N_FRACT, CPP_N_ACCUM): Define.
From-SVN: r127940
2007-08-31 01:05:17 +02:00
|
|
|
|
2007-08-30 Chao-ying Fu <fu@mips.com>
|
|
|
|
|
|
|
|
|
|
* expr.c (interpret_float_suffix): Support hr, r, lr, llr, uhr, ur,
|
|
|
|
|
ulr, ullr, hk, k, lk, llk, uhk, uk, ulk, ullk.
|
|
|
|
|
(cpp_classify_number): Support decimal fixed-point constants without
|
|
|
|
|
exponents.
|
|
|
|
|
Warn about fixed-point constants when -pedantic.
|
|
|
|
|
* include/cpplib.h (CPP_N_SMALL, CPP_N_MEDIUM, CPP_N_LARGE): Change
|
|
|
|
|
comments to support fixed-point values.
|
|
|
|
|
(CPP_N_FRACT, CPP_N_ACCUM): Define.
|
|
|
|
|
|
2007-08-18 19:54:11 +02:00
|
|
|
|
2007-08-18 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
2008-01-25 10:01:27 +01:00
|
|
|
|
PR preprocessor/32974
|
2007-08-18 19:54:11 +02:00
|
|
|
|
* directives.c (parse_include): Don't check for EOL when
|
|
|
|
|
processing #pragma dependency.
|
|
|
|
|
|
2007-07-30 20:29:20 +02:00
|
|
|
|
2007-07-30 Ollie Wild <aaw@google.com>
|
|
|
|
|
|
|
|
|
|
* directives-only.c: New file.
|
|
|
|
|
* internal.h (struct _cpp_dir_only_callbacks): New.
|
|
|
|
|
(_cpp_preprocess_dir_only): New function.
|
|
|
|
|
* directives.c (_cpp_handle_directive): Check directives_only before
|
|
|
|
|
disabling execution of indented directives.
|
|
|
|
|
* files.c (_cpp_stack_file): Add directives_only check.
|
|
|
|
|
* include/cpplib.h (struct cpp_options): Add directives_only.
|
|
|
|
|
(cpp_init_special_builtins): New function.
|
|
|
|
|
* init.c (cpp_init_special_builtins): New function.
|
|
|
|
|
(cpp_init_builtins): Move builtin_array initialization to
|
|
|
|
|
cpp_init_special_builtins.
|
|
|
|
|
(post_options): Check directives_only before setting
|
|
|
|
|
pfile->state.prevent_expansion = 1.
|
|
|
|
|
* macro.c (_cpp_builtin_macro_text): Print an error if __COUNTER__
|
|
|
|
|
is expanded inside a directive while -fdirectives-only is enabled.
|
|
|
|
|
* Makefile.in (libcpp_a_OBJS): Add directives-only.o.
|
|
|
|
|
(libcpp_a_SOURCES): Add directives-only.c.
|
|
|
|
|
|
2007-07-04 12:08:44 +02:00
|
|
|
|
2007-07-04 Uros Bizjak <ubizjak@gmail.com>
|
|
|
|
|
|
|
|
|
|
* traditional.c (_cpp_scan_out_logical_line): Initialize
|
|
|
|
|
fmacro.args, fmacro.node, fmacro.offset, fmacro.line and
|
|
|
|
|
fmacro.args to prevent 'may be used uninitialized' warning.
|
|
|
|
|
|
2007-07-03 07:53:58 +02:00
|
|
|
|
2007-07-03 Uros Bizjak <ubizjak@gmail.com>
|
|
|
|
|
|
|
|
|
|
* include/cpplib.h (CPP_N_WIDTH_MD, CPP_N_MD_W, CPP_N_MD_Q):
|
|
|
|
|
Add new constants.
|
|
|
|
|
* expr.c (interpret_float_suffix): Process 'w', 'W', 'q' and 'Q'
|
|
|
|
|
suffixes. Return CPP_N_MD_W for 'w' or 'W' suffixes and CPP_N_MD_Q
|
|
|
|
|
for 'q' or 'Q' suffixes.
|
|
|
|
|
|
2007-06-18 01:15:58 +02:00
|
|
|
|
2007-06-17 Danny Smith <dannysmith@users.sourceforge.net
|
|
|
|
|
|
2007-06-18 01:19:09 +02:00
|
|
|
|
* files.c (open_file): Correct typo.
|
2007-06-18 01:15:58 +02:00
|
|
|
|
|
2007-06-16 14:30:49 +02:00
|
|
|
|
2007-06-16 Vladimir Prus <vladimir@codesourcery.com>
|
|
|
|
|
|
2007-06-18 01:19:09 +02:00
|
|
|
|
* files.c (open_file): Prevent the call
|
2007-06-16 14:30:49 +02:00
|
|
|
|
for stat from overwriting errno.
|
|
|
|
|
|
2007-06-09 12:16:52 +02:00
|
|
|
|
2007-06-09 Vladimir Prus <vladimir@codesourcery.com>
|
|
|
|
|
|
2007-06-18 01:19:09 +02:00
|
|
|
|
* files.c (open_file): Account for the
|
2014-10-22 03:41:31 +02:00
|
|
|
|
fact that on windows, opening a directory gives
|
|
|
|
|
EACCES.
|
2007-06-09 12:16:52 +02:00
|
|
|
|
|
2007-06-06 00:25:27 +02:00
|
|
|
|
2007-06-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/23479
|
|
|
|
|
* expr.c (cpp_classify_number): Implement 0b-prefixed binary
|
|
|
|
|
integer constants.
|
|
|
|
|
(append_digit): Likewise.
|
|
|
|
|
* include/cpplib.h: Add CPP_N_BINARY, to be used for 0b-prefixed
|
|
|
|
|
binary integer constants.
|
|
|
|
|
|
2007-05-31 04:06:48 +02:00
|
|
|
|
2007-05-31 Dave Korn <dave.korn@artimi.com>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/14331
|
|
|
|
|
* lex.c (_cpp_get_fresh_line): Don't warn if no newline at EOF.
|
|
|
|
|
|
2007-05-24 22:55:36 +02:00
|
|
|
|
2007-05-24 Ollie Wild <aaw@google.com>
|
|
|
|
|
|
|
|
|
|
* macro.c (_cpp_builtin_macro_text): Handle BT_COUNTER.
|
|
|
|
|
* pch.c (cpp_write_pch_deps): Save __COUNTER__ state.
|
|
|
|
|
(cpp_write_pch_state): Save __COUNTER__ state.
|
|
|
|
|
(cpp_valid_state): Check valid __COUNTER__ state.
|
|
|
|
|
(cpp_read_state): Read new __COUNTER__ state.
|
|
|
|
|
* include/cpplib.h (enum builtin_type): Add BT_COUNTER enumerator.
|
|
|
|
|
* init.c (builtin_array): Add __COUNTER__/BT_COUNTER.
|
|
|
|
|
* internal.h (struct cpp_reader): Add counter member.
|
|
|
|
|
|
2007-05-23 22:58:34 +02:00
|
|
|
|
2007-05-23 Simon Martin <simartin@users.sourceforge.net>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/20077
|
|
|
|
|
* macro.c (create_iso_definition): Fixed the method to determine
|
|
|
|
|
whether the token-pasting operator appears at the beginning or the end
|
|
|
|
|
of a macro.
|
|
|
|
|
|
2007-05-22 01:43:53 +02:00
|
|
|
|
2007-05-21 Ian Lance Taylor <iant@google.com>
|
|
|
|
|
|
|
|
|
|
* internal.h (struct cpp_reader): Add new fields:
|
|
|
|
|
nonexistent_file_hash and nonexistent_file_ob.
|
|
|
|
|
* files.c: Include "obstack.h".
|
|
|
|
|
(find_file_in_dir): Before trying to open the file, look up the
|
|
|
|
|
path name in the hash table of nonexistent files. After failing
|
|
|
|
|
to open the file, add the path name to the hash table.
|
|
|
|
|
(_cpp_find_file): Cache the results of looking up the file name
|
|
|
|
|
starting with the quote and bracket chain heads, if we can.
|
|
|
|
|
(nonexistent_file_hash_eq): New static function.
|
|
|
|
|
(_cpp_init_files): Initialize pfile->nonexistent_file_hash and
|
|
|
|
|
pfile->nonexistent_file_ob.
|
|
|
|
|
(_cpp_cleanup_files): Free pfile->nonexistent_file_hash and
|
|
|
|
|
pfile->nonexistent_file_ob.
|
|
|
|
|
|
2007-05-15 01:43:07 +02:00
|
|
|
|
2007-05-14 Janis Johnson <janis187@us.ibm.com>
|
|
|
|
|
|
2014-10-22 03:41:31 +02:00
|
|
|
|
* expr.c (cpp_classify_number): Warn about dfp constant for -pedantic.
|
2007-05-15 01:45:40 +02:00
|
|
|
|
|
2007-05-15 01:43:07 +02:00
|
|
|
|
PR c/31924
|
|
|
|
|
* expr.c (interpret_float_suffix): Check for invalid suffix.
|
|
|
|
|
|
2007-05-02 23:57:50 +02:00
|
|
|
|
2007-05-02 Eric Christopher <echristo@apple.com>
|
|
|
|
|
|
|
|
|
|
* expr.c (num_div_op): Don't overflow if the result is
|
|
|
|
|
zero.
|
|
|
|
|
|
2007-05-02 21:33:44 +02:00
|
|
|
|
2007-05-02 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
2008-01-25 10:01:27 +01:00
|
|
|
|
PR preprocessor/28709
|
2007-05-02 21:33:44 +02:00
|
|
|
|
* macro.c (paste_tokens): Remove PASTE_LEFT from the old lhs.
|
|
|
|
|
|
2007-03-31 00:40:19 +02:00
|
|
|
|
2007-03-30 Michael Meissner <michael.meissner@amd.com>
|
|
|
|
|
|
|
|
|
|
* directives.c (lex_macro_node_from_str): Fix alloca call to be
|
|
|
|
|
type correct.
|
|
|
|
|
|
2007-03-30 23:12:53 +02:00
|
|
|
|
2007-03-30 Richard Henderson <rth@redhat.com>
|
|
|
|
|
|
|
|
|
|
* directives.c (lex_macro_node_from_str): New.
|
|
|
|
|
(cpp_push_definition, cpp_pop_definition): New.
|
|
|
|
|
* include/cpplib.h (cpp_push_definition, cpp_pop_definition): Declare.
|
|
|
|
|
|
2007-03-02 00:56:24 +01:00
|
|
|
|
2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* Makefile.in: Add dummy install-pdf target.
|
|
|
|
|
|
2007-01-30 16:50:00 +01:00
|
|
|
|
2007-01-30 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
2008-01-25 10:01:27 +01:00
|
|
|
|
PR preprocessor/30468
|
2007-01-30 16:50:00 +01:00
|
|
|
|
* mkdeps.c (apply_vpath): Strip successive '/'s if we stripped
|
|
|
|
|
'./'.
|
|
|
|
|
|
2007-01-30 16:46:01 +01:00
|
|
|
|
2007-01-30 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
2008-01-25 10:01:27 +01:00
|
|
|
|
PR preprocessor/29966
|
2007-01-30 16:46:01 +01:00
|
|
|
|
* macro.c (lex_expansion_token): Save and restore cpp_reader's
|
|
|
|
|
cur_token.
|
|
|
|
|
(_cpp_create_definition): Don't restore cur_token here.
|
|
|
|
|
* lex.c (_cpp_lex_token): Added assertion.
|
|
|
|
|
|
2007-01-27 20:50:38 +01:00
|
|
|
|
2007-01-27 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
|
|
|
|
* configure: Rebuilt.
|
|
|
|
|
|
2007-01-12 20:46:49 +01:00
|
|
|
|
2007-01-12 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
2008-01-25 10:01:27 +01:00
|
|
|
|
PR preprocessor/28227
|
2007-01-12 20:46:49 +01:00
|
|
|
|
* directives.c (lex_macro_node): Added 'is_def_or_undef'
|
|
|
|
|
argument.
|
|
|
|
|
(do_define): Update.
|
|
|
|
|
(do_undef): Update.
|
|
|
|
|
(do_ifdef): Update.
|
|
|
|
|
(do_ifndef): Update.
|
|
|
|
|
|
2007-01-11 15:11:32 +01:00
|
|
|
|
2007-01-11 Paolo Bonzini <bonzini@gnu.org>
|
|
|
|
|
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
|
2007-01-11 16:21:53 +01:00
|
|
|
|
2007-01-11 Paolo Bonzini <bonzini@gnu.org>
|
|
|
|
|
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
|
2007-01-04 16:32:26 +01:00
|
|
|
|
2007-01-04 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
2008-01-25 10:01:27 +01:00
|
|
|
|
PR preprocessor/28165
|
2007-01-04 16:32:26 +01:00
|
|
|
|
* internal.h (cpp_in_primary_file): New function.
|
|
|
|
|
* directives.c (do_include_next): Use cpp_in_primary_file.
|
|
|
|
|
(do_pragma_once): Likewise.
|
|
|
|
|
(do_pragma_system_header): Likewise.
|
|
|
|
|
|
2006-12-29 16:43:55 +01:00
|
|
|
|
2006-12-29 Ian Lance Taylor <iant@google.com>
|
|
|
|
|
|
|
|
|
|
* lex.c (_cpp_clean_line): Add uses of __builtin_expect. Don't
|
|
|
|
|
look backward at the end of the line unless we saw a backslash.
|
|
|
|
|
|
2006-12-29 09:15:08 +01:00
|
|
|
|
2006-12-29 Jakub Jelinek <jakub@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/29612
|
|
|
|
|
* directives.c (do_linemarker): Set pfile->buffer->sysp always, not
|
|
|
|
|
only when new_sysp is non-zero.
|
|
|
|
|
|
2006-12-28 19:45:48 +01:00
|
|
|
|
2006-12-28 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
2008-01-25 10:01:27 +01:00
|
|
|
|
PR preprocessor/30001
|
2006-12-28 19:45:48 +01:00
|
|
|
|
* charset.c (_cpp_convert_input): Check that to.len is greater
|
|
|
|
|
than zero.
|
|
|
|
|
|
2006-11-21 02:35:42 +01:00
|
|
|
|
2006-11-20 Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
|
|
|
|
|
|
|
|
|
|
* configure.ac (need_64bit_hwint): Need 64bit hwint for SPU.
|
2006-11-21 03:22:40 +01:00
|
|
|
|
* configure: Rebuilt.
|
2006-11-21 02:35:42 +01:00
|
|
|
|
|
2006-11-01 17:27:23 +01:00
|
|
|
|
2006-11-01 Douglas Gregor <doug.gregor@gmail.com>
|
|
|
|
|
|
|
|
|
|
* include/cpplib.h (enum c_lang): Add CLK_GNUCXX0X and CLK_CXX0X
|
|
|
|
|
for experimental C++0x mode.
|
|
|
|
|
* init.c (lang_defaults): Add defaults for C++0x modes. C++0x has
|
|
|
|
|
adopted the preprocessor changes introduced in C99.
|
|
|
|
|
|
2006-10-29 17:35:50 +01:00
|
|
|
|
2006-10-29 Joseph Myers <joseph@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* configure.ac (need_64bit_hwint): Set for i[34567]86-*-linux*
|
|
|
|
|
depending on --enable-targets=all.
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
|
2006-10-12 11:25:59 +02:00
|
|
|
|
2006-10-12 Jakub Jelinek <jakub@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/28709
|
|
|
|
|
* macro.c (paste_tokens): Do error reporting here, use BUF with the
|
|
|
|
|
spelled LHS token as opposed to spelling it again.
|
|
|
|
|
(paste_all_tokens): Don't report errors here, just break on failure.
|
|
|
|
|
|
2006-10-11 01:48:09 +02:00
|
|
|
|
2006-10-10 Brooks Moses <bmoses@stanford.edu>
|
|
|
|
|
|
|
|
|
|
* Makefile.in: Added empty "pdf" target.
|
|
|
|
|
|
2006-09-23 01:26:20 +02:00
|
|
|
|
2006-09-22 Geoffrey Keating <geoffk@apple.com>
|
|
|
|
|
|
|
|
|
|
* configure.ac: Make need_64_bit_hwint case for x86-darwin
|
|
|
|
|
match exactly the glob in gcc/config.gcc.
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
|
2006-09-13 03:04:18 +02:00
|
|
|
|
2006-09-13 Joseph S. Myers <joseph@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
PR c/28768
|
|
|
|
|
PR preprocessor/14634
|
|
|
|
|
* lex.c (lex_string): Pedwarn for unterminated literals.
|
|
|
|
|
|
2006-09-09 02:27:47 +02:00
|
|
|
|
2006-09-08 Eric Christopher <echristo@apple.com>
|
|
|
|
|
|
|
|
|
|
* configure.ac: Add 64-bit HWI support for i?86-darwin.
|
|
|
|
|
|
2006-08-15 01:13:54 +02:00
|
|
|
|
2006-08-14 Steve Ellcey <sje@cup.hp.com>
|
|
|
|
|
|
|
|
|
|
PR c++/28288
|
|
|
|
|
PR c++/14556
|
|
|
|
|
* include/cpplib.h: Remove <?, >?, <?=, and >?= tokens.
|
|
|
|
|
(CPP_LAST_EQ): Change.
|
|
|
|
|
(CPP_LAST_PUNCTUATOR): Change.
|
|
|
|
|
* expr.c (cpp_operator): Remove MIN and MAX.
|
|
|
|
|
(reduce): Remove CPP_MIN and CPP_MAX.
|
|
|
|
|
(num_binary_op): Ditto.
|
|
|
|
|
* lex.c (_cpp_lex_direct): Ditto.
|
|
|
|
|
(cpp_avoid_paste): Remove ? as legal symbol after > or <.
|
|
|
|
|
|
2006-06-09 23:13:25 +02:00
|
|
|
|
2006-06-09 Jakub Jelinek <jakub@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/27746
|
|
|
|
|
* directives.c (do_pragma): Handle pragma with valid namespace
|
|
|
|
|
and invalid name coming from macro expansion.
|
|
|
|
|
* directives.c (destringize_and_run): Initialize next field in
|
|
|
|
|
context.
|
|
|
|
|
|
|
|
|
|
PR c/27747
|
|
|
|
|
PR c++/27748
|
|
|
|
|
* directives.c (destringize_and_run): Set NO_EXPAND on the
|
|
|
|
|
tokens.
|
|
|
|
|
|
|
|
|
|
* macro.c (_cpp_backup_tokens): Fix comment typo.
|
|
|
|
|
|
2006-05-31 17:34:37 +02:00
|
|
|
|
2006-05-31 Daniel Jacobowitz <dan@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* Makefile.in (CATALOGS): Add po/ prefix.
|
|
|
|
|
* configure: Regenerated.
|
|
|
|
|
|
2006-05-24 03:48:20 +02:00
|
|
|
|
2006-05-23 Carlos O'Donell <carlos@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* Makefile.in: Add install-html target. Add install-html to .PHONY
|
|
|
|
|
|
2006-02-18 10:25:31 +01:00
|
|
|
|
2006-02-17 Grigory Zagorodnev <grigory_zagorodnev@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
* macro.c (_cpp_builtin_macro_text): Handle BT_TIMESTAMP.
|
|
|
|
|
* files.c (_cpp_get_file_stat): New function.
|
|
|
|
|
* include/cpplib.h (builtin_type): Add BT_TIMESTAMP.
|
|
|
|
|
* init.c (builtin_array): Add support for __TIMESTAMP__/BT_TIMESTAMP.
|
|
|
|
|
* internal.h (_cpp_get_file_stat): Prototype.
|
|
|
|
|
(struct cpp_buffer): Add timestamp.
|
|
|
|
|
|
2006-01-23 22:50:15 +01:00
|
|
|
|
2006-01-23 Jakub Jelinek <jakub@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/25717
|
|
|
|
|
* init.c (cpp_init_builtins): If __STDC__ will not change value
|
|
|
|
|
between system headers and other sources, define it as a normal
|
|
|
|
|
macro rather than a builtin.
|
|
|
|
|
* macro.c (_cpp_builtin_macro_text) <case BT_STDC>: Only check
|
|
|
|
|
cpp_in_system_header condition.
|
|
|
|
|
|
|
|
|
|
2006-01-05 Paolo Bonzini <bonzini@gnu.org>
|
2006-01-05 09:35:23 +01:00
|
|
|
|
|
|
|
|
|
* Makefile.in: Use -MMD instead of -MD.
|
|
|
|
|
|
2006-01-04 17:33:38 +01:00
|
|
|
|
2006-01-04 Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
|
|
|
|
|
Richard Henderson <rth@redhat.com>
|
|
|
|
|
|
|
|
|
|
Merge from gomp branch:
|
|
|
|
|
* directives.c (struct pragma_entry): Add is_deferred. Add ident
|
|
|
|
|
entry to value union.
|
|
|
|
|
(end_directive): Don't eat the line if in_deferred_pragma.
|
|
|
|
|
(run_directive): Remove pragma hacks.
|
|
|
|
|
(insert_pragma_entry): Remove.
|
|
|
|
|
(new_pragma_entry): New.
|
|
|
|
|
(register_pragma_1): Split out of register_pragma. Only handle
|
|
|
|
|
the lookup tree and return the new entry.
|
|
|
|
|
(cpp_register_pragma): Fill in the pragma entry here.
|
|
|
|
|
(cpp_register_deferred_pragma): New.
|
|
|
|
|
(register_pragma_internal): New.
|
|
|
|
|
(_cpp_init_internal_pragmas): Use register_pragma_internal.
|
|
|
|
|
(do_pragma): Allow pragma expansion after namespace. For deferred
|
|
|
|
|
pragmas, don't slurp the line into a string.
|
|
|
|
|
(destringize_and_run): Save tokens for deferred pragmas.
|
|
|
|
|
(cpp_handle_deferred_pragma): Remove.
|
|
|
|
|
* macro.c (builtin_macro): Remove pragma token hack.
|
|
|
|
|
(_cpp_push_token_context): Rename from push_token_context and export.
|
|
|
|
|
* internal.h (struct lexer_state): Add pragma_allow_expansion.
|
|
|
|
|
(_cpp_push_token_context): Declare.
|
|
|
|
|
* lex.c (_cpp_lex_token): Allow _cpp_handle_directive to return
|
|
|
|
|
a token. Update the line number correctly if so.
|
|
|
|
|
(_cpp_lex_direct): Emit CPP_PRAGMA_EOL tokens.
|
|
|
|
|
(cpp_token_val_index): Return CPP_TOKEN_FLD_PRAGMA for pragmas.
|
|
|
|
|
* include/cpplib.h (PRAGMA_EOL): New.
|
|
|
|
|
(CPP_TOKEN_FLD_PRAGMA): New.
|
|
|
|
|
(struct cpp_token): Add val.pragma.
|
|
|
|
|
(struct cpp_options): Remove defer_pragmas.
|
|
|
|
|
(cpp_handle_deferred_pragma): Remove.
|
|
|
|
|
(cpp_register_deferred_pragma): Declare.
|
|
|
|
|
|
2006-01-01 00:45:58 +01:00
|
|
|
|
2006-01-01 Jakub Jelinek <jakub@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR c++/25294
|
|
|
|
|
* directives.c (do_pragma): If pragma line ends with multi-line
|
|
|
|
|
block comment, end the saved deferred pragma string before that
|
|
|
|
|
comment. Handle embedded '\0' chars on the pragma line.
|
|
|
|
|
|
2005-12-22 13:01:44 +01:00
|
|
|
|
2005-12-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
|
|
|
|
|
|
|
|
|
PR c++/23333
|
|
|
|
|
* include/cpplib.h: Add PURE_ZERO to flags for the cpp_token structure.
|
|
|
|
|
|
2005-12-07 00:13:15 +01:00
|
|
|
|
2005-12-07 Jon Grimm <jgrimm2@us.ibm.com>
|
|
|
|
|
Ben Elliston <bje@au.ibm.com>
|
|
|
|
|
|
|
|
|
|
* include/cpplib.h (CPP_N_DFLOAT): New.
|
|
|
|
|
* expr.c (interpret_float_suffix): Identify df, dd, and dl
|
|
|
|
|
suffixes as decimal floating point constants.
|
|
|
|
|
(cpp_classify_number): Disallow hexadecimal DFP constants.
|
|
|
|
|
|
2005-11-14 17:28:55 +01:00
|
|
|
|
2005-11-14 Gerald Pfeifer <gerald@pfeifer.com>
|
2006-01-04 17:33:38 +01:00
|
|
|
|
Ian Lance Taylor <ian@airs.com>
|
2005-11-14 17:28:55 +01:00
|
|
|
|
|
|
|
|
|
* include/cpplib.h (struct cpp_callbacks): Annotate error with
|
|
|
|
|
ATTRIBUTE_FPTR_PRINTF(3,0) instead of ATTRIBUTE_PRINTF(3,0).
|
|
|
|
|
|
2005-11-09 07:30:03 +01:00
|
|
|
|
2005-11-09 Per Bothner <per@bothner.com>
|
|
|
|
|
Uros Bizjak <uros@kss-loka.si>
|
2006-09-09 02:27:47 +02:00
|
|
|
|
|
2005-11-09 07:30:03 +01:00
|
|
|
|
PR c/24101
|
|
|
|
|
* init.c (read_original_filename): Temporarily set
|
|
|
|
|
state.in_directive before calling _cpp_lex_direct for
|
|
|
|
|
CPP_HASH tokens.
|
|
|
|
|
|
2005-11-04 03:10:19 +01:00
|
|
|
|
2005-11-03 James E Wilson <wilson@specifix.com>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/24202
|
|
|
|
|
* files.c (_cpp_pop_file_buffer): Set buffer_valid to false.
|
|
|
|
|
|
2005-11-04 02:16:32 +01:00
|
|
|
|
2005-11-04 Joseph S. Myers <joseph@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* include/cpplib.h (struct cpp_callbacks): Make error take
|
|
|
|
|
va_list* parameter.
|
|
|
|
|
* errors.c (cpp_error): Update call to callback.
|
|
|
|
|
|
2005-11-04 01:23:01 +01:00
|
|
|
|
2005-11-03 Andrew Pinski <pinskia@physics.uc.edu>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/22042
|
|
|
|
|
* macro.c (_cpp_builtin_macro_text): Lower the needed max
|
|
|
|
|
buffer size.
|
|
|
|
|
(cpp_quote_string): Don't octalify non printable
|
|
|
|
|
charactors.
|
|
|
|
|
|
2005-11-04 00:08:18 +01:00
|
|
|
|
2005-11-03 Joseph S. Myers <joseph@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
PR c++/17964
|
|
|
|
|
* include/cpplib.h (struct cpp_options): Add client_diagnostic.
|
|
|
|
|
(struct cpp_callbacks): Add error.
|
|
|
|
|
* errors.c (cpp_error): If client_diagnostic, use error callback.
|
|
|
|
|
* charset.c (convert_escape): Don't use %03o in diagnostic.
|
|
|
|
|
|
2005-10-21 19:59:07 +02:00
|
|
|
|
2005-10-21 James E Wilson <wilson@specifix.com>
|
2005-10-21 19:54:20 +02:00
|
|
|
|
|
|
|
|
|
PR preprocessor/15220
|
|
|
|
|
* files.c (_cpp_find_file): New parameter angle_brackets. Fix all
|
|
|
|
|
callers. Pass to open_file_failed.
|
|
|
|
|
(open_file_failed): New parameter angle_brackets. Fix all callers.
|
|
|
|
|
Use in print_dep assignment.
|
|
|
|
|
* init.c (cpp_read_main_file): Pass additional arg to _cpp_find_file.
|
|
|
|
|
* internal.h (_cpp_find_file): Add new parm to declaration.
|
2006-09-09 02:27:47 +02:00
|
|
|
|
|
2005-10-08 20:17:20 +02:00
|
|
|
|
2005-10-08 Kazu Hirata <kazu@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* configure.ac: Require 64-bit int for arm*-*-*eabi*.
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
|
2005-10-04 20:06:19 +02:00
|
|
|
|
2005-10-04 Ian Lance Taylor <ian@airs.com>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/13726
|
|
|
|
|
* directives.c (check_eol_return_comments): New static function.
|
|
|
|
|
(parse_include): Add buf parameter. Change all callers.
|
|
|
|
|
(do_include_common): If not discard comments, turn on
|
|
|
|
|
save_comments. Pass collected comments to include callback.
|
|
|
|
|
* include/cpplib.h (struct cpp_callbacks): Add new parameter to
|
|
|
|
|
include callback: cpp_token list.
|
|
|
|
|
|
c.opt (fextended-identifiers): New.
gcc:
* c.opt (fextended-identifiers): New.
* c-opts.c (c_common_handle_option): Handle
-fextended-identifiers.
* doc/cpp.texi: Update documentation of extended identifiers.
* doc/cppopts.texi (-fextended-identifiers): Document.
gcc/testsuite:
* g++.dg/cpp/ucnid-1.C, g++.dg/cpp/normalize-1.C,
g++.dg/other/ucnid-1.C, gcc.dg/cpp/normalize-1.c,
gcc.dg/cpp/normalize-2.c, gcc.dg/cpp/normalize-3.c,
gcc.dg/cpp/normalize-4.c, gcc.dg/cpp/ucnid-1.c,
gcc.dg/cpp/ucnid-2.c, gcc.dg/cpp/ucnid-3.c, gcc.dg/cpp/ucnid-4.c,
gcc.dg/cpp/ucnid-5.c, gcc.dg/cpp/ucnid-7.c,gcc.dg/ucnid-1.c,
gcc.dg/ucnid-2.c, gcc.dg/ucnid-3.c, gcc.dg/ucnid-4.c,
gcc.dg/ucnid-5.c, gcc.dg/ucnid-6.c: Add -fextended-identifiers.
* gcc.dg/cpp/ucnid-8.c: New test.
libcpp:
* include/cpplib.h (struct cpp_options): Add extended_identifiers.
* init.c (struct lang_flags, lang_defaults): Add
extended_identifiers.
(cpp_set_lang): Use it.
* lex.c (forms_identifier_p): Check extended_identifiers.
From-SVN: r104462
2005-09-20 22:31:37 +02:00
|
|
|
|
2005-09-20 Joseph S. Myers <joseph@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* include/cpplib.h (struct cpp_options): Add extended_identifiers.
|
|
|
|
|
* init.c (struct lang_flags, lang_defaults): Add
|
|
|
|
|
extended_identifiers.
|
|
|
|
|
(cpp_set_lang): Use it.
|
|
|
|
|
* lex.c (forms_identifier_p): Check extended_identifiers.
|
|
|
|
|
|
2005-08-30 08:28:21 +02:00
|
|
|
|
2005-08-30 Jakub Jelinek <jakub@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/20348
|
|
|
|
|
PR preprocessor/20356
|
|
|
|
|
* files.c (_cpp_find_file, search_cache): Revert 2004-06-26 and
|
|
|
|
|
2004-06-05 changes.
|
|
|
|
|
|
2005-07-24 05:44:26 +02:00
|
|
|
|
2005-07-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
|
|
|
|
|
|
|
|
|
|
* configure.ac (ACX_PROG_CC_WARNING_OPTS): add
|
|
|
|
|
-Wmissing-format-attribute.
|
|
|
|
|
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
|
2005-06-29 04:34:39 +02:00
|
|
|
|
2005-06-29 Kelley Cook <kcook@gcc.gnu.org>
|
|
|
|
|
|
|
|
|
|
* all files: Update FSF address in copyright headers.
|
|
|
|
|
* makeucnid.c (write_copyright): Update outputted FSF address.
|
|
|
|
|
|
2005-06-13 10:26:05 +02:00
|
|
|
|
2005-06-13 Zack Weinberg <zack@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* configure.ac: Invoke ZW_CREATE_DEPDIR and
|
|
|
|
|
ZW_PROG_COMPILER_DEPENDENCIES.
|
|
|
|
|
* aclocal.m4, configure: Regenerate.
|
|
|
|
|
* Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.base, COMPILE):
|
|
|
|
|
New variables.
|
|
|
|
|
(distclean): Clean up $(DEPDIR) and its contents.
|
|
|
|
|
(.c.o): Use $(COMPILE).
|
|
|
|
|
Include $(DEPDIR)/*.Po for most object->header dependencies.
|
|
|
|
|
|
2005-05-28 17:52:48 +02:00
|
|
|
|
2005-05-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
|
|
|
|
|
|
|
|
|
|
* configure.ac: Check declarations for asprintf and vasprintf.
|
|
|
|
|
* config.in: Regenerate.
|
|
|
|
|
* configure: Likewise.
|
|
|
|
|
|
|
|
|
|
* charset.c (conversion_loop): Use XRESIZEVEC.
|
|
|
|
|
(convert_no_conversion): Likewise.
|
|
|
|
|
(convert_using_iconv): Likewise.
|
|
|
|
|
(init_iconv_desc): Cast return value of alloca.
|
|
|
|
|
(cpp_host_to_exec_charset): Use XNEWVEC.
|
|
|
|
|
(emit_numeric_escape): Use XRESIZEVEC.
|
|
|
|
|
(cpp_interpret_string): Use XNEWVEC.
|
|
|
|
|
(cpp_interpret_string): Use XRESIZEVEC.
|
|
|
|
|
(_cpp_interpret_identifier): Cast return value of alloca.
|
|
|
|
|
(_cpp_convert_input): Use XNEWVEC and XRESIZEVEC.
|
|
|
|
|
* directives.c (glue_header_name): Use XNEWVEC and XRESIZEVEC.
|
|
|
|
|
(parse_include): Use XNEWVEC.
|
|
|
|
|
(insert_pragma_entry): Rename local variable "new" to
|
2005-06-13 10:26:05 +02:00
|
|
|
|
"new_entry".
|
2005-05-28 17:52:48 +02:00
|
|
|
|
(save_registered_pragmas): Cast return value of xmemdup.
|
|
|
|
|
(destringize_and_run): Same for alloca.
|
|
|
|
|
(parse_assertion): Likewise.
|
|
|
|
|
(do_assert): Cast allocated storage to proper type.
|
|
|
|
|
(cpp_define): Likewise.
|
|
|
|
|
(_cpp_define_builtin): Likewise.
|
|
|
|
|
(cpp_undef): Likewise.
|
|
|
|
|
(handle_assertion): Likewise.
|
|
|
|
|
(cpp_push_buffer): Rename local variable "new" to "new_buffer".
|
|
|
|
|
* expr.c (CPP_UPLUS): Cast value to type cpp_ttype.
|
|
|
|
|
(CPP_UMINUS): Likewise.
|
|
|
|
|
(struct cpp_operator): Rename from struct operator.
|
|
|
|
|
(_cpp_expand_op_stack): Use XRESIZEVEC.
|
|
|
|
|
* files.c (pch_open_file): Use XNEWVEC.
|
|
|
|
|
(pch_open_file): Use XRESIZEVEC.
|
|
|
|
|
(read_file_guts): Use XNEWVEC and XRESIZEVEC.
|
|
|
|
|
(dir_name_of_file): Use XNEWVEC.
|
|
|
|
|
(make_cpp_file): Use XCNEW.
|
|
|
|
|
(make_cpp_dir): Likewise.
|
|
|
|
|
(allocate_file_hash_entries): USE XNEWVEC.
|
|
|
|
|
(cpp_included): Cast return value of htab_find_with_hash.
|
|
|
|
|
(append_file_to_dir): Use XNEWVEC.
|
|
|
|
|
(read_filename_string): Likewise. Use XRESIZEVEC too.
|
|
|
|
|
(read_name_map): Cast return value of alloca. Use XRESIZEVEC.
|
|
|
|
|
(remap_filename): Use XNEWVEC.
|
|
|
|
|
(struct pchf_entry): Move definition out of struct pchf_data.
|
|
|
|
|
(_cpp_save_file_entries): Use XCNEWVAR.
|
|
|
|
|
(_cpp_read_file_entries): Use XNEWVAR.
|
|
|
|
|
* identifiers.c (alloc_node): Use XOBNEW.
|
|
|
|
|
* init.c (cpp_create_reader): Use XCNEW.
|
|
|
|
|
(cpp_init_builtins): Cast of b->value to enum builtin_type.
|
|
|
|
|
(read_original_directory): Cast return value of alloca.
|
|
|
|
|
* lex.c (add_line_note): Use XRESIZEVEC.
|
|
|
|
|
(warn_about_normalization): Use XNEWVEC.
|
|
|
|
|
(_cpp_lex_direct): Cast node->directive_index to (enum cpp_ttype).
|
|
|
|
|
(new_buff): Use XNEWVEC.
|
|
|
|
|
* line-map.c (linemap_add): Use XRESIZEVEC.
|
|
|
|
|
* macro.c (builtin_macro): Cast return value of alloca.
|
|
|
|
|
(paste_tokens): Likewise.
|
|
|
|
|
(expand_arg): Use XNEWVEC and XRESIZEVEC.
|
|
|
|
|
(_cpp_save_parameter): Use XRESIZEVEC.
|
|
|
|
|
(create_iso_definition): Cast allocated storage to proper type.
|
|
|
|
|
(_cpp_create_definition): Likewise.
|
|
|
|
|
(cpp_macro_definition): Use XRESIZEVEC.
|
|
|
|
|
* makedepend.c (add_clm): Use XNEW.
|
|
|
|
|
(add_dir): Likewise.
|
|
|
|
|
* mkdeps.c (munge): Use XNEWVEC.
|
|
|
|
|
(deps_init): Use XCNEW.
|
|
|
|
|
(deps_add_target): Use XRESIZEVEC.
|
|
|
|
|
(deps_add_default_target): Cast return value of alloca.
|
|
|
|
|
(deps_add_dep): Use XRESIZEVEC.
|
|
|
|
|
(deps_add_vpath): Likewise. Use XNEWVEC too.
|
|
|
|
|
(deps_restore): Likewise.
|
|
|
|
|
* pch.c (save_idents): Use XNEW and XNEWVEC.
|
|
|
|
|
(cpp_save_state): Use XNEW.
|
|
|
|
|
(count_defs): Cast return value of htab_find.
|
|
|
|
|
(write_defs): Likewise.
|
|
|
|
|
(cpp_write_pch_deps): Use XNEWVEC.
|
|
|
|
|
(collect_ht_nodes): Use XRESIZEVEC.
|
|
|
|
|
(cpp_valid_state): Use XNEWVEC.
|
|
|
|
|
(save_macros): Use XRESIZEVEC. Cast return value of xmemdup.
|
|
|
|
|
* symtab.c (ht_create): Use XCNEW.
|
|
|
|
|
(ht_lookup_with_hash): Cast return value of obstack_copy0.
|
|
|
|
|
(ht_expand): Use XCNEWVEC.
|
|
|
|
|
* system.h (HAVE_DESIGNATED_INITIALIZERS): False if __cplusplus.
|
|
|
|
|
(bool): Do not define if __cplusplus.
|
|
|
|
|
|
2005-05-12 20:31:38 +02:00
|
|
|
|
2005-05-12 Zack Weinberg <zack@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* directives.c (#sccs table entry): Mark IN_I, consistent with #ident.
|
|
|
|
|
(do_sccs): Delete function definition, #define to do_ident.
|
|
|
|
|
(do_ident): Don't hardwire directive name.
|
|
|
|
|
|
2005-05-12 14:22:08 +02:00
|
|
|
|
2005-05-12 Ryota Kunisawa <kunisawa@access.co.jp>
|
|
|
|
|
|
|
|
|
|
PR bootstrap/21230
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
|
2005-04-28 04:38:59 +02:00
|
|
|
|
2005-04-27 Andris Pavenis <pavenis@latnet.lv>
|
|
|
|
|
|
|
|
|
|
* files.c: Include io.h for DJGPP to get prototype of setmode.
|
|
|
|
|
|
2005-04-21 19:08:27 +02:00
|
|
|
|
2005-04-19 Per Bothner <per@bothner.com>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/20907
|
|
|
|
|
* line-map.c (linemap_line_start): Fix bug when we need to increse
|
|
|
|
|
column_bits but can re-use the current line_map.
|
|
|
|
|
|
2005-04-19 14:37:08 +02:00
|
|
|
|
2005-04-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
|
|
|
|
|
|
|
|
|
|
* system.h (fopen, fdopen, freopen): Define these to the unlocked
|
|
|
|
|
libiberty functions.
|
|
|
|
|
|
configure.ac (fixincludes_UNLOCKED_FUNCS): New.
fixincludes:
* configure.ac (fixincludes_UNLOCKED_FUNCS): New.
(AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for fixincludes_UNLOCKED_FUNCS.
* system.h (putchar, getc, getchar, clearerr, feof, fileno,
fflush, fgetc, fgets, ferror, fread): Redefine to the associated
_unlocked function.
(fwrite_unlocked): Fix prototype.
* configure, config.h.in: Regenerate.
gcc:
PR/17092
* configure.ac (gcc_UNLOCKED_FUNCS): New.
(AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for gcc_UNLOCKED_FUNCS.
* system.h (putchar, getc, getchar, clearerr, feof, fileno,
fflush, fgetc, fgets, ferror, fread): Redefine to the associated
_unlocked function.
(fwrite_unlocked): Fix prototype.
* configure, config.in: Regenerate.
libcpp:
* configure.ac (libcpp_UNLOCKED_FUNCS): New.
(AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for libcpp_UNLOCKED_FUNCS.
* system.h (putchar, getc, getchar, clearerr, feof, fileno,
fflush, fgetc, fgets, ferror, fread): Redefine to the associated
_unlocked function.
(fwrite_unlocked): Fix prototype.
* configure, config.in: Regenerate.
From-SVN: r97986
2005-04-11 23:46:59 +02:00
|
|
|
|
2005-04-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
|
|
|
|
|
|
|
|
|
|
* configure.ac (libcpp_UNLOCKED_FUNCS): New.
|
|
|
|
|
(AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for libcpp_UNLOCKED_FUNCS.
|
|
|
|
|
* system.h (putchar, getc, getchar, clearerr, feof, fileno,
|
|
|
|
|
fflush, fgetc, fgets, ferror, fread): Redefine to the associated
|
|
|
|
|
_unlocked function.
|
|
|
|
|
(fwrite_unlocked): Fix prototype.
|
2005-05-12 20:31:38 +02:00
|
|
|
|
|
configure.ac (fixincludes_UNLOCKED_FUNCS): New.
fixincludes:
* configure.ac (fixincludes_UNLOCKED_FUNCS): New.
(AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for fixincludes_UNLOCKED_FUNCS.
* system.h (putchar, getc, getchar, clearerr, feof, fileno,
fflush, fgetc, fgets, ferror, fread): Redefine to the associated
_unlocked function.
(fwrite_unlocked): Fix prototype.
* configure, config.h.in: Regenerate.
gcc:
PR/17092
* configure.ac (gcc_UNLOCKED_FUNCS): New.
(AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for gcc_UNLOCKED_FUNCS.
* system.h (putchar, getc, getchar, clearerr, feof, fileno,
fflush, fgetc, fgets, ferror, fread): Redefine to the associated
_unlocked function.
(fwrite_unlocked): Fix prototype.
* configure, config.in: Regenerate.
libcpp:
* configure.ac (libcpp_UNLOCKED_FUNCS): New.
(AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for libcpp_UNLOCKED_FUNCS.
* system.h (putchar, getc, getchar, clearerr, feof, fileno,
fflush, fgetc, fgets, ferror, fread): Redefine to the associated
_unlocked function.
(fwrite_unlocked): Fix prototype.
* configure, config.in: Regenerate.
From-SVN: r97986
2005-04-11 23:46:59 +02:00
|
|
|
|
* configure, config.in: Regenerate.
|
|
|
|
|
|
2005-04-05 22:07:06 +02:00
|
|
|
|
2005-04-05 Jakub Jelinek <jakub@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/19475
|
|
|
|
|
* macro.c (create_iso_definition): For < ISO C99, don't
|
|
|
|
|
pedwarn if there is no whitespace between macro name and its
|
|
|
|
|
replacement, but the replacement starts with a basic character
|
|
|
|
|
set character.
|
|
|
|
|
|
2005-03-28 08:55:47 +02:00
|
|
|
|
2005-03-28 Andreas Jaeger <aj@suse.de>
|
|
|
|
|
|
|
|
|
|
* lex.c (warn_about_normalization): Cast field width to int to
|
|
|
|
|
avoid warning.
|
|
|
|
|
|
2005-03-19 21:19:06 +01:00
|
|
|
|
2005-03-19 Joseph S. Myers <joseph@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* configure.ac: Consistently use solaris2.1[0-9]* instead of
|
|
|
|
|
solaris2.1[0-9].
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
|
2005-03-16 01:59:31 +01:00
|
|
|
|
2005-03-15 Geoffrey Keating <geoffk@apple.com>
|
|
|
|
|
|
|
|
|
|
* charset.c (_cpp_valid_ucn): In identifiers, reject a partial
|
|
|
|
|
UCN rather than printing an error.
|
|
|
|
|
|
2005-03-15 01:36:33 +01:00
|
|
|
|
2005-03-14 Geoffrey Keating <geoffk@apple.com>
|
|
|
|
|
|
2005-03-15 10:55:41 +01:00
|
|
|
|
* lex.c (forms_identifier_p): Disable UCNs in C89 mode.
|
|
|
|
|
|
|
|
|
|
2005-03-14 Geoffrey Keating <geoffk@apple.com>
|
2005-05-12 20:31:38 +02:00
|
|
|
|
|
2005-03-15 01:36:33 +01:00
|
|
|
|
* init.c (cpp_create_reader): Default warn_normalize to normalized_C.
|
|
|
|
|
* charset.c: Update for new format of ucnid.h.
|
|
|
|
|
(ucn_valid_in_identifier): Update for new format of ucnid.h.
|
|
|
|
|
Add NST parameter, and update it; update callers.
|
|
|
|
|
(cpp_valid_ucn): Add NST parameter, update callers. Replace abort
|
|
|
|
|
with cpp_error.
|
|
|
|
|
(convert_ucn): Pass normalize_state to cpp_valid_ucn.
|
|
|
|
|
* internal.h (struct normalize_state): New.
|
|
|
|
|
(INITIAL_NORMALIZE_STATE): New.
|
|
|
|
|
(NORMALIZE_STATE_RESULT): New.
|
|
|
|
|
(NORMALIZE_STATE_UPDATE_IDNUM): New.
|
|
|
|
|
(_cpp_valid_ucn): New.
|
|
|
|
|
* lex.c (warn_about_normalization): New.
|
|
|
|
|
(forms_identifier_p): Add normalize_state parameter, update callers.
|
|
|
|
|
(lex_identifier): Add normalize_state parameter, update callers. Keep
|
|
|
|
|
the state current.
|
|
|
|
|
(lex_number): Likewise.
|
|
|
|
|
(_cpp_lex_direct): Pass normalize_state to subroutines. Check
|
|
|
|
|
it with warn_about_normalization.
|
|
|
|
|
* makeucnid.c: New.
|
|
|
|
|
* ucnid.h: Replace.
|
|
|
|
|
* ucnid.pl: Remove.
|
|
|
|
|
* ucnid.tab: Make appropriate for input to makeucnid.c. Remove
|
|
|
|
|
comments about obsolete version of C++.
|
|
|
|
|
* include/cpplib.h (enum cpp_normalize_level): New.
|
|
|
|
|
(struct cpp_options): Add warn_normalize field.
|
|
|
|
|
|
2005-03-12 11:44:06 +01:00
|
|
|
|
2005-03-11 Geoffrey Keating <geoffk@apple.com>
|
|
|
|
|
|
|
|
|
|
* directives.c (glue_header_name): Update call to cpp_spell_token.
|
|
|
|
|
* internal.h (_cpp_interpret_identifier): New.
|
|
|
|
|
* charset.c (_cpp_interpret_identifier): New.
|
|
|
|
|
(_cpp_valid_ucn): Allow UCN version of '$'.
|
|
|
|
|
* lex.c (lex_identifier): Add extra parameter to indicate if initial
|
|
|
|
|
character was '$' or '\'. Support identifiers with UCNs.
|
|
|
|
|
(forms_identifier_p): Allow UCNs.
|
|
|
|
|
(_cpp_lex_direct): Pass extra parameter to lex_identifier.
|
|
|
|
|
(utf8_to_ucn): New.
|
|
|
|
|
(cpp_spell_token): Add FORSTRING parameter. Use it.
|
|
|
|
|
(cpp_token_as_text): Update call to cpp_spell_token.
|
|
|
|
|
(cpp_output_token): Write UCNs back out.
|
|
|
|
|
(stringify_arg): Update call to cpp_spell_token.
|
|
|
|
|
(paste_tokens): Likewise.
|
|
|
|
|
(cpp_macro_definition): Likewise.
|
|
|
|
|
* macro.c (stringify_arg): Likewise.
|
|
|
|
|
(paste_tokens): Likewise.
|
|
|
|
|
(cpp_macro_definition): Likewise.
|
|
|
|
|
* include/cpplib.h: Add parameter to cpp_spell_token.
|
|
|
|
|
|
2005-03-04 16:33:23 +01:00
|
|
|
|
2005-03-04 Jakub Jelinek <jakub@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR bootstrap/20282
|
|
|
|
|
PR bootstrap/20305
|
|
|
|
|
* macro.c (replace_args, cpp_get_token): Copy whole
|
|
|
|
|
cpp_token_u instead of just cpp_string field from it.
|
|
|
|
|
|
2005-02-28 20:04:19 +01:00
|
|
|
|
2005-02-28 Devang Patel <dpatel@apple.com>
|
|
|
|
|
|
|
|
|
|
* directives.c (do_line): Save sysp early before line table is
|
|
|
|
|
realloc'ed.
|
2005-05-12 20:31:38 +02:00
|
|
|
|
|
2005-02-20 18:01:32 +01:00
|
|
|
|
2005-02-20 Zack Weinberg <zack@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
PR 18785
|
|
|
|
|
* charset.c (LAST_POSSIBLY_BASIC_SOURCE_CHAR): New helper macro.
|
|
|
|
|
(cpp_host_to_exec_charset): New function.
|
|
|
|
|
* include/cpplib.h: Declare cpp_host_to_exec_charset.
|
|
|
|
|
|
2005-02-19 20:48:02 +01:00
|
|
|
|
2005-02-19 Devang Patel <dpatel@apple.com>
|
|
|
|
|
|
|
|
|
|
* charset.c (_cpp_convert_input): Check '\r' before inserting
|
|
|
|
|
'\n' at the end.
|
2005-02-20 18:01:32 +01:00
|
|
|
|
|
2005-02-16 00:18:04 +01:00
|
|
|
|
2005-02-15 Eric Christopher <echristo@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/19077
|
|
|
|
|
* macro.c (cpp_macro_definition): Move handling of whitespace
|
|
|
|
|
to PREV_WHITE conditional. Remove overloading of len
|
|
|
|
|
variable.
|
|
|
|
|
|
2005-02-14 15:43:56 +01:00
|
|
|
|
2005-02-14 Kazu Hirata <kazu@cs.umass.edu>
|
|
|
|
|
|
|
|
|
|
* directives.c, files.c, init.c, internal.h, macro.c, pch.c,
|
|
|
|
|
traditional.c: Update copyright.
|
|
|
|
|
|
2005-02-14 09:52:24 +01:00
|
|
|
|
2005-02-14 Paolo Bonzini <bonzini@gnu.org>
|
|
|
|
|
|
|
|
|
|
PR bootstrap/19818
|
|
|
|
|
* configure.ac: Check for declaration of basename and getopt.
|
|
|
|
|
* config.in: Regenerate.
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
* internal.h (ustrcspn): New.
|
|
|
|
|
* macro.c (create_iso_definition): Fix allocation of memory.
|
|
|
|
|
(padding_token): Add cast to remove const-ness.
|
|
|
|
|
* pch.c (cpp_read_state): Use ustrcspn.
|
|
|
|
|
|
2005-02-09 02:23:56 +01:00
|
|
|
|
2005-02-08 Mike Stump <mrs@apple.com>
|
|
|
|
|
|
|
|
|
|
* files.c (pchf_adder): Remove.
|
|
|
|
|
(struct pchf_adder_info): Likewise.
|
|
|
|
|
(_cpp_save_file_entries): Write out all files so that #import works.
|
|
|
|
|
|
2005-01-23 20:22:01 +01:00
|
|
|
|
2005-01-23 Joseph S. Myers <joseph@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
|
2005-01-11 19:19:56 +01:00
|
|
|
|
2005-01-11 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
|
|
|
|
|
|
|
|
|
|
* include/cpplib.h (c_lang): Fix comment to say cpp_create_reader.
|
|
|
|
|
|
2005-01-11 19:24:12 +01:00
|
|
|
|
* include/cpplib.h: Also update copyright years.
|
2005-02-20 18:01:32 +01:00
|
|
|
|
|
2005-01-04 03:13:56 +01:00
|
|
|
|
2005-01-03 Geoffrey Keating <geoffk@apple.com>
|
|
|
|
|
|
|
|
|
|
* files.c (_cpp_find_file): Add files found by search_path_exhausted
|
|
|
|
|
to the list of all files.
|
|
|
|
|
|
2005-01-02 02:32:21 +01:00
|
|
|
|
2005-01-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
|
|
|
|
|
|
|
|
|
|
* internal.h: Update references to Cpp lib filenames.
|
|
|
|
|
* directives.c: Likewise.
|
|
|
|
|
* init.c: Likewise.
|
|
|
|
|
* macro.c: Likewise.
|
|
|
|
|
* traditional.c: Likewise.
|
|
|
|
|
|
2004-12-15 14:31:28 +01:00
|
|
|
|
2004-12-15 Eric Botcazou <ebotcazou@libertysurf.fr>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/15167
|
|
|
|
|
* files.c (destroy_cpp_file): New function.
|
|
|
|
|
(should_stack_file): Make a new file if the
|
|
|
|
|
compared file is still stacked.
|
|
|
|
|
|
2004-11-28 23:28:13 +01:00
|
|
|
|
2004-11-28 Nathanael Nerode <neroden@gcc.gnu.org>
|
|
|
|
|
|
2005-02-20 18:01:32 +01:00
|
|
|
|
PR preprocessor/17610
|
2004-11-28 23:28:13 +01:00
|
|
|
|
* directives.c (do_include_common): Error out if an empty filename
|
|
|
|
|
is given for #include (or #include_next or #import).
|
|
|
|
|
|
2004-11-27 22:59:38 +01:00
|
|
|
|
2004-11-27 Roger Sayle <roger@eyesopen.com>
|
|
|
|
|
Zack Weinberg <zack@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* internal.h: Replace all uses of uchar with unsigned char.
|
|
|
|
|
* include/cpp-id-data.h: Likewise. Guard typedef of uchar
|
|
|
|
|
with !IN_GCC, so uchar is only defined whilst building libcpp.
|
|
|
|
|
|
2004-11-24 22:53:28 +01:00
|
|
|
|
2004-11-24 Kelley Cook <kcook@gcc.gnu.org>
|
|
|
|
|
|
|
|
|
|
* aclocal.m4: Regenerate.
|
|
|
|
|
|
2004-11-24 15:00:38 +01:00
|
|
|
|
2004-11-24 Roger Sayle <roger@eyesopen.com>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/15824
|
|
|
|
|
* configure.ac: Correct HAVE_UCHAR test to #include <sys/types.h>
|
|
|
|
|
directly, instead of the non-existant "system.h" and "ansidecl.h".
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
|
2004-11-24 00:25:40 +01:00
|
|
|
|
2004-11-23 Daniel Jacobowitz <dan@codesourcery.com>
|
2005-02-20 18:01:32 +01:00
|
|
|
|
Joseph Myers <joseph@codesourcery.com>
|
2004-11-24 00:25:40 +01:00
|
|
|
|
|
|
|
|
|
* internal.h (struct lexer_state): Add in_deferred_pragma.
|
|
|
|
|
* directives.c (struct pragma_entry): Add allow_expansion.
|
|
|
|
|
(insert_pragma_entry): Take allow_expansion flag.
|
|
|
|
|
(register_pragma): Likewise.
|
|
|
|
|
(cpp_register_pragma): Likewise.
|
|
|
|
|
(_cpp_init_internal_pragmas): Update calls to cpp_register_pragma.
|
|
|
|
|
(do_pragma): Honor allow_expansion.
|
|
|
|
|
(cpp_handle_deferred_pragma): Set in_deferred_pragma.
|
|
|
|
|
* include/cpplib.h (cpp_register_pragma): Update prototype.
|
|
|
|
|
|
2004-11-18 02:07:18 +01:00
|
|
|
|
2004-11-18 Daniel Jacobowitz <dan@codesourcery.com>
|
2005-02-20 18:01:32 +01:00
|
|
|
|
Mark Mitchell <mark@codesourcery.com>
|
2004-11-18 02:07:18 +01:00
|
|
|
|
|
|
|
|
|
* configure.ac (i[34567]86-*-solaris2.1[0-9]*): Set
|
|
|
|
|
need_64bit_hwint=yes.
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
|
2004-11-09 22:58:43 +01:00
|
|
|
|
2004-11-09 Joseph S. Myers <joseph@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* Makefile.in ($(PACKAGE).pot): New rule. Depend on
|
|
|
|
|
po/$(PACKAGE).pot.
|
|
|
|
|
(po/$(PACKAGE).pot): Use ":" instead of "," in --keyword
|
|
|
|
|
arguments. Add keywords _, N_, SYNTAX_ERROR and SYNTAX_ERROR2.
|
|
|
|
|
Remove local srcdir path from generated file.
|
|
|
|
|
|
2004-11-04 21:35:08 +01:00
|
|
|
|
2004-11-04 Zack Weinberg <zack@codesourcery.com>
|
2005-02-20 18:01:32 +01:00
|
|
|
|
Gerald Pfeifer <gerald@pfeifer.com>
|
2004-11-04 21:35:08 +01:00
|
|
|
|
|
|
|
|
|
* internal.h (HAVE_ICONV): Undefine if we do not have HAVE_ICONV_H
|
|
|
|
|
as well.
|
|
|
|
|
|
2004-10-27 19:29:29 +02:00
|
|
|
|
2004-10-27 Zack Weinberg <zack@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
PR 18075
|
|
|
|
|
* directives.c (do_pragma): Do not defer pragmas which are unknown.
|
|
|
|
|
(cpp_handle_deferred_pragma): Add cast to silence warning.
|
|
|
|
|
|
2004-10-14 02:56:22 +02:00
|
|
|
|
2004-10-14 Joseph S. Myers <jsm@polyomino.org.uk>
|
|
|
|
|
|
|
|
|
|
* errors.c (_cpp_begin_message): Print "error: " for errors.
|
|
|
|
|
|
2004-10-11 07:19:48 +02:00
|
|
|
|
2004-10-10 Andreas Jaeger <aj@suse.de>
|
|
|
|
|
|
|
|
|
|
* makedepend.c: Include mkdeps.h for prototype of deps_add_vpath.
|
|
|
|
|
* Makefile.in (makedepend.o): Add dependency on mkdeps.h.
|
|
|
|
|
|
2004-10-08 14:50:12 +02:00
|
|
|
|
2004-10-08 Andrew Pinski <pinskia@physics.uc.edu>
|
|
|
|
|
|
|
|
|
|
* pch.c (cpp_write_pch_state): Remove variable z as it is not
|
|
|
|
|
used.
|
|
|
|
|
(cpp_read_state): Remove unused variables, m, d and mac_count.
|
|
|
|
|
|
2004-09-30 03:19:46 +02:00
|
|
|
|
2004-09-29 Per Bothner <per@bothner.com>
|
|
|
|
|
|
|
|
|
|
* directives.c (cpp_handle_deferred_pragma): Save, clear and restore
|
|
|
|
|
cb.line_change. Otherwise do_pragma will call the line_change
|
|
|
|
|
call-back with a meaningless line number.
|
|
|
|
|
|
2004-09-24 23:39:06 +02:00
|
|
|
|
2004-09-24 Zack Weinberg <zack@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* configure.ac: Move AC_PROG_MAKE_SET, AC_PROG_INSTALL to
|
|
|
|
|
programs cluster. Use ACX_PROG_CC_WARNING_OPTS,
|
|
|
|
|
ACX_PROG_CC_WARNING_ALMOST_PEDANTIC, ACX_PROG_CC_WARNINGS_ARE_ERRORS.
|
|
|
|
|
* aclocal.m4, configure: Regenerate.
|
|
|
|
|
* init.c: Include localedir.h.
|
|
|
|
|
* Makefile.in (WARN_CFLAGS, ALL_CFLAGS): New variables.
|
|
|
|
|
(DEFS): Delete.
|
|
|
|
|
(.c.o): Use $(ALL_CFLAGS).
|
|
|
|
|
(localedir.h, localedir.hs): New rules.
|
|
|
|
|
(clean): Use rm -rf to remove directories.
|
|
|
|
|
(distclean): Also delete localedir.h and localedir.hs.
|
|
|
|
|
(init.o): Update dependencies.
|
|
|
|
|
|
gettext-sister.m4: Renamed from gettext.m4
config/
2004-09-22 Kelley Cook <kcook@gcc.gnu.org>
* gettext-sister.m4: Renamed from gettext.m4
* codeset.m4, gettext.m4, glibc21.m4, iconv.m4, intdiv0.m4, po.m4,
inttypes.m4, inttypes-pri.m4, inttypes_h.m4, lcmessage.m4, lib-ld.m4,
lib-link.m4, lib-prefix.m4, nls.m4, progtest.m4, stdint_h.m4,
uintmax_t.m4, ulonglong.m4: Import from gettext-0.12.1 sources.
gcc/
2004-09-22 Kelley Cook <kcook@gcc.gnu.org>
* aclocal.m4: Update for rename of gettext-sister.m4.
libcpp/
2004-09-22 Kelley Cook <kcook@gcc.gnu.org>
* Makefile.in (aclocal.m4): Update dependencies.
* configure.ac (AC_CONFIG_MACRO_DIR): New.
* aclocal.m4, configure: Regenerate.
intl/
2004-09-22 Kelley Cook <kcook@gcc.gnu.org>
* configure.ac (AC_CONFIG_MACRO_DIR): New.
(ACLOCAL, AUTOCONF, AUTOHEADER, MAINT): Substitute.
* Makefile.in: Update with maintainer mode rules.
* README: Update aclocal regeneration instructions.
* aclocal.m4, configure: Regenerate.
From-SVN: r87900
2004-09-23 01:53:59 +02:00
|
|
|
|
2004-09-22 Kelley Cook <kcook@gcc.gnu.org>
|
|
|
|
|
|
|
|
|
|
* Makefile.in (aclocal.m4): Update dependencies.
|
|
|
|
|
* configure.ac (AC_CONFIG_MACRO_DIR): New.
|
|
|
|
|
* aclocal.m4, configure: Regenerate.
|
|
|
|
|
|
2004-09-18 02:53:50 +02:00
|
|
|
|
2004-09-17 Zack Weinberg <zack@codesourcery.com>
|
|
|
|
|
|
2004-09-18 02:56:19 +02:00
|
|
|
|
* charset.c (_cpp_destroy_iconv, emit_numeric_escape)
|
|
|
|
|
(_cpp_convert_input, _cpp_default_encoding): Add comments.
|
|
|
|
|
Some other comments in this file also tweaked.
|
|
|
|
|
|
2004-09-18 02:53:50 +02:00
|
|
|
|
* directives.c (do_pragma): Save current buffer position
|
|
|
|
|
before lexing the pragma keywords; don't call
|
|
|
|
|
_cpp_backup_tokens in the defer_pragmas case.
|
|
|
|
|
|
2004-09-15 21:39:22 +02:00
|
|
|
|
2004-09-15 Per Bothner <per@bothner.com>
|
|
|
|
|
|
|
|
|
|
* include/line-map.h (line_map_start): Add parameter names so
|
|
|
|
|
preceding comment makes sense.
|
|
|
|
|
(linemap_add): Remove from comment mention of non-existing parameter.
|
|
|
|
|
|
2004-09-09 21:16:56 +02:00
|
|
|
|
2004-09-09 Matt Austern <austern@apple.com>
|
|
|
|
|
Zack Weinberg <zack@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* include/cpplib.h (TTYPE_TABLE): Remove CPP_ and SPELL_
|
|
|
|
|
prefixes throughout. Add entry for PRAGMA. Remove
|
|
|
|
|
unnecessary "= 0" from EQ.
|
|
|
|
|
(enum cpp_ttype): Adjust OP and TK definitions to restore
|
|
|
|
|
prefixes, via token-paste.
|
|
|
|
|
(CPP_LAST_EQ, CPP_FIRST_DIGRAPH, CPP_LAST_PUNCTUATOR, CPP_LAST_CPP_OP):
|
|
|
|
|
Change from #defines to additional cpp_ttype enumerators.
|
|
|
|
|
(struct cpp_options): Add defer_pragmas.
|
|
|
|
|
(cpp_handle_deferred_pragma): Prototype new interface.
|
|
|
|
|
|
|
|
|
|
* internal.h (struct cpp_reader): Add directive_result.
|
|
|
|
|
* directives.c (struct pragma_entry): Add is_internal field;
|
|
|
|
|
give boolean fields type bool.
|
|
|
|
|
(start_directive): Initialize pfile->directive_result.type.
|
|
|
|
|
(_cpp_do__Pragma): Likewise.
|
|
|
|
|
(run_directive): Do not crash if pfile->buffer->prev is NULL.
|
|
|
|
|
(insert_pragma_entry): Add 'internal' argument; set new->is_internal
|
|
|
|
|
from it.
|
|
|
|
|
(register_pragma): New static function, bulk of former
|
|
|
|
|
cpp_register_pragma here; add 'internal' argument, pass along
|
|
|
|
|
to insert_pragma_entry.
|
|
|
|
|
(cpp_register_pragma): Now a wrapper around register_pragma which
|
|
|
|
|
always passes false for 'internal' argument.
|
|
|
|
|
(_cpp_init_internal_pragmas): Call register_pragma directly, passing
|
|
|
|
|
true for 'internal'.
|
|
|
|
|
(do_pragma): If CPP_OPTION (pfile, defer_pragmas) and this isn't
|
|
|
|
|
an internal pragma, save text till the end of the line as a CPP_PRAGMA
|
|
|
|
|
token instead of executing the pragma.
|
|
|
|
|
(cpp_handle_deferred_pragma): New interface.
|
|
|
|
|
* lex.c (token_spellings): Adjust OP and TK definitions to
|
|
|
|
|
match changes to cpplib.h.
|
|
|
|
|
(_cpp_lex_token): Check for a directive-result token and
|
|
|
|
|
return it if present.
|
|
|
|
|
(cpp_token_val_index): Handle CPP_PRAGMA.
|
|
|
|
|
* macro.c (cpp_builtin_macro_text): Correct comment.
|
|
|
|
|
(builtin_macro): Handle directive-result tokens from _cpp_do__Pragma.
|
|
|
|
|
|
2004-09-06 15:22:48 +02:00
|
|
|
|
2004-09-06 Serge Belyshev <belyshev@lubercy.com>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/14699
|
|
|
|
|
* symtab.c (ht_dump_statistics): Change type of sum_of_squares
|
|
|
|
|
from size_t to double.
|
|
|
|
|
|
2004-08-28 20:04:17 +02:00
|
|
|
|
2004-08-28 Andreas Schwab <schwab@suse.de>
|
|
|
|
|
Andreas Jaeger <aj@suse.de>
|
|
|
|
|
|
|
|
|
|
* configure.ac: Set PACKAGE correctly.
|
|
|
|
|
* configure: Regenerated.
|
|
|
|
|
|
2004-08-25 14:57:05 +02:00
|
|
|
|
2004-08-25 Paolo Bonzini <bonzini@gnu.org>
|
|
|
|
|
|
|
|
|
|
* Makefile.in: Add back top_builddir.
|
|
|
|
|
|
2004-08-25 10:10:02 +02:00
|
|
|
|
2004-08-25 Paolo Bonzini <bonzini@gnu.org>
|
|
|
|
|
|
|
|
|
|
* configure.ac: Replace Automake macro invocations
|
|
|
|
|
with manual Autoconf checks and substitutions.
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
* aclocal.m4: Regenerate.
|
|
|
|
|
* config.in: Regenerate.
|
|
|
|
|
* Makefile.am: Removed.
|
|
|
|
|
* Makefile.in: Heavy simplification and reorganization.
|
|
|
|
|
|
2004-08-11 04:50:14 +02:00
|
|
|
|
2004-08-09 Mark Mitchell <mark@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* configure.ac (arm*-*-eabi*): New target.
|
|
|
|
|
(arm*-*-symbianelf*): Likewise.
|
|
|
|
|
* configure: Regenerated.
|
|
|
|
|
|
2004-07-24 20:04:42 +02:00
|
|
|
|
2004-07-24 Bernardo Innocenti <bernie@develer.com>
|
|
|
|
|
|
|
|
|
|
* internal.h (xnew, xcnew, xnewvec, xcnewvec, xobnew): Remove.
|
|
|
|
|
* directives.c: Use XNEW-family macros from libiberty.
|
|
|
|
|
* lex.c: Likewise.
|
|
|
|
|
* macro.c: Likewise.
|
|
|
|
|
* cpplib.h (cpp_deps_style): Export enum with name.
|
|
|
|
|
|
2004-09-09 21:16:56 +02:00
|
|
|
|
2004-07-23 Matthias Klose <doko@debian.org>
|
2004-07-24 20:04:42 +02:00
|
|
|
|
|
2004-09-09 21:16:56 +02:00
|
|
|
|
* init.c (init_library): Use PACKAGE for the text domain.
|
2004-07-23 09:00:57 +02:00
|
|
|
|
|
2004-07-16 19:07:01 +02:00
|
|
|
|
2004-07-16 Andris Pavenis <pavenis@latnet.lv>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/16366
|
|
|
|
|
* internal.h (struct cpp_reader): New field dir_hash.
|
|
|
|
|
* files.c (make_cpp_dir): Use dir_hash, not file_hash.
|
|
|
|
|
(_cpp_init_files, _cpp_cleanup_files): Update for new field.
|
|
|
|
|
|
2004-07-04 14:57:50 +02:00
|
|
|
|
2004-07-04 Neil Booth <neil@duron.akihabara.co.uk>
|
|
|
|
|
|
|
|
|
|
PR preprocessor/16192
|
|
|
|
|
PR preprocessor/15913
|
|
|
|
|
PR preprocessor/15572
|
|
|
|
|
* expr.c (_cpp_parse_expr): Handle remaining cases where an
|
|
|
|
|
expression is missing.
|
|
|
|
|
* init.c (post_options): Traditional cpp doesn't do // comments.
|
|
|
|
|
|
2004-06-30 20:35:18 +02:00
|
|
|
|
2004-06-30 Per Bothner <per@bothner.com>
|
|
|
|
|
|
|
|
|
|
* include/line-map.h (fileline): Remove old typedef.
|
|
|
|
|
* internal.h (struct cpp_reader): Use source_location typedef instead.
|
|
|
|
|
|
2004-06-26 19:39:40 +02:00
|
|
|
|
2004-06-26 Zack Weinberg <zack@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
Partially revert patch of 2004-06-05.
|
|
|
|
|
* files.c (search_cache): Remove pfile argument. Don't check
|
|
|
|
|
for file that would be found by "" or <> search here...
|
|
|
|
|
(_cpp_find_file): ...do it here, before calling find_file_in_dir.
|
|
|
|
|
Do not apply directory-of-current-file correction to files
|
|
|
|
|
found by this check. Rearrange code slightly.
|
|
|
|
|
|
2004-06-22 08:51:56 +02:00
|
|
|
|
2004-06-21 Geoffrey Keating <geoffk@apple.com>
|
|
|
|
|
|
|
|
|
|
* files.c (should_stack_file): Correct swapped parameters to call
|
|
|
|
|
to cb.read_pch.
|
|
|
|
|
* pch.c (cpp_valid_state): Handle -fpreprocessed.
|
|
|
|
|
|
2004-06-15 09:32:58 +02:00
|
|
|
|
2004-06-15 Paolo Bonzini <bonzini@gnu.org>
|
|
|
|
|
|
|
|
|
|
* Makefile.in: Regenerate with automake 1.8.5.
|
|
|
|
|
* aclocal.m4: Likewise.
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
|
2004-06-12 07:53:54 +02:00
|
|
|
|
2004-06-11 Zack Weinberg <zack@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* configure.ac: Don't invoke ACX_HEADER_STDBOOL.
|
|
|
|
|
* configure, config.in: Regenerate.
|
|
|
|
|
* system.h: Unconditionally define bool as unsigned char,
|
|
|
|
|
BOOL_BITFIELD as unsigned int.
|
|
|
|
|
* .cvsignore: New file.
|
|
|
|
|
|
2004-06-09 22:10:13 +02:00
|
|
|
|
2004-06-09 Geoffrey Keating <geoffk@apple.com>
|
|
|
|
|
|
|
|
|
|
* traditional.c (push_replacement_text): Set macro->traditional.
|
|
|
|
|
(save_replacement_text): Likewise.
|
|
|
|
|
* pch.c (cpp_write_pch_state): Don't write list of defined macros.
|
|
|
|
|
(struct save_macro_item): Delete.
|
|
|
|
|
(struct save_macro_data): Use a character array not the previous
|
|
|
|
|
structured format.
|
|
|
|
|
(save_macros): Save macro as text not as internal structures.
|
|
|
|
|
(cpp_prepare_state): Update for changes to save_macro_data.
|
|
|
|
|
(cpp_read_state): Don't read macros defined in PCH. Restore
|
2004-06-11 20:07:12 +02:00
|
|
|
|
-D macros as text.
|
2004-06-09 22:10:13 +02:00
|
|
|
|
* macro.c (create_iso_definition): Honour alloc_subobject.
|
|
|
|
|
Clear traditional flag.
|
|
|
|
|
(_cpp_create_definition): Honour alloc_subobject.
|
|
|
|
|
* lex.c (cpp_token_val_index): New.
|
|
|
|
|
* internal.h: Include cpp-id-data.h.
|
|
|
|
|
(uchar): Move definition to cpp-id-data.h.
|
|
|
|
|
(U): Likewise.
|
|
|
|
|
(cpp_macro): Likewise.
|
|
|
|
|
* directives.c (struct answer): Move to cpp-id-data.h.
|
|
|
|
|
(do_assert): Honour alloc_subobject.
|
2004-06-11 20:07:12 +02:00
|
|
|
|
|
|
|
|
|
* include/symtab.h (struct ht): Add field 'alloc_subobject'.
|
|
|
|
|
* include/cpplib.h (struct cpp_string): Add GTY marker.
|
|
|
|
|
(enum cpp_token_fld_kind): New.
|
|
|
|
|
(struct cpp_token): Add GTY markers.
|
|
|
|
|
(cpp_token_val_index): Prototype.
|
|
|
|
|
(CPP_HASHNODE_VALUE_IDX): New.
|
|
|
|
|
(struct cpp_hashnode): Don't skip fields of 'value' when marking.
|
|
|
|
|
* include/cpp-id-data.h: New file.
|
2004-06-09 22:10:13 +02:00
|
|
|
|
|
2004-06-09 11:07:11 +02:00
|
|
|
|
2004-06-09 Paolo Bonzini <bonzini@gnu.org>
|
|
|
|
|
|
|
|
|
|
* Makefile.am (all-local): New.
|
|
|
|
|
* Makefile.in: Regenerate.
|
|
|
|
|
|
2004-06-07 07:18:36 +02:00
|
|
|
|
2004-06-06 Roger Sayle <roger@eyesopen.com>
|
|
|
|
|
|
|
|
|
|
* Makefile.am (LIBICONV): Declare.
|
|
|
|
|
(makedepend_LDADD): Use LIBICONV.
|
|
|
|
|
* Makefile.in: Regenerate.
|
|
|
|
|
|
2004-06-06 06:23:01 +02:00
|
|
|
|
2004-06-05 Andrew Pinski <pinskia@physics.uc.edu>
|
|
|
|
|
|
|
|
|
|
* Makefile.am (LIBINTL): Declare
|
|
|
|
|
(makedepend_LDADD): Use LIBINTL.
|
|
|
|
|
* Makefile.in: Regenerate.
|
|
|
|
|
|
2004-06-05 22:58:06 +02:00
|
|
|
|
2004-06-05 Zack Weinberg <zack@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* Makefile.am: Add makedepend.
|
|
|
|
|
* Makefile.in, aclocal.m4: Regenerate.
|
|
|
|
|
* charset.c: Insert a space to avoid a warning.
|
|
|
|
|
* directives.c: Include mkdeps.h.
|
|
|
|
|
(_cpp_handle_directive): Reenable macro expander if appropriate.
|
|
|
|
|
(undefine_macros): Inline body of _cpp_free_definition for speed.
|
|
|
|
|
Do not call undef callback or _cpp_warn_if_unused_macro.
|
|
|
|
|
(cpp_get_deps): New interface.
|
|
|
|
|
* files.c (search_cache): Add pfile argument. Check for file
|
|
|
|
|
that would be found by "" or <> search here...
|
|
|
|
|
(_cpp_find_file): ...not here. Correct recorded start_dir of
|
|
|
|
|
files found by directory-of-current-file search that would be
|
|
|
|
|
found by "" or <> search.
|
|
|
|
|
* init.c (cpp_add_dependency_target): Delete.
|
|
|
|
|
* internal.h (struct lexer_state): Add discarding_output flag.
|
|
|
|
|
* lex.c (lex_identifier): Compute hash function while scanning.
|
|
|
|
|
* macro.c (cpp_scan_nooutput): Disable macro expansion outside
|
|
|
|
|
directives.
|
|
|
|
|
* makedepend.c: New file.
|
|
|
|
|
* mkdeps.c (struct deps): Add vpath vector.
|
|
|
|
|
(apply_vpath, deps_add_vpath): New function.
|
|
|
|
|
(deps_free): Free vpath vector.
|
|
|
|
|
(deps_add_dep, deps_add_target): Use apply_vpath.
|
|
|
|
|
* symtab.c (calc_hash): Use HT_HASHSTEP and HT_FINISH.
|
|
|
|
|
(ht_lookup_with_hash): New function.
|
|
|
|
|
* cpplib.h, mkdeps.h: Update prototypes.
|
|
|
|
|
* symtab.h: Update prototypes.
|
|
|
|
|
(HT_HASHSTEP, HT_FINISH): New macros.
|
|
|
|
|
|
2004-05-30 02:49:06 +02:00
|
|
|
|
2004-05-29 Geoffrey Keating <geoffk@apple.com>
|
|
|
|
|
|
|
|
|
|
* symtab.c (ht_create): Set entries_owned.
|
|
|
|
|
(ht_destroy): Honour entries_owned.
|
|
|
|
|
(ht_expand): Likewise.
|
|
|
|
|
(ht_load): New.
|
2004-06-11 20:07:12 +02:00
|
|
|
|
* include/symtab.h (struct ht): New field 'entries_owned'
|
|
|
|
|
(ht_load): New prototype.
|
2004-05-30 02:49:06 +02:00
|
|
|
|
|
2004-05-26 08:58:53 +02:00
|
|
|
|
2004-05-26 Paolo Bonzini <bonzini@gnu.org>
|
|
|
|
|
|
|
|
|
|
PR bootstrap/15651
|
|
|
|
|
* configure.ac: Fix m4 quoting when picking
|
|
|
|
|
the size of HOST_WIDE_INT.
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
|
2004-05-25 08:14:37 +02:00
|
|
|
|
2004-05-25 Paolo Bonzini <bonzini@gnu.org>
|
|
|
|
|
|
|
|
|
|
* Makefile.am: the correct directory for
|
|
|
|
|
gettext include files is given by @INCINTL@.
|
|
|
|
|
* Makefile.in: Regenerate.
|
|
|
|
|
|
2004-05-24 17:04:09 +02:00
|
|
|
|
2004-05-24 Paolo Bonzini <bonzini@gnu.org>
|
|
|
|
|
|
|
|
|
|
* system.h [!ENABLE_NLS]: dgettext takes two
|
|
|
|
|
parameters.
|
|
|
|
|
|
2004-05-24 12:50:45 +02:00
|
|
|
|
2004-05-23 Paolo Bonzini <bonzini@gnu.org>
|
|
|
|
|
|
|
|
|
|
Moved libcpp from the gcc subdirectory to the toplevel.
|
|
|
|
|
* Makefile.am: New file.
|
|
|
|
|
* Makefile.in: Regenerate.
|
|
|
|
|
* configure.ac: New file.
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
* config.in: Regenerate.
|
|
|
|
|
* charset.c: Moved from gcc/cppcharset.c. Add note about
|
|
|
|
|
brokenness of input charset detection. Adjust for change
|
|
|
|
|
in name of cppucnid.h.
|
|
|
|
|
* errors.c: Moved from gcc/cpperror.c. Do not include intl.h.
|
|
|
|
|
* expr.c: Moved from gcc/cppexp.c.
|
|
|
|
|
* files.c: Moved from gcc/cppfiles.c. Do not include intl.h.
|
|
|
|
|
Remove #define of O_BINARY, it is in system.h.
|
|
|
|
|
* identifiers.c: Moved from gcc/cpphash.c.
|
|
|
|
|
* internal.h: Moved from gcc/cpphash.h. Change header
|
|
|
|
|
guard name. All other files adjusted to match name change.
|
|
|
|
|
* init.c: Moved from gcc/cppinit.c.
|
|
|
|
|
(init_library) [ENABLE_NLS]: Call bindtextdomain.
|
|
|
|
|
* lex.c: Moved from gcc/cpplex.c.
|
|
|
|
|
* directives.c: Moved from gcc/cpplib.c.
|
|
|
|
|
* macro.c: Moved from gcc/cppmacro.c.
|
|
|
|
|
* pch.c: Moved from gcc/cpppch.c. Do not include intl.h.
|
|
|
|
|
* traditional.c: Moved from gcc/cpptrad.c.
|
|
|
|
|
* ucnid.h: Moved from gcc/cppucnid.h. Change header
|
|
|
|
|
guard name.
|
|
|
|
|
* ucnid.pl: Moved from gcc/cppucnid.pl.
|
|
|
|
|
* ucnid.tab: Moved from gcc/cppucnid.tab. Change header
|
|
|
|
|
guard name.
|
|
|
|
|
* symtab.c: Moved from gcc/hashtable.c.
|
|
|
|
|
* line-map.c: Moved from gcc. Do not include intl.h.
|
|
|
|
|
* mkdeps.c: Moved from gcc.
|
|
|
|
|
* system.h: New file.
|
2004-06-11 20:07:12 +02:00
|
|
|
|
* include/cpplib.h: Moved from gcc. Change header guard name.
|
|
|
|
|
* include/line-map.h: Moved from gcc. Change header guard name.
|
|
|
|
|
* include/mkdeps.h: Moved from gcc. Change header guard name.
|
|
|
|
|
* include/symtab.h: Moved from gcc/hashtable.h. Change header
|
|
|
|
|
guard name.
|
2016-01-04 15:30:50 +01:00
|
|
|
|
|
2020-01-01 12:51:42 +01:00
|
|
|
|
Copyright (C) 2004-2020 Free Software Foundation, Inc.
|
2016-01-04 15:30:50 +01:00
|
|
|
|
|
|
|
|
|
Copying and distribution of this file, with or without modification,
|
|
|
|
|
are permitted in any medium without royalty provided the copyright
|
|
|
|
|
notice and this notice are preserved.
|