summaryrefslogtreecommitdiff
path: root/gcc/optc-gen.awk
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2006-05-16 14:27:18 +0000
committerH.J. Lu <hjl@gcc.gnu.org>2006-05-16 07:27:18 -0700
commit14c7833ccd0392c40505c4f707abc7ef64af7972 (patch)
treef010ca26f2ca6b7e3f6a1baeeac28d996a541357 /gcc/optc-gen.awk
parentb570947c8ad996f00aaa621a9e3dee997baa2e2e (diff)
downloadgcc-14c7833ccd0392c40505c4f707abc7ef64af7972.tar.gz
re PR target/26885 (-m64 -m32 no longer creates 32-bit object)
gcc/ 2006-05-16 H.J. Lu <hongjiu.lu@intel.com> PR driver/26885 * Makefile.in (GCC_OBJS): New. (OBJS-common): Add opts-common.o. (xgcc$(exeext)): Replace gcc.o with $(GCC_OBJS). (cpp$(exeext)): Likewise. (gcc.o): Also depend on opts.h. (opts-common.o): New. * common.opt (gcoff): Add Negative(gdwarf-2). (gdwarf-2): Add Negative(gstabs). (gstabs): Add Negative(gstabs+). (gstabs+): Add Negative(gvms). (gvms): Add Negative(gxcoff). (gxcoff): Add Negative(gxcoff+). (gxcoff+): Add Negative(gcoff). * config/i386/i386.opt (m32): Add Negative(m64). (m64): Add Negative(m32). * doc/options.texi: Document the Negative option. * gcc.c: Include "opts.h". (main): Call prune_options after expandargv. * optc-gen.awk: Generate common declarations for all flag variables in options.c. Output the neg_index field. * opts.c (find_opt): Moved to ... * opts-common.c: Here. New file. * opts.h (cl_option): Add a neg_index field. (find_opt): New. (prune_options): Likewise. gcc/cp/ 2006-05-16 H.J. Lu <hongjiu.lu@intel.com> PR driver/26885 * Make-lang.in (GXX_OBJS): Replace gcc.o with $(GCC_OBJS). gcc/fortran/ 2006-05-16 H.J. Lu <hongjiu.lu@intel.com> PR driver/26885 * Make-lang.in (GFORTRAN_D_OBJS): Replace gcc.o with $(GCC_OBJS). gcc/java/ 2006-05-16 H.J. Lu <hongjiu.lu@intel.com> PR driver/26885 * Make-lang.in ($(GCJ)$(exeext)): Replace gcc.o with $(GCC_OBJS). gcc/treelang/ 2006-05-16 H.J. Lu <hongjiu.lu@intel.com> PR driver/26885 * Make-lang.in (gtreelang$(exeext)): Replace gcc.o with $(GCC_OBJS). From-SVN: r113824
Diffstat (limited to 'gcc/optc-gen.awk')
-rw-r--r--gcc/optc-gen.awk55
1 files changed, 44 insertions, 11 deletions
diff --git a/gcc/optc-gen.awk b/gcc/optc-gen.awk
index 065972b031a..da199171d27 100644
--- a/gcc/optc-gen.awk
+++ b/gcc/optc-gen.awk
@@ -62,20 +62,27 @@ for (i = 1; i <= n_headers; i++)
print "#include " quote "opts.h" quote
print "#include " quote "intl.h" quote
print ""
+print "int target_flags;"
+print ""
for (i = 0; i < n_opts; i++) {
name = var_name(flags[i]);
if (name == "")
continue;
- if (flag_set_p("VarExists", flags[i]))
- continue;
-
- init = opt_args("Init", flags[i])
- if (init != "")
- init = " = " init;
- else if (name in var_seen)
- continue;
+ if (flag_set_p("VarExists", flags[i])) {
+ # Need it for the gcc driver.
+ if (name in var_seen)
+ continue;
+ init = ""
+ }
+ else {
+ init = opt_args("Init", flags[i])
+ if (init != "")
+ init = " = " init;
+ else if (name in var_seen)
+ continue;
+ }
print "/* Set by -" opts[i] "."
print " " help[i] " */"
@@ -107,8 +114,21 @@ print "const unsigned int cl_options_count = N_OPTS;\n"
print "const struct cl_option cl_options[] =\n{"
-for (i = 0; i < n_opts; i++)
+j = 0
+for (i = 0; i < n_opts; i++) {
back_chain[i] = "N_OPTS";
+ indices[opts[i]] = j;
+ # Combine the flags of identical switches. Switches
+ # appear many times if they are handled by many front
+ # ends, for example.
+ while( i + 1 != n_opts && opts[i] == opts[i + 1] ) {
+ flags[i + 1] = flags[i] " " flags[i + 1];
+ i++;
+ back_chain[i] = "N_OPTS";
+ indices[opts[i]] = j;
+ }
+ j++;
+}
for (i = 0; i < n_opts; i++) {
# Combine the flags of identical switches. Switches
@@ -147,8 +167,21 @@ for (i = 0; i < n_opts; i++) {
else
hlp = quote help[i] quote;
- printf(" { %c-%s%c,\n %s,\n %s, %u,\n",
- quote, opts[i], quote, hlp, back_chain[i], len)
+ neg = opt_args("Negative", flags[i]);
+ if (neg != "")
+ idx = indices[neg]
+ else {
+ if (flag_set_p("RejectNegative", flags[i]))
+ idx = -1;
+ else {
+ if (opts[i] ~ "^[Wfm]")
+ idx = indices[opts[i]];
+ else
+ idx = -1;
+ }
+ }
+ printf(" { %c-%s%c,\n %s,\n %s, %u, %d,\n",
+ quote, opts[i], quote, hlp, back_chain[i], len, idx)
condition = opt_args("Condition", flags[i])
cl_flags = switch_flags(flags[i])
if (condition != "")