+2017-07-02 Richard Sandiford <richard.sandiford@linaro.org>
+ Alan Hayward <alan.hayward@arm.com>
+ David Sherwood <david.sherwood@arm.com>
+
+ * Makefile.in (MACHMODE_H): Remove insn-modes.h
+ (CORETYPES_H): New define.
+ (MOSTLYCLEANFILES): Add insn-modes-inline.h.
+ (insn-modes-inline.h, s-modes-inline-h): New rules.
+ (generated_files): Add insn-modes-inline.h.
+ (RTL_BASE_H, TREE_CORE_H): Use CORETYPES_H instead of coretypes.h.
+ (build/gensupport.o, build/ggc-none.o, build/print-rtl.o): Likewise.
+ (build/read-md.o, build/read-rtl.o, build/rtl.o): Likewise.
+ (build/vec.o, build/hash-table.o, build/inchash.o): Likewise.
+ (build/gencondmd.o, build/genattr.o, build/genattr-common.o): Likewise.
+ (build/genattrtab.o, build/genautomata.o, build/gencheck.o): Likewise.
+ (build/gencodes.o, build/genconditions.o): Likewise.
+ (build/genconfig.o, build/genconstants.o, build/genemit.o): Likewise.
+ (build/genenums.o, build/genextract.o, build/genflags.o): Likewise.
+ (build/gentarget-def.o, build/genmddeps.o, build/genopinit.o)
+ (build/genoutput.o, build/genpeep.o, build/genpreds.o): Likewise.
+ (build/genrecog.o, build/genmddump.o, build/genmatch.o): Likewise.
+ (build/gencfn-macros.o, build/gcov-iov.o): Likewise.
+ * coretypes.h: Include everything up to real.h for generators.
+ Include insn-modes.h first. Include wide-int-print.h after
+ wide-int.h. Include insn-modes-inline.h and then machmode.h.
+ * machmode.h: Don't include insn-modes.h here.
+ * function-tests.c: Remove includes of signop.h, machmode.h,
+ double-int.h and wide-int.h.
+ * rtl.h: Likewise.
+ * gcc-rich-location.c: Remove includes of machmode.h, double-int.h
+ and wide-int.h.
+ * optc-save-gen.awk: Likewise.
+ * gencheck.c (BITS_PER_UNIT): Delete dummy definition.
+ * godump.c: Remove include of wide-int-print.h.
+ * pretty-print.h: Likewise.
+ * wide-int-print.cc: Likewise.
+ * wide-int.cc: Likewise.
+ * hash-map-tests.c: Remove include of signop.h.
+ * hash-set-tests.c: Likewise.
+ * rtl-tests.c: Likewise.
+ * mkconfig.sh: Remove include of machmode.h.
+ * genmodes.c (emit_insn_modes_h): Split emission of inline functions
+ into...
+ (emit_insn_modes_inline_h): ...this new function. Emit the code
+ into an insn-modes-inline.h header file, adding appropriate
+ include guards and end comments.
+ (emit_insn_modes_c_header): Remove include of machmode.h.
+ (emit_min_insn_modes_c_header): Include coretypes.h rather than
+ machmode.h.
+ (main): Handle -i flag and call emit_insn_modes_inline_h when
+ it is passed.
+
2017-07-02 Richard Sandiford <richard.sandiford@linaro.org>
* tree-ssa-strlen.c (strinfo): Rename the length field to
TARGET_H = $(TM_H) target.h $(TARGET_DEF) insn-modes.h insn-codes.h
C_TARGET_H = c-family/c-target.h $(C_TARGET_DEF)
COMMON_TARGET_H = common/common-target.h $(INPUT_H) $(COMMON_TARGET_DEF)
-MACHMODE_H = machmode.h mode-classes.def insn-modes.h
+MACHMODE_H = machmode.h mode-classes.def
HOOKS_H = hooks.h $(MACHMODE_H)
HOSTHOOKS_DEF_H = hosthooks-def.h $(HOOKS_H)
LANGHOOKS_DEF_H = langhooks-def.h $(HOOKS_H)
TARGET_DEF_H = target-def.h target-hooks-def.h $(HOOKS_H) targhooks.h
C_TARGET_DEF_H = c-family/c-target-def.h c-family/c-target-hooks-def.h \
$(TREE_H) $(C_COMMON_H) $(HOOKS_H) common/common-targhooks.h
-RTL_BASE_H = coretypes.h rtl.h rtl.def $(MACHMODE_H) reg-notes.def \
+CORETYPES_H = coretypes.h insn-modes.h insn-modes-inline.h
+RTL_BASE_H = $(CORETYPES_H) rtl.h rtl.def $(MACHMODE_H) reg-notes.def \
insn-notes.def $(INPUT_H) $(REAL_H) statistics.h $(VEC_H) \
$(FIXED_VALUE_H) alias.h $(HASHTAB_H)
FIXED_VALUE_H = fixed-value.h $(MACHMODE_H) double-int.h
hsa-builtins.def
INTERNAL_FN_DEF = internal-fn.def
INTERNAL_FN_H = internal-fn.h $(INTERNAL_FN_DEF)
-TREE_CORE_H = tree-core.h coretypes.h all-tree.def tree.def \
+TREE_CORE_H = tree-core.h $(CORETYPES_H) all-tree.def tree.def \
c-family/c-common.def $(lang_tree_files) $(MACHMODE_H) \
$(BUILTINS_DEF) $(INPUT_H) statistics.h \
$(VEC_H) treestruct.def $(HASHTAB_H) \
insn-attr.h insn-attr-common.h insn-attrtab.c insn-dfatab.c \
insn-latencytab.c insn-opinit.c insn-opinit.h insn-preds.c insn-constants.h \
tm-preds.h tm-constrs.h checksum-options gimple-match.c generic-match.c \
- tree-check.h min-insn-modes.c insn-modes.c insn-modes.h \
+ tree-check.h min-insn-modes.c insn-modes.c insn-modes.h insn-modes-inline.h \
genrtl.h gt-*.h gtype-*.h gtype-desc.c gtyp-input.list \
case-cfn-macros.h cfn-operators.pd \
xgcc$(exeext) cpp$(exeext) $(FULL_DRIVER_NAME) \
insn-modes.c: s-modes; @true
insn-modes.h: s-modes-h; @true
+insn-modes-inline.h: s-modes-inline-h; @true
min-insn-modes.c: s-modes-m; @true
s-modes: build/genmodes$(build_exeext)
$(SHELL) $(srcdir)/../move-if-change tmp-modes.h insn-modes.h
$(STAMP) s-modes-h
+s-modes-inline-h: build/genmodes$(build_exeext)
+ $(RUN_GEN) build/genmodes$(build_exeext) -i > tmp-modes-inline.h
+ $(SHELL) $(srcdir)/../move-if-change tmp-modes-inline.h \
+ insn-modes-inline.h
+ $(STAMP) s-modes-inline-h
+
s-modes-m: build/genmodes$(build_exeext)
$(RUN_GEN) build/genmodes$(build_exeext) -m > tmp-min-modes.c
$(SHELL) $(srcdir)/../move-if-change tmp-min-modes.c min-insn-modes.c
generated_files = config.h tm.h $(TM_P_H) $(TM_H) multilib.h \
$(simple_generated_h) specs.h \
- tree-check.h genrtl.h insn-modes.h tm-preds.h tm-constrs.h \
+ tree-check.h genrtl.h insn-modes.h insn-modes-inline.h \
+ tm-preds.h tm-constrs.h \
$(ALL_GTFILES_H) gtype-desc.c gtype-desc.h gcov-iov.h \
options.h target-hooks-def.h insn-opinit.h \
common/common-target-hooks-def.h pass-instances.def \
# Header dependencies for the programs that generate source code.
# These are library modules...
build/errors.o : errors.c $(BCONFIG_H) $(SYSTEM_H) errors.h
-build/gensupport.o: gensupport.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h \
- $(GTM_H) $(RTL_BASE_H) $(OBSTACK_H) errors.h $(HASHTAB_H) \
- $(READ_MD_H) $(GENSUPPORT_H)
-build/ggc-none.o : ggc-none.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h \
+build/gensupport.o: gensupport.c $(BCONFIG_H) $(SYSTEM_H) \
+ $(CORETYPES_H) $(GTM_H) $(RTL_BASE_H) $(OBSTACK_H) errors.h \
+ $(HASHTAB_H) $(READ_MD_H) $(GENSUPPORT_H)
+build/ggc-none.o : ggc-none.c $(BCONFIG_H) $(SYSTEM_H) $(CORETYPES_H) \
$(GGC_H)
build/min-insn-modes.o : min-insn-modes.c $(BCONFIG_H) $(SYSTEM_H) \
$(MACHMODE_H)
-build/print-rtl.o: print-rtl.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h \
+build/print-rtl.o: print-rtl.c $(BCONFIG_H) $(SYSTEM_H) $(CORETYPES_H) \
$(GTM_H) $(RTL_BASE_H)
-build/read-md.o: read-md.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h \
+build/read-md.o: read-md.c $(BCONFIG_H) $(SYSTEM_H) $(CORETYPES_H) \
$(HASHTAB_H) errors.h $(READ_MD_H)
-build/read-rtl.o: read-rtl.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h \
+build/read-rtl.o: read-rtl.c $(BCONFIG_H) $(SYSTEM_H) $(CORETYPES_H) \
$(GTM_H) $(RTL_BASE_H) $(OBSTACK_H) $(HASHTAB_H) $(READ_MD_H) \
$(GENSUPPORT_H)
-build/rtl.o: rtl.c $(BCONFIG_H) coretypes.h $(GTM_H) $(SYSTEM_H) \
+build/rtl.o: rtl.c $(BCONFIG_H) $(CORETYPES_H) $(GTM_H) $(SYSTEM_H) \
$(RTL_H) $(GGC_H) errors.h
-build/vec.o : vec.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(VEC_H) \
- $(GGC_H) toplev.h $(DIAGNOSTIC_CORE_H)
-build/hash-table.o : hash-table.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h \
- $(HASH_TABLE_H) $(GGC_H) toplev.h $(DIAGNOSTIC_CORE_H)
-build/inchash.o : inchash.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h \
- $(HASHTAB_H) inchash.h
+build/vec.o : vec.c $(BCONFIG_H) $(SYSTEM_H) $(CORETYPES_H) $(VEC_H) \
+ $(GGC_H) toplev.h $(DIAGNOSTIC_CORE_H)
+build/hash-table.o : hash-table.c $(BCONFIG_H) $(SYSTEM_H) \
+ $(CORETYPES_H) $(HASH_TABLE_H) $(GGC_H) toplev.h $(DIAGNOSTIC_CORE_H)
+build/inchash.o : inchash.c $(BCONFIG_H) $(SYSTEM_H) $(CORETYPES_H) \
+ $(HASHTAB_H) inchash.h
build/gencondmd.o : build/gencondmd.c $(BCONFIG_H) $(SYSTEM_H) \
- coretypes.h $(GTM_H) insn-constants.h \
+ $(CORETYPES_H) $(GTM_H) insn-constants.h \
$(filter-out insn-flags.h, $(RTL_H) $(TM_P_H) $(FUNCTION_H) $(REGS_H) \
$(RECOG_H) output.h $(FLAGS_H) $(RESOURCE_H) toplev.h $(DIAGNOSTIC_CORE_H) reload.h \
$(EXCEPT_H) tm-constrs.h)
# ...these are the programs themselves.
build/genattr.o : genattr.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
- coretypes.h $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H)
+ $(CORETYPES_H) $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H)
build/genattr-common.o : genattr-common.c $(RTL_BASE_H) $(BCONFIG_H) \
- $(SYSTEM_H) coretypes.h $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H)
+ $(SYSTEM_H) $(CORETYPES_H) $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H)
build/genattrtab.o : genattrtab.c $(RTL_BASE_H) $(OBSTACK_H) \
- $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) errors.h $(GGC_H) \
+ $(BCONFIG_H) $(SYSTEM_H) $(CORETYPES_H) $(GTM_H) errors.h $(GGC_H) \
$(READ_MD_H) $(GENSUPPORT_H) $(FNMATCH_H)
build/genautomata.o : genautomata.c $(RTL_BASE_H) $(OBSTACK_H) \
- $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) errors.h $(VEC_H) \
+ $(BCONFIG_H) $(SYSTEM_H) $(CORETYPES_H) $(GTM_H) errors.h $(VEC_H) \
$(HASHTAB_H) $(GENSUPPORT_H) $(FNMATCH_H)
build/gencheck.o : gencheck.c all-tree.def $(BCONFIG_H) $(GTM_H) \
- $(SYSTEM_H) coretypes.h tree.def c-family/c-common.def \
+ $(SYSTEM_H) $(CORETYPES_H) tree.def c-family/c-common.def \
$(lang_tree_files) gimple.def
build/genchecksum.o : genchecksum.c $(BCONFIG_H) $(SYSTEM_H) $(MD5_H)
build/gencodes.o : gencodes.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
- coretypes.h $(GTM_H) errors.h $(GENSUPPORT_H)
+ $(CORETYPES_H) $(GTM_H) errors.h $(GENSUPPORT_H)
build/genconditions.o : genconditions.c $(RTL_BASE_H) $(BCONFIG_H) \
- $(SYSTEM_H) coretypes.h $(GTM_H) errors.h $(HASHTAB_H) $(READ_MD_H) \
- $(GENSUPPORT_H)
+ $(SYSTEM_H) $(CORETYPES_H) $(GTM_H) errors.h $(HASHTAB_H) \
+ $(READ_MD_H) $(GENSUPPORT_H)
build/genconfig.o : genconfig.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
- coretypes.h $(GTM_H) errors.h $(GENSUPPORT_H)
+ $(CORETYPES_H) $(GTM_H) errors.h $(GENSUPPORT_H)
build/genconstants.o : genconstants.c $(BCONFIG_H) $(SYSTEM_H) \
- coretypes.h errors.h $(READ_MD_H)
+ $(CORETYPES_H) errors.h $(READ_MD_H)
build/genemit.o : genemit.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
- coretypes.h $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H) internal-fn.def
+ $(CORETYPES_H) $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H) internal-fn.def
build/genenums.o : genenums.c $(BCONFIG_H) $(SYSTEM_H) \
- coretypes.h errors.h $(READ_MD_H)
+ $(CORETYPES_H) errors.h $(READ_MD_H)
build/genextract.o : genextract.c $(RTL_BASE_H) $(BCONFIG_H) \
- $(SYSTEM_H) coretypes.h $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H)
+ $(SYSTEM_H) $(CORETYPES_H) $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H)
build/genflags.o : genflags.c $(RTL_BASE_H) $(OBSTACK_H) $(BCONFIG_H) \
- $(SYSTEM_H) coretypes.h $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H)
+ $(SYSTEM_H) $(CORETYPES_H) $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H)
build/gentarget-def.o : gentarget-def.c $(BCONFIG_H) $(SYSTEM_H) \
- coretypes.h $(GTM_H) $(RTL_BASE_H) errors.h $(READ_MD_H) $(GENSUPPORT_H) \
- $(HASH_TABLE_H) target-insns.def
+ $(CORETYPES_H) $(GTM_H) $(RTL_BASE_H) errors.h $(READ_MD_H) \
+ $(GENSUPPORT_H) $(HASH_TABLE_H) target-insns.def
build/gengenrtl.o : gengenrtl.c $(BCONFIG_H) $(SYSTEM_H) rtl.def
# The gengtype generator program is special: Two versions are built.
CFLAGS-errors.o += -DHOST_GENERATOR_FILE
-build/genmddeps.o: genmddeps.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h \
+build/genmddeps.o: genmddeps.c $(BCONFIG_H) $(SYSTEM_H) $(CORETYPES_H) \
errors.h $(READ_MD_H)
build/genmodes.o : genmodes.c $(BCONFIG_H) $(SYSTEM_H) errors.h \
$(HASHTAB_H) machmode.def $(extra_modes_file)
build/genopinit.o : genopinit.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
- coretypes.h $(GTM_H) errors.h $(GENSUPPORT_H) optabs.def
+ $(CORETYPES_H) $(GTM_H) errors.h $(GENSUPPORT_H) optabs.def
build/genoutput.o : genoutput.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
- coretypes.h $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H)
+ $(CORETYPES_H) $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H)
build/genpeep.o : genpeep.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
- coretypes.h $(GTM_H) errors.h $(GENSUPPORT_H) toplev.h $(DIAGNOSTIC_CORE_H)
+ $(CORETYPES_H) $(GTM_H) errors.h $(GENSUPPORT_H) toplev.h \
+ $(DIAGNOSTIC_CORE_H)
build/genpreds.o : genpreds.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
- coretypes.h $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H) $(OBSTACK_H)
+ $(CORETYPES_H) $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H) $(OBSTACK_H)
build/genrecog.o : genrecog.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
- coretypes.h $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H) \
+ $(CORETYPES_H) $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H) \
$(HASH_TABLE_H) inchash.h
build/genhooks.o : genhooks.c $(TARGET_DEF) $(C_TARGET_DEF) \
$(COMMON_TARGET_DEF) $(BCONFIG_H) $(SYSTEM_H) errors.h
build/genmddump.o : genmddump.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
- coretypes.h $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H)
+ $(CORETYPES_H) $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H)
build/genmatch.o : genmatch.c $(BCONFIG_H) $(SYSTEM_H) \
- coretypes.h errors.h $(HASH_TABLE_H) hash-map.h $(GGC_H) is-a.h \
+ $(CORETYPES_H) errors.h $(HASH_TABLE_H) hash-map.h $(GGC_H) is-a.h \
tree.def builtins.def internal-fn.def
build/gencfn-macros.o : gencfn-macros.c $(BCONFIG_H) $(SYSTEM_H) \
- coretypes.h errors.h $(HASH_TABLE_H) hash-set.h builtins.def internal-fn.def
+ $(CORETYPES_H) errors.h $(HASH_TABLE_H) hash-set.h builtins.def \
+ internal-fn.def
# Compile the programs that generate insn-* from the machine description.
# They are compiled with $(COMPILER_FOR_BUILD), and associated libraries,
# having an empty command (nothing following the semicolon).
# gcov-iov.c is run on the build machine to generate gcov-iov.h from version.c
-build/gcov-iov.o: gcov-iov.c $(BCONFIG_H) coretypes.h $(GTM_H) \
- $(SYSTEM_H) coretypes.h $(TM_H)
+build/gcov-iov.o: gcov-iov.c $(BCONFIG_H) $(CORETYPES_H) $(GTM_H) \
+ $(SYSTEM_H) $(CORETYPES_H) $(TM_H)
build/gcov-iov$(build_exeext): build/gcov-iov.o
+$(LINKER_FOR_BUILD) $(BUILD_LINKERFLAGS) $(BUILD_LDFLAGS) \