diff options
author | nickc <nickc@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-02-12 16:25:14 +0000 |
---|---|---|
committer | nickc <nickc@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-02-12 16:25:14 +0000 |
commit | 87c75316828e972767fe35aac2eebd58847831a9 (patch) | |
tree | 8132cd1fbca1d1ba829d2d5f28f606f2e09d28b2 /gcc/gcc.c | |
parent | 1dffd068f1f11c688c08d6f564540cb4eb81fa34 (diff) | |
download | gcc-87c75316828e972767fe35aac2eebd58847831a9.tar.gz |
* doc/invoke.texi (Overall Options): Document --help=.
* gcc.c (target_help_flag): Rename to print_subprocess_flag.
(cc1_options): Pass --help= on to cc1.
(display_help): Add description of --help=.
(process_command): Add code to handle --help=. Allow translated
--help and --target-help switches to be passed on to compiler sub-process.
(main): Remove unused if statement.
* opts.c (columns): Remove.
(LEFT_COLUMN): Define.
(wrap_help): Add columns argument.
(print_filtered_help): Change parameters to be an include bitmask,
an exclude bitmask, an any bitmask and the column width. Move the
code to display the params list here. Add code to display the
status of options rather than their descriptions if the quiet flag
is not active.
(print_specific_help): Change parameters to be an include bitmask,
an exclude bitmask and an any bitmask. Move code to look up the
column width here. Decide upon the title for an options listing.
(common_handle_options): Add code to handle --help=. Adapt code
for --help and --target-help to use the revised form of the
print_specific_help function.
(print_help): Delete.
(print_param_help): Delete.
(print_switch): Delete.
* opts.h (cl_lang_count): Add prototype.
(CL_PARAMS, CL_WARNING, CL_OPTIMIZATION, CL_MIN_OPTION_CLASS, CL_MAX_OPTION_CLASS): New defines.
* optc-gen.awk: Add construction of cl_lang_count.
* c.opt: Add Warning attribute to warning options and Optimization attribute to optimization options.
* common.opt: Likewise.
Add --help=.
Add -fhelp and -ftarget-help as aliases for the transformed --help and --target-help options.
* opt-functions.awk: Add code to handle Warning and Optimization attributes.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121849 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r-- | gcc/gcc.c | 64 |
1 files changed, 21 insertions, 43 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c index a7bb71e8760..14e4ceea71f 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -1,7 +1,7 @@ /* Compiler driver program that can handle many languages. Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, - Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. This file is part of GCC. @@ -179,9 +179,9 @@ static int verbose_flag; shell scripts to capture the driver-generated command line. */ static int verbose_only_flag; -/* Flag indicating to print target specific command line options. */ +/* Flag indicating how to print command line options of sub-processes. */ -static int target_help_flag; +static int print_subprocess_help; /* Flag indicating whether we should report subprocess execution times (if this is supported by the system - see pexecute.c). */ @@ -805,6 +805,7 @@ static const char *cc1_options = %{v:-version} %{pg:-p} %{p} %{f*} %{undef}\ %{Qn:-fno-ident} %{--help:--help}\ %{--target-help:--target-help}\ + %{--help=*:--help=%(VALUE)}\ %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\ %{fsyntax-only:-o %j} %{-param*}\ %{fmudflap|fmudflapth:-fno-builtin -fno-merge-constants}\ @@ -1492,7 +1493,7 @@ static const char *const standard_exec_prefix_2 = "/usr/lib/gcc/"; static const char *md_exec_prefix = MD_EXEC_PREFIX; static const char *md_startfile_prefix = MD_STARTFILE_PREFIX; static const char *md_startfile_prefix_1 = MD_STARTFILE_PREFIX_1; -static const char *const standard_startfile_prefix_1 +static const char *const standard_startfile_prefix_1 = STANDARD_STARTFILE_PREFIX_1; static const char *const standard_startfile_prefix_2 = STANDARD_STARTFILE_PREFIX_2; @@ -3174,6 +3175,8 @@ display_help (void) fputs (_(" -pass-exit-codes Exit with highest error code from a phase\n"), stdout); fputs (_(" --help Display this information\n"), stdout); fputs (_(" --target-help Display target specific command line options\n"), stdout); + fputs (_(" --help={target|optimizers|warnings|undocumented|params}[,{[^]joined|[^]separate}]\n"), stdout); + fputs (_(" Display specific types of command line options\n"), stdout); if (! verbose_flag) fputs (_(" (Use '-v --help' to display command line options of sub-processes)\n"), stdout); fputs (_(" -dumpspecs Display all of the built in spec strings\n"), stdout); @@ -3589,10 +3592,19 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n" add_assembler_option ("--help", 6); add_linker_option ("--help", 6); } + else if (strncmp (argv[i], "-fhelp=", 7) == 0) + { + /* translate_options () has turned --help into -fhelp. */ + print_subprocess_help = 2; + + /* We will be passing a dummy file on to the sub-processes. */ + n_infiles++; + n_switches++; + } else if (strcmp (argv[i], "-ftarget-help") == 0) { /* translate_options() has turned --target-help into -ftarget-help. */ - target_help_flag = 1; + print_subprocess_help = 1; /* We will be passing a dummy file on to the sub-processes. */ n_infiles++; @@ -4074,10 +4086,6 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n" ; else if (! strcmp (argv[i], "-print-multi-os-directory")) ; - else if (! strcmp (argv[i], "-ftarget-help")) - ; - else if (! strcmp (argv[i], "-fhelp")) - ; else if (! strncmp (argv[i], "--sysroot=", strlen ("--sysroot="))) { target_system_root = argv[i] + strlen ("--sysroot="); @@ -4243,34 +4251,14 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n" error ("warning: '-x %s' after last input file has no effect", spec_lang); /* Ensure we only invoke each subprocess once. */ - if (target_help_flag || print_help_list) + if (print_subprocess_help || print_help_list) { n_infiles = 1; - /* Create a dummy input file, so that we can pass --target-help on to - the various sub-processes. */ + /* Create a dummy input file, so that we can pass + the help option on to the various sub-processes. */ infiles[0].language = "c"; infiles[0].name = "help-dummy"; - - if (target_help_flag) - { - switches[n_switches].part1 = "--target-help"; - switches[n_switches].args = 0; - switches[n_switches].live_cond = SWITCH_OK; - switches[n_switches].validated = 0; - - n_switches++; - } - - if (print_help_list) - { - switches[n_switches].part1 = "--help"; - switches[n_switches].args = 0; - switches[n_switches].live_cond = SWITCH_OK; - switches[n_switches].validated = 0; - - n_switches++; - } } switches[n_switches].part1 = 0; @@ -6421,16 +6409,6 @@ main (int argc, char **argv) return (0); } - if (target_help_flag) - { - /* Print if any target specific options. */ - - /* We do not exit here. Instead we have created a fake input file - called 'target-dummy' which needs to be compiled, and we pass this - on to the various sub-processes, along with the --target-help - switch. */ - } - if (print_help_list) { display_help (); |