aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.h
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2020-12-08 10:23:44 -0800
committerNathan Sidwell <nathan@acm.org>2020-12-08 10:41:02 -0800
commit5312fa0fd95aab112abe40f2a5cdb70a76e89fbf (patch)
tree209a06325457a073b8809143b9bd90d48a3c98e6 /gcc/tree.h
parentf1b6e17b3f753980527721aa8e949d2481b2560b (diff)
downloadgcc-5312fa0fd95aab112abe40f2a5cdb70a76e89fbf.zip
gcc-5312fa0fd95aab112abe40f2a5cdb70a76e89fbf.tar.gz
gcc-5312fa0fd95aab112abe40f2a5cdb70a76e89fbf.tar.bz2
Raw tree accessors
Here are the couple of raw accessors I make use of in the module streaming. gcc/ * tree.h (DECL_ALIGN_RAW): New. (DECL_ALIGN): Use it. (DECL_WARN_IF_NOT_ALIGN_RAW): New. (DECL_WARN_IF_NOT_ALIGN): Use it. (SET_DECL_WARN_IF_NOT_ALIGN): Likewise.
Diffstat (limited to 'gcc/tree.h')
-rw-r--r--gcc/tree.h21
1 files changed, 12 insertions, 9 deletions
diff --git a/gcc/tree.h b/gcc/tree.h
index 7faa49d..b44039f 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -2529,25 +2529,28 @@ extern tree vector_element_bits_tree (const_tree);
#define DECL_SIZE(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.size)
/* Likewise for the size in bytes. */
#define DECL_SIZE_UNIT(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.size_unit)
+#define DECL_ALIGN_RAW(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.align)
/* Returns the alignment required for the datum, in bits. It must
be a power of two, but an "alignment" of zero is supported
(e.g. as "uninitialized" sentinel). */
-#define DECL_ALIGN(NODE) \
- (DECL_COMMON_CHECK (NODE)->decl_common.align \
- ? ((unsigned)1) << ((NODE)->decl_common.align - 1) : 0)
+#define DECL_ALIGN(NODE) \
+ (DECL_ALIGN_RAW (NODE) \
+ ? ((unsigned)1) << (DECL_ALIGN_RAW (NODE) - 1) : 0)
/* Specify that DECL_ALIGN(NODE) is X. */
#define SET_DECL_ALIGN(NODE, X) \
- (DECL_COMMON_CHECK (NODE)->decl_common.align = ffs_hwi (X))
+ (DECL_ALIGN_RAW (NODE) = ffs_hwi (X))
/* The minimum alignment necessary for the datum, in bits, without
warning. */
-#define DECL_WARN_IF_NOT_ALIGN(NODE) \
- (DECL_COMMON_CHECK (NODE)->decl_common.warn_if_not_align \
- ? ((unsigned)1) << ((NODE)->decl_common.warn_if_not_align - 1) : 0)
+#define DECL_WARN_IF_NOT_ALIGN_RAW(NODE) \
+ (DECL_COMMON_CHECK (NODE)->decl_common.warn_if_not_align)
+#define DECL_WARN_IF_NOT_ALIGN(NODE) \
+ (DECL_WARN_IF_NOT_ALIGN_RAW (NODE) \
+ ? ((unsigned)1) << (DECL_WARN_IF_NOT_ALIGN_RAW (NODE) - 1) : 0)
/* Specify that DECL_WARN_IF_NOT_ALIGN(NODE) is X. */
-#define SET_DECL_WARN_IF_NOT_ALIGN(NODE, X) \
- (DECL_COMMON_CHECK (NODE)->decl_common.warn_if_not_align = ffs_hwi (X))
+#define SET_DECL_WARN_IF_NOT_ALIGN(NODE, X) \
+ (DECL_WARN_IF_NOT_ALIGN_RAW (NODE) = ffs_hwi (X))
/* The alignment of NODE, in bytes. */
#define DECL_ALIGN_UNIT(NODE) (DECL_ALIGN (NODE) / BITS_PER_UNIT)