aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.h
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@gcc.gnu.org>2017-10-11 15:33:51 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2017-10-11 15:33:51 +0000
commit4e7d02606ea8b0dac11887b1f759ea61d5394d86 (patch)
treed02ed206b4fdcfc4796f611f2578941e141fa903 /gcc/tree.h
parent64766e8dc78b92fc906e21429b1befd2b248f96e (diff)
downloadgcc-4e7d02606ea8b0dac11887b1f759ea61d5394d86.zip
gcc-4e7d02606ea8b0dac11887b1f759ea61d5394d86.tar.gz
gcc-4e7d02606ea8b0dac11887b1f759ea61d5394d86.tar.bz2
[PATCH] DECL_ASSEMBLER_NAME and friends
https://gcc.gnu.org/ml/gcc-patches/2017-10/msg00582.html * tree.h (DECL_ASSEMBLER_NAME_RAW): New. (SET_DECL_ASSEMBLER_NAME): Use it. (DECL_ASSEMBLER_NAME_SET_P): Likewise. (COPY_DECL_ASSEMBLER_NAME): Likewise. * tree.c (decl_assembler_name): Use DECL_ASSEMBLER_NAME_RAW. lto/ * lto.c (mentions_vars_p_decl_with_vis): Use DECL_ASSEMBLER_NAME_RAW. (lto_fixup_prevailing_decls): Likewise. cp * decl2.c (struct mangled_decl_hash): Use DECL_ASSEMBLER_NAME_RAW. (record_mangling): Likewise. From-SVN: r253647
Diffstat (limited to 'gcc/tree.h')
-rw-r--r--gcc/tree.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/gcc/tree.h b/gcc/tree.h
index 9507c3b..b542f51 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -2721,6 +2721,10 @@ extern void decl_value_expr_insert (tree, tree);
LTO compilation and C++. */
#define DECL_ASSEMBLER_NAME(NODE) decl_assembler_name (NODE)
+/* Raw accessor for DECL_ASSEMBLE_NAME. */
+#define DECL_ASSEMBLER_NAME_RAW(NODE) \
+ (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.assembler_name)
+
/* Return true if NODE is a NODE that can contain a DECL_ASSEMBLER_NAME.
This is true of all DECL nodes except FIELD_DECL. */
#define HAS_DECL_ASSEMBLER_NAME_P(NODE) \
@@ -2731,11 +2735,11 @@ extern void decl_value_expr_insert (tree, tree);
yet. */
#define DECL_ASSEMBLER_NAME_SET_P(NODE) \
(HAS_DECL_ASSEMBLER_NAME_P (NODE) \
- && DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.assembler_name != NULL_TREE)
+ && DECL_ASSEMBLER_NAME_RAW (NODE) != NULL_TREE)
/* Set the DECL_ASSEMBLER_NAME for NODE to NAME. */
#define SET_DECL_ASSEMBLER_NAME(NODE, NAME) \
- (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.assembler_name = (NAME))
+ (DECL_ASSEMBLER_NAME_RAW (NODE) = (NAME))
/* Copy the DECL_ASSEMBLER_NAME from DECL1 to DECL2. Note that if DECL1's
DECL_ASSEMBLER_NAME has not yet been set, using this macro will not cause
@@ -2747,10 +2751,7 @@ extern void decl_value_expr_insert (tree, tree);
which will try to set the DECL_ASSEMBLER_NAME for DECL1. */
#define COPY_DECL_ASSEMBLER_NAME(DECL1, DECL2) \
- (DECL_ASSEMBLER_NAME_SET_P (DECL1) \
- ? (void) SET_DECL_ASSEMBLER_NAME (DECL2, \
- DECL_ASSEMBLER_NAME (DECL1)) \
- : (void) 0)
+ SET_DECL_ASSEMBLER_NAME (DECL2, DECL_ASSEMBLER_NAME_RAW (DECL1))
/* Records the section name in a section attribute. Used to pass
the name from decl_attributes to make_function_rtl and make_decl_rtl. */