+2006-01-27 Richard Sandiford <richard@codesourcery.com>
+
+ * doc/rtl.texi (SYMBOL_REF_DATA): Adjust documentation for new
+ opaque type.
+ * optabs.c (init_one_libfunc): Use SET_SYMBOL_REF_DECL.
+ * varasm.c (make_decl_rtl, build_constant_desc): Likewise.
+ (force_const_mem): Use SET_SYMBOL_REF_CONSTANT.
+ * rtl.h (rtunion_def): Remove rt_ptr.
+ (X0PTR): Delete.
+ (SYMBOL_REF_DATA): Use X0ANY instead of X0PTR.
+ (SET_SYMBOL_REF_DECL, SET_SYMBOL_REF_CONSTANT): New macros.
+ * config/i386/winnt.c (i386_pe_mark_dllexport)
+ (i386_pe_mark_dllimport): Use SET_SYMBOL_REF_DECL.
+
2006-01-27 Gabor Loki <loki@gcc.gnu.org>
* cfgcleanup.c (try_crossjump_to_edge): Fix comment typo.
idp = get_identifier (newname);
symref = gen_rtx_SYMBOL_REF (Pmode, IDENTIFIER_POINTER (idp));
- SYMBOL_REF_DATA (symref) = decl;
+ SET_SYMBOL_REF_DECL (symref, decl);
XEXP (DECL_RTL (decl), 0) = symref;
}
idp = get_identifier (newname);
symref = gen_rtx_SYMBOL_REF (Pmode, IDENTIFIER_POINTER (idp));
- SYMBOL_REF_DATA (symref) = decl;
+ SET_SYMBOL_REF_DECL (symref, decl);
newrtl = gen_rtx_MEM (Pmode,symref);
XEXP (DECL_RTL (decl), 0) = newrtl;
@findex SYMBOL_REF_DATA
@item SYMBOL_REF_DATA (@var{x})
-A @samp{void *} pointer used to store @code{SYMBOL_REF_DECL} or
+A field of opaque type used to store @code{SYMBOL_REF_DECL} or
@code{SYMBOL_REF_CONSTANT}.
@findex SYMBOL_REF_FLAGS
/* Zap the nonsensical SYMBOL_REF_DECL for this. What we're left with
are the flags assigned by targetm.encode_section_info. */
- SYMBOL_REF_DATA (symbol) = 0;
+ SET_SYMBOL_REF_DECL (symbol, 0);
return symbol;
}
mem_attrs *rt_mem;
reg_attrs *rt_reg;
struct constant_descriptor_rtx *rt_constant;
- void *rt_ptr;
};
typedef union rtunion_def rtunion;
#define X0MEMATTR(RTX, N) (RTL_CHECKC1 (RTX, N, MEM).rt_mem)
#define X0REGATTR(RTX, N) (RTL_CHECKC1 (RTX, N, REG).rt_reg)
#define X0CONSTANT(RTX, N) (RTL_CHECK1 (RTX, N, '0').rt_constant)
-#define X0PTR(RTX, N) (RTL_CHECK1 (RTX, N, '0').rt_ptr)
/* Access a '0' field with any type. */
#define X0ANY(RTX, N) RTL_CHECK1 (RTX, N, '0')
/* A pointer attached to the SYMBOL_REF; either SYMBOL_REF_DECL or
SYMBOL_REF_CONSTANT. */
-#define SYMBOL_REF_DATA(RTX) X0PTR ((RTX), 2)
+#define SYMBOL_REF_DATA(RTX) X0ANY ((RTX), 2)
+
+/* Set RTX's SYMBOL_REF_DECL to DECL. RTX must not be a constant
+ pool symbol. */
+#define SET_SYMBOL_REF_DECL(RTX, DECL) \
+ (gcc_assert (!CONSTANT_POOL_ADDRESS_P (RTX)), X0TREE ((RTX), 2) = (DECL))
/* The tree (decl or constant) associated with the symbol, or null. */
#define SYMBOL_REF_DECL(RTX) \
(CONSTANT_POOL_ADDRESS_P (RTX) ? NULL : X0TREE ((RTX), 2))
+/* Set RTX's SYMBOL_REF_CONSTANT to C. RTX must be a constant pool symbol. */
+#define SET_SYMBOL_REF_CONSTANT(RTX, C) \
+ (gcc_assert (CONSTANT_POOL_ADDRESS_P (RTX)), X0CONSTANT ((RTX), 2) = (C))
+
/* The rtx constant pool entry for a symbol, or null. */
#define SYMBOL_REF_CONSTANT(RTX) \
(CONSTANT_POOL_ADDRESS_P (RTX) ? X0CONSTANT ((RTX), 2) : NULL)
x = gen_rtx_SYMBOL_REF (Pmode, name);
SYMBOL_REF_WEAK (x) = DECL_WEAK (decl);
- SYMBOL_REF_DATA (x) = decl;
+ SET_SYMBOL_REF_DECL (x, decl);
x = gen_rtx_MEM (DECL_MODE (decl), x);
if (TREE_CODE (decl) != FUNCTION_DECL)
/* We have a symbol name; construct the SYMBOL_REF and the MEM. */
symbol = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (label));
SYMBOL_REF_FLAGS (symbol) = SYMBOL_FLAG_LOCAL;
- SYMBOL_REF_DATA (symbol) = desc->value;
+ SET_SYMBOL_REF_DECL (symbol, desc->value);
TREE_CONSTANT_POOL_ADDRESS_P (symbol) = 1;
rtl = gen_rtx_MEM (TYPE_MODE (TREE_TYPE (exp)), symbol);
the constants pool. */
desc->sym = symbol = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (label));
SYMBOL_REF_FLAGS (symbol) = SYMBOL_FLAG_LOCAL;
- SYMBOL_REF_DATA (symbol) = desc;
CONSTANT_POOL_ADDRESS_P (symbol) = 1;
+ SET_SYMBOL_REF_CONSTANT (symbol, desc);
current_function_uses_const_pool = 1;
/* Construct the MEM. */