diff options
author | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-12-01 13:46:36 +0000 |
---|---|---|
committer | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-12-01 13:46:36 +0000 |
commit | 0e763b2a064acd9dbf0301717394bc0a52d72667 (patch) | |
tree | e655a7d31d6c68b342a1dffa891111f94d224b1c /gcc | |
parent | b3e42c2f021813e7371106583decbe30439b503c (diff) | |
download | gcc-0e763b2a064acd9dbf0301717394bc0a52d72667.tar.gz |
* common.opt (main_input_filename, main_input_basename,
main_input_baselength): New Variable entries. From toplev.c.
* final.c (output_quoted_string): Move from toplev.c.
* output.h (output_quoted_string): Move from toplev.h.
* opts-global.c (read_cmdline_options): Use gcc_options pointer to
access main_input_filename, main_input_baselength and
main_input_basename.
* targhooks.c: Include intl.h and opts.h.
(option_affects_pch_p, default_get_pch_validity): Move from
toplev.c.
* targhooks.h (option_affects_pch_p, default_get_pch_validity):
Move from toplev.h.
* toplev.c (main_input_filename, main_input_basename,
main_input_baselength): Move to common.opt.
(output_quoted_string): Move to final.c.
(warn_deprecated_use): Move to tree.c.
(option_affects_pch_p, default_get_pch_validity,
pch_option_mismatch, default_pch_valid_p): Move to targhooks.c.
* toplev.h (skip_leading_substring): Move to tree-dump.c.
(warn_deprecated_use): Move to tree.h.
(output_quoted_string): Move to output.h.
(main_input_filename, main_input_basename, main_input_baselength):
Move to common.opt.
(default_get_pch_validity, default_pch_valid_p): Move to
targhooks.c.
* tree-dump.c (skip_leading_substring): Move from toplev.h.
* tree.c (warn_deprecated_use): Move from toplev.c.
* tree.h (warn_deprecated_use): Move from toplev.h.
* c-typeck.c, config/alpha/alpha.c, config/arc/arc.c,
config/arm/arm.c, config/avr/avr.c, config/bfin/bfin.c,
config/cris/cris.c, config/crx/crx.c, config/fr30/fr30.c,
config/frv/frv.c, config/h8300/h8300.c, config/ia64/ia64.c,
config/iq2000/iq2000.c, config/lm32/lm32.c, config/m32c/m32c.c,
config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c,
config/mcore/mcore.c, config/mep/mep.c,
config/microblaze/microblaze.c, config/mips/mips.c,
config/mmix/mmix.c, config/mn10300/mn10300.c,
config/moxie/moxie.c, config/pa/pa.c, config/pdp11/pdp11.c,
config/picochip/picochip.c, config/s390/s390.c,
config/score/score.c, config/sh/sh.c, config/sparc/sparc.c,
config/spu/spu.c, config/stormy16/stormy16.c, config/v850/v850.c,
config/vax/vax.c, config/xtensa/xtensa.c, gimple-low.c,
graphite-sese-to-poly.c, plugin.c, tree-cfg.c, tree-inline.c,
varasm.c, xcoffout.c: Don't include toplev.h.
* Makefile.in (c-typeck.o, tree-inline.o, tree-cfg.o,
gimple-low.o, graphite-sese-to-poly.o, targhooks.o, plugin.o,
varasm.o, xcoffout.o): Update dependencies.
* config/arm/t-arm (arm.o): Update dependencies.
* config/spu/t-spu-elf (spu.o): Update dependencies.
cp:
* cp-objcp-common.c, lex.c, typeck.c: Don't include toplev.h.
* Make-lang.in (cp/lex.o, cp/cp-objcp-common.o, cp/typeck2.o):
Update dependencies.
java:
* jcf-parse.c: Don't include toplev.h.
* Make-lang.in (java/jcf-parse.o): Don't depend on toplev.h.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@167329 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
67 files changed, 352 insertions, 338 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 56bb5347d2d..00e29e249a6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,55 @@ +2010-12-01 Joseph Myers <joseph@codesourcery.com> + + * common.opt (main_input_filename, main_input_basename, + main_input_baselength): New Variable entries. From toplev.c. + * final.c (output_quoted_string): Move from toplev.c. + * output.h (output_quoted_string): Move from toplev.h. + * opts-global.c (read_cmdline_options): Use gcc_options pointer to + access main_input_filename, main_input_baselength and + main_input_basename. + * targhooks.c: Include intl.h and opts.h. + (option_affects_pch_p, default_get_pch_validity): Move from + toplev.c. + * targhooks.h (option_affects_pch_p, default_get_pch_validity): + Move from toplev.h. + * toplev.c (main_input_filename, main_input_basename, + main_input_baselength): Move to common.opt. + (output_quoted_string): Move to final.c. + (warn_deprecated_use): Move to tree.c. + (option_affects_pch_p, default_get_pch_validity, + pch_option_mismatch, default_pch_valid_p): Move to targhooks.c. + * toplev.h (skip_leading_substring): Move to tree-dump.c. + (warn_deprecated_use): Move to tree.h. + (output_quoted_string): Move to output.h. + (main_input_filename, main_input_basename, main_input_baselength): + Move to common.opt. + (default_get_pch_validity, default_pch_valid_p): Move to + targhooks.c. + * tree-dump.c (skip_leading_substring): Move from toplev.h. + * tree.c (warn_deprecated_use): Move from toplev.c. + * tree.h (warn_deprecated_use): Move from toplev.h. + * c-typeck.c, config/alpha/alpha.c, config/arc/arc.c, + config/arm/arm.c, config/avr/avr.c, config/bfin/bfin.c, + config/cris/cris.c, config/crx/crx.c, config/fr30/fr30.c, + config/frv/frv.c, config/h8300/h8300.c, config/ia64/ia64.c, + config/iq2000/iq2000.c, config/lm32/lm32.c, config/m32c/m32c.c, + config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, + config/mcore/mcore.c, config/mep/mep.c, + config/microblaze/microblaze.c, config/mips/mips.c, + config/mmix/mmix.c, config/mn10300/mn10300.c, + config/moxie/moxie.c, config/pa/pa.c, config/pdp11/pdp11.c, + config/picochip/picochip.c, config/s390/s390.c, + config/score/score.c, config/sh/sh.c, config/sparc/sparc.c, + config/spu/spu.c, config/stormy16/stormy16.c, config/v850/v850.c, + config/vax/vax.c, config/xtensa/xtensa.c, gimple-low.c, + graphite-sese-to-poly.c, plugin.c, tree-cfg.c, tree-inline.c, + varasm.c, xcoffout.c: Don't include toplev.h. + * Makefile.in (c-typeck.o, tree-inline.o, tree-cfg.o, + gimple-low.o, graphite-sese-to-poly.o, targhooks.o, plugin.o, + varasm.o, xcoffout.o): Update dependencies. + * config/arm/t-arm (arm.o): Update dependencies. + * config/spu/t-spu-elf (spu.o): Update dependencies. + 2010-12-01 Richard Guenther <rguenther@suse.de> PR tree-optimization/46730 diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 0852220a364..a3ea7a36c68 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -2050,7 +2050,7 @@ c-parser.o : c-parser.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ c-typeck.o : c-typeck.c c-lang.h $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(TREE_H) $(C_TREE_H) $(TARGET_H) $(FLAGS_H) intl.h output.h $(EXPR_H) \ - toplev.h langhooks.h tree-iterator.h $(BITMAP_H) $(GIMPLE_H) + langhooks.h tree-iterator.h $(BITMAP_H) $(GIMPLE_H) @@ -2352,7 +2352,7 @@ tree-dump.o: tree-dump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ tree-iterator.h $(TREE_PASS_H) $(DIAGNOSTIC_H) tree-inline.o : tree-inline.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(TREE_H) $(RTL_H) $(EXPR_H) $(FLAGS_H) $(PARAMS_H) $(INPUT_H) insn-config.h \ - $(HASHTAB_H) toplev.h langhooks.h $(TREE_INLINE_H) $(CGRAPH_H) \ + $(HASHTAB_H) langhooks.h $(TREE_INLINE_H) $(CGRAPH_H) \ intl.h $(FUNCTION_H) $(GIMPLE_H) \ debug.h $(DIAGNOSTIC_H) $(EXCEPT_H) $(TREE_FLOW_H) tree-iterator.h tree-mudflap.h \ $(IPA_PROP_H) value-prof.h $(TREE_PASS_H) $(TARGET_H) $(INTEGRATE_H) \ @@ -2498,7 +2498,7 @@ tree-cfg.o : tree-cfg.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) $(FLAGS_H) output.h \ $(DIAGNOSTIC_H) $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h \ $(TREE_DUMP_H) $(EXCEPT_H) langhooks.h $(CFGLOOP_H) $(TREE_PASS_H) \ - $(CFGLAYOUT_H) $(BASIC_BLOCK_H) toplev.h \ + $(CFGLAYOUT_H) $(BASIC_BLOCK_H) \ value-prof.h tree-ssa-propagate.h $(TREE_INLINE_H) tree-pretty-print.h \ gimple-pretty-print.h tree-cfgcleanup.o : tree-cfgcleanup.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ @@ -2646,7 +2646,7 @@ gimple-low.o : gimple-low.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \ $(DIAGNOSTIC_H) $(GIMPLE_H) $(TREE_INLINE_H) langhooks.h \ $(LANGHOOKS_DEF_H) $(TREE_FLOW_H) $(TIMEVAR_H) $(TM_H) coretypes.h \ $(EXCEPT_H) $(FLAGS_H) $(RTL_H) $(FUNCTION_H) $(EXPR_H) $(TREE_PASS_H) \ - $(HASHTAB_H) toplev.h $(DIAGNOSTIC_CORE_H) tree-iterator.h + $(HASHTAB_H) $(DIAGNOSTIC_CORE_H) tree-iterator.h omp-low.o : omp-low.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ $(RTL_H) $(GIMPLE_H) $(TREE_INLINE_H) langhooks.h $(DIAGNOSTIC_CORE_H) \ $(TREE_FLOW_H) $(TIMEVAR_H) $(FLAGS_H) $(EXPR_H) $(DIAGNOSTIC_CORE_H) \ @@ -2732,7 +2732,7 @@ graphite-scop-detection.o: graphite-scop-detection.c $(CONFIG_H) $(SYSTEM_H) \ graphite-scop-detection.h graphite-poly.h graphite-sese-to-poly.o: graphite-sese-to-poly.c $(CONFIG_H) \ $(SYSTEM_H) coretypes.h $(TM_H) \ - $(GGC_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) toplev.h $(DIAGNOSTIC_CORE_H) \ + $(GGC_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(DIAGNOSTIC_CORE_H) \ $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) $(GIMPLE_H) \ $(TREE_DATA_REF_H) tree-pass.h domwalk.h graphite.h \ pointer-set.h value-prof.h graphite-ppl.h sese.h \ @@ -2836,7 +2836,7 @@ opts-common.o : opts-common.c $(OPTS_H) $(FLAGS_H) $(CONFIG_H) $(SYSTEM_H) \ targhooks.o : targhooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TREE_H) \ $(EXPR_H) $(TM_H) $(RTL_H) $(TM_P_H) $(FUNCTION_H) output.h $(DIAGNOSTIC_CORE_H) \ $(MACHMODE_H) $(TARGET_DEF_H) $(TARGET_H) $(GGC_H) gt-targhooks.h \ - $(OPTABS_H) $(RECOG_H) reload.h hard-reg-set.h + $(OPTABS_H) $(RECOG_H) reload.h hard-reg-set.h intl.h $(OPTS_H) bversion.h: s-bversion; @true s-bversion: BASE-VER @@ -2878,7 +2878,7 @@ passes.o : passes.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ $(PLUGIN_H) plugin.o : plugin.c $(PLUGIN_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - toplev.h $(DIAGNOSTIC_CORE_H) $(TREE_H) $(TREE_PASS_H) intl.h $(PLUGIN_VERSION_H) $(GGC_H) + $(DIAGNOSTIC_CORE_H) $(TREE_H) $(TREE_PASS_H) intl.h $(PLUGIN_VERSION_H) $(GGC_H) main.o : main.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) toplev.h $(DIAGNOSTIC_CORE_H) @@ -2902,7 +2902,7 @@ rtlanal.o : rtlanal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) toplev.h $(DIA varasm.o : varasm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ $(RTL_H) $(FLAGS_H) $(FUNCTION_H) $(EXPR_H) hard-reg-set.h $(REGS_H) \ - output.h toplev.h $(DIAGNOSTIC_CORE_H) xcoffout.h debug.h $(GGC_H) $(TM_P_H) \ + output.h $(DIAGNOSTIC_CORE_H) xcoffout.h debug.h $(GGC_H) $(TM_P_H) \ $(HASHTAB_H) $(TARGET_H) langhooks.h gt-varasm.h $(BASIC_BLOCK_H) \ $(CFGLAYOUT_H) $(CGRAPH_H) targhooks.h tree-mudflap.h \ tree-iterator.h pointer-set.h @@ -2983,7 +2983,7 @@ dwarf2asm.o : dwarf2asm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ vmsdbgout.o : vmsdbgout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) version.h \ $(FLAGS_H) $(RTL_H) output.h vmsdbg.h debug.h langhooks.h $(FUNCTION_H) $(TARGET_H) xcoffout.o : xcoffout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(TREE_H) $(RTL_H) xcoffout.h $(FLAGS_H) toplev.h $(DIAGNOSTIC_CORE_H) output.h dbxout.h \ + $(TREE_H) $(RTL_H) xcoffout.h $(FLAGS_H) $(DIAGNOSTIC_CORE_H) output.h dbxout.h \ $(GGC_H) $(TARGET_H) debug.h $(GSTAB_H) xcoff.h godump.o : godump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(DIAGNOSTIC_CORE_H) \ $(TREE_H) $(GGC_H) pointer-set.h $(OBSTACK_H) debug.h diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 65d255abd13..77a38642b6e 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -35,7 +35,6 @@ along with GCC; see the file COPYING3. If not see #include "c-lang.h" #include "flags.h" #include "output.h" -#include "toplev.h" #include "intl.h" #include "target.h" #include "tree-iterator.h" diff --git a/gcc/common.opt b/gcc/common.opt index 57f5b0a27e9..dd672a0357f 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -157,6 +157,22 @@ int flag_print_asm_name Variable enum graph_dump_types graph_dump_format = no_graph +; Name of top-level original source file (what was input to cpp). +; This comes from the #-command at the beginning of the actual input. +; If there isn't any there, then this is the cc1 input file name. +Variable +const char *main_input_filename + +; Pointer to base name in main_input_filename, with directories and a +; single final extension removed, and the length of this base +; name. + +Variable +const char *main_input_basename + +Variable +int main_input_baselength + ; Which options have been printed by --help. Variable char *help_printed diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index 1ecd2c4d70f..76ab31aea73 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -42,7 +42,6 @@ along with GCC; see the file COPYING3. If not see #include "except.h" #include "function.h" #include "diagnostic-core.h" -#include "toplev.h" #include "ggc.h" #include "integrate.h" #include "tm_p.h" diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c index c13eb717170..f1afda20f97 100644 --- a/gcc/config/arc/arc.c +++ b/gcc/config/arc/arc.c @@ -37,7 +37,6 @@ along with GCC; see the file COPYING3. If not see #include "expr.h" #include "recog.h" #include "diagnostic-core.h" -#include "toplev.h" #include "df.h" #include "tm_p.h" #include "target.h" diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 53a847d7615..38714609cab 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -41,7 +41,6 @@ #include "expr.h" #include "optabs.h" #include "diagnostic-core.h" -#include "toplev.h" #include "recog.h" #include "cgraph.h" #include "ggc.h" diff --git a/gcc/config/arm/t-arm b/gcc/config/arm/t-arm index 4879211be37..e1aa815664c 100644 --- a/gcc/config/arm/t-arm +++ b/gcc/config/arm/t-arm @@ -49,7 +49,7 @@ arm.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(RTL_H) $(TREE_H) $(OBSTACK_H) $(REGS_H) hard-reg-set.h \ insn-config.h conditions.h output.h \ $(INSN_ATTR_H) $(FLAGS_H) reload.h $(FUNCTION_H) \ - $(EXPR_H) $(OPTABS_H) toplev.h $(RECOG_H) $(CGRAPH_H) \ + $(EXPR_H) $(OPTABS_H) $(RECOG_H) $(CGRAPH_H) \ $(GGC_H) except.h $(C_PRAGMA_H) $(INTEGRATE_H) $(TM_P_H) \ $(TARGET_H) $(TARGET_DEF_H) debug.h langhooks.h $(DF_H) \ intl.h libfuncs.h $(PARAMS_H) diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c index 9e18b00d482..30e4626ec2b 100644 --- a/gcc/config/avr/avr.c +++ b/gcc/config/avr/avr.c @@ -35,7 +35,6 @@ #include "output.h" #include "expr.h" #include "diagnostic-core.h" -#include "toplev.h" #include "obstack.h" #include "function.h" #include "recog.h" diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c index 0abb4ebdd04..93edc88b558 100644 --- a/gcc/config/bfin/bfin.c +++ b/gcc/config/bfin/bfin.c @@ -41,7 +41,6 @@ #include "target-def.h" #include "expr.h" #include "diagnostic-core.h" -#include "toplev.h" #include "recog.h" #include "optabs.h" #include "ggc.h" diff --git a/gcc/config/cris/cris.c b/gcc/config/cris/cris.c index 49213b6334c..aec7cba63bb 100644 --- a/gcc/config/cris/cris.c +++ b/gcc/config/cris/cris.c @@ -35,7 +35,6 @@ along with GCC; see the file COPYING3. If not see #include "except.h" #include "function.h" #include "diagnostic-core.h" -#include "toplev.h" #include "recog.h" #include "reload.h" #include "tm_p.h" diff --git a/gcc/config/crx/crx.c b/gcc/config/crx/crx.c index d6b9022b239..79d341c472e 100644 --- a/gcc/config/crx/crx.c +++ b/gcc/config/crx/crx.c @@ -44,7 +44,6 @@ #include "expr.h" #include "optabs.h" #include "diagnostic-core.h" -#include "toplev.h" #include "basic-block.h" #include "df.h" #include "target.h" diff --git a/gcc/config/fr30/fr30.c b/gcc/config/fr30/fr30.c index 77196c1cea8..74585b5dc0c 100644 --- a/gcc/config/fr30/fr30.c +++ b/gcc/config/fr30/fr30.c @@ -41,7 +41,6 @@ #include "function.h" #include "df.h" #include "diagnostic-core.h" -#include "toplev.h" #include "tm_p.h" #include "target.h" #include "target-def.h" diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c index f8653c761e0..56f69e2065d 100644 --- a/gcc/config/frv/frv.c +++ b/gcc/config/frv/frv.c @@ -40,7 +40,6 @@ along with GCC; see the file COPYING3. If not see #include "function.h" #include "optabs.h" #include "diagnostic-core.h" -#include "toplev.h" #include "basic-block.h" #include "tm_p.h" #include "ggc.h" diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c index 31aa54cca9b..834fc992fc1 100644 --- a/gcc/config/h8300/h8300.c +++ b/gcc/config/h8300/h8300.c @@ -39,7 +39,6 @@ along with GCC; see the file COPYING3. If not see #include "function.h" #include "optabs.h" #include "diagnostic-core.h" -#include "toplev.h" #include "c-family/c-pragma.h" /* ??? */ #include "tm_p.h" #include "ggc.h" diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index 878cd72a652..0c2d20eaf6e 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -43,7 +43,6 @@ along with GCC; see the file COPYING3. If not see #include "basic-block.h" #include "libfuncs.h" #include "diagnostic-core.h" -#include "toplev.h" #include "sched-int.h" #include "timevar.h" #include "target.h" diff --git a/gcc/config/iq2000/iq2000.c b/gcc/config/iq2000/iq2000.c index cc4c80f2836..b838fecb9f1 100644 --- a/gcc/config/iq2000/iq2000.c +++ b/gcc/config/iq2000/iq2000.c @@ -37,7 +37,6 @@ along with GCC; see the file COPYING3. If not see #include "libfuncs.h" #include "recog.h" #include "diagnostic-core.h" -#include "toplev.h" #include "reload.h" #include "ggc.h" #include "tm_p.h" diff --git a/gcc/config/lm32/lm32.c b/gcc/config/lm32/lm32.c index b155697b97f..05888ee5289 100644 --- a/gcc/config/lm32/lm32.c +++ b/gcc/config/lm32/lm32.c @@ -41,7 +41,6 @@ #include "tm_p.h" #include "function.h" #include "diagnostic-core.h" -#include "toplev.h" #include "optabs.h" #include "libfuncs.h" #include "ggc.h" diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c index 659de83fcf0..3a741392aa0 100644 --- a/gcc/config/m32c/m32c.c +++ b/gcc/config/m32c/m32c.c @@ -35,7 +35,6 @@ #include "recog.h" #include "reload.h" #include "diagnostic-core.h" -#include "toplev.h" #include "obstack.h" #include "tree.h" #include "expr.h" diff --git a/gcc/config/m32r/m32r.c b/gcc/config/m32r/m32r.c index 18ac2608dab..410882766c7 100644 --- a/gcc/config/m32r/m32r.c +++ b/gcc/config/m32r/m32r.c @@ -35,7 +35,6 @@ #include "function.h" #include "recog.h" #include "diagnostic-core.h" -#include "toplev.h" #include "ggc.h" #include "integrate.h" #include "df.h" diff --git a/gcc/config/m68hc11/m68hc11.c b/gcc/config/m68hc11/m68hc11.c index 00d409e8aac..f45de3d8505 100644 --- a/gcc/config/m68hc11/m68hc11.c +++ b/gcc/config/m68hc11/m68hc11.c @@ -51,7 +51,6 @@ Note: #include "expr.h" #include "libfuncs.h" #include "diagnostic-core.h" -#include "toplev.h" #include "basic-block.h" #include "function.h" #include "ggc.h" diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c index 619cf5c33d6..eedf009b1e2 100644 --- a/gcc/config/m68k/m68k.c +++ b/gcc/config/m68k/m68k.c @@ -34,7 +34,6 @@ along with GCC; see the file COPYING3. If not see #include "insn-attr.h" #include "recog.h" #include "diagnostic-core.h" -#include "toplev.h" #include "expr.h" #include "reload.h" #include "tm_p.h" diff --git a/gcc/config/mcore/mcore.c b/gcc/config/mcore/mcore.c index 3c3e1bba811..a66eb3cd162 100644 --- a/gcc/config/mcore/mcore.c +++ b/gcc/config/mcore/mcore.c @@ -41,7 +41,6 @@ #include "function.h" #include "ggc.h" #include "diagnostic-core.h" -#include "toplev.h" #include "target.h" #include "target-def.h" #include "df.h" diff --git a/gcc/config/mep/mep.c b/gcc/config/mep/mep.c index 96b9eb2a0d0..3b1127914e8 100644 --- a/gcc/config/mep/mep.c +++ b/gcc/config/mep/mep.c @@ -44,7 +44,6 @@ along with GCC; see the file COPYING3. If not see #include "tm_p.h" #include "ggc.h" #include "diagnostic-core.h" -#include "toplev.h" #include "integrate.h" #include "target.h" #include "target-def.h" diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c index 2cd28fc8932..b50c7942e0d 100644 --- a/gcc/config/microblaze/microblaze.c +++ b/gcc/config/microblaze/microblaze.c @@ -33,7 +33,6 @@ #include "insn-attr.h" #include "integrate.h" #include "recog.h" -#include "toplev.h" #include "tree.h" #include "function.h" #include "expr.h" diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 7e7e428d17f..74f7a7951ec 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -34,7 +34,6 @@ along with GCC; see the file COPYING3. If not see #include "conditions.h" #include "insn-attr.h" #include "recog.h" -#include "toplev.h" #include "output.h" #include "tree.h" #include "function.h" diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c index 906bff9804b..c0801163865 100644 --- a/gcc/config/mmix/mmix.c +++ b/gcc/config/mmix/mmix.c @@ -36,7 +36,6 @@ along with GCC; see the file COPYING3. If not see #include "function.h" #include "expr.h" #include "diagnostic-core.h" -#include "toplev.h" #include "recog.h" #include "ggc.h" #include "dwarf2.h" diff --git a/gcc/config/mn10300/mn10300.c b/gcc/config/mn10300/mn10300.c index 709407e57f6..a4e0bc432df 100644 --- a/gcc/config/mn10300/mn10300.c +++ b/gcc/config/mn10300/mn10300.c @@ -39,7 +39,6 @@ #include "function.h" #include "obstack.h" #include "diagnostic-core.h" -#include "toplev.h" #include "tm_p.h" #include "target.h" #include "target-def.h" diff --git a/gcc/config/moxie/moxie.c b/gcc/config/moxie/moxie.c index dd8a145e524..53b73d15fcc 100644 --- a/gcc/config/moxie/moxie.c +++ b/gcc/config/moxie/moxie.c @@ -34,7 +34,6 @@ #include "recog.h" #include "reload.h" #include "diagnostic-core.h" -#include "toplev.h" #include "obstack.h" #include "tree.h" #include "expr.h" diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 81d85b9ae64..aa8ad01fd9a 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -40,7 +40,6 @@ along with GCC; see the file COPYING3. If not see #include "integrate.h" #include "function.h" #include "diagnostic-core.h" -#include "toplev.h" #include "ggc.h" #include "recog.h" #include "predict.h" diff --git a/gcc/config/pdp11/pdp11.c b/gcc/config/pdp11/pdp11.c index b63d79fea9f..35a76fadc22 100644 --- a/gcc/config/pdp11/pdp11.c +++ b/gcc/config/pdp11/pdp11.c @@ -36,7 +36,6 @@ along with GCC; see the file COPYING3. If not see #include "tree.h" #include "expr.h" #include "diagnostic-core.h" -#include "toplev.h" #include "tm_p.h" #include "target.h" #include "target-def.h" diff --git a/gcc/config/picochip/picochip.c b/gcc/config/picochip/picochip.c index 20a5b37dedd..1ca95b4920d 100644 --- a/gcc/config/picochip/picochip.c +++ b/gcc/config/picochip/picochip.c @@ -42,7 +42,6 @@ along with GCC; see the file COPYING3. If not, see #include "basic-block.h" #include "integrate.h" #include "diagnostic-core.h" -#include "toplev.h" #include "ggc.h" #include "hashtab.h" #include "tm_p.h" diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 25807239e92..df5a246a2c1 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -41,7 +41,6 @@ along with GCC; see the file COPYING3. If not see #include "expr.h" #include "reload.h" #include "diagnostic-core.h" -#include "toplev.h" #include "basic-block.h" #include "integrate.h" #include "ggc.h" diff --git a/gcc/config/score/score.c b/gcc/config/score/score.c index f64f3d8195e..f9e4c0f677e 100644 --- a/gcc/config/score/score.c +++ b/gcc/config/score/score.c @@ -30,7 +30,6 @@ #include "insn-attr.h" #include "recog.h" #include "diagnostic-core.h" -#include "toplev.h" #include "output.h" #include "tree.h" #include "function.h" diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index 7b87c962140..034b171711f 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -38,7 +38,6 @@ along with GCC; see the file COPYING3. If not see #include "output.h" #include "insn-attr.h" #include "diagnostic-core.h" -#include "toplev.h" #include "recog.h" #include "integrate.h" #include "dwarf2.h" diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index bdb44af48fd..85387cc5b77 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -42,7 +42,6 @@ along with GCC; see the file COPYING3. If not see #include "optabs.h" #include "recog.h" #include "diagnostic-core.h" -#include "toplev.h" #include "ggc.h" #include "tm_p.h" #include "debug.h" diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c index 92845d7129c..bdea7e032e8 100644 --- a/gcc/config/spu/spu.c +++ b/gcc/config/spu/spu.c @@ -36,7 +36,6 @@ #include "basic-block.h" #include "integrate.h" #include "diagnostic-core.h" -#include "toplev.h" #include "ggc.h" #include "hashtab.h" #include "tm_p.h" diff --git a/gcc/config/spu/t-spu-elf b/gcc/config/spu/t-spu-elf index de559c9176a..cc8c94b387b 100644 --- a/gcc/config/spu/t-spu-elf +++ b/gcc/config/spu/t-spu-elf @@ -107,7 +107,7 @@ spu.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(RTL_H) $(REGS_H) hard-reg-set.h \ real.h insn-config.h conditions.h insn-attr.h flags.h $(RECOG_H) \ $(OBSTACK_H) $(TREE_H) $(EXPR_H) $(OPTABS_H) except.h function.h \ - output.h $(BASIC_BLOCK_H) $(INTEGRATE_H) toplev.h $(GGC_H) $(HASHTAB_H) \ + output.h $(BASIC_BLOCK_H) $(INTEGRATE_H) $(GGC_H) $(HASHTAB_H) \ $(TM_P_H) $(TARGET_H) $(TARGET_DEF_H) langhooks.h reload.h cfglayout.h \ $(srcdir)/config/spu/spu-protos.h \ $(srcdir)/config/spu/spu-builtins.def diff --git a/gcc/config/stormy16/stormy16.c b/gcc/config/stormy16/stormy16.c index ce83f683d39..fa5c5b5a8dc 100644 --- a/gcc/config/stormy16/stormy16.c +++ b/gcc/config/stormy16/stormy16.c @@ -34,7 +34,6 @@ #include "flags.h" #include "recog.h" #include "diagnostic-core.h" -#include "toplev.h" #include "obstack.h" #include "tree.h" #include "expr.h" diff --git a/gcc/config/v850/v850.c b/gcc/config/v850/v850.c index 1b3f3e48305..6d6ed782667 100644 --- a/gcc/config/v850/v850.c +++ b/gcc/config/v850/v850.c @@ -36,7 +36,6 @@ #include "expr.h" #include "function.h" #include "diagnostic-core.h" -#include "toplev.h" #include "ggc.h" #include "integrate.h" #include "tm_p.h" diff --git a/gcc/config/vax/vax.c b/gcc/config/vax/vax.c index 9459b7f4420..a9e032aa695 100644 --- a/gcc/config/vax/vax.c +++ b/gcc/config/vax/vax.c @@ -39,7 +39,6 @@ along with GCC; see the file COPYING3. If not see #include "flags.h" #include "debug.h" #include "diagnostic-core.h" -#include "toplev.h" #include "tm-preds.h" #include "tm-constrs.h" #include "tm_p.h" diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c index 67d367caa85..c3c69fdcc94 100644 --- a/gcc/config/xtensa/xtensa.c +++ b/gcc/config/xtensa/xtensa.c @@ -41,7 +41,6 @@ along with GCC; see the file COPYING3. If not see #include "tm_p.h" #include "function.h" #include "diagnostic-core.h" -#include "toplev.h" #include "optabs.h" #include "libfuncs.h" #include "ggc.h" diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 706c974ae4a..bfc522a6f58 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2010-12-01 Joseph Myers <joseph@codesourcery.com> + + * cp-objcp-common.c, lex.c, typeck.c: Don't include toplev.h. + * Make-lang.in (cp/lex.o, cp/cp-objcp-common.o, cp/typeck2.o): + Update dependencies. + 2010-11-30 Nicola Pero <nicola.pero@meta-innovation.com> * decl.c (finish_function): Call objc_finish_function when diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in index e34a1ab72de..afbf0da8d47 100644 --- a/gcc/cp/Make-lang.in +++ b/gcc/cp/Make-lang.in @@ -247,7 +247,7 @@ CXX_TREE_H = $(TREE_H) cp/name-lookup.h cp/cp-tree.h $(C_COMMON_H) \ CXX_PRETTY_PRINT_H = cp/cxx-pretty-print.h $(C_PRETTY_PRINT_H) cp/lex.o: cp/lex.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) \ - $(C_PRAGMA_H) toplev.h output.h input.h cp/operators.def $(TM_P_H) + $(C_PRAGMA_H) output.h input.h cp/operators.def $(TM_P_H) cp/cp-lang.o: cp/cp-lang.c $(CXX_TREE_H) $(TM_H) debug.h langhooks.h \ $(LANGHOOKS_DEF_H) $(C_COMMON_H) gtype-cp.h gt-cp-cp-lang.h \ cp/cp-objcp-common.h $(EXPR_H) $(TARGET_H) @@ -261,14 +261,14 @@ cp/decl2.o: cp/decl2.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) cp/decl.h \ $(C_PRAGMA_H) $(TREE_DUMP_H) intl.h $(TARGET_H) $(GIMPLE_H) $(POINTER_SET_H) \ $(SPLAY_TREE_H) c-family/c-ada-spec.h cp/cp-objcp-common.o : cp/cp-objcp-common.c $(CONFIG_H) $(SYSTEM_H) \ - coretypes.h $(TM_H) $(TREE_H) $(CXX_TREE_H) $(C_COMMON_H) toplev.h \ + coretypes.h $(TM_H) $(TREE_H) $(CXX_TREE_H) $(C_COMMON_H) \ langhooks.h $(LANGHOOKS_DEF_H) $(DIAGNOSTIC_H) debug.h \ $(CXX_PRETTY_PRINT_H) cp/cp-objcp-common.h gt-cp-cp-objcp-common.h cp/typeck2.o: cp/typeck2.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) output.h \ $(TM_P_H) $(DIAGNOSTIC_CORE_H) gt-cp-typeck2.h $(REAL_H) intl.h cp/typeck.o: cp/typeck.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) \ toplev.h $(DIAGNOSTIC_H) convert.h $(C_COMMON_H) $(TARGET_H) \ - output.h toplev.h + output.h cp/class.o: cp/class.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h \ $(TARGET_H) convert.h $(CGRAPH_H) $(TREE_DUMP_H) gt-cp-class.h \ $(SPLAY_TREE_H) diff --git a/gcc/cp/cp-objcp-common.c b/gcc/cp/cp-objcp-common.c index 0fdb87a4cc4..f045d290eae 100644 --- a/gcc/cp/cp-objcp-common.c +++ b/gcc/cp/cp-objcp-common.c @@ -25,7 +25,6 @@ along with GCC; see the file COPYING3. If not see #include "tree.h" #include "cp-tree.h" #include "c-family/c-common.h" -#include "toplev.h" #include "langhooks.h" #include "langhooks-def.h" #include "diagnostic.h" diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index c583d7d307e..5484317b6b8 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -33,7 +33,6 @@ along with GCC; see the file COPYING3. If not see #include "cpplib.h" #include "flags.h" #include "c-family/c-pragma.h" -#include "toplev.h" #include "output.h" #include "tm_p.h" #include "timevar.h" diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 80aa725d251..7cff632fbda 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -34,7 +34,6 @@ along with GCC; see the file COPYING3. If not see #include "cp-tree.h" #include "flags.h" #include "output.h" -#include "toplev.h" #include "diagnostic.h" #include "intl.h" #include "target.h" diff --git a/gcc/final.c b/gcc/final.c index c4278ae4922..ebe21b60765 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -3620,6 +3620,32 @@ output_addr_const (FILE *file, rtx x) } } +/* Output a quoted string. */ + +void +output_quoted_string (FILE *asm_file, const char *string) +{ +#ifdef OUTPUT_QUOTED_STRING + OUTPUT_QUOTED_STRING (asm_file, string); +#else + char c; + + putc ('\"', asm_file); + while ((c = *string++) != 0) + { + if (ISPRINT (c)) + { + if (c == '\"' || c == '\\') + putc ('\\', asm_file); + putc (c, asm_file); + } + else + fprintf (asm_file, "\\%03o", (unsigned char) c); + } + putc ('\"', asm_file); +#endif +} + /* A poor man's fprintf, with the added features of %I, %R, %L, and %U. %R prints the value of REGISTER_PREFIX. %L prints the value of LOCAL_LABEL_PREFIX. diff --git a/gcc/gimple-low.c b/gcc/gimple-low.c index dcbb560cab1..d3ec6a7bcf9 100644 --- a/gcc/gimple-low.c +++ b/gcc/gimple-low.c @@ -31,7 +31,6 @@ along with GCC; see the file COPYING3. If not see #include "flags.h" #include "function.h" #include "diagnostic-core.h" -#include "toplev.h" #include "tree-pass.h" /* The differences between High GIMPLE and Low GIMPLE are the diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c index 77930d5c67b..2e56d7a088a 100644 --- a/gcc/graphite-sese-to-poly.c +++ b/gcc/graphite-sese-to-poly.c @@ -28,7 +28,6 @@ along with GCC; see the file COPYING3. If not see #include "basic-block.h" #include "diagnostic.h" #include "tree-flow.h" -#include "toplev.h" #include "tree-dump.h" #include "timevar.h" #include "cfgloop.h" diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 2629d200f2d..16ea3712d07 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,8 @@ +2010-12-01 Joseph Myers <joseph@codesourcery.com> + + * jcf-parse.c: Don't include toplev.h. + * Make-lang.in (java/jcf-parse.o): Don't depend on toplev.h. + 2010-11-30 Joseph Myers <joseph@codesourcery.com> * boehm.c: Don't include toplev.h. diff --git a/gcc/java/Make-lang.in b/gcc/java/Make-lang.in index 3e3d2c99317..f5852b405cf 100644 --- a/gcc/java/Make-lang.in +++ b/gcc/java/Make-lang.in @@ -295,7 +295,7 @@ java/expr.o: java/expr.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h $(REAL_H) \ java/jcf-depend.o: java/jcf-depend.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ java/jcf.h java/jcf-parse.o: java/jcf-parse.c $(CONFIG_H) $(JAVA_TREE_H) $(FLAGS_H) \ - input.h java/java-except.h $(SYSTEM_H) coretypes.h toplev.h \ + input.h java/java-except.h $(SYSTEM_H) coretypes.h \ java/parse.h $(GGC_H) debug.h $(REAL_H) gt-java-jcf-parse.h \ java/jcf-reader.c java/zipfile.h java/jcf.h $(BITMAP_H) java/jvgenmain.o: java/jvgenmain.c $(CONFIG_H) $(JAVA_TREE_H) $(SYSTEM_H) \ diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c index 28d9ad44222..9166f311e99 100644 --- a/gcc/java/jcf-parse.c +++ b/gcc/java/jcf-parse.c @@ -35,7 +35,6 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ #include "javaop.h" #include "java-tree.h" #include "diagnostic-core.h" -#include "toplev.h" #include "parse.h" #include "ggc.h" #include "debug.h" diff --git a/gcc/opts-global.c b/gcc/opts-global.c index dc462ec354f..71c428e9b6b 100644 --- a/gcc/opts-global.c +++ b/gcc/opts-global.c @@ -229,11 +229,12 @@ read_cmdline_options (struct gcc_options *opts, struct gcc_options *opts_set, gcc_assert (opts == &global_options); gcc_assert (opts_set == &global_options_set); - if (main_input_filename == NULL) + if (opts->x_main_input_filename == NULL) { - main_input_filename = decoded_options[i].arg; - main_input_baselength - = base_of_path (main_input_filename, &main_input_basename); + opts->x_main_input_filename = decoded_options[i].arg; + opts->x_main_input_baselength + = base_of_path (opts->x_main_input_filename, + &opts->x_main_input_basename); } add_input_filename (decoded_options[i].arg); continue; diff --git a/gcc/output.h b/gcc/output.h index 928aa1f580f..6a835c0f932 100644 --- a/gcc/output.h +++ b/gcc/output.h @@ -298,6 +298,8 @@ extern void output_shared_constant_pool (void); extern void output_object_blocks (void); +extern void output_quoted_string (FILE *, const char *); + /* Whether a constructor CTOR is a valid static constant initializer if all its elements are. This used to be internal to initializer_constant_valid_p and has been exposed to let other functions like categorize_ctor_elements diff --git a/gcc/plugin.c b/gcc/plugin.c index 6fd20585b3e..2179b819288 100644 --- a/gcc/plugin.c +++ b/gcc/plugin.c @@ -33,7 +33,6 @@ along with GCC; see the file COPYING3. If not see #include "coretypes.h" #include "diagnostic-core.h" -#include "toplev.h" #include "tree.h" #include "tree-pass.h" #include "intl.h" diff --git a/gcc/targhooks.c b/gcc/targhooks.c index 233a16f3ca3..14ec00c7bf2 100644 --- a/gcc/targhooks.c +++ b/gcc/targhooks.c @@ -67,6 +67,8 @@ along with GCC; see the file COPYING3. If not see #include "reload.h" #include "optabs.h" #include "recog.h" +#include "intl.h" +#include "opts.h" bool @@ -1356,6 +1358,115 @@ default_get_reg_raw_mode(int regno) return reg_raw_mode[regno]; } +/* Return true if the state of option OPTION should be stored in PCH files + and checked by default_pch_valid_p. Store the option's current state + in STATE if so. */ + +static inline bool +option_affects_pch_p (int option, struct cl_option_state *state) +{ + if ((cl_options[option].flags & CL_TARGET) == 0) + return false; + if (option_flag_var (option, &global_options) == &target_flags) + if (targetm.check_pch_target_flags) + return false; + return get_option_state (&global_options, option, state); +} + +/* Default version of get_pch_validity. + By default, every flag difference is fatal; that will be mostly right for + most targets, but completely right for very few. */ + +void * +default_get_pch_validity (size_t *sz) +{ + struct cl_option_state state; + size_t i; + char *result, *r; + + *sz = 2; + if (targetm.check_pch_target_flags) + *sz += sizeof (target_flags); + for (i = 0; i < cl_options_count; i++) + if (option_affects_pch_p (i, &state)) + *sz += state.size; + + result = r = XNEWVEC (char, *sz); + r[0] = flag_pic; + r[1] = flag_pie; + r += 2; + if (targetm.check_pch_target_flags) + { + memcpy (r, &target_flags, sizeof (target_flags)); + r += sizeof (target_flags); + } + + for (i = 0; i < cl_options_count; i++) + if (option_affects_pch_p (i, &state)) + { + memcpy (r, state.data, state.size); + r += state.size; + } + + return result; +} + +/* Return a message which says that a PCH file was created with a different + setting of OPTION. */ + +static const char * +pch_option_mismatch (const char *option) +{ + char *r; + + asprintf (&r, _("created and used with differing settings of '%s'"), option); + if (r == NULL) + return _("out of memory"); + return r; +} + +/* Default version of pch_valid_p. */ + +const char * +default_pch_valid_p (const void *data_p, size_t len) +{ + struct cl_option_state state; + const char *data = (const char *)data_p; + size_t i; + + /* -fpic and -fpie also usually make a PCH invalid. */ + if (data[0] != flag_pic) + return _("created and used with different settings of -fpic"); + if (data[1] != flag_pie) + return _("created and used with different settings of -fpie"); + data += 2; + + /* Check target_flags. */ + if (targetm.check_pch_target_flags) + { + int tf; + const char *r; + + memcpy (&tf, data, sizeof (target_flags)); + data += sizeof (target_flags); + len -= sizeof (target_flags); + r = targetm.check_pch_target_flags (tf); + if (r != NULL) + return r; + } + + for (i = 0; i < cl_options_count; i++) + if (option_affects_pch_p (i, &state)) + { + if (memcmp (data, state.data, state.size) != 0) + return pch_option_mismatch (cl_options[i].opt_text); + data += state.size; + len -= state.size; + } + + return NULL; +} + const struct default_options empty_optimization_table[] = { { OPT_LEVELS_NONE, 0, NULL, 0 } diff --git a/gcc/targhooks.h b/gcc/targhooks.h index ce73f994cb8..1e603c983dd 100644 --- a/gcc/targhooks.h +++ b/gcc/targhooks.h @@ -176,3 +176,6 @@ extern section * default_function_section(tree decl, enum node_frequency freq, extern enum machine_mode default_get_reg_raw_mode(int); extern const struct default_options empty_optimization_table[]; + +extern void *default_get_pch_validity (size_t *); +extern const char *default_pch_valid_p (const void *, size_t); diff --git a/gcc/toplev.c b/gcc/toplev.c index 3050f0730e3..2cef957c30b 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -116,18 +116,6 @@ static bool no_backend; struct cl_decoded_option *save_decoded_options; unsigned int save_decoded_options_count; -/* Name of top-level original source file (what was input to cpp). - This comes from the #-command at the beginning of the actual input. - If there isn't any there, then this is the cc1 input file name. */ - -const char *main_input_filename; - -/* Pointer to base name in main_input_filename, with directories and a - single final extension removed, and the length of this base - name. */ -const char *main_input_basename; -int main_input_baselength; - /* Used to enable -fvar-tracking, -fweb and -frename-registers according to optimize in process_options (). */ #define AUTODETECT_VALUE 2 @@ -374,32 +362,6 @@ crash_signal (int signo) internal_error ("%s", strsignal (signo)); } -/* Output a quoted string. */ - -void -output_quoted_string (FILE *asm_file, const char *string) -{ -#ifdef OUTPUT_QUOTED_STRING - OUTPUT_QUOTED_STRING (asm_file, string); -#else - char c; - - putc ('\"', asm_file); - while ((c = *string++) != 0) - { - if (ISPRINT (c)) - { - if (c == '\"' || c == '\\') - putc ('\\', asm_file); - putc (c, asm_file); - } - else - fprintf (asm_file, "\\%03o", (unsigned char) c); - } - putc ('\"', asm_file); -#endif -} - /* A subroutine of wrapup_global_declarations. We've come to the end of the compilation unit. All deferred variables should be undeferred, and all incomplete decls should be finalized. */ @@ -597,111 +559,6 @@ emit_debug_global_declarations (tree *vec, int len) timevar_pop (TV_SYMOUT); } -/* Warn about a use of an identifier which was marked deprecated. */ -void -warn_deprecated_use (tree node, tree attr) -{ - const char *msg; - - if (node == 0 || !warn_deprecated_decl) - return; - - if (!attr) - { - if (DECL_P (node)) - attr = DECL_ATTRIBUTES (node); - else if (TYPE_P (node)) - { - tree decl = TYPE_STUB_DECL (node); - if (decl) - attr = lookup_attribute ("deprecated", - TYPE_ATTRIBUTES (TREE_TYPE (decl))); - } - } - - if (attr) - attr = lookup_attribute ("deprecated", attr); - - if (attr) - msg = TREE_STRING_POINTER (TREE_VALUE (TREE_VALUE (attr))); - else - msg = NULL; - - if (DECL_P (node)) - { - expanded_location xloc = expand_location (DECL_SOURCE_LOCATION (node)); - if (msg) - warning (OPT_Wdeprecated_declarations, - "%qD is deprecated (declared at %s:%d): %s", - node, xloc.file, xloc.line, msg); - else - warning (OPT_Wdeprecated_declarations, - "%qD is deprecated (declared at %s:%d)", - node, xloc.file, xloc.line); - } - else if (TYPE_P (node)) - { - tree what = NULL_TREE; - tree decl = TYPE_STUB_DECL (node); - - if (TYPE_NAME (node)) - { - if (TREE_CODE (TYPE_NAME (node)) == IDENTIFIER_NODE) - what = TYPE_NAME (node); - else if (TREE_CODE (TYPE_NAME (node)) == TYPE_DECL - && DECL_NAME (TYPE_NAME (node))) - what = DECL_NAME (TYPE_NAME (node)); - } - - if (decl) - { - expanded_location xloc - = expand_location (DECL_SOURCE_LOCATION (decl)); - if (what) - { - if (msg) - warning (OPT_Wdeprecated_declarations, - "%qE is deprecated (declared at %s:%d): %s", - what, xloc.file, xloc.line, msg); - else - warning (OPT_Wdeprecated_declarations, - "%qE is deprecated (declared at %s:%d)", what, - xloc.file, xloc.line); - } - else - { - if (msg) - warning (OPT_Wdeprecated_declarations, - "type is deprecated (declared at %s:%d): %s", - xloc.file, xloc.line, msg); - else - warning (OPT_Wdeprecated_declarations, - "type is deprecated (declared at %s:%d)", - xloc.file, xloc.line); - } - } - else - { - if (what) - { - if (msg) - warning (OPT_Wdeprecated_declarations, "%qE is deprecated: %s", - what, msg); - else - warning (OPT_Wdeprecated_declarations, "%qE is deprecated", what); - } - else - { - if (msg) - warning (OPT_Wdeprecated_declarations, "type is deprecated: %s", - msg); - else - warning (OPT_Wdeprecated_declarations, "type is deprecated"); - } - } - } -} - /* Compile an entire translation unit. Write a file of assembly output and various debugging dumps. */ @@ -1108,115 +965,6 @@ init_asm_output (const char *name) } } -/* Return true if the state of option OPTION should be stored in PCH files - and checked by default_pch_valid_p. Store the option's current state - in STATE if so. */ - -static inline bool -option_affects_pch_p (int option, struct cl_option_state *state) -{ - if ((cl_options[option].flags & CL_TARGET) == 0) - return false; - if (option_flag_var (option, &global_options) == &target_flags) - if (targetm.check_pch_target_flags) - return false; - return get_option_state (&global_options, option, state); -} - -/* Default version of get_pch_validity. - By default, every flag difference is fatal; that will be mostly right for - most targets, but completely right for very few. */ - -void * -default_get_pch_validity (size_t *sz) -{ - struct cl_option_state state; - size_t i; - char *result, *r; - - *sz = 2; - if (targetm.check_pch_target_flags) - *sz += sizeof (target_flags); - for (i = 0; i < cl_options_count; i++) - if (option_affects_pch_p (i, &state)) - *sz += state.size; - - result = r = XNEWVEC (char, *sz); - r[0] = flag_pic; - r[1] = flag_pie; - r += 2; - if (targetm.check_pch_target_flags) - { - memcpy (r, &target_flags, sizeof (target_flags)); - r += sizeof (target_flags); - } - - for (i = 0; i < cl_options_count; i++) - if (option_affects_pch_p (i, &state)) - { - memcpy (r, state.data, state.size); - r += state.size; - } - - return result; -} - -/* Return a message which says that a PCH file was created with a different - setting of OPTION. */ - -static const char * -pch_option_mismatch (const char *option) -{ - char *r; - - asprintf (&r, _("created and used with differing settings of '%s'"), option); - if (r == NULL) - return _("out of memory"); - return r; -} - -/* Default version of pch_valid_p. */ - -const char * -default_pch_valid_p (const void *data_p, size_t len) -{ - struct cl_option_state state; - const char *data = (const char *)data_p; - size_t i; - - /* -fpic and -fpie also usually make a PCH invalid. */ - if (data[0] != flag_pic) - return _("created and used with different settings of -fpic"); - if (data[1] != flag_pie) - return _("created and used with different settings of -fpie"); - data += 2; - - /* Check target_flags. */ - if (targetm.check_pch_target_flags) - { - int tf; - const char *r; - - memcpy (&tf, data, sizeof (target_flags)); - data += sizeof (target_flags); - len -= sizeof (target_flags); - r = targetm.check_pch_target_flags (tf); - if (r != NULL) - return r; - } - - for (i = 0; i < cl_options_count; i++) - if (option_affects_pch_p (i, &state)) - { - if (memcmp (data, state.data, state.size) != 0) - return pch_option_mismatch (cl_options[i].opt_text); - data += state.size; - len -= state.size; - } - - return NULL; -} - /* Default tree printer. Handles declarations only. */ bool default_tree_printer (pretty_printer *pp, text_info *text, const char *spec, diff --git a/gcc/toplev.h b/gcc/toplev.h index 925e35777e6..2455dc02263 100644 --- a/gcc/toplev.h +++ b/gcc/toplev.h @@ -22,11 +22,6 @@ along with GCC; see the file COPYING3. If not see #ifndef GCC_TOPLEV_H #define GCC_TOPLEV_H -/* If non-NULL, return one past-the-end of the matching SUBPART of - the WHOLE string. */ -#define skip_leading_substring(whole, part) \ - (strncmp (whole, part, strlen (part)) ? NULL : whole + strlen (part)) - /* Decoded options, and number of such options. */ extern struct cl_decoded_option *save_decoded_options; extern unsigned int save_decoded_options_count; @@ -46,12 +41,6 @@ extern void init_eh (void); extern void announce_function (tree); -extern void warn_deprecated_use (tree, tree); - -#ifdef BUFSIZ -extern void output_quoted_string (FILE *, const char *); -#endif - extern void wrapup_global_declaration_1 (tree); extern bool wrapup_global_declaration_2 (tree); extern bool wrapup_global_declarations (tree *, int); @@ -67,11 +56,6 @@ extern void target_reinit (void); /* A unique local time stamp, might be zero if none is available. */ extern unsigned local_tick; -/* Top-level source file. */ -extern const char *main_input_filename; -extern const char *main_input_basename; -extern int main_input_baselength; - /* True if the user has tagged the function with the 'section' attribute. */ @@ -80,10 +64,7 @@ extern bool user_defined_section_attribute; /* See toplev.c. */ extern int flag_rerun_cse_after_global_opts; -/* Things to do with target switches. */ extern void print_version (FILE *, const char *); -extern void * default_get_pch_validity (size_t *); -extern const char * default_pch_valid_p (const void *, size_t); /* The hashtable, so that the C front ends can pass it to cpplib. */ extern struct ht *ident_hash; diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 7944f8c7809..e3ab9d92780 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -38,7 +38,6 @@ along with GCC; see the file COPYING3. If not see #include "tree-dump.h" #include "tree-pass.h" #include "diagnostic-core.h" -#include "toplev.h" #include "except.h" #include "cfgloop.h" #include "cfglayout.h" diff --git a/gcc/tree-dump.c b/gcc/tree-dump.c index beac4410fdb..7de09390561 100644 --- a/gcc/tree-dump.c +++ b/gcc/tree-dump.c @@ -32,6 +32,11 @@ along with GCC; see the file COPYING3. If not see #include "langhooks.h" #include "tree-iterator.h" +/* If non-NULL, return one past-the-end of the matching SUBPART of + the WHOLE string. */ +#define skip_leading_substring(whole, part) \ + (strncmp (whole, part, strlen (part)) ? NULL : whole + strlen (part)) + static unsigned int queue (dump_info_p, const_tree, int); static void dump_index (dump_info_p, unsigned int); static void dequeue_and_dump (dump_info_p); diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 2c05835052f..97a9869d31e 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -23,7 +23,6 @@ along with GCC; see the file COPYING3. If not see #include "system.h" #include "coretypes.h" #include "tm.h" -#include "toplev.h" /* floor_log2 */ #include "diagnostic-core.h" #include "tree.h" #include "tree-inline.h" diff --git a/gcc/tree.c b/gcc/tree.c index 2f8d96ef4a2..88666d3e0e8 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -11005,4 +11005,109 @@ typedef_variant_p (tree type) return is_typedef_decl (TYPE_NAME (type)); } +/* Warn about a use of an identifier which was marked deprecated. */ +void +warn_deprecated_use (tree node, tree attr) +{ + const char *msg; + + if (node == 0 || !warn_deprecated_decl) + return; + + if (!attr) + { + if (DECL_P (node)) + attr = DECL_ATTRIBUTES (node); + else if (TYPE_P (node)) + { + tree decl = TYPE_STUB_DECL (node); + if (decl) + attr = lookup_attribute ("deprecated", + TYPE_ATTRIBUTES (TREE_TYPE (decl))); + } + } + + if (attr) + attr = lookup_attribute ("deprecated", attr); + + if (attr) + msg = TREE_STRING_POINTER (TREE_VALUE (TREE_VALUE (attr))); + else + msg = NULL; + + if (DECL_P (node)) + { + expanded_location xloc = expand_location (DECL_SOURCE_LOCATION (node)); + if (msg) + warning (OPT_Wdeprecated_declarations, + "%qD is deprecated (declared at %s:%d): %s", + node, xloc.file, xloc.line, msg); + else + warning (OPT_Wdeprecated_declarations, + "%qD is deprecated (declared at %s:%d)", + node, xloc.file, xloc.line); + } + else if (TYPE_P (node)) + { + tree what = NULL_TREE; + tree decl = TYPE_STUB_DECL (node); + + if (TYPE_NAME (node)) + { + if (TREE_CODE (TYPE_NAME (node)) == IDENTIFIER_NODE) + what = TYPE_NAME (node); + else if (TREE_CODE (TYPE_NAME (node)) == TYPE_DECL + && DECL_NAME (TYPE_NAME (node))) + what = DECL_NAME (TYPE_NAME (node)); + } + + if (decl) + { + expanded_location xloc + = expand_location (DECL_SOURCE_LOCATION (decl)); + if (what) + { + if (msg) + warning (OPT_Wdeprecated_declarations, + "%qE is deprecated (declared at %s:%d): %s", + what, xloc.file, xloc.line, msg); + else + warning (OPT_Wdeprecated_declarations, + "%qE is deprecated (declared at %s:%d)", what, + xloc.file, xloc.line); + } + else + { + if (msg) + warning (OPT_Wdeprecated_declarations, + "type is deprecated (declared at %s:%d): %s", + xloc.file, xloc.line, msg); + else + warning (OPT_Wdeprecated_declarations, + "type is deprecated (declared at %s:%d)", + xloc.file, xloc.line); + } + } + else + { + if (what) + { + if (msg) + warning (OPT_Wdeprecated_declarations, "%qE is deprecated: %s", + what, msg); + else + warning (OPT_Wdeprecated_declarations, "%qE is deprecated", what); + } + else + { + if (msg) + warning (OPT_Wdeprecated_declarations, "type is deprecated: %s", + msg); + else + warning (OPT_Wdeprecated_declarations, "type is deprecated"); + } + } + } +} + #include "gt-tree.h" diff --git a/gcc/tree.h b/gcc/tree.h index 14fe7aa6799..4995b4384c4 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -4959,6 +4959,7 @@ extern tree tree_strip_nop_conversions (tree); extern tree tree_strip_sign_nop_conversions (tree); extern tree lhd_gcc_personality (void); extern void assign_assembler_name_if_neeeded (tree); +extern void warn_deprecated_use (tree, tree); /* In cgraph.c */ diff --git a/gcc/varasm.c b/gcc/varasm.c index fc996f1f8cd..5f79ece7001 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -40,7 +40,6 @@ along with GCC; see the file COPYING3. If not see #include "regs.h" #include "output.h" #include "diagnostic-core.h" -#include "toplev.h" #include "hashtab.h" #include "ggc.h" #include "langhooks.h" diff --git a/gcc/xcoffout.c b/gcc/xcoffout.c index fa889789e78..ccc1ab810ff 100644 --- a/gcc/xcoffout.c +++ b/gcc/xcoffout.c @@ -31,7 +31,6 @@ along with GCC; see the file COPYING3. If not see #include "rtl.h" #include "flags.h" #include "diagnostic-core.h" -#include "toplev.h" #include "output.h" #include "ggc.h" #include "target.h" |