Prevent unnecessary recompilation for trivial params.def changes
authorTom de Vries <tom@codesourcery.com>
Tue, 8 Sep 2015 21:20:51 +0000 (21:20 +0000)
committerTom de Vries <vries@gcc.gnu.org>
Tue, 8 Sep 2015 21:20:51 +0000 (21:20 +0000)
2015-09-08  Tom de Vries  <tom@codesourcery.com>

* Makefile.in (generated_files): Add params.list.
(params.list, s-params.list): Add rule.
* params.h (enum compiler_param): Include params-list.h.  Move define
DEFPARAM, include params.def and undef DEFPARAM ...
* params-list.h: ... here.  New file.

From-SVN: r227566

gcc/ChangeLog
gcc/Makefile.in
gcc/params-list.h [new file with mode: 0644]
gcc/params.h

index fb7d644eac9cf5c83d67c0fe9072466dba2861e0..d8dd36a6de1d51ccb6d76f20f2d07a6d0dbb8dee 100644 (file)
@@ -1,3 +1,11 @@
+2015-09-08  Tom de Vries  <tom@codesourcery.com>
+
+       * Makefile.in (generated_files): Add params.list.
+       (params.list, s-params.list): Add rule.
+       * params.h (enum compiler_param): Include params-list.h.  Move define
+       DEFPARAM, include params.def and undef DEFPARAM ...
+       * params-list.h: ... here.  New file.
+
 2015-09-08  David Malcolm  <dmalcolm@redhat.com>
 
        * pretty-print.h (printer_fn): Fix typo in comment.
index 3d1c1e5aba34dc08b60bb4eddb1697415d380ec9..b495bd2eb3f5ac9ee480a68db1cea385f5874268 100644 (file)
@@ -2415,7 +2415,7 @@ generated_files = config.h tm.h $(TM_P_H) $(TM_H) multilib.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 \
-       c-family/c-target-hooks-def.h
+       c-family/c-target-hooks-def.h params.list
 
 #\f
 # How to compile object files to run on the build machine.
@@ -3236,6 +3236,12 @@ installdirs:
        $(mkinstalldirs) $(DESTDIR)$(man1dir)
        $(mkinstalldirs) $(DESTDIR)$(man7dir)
 
+params.list: s-params.list; @true
+s-params.list: $(srcdir)/params-list.h $(srcdir)/params.def
+       $(CPP) $(srcdir)/params-list.h | sed 's/^#.*//;/^$$/d' > tmp-params.list
+       $(SHELL) $(srcdir)/../move-if-change tmp-params.list params.list
+       $(STAMP) s-params.list
+
 PLUGIN_HEADERS = $(TREE_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
   toplev.h $(DIAGNOSTIC_CORE_H) $(BASIC_BLOCK_H) $(HASH_TABLE_H) \
   tree-ssa-alias.h $(INTERNAL_FN_H) gimple-fold.h tree-eh.h gimple-expr.h \
diff --git a/gcc/params-list.h b/gcc/params-list.h
new file mode 100644 (file)
index 0000000..49301d2
--- /dev/null
@@ -0,0 +1,4 @@
+#define DEFPARAM(enumerator, option, nocmsgid, default, min, max) \
+  enumerator,
+#include "params.def"
+#undef DEFPARAM
index f53426dfea69310880a4ffcf85ab80ef3e493d6e..9f7618ac1d14f0cb735dce68976ace35becddfff 100644 (file)
@@ -81,10 +81,7 @@ extern void set_param_value (const char *name, int value,
 
 enum compiler_param
 {
-#define DEFPARAM(enumerator, option, nocmsgid, default, min, max) \
-  enumerator,
-#include "params.def"
-#undef DEFPARAM
+#include "params.list"
   LAST_PARAM
 };