diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-06-11 12:29:53 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-06-11 12:29:53 +0000 |
commit | 43d60d6437eb2d2213344f35f78994372ca22d00 (patch) | |
tree | b9d5e6003412755a9b91c08dbafc60f251457051 /gcc/tree-cfg.c | |
parent | 80373d81743bf073adc43299fb4679b8f03c8f0f (diff) | |
download | gcc-43d60d6437eb2d2213344f35f78994372ca22d00.tar.gz |
* doc/invoke.texi (Wsuggest-attribute): Document.
(Wmissing-noreturn): Remove.
* ipa-pure-const.c (warn_function_noreturn): New function.
* opts.c (decode_options): Set warn_suggest_attribute_noreturn on
warn_missing_noreturn.
* common.opt (Wsuggest-attribute=noreturn): New.
* tree-flow.h (warn_function_noreturn): Declare.
* tree-cfg.c (execute_warn_function_noreturn): Use
warn_function_noreturn.
(gate_warn_function_noreturn): New.
(pass_warn_function_noreturn): Update.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160606 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r-- | gcc/tree-cfg.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index f46556fe59a..406479416ae 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -7256,22 +7256,24 @@ struct gimple_opt_pass pass_warn_function_return = static unsigned int execute_warn_function_noreturn (void) { - if (warn_missing_noreturn - && !TREE_THIS_VOLATILE (cfun->decl) - && EDGE_COUNT (EXIT_BLOCK_PTR->preds) == 0 - && !lang_hooks.missing_noreturn_ok_p (cfun->decl)) - warning_at (DECL_SOURCE_LOCATION (cfun->decl), OPT_Wmissing_noreturn, - "function might be possible candidate " - "for attribute %<noreturn%>"); + if (!TREE_THIS_VOLATILE (current_function_decl) + && EDGE_COUNT (EXIT_BLOCK_PTR->preds) == 0) + warn_function_noreturn (current_function_decl); return 0; } +static bool +gate_warn_function_noreturn (void) +{ + return warn_suggest_attribute_noreturn; +} + struct gimple_opt_pass pass_warn_function_noreturn = { { GIMPLE_PASS, "*warn_function_noreturn", /* name */ - NULL, /* gate */ + gate_warn_function_noreturn, /* gate */ execute_warn_function_noreturn, /* execute */ NULL, /* sub */ NULL, /* next */ |