Commit fef3106c by Neil Booth Committed by Neil Booth

Makefile.in (c-opts.o, [...]): Update dependencies.

	* Makefile.in (c-opts.o, c-options.h): Update dependencies.
	* c-opts.c: Include c-options.h and c-options.c.
	(CL_C_ONLY, CL_OBJC_ONLY, CL_CXX_ONLY, CL_OBJCXX_ONLY):
	Rename CL_C, CL_OBJC, CL_CXX, CL_OBJCXX.
	(CL_ARG, CL_ALL, COMMAND_LINE_OPTIONS, struct cl_option,
	OPT, opt_comp): Remove.
	(missing_arg, c_common_init_options, c_common_decode_option,
	write_langs): Update for macro redefinitions and enumeration
	name changes.
	* c.opt, opts.sh: New files.
	* doc/passes.texi: Update.

From-SVN: r67278
parent 5f90145a
2003-05-31 Neil Booth <neil@daikokuya.co.uk>
* Makefile.in (c-opts.o, c-options.h): Update dependencies.
* c-opts.c: Include c-options.h and c-options.c.
(CL_C_ONLY, CL_OBJC_ONLY, CL_CXX_ONLY, CL_OBJCXX_ONLY):
Rename CL_C, CL_OBJC, CL_CXX, CL_OBJCXX.
(CL_ARG, CL_ALL, COMMAND_LINE_OPTIONS, struct cl_option,
OPT, opt_comp): Remove.
(missing_arg, c_common_init_options, c_common_decode_option,
write_langs): Update for macro redefinitions and enumeration
name changes.
* c.opt, opts.sh: New files.
* doc/passes.texi: Update.
2003-05-31 Andreas Jaeger <aj@suse.de>
* function.c (trampoline_address): Remove ALLOCATE_TRAMPOLINE
......
......@@ -1316,10 +1316,13 @@ c-pretty-print.o : c-pretty-print.c c-pretty-print.h pretty-print.h \
c-opts.o : c-opts.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
c-pragma.h flags.h toplev.h langhooks.h tree-inline.h diagnostic.h \
intl.h debug.h $(C_COMMON_H)
intl.h debug.h $(C_COMMON_H) c-options.h c-options.c
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
$< $(OUTPUT_OPTION) @TARGET_SYSTEM_ROOT_DEFINE@
c-options.h c-options.c: c.opt $(srcdir)/opts.sh
$(SHELL) $(srcdir)/opts.sh c-options.c c-options.h $(srcdir)/c.opt
c-cppbuiltin.o : c-cppbuiltin.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) $(C_COMMON_H) c-pragma.h flags.h toplev.h langhooks.h \
output.h except.h real.h $(TM_P_H)
......
; Options for the C, ObjC, C++ and ObjC++ front ends.
; Copyright (C) 2003 Free Software Foundation, Inc.
;
; This file is part of GCC.
;
; GCC is free software; you can redistribute it and/or modify it under
; the terms of the GNU General Public License as published by the Free
; Software Foundation; either version 2, or (at your option) any later
; version.
;
; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
; WARRANTY; without even the implied warranty of MERCHANTABILITY or
; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
; for more details.
;
; You should have received a copy of the GNU General Public License
; along with GCC; see the file COPYING. If not, write to the Free
; Software Foundation, 59 Temple Place - Suite 330, Boston, MA
; 02111-1307, USA.
; This file is processed by the script opts.sh. It is a database of
; command line options, with each record separated by a blank line,
; and each field appearing on its own line. The first field is the
; command-line switch with the leading "-" removed. All options
; beginning with "f" or "W" are implicitly assumed to take a "no-"
; form; this form should not be listed.
; The second field is a space-separated list of which parts of the
; compiler recognize the switch. Current valid entries are "C",
; "ObjC", "C++" and "ObjC++". If the switch takes an argument, then
; you should also specify "Joined" and/or "Separate" to indicate where
; the argument can appear.
; Comments can appear on their own line anwhere in the file, preceded
; by a semicolon. Whitespace is permitted before the semicolon.
; For each switch XXX below, an enumeration constant is created by the
; script opts.sh spelt OPT_XXX, but with all non-alphanumeric
; characters replaced with an underscore.
; Please try to keep this file in ASCII collating order.
-help
C ObjC C++ ObjC++
-output-pch=
C ObjC C++ ObjC++ Joined Separate
A
C ObjC C++ ObjC++ Joined Separate
C
C ObjC C++ ObjC++
CC
C ObjC C++ ObjC++
D
C ObjC C++ ObjC++ Joined Separate
E
C ObjC C++ ObjC++
H
C ObjC C++ ObjC++
I
C ObjC C++ ObjC++ Joined Separate
M
C ObjC C++ ObjC++
MD
C ObjC C++ ObjC++ Separate
MF
C ObjC C++ ObjC++ Joined Separate
MG
C ObjC C++ ObjC++
MM
C ObjC C++ ObjC++
MMD
C ObjC C++ ObjC++ Separate
MP
C ObjC C++ ObjC++
MQ
C ObjC C++ ObjC++ Joined Separate
MT
C ObjC C++ ObjC++ Joined Separate
P
C ObjC C++ ObjC++
U
C ObjC C++ ObjC++ Joined Separate
Wabi
C++ ObjC++
Wall
C ObjC C++ ObjC++
Wbad-function-cast
C ObjC
Wcast-qual
C ObjC C++ ObjC++
Wchar-subscripts
C ObjC C++ ObjC++
Wcomment
C ObjC C++ ObjC++
Wcomments
C ObjC C++ ObjC++
Wconversion
C ObjC C++ ObjC++
Wctor-dtor-privacy
C++ ObjC++
Wdeprecated
C++ ObjC++
Wdiv-by-zero
C ObjC
Weffc++
C++ ObjC++
Wendif-labels
C ObjC C++ ObjC++
Werror
C ObjC C++ ObjC++
Werror-implicit-function-declaration
C ObjC
Wfloat-equal
C ObjC C++ ObjC++
Wformat
C ObjC C++ ObjC++
Wformat-extra-args
C ObjC C++ ObjC++
Wformat-nonliteral
C ObjC C++ ObjC++
Wformat-security
C ObjC C++ ObjC++
Wformat-y2k
C ObjC C++ ObjC++
Wformat-zero-length
C ObjC
Wformat=
C ObjC C++ ObjC++ Joined
Wimplicit
C ObjC C++ ObjC++
Wimplicit-function-declaration
C ObjC
Wimplicit-int
C ObjC
Wimport
C ObjC C++ ObjC++
Winvalid-offsetof
C++ ObjC++
Winvalid-pch
C ObjC C++ ObjC++
Wlong-long
C ObjC C++ ObjC++
Wmain
C ObjC
Wmissing-braces
C ObjC C++ ObjC++
Wmissing-declarations
C ObjC
Wmissing-format-attribute
C ObjC C++ ObjC++
Wmissing-prototypes
C ObjC
Wmultichar
C ObjC C++ ObjC++
Wnested-externs
C ObjC
Wnon-template-friend
C++ ObjC++
Wnon-virtual-dtor
C++ ObjC++
Wnonnull
C ObjC
Wold-style-cast
C++ ObjC++
Woverloaded-virtual
C++ ObjC++
Wparentheses
C ObjC C++ ObjC++
Wpmf-conversions
C++ ObjC++
Wpointer-arith
C ObjC C++ ObjC++
Wprotocol
ObjC ObjC++
Wredundant-decls
C ObjC C++ ObjC++
Wreorder
C++ ObjC++
Wreturn-type
C ObjC C++ ObjC++
Wselector
ObjC ObjC++
Wsequence-point
C ObjC
Wsign-compare
C ObjC C++ ObjC++
Wsign-promo
C++ ObjC++
Wstrict-prototypes
C ObjC
Wsynth
C++ ObjC++
Wsystem-headers
C ObjC C++ ObjC++
Wtraditional
C ObjC
Wtrigraphs
C ObjC C++ ObjC++
Wundeclared-selector
ObjC ObjC++
Wundef
C ObjC C++ ObjC++
Wunknown-pragmas
C ObjC C++ ObjC++
Wunused-macros
C ObjC C++ ObjC++
Wwrite-strings
C ObjC C++ ObjC++
ansi
C ObjC C++ ObjC++
d
C ObjC C++ ObjC++ Joined
fabi-version=
C++ ObjC++ Joined
faccess-control
C++ ObjC++
fall-virtual
C++ ObjC++
falt-external-templates
C++ ObjC++
fasm
C ObjC C++ ObjC++
fbuiltin
C ObjC C++ ObjC++
fbuiltin-
C ObjC C++ ObjC++ Joined
fcheck-new
C++ ObjC++
fcond-mismatch
C ObjC C++ ObjC++
fconserve-space
C++ ObjC++
fconst-strings
C++ ObjC++
fconstant-string-class=
ObjC ObjC++ Joined
fdefault-inline
C++ ObjC++
fdollars-in-identifiers
C ObjC C++ ObjC++
fdump-
C ObjC C++ ObjC++ Joined
felide-constructors
C++ ObjC++
fenforce-eh-specs
C++ ObjC++
fenum-int-equiv
C++ ObjC++
fexternal-templates
C++ ObjC++
ffixed-form
C ObjC
ffixed-line-length-
C ObjC Joined
ffor-scope
C++ ObjC++
ffreestanding
C ObjC
fgnu-keywords
C++ ObjC++
fgnu-runtime
ObjC ObjC++
fguiding-decls
C++ ObjC++
fhandle-exceptions
C++ ObjC++
fhonor-std
C++ ObjC++
fhosted
C ObjC
fhuge-objects
C++ ObjC++
fimplement-inlines
C++ ObjC++
fimplicit-inline-templates
C++ ObjC++
fimplicit-templates
C++ ObjC++
flabels-ok
C++ ObjC++
fms-extensions
C ObjC C++ ObjC++
fname-mangling-version-
C++ ObjC++ Joined
fnew-abi
C++ ObjC++
fnext-runtime
ObjC ObjC++
fnonansi-builtins
C++ ObjC++
fnonnull-objects
C++ ObjC++
foperator-names
C++ ObjC++
foptional-diags
C++ ObjC++
fpch-deps
C ObjC C++ ObjC++
fpermissive
C++ ObjC++
fpreprocessed
C ObjC C++ ObjC++
frepo
C++ ObjC++
frtti
C++ ObjC++
fshort-double
C ObjC C++ ObjC++
fshort-enums
C ObjC C++ ObjC++
fshort-wchar
C ObjC C++ ObjC++
fshow-column
C ObjC C++ ObjC++
fsigned-bitfields
C ObjC C++ ObjC++
fsigned-char
C ObjC C++ ObjC++
fsquangle
C++ ObjC++
fstats
C++ ObjC++
fstrict-prototype
C++ ObjC++
ftabstop=
C ObjC C++ ObjC++ Joined
ftemplate-depth-
C++ ObjC++ Joined
fthis-is-variable
C++ ObjC++
funsigned-bitfields
C ObjC C++ ObjC++
funsigned-char
C ObjC C++ ObjC++
fuse-cxa-atexit
C++ ObjC++
fvtable-gc
C++ ObjC++
fvtable-thunks
C++ ObjC++
fweak
C++ ObjC++
fxref
C++ ObjC++
gen-decls
ObjC ObjC++
idirafter
C ObjC C++ ObjC++ Joined Separate
imacros
C ObjC C++ ObjC++ Joined Separate
include
C ObjC C++ ObjC++ Joined Separate
iprefix
C ObjC C++ ObjC++ Joined Separate
isysroot
C ObjC C++ ObjC++ Joined Separate
isystem
C ObjC C++ ObjC++ Joined Separate
iwithprefix
C ObjC C++ ObjC++ Joined Separate
iwithprefixbefore
C ObjC C++ ObjC++ Joined Separate
lang-asm
C
lang-objc
C ObjC C++ ObjC++
nostdinc
C ObjC C++ ObjC++
nostdinc++
C ObjC C++ ObjC++
o
C ObjC C++ ObjC++ Joined Separate
pedantic
C ObjC C++ ObjC++
pedantic-errors
C ObjC C++ ObjC++
print-objc-runtime-info
ObjC ObjC++
remap
C ObjC C++ ObjC++
std=c++98
C++ ObjC++
std=c89
C ObjC
std=c99
C ObjC
std=c9x
C ObjC
std=gnu++98
C++ ObjC++
std=gnu89
C ObjC
std=gnu99
C ObjC
std=gnu9x
C ObjC
std=iso9899:1990
C ObjC
std=iso9899:199409
C ObjC
std=iso9899:1999
C ObjC
std=iso9899:199x
C ObjC
traditional-cpp
C ObjC C++ ObjC++
trigraphs
C ObjC C++ ObjC++
undef
C ObjC C++ ObjC++
v
C ObjC C++ ObjC++
w
C ObjC C++ ObjC++
......@@ -87,6 +87,7 @@ the other C-like languages: @file{c-common.c},
@file{c-cppbuiltin.c},
@file{c-common.h},
@file{c-dump.h},
@file{c.opt},
@file{c-incpath.h}
and
@file{c-pragma.h},
......
#!/bin/sh
#
# Copyright (C) 2003 Free Software Foundation, Inc.
# Contributed by Neil Booth, May 2003.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2, or (at your option) any
# later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# Usage: opts.sh outfile.c outfile.h file1.opt [file2.opt, ...]
AWK=/usr/bin/awk
SORT=/usr/bin/sort
C_FILE=$1; shift
H_FILE=$1; shift
cat "$@" | ${AWK} '
BEGIN{ RS=""; FS="\n" }
# Ignore comments and blank lines
/^[ \t]*(;|$)/ { next }
/^[^ \t]/ { gsub ("\n", "\034", $0); print }
' | LANG=C ${SORT} | ${AWK} '
function switch_flags (langs, flags)
{
langs = ":" langs ":"
gsub( " ", ":", langs)
flags = "0"
if (langs ~ ":C:") flags = flags " | CL_C"
if (langs ~ ":ObjC:") flags = flags " | CL_OBJC"
if (langs ~ ":C\\+\\+:") flags = flags " | CL_CXX"
if (langs ~ ":ObjC\\+\\+:") flags = flags " | CL_OBJCXX"
if (langs ~ ":Joined") flags = flags " | CL_JOINED"
if (langs ~ ":Separate") flags = flags " | CL_SEPARATE"
sub( "^0 \\| ", "", flags )
return flags
}
BEGIN {
c_file = "'${C_FILE}'"
h_file = "'${H_FILE}'"
FS = "\034"
print "/* This file is auto-generated by opts.sh. */\n" > h_file
print "/* This file is auto-generated by opts.sh. */\n" > c_file
print "struct cl_option\n{" >> h_file
print " const char *opt_text;" >> h_file
print " unsigned char opt_len;" >> h_file
print " unsigned char flags;" >> h_file
print "};\n" >> h_file
print "enum opt_code\n{" >> h_file
print "static const struct cl_option cl_options[] =\n{" >> c_file
}
{
opt = $1
gsub ( "[^A-Za-z0-9]", "_", opt)
s = substr (" ", length (opt))
enum = "OPT_" opt
printf (" %s,%s/* -%s */\n", enum, s, $1 ) >> h_file
printf (" { \"%s\", %u, %s },\n", $1, \
length ($1), switch_flags($2)) >> c_file
}
END {
print " N_OPTS\n};" >> h_file
print "};" >> c_file
}
'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment