diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-05-14 14:24:49 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-05-14 14:24:49 +0000 |
commit | 73d5fb10e28767961dded3d66f198afaef5910fc (patch) | |
tree | 525ffde8eec4a141ff785969b9ab2e9d710d86b5 /gcc/tree-cfg.c | |
parent | a7e092b3080c7f1ff9745cfa91bd43b8b8851162 (diff) | |
download | gcc-73d5fb10e28767961dded3d66f198afaef5910fc.tar.gz |
* tree-cfg.c (execute_warn_function_return): Break out noreturn
warning too..
(execute_warn_function_noreturn): ... here.
(pass_warn_function_noreturn): New pass.
* tree-pass.h (pass_warn_function_noreturn): Declare
* tree-optimize.c (init_tree_optimization_passes): Move return
warnings early and add noreturn warnings at place of previous
return warnings.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@99696 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r-- | gcc/tree-cfg.c | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 983530ef361..96377ec821e 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -5630,14 +5630,6 @@ execute_warn_function_return (void) edge e; edge_iterator ei; - if (warn_missing_noreturn - && !TREE_THIS_VOLATILE (cfun->decl) - && EDGE_COUNT (EXIT_BLOCK_PTR->preds) == 0 - && !lang_hooks.function.missing_noreturn_ok_p (cfun->decl)) - warning (0, "%Jfunction might be possible candidate for " - "attribute %<noreturn%>", - cfun->decl); - /* If we have a path to EXIT, then we do return. */ if (TREE_THIS_VOLATILE (cfun->decl) && EDGE_COUNT (EXIT_BLOCK_PTR->preds) > 0) @@ -5741,3 +5733,34 @@ struct tree_opt_pass pass_warn_function_return = 0, /* todo_flags_finish */ 0 /* letter */ }; + +/* Emit noreturn warnings. */ + +static void +execute_warn_function_noreturn (void) +{ + if (warn_missing_noreturn + && !TREE_THIS_VOLATILE (cfun->decl) + && EDGE_COUNT (EXIT_BLOCK_PTR->preds) == 0 + && !lang_hooks.function.missing_noreturn_ok_p (cfun->decl)) + warning (0, "%Jfunction might be possible candidate for " + "attribute %<noreturn%>", + cfun->decl); +} + +struct tree_opt_pass pass_warn_function_noreturn = +{ + NULL, /* name */ + NULL, /* gate */ + execute_warn_function_noreturn, /* execute */ + NULL, /* sub */ + NULL, /* next */ + 0, /* static_pass_number */ + 0, /* tv_id */ + PROP_cfg, /* properties_required */ + 0, /* properties_provided */ + 0, /* properties_destroyed */ + 0, /* todo_flags_start */ + 0, /* todo_flags_finish */ + 0 /* letter */ +}; |