aboutsummaryrefslogtreecommitdiff
path: root/gcc/params.h
diff options
context:
space:
mode:
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-14 10:22:43 +0000
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-14 10:22:43 +0000
commit56f280c4e1666af026e5c2c274e8b1a165691ea1 (patch)
tree9b340b8d6c331d28e231ef93373d6e4219525626 /gcc/params.h
parent5574dbdd51f2fab4b84bb3b5cde65239c2845624 (diff)
* params.c (params_finished): New.
(add_params): Assert !params_finished. (finish_params): New. (set_param_value_internal): Take params and params_set parameters. Assert params_finished. (set_param_value, maybe_set_param_value): Take params and params_set parameters. Update calls to set_param_value_internal. (set_default_param_value): Assert !params_finished. Don't use set_param_value_internal. (default_param_value, init_param_values): New. * params.h (struct param_info): Change value to default_value. Remove set. (set_param_value, maybe_set_param_value): Add params and params_set parameters. (PARAM_VALUE): Get parameters from global_options. (PARAM_SET_P): Remove. (finish_params, default_param_value, init_param_values): New. * common.opt (param_values): New Variable. * config/arm/arm.c (arm_option_override): Pass extra arguments to maybe_set_param_value. * config/i386/i386.c (ix86_option_override_internal): Pass extra arguments to maybe_set_param_value. * config/picochip/picochip.c (picochip_option_override): Pass extra arguments to maybe_set_param_value. * config/rs6000/rs6000.c (rs6000_option_override_internal): Pass extra arguments to maybe_set_param_value. * config/s390/s390.c (s390_option_override): Use maybe_set_param_value instead of set_param_value. Pass extra arguments to maybe_set_param_value. * config/sparc/sparc.c (sparc_option_override): Pass extra arguments to maybe_set_param_value. * config/spu/spu.c (spu_option_override): Pass extra arguments to maybe_set_param_value. * opts.c (handle_param): Take opts and opts_set parameters. Update call to set_param_value. (initial_min_crossjump_insns, initial_max_fields_for_field_sensitive, initial_loop_invariant_max_bbs_in_loop): Remove. (init_options_once): Don't set them. (init_options_struct): Initialize parameters structures. (default_options_optimization): Use default_param_value when restoring defaults. Update calls to maybe_set_param_value. (finish_options): Update calls to maybe_set_param_value. (common_handle_option): Update calls to handle_param and set_param_value. * toplev.c (DEFPARAM): Update definition for changes to param_info. (general_init): Call finish_params. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165460 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/params.h')
-rw-r--r--gcc/params.h36
1 files changed, 23 insertions, 13 deletions
diff --git a/gcc/params.h b/gcc/params.h
index b924e781a1e..5aeb3ef47d7 100644
--- a/gcc/params.h
+++ b/gcc/params.h
@@ -44,11 +44,9 @@ typedef struct param_info
/* The name used with the `--param <name>=<value>' switch to set this
value. */
const char *const option;
- /* The associated value. */
- int value;
- /* True if the parameter was explicitly set. */
- bool set;
+ /* The default value. */
+ int default_value;
/* Minimum acceptable value. */
int min_value;
@@ -72,9 +70,12 @@ extern size_t get_num_compiler_params (void);
extern void add_params (const param_info params[], size_t n);
-/* Set the VALUE associated with the parameter given by NAME. */
+/* Set the VALUE associated with the parameter given by NAME in the
+ table PARAMS using PARAMS_SET to indicate which have been
+ explicitly set. */
-extern void set_param_value (const char *name, int value);
+extern void set_param_value (const char *name, int value,
+ int *params, int *params_set);
/* The parameters in use by language-independent code. */
@@ -90,22 +91,31 @@ typedef enum compiler_param
/* The value of the parameter given by ENUM. Not an lvalue. */
#define PARAM_VALUE(ENUM) \
- ((int) compiler_params[(int) ENUM].value)
+ ((int) global_options.x_param_values[(int) ENUM])
/* Set the value of the parameter given by NUM to VALUE, implicitly,
- if it has not been set explicitly by the user. */
+ if it has not been set explicitly by the user, in the table PARAMS
+ using PARAMS_SET to indicate which have been explicitly set. */
-extern void maybe_set_param_value (compiler_param num, int value);
+extern void maybe_set_param_value (compiler_param num, int value,
+ int *params, int *params_set);
/* Set the default value of a parameter given by NUM to VALUE, before
option processing. */
extern void set_default_param_value (compiler_param num, int value);
-/* True if the value of the parameter was explicitly changed. Not an
- lvalue. */
-#define PARAM_SET_P(ENUM) \
- ((bool) compiler_params[(int) ENUM].set)
+/* Note that all parameters have been added and all default values
+ set. */
+extern void finish_params (void);
+
+/* Return the default value of parameter NUM. */
+
+extern int default_param_value (compiler_param num);
+
+/* Initialize an array PARAMS with default values of the
+ parameters. */
+extern void init_param_values (int *params);
/* Macros for the various parameters. */
#define STRUCT_REORG_COLD_STRUCT_RATIO \