Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
b8468bc7
Commit
b8468bc7
authored
Jul 13, 1998
by
Nick Clifton
Committed by
Nick Clifton
Jul 13, 1998
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add --help option.
From-SVN: r21109
parent
c6b0465b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
343 additions
and
58 deletions
+343
-58
gcc/ChangeLog
+19
-0
gcc/cccp.c
+79
-1
gcc/cpplib.c
+83
-3
gcc/gcc.c
+147
-42
gcc/tm.texi
+15
-12
gcc/toplev.c
+0
-0
No files found.
gcc/ChangeLog
View file @
b8468bc7
Mon Jul 13 17:18:47 1998 Nick Clifton <nickc@cygnus.com>
* cccp.c (main): Add support for parsing --help.
(display_help): New function: display command line switches.
* cpplib.c (cpp_handle_option): Add support for parsing --help.
(display_help): New function: display command line switches.
* gcc.c (main): Add support for parsing --help, and passing it on
to the sub-processes invoked by gcc.
(display_help): New function: display comman line switches.
* tm.texi (TARGET_SWITCHES and TARGET_OPTIONS): Document
'description' field added to structure.
* toplev.c: Add support for parsing --help.
Add documentation strings to command line option tables.
(display_help): New function: display comman line switches.
Mon Jul 13 16:15:10 1998 John Carr <jfc@mit.edu>
Mon Jul 13 16:15:10 1998 John Carr <jfc@mit.edu>
* sparc.c, sparc.h, sparc.md: New trampoline code.
* sparc.c, sparc.h, sparc.md: New trampoline code.
...
...
gcc/cccp.c
View file @
b8468bc7
...
@@ -1047,6 +1047,7 @@ GENERIC_PTR xmalloc PROTO((size_t));
...
@@ -1047,6 +1047,7 @@ GENERIC_PTR xmalloc PROTO((size_t));
static
GENERIC_PTR
xrealloc
PROTO
((
GENERIC_PTR
,
size_t
));
static
GENERIC_PTR
xrealloc
PROTO
((
GENERIC_PTR
,
size_t
));
static
GENERIC_PTR
xcalloc
PROTO
((
size_t
,
size_t
));
static
GENERIC_PTR
xcalloc
PROTO
((
size_t
,
size_t
));
static
char
*
savestring
PROTO
((
char
*
));
static
char
*
savestring
PROTO
((
char
*
));
static
void
print_help
PROTO
((
void
));
/* Read LEN bytes at PTR from descriptor DESC, for file FILENAME,
/* Read LEN bytes at PTR from descriptor DESC, for file FILENAME,
retrying if necessary. If MAX_READ_LEN is defined, read at most
retrying if necessary. If MAX_READ_LEN is defined, read at most
...
@@ -1146,6 +1147,73 @@ eprint_string (string, length)
...
@@ -1146,6 +1147,73 @@ eprint_string (string, length)
}
}
static
void
print_help
()
{
printf
(
"Usage: %s [switches] input output
\n
"
,
progname
);
printf
(
"Switches:
\n
"
);
printf
(
" -include <file> Include the contents of <file> before other files
\n
"
);
printf
(
" -imacros <file> Accept definition of marcos in <file>
\n
"
);
printf
(
" -iprefix <path> Specify <path> as a prefix for next two options
\n
"
);
printf
(
" -iwithprefix <dir> Add <dir> to the end of the system include paths
\n
"
);
printf
(
" -iwithprefixbefore <dir> Add <dir> to the end of the main include paths
\n
"
);
printf
(
" -isystem <dir> Add <dir> to the start of the system include paths
\n
"
);
printf
(
" -idirafter <dir> Add <dir> to the end of the system include paths
\n
"
);
printf
(
" -I <dir> Add <dir> to the end of the main include paths
\n
"
);
printf
(
" -nostdinc Do not search the system include directories
\n
"
);
printf
(
" -nostdinc++ Do not search the system include directories for C++
\n
"
);
printf
(
" -o <file> Put output into <file>
\n
"
);
printf
(
" -pedantic Issue all warnings demanded by strict ANSI C
\n
"
);
printf
(
" -traditional Follow K&R pre-processor behaviour
\n
"
);
printf
(
" -trigraphs Support ANSI C trigraphs
\n
"
);
printf
(
" -lang-c Assume that the input sources are in C
\n
"
);
printf
(
" -lang-c89 Assume that the input sources are in C89
\n
"
);
printf
(
" -lang-c++ Assume that the input sources are in C++
\n
"
);
printf
(
" -lang-objc Assume that the input sources are in ObjectiveC
\n
"
);
printf
(
" -lang-objc++ Assume that the input sources are in ObjectiveC++
\n
"
);
printf
(
" -lang-asm Assume that the input sources are in assembler
\n
"
);
printf
(
" -lang-chill Assume that the input sources are in Chill
\n
"
);
printf
(
" -+ Allow parsing of C++ style features
\n
"
);
printf
(
" -w Inhibit warning messages
\n
"
);
printf
(
" -Wtrigraphs Warn if trigraphs are encountered
\n
"
);
printf
(
" -Wno-trigraphs Do not warn about trigraphs
\n
"
);
printf
(
" -Wcomment{s} Warn if one comment starts inside another
\n
"
);
printf
(
" -Wno-comment{s} Do not warn about comments
\n
"
);
printf
(
" -Wtraditional Warn if a macro argument is/would be turned into
\n
"
);
printf
(
" a string if -tradtional is specified
\n
"
);
printf
(
" -Wno-traditional Do not warn about stringification
\n
"
);
printf
(
" -Wundef Warn if an undefined macro is used by #if
\n
"
);
printf
(
" -Wno-undef Do not warn about testing udefined macros
\n
"
);
printf
(
" -Wimport Warn about the use of the #import directive
\n
"
);
printf
(
" -Wno-import Do not warn about the use of #import
\n
"
);
printf
(
" -Werror Treat all warnings as errors
\n
"
);
printf
(
" -Wno-error Do not treat warnings as errors
\n
"
);
printf
(
" -Wall Enable all preprocessor warnings
\n
"
);
printf
(
" -M Generate make dependencies
\n
"
);
printf
(
" -MM As -M, but ignore system header files
\n
"
);
printf
(
" -MD As -M, but put output in a .d file
\n
"
);
printf
(
" -MMD As -MD, but ignore system header files
\n
"
);
printf
(
" -MG Treat missing header file as generated files
\n
"
);
printf
(
" -g Include #define and #undef directives in the output
\n
"
);
printf
(
" -D<macro> Define a <macro> with string '1' as its value
\n
"
);
printf
(
" -D<macro>=<val> Define a <macro> with <val> as its value
\n
"
);
printf
(
" -A<question> (<answer>) Assert the <answer> to <question>
\n
"
);
printf
(
" -U<macro> Undefine <macro>
\n
"
);
printf
(
" -u or -undef Do not predefine any macros
\n
"
);
printf
(
" -v Display the version number
\n
"
);
printf
(
" -H Print the name of header files as they are used
\n
"
);
printf
(
" -C Do not discard comments
\n
"
);
printf
(
" -dM Display a list of macro definitions active at end
\n
"
);
printf
(
" -dD Preserve macro definitions in output
\n
"
);
printf
(
" -dN As -dD except that only the names are preserved
\n
"
);
printf
(
" -dI Include #include directives in the output
\n
"
);
printf
(
" -ifoutput Describe skipped code blocks in output
\n
"
);
printf
(
" -P Do not generate #line directives
\n
"
);
printf
(
" -$ Do not include '$' in identifiers
\n
"
);
printf
(
" -remap Remap file names when including files.
\n
"
);
printf
(
" -h or --help Display this information
\n
"
);
}
int
int
main
(
argc
,
argv
)
main
(
argc
,
argv
)
int
argc
;
int
argc
;
...
@@ -1245,7 +1313,10 @@ main (argc, argv)
...
@@ -1245,7 +1313,10 @@ main (argc, argv)
for
(
i
=
1
;
i
<
argc
;
i
++
)
{
for
(
i
=
1
;
i
<
argc
;
i
++
)
{
if
(
argv
[
i
][
0
]
!=
'-'
)
{
if
(
argv
[
i
][
0
]
!=
'-'
)
{
if
(
out_fname
!=
NULL
)
if
(
out_fname
!=
NULL
)
fatal
(
"Usage: %s [switches] input output"
,
argv
[
0
]);
{
print_help
();
fatal
(
"Too many arguments"
);
}
else
if
(
in_fname
!=
NULL
)
else
if
(
in_fname
!=
NULL
)
out_fname
=
argv
[
i
];
out_fname
=
argv
[
i
];
else
else
...
@@ -1525,6 +1596,13 @@ main (argc, argv)
...
@@ -1525,6 +1596,13 @@ main (argc, argv)
debug_output
=
1
;
debug_output
=
1
;
break
;
break
;
case
'-'
:
if
(
strcmp
(
argv
[
i
],
"--help"
)
!=
0
)
return
i
;
print_help
();
exit
(
0
);
break
;
case
'v'
:
case
'v'
:
fprintf
(
stderr
,
"GNU CPP version %s"
,
version_string
);
fprintf
(
stderr
,
"GNU CPP version %s"
,
version_string
);
#ifdef TARGET_VERSION
#ifdef TARGET_VERSION
...
...
gcc/cpplib.c
View file @
b8468bc7
...
@@ -251,7 +251,8 @@ static char *savestring PROTO ((char *));
...
@@ -251,7 +251,8 @@ static char *savestring PROTO ((char *));
static
void
conditional_skip
PROTO
((
cpp_reader
*
,
int
,
static
void
conditional_skip
PROTO
((
cpp_reader
*
,
int
,
enum
node_type
,
U_CHAR
*
));
enum
node_type
,
U_CHAR
*
));
static
void
skip_if_group
PROTO
((
cpp_reader
*
,
int
));
static
void
skip_if_group
PROTO
((
cpp_reader
*
,
int
));
static
int
parse_name
PARAMS
((
cpp_reader
*
,
int
));
static
int
parse_name
PARAMS
((
cpp_reader
*
,
int
));
static
void
print_help
PROTO
((
void
));
/* Last arg to output_line_command. */
/* Last arg to output_line_command. */
enum
file_change_code
{
same_file
,
enter_file
,
leave_file
};
enum
file_change_code
{
same_file
,
enter_file
,
leave_file
};
...
@@ -6235,6 +6236,79 @@ push_pending (pfile, cmd, arg)
...
@@ -6235,6 +6236,79 @@ push_pending (pfile, cmd, arg)
CPP_OPTIONS
(
pfile
)
->
pending
=
pend
;
CPP_OPTIONS
(
pfile
)
->
pending
=
pend
;
}
}
static
void
print_help
()
{
printf
(
"Usage: %s [switches] input output
\n
"
,
progname
);
printf
(
"Switches:
\n
"
);
/* start-sanitize-obscured-headers */
printf
(
" -fgenobscured=<args> Generate obscured versions of header files used
\n
"
);
printf
(
" -fuseobscured=<args> Search for obscured versions of header files
\n
"
);
/* end-sanitize-obscured-headers */
printf
(
" -include <file> Include the contents of <file> before other files
\n
"
);
printf
(
" -imacros <file> Accept definition of marcos in <file>
\n
"
);
printf
(
" -iprefix <path> Specify <path> as a prefix for next two options
\n
"
);
printf
(
" -iwithprefix <dir> Add <dir> to the end of the system include paths
\n
"
);
printf
(
" -iwithprefixbefore <dir> Add <dir> to the end of the main include paths
\n
"
);
printf
(
" -isystem <dir> Add <dir> to the start of the system include paths
\n
"
);
printf
(
" -idirafter <dir> Add <dir> to the end of the system include paths
\n
"
);
printf
(
" -I <dir> Add <dir> to the end of the main include paths
\n
"
);
printf
(
" -nostdinc Do not search the system include directories
\n
"
);
printf
(
" -nostdinc++ Do not search the system include directories for C++
\n
"
);
printf
(
" -o <file> Put output into <file>
\n
"
);
printf
(
" -pedantic Issue all warnings demanded by strict ANSI C
\n
"
);
printf
(
" -traditional Follow K&R pre-processor behaviour
\n
"
);
printf
(
" -trigraphs Support ANSI C trigraphs
\n
"
);
printf
(
" -lang-c Assume that the input sources are in C
\n
"
);
printf
(
" -lang-c89 Assume that the input sources are in C89
\n
"
);
printf
(
" -lang-c++ Assume that the input sources are in C++
\n
"
);
printf
(
" -lang-objc Assume that the input sources are in ObjectiveC
\n
"
);
printf
(
" -lang-objc++ Assume that the input sources are in ObjectiveC++
\n
"
);
printf
(
" -lang-asm Assume that the input sources are in assembler
\n
"
);
printf
(
" -lang-chill Assume that the input sources are in Chill
\n
"
);
printf
(
" -+ Allow parsing of C++ style features
\n
"
);
printf
(
" -w Inhibit warning messages
\n
"
);
printf
(
" -Wtrigraphs Warn if trigraphs are encountered
\n
"
);
printf
(
" -Wno-trigraphs Do not warn about trigraphs
\n
"
);
printf
(
" -Wcomment{s} Warn if one comment starts inside another
\n
"
);
printf
(
" -Wno-comment{s} Do not warn about comments
\n
"
);
printf
(
" -Wtraditional Warn if a macro argument is/would be turned into
\n
"
);
printf
(
" a string if -tradtional is specified
\n
"
);
printf
(
" -Wno-traditional Do not warn about stringification
\n
"
);
printf
(
" -Wundef Warn if an undefined macro is used by #if
\n
"
);
printf
(
" -Wno-undef Do not warn about testing udefined macros
\n
"
);
printf
(
" -Wimport Warn about the use of the #import directive
\n
"
);
printf
(
" -Wno-import Do not warn about the use of #import
\n
"
);
printf
(
" -Werror Treat all warnings as errors
\n
"
);
printf
(
" -Wno-error Do not treat warnings as errors
\n
"
);
printf
(
" -Wall Enable all preprocessor warnings
\n
"
);
printf
(
" -M Generate make dependencies
\n
"
);
printf
(
" -MM As -M, but ignore system header files
\n
"
);
printf
(
" -MD As -M, but put output in a .d file
\n
"
);
printf
(
" -MMD As -MD, but ignore system header files
\n
"
);
printf
(
" -MG Treat missing header file as generated files
\n
"
);
printf
(
" -g Include #define and #undef directives in the output
\n
"
);
printf
(
" -D<macro> Define a <macro> with string '1' as its value
\n
"
);
printf
(
" -D<macro>=<val> Define a <macro> with <val> as its value
\n
"
);
printf
(
" -A<question> (<answer>) Assert the <answer> to <question>
\n
"
);
printf
(
" -U<macro> Undefine <macro>
\n
"
);
printf
(
" -u or -undef Do not predefine any macros
\n
"
);
printf
(
" -v Display the version number
\n
"
);
printf
(
" -H Print the name of header files as they are used
\n
"
);
printf
(
" -C Do not discard comments
\n
"
);
printf
(
" -dM Display a list of macro definitions active at end
\n
"
);
printf
(
" -dD Preserve macro definitions in output
\n
"
);
printf
(
" -dN As -dD except that only the names are preserved
\n
"
);
printf
(
" -dI Include #include directives in the output
\n
"
);
printf
(
" -ifoutput Describe skipped code blocks in output
\n
"
);
printf
(
" -P Do not generate #line directives
\n
"
);
printf
(
" -$ Do not include '$' in identifiers
\n
"
);
printf
(
" -remap Remap file names when including files.
\n
"
);
printf
(
" -h or --help Display this information
\n
"
);
}
/* Handle one command-line option in (argc, argv).
/* Handle one command-line option in (argc, argv).
Can be called multiple times, to handle multiple sets of options.
Can be called multiple times, to handle multiple sets of options.
Returns number of strings consumed. */
Returns number of strings consumed. */
...
@@ -6249,8 +6323,8 @@ cpp_handle_option (pfile, argc, argv)
...
@@ -6249,8 +6323,8 @@ cpp_handle_option (pfile, argc, argv)
if
(
argv
[
i
][
0
]
!=
'-'
)
{
if
(
argv
[
i
][
0
]
!=
'-'
)
{
if
(
opts
->
out_fname
!=
NULL
)
if
(
opts
->
out_fname
!=
NULL
)
{
{
cpp_fatal
(
pfile
,
"Usage: %s [switches] input output"
,
argv
[
0
]
);
print_help
(
);
return
argc
;
cpp_fatal
(
pfile
,
"Too many arguments"
)
;
}
}
else
if
(
opts
->
in_fname
!=
NULL
)
else
if
(
opts
->
in_fname
!=
NULL
)
opts
->
out_fname
=
argv
[
i
];
opts
->
out_fname
=
argv
[
i
];
...
@@ -6576,6 +6650,12 @@ cpp_handle_option (pfile, argc, argv)
...
@@ -6576,6 +6650,12 @@ cpp_handle_option (pfile, argc, argv)
opts
->
debug_output
=
1
;
opts
->
debug_output
=
1
;
break
;
break
;
case
'-'
:
if
(
strcmp
(
argv
[
i
],
"--help"
)
!=
0
)
return
i
;
print_help
();
break
;
case
'v'
:
case
'v'
:
fprintf
(
stderr
,
"GNU CPP version %s"
,
version_string
);
fprintf
(
stderr
,
"GNU CPP version %s"
,
version_string
);
#ifdef TARGET_VERSION
#ifdef TARGET_VERSION
...
...
gcc/gcc.c
View file @
b8468bc7
This diff is collapsed.
Click to expand it.
gcc/tm.texi
View file @
b8468bc7
...
@@ -546,10 +546,13 @@ bits in @code{target_flags}. Its definition is an initializer
...
@@ -546,10 +546,13 @@ bits in @code{target_flags}. Its definition is an initializer
with
a
subgrouping
for
each
command
option
.
with
a
subgrouping
for
each
command
option
.
Each
subgrouping
contains
a
string
constant
,
that
defines
the
option
Each
subgrouping
contains
a
string
constant
,
that
defines
the
option
name
,
and
a
number
,
which
contains
the
bits
to
set
in
name
,
a
number
,
which
contains
the
bits
to
set
in
@code
{
target_flags
}.
A
negative
number
says
to
clear
bits
instead
;
@code
{
target_flags
},
and
a
second
string
which
is
the
description
the
negative
of
the
number
is
which
bits
to
clear
.
The
actual
option
displayed
by
--
help
.
If
the
number
is
negative
then
the
bits
specified
name
is
made
by
appending
@samp
{
-
m
}
to
the
specified
name
.
by
the
number
are
cleared
instead
of
being
set
.
If
the
description
string
is
present
but
empty
,
then
no
help
information
will
be
displayed
for
that
option
,
but
it
will
not
count
as
an
undocumented
option
.
The
actual
option
name
is
made
by
appending
@samp
{
-
m
}
to
the
specified
name
.
One
of
the
subgroupings
should
have
a
null
string
.
The
number
in
One
of
the
subgroupings
should
have
a
null
string
.
The
number
in
this
grouping
is
the
default
value
for
@code
{
target_flags
}.
Any
this
grouping
is
the
default
value
for
@code
{
target_flags
}.
Any
...
@@ -560,9 +563,9 @@ with opposite meanings, and picks the latter as the default:
...
@@ -560,9 +563,9 @@ with opposite meanings, and picks the latter as the default:
@smallexample
@smallexample
#define TARGET_SWITCHES \
#define TARGET_SWITCHES \
@{ @{ "68020", 1@}, \
@{ @{ "68020", 1
, ""
@}, \
@{ "68000", -1
@},
\
@{ "68000", -1
, "Compile for the 68000" @},
\
@{ "", 1@}@}
@{ "", 1
, ""
@}@}
@end
smallexample
@end
smallexample
@findex
TARGET_OPTIONS
@findex
TARGET_OPTIONS
...
@@ -572,10 +575,10 @@ options that have values. Its definition is an initializer with a
...
@@ -572,10 +575,10 @@ options that have values. Its definition is an initializer with a
subgrouping
for
each
command
option
.
subgrouping
for
each
command
option
.
Each
subgrouping
contains
a
string
constant
,
that
defines
the
fixed
part
Each
subgrouping
contains
a
string
constant
,
that
defines
the
fixed
part
of
the
option
name
,
and
the
address
of
a
variable
.
The
variable
,
type
of
the
option
name
,
the
address
of
a
variable
,
and
a
description
string
.
@code
{
char
*
},
is
set
to
the
variable
part
of
the
given
option
if
the
fixed
The
variable
,
type
@code
{
char
*
},
is
set
to
the
variable
part
of
the
part
matches
.
The
actual
option
name
is
made
by
appending
@samp
{
-
m
}
to
th
e
given
option
if
the
fixed
part
matches
.
The
actual
option
name
is
mad
e
specified
name
.
by
appending
@samp
{
-
m
}
to
the
specified
name
.
Here
is
an
example
which
defines
@samp
{
-
mshort
-
data
-
@var
{
number
}}.
If
the
Here
is
an
example
which
defines
@samp
{
-
mshort
-
data
-
@var
{
number
}}.
If
the
given
option
is
@samp
{
-
mshort
-
data
-
512
},
the
variable
@code
{
m88k_short_data
}
given
option
is
@samp
{
-
mshort
-
data
-
512
},
the
variable
@code
{
m88k_short_data
}
...
@@ -584,7 +587,7 @@ will be set to the string @code{"512"}.
...
@@ -584,7 +587,7 @@ will be set to the string @code{"512"}.
@smallexample
@smallexample
extern
char
*
m88k_short_data
;
extern
char
*
m88k_short_data
;
#define TARGET_OPTIONS \
#define TARGET_OPTIONS \
@{ @{ "short-data-", &m88k_short_data @} @}
@{ @{ "short-data-", &m88k_short_data
, "Specify the size of the short data section"
@} @}
@end
smallexample
@end
smallexample
@findex
TARGET_VERSION
@findex
TARGET_VERSION
...
...
gcc/toplev.c
View file @
b8468bc7
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment