From 951af26e21ccfb983c70e61f82fd5dd87a757f57 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Sat, 18 Mar 1995 11:43:35 +0000 Subject: [PATCH] Fix -Wreturn-type for inlines. From-SVN: r9201 --- gcc/toplev.c | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/gcc/toplev.c b/gcc/toplev.c index 532ac4ef523..b206128c954 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -2859,24 +2859,30 @@ rest_of_compilation (decl) && ! flag_keep_inline_functions) || DECL_EXTERNAL (decl)))) { -#ifdef DWARF_DEBUGGING_INFO - /* Generate the DWARF info for the "abstract" instance - of a function which we may later generate inlined and/or - out-of-line instances of. */ - if (write_symbols == DWARF_DEBUG) + DECL_DEFER_OUTPUT (decl) = 1; + + /* If -Wreturn-type, we have to do a bit of compilation. */ + if (! warn_return_type) { - set_decl_abstract_flags (decl, 1); - TIMEVAR (symout_time, dwarfout_file_scope_decl (decl, 0)); - set_decl_abstract_flags (decl, 0); - } +#ifdef DWARF_DEBUGGING_INFO + /* Generate the DWARF info for the "abstract" instance + of a function which we may later generate inlined and/or + out-of-line instances of. */ + if (write_symbols == DWARF_DEBUG) + { + set_decl_abstract_flags (decl, 1); + TIMEVAR (symout_time, dwarfout_file_scope_decl (decl, 0)); + set_decl_abstract_flags (decl, 0); + } #endif - TIMEVAR (integration_time, save_for_inline_nocopy (decl)); - goto exit_rest_of_compilation; + TIMEVAR (integration_time, save_for_inline_nocopy (decl)); + goto exit_rest_of_compilation; + } } /* If we have to compile the function now, save its rtl and subdecls so that its compilation will not affect what others get. */ - if (DECL_INLINE (decl)) + if (DECL_INLINE (decl) || DECL_DEFER_OUTPUT (decl)) { #ifdef DWARF_DEBUGGING_INFO /* Generate the DWARF info for the "abstract" instance of @@ -2901,7 +2907,8 @@ rest_of_compilation (decl) goto exit_rest_of_compilation; } - TREE_ASM_WRITTEN (decl) = 1; + if (! DECL_DEFER_OUTPUT (decl)) + TREE_ASM_WRITTEN (decl) = 1; /* Now that integrate will no longer see our rtl, we need not distinguish between the return value of this function and the return value of called @@ -2958,7 +2965,7 @@ rest_of_compilation (decl) } /* Now is when we stop if -fsyntax-only and -Wreturn-type. */ - if (rtl_dump_and_exit || flag_syntax_only) + if (rtl_dump_and_exit || flag_syntax_only || DECL_DEFER_OUTPUT (decl)) goto exit_rest_of_compilation; /* Dump rtl code after jump, if we are doing that. */ -- 2.30.2