diff options
author | Nathan Sidwell <nathan@gcc.gnu.org> | 2018-08-17 19:57:46 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2018-08-17 19:57:46 +0000 |
commit | aa47c164cfe5c452f1f53763a8aac4221929a091 (patch) | |
tree | 9647a4f3a81e2f44297577941828b89959c4c440 | |
parent | 33cec993eac1fb2a3a996612d31b072a922160d9 (diff) | |
parent | 10f04917abbc42e3717d33d9b5079aa4f9eb9ac5 (diff) | |
download | gcc-aa47c164cfe5c452f1f53763a8aac4221929a091.zip gcc-aa47c164cfe5c452f1f53763a8aac4221929a091.tar.gz gcc-aa47c164cfe5c452f1f53763a8aac4221929a091.tar.bz2 |
Merge trunk r263622.
From-SVN: r263634
-rw-r--r-- | ChangeLog.name-lookup | 2 | ||||
-rw-r--r-- | gcc/c-family/ChangeLog | 2 | ||||
-rw-r--r-- | gcc/cp/decl.c | 7 | ||||
-rw-r--r-- | gcc/cp/error.c | 2 | ||||
-rw-r--r-- | gcc/cp/pt.c | 4 | ||||
-rw-r--r-- | libcc1/libcp1plugin.cc | 1 | ||||
-rw-r--r-- | libcpp/ChangeLog | 23 | ||||
-rw-r--r-- | libcpp/include/line-map.h | 2 | ||||
-rw-r--r-- | libcpp/line-map.c | 11 | ||||
-rw-r--r-- | libcpp/macro.c | 4 |
10 files changed, 35 insertions, 23 deletions
diff --git a/ChangeLog.name-lookup b/ChangeLog.name-lookup index f0d63eb..42f9135 100644 --- a/ChangeLog.name-lookup +++ b/ChangeLog.name-lookup @@ -1,5 +1,7 @@ 2018-08-17 Nathan Sidwell <nathan@acm.org> + Merge trunk r263622. + Merge trunk r263618. 2018-08-16 Nathan Sidwell <nathan@acm.org> diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 93b1ba1..6ad2fe0 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,5 +1,7 @@ 2018-08-17 Nathan Sidwell <nathan@acm.org> + * c-ada-spec.c (macro_length, dump_ada_macros): Constify. + * c-ada-spec.c: Don't #include "cpp-id-data.h" * c-cppbuiltin.c: Likewise. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 84fcd7a..fa58bc4 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -12158,8 +12158,7 @@ grokdeclarator (const cp_declarator *declarator, if (ctype && TREE_CODE (type) == FUNCTION_TYPE && staticp < 2 && !(identifier_p (unqualified_id) - && IDENTIFIER_OVL_OP_P (unqualified_id) - && (IDENTIFIER_OVL_OP_FLAGS (unqualified_id) & OVL_OP_FLAG_ALLOC))) + && IDENTIFIER_NEWDEL_OP_P (unqualified_id))) { cp_cv_quals real_quals = memfn_quals; if (cxx_dialect < cxx14 && constexpr_p @@ -12274,9 +12273,7 @@ grokdeclarator (const cp_declarator *declarator, if (virtualp && identifier_p (unqualified_id) - && IDENTIFIER_OVL_OP_P (unqualified_id) - && (IDENTIFIER_OVL_OP_FLAGS (unqualified_id) - & OVL_OP_FLAG_ALLOC)) + && IDENTIFIER_NEWDEL_OP_P (unqualified_id)) { error_at (declspecs->locations[ds_virtual], "%qD cannot be declared %<virtual%>, since it " diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 4a2d2f6..355a5e8 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -2223,7 +2223,7 @@ dump_expr (cxx_pretty_printer *pp, tree t, int flags) case INIT_EXPR: case MODIFY_EXPR: - dump_binary_op (pp, ovl_op_info[1][OVL_OP_NOP_EXPR].name, t, flags); + dump_binary_op (pp, OVL_OP_INFO (true, NOP_EXPR)->name, t, flags); break; case PLUS_EXPR: diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 6afaa16..cbb7b8e 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -5520,9 +5520,7 @@ push_template_decl_real (tree decl, bool is_friend) error ("destructor %qD declared as member template", decl); return error_mark_node; } - if (IDENTIFIER_OVL_OP_P (DECL_NAME (decl)) - && (IDENTIFIER_OVL_OP_FLAGS (DECL_NAME (decl)) - & OVL_OP_FLAG_ALLOC) + if (IDENTIFIER_NEWDEL_OP_P (DECL_NAME (decl)) && (!prototype_p (TREE_TYPE (decl)) || TYPE_ARG_TYPES (TREE_TYPE (decl)) == void_list_node || !TREE_CHAIN (TYPE_ARG_TYPES (TREE_TYPE (decl))) diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc index 6467a86..1034147 100644 --- a/libcc1/libcp1plugin.cc +++ b/libcc1/libcp1plugin.cc @@ -1405,6 +1405,7 @@ plugin_build_decl (cc1_plugin::connection *self, DECL_DECLARED_INLINE_P (decl) = 1; DECL_INITIAL (decl) = error_mark_node; } + if (ctor) DECL_CXX_CONSTRUCTOR_P (decl) = 1; else if (dtor) diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index 978b32e..c79866f 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,5 +1,28 @@ 2018-08-17 Nathan Sidwell <nathan@acm.org> + * include/cpplib.h (enum cpp_macro_kind): New. + (struct cpp_macro): Make body trailing array. Add kind field, + delete traditional flag. + * internal.h (_cpp_new_macro): Declare. + (_cpp_reserve_room): New inline. + (_cpp_commit_buf): Declare. + (_cpp_create_trad_definition): Return new macro. + * lex.c (_cpp_commit_buff): New. + * macro.c (macro_real_token_count): Count backwards. + (replace_args): Pointer equality not orderedness. + (_cpp_save_parameter): Use _cpp_reserve_room. + (alloc_expansion_token): Delete. + (lex_expansion_token): Return macro pointer. Use _cpp_reserve_room. + (create_iso_definition): Allocate macro itself. Adjust for + different allocation ordering. + (_cpp_new_macro): New. + (_cpp_create_definition): Adjust for API changes. + * traditional.c (push_replacement_text): Don't set traditional + flag. + (save_replacement_text): Likewise. + (_cpp_create_trad_definition): Allocate macro itself, Adjust for + different allocation ordering. + * cpp-id-data.h (uchar, UC): Move to internal.h (struct cpp_macro): Move to cpplib.h. * internal.h (uchar, UC): From cpp-id-data.h. diff --git a/libcpp/include/line-map.h b/libcpp/include/line-map.h index fa6f93f..8a4bf53 100644 --- a/libcpp/include/line-map.h +++ b/libcpp/include/line-map.h @@ -69,8 +69,8 @@ enum lc_reason LC_RENAME, /* Other reason for name change. */ LC_RENAME_VERBATIM, /* Likewise, but "" != stdin. */ LC_ENTER_MACRO, /* Begin macro expansion. */ - LC_HWM /* FIXME: add support for stringize and paste. */ + LC_HWM }; /* The typedef "source_location" is a key within the location database, diff --git a/libcpp/line-map.c b/libcpp/line-map.c index fde8c36..f0e6318 100644 --- a/libcpp/line-map.c +++ b/libcpp/line-map.c @@ -443,17 +443,6 @@ new_linemap (struct line_maps *set, source_location start_location) return result; } -/* Return the location of the last source line within an ordinary - map. */ -inline source_location -LAST_SOURCE_LINE_LOCATION (const line_map_ordinary *map) -{ - return (((map[1].start_location - 1 - - map->start_location) - & ~((1 << map->m_column_and_range_bits) - 1)) - + map->start_location); -} - /* Add a mapping of logical source line to physical source file and line number. diff --git a/libcpp/macro.c b/libcpp/macro.c index 9535d08..8323d38 100644 --- a/libcpp/macro.c +++ b/libcpp/macro.c @@ -3074,12 +3074,12 @@ _cpp_save_parameter (cpp_reader *pfile, unsigned n, cpp_hashnode *node, void *base = _cpp_reserve_room (pfile, n * sizeof (cpp_hashnode *), sizeof (cpp_hashnode *)); - ((cpp_hashnode **)base)[n++] = spelling; + ((cpp_hashnode **)base)[n] = spelling; /* Morph into a macro arg. */ node->type = NT_MACRO_ARG; /* Index is 1 based. */ - node->value.arg_index = n; + node->value.arg_index = n + 1; return true; } |