aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-objc-common.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2002-04-03 14:39:51 -0800
committerRichard Henderson <rth@gcc.gnu.org>2002-04-03 14:39:51 -0800
commitef4f94ac977780ceb14adc8dcbcc2eb2c23b5425 (patch)
treefd1d1d700f54be42454fcc88e95011014edff3f4 /gcc/c-objc-common.c
parent599bba86dffe8bd03676f4bf50bca436d3112b90 (diff)
downloadgcc-ef4f94ac977780ceb14adc8dcbcc2eb2c23b5425.zip
gcc-ef4f94ac977780ceb14adc8dcbcc2eb2c23b5425.tar.gz
gcc-ef4f94ac977780ceb14adc8dcbcc2eb2c23b5425.tar.bz2
re PR rtl-optimization/4330 (Optimizer generates illegal assembly code)
PR opt/4330 * langhooks.h (lang_hooks.decls.warn_unused_global): New. * toplev.c (check_global_declarations): Use it. * langhooks-def.h (lhd_warn_unused_global_decl): Declare. (LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL): New. (LANG_HOOKS_DECLS): Add it. * langhooks.c (lhd_warn_unused_global_decl): New. * c-decl.c (LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL): New. * c-objc-common.c (c_warn_unused_global_decl): New. * c-tree.h (c_warn_unused_global_decl): Declare. * objc/objc-lang.c (LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL): New. * cp-lang.c (cxx_warn_unused_global_decl): New. (LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL): New. * g++.dg/warn/Wunused-2.C: New. * gcc.dg/unused-4.c: New. From-SVN: r51818
Diffstat (limited to 'gcc/c-objc-common.c')
-rw-r--r--gcc/c-objc-common.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/c-objc-common.c b/gcc/c-objc-common.c
index 5207abd..36b5db4 100644
--- a/gcc/c-objc-common.c
+++ b/gcc/c-objc-common.c
@@ -209,6 +209,20 @@ c_cannot_inline_tree_fn (fnp)
return 0;
}
+/* Called from check_global_declarations. */
+
+bool
+c_warn_unused_global_decl (decl)
+ tree decl;
+{
+ if (TREE_CODE (decl) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (decl))
+ return false;
+ if (DECL_IN_SYSTEM_HEADER (decl))
+ return false;
+
+ return true;
+}
+
/* Initialization common to C and Objective-C front ends. */
const char *
c_objc_common_init (filename)