summaryrefslogtreecommitdiff
path: root/gcc/opts.h
diff options
context:
space:
mode:
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-30 13:53:12 +0000
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-30 13:53:12 +0000
commit2c5d2e3966908b338ac3357dba79f3a360452c66 (patch)
tree9e8ddd32df9fcfb0446877af547d5a2daa89da8b /gcc/opts.h
parent69eb54ac94deb1bd955958a5d65c706a62be1abc (diff)
downloadlinaro-gcc-2c5d2e3966908b338ac3357dba79f3a360452c66.tar.gz
linaro-gcc-2c5d2e3966908b338ac3357dba79f3a360452c66.tar.bz2
linaro-gcc-2c5d2e3966908b338ac3357dba79f3a360452c66.zip
* opt-functions.awk (static_var): Update comment.
(var_ref): Return offsetof expression or -1, not variable address. * optc-gen.awk: Generate structure field initializers instead of static variables. Expect -1 for missing variables instead of null pointer. Add gcc_options parameters to generated functions. * opth-gen.awk: Generate structure fields for static variables. Add gcc_options parameters to generated functions. * common.opt (optimize, optimize_size): Add variables. * config/i386/i386-c.c (ix86_pragma_target_parse): Pass &global_options to cl_target_option_restore. * config/i386/i386.c (ix86_valid_target_attribute_p): Pass &global_options to cl_optimization_restore, cl_target_option_save and cl_target_option_restore. (ix86_set_current_function): Pass &global_options to cl_target_option_restore. * config/pdp11/pdp11.h (optimize): Remove. * config/rs6000/rs6000.h (optimize): Remove. * config/sh/sh.h (optimize): Remove. * config/xtensa/xtensa.h (optimize): Remove. * coretypes.h (struct gcc_options): Declare. * diagnostic.c (diagnostic_initialize): Initialize context->option_state. (diagnostic_report_diagnostic): Pass option_state to option_enabled hook. * diagnostic.h (diagnostic_context.option_enabled): Add void * parameter. (diagnostic_context.option_state): New field. * final.c (final_start_function, final, final_scan_insn): Rename optimize parameter to optimize_p. * flags.h (optimize, optimize_size): Remove. * function.c (invoke_set_current_function_hook): Pass &global_options to cl_optimization_restore. * gcc.c (driver_handle_option): Take gcc_options parameter. Assert that it is &global_options. (process_command): Pass &global_options to read_cmdline_option. * ipa-pure-const.c (suggest_attribute): Pass &global_options to option_enabled. * lto-opts.c (lto_reissue_options): Use option_flag_var. Pass &global_options to set_option. * opts-common.c (handle_option, handle_generated_option, read_cmdline_option, set_option): Take explicit gcc_options parameters. Use option_flag_var. (option_flag_var): New. * opts.c (common_handle_option, lang_handle_option, target_handle_option): Take gcc_options parameter. Assert that it is &global_options. (read_cmdline_options): Pass &global_options to read_cmdline_option. (print_filtered_help): Use option_flag_var. Pass &global_options to option_enabled. (common_handle_option): Use option_flag_var. (option_enabled): Take opts parameter. Use option_flag_var. (get_option_state): Take gcc_options parameter. Use option_flag_var. Pass gcc_options parameter to option_enabled. (enable_warning_as_error): Pass &global_options to handle_generated_option. * opts.h (struct cl_option): Change flag_var to flag_var_offset. (cl_option_handler_func.handler): Take gcc_options parameter. (option_enabled, get_option_state, set_option, handle_option, handle_generated_option, read_cmdline_option): Take gcc_options parameters. * toplev.c (optimize, optimize_size): Remove. (print_switch_values): Pass &global_options to option_enabled. (option_affects_pch_p): Use option_flag_var. Pass &global_options to get_option_state. (general_init): Initialize global_dc->option_state. * tree.c (build_optimization_node): Pass &global_options to cl_optimization_save. (build_target_option_node): Pass &global_options to cl_target_option_save. c-family: * c-common.c (handle_optimize_attribute): Pass &global_options to cl_optimization_save and cl_optimization_restore. * c-opts.c (c_common_handle_option): Pass &global_options to handle_generated_option. * c-pragma.c (handle_pragma_diagnostic): Use option_flag_var. (handle_pragma_pop_options, handle_pragma_reset_options): Pass &global_options to cl_optimization_restore. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164751 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/opts.h')
-rw-r--r--gcc/opts.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/gcc/opts.h b/gcc/opts.h
index c4d253ff04a..6ede04d7b50 100644
--- a/gcc/opts.h
+++ b/gcc/opts.h
@@ -53,7 +53,7 @@ struct cl_option
unsigned char opt_len;
int neg_index;
unsigned int flags;
- void *flag_var;
+ unsigned short flag_var_offset;
enum cl_var_type var_type;
int var_value;
};
@@ -156,7 +156,8 @@ struct cl_decoded_option
struct cl_option_handler_func
{
/* The function called to handle the option. */
- bool (*handler) (const struct cl_decoded_option *decoded,
+ bool (*handler) (struct gcc_options *opts,
+ const struct cl_decoded_option *decoded,
unsigned int lang_mask, int kind,
const struct cl_option_handlers *handlers);
@@ -209,13 +210,18 @@ extern void decode_cmdline_options_to_array (unsigned int argc,
extern void decode_options (unsigned int argc, const char **argv,
struct cl_decoded_option **decoded_options,
unsigned int *decoded_options_count);
-extern int option_enabled (int opt_idx);
-extern bool get_option_state (int, struct cl_option_state *);
-extern void set_option (int opt_index, int value, const char *arg, int);
-bool handle_option (const struct cl_decoded_option *decoded,
+extern int option_enabled (int opt_idx, void *opts);
+extern bool get_option_state (struct gcc_options *, int,
+ struct cl_option_state *);
+extern void set_option (struct gcc_options *opts, int opt_index, int value,
+ const char *arg, int);
+extern void *option_flag_var (int opt_index, struct gcc_options *opts);
+bool handle_option (struct gcc_options *opts,
+ const struct cl_decoded_option *decoded,
unsigned int lang_mask, int kind,
const struct cl_option_handlers *handlers);
-bool handle_generated_option (size_t opt_index, const char *arg, int value,
+bool handle_generated_option (struct gcc_options *opts,
+ size_t opt_index, const char *arg, int value,
unsigned int lang_mask, int kind,
const struct cl_option_handlers *handlers);
void generate_option (size_t opt_index, const char *arg, int value,
@@ -223,7 +229,8 @@ void generate_option (size_t opt_index, const char *arg, int value,
struct cl_decoded_option *decoded);
void generate_option_input_file (const char *file,
struct cl_decoded_option *decoded);
-extern void read_cmdline_option (struct cl_decoded_option *decoded,
+extern void read_cmdline_option (struct gcc_options *opts,
+ struct cl_decoded_option *decoded,
unsigned int lang_mask,
const struct cl_option_handlers *handlers);
extern void register_warning_as_error_callback (void (*callback) (int));