diff options
author | Nathan Sidwell <nathan@acm.org> | 2017-11-16 14:54:54 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2017-11-16 14:54:54 +0000 |
commit | 5f3682ffcef162363b783eb9ee702debff489fa8 (patch) | |
tree | b9e4f1042a3c4558c07ba463d34ee29d68c28a6e /gcc/tree.c | |
parent | a930324dabd41a76ef141a85a7d0cc7fc9c9c0b3 (diff) | |
download | gcc-5f3682ffcef162363b783eb9ee702debff489fa8.zip gcc-5f3682ffcef162363b783eb9ee702debff489fa8.tar.gz gcc-5f3682ffcef162363b783eb9ee702debff489fa8.tar.bz2 |
[PATCH] New lang hook
https://gcc.gnu.org/ml/gcc-patches/2017-11/msg01340.html
PR c++/82836
PR c++/82737
* tree.h (COPY_DECL_RTL): Rename parms for clarity.
(SET_DECL_ASSEMBLER_NAME): Forward to
overwrite_decl_assembler_name.
(COPY_DECL_ASSEMBLER_NAME): Rename parms for clarity.
(overwrite_decl_assembler_name): Declare.
* tree.c (overwrite_decl_assembler_name): New.
* langhooks-def.h (lhd_overwrite_decl_assembler_name): Declare.
(LANG_HOOKS_OVERWRITE_DECL_ASSEMBLER_NAME): Provide default.
(LANG_HOOKS_INITIALIZER): Add it.
* langhooks.h (struct lang_hooks): Add overwrite_decl_assembler_name.
* langhooks.c (lhd_set_decl_assembler_name): Use
SET_DECL_ASSEMBLER_NAME.
(lhd_overwrite_decl_assembler_name): Default implementation.
PR c++/82836
PR c++/82737
* cp-objcp-common.h (LANG_HOOKS_OVERWRITE_DECL_ASSEMBLER_NAME):
Override.
* cp-tree.h (overwrite_mangling): Declare.
* decl2.c (struct mangled_decl_hash): Entries are deletable.
(overwrite_mangling): New.
PR c++/82836
PR c++/82737
* g++.dg/pr82836.C: New.
From-SVN: r254823
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -674,6 +674,17 @@ decl_assembler_name (tree decl) return DECL_ASSEMBLER_NAME_RAW (decl); } +/* The DECL_ASSEMBLER_NAME_RAW of DECL is being explicitly set to NAME + (either of which may be NULL). Inform the FE, if this changes the + name. */ + +void +overwrite_decl_assembler_name (tree decl, tree name) +{ + if (DECL_ASSEMBLER_NAME_RAW (decl) != name) + lang_hooks.overwrite_decl_assembler_name (decl, name); +} + /* When the target supports COMDAT groups, this indicates which group the DECL is associated with. This can be either an IDENTIFIER_NODE or a decl, in which case its DECL_ASSEMBLER_NAME identifies the group. */ |