+2001-07-06 Stan Shebs <shebs@apple.com>
+
+ * target.h (targetm): Rename global from "target", so as not to
+ conflict with local variables.
+ * c-decl.c: Ditto.
+ * c-typeck.c: Ditto.
+ * final.c: Ditto.
+ * tree.c: Ditto.
+ * cp/decl.c: Ditto.
+ * cp/decl2.c: Ditto.
+ * cp/typeck.c: Ditto.
+ * 1750a/1750a.c: Ditto.
+ * a29k/a29k.c: Ditto.
+ * arc/arc.c: Ditto.
+ * arm/arm.c: Ditto.
+ * avr/avr.c: Ditto.
+ * clipper/clipper.c: Ditto.
+ * convex/convex.c: Ditto.
+ * d30v/d30v.c: Ditto.
+ * dsp16xx/dsp16xx.c: Ditto.
+ * elxsi/elxsi.c: Ditto.
+ * fr30/fr30.c: Ditto.
+ * h8300/h8300.c: Ditto.
+ * i370/i370.c: Ditto.
+ * i386/i386.c: Ditto.
+ * i860/i860.c: Ditto.
+ * i960/i960.c: Ditto.
+ * ia64/ia64.c: Ditto.
+ * m32r/m32r.c: Ditto.
+ * m68hc11/m68hc11.c: Ditto.
+ * m68k/m68k.c: Ditto.
+ * m88k/m88k.c: Ditto.
+ * mips/mips.c: Ditto.
+ * ns32k/ns32k.c: Ditto.
+ * pa/pa.c: Ditto.
+ * pdp11/pdp11.c: Ditto.
+ * romp/romp.c: Ditto.
+ * rs6000/rs6000.c: Ditto.
+ * sh/sh.c: Ditto.
+ * sparc/sparc.c: Ditto.
+ * vax/vax.c: Ditto.
+ * we32k/we32k.c: Ditto.
+ * doc/tm.texi: Update the manual to match.
+
2001-07-06 Richard Henderson <rth@redhat.com>
* except.h (MUST_USE_SJLJ_EXCEPTIONS): Examine the value of
if (DECL_P (olddecl))
DECL_MACHINE_ATTRIBUTES (newdecl)
- = (*target.merge_decl_attributes) (olddecl, newdecl);
+ = (*targetm.merge_decl_attributes) (olddecl, newdecl);
if (TREE_CODE (newtype) == ERROR_MARK
|| TREE_CODE (oldtype) == ERROR_MARK)
return t1;
/* Merge the attributes. */
- attributes = (*target.merge_type_attributes) (t1, t2);
+ attributes = (*targetm.merge_type_attributes) (t1, t2);
/* Treat an enum type as the unsigned integer type of the same width. */
return 1;
/* 1 if no need for warning yet, 2 if warning cause has been seen. */
- if (! (attrval = (*target.comp_type_attributes) (t1, t2)))
+ if (! (attrval = (*targetm.comp_type_attributes) (t1, t2)))
return 0;
/* 1 if no need for warning yet, 2 if warning cause has been seen. */
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE output_function_epilogue
-struct gcc_target target = TARGET_INITIALIZER;
+struct gcc_target targetm = TARGET_INITIALIZER;
\f
/* Generate the assembly code for function entry. FILE is a stdio
stream to output the code to. SIZE is an int: how many units of
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE output_function_epilogue
-struct gcc_target target = TARGET_INITIALIZER;
+struct gcc_target targetm = TARGET_INITIALIZER;
\f
/* Returns 1 if OP is a 8-bit constant. */
\f
/* Initialize the GCC target structure. */
-struct gcc_target target = TARGET_INITIALIZER;
+struct gcc_target targetm = TARGET_INITIALIZER;
\f
/* Parse target option strings. */
#undef TARGET_VALID_DECL_ATTRIBUTE
#define TARGET_VALID_DECL_ATTRIBUTE arc_valid_decl_attribute
-struct gcc_target target = TARGET_INITIALIZER;
+struct gcc_target targetm = TARGET_INITIALIZER;
\f
/* Called by OVERRIDE_OPTIONS to initialize various things. */
#undef TARGET_SET_DEFAULT_TYPE_ATTRIBUTES
#define TARGET_SET_DEFAULT_TYPE_ATTRIBUTES arm_set_default_type_attributes
-struct gcc_target target = TARGET_INITIALIZER;
+struct gcc_target targetm = TARGET_INITIALIZER;
\f
/* Obstack for minipool constant handling. */
static struct obstack minipool_obstack;
#undef TARGET_VALID_TYPE_ATTRIBUTE
#define TARGET_VALID_TYPE_ATTRIBUTE avr_valid_type_attribute
-struct gcc_target target = TARGET_INITIALIZER;
+struct gcc_target targetm = TARGET_INITIALIZER;
\f
void
avr_override_options ()
#undef TARGET_VALID_TYPE_ATTRIBUTE
#define TARGET_VALID_TYPE_ATTRIBUTE c4x_valid_type_attribute_p
-struct gcc_target target = TARGET_INITIALIZER;
+struct gcc_target targetm = TARGET_INITIALIZER;
\f
/* Called to register all of our global variables with the garbage
collector. */
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE clipper_output_function_epilogue
-struct gcc_target target = TARGET_INITIALIZER;
+struct gcc_target targetm = TARGET_INITIALIZER;
\f
/* Compute size of a clipper stack frame where 'lsize' is the required
space for local variables. */
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE convex_output_function_epilogue
-struct gcc_target target = TARGET_INITIALIZER;
+struct gcc_target targetm = TARGET_INITIALIZER;
\f
/* Generate the assembly code for function entry. FILE is a stdio
stream to output the code to. SIZE is an int: how many units of
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE d30v_output_function_epilogue
-struct gcc_target target = TARGET_INITIALIZER;
+struct gcc_target targetm = TARGET_INITIALIZER;
\f
/* Sometimes certain combinations of command options do not make
sense on a particular target machine. You can define a macro
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE dsp16xx_output_function_epilogue
-struct gcc_target target = TARGET_INITIALIZER;
+struct gcc_target targetm = TARGET_INITIALIZER;
\f
int
hard_regno_mode_ok (regno, mode)
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE elxsi_output_function_epilogue
-struct gcc_target target = TARGET_INITIALIZER;
+struct gcc_target targetm = TARGET_INITIALIZER;
\f
/* Generate the assembly code for function entry. FILE is a stdio
stream to output the code to. SIZE is an int: how many units of
\f
/* Initialize the GCC target structure. */
-struct gcc_target target = TARGET_INITIALIZER;
+struct gcc_target targetm = TARGET_INITIALIZER;
\f
/* Returns the number of bytes offset between FROM_REG and TO_REG
for the current function. As a side effect it fills in the
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE h8300_output_function_epilogue
-struct gcc_target target = TARGET_INITIALIZER;
+struct gcc_target targetm = TARGET_INITIALIZER;
\f
/* Initialize various cpu specific globals at start up. */
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE i370_output_function_epilogue
-struct gcc_target target = TARGET_INITIALIZER;
+struct gcc_target targetm = TARGET_INITIALIZER;
\f
/* Map characters from one character set to another.
C is the character to be translated. */
# define TARGET_ASM_FUNCTION_PROLOGUE ix86_osf_output_function_prologue
#endif
-struct gcc_target target = TARGET_INITIALIZER;
+struct gcc_target targetm = TARGET_INITIALIZER;
\f
/* Sometimes certain combinations of command options do not make
sense on a particular target machine. You can define a macro
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE i860_output_function_epilogue
-struct gcc_target target = TARGET_INITIALIZER;
+struct gcc_target targetm = TARGET_INITIALIZER;
\f
/* Return non-zero if this pattern, can be evaluated safely, even if it
was not asked for. */
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE i960_output_function_epilogue
-struct gcc_target target = TARGET_INITIALIZER;
+struct gcc_target targetm = TARGET_INITIALIZER;
\f
/* Initialize variables before compiling any files. */
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE ia64_output_function_epilogue
-struct gcc_target target = TARGET_INITIALIZER;
+struct gcc_target targetm = TARGET_INITIALIZER;
\f
/* Return 1 if OP is a valid operand for the MEM of a CALL insn. */
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE m32r_output_function_epilogue
-struct gcc_target target = TARGET_INITIALIZER;
+struct gcc_target targetm = TARGET_INITIALIZER;
\f
/* Called by OVERRIDE_OPTIONS to initialize various things. */
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE m68hc11_output_function_epilogue
-struct gcc_target target = TARGET_INITIALIZER;
+struct gcc_target targetm = TARGET_INITIALIZER;
\f
int
m68hc11_override_options ()
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE m68k_output_function_epilogue
-struct gcc_target target = TARGET_INITIALIZER;
+struct gcc_target targetm = TARGET_INITIALIZER;
\f
/* Sometimes certain combinations of command options do not make
sense on a particular target machine. You can define a macro
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE m88k_output_function_epilogue
-struct gcc_target target = TARGET_INITIALIZER;
+struct gcc_target targetm = TARGET_INITIALIZER;
\f
/* Determine what instructions are needed to manufacture the integer VALUE
in the given MODE. */
#undef TARGET_VALID_DECL_ATTRIBUTE
#define TARGET_VALID_DECL_ATTRIBUTE mcore_valid_decl_attribute
-struct gcc_target target = TARGET_INITIALIZER;
+struct gcc_target targetm = TARGET_INITIALIZER;
\f
/* Adjust the stack and return the number of bytes taken to do it. */
static void
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE mips_output_function_epilogue
-struct gcc_target target = TARGET_INITIALIZER;
+struct gcc_target targetm = TARGET_INITIALIZER;
\f
/* Return truth value of whether OP can be used as an operands
where a register or 16 bit unsigned integer is needed. */
\f
/* Initialize the GCC target structure. */
-struct gcc_target target = TARGET_INITIALIZER;
+struct gcc_target targetm = TARGET_INITIALIZER;
\f
/* Indicate this file was compiled by gcc and what optimization
level was used. */
\f
/* Initialize the GCC target structure. */
-struct gcc_target target = TARGET_INITIALIZER;
+struct gcc_target targetm = TARGET_INITIALIZER;
\f
void
asm_file_start (file)
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE ns32k_output_function_epilogue
-struct gcc_target target = TARGET_INITIALIZER;
+struct gcc_target targetm = TARGET_INITIALIZER;
\f
/* Generate the assembly code for function entry. FILE is a stdio
stream to output the code to. SIZE is an int: how many units of
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE pa_output_function_epilogue
-struct gcc_target target = TARGET_INITIALIZER;
+struct gcc_target targetm = TARGET_INITIALIZER;
\f
void
override_options ()
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE pdp11_output_function_epilogue
-struct gcc_target target = TARGET_INITIALIZER;
+struct gcc_target targetm = TARGET_INITIALIZER;
\f
/* Nonzero if OP is a valid second operand for an arithmetic insn. */
\f
/* Initialize the GCC target structure. */
-struct gcc_target target = TARGET_INITIALIZER;
+struct gcc_target targetm = TARGET_INITIALIZER;
\f
/* printf to the asm_out_file, with special format control characters
for decoding operands.
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE romp_output_function_epilogue
-struct gcc_target target = TARGET_INITIALIZER;
+struct gcc_target targetm = TARGET_INITIALIZER;
\f
/* Return 1 if the insn using CC0 set by INSN does not contain
any unsigned tests applied to the condition codes.
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE rs6000_output_function_epilogue
-struct gcc_target target = TARGET_INITIALIZER;
+struct gcc_target targetm = TARGET_INITIALIZER;
\f
/* Override command line options. Mostly we process the processor
type and sometimes adjust other TARGET_ options. */
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE sh_output_function_epilogue
-struct gcc_target target = TARGET_INITIALIZER;
+struct gcc_target targetm = TARGET_INITIALIZER;
\f
/* Print the operand address in x to the stream. */
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE sparc_output_function_epilogue
-struct gcc_target target = TARGET_INITIALIZER;
+struct gcc_target targetm = TARGET_INITIALIZER;
\f
/* Validate and override various options, and do some machine dependent
initialization. */
#undef TARGET_VALID_DECL_ATTRIBUTE
#define TARGET_VALID_DECL_ATTRIBUTE v850_valid_decl_attribute
-struct gcc_target target = TARGET_INITIALIZER;
+struct gcc_target targetm = TARGET_INITIALIZER;
\f
/* Sometimes certain combinations of command options do not make
sense on a particular target machine. You can define a macro
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE vax_output_function_prologue
-struct gcc_target target = TARGET_INITIALIZER;
+struct gcc_target targetm = TARGET_INITIALIZER;
\f
/* Generate the assembly code for function entry. FILE is a stdio
stream to output the code to. SIZE is an int: how many units of
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE we32k_output_function_epilogue
-struct gcc_target target = TARGET_INITIALIZER;
+struct gcc_target targetm = TARGET_INITIALIZER;
\f
/* Generate the assembly code for function entry. FILE is a stdio
stream to output the code to. SIZE is an int: how many units of
/* Copy all the DECL_... slots specified in the new decl
except for any that we copy here from the old type. */
DECL_MACHINE_ATTRIBUTES (newdecl)
- = (*target.merge_decl_attributes) (olddecl, newdecl);
+ = (*targetm.merge_decl_attributes) (olddecl, newdecl);
if (TREE_CODE (newdecl) == TEMPLATE_DECL)
{
if (CLASSTYPE_INTERFACE_ONLY (ctype))
return;
- if ((*target.valid_type_attribute) (ctype,
- TYPE_ATTRIBUTES (ctype),
- get_identifier ("dllimport"),
- NULL_TREE)
+ if ((*targetm.valid_type_attribute) (ctype,
+ TYPE_ATTRIBUTES (ctype),
+ get_identifier ("dllimport"),
+ NULL_TREE)
&& lookup_attribute ("dllimport", TYPE_ATTRIBUTES (ctype)))
import_export = -1;
- else if ((*target.valid_type_attribute) (ctype,
- TYPE_ATTRIBUTES (ctype),
- get_identifier ("dllexport"),
- NULL_TREE)
+ else if ((*targetm.valid_type_attribute) (ctype,
+ TYPE_ATTRIBUTES (ctype),
+ get_identifier ("dllexport"),
+ NULL_TREE)
&& lookup_attribute ("dllexport", TYPE_ATTRIBUTES (ctype)))
import_export = 1;
tree b1;
int type_quals;
tree tgt;
- tree attributes = (*target.merge_type_attributes) (t1, t2);
+ tree attributes = (*targetm.merge_type_attributes) (t1, t2);
if (TREE_CODE (tt1) == OFFSET_TYPE)
{
/* In what follows, we slightly generalize the rules given in [expr]
so as to deal with `long long'. First, merge the attributes. */
- attributes = (*target.merge_type_attributes) (t1, t2);
+ attributes = (*targetm.merge_type_attributes) (t1, t2);
/* If only one is real, use it as the result. */
if (code1 == REAL_TYPE && code2 != REAL_TYPE)
return type_after_usual_arithmetic_conversions (t1, t2);
/* Merge the attributes. */
- attributes = (*target.merge_type_attributes) (t1, t2);
+ attributes = (*targetm.merge_type_attributes) (t1, t2);
/* Treat an enum type as the unsigned integer type of the same width. */
if (strict & COMPARE_NO_ATTRIBUTES)
attrval = 1;
/* 1 if no need for warning yet, 2 if warning cause has been seen. */
- else if (! (attrval = (*target.comp_type_attributes) (t1, t2)))
+ else if (! (attrval = (*targetm.comp_type_attributes) (t1, t2)))
return 0;
/* 1 if no need for warning yet, 2 if warning cause has been seen. */
@cindex target hooks
@cindex target functions
-@deftypevar {struct gcc_target} target
-The target @file{.c} file must define the global @code{target} variable
+@deftypevar {struct gcc_target} targetm
+The target @file{.c} file must define the global @code{targetm} variable
which contains pointers to functions and data relating to the target
machine. The variable is declared in @file{target.h};
@file{target-def.h} defines the macro @code{TARGET_INITIALIZER} which is
#undef TARGET_VALID_TYPE_ATTRIBUTE
#define TARGET_VALID_TYPE_ATTRIBUTE @var{machine}_valid_type_attribute_p
-struct gcc_target target = TARGET_INITIALIZER;
+struct gcc_target targetm = TARGET_INITIALIZER;
@end smallexample
@end deftypevar
}
/* First output the function prologue: code to set up the stack frame. */
- (*target.asm_out.function_prologue) (file, get_frame_size ());
+ (*targetm.asm_out.function_prologue) (file, get_frame_size ());
/* If the machine represents the prologue as RTL, the profiling code must
be emitted when NOTE_INSN_PROLOGUE_END is scanned. */
/* Finally, output the function epilogue:
code to restore the stack frame and return to the caller. */
- (*target.asm_out.function_epilogue) (file, get_frame_size ());
+ (*targetm.asm_out.function_epilogue) (file, get_frame_size ());
#ifdef SDB_DEBUGGING_INFO
if (write_symbols == SDB_DEBUG)
includes target.h and target-def.h, and overrides any inappropriate
defaults by undefining the relevant macro and defining a suitable
replacement. That file should then contain the definition of
- "target" like so:
+ "targetm" like so:
- struct gcc_target target = TARGET_INITIALIZER;
+ struct gcc_target targetm = TARGET_INITIALIZER;
Doing things this way allows us to bring together everything that
defines a target to GCC. By supplying a default that is
void (* set_default_type_attributes) PARAMS ((tree type));
};
-extern struct gcc_target target;
+extern struct gcc_target targetm;
/* Default to no attributes for type, but let target change that. */
TYPE_ATTRIBUTES (t) = NULL_TREE;
- (*target.set_default_type_attributes) (t);
+ (*targetm.set_default_type_attributes) (t);
/* We have not yet computed the alias set for this type. */
TYPE_ALIAS_SET (t) = -1;
{
tree decl_attrs = DECL_MACHINE_ATTRIBUTES (decl);
- if ((*target.valid_decl_attribute) (decl, decl_attrs, attr_name,
- attr_args))
+ if ((*targetm.valid_decl_attribute) (decl, decl_attrs, attr_name,
+ attr_args))
{
tree attr = lookup_attribute (IDENTIFIER_POINTER (attr_name),
decl_attrs);
}
type_attrs = TYPE_ATTRIBUTES (type);
- if ((*target.valid_type_attribute) (type, type_attrs, attr_name,
- attr_args))
+ if ((*targetm.valid_type_attribute) (type, type_attrs, attr_name,
+ attr_args))
{
tree attr = lookup_attribute (IDENTIFIER_POINTER (attr_name),
type_attrs);
by putting the attribute on the function type. */
else if (POINTER_TYPE_P (type)
&& TREE_CODE (TREE_TYPE (type)) == FUNCTION_TYPE
- && (*target.valid_type_attribute) (TREE_TYPE (type), type_attrs,
- attr_name, attr_args))
+ && (*targetm.valid_type_attribute) (TREE_TYPE (type), type_attrs,
+ attr_name, attr_args))
{
tree inner_type = TREE_TYPE (type);
tree inner_attrs = TYPE_ATTRIBUTES (inner_type);