aboutsummaryrefslogtreecommitdiff
path: root/gcc/opts-common.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2010-09-03 21:00:05 +0000
committerJoseph Myers <joseph@codesourcery.com>2010-09-03 21:00:05 +0000
commitdebe77024ae9af66525d76f82e8d2ecefa80fdad (patch)
tree4c595a910219a400780aabf660892ec4ce06400f /gcc/opts-common.c
parent06e885642fa1ed98ccdbb572c816c72afc6327f1 (diff)
* doc/options.texi (SeparateAlias): Document.
* opt-functions.awk (switch_flags): Handle SeparateAlias. * opth-gen.awk: Generate enumeration names for options marked SeparateAlias, but not for those marked Ignore. * opts-common.c (generate_canonical_option): Don't output separate argument for options marked CL_SEPARATE_ALIAS. (decode_cmdline_option): Handle CL_SEPARATE_ALIAS. * opts.h (CL_SEPARATE_ALIAS): New. (CL_PARAMS, CL_WARNING, CL_OPTIMIZATION, CL_DRIVER, CL_TARGET, CL_COMMON): Adjust definitions. * config/i386/darwin.opt, config/mips/sde.opt: New. * common.opt (fdump-final-insns): New. * config.gcc (i[34567]86-*-darwin*, x86_64-*-darwin*): Add i386/darwin.opt. (mips*-sde-elf*): Add mips/sde.opt. * config/mips/sde.h (DRIVER_SELF_SPECS): Don't handle -mno-data-in-code and -mcode-xonly here. * defaults.h (DEFAULT_SWITCH_TAKES_ARG): Add 'd'. * gcc.c (option_map): Add "j" to --dump entry. (translate_options): Don't translate -d to -foutput-class-dir= here. java: * lang.opt (d): New. testsuite: * gcc.dg/opts-4.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@163844 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/opts-common.c')
-rw-r--r--gcc/opts-common.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/opts-common.c b/gcc/opts-common.c
index 40822a7bde1..8299edd4ab9 100644
--- a/gcc/opts-common.c
+++ b/gcc/opts-common.c
@@ -174,7 +174,8 @@ generate_canonical_option (size_t opt_index, const char *arg, int value,
if (arg)
{
- if (option->flags & CL_SEPARATE)
+ if ((option->flags & CL_SEPARATE)
+ && !(option->flags & CL_SEPARATE_ALIAS))
{
decoded->canonical_option[0] = opt_text;
decoded->canonical_option[1] = arg;
@@ -217,6 +218,7 @@ decode_cmdline_option (const char **argv, unsigned int lang_mask,
const char *warn_message = NULL;
bool separate_arg_flag;
bool joined_arg_flag;
+ bool have_separate_arg = false;
opt = argv[0];
@@ -286,6 +288,8 @@ decode_cmdline_option (const char **argv, unsigned int lang_mask,
result = 2;
if (arg == NULL)
result = 1;
+ else
+ have_separate_arg = true;
}
else
/* Missing argument. */
@@ -298,6 +302,8 @@ decode_cmdline_option (const char **argv, unsigned int lang_mask,
result = 2;
if (arg == NULL)
result = 1;
+ else
+ have_separate_arg = true;
}
if (arg == NULL && (separate_arg_flag || joined_arg_flag))
@@ -305,7 +311,8 @@ decode_cmdline_option (const char **argv, unsigned int lang_mask,
/* Is this option an alias (or an ignored option, marked as an alias
of OPT_SPECIAL_ignore)? */
- if (option->alias_target != N_OPTS)
+ if (option->alias_target != N_OPTS
+ && (!(option->flags & CL_SEPARATE_ALIAS) || have_separate_arg))
{
size_t new_opt_index = option->alias_target;