]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* cfgrtl.c (pass_free_cfg): Add pass name.
authoramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 8 Nov 2009 21:10:08 +0000 (21:10 +0000)
committeramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 8 Nov 2009 21:10:08 +0000 (21:10 +0000)
        * cgraphbuild.c (pass_build_cgraph_edges): Likewise.
        (pass_rebuild_cgraph_edges, pass_remove_cgraph_callee_edges): Likewise.
        * dce.c (pass_ud_rtl_dce, pass_fast_rtl_dce): Change pass name.
        * df-core.c (pass_df_initialize_no_opt): Likewise.
        * except.c (pass_rtl_eh): Likewise.
        * function.c (pass_init_function, pass_leaf_regs): Likewise.
        * gcse.c (pass_rtl_pre): Change pass name.
        * passes.c (pass_postreload): Add pass name.
        (make_pass_instance): Don't use duplicate-tracking logic for
        names starting with '*'.
        (next_pass_1): Assert that pass has a name.
        (register_one_dump_file): If there is an space in the name,
        skip past it.
        * predict.c (pass_strip_predict_hints): Add pass name.
        * reg-stack.c (pass_stack_regs): Likewise.
        * stack-ptr-mod.c (pass_stack_ptr_mod): Likewise.
        * tree-cfg.c (pass_warn_function_return,
        pass_warn_function_noreturn): Add pass name.
        * tree-dfa.c (pass_referenced_vars): Likewise.
        * tree-optimize.c (pass_cleanup_cfg_post_optimizing):
        Fix whitespace before comment.
        (pass_fixup_cfg): Add pass name, fix whitespace before comment.
        (pass_init_datastructures): Add pass name.
        * tree-ssa-loop.c (pass_record_bounds): Likewise.
        * tree-ssa.c (pass_early_warn_uninitialized,
        pass_late_warn_uninitialized): Likewise.
        * tree.c (pass_ipa_free_lang_data): Likewise.
        * doc/passes.texi (pass manager): Document how to disambiguate
        pass names.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154013 138bc75d-0d04-0410-961f-82ee72b054a4

19 files changed:
gcc/ChangeLog
gcc/cfgrtl.c
gcc/cgraphbuild.c
gcc/dce.c
gcc/df-core.c
gcc/doc/passes.texi
gcc/except.c
gcc/function.c
gcc/gcse.c
gcc/passes.c
gcc/predict.c
gcc/reg-stack.c
gcc/stack-ptr-mod.c
gcc/tree-cfg.c
gcc/tree-dfa.c
gcc/tree-optimize.c
gcc/tree-ssa-loop.c
gcc/tree-ssa.c
gcc/tree.c

index 845e28250b220210de5cd9e009abef1667b3a49e..aeb880e82309042df15ae283e4a6ca7d4d78f85b 100644 (file)
@@ -1,3 +1,37 @@
+2009-11-08  Zbigniew Chamski  <zbigniew.chamski@gmail.com>
+           Joern Rennecke  <amylaar@spamcop.net>
+
+       * cfgrtl.c (pass_free_cfg): Add pass name.
+       * cgraphbuild.c (pass_build_cgraph_edges): Likewise.
+       (pass_rebuild_cgraph_edges, pass_remove_cgraph_callee_edges): Likewise.
+       * dce.c (pass_ud_rtl_dce, pass_fast_rtl_dce): Change pass name.
+       * df-core.c (pass_df_initialize_no_opt): Likewise.
+       * except.c (pass_rtl_eh): Likewise.
+       * function.c (pass_init_function, pass_leaf_regs): Likewise.
+       * gcse.c (pass_rtl_pre): Change pass name.
+       * passes.c (pass_postreload): Add pass name.
+       (make_pass_instance): Don't use duplicate-tracking logic for
+       names starting with '*'.
+       (next_pass_1): Assert that pass has a name.
+       (register_one_dump_file): If there is an space in the name,
+       skip past it.
+       * predict.c (pass_strip_predict_hints): Add pass name.
+       * reg-stack.c (pass_stack_regs): Likewise.
+       * stack-ptr-mod.c (pass_stack_ptr_mod): Likewise.
+       * tree-cfg.c (pass_warn_function_return,
+       pass_warn_function_noreturn): Add pass name.
+       * tree-dfa.c (pass_referenced_vars): Likewise.
+       * tree-optimize.c (pass_cleanup_cfg_post_optimizing):
+       Fix whitespace before comment.
+       (pass_fixup_cfg): Add pass name, fix whitespace before comment.
+       (pass_init_datastructures): Add pass name.
+       * tree-ssa-loop.c (pass_record_bounds): Likewise.
+       * tree-ssa.c (pass_early_warn_uninitialized,
+       pass_late_warn_uninitialized): Likewise.
+       * tree.c (pass_ipa_free_lang_data): Likewise.
+       * doc/passes.texi (pass manager): Document how to disambiguate
+       pass names.
+
 2009-11-08  Paolo Bonzini  <bonzini@gnu.org>
 
        * df-problems.c: Fix documentation for forward simulation of LR.
index 4146b146977e7e777fa522be688414a1d495e5a4..73aebf078446aaa15af4e2d0b760a36062953bfc 100644 (file)
@@ -433,7 +433,7 @@ struct rtl_opt_pass pass_free_cfg =
 {
  {
   RTL_PASS,
-  NULL,                                 /* name */
+  "*free_cfg",                          /* name */
   NULL,                                 /* gate */
   rest_of_pass_free_cfg,                /* execute */
   NULL,                                 /* sub */
index 65e3d67e14c8cc8e2fa4391b9a4bb6caf2154287..8423c36b880a5624f3f0adcd7527dbbbb4c0d3b9 100644 (file)
@@ -205,7 +205,7 @@ struct gimple_opt_pass pass_build_cgraph_edges =
 {
  {
   GIMPLE_PASS,
-  NULL,                                        /* name */
+  "*build_cgraph_edges",                       /* name */
   NULL,                                        /* gate */
   build_cgraph_edges,                  /* execute */
   NULL,                                        /* sub */
@@ -270,7 +270,7 @@ struct gimple_opt_pass pass_rebuild_cgraph_edges =
 {
  {
   GIMPLE_PASS,
-  NULL,                                        /* name */
+  "*rebuild_cgraph_edges",             /* name */
   NULL,                                        /* gate */
   rebuild_cgraph_edges,                        /* execute */
   NULL,                                        /* sub */
@@ -297,7 +297,7 @@ struct gimple_opt_pass pass_remove_cgraph_callee_edges =
 {
  {
   GIMPLE_PASS,
-  NULL,                                        /* name */
+  "*remove_cgraph_callee_edges",               /* name */
   NULL,                                        /* gate */
   remove_cgraph_callee_edges,          /* execute */
   NULL,                                        /* sub */
index b937dd44a190c6af421d9d00c55feac4b8da2a10..a2c6973f53f904427a523725c9a8de0b4e183c6b 100644 (file)
--- a/gcc/dce.c
+++ b/gcc/dce.c
@@ -738,9 +738,9 @@ struct rtl_opt_pass pass_ud_rtl_dce =
 {
  {
   RTL_PASS,
-  "dce",                                /* name */
-  gate_ud_dce,                        /* gate */
-  rest_of_handle_ud_dce,              /* execute */
+  "ud dce",                             /* name */
+  gate_ud_dce,                          /* gate */
+  rest_of_handle_ud_dce,                /* execute */
   NULL,                                 /* sub */
   NULL,                                 /* next */
   0,                                    /* static_pass_number */
@@ -1123,7 +1123,7 @@ struct rtl_opt_pass pass_fast_rtl_dce =
 {
  {
   RTL_PASS,
-  "dce",                                /* name */
+  "rtl dce",                            /* name */
   gate_fast_dce,                        /* gate */
   rest_of_handle_fast_dce,              /* execute */
   NULL,                                 /* sub */
index 8057b54df102eddbcabb59580c6791ef85a7a061..a53e7091d955b81b58f3ffae8c92ee60693925db 100644 (file)
@@ -780,7 +780,7 @@ struct rtl_opt_pass pass_df_initialize_no_opt =
 {
  {
   RTL_PASS,
-  "dfinit",                             /* name */
+  "no-opt dfinit",                      /* name */
   gate_no_opt,                          /* gate */
   rest_of_handle_df_initialize,         /* execute */
   NULL,                                 /* sub */
index b28b87cb57ab6650bc3978887b48909556b90061..2bbddeab52012f6e36681b643394ce9a83983f57 100644 (file)
@@ -166,9 +166,14 @@ not attempt to (re-)generate data structures or lower intermediate
 language form based on the requirements of the next pass.  Nevertheless,
 what is present is useful, and a far sight better than nothing at all.
 
+Each pass should have a unique name.
 Each pass may have its own dump file (for GCC debugging purposes).
-Passes without any names, or with a name starting with a star, do not
-dump anything.
+Passes with a name starting with a star do not dump anything.
+Sometimes passes are supposed to share a dump file / option name.
+To still give these unique names, you can use a prefix that is delimited
+by a space from the part that is used for the dump file / option name.
+E.g. When the pass name is "ud dce", the name used for dump file/options
+is "dce".
 
 TODO: describe the global variables set up by the pass manager,
 and a brief description of how a new pass should use it.
index b25e48b6c9bcebedbadd8ef13096f8d8bccaf394..6c7618339e57bc0fb3c92da53aeb7620a66a1ada 100644 (file)
@@ -1465,7 +1465,7 @@ struct rtl_opt_pass pass_rtl_eh =
 {
  {
   RTL_PASS,
-  "eh",                                 /* name */
+  "rtl eh",                             /* name */
   gate_handle_eh,                       /* gate */
   rest_of_handle_eh,                   /* execute */
   NULL,                                 /* sub */
index 35c0cfd609e8b04cb5ea9d5fe4a051ed27f50f1c..d5963430c7305b37a6f447cffa8334aab2db695b 100644 (file)
@@ -4228,7 +4228,7 @@ struct rtl_opt_pass pass_init_function =
 {
  {
   RTL_PASS,
-  NULL,                                 /* name */
+  "*init_function",                     /* name */
   NULL,                                 /* gate */   
   init_function_for_compilation,        /* execute */       
   NULL,                                 /* sub */
@@ -5538,7 +5538,7 @@ struct rtl_opt_pass pass_leaf_regs =
 {
  {
   RTL_PASS,
-  NULL,                                 /* name */
+  "*leaf_regs",                         /* name */
   NULL,                                 /* gate */
   rest_of_handle_check_leaf_regs,       /* execute */
   NULL,                                 /* sub */
index 7ccb05e1d85fbab65b72a4d6643ffbcff30a35c2..e6514e7cce5d40508bc9dd71eca70eecf762e7c7 100644 (file)
@@ -5147,7 +5147,7 @@ struct rtl_opt_pass pass_rtl_pre =
 {
  {
   RTL_PASS,
-  "pre",                                /* name */
+  "rtl pre",                            /* name */
   gate_rtl_pre,                         /* gate */   
   execute_rtl_pre,                     /* execute */       
   NULL,                                 /* sub */
index 80225490cbddfd62a87941ecd45a7db88076c4d7..1cef3499b789ec168124943cf5ab1326a46678b3 100644 (file)
@@ -314,7 +314,7 @@ struct rtl_opt_pass pass_postreload =
 {
  {
   RTL_PASS,
-  NULL,                                 /* name */
+  "*all-postreload",                        /* name */
   gate_postreload,                      /* gate */
   NULL,                                 /* execute */
   NULL,                                 /* sub */
@@ -374,7 +374,7 @@ void
 register_one_dump_file (struct opt_pass *pass)
 {
   char *dot_name, *flag_name, *glob_name;
-  const char *prefix;
+  const char *name, *prefix;
   char num[10];
   int flags, id;
 
@@ -384,7 +384,14 @@ register_one_dump_file (struct opt_pass *pass)
     sprintf (num, "%d", ((int) pass->static_pass_number < 0
                         ? 1 : pass->static_pass_number));
 
-  dot_name = concat (".", pass->name, num, NULL);
+  /* The name is both used to identify the pass for the purposes of plugins,
+     and to specify dump file name and option.
+     The latter two might want something short which is not quite unique; for
+     that reason, we may have a disambiguating prefix, followed by a space
+     to mark the start of the following dump file name / option string.  */
+  name = strchr (pass->name, ' ');
+  name = name ? name + 1 : pass->name;
+  dot_name = concat (".", name, num, NULL);
   if (pass->type == SIMPLE_IPA_PASS || pass->type == IPA_PASS)
     prefix = "ipa-", flags = TDF_IPA;
   else if (pass->type == GIMPLE_PASS)
@@ -392,8 +399,8 @@ register_one_dump_file (struct opt_pass *pass)
   else
     prefix = "rtl-", flags = TDF_RTL;
 
-  flag_name = concat (prefix, pass->name, num, NULL);
-  glob_name = concat (prefix, pass->name, NULL);
+  flag_name = concat (prefix, name, num, NULL);
+  glob_name = concat (prefix, name, NULL);
   id = dump_register (dot_name, flag_name, glob_name, flags);
   set_pass_for_id (id, pass);
 }
@@ -461,7 +468,7 @@ make_pass_instance (struct opt_pass *pass, bool track_duplicates)
          and so it should rename the dump file.  The first instance will
          be -1, and be number of duplicates = -static_pass_number - 1.
          Subsequent instances will be > 0 and just the duplicate number.  */
-      if (pass->name || track_duplicates)
+      if ((pass->name && pass->name[0] != '*') || track_duplicates)
         {
           pass->static_pass_number -= 1;
           new_pass->static_pass_number = -pass->static_pass_number;
@@ -482,6 +489,9 @@ make_pass_instance (struct opt_pass *pass, bool track_duplicates)
 static struct opt_pass **
 next_pass_1 (struct opt_pass **list, struct opt_pass *pass)
 {
+  /* Every pass should have a name so that plugins can refer to them.  */
+  gcc_assert (pass->name != NULL);
+
   *list = make_pass_instance (pass, false);
   
   return &(*list)->next;
index 6353fb96a56b40251718440c4ee85f2377b1f22f..becff10615b4db8ad05aaf088db95a0dd8a9edfb 100644 (file)
@@ -2246,7 +2246,7 @@ struct gimple_opt_pass pass_strip_predict_hints =
 {
  {
   GIMPLE_PASS,
-  NULL,                                        /* name */
+  "*strip_predict_hints",              /* name */
   NULL,                                        /* gate */
   strip_predict_hints,                 /* execute */
   NULL,                                        /* sub */
index 7e4ba6cad201b803d38e53314f0abdb62fb84c73..f3f71e9c534412e1f6fd9771ce255ec0a703f4ce 100644 (file)
@@ -3275,7 +3275,7 @@ struct rtl_opt_pass pass_stack_regs =
 {
  {
   RTL_PASS,
-  NULL,                                 /* name */
+  "*stack_regs",                        /* name */
   gate_handle_stack_regs,               /* gate */
   NULL,                                        /* execute */
   NULL,                                 /* sub */
index 9800d9966ab7d0c0d84b5767d22a3db67689f4d2..2d9ce82c98ed60c3c410aaed3c5adc4d68a1507c 100644 (file)
@@ -95,7 +95,7 @@ struct rtl_opt_pass pass_stack_ptr_mod =
 {
  {
   RTL_PASS,
-  NULL,                                        /* name */
+  "*stack_ptr_mod",                     /* name */
   NULL,                                 /* gate */
   rest_of_handle_stack_ptr_mod,         /* execute */
   NULL,                                 /* sub */
index 97b08924ff7822725f896925f64983ee65816ab7..4de3dea4ea4b4dc9ba0fea3fd469642f9aad0066 100644 (file)
@@ -7191,7 +7191,7 @@ struct gimple_opt_pass pass_warn_function_return =
 {
  {
   GIMPLE_PASS,
-  NULL,                                        /* name */
+  "*warn_function_return",             /* name */
   NULL,                                        /* gate */
   execute_warn_function_return,                /* execute */
   NULL,                                        /* sub */
@@ -7225,7 +7225,7 @@ struct gimple_opt_pass pass_warn_function_noreturn =
 {
  {
   GIMPLE_PASS,
-  NULL,                                        /* name */
+  "*warn_function_noreturn",           /* name */
   NULL,                                        /* gate */
   execute_warn_function_noreturn,      /* execute */
   NULL,                                        /* sub */
index 847a6818b1baf63c9d924721d5b4bc69540a66ab..d1f84a2ebaafdea7cc060317e6d87d4e7be3c223 100644 (file)
@@ -106,7 +106,7 @@ struct gimple_opt_pass pass_referenced_vars =
 {
  {
   GIMPLE_PASS,
-  NULL,                                        /* name */
+  "*referenced_vars",                  /* name */
   NULL,                                        /* gate */
   find_referenced_vars,                        /* execute */
   NULL,                                        /* sub */
index abd56fcc484c85406100fffc848c0c6af19ba584..7affd1627c590f7be18a7fc5723363379feb301b 100644 (file)
@@ -201,7 +201,7 @@ struct gimple_opt_pass pass_cleanup_cfg_post_optimizing =
 {
  {
   GIMPLE_PASS,
-  "optimized",                 /* name */
+  "optimized",                         /* name */
   NULL,                                        /* gate */
   execute_cleanup_cfg_post_optimizing, /* execute */
   NULL,                                        /* sub */
@@ -287,9 +287,9 @@ struct gimple_opt_pass pass_fixup_cfg =
 {
  {
   GIMPLE_PASS,
-  NULL,                                        /* name */
+  "*free_cfg_annotations",             /* name */
   NULL,                                        /* gate */
-  execute_fixup_cfg,           /* execute */
+  execute_fixup_cfg,                   /* execute */
   NULL,                                        /* sub */
   NULL,                                        /* next */
   0,                                   /* static_pass_number */
@@ -317,7 +317,7 @@ struct gimple_opt_pass pass_init_datastructures =
 {
  {
   GIMPLE_PASS,
-  NULL,                                        /* name */
+  "*init_datastructures",              /* name */
   NULL,                                        /* gate */
   execute_init_datastructures,         /* execute */
   NULL,                                        /* sub */
index 8f7047f83097d385d07d24b9e4a750f0b7d9f5d3..c52b787f4072e82976e667ccd551abcf72e3a868 100644 (file)
@@ -455,7 +455,7 @@ struct gimple_opt_pass pass_record_bounds =
 {
  {
   GIMPLE_PASS,
-  NULL,                                        /* name */
+  "*record_bounds",                    /* name */
   NULL,                                        /* gate */
   tree_ssa_loop_bounds,                        /* execute */
   NULL,                                        /* sub */
index 8e88c2f73b033c35cb3fab05f587b62e19c767a7..e6a9a07a5d85b530822453d65a62fc606f70f216 100644 (file)
@@ -1856,7 +1856,7 @@ struct gimple_opt_pass pass_early_warn_uninitialized =
 {
  {
   GIMPLE_PASS,
-  NULL,                                        /* name */
+  "*early_warn_uninitialized",         /* name */
   gate_warn_uninitialized,             /* gate */
   execute_early_warn_uninitialized,    /* execute */
   NULL,                                        /* sub */
@@ -1875,7 +1875,7 @@ struct gimple_opt_pass pass_late_warn_uninitialized =
 {
  {
   GIMPLE_PASS,
-  NULL,                                        /* name */
+  "*late_warn_uninitialized",          /* name */
   gate_warn_uninitialized,             /* gate */
   execute_late_warn_uninitialized,     /* execute */
   NULL,                                        /* sub */
index b3863340212fe82a716f49be2007e7dd1e899658..3bfb527590e4390f64e7e1b17894f915f0d80b81 100644 (file)
@@ -4988,7 +4988,7 @@ struct simple_ipa_opt_pass pass_ipa_free_lang_data =
 {
  {
   SIMPLE_IPA_PASS,
-  NULL,                                        /* name */
+  "*free_lang_data",                   /* name */
   NULL,                                        /* gate */
   free_lang_data,                      /* execute */
   NULL,                                        /* sub */