diff options
author | Joseph Myers <joseph@codesourcery.com> | 2010-06-20 22:02:46 +0100 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2010-06-20 22:02:46 +0100 |
commit | 6e2f19568ad7378a11073048ffb2372045dc665a (patch) | |
tree | 2c4f1fab67e1d031a842bdda5d4777aed748b3b5 /gcc/varasm.c | |
parent | 1d63e3de09ef2a47b63f29db8da5289404cec4d1 (diff) | |
download | gcc-6e2f19568ad7378a11073048ffb2372045dc665a.tar.gz |
re PR other/32998 (-frecord-gcc-switches issues)
PR other/32998
* opth-gen.awk: Generate definitions of OPT_SPECIAL_unknown,
OPT_SPECIAL_program_name and OPT_SPECIAL_input_file.
* opts-common.c (find_opt): Return OPT_SPECIAL_unknown on failure.
(decode_cmdline_option): Update for this return value. Set
orig_option_with_args_text field. Set arg field for unknown
options. Make static.
(decode_cmdline_options_to_array): New.
(prune_options): Update handling of find_opt return value.
* opts.c (read_cmdline_option): Take decoded option. Return void.
(read_cmdline_options): Take decoded options.
(decode_options): Add parameters for decoded options. Use
decode_cmdline_options_to_array. Use decoded options for -O
scan. Use integral_argument for -O parameters. Update call to
read_cmdline_options.
(enable_warning_as_error): Update handling of find_opt return
value.
* opts.h: Update comment on unknown options.
(struct cl_decoded_option): Update comments on opt_index and arg.
Add orig_option_with_args_text.
(decode_cmdline_option): Remove.
(decode_cmdline_options_to_array): Declare.
(decode_options): Update prototype.
* toplev.c (save_argv): Remove.
(save_decoded_options, save_decoded_options_count): New.
(read_integral_parameter): Remove.
(print_switch_values): Use decoded options.
(toplev_main): Don't set save_argv. Update call to
decode_options.
* toplev.h (read_integral_parameter): Remove.
* varasm.c (elf_record_gcc_switches): Don't handle holding back
names.
c-family:
* c-common.c (parse_optimize_options): Update call to
decode_options.
fortran:
* options.c (gfc_handle_option): Don't handle N_OPTS.
testsuite:
* gcc.dg/opts-2.c: New test.
From-SVN: r161053
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r-- | gcc/varasm.c | 53 |
1 files changed, 3 insertions, 50 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c index 8ef41e3264b..98187c13cf2 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -7199,50 +7199,11 @@ output_object_blocks (void) int elf_record_gcc_switches (print_switch_type type, const char * name) { - static char buffer[1024]; - - /* This variable is used as part of a simplistic heuristic to detect - command line switches which take an argument: - - "If a command line option does not start with a dash then - it is an argument for the previous command line option." - - This fails in the case of the command line option which is the name - of the file to compile, but otherwise it is pretty reasonable. */ - static bool previous_name_held_back = FALSE; - switch (type) { case SWITCH_TYPE_PASSED: - if (* name != '-') - { - if (previous_name_held_back) - { - unsigned int len = strlen (buffer); - - snprintf (buffer + len, sizeof buffer - len, " %s", name); - ASM_OUTPUT_ASCII (asm_out_file, buffer, strlen (buffer)); - ASM_OUTPUT_SKIP (asm_out_file, (unsigned HOST_WIDE_INT) 1); - previous_name_held_back = FALSE; - } - else - { - strncpy (buffer, name, sizeof buffer); - ASM_OUTPUT_ASCII (asm_out_file, buffer, strlen (buffer)); - ASM_OUTPUT_SKIP (asm_out_file, (unsigned HOST_WIDE_INT) 1); - } - } - else - { - if (previous_name_held_back) - { - ASM_OUTPUT_ASCII (asm_out_file, buffer, strlen (buffer)); - ASM_OUTPUT_SKIP (asm_out_file, (unsigned HOST_WIDE_INT) 1); - } - - strncpy (buffer, name, sizeof buffer); - previous_name_held_back = TRUE; - } + ASM_OUTPUT_ASCII (asm_out_file, name, strlen (name)); + ASM_OUTPUT_SKIP (asm_out_file, (unsigned HOST_WIDE_INT) 1); break; case SWITCH_TYPE_DESCRIPTIVE: @@ -7251,15 +7212,7 @@ elf_record_gcc_switches (print_switch_type type, const char * name) /* Distinguish between invocations where name is NULL. */ static bool started = false; - if (started) - { - if (previous_name_held_back) - { - ASM_OUTPUT_ASCII (asm_out_file, buffer, strlen (buffer)); - ASM_OUTPUT_SKIP (asm_out_file, (unsigned HOST_WIDE_INT) 1); - } - } - else + if (!started) { section * sec; |