aboutsummaryrefslogtreecommitdiff
path: root/gcc/rtl.h
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2003-04-11 14:15:36 -0700
committerRichard Henderson <rth@gcc.gnu.org>2003-04-11 14:15:36 -0700
commit52859c77e9752203d3d551275df65d4d6f223df8 (patch)
treef675f00c76e2ef9d9b6ec56014ab50bc39c69884 /gcc/rtl.h
parent68d28100a03d7a4bb0f5763f6478c2c84bf4e2ab (diff)
downloadgcc-52859c77e9752203d3d551275df65d4d6f223df8.zip
gcc-52859c77e9752203d3d551275df65d4d6f223df8.tar.gz
gcc-52859c77e9752203d3d551275df65d4d6f223df8.tar.bz2
rtl.def (SYMBOL_REF): Add two 0 fields.
* rtl.def (SYMBOL_REF): Add two 0 fields. * gengtype.c (adjust_field_rtx_def): Handle them. * print-rtl.c (print_rtx): Print them. * rtl.h (SYMBOL_REF_DECL, SYMBOL_REF_FLAGS): New. (SYMBOL_FLAG_FUNCTION, SYMBOL_REF_FUNCTION_P): New. (SYMBOL_FLAG_LOCAL, SYMBOL_REF_LOCAL_P): New. (SYMBOL_FLAG_SMALL, SYMBOL_REF_SMALL_P): New. (SYMBOL_FLAG_TLS_SHIFT, SYMBOL_REF_TLS_MODEL): New. (SYMBOL_FLAG_EXTERNAL, SYMBOL_REF_EXTERNAL_P): New. (SYMBOL_FLAG_MACH_DEP): New. * optabs.c (init_one_libfunc): Zap fake SYMBOL_REF_DECL. * varasm.c (make_decl_rtl): Set SYMBOL_REF_DECL. (assemble_static_space): Set SYMBOL_REF_FLAGS. (assemble_trampoline_template): Likewise. (output_constant_def, force_const_mem): Likewise. (default_encode_section_info): New. * output.h: Declare it. * target-def.h (TARGET_ENCODE_SECTION_INFO): Use it. From-SVN: r65479
Diffstat (limited to 'gcc/rtl.h')
-rw-r--r--gcc/rtl.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 9174bf7..fa5ef84 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -1245,6 +1245,46 @@ do { \
#define SYMBOL_REF_WEAK(RTX) \
(RTL_FLAG_CHECK1("SYMBOL_REF_WEAK", (RTX), SYMBOL_REF)->integrated)
+/* The tree decl associated with the symbol, or null. */
+#define SYMBOL_REF_DECL(RTX) X0TREE ((RTX), 2)
+
+/* A set of flags on a symbol_ref that are, in some respects, redundant with
+ information derivable from the tree decl associated with this symbol.
+ Except that we build a *lot* of SYMBOL_REFs that aren't associated with a
+ decl. In some cases this is a bug. But beyond that, it's nice to cache
+ this information to avoid recomputing it. Finally, this allows space for
+ the target to store more than one bit of information, as with
+ SYMBOL_REF_FLAG. */
+#define SYMBOL_REF_FLAGS(RTX) X0INT ((RTX), 1)
+
+/* These flags are common enough to be defined for all targets. They
+ are computed by the default version of targetm.encode_section_info. */
+
+/* Set if this symbol is a function. */
+#define SYMBOL_FLAG_FUNCTION (1 << 0)
+#define SYMBOL_REF_FUNCTION_P(RTX) \
+ ((SYMBOL_REF_FLAGS (RTX) & SYMBOL_FLAG_FUNCTION) != 0)
+/* Set if targetm.binds_local_p is true. */
+#define SYMBOL_FLAG_LOCAL (1 << 1)
+#define SYMBOL_REF_LOCAL_P(RTX) \
+ ((SYMBOL_REF_FLAGS (RTX) & SYMBOL_FLAG_LOCAL) != 0)
+/* Set if targetm.in_small_data_p is true. */
+#define SYMBOL_FLAG_SMALL (1 << 2)
+#define SYMBOL_REF_SMALL_P(RTX) \
+ ((SYMBOL_REF_FLAGS (RTX) & SYMBOL_FLAG_SMALL) != 0)
+/* The three-bit field at [5:3] is true for TLS variables; use
+ SYMBOL_REF_TLS_MODEL to extract the field as an enum tls_model. */
+#define SYMBOL_FLAG_TLS_SHIFT 3
+#define SYMBOL_REF_TLS_MODEL(RTX) \
+ ((enum tls_model) ((SYMBOL_REF_FLAGS (RTX) >> SYMBOL_FLAG_TLS_SHIFT) & 3))
+/* Set if this symbol is not defined in this translation unit. */
+#define SYMBOL_FLAG_EXTERNAL (1 << 6)
+#define SYMBOL_REF_EXTERNAL_P(RTX) \
+ ((SYMBOL_REF_FLAGS (RTX) & SYMBOL_FLAG_EXTERNAL) != 0)
+
+/* Subsequent bits are available for the target to use. */
+#define SYMBOL_FLAG_MACH_DEP (1 << 7)
+
/* Define a macro to look for REG_INC notes,
but save time on machines where they never exist. */