X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=blobdiff_plain;f=gcc%2Ftarget.h;h=e3307e8ead27b5bfd89c05331f86f2f66bb0e136;hp=eaf7aadd707a682e3dd9f6b4827f24bc452757f6;hb=f105335dc974c083a15d588f7ae903f47f7a02c2;hpb=be97d4b6c7cb17863a36b86d933a1d6cf52bb919 diff --git a/gcc/target.h b/gcc/target.h index eaf7aadd707..e3307e8ead2 100644 --- a/gcc/target.h +++ b/gcc/target.h @@ -1,5 +1,6 @@ /* Data structure definitions for a generic GCC target. - Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 + Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, + 2011, 2012 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it @@ -49,9 +50,24 @@ #ifndef GCC_TARGET_H #define GCC_TARGET_H -#include "tm.h" #include "insn-modes.h" +#ifdef ENABLE_CHECKING + +typedef struct { void *magic; void *p; } cumulative_args_t; + +#else /* !ENABLE_CHECKING */ + +/* When using a GCC build compiler, we could use + __attribute__((transparent_union)) to get cumulative_args_t function + arguments passed like scalars where the ABI would mandate a less + efficient way of argument passing otherwise. However, that would come + at the cost of less type-safe !ENABLE_CHECKING compilation. */ + +typedef union { void *p; } cumulative_args_t; + +#endif /* !ENABLE_CHECKING */ + /* Types used by the record_gcc_switches() target function. */ typedef enum { @@ -76,6 +92,7 @@ extern bool target_default_pointer_address_modes_p (void); struct stdarg_info; struct spec_info_def; +struct hard_reg_set_container; /* The struct used by the secondary_reload target hook. */ typedef struct secondary_reload_info @@ -128,42 +145,8 @@ enum vect_cost_for_stmt scalar_to_vec, cond_branch_not_taken, cond_branch_taken, - vec_perm -}; - -/* Sets of optimization levels at which an option may be enabled by - default_options_optimization. */ -enum opt_levels -{ - OPT_LEVELS_NONE, /* No levels (mark end of array). */ - OPT_LEVELS_ALL, /* All levels (used by targets to disable options - enabled in target-independent code). */ - OPT_LEVELS_0_ONLY, /* -O0 only. */ - OPT_LEVELS_1_PLUS, /* -O1 and above, including -Os. */ - OPT_LEVELS_1_PLUS_SPEED_ONLY, /* -O1 and above, but not -Os. */ - OPT_LEVELS_2_PLUS, /* -O2 and above, including -Os. */ - OPT_LEVELS_2_PLUS_SPEED_ONLY, /* -O2 and above, but not -Os. */ - OPT_LEVELS_3_PLUS, /* -O3 and above. */ - OPT_LEVELS_3_PLUS_AND_SIZE, /* -O3 and above and -Os. */ - OPT_LEVELS_SIZE, /* -Os only. */ - OPT_LEVELS_FAST /* -Ofast only. */ -}; - -/* Description of options to enable by default at given levels. */ -struct default_options -{ - /* The levels at which to enable the option. */ - enum opt_levels levels; - - /* The option index and argument or enabled/disabled sense of the - option, as passed to handle_generated_option. If ARG is NULL and - the option allows a negative form, the option is considered to be - passed in negative form when the optimization level is not one of - those in LEVELS (in order to handle changes to the optimization - level with the "optimize" attribute). */ - size_t opt_index; - const char *arg; - int value; + vec_perm, + vec_promote_demote }; /* The target structure. This holds all the backend hooks. */ @@ -176,7 +159,32 @@ struct default_options extern struct gcc_target targetm; -/* Each target can provide their own. */ -extern struct gcc_targetcm targetcm; +#ifdef GCC_TM_H + +#ifndef CUMULATIVE_ARGS_MAGIC +#define CUMULATIVE_ARGS_MAGIC ((void *) &targetm.calls) +#endif + +static inline CUMULATIVE_ARGS * +get_cumulative_args (cumulative_args_t arg) +{ +#ifdef ENABLE_CHECKING + gcc_assert (arg.magic == CUMULATIVE_ARGS_MAGIC); +#endif /* ENABLE_CHECKING */ + return (CUMULATIVE_ARGS *) arg.p; +} + +static inline cumulative_args_t +pack_cumulative_args (CUMULATIVE_ARGS *arg) +{ + cumulative_args_t ret; + +#ifdef ENABLE_CHECKING + ret.magic = CUMULATIVE_ARGS_MAGIC; +#endif /* ENABLE_CHECKING */ + ret.p = (void *) arg; + return ret; +} +#endif /* GCC_TM_H */ #endif /* GCC_TARGET_H */