From b9a26d0920dd12f8595a1f193c7db2045f9eb7d0 Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Thu, 25 Apr 2002 18:55:48 +0000 Subject: [PATCH] integrate.c (function_attribute_inlinable_p): Simplify. * integrate.c (function_attribute_inlinable_p): Simplify. Check the table pointer is not NULL. From-SVN: r52763 --- gcc/ChangeLog | 5 +++++ gcc/integrate.c | 28 ++++++++++------------------ 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 47b953c15e9..77741da95b3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2002-04-25 Neil Booth + + * integrate.c (function_attribute_inlinable_p): Simplify. + Check the table pointer is not NULL. + 2002-04-25 Steven Bosscher * doc/c-tree.texi: Fix typo in introduction. diff --git a/gcc/integrate.c b/gcc/integrate.c index db540c9b596..66be25bd683 100644 --- a/gcc/integrate.c +++ b/gcc/integrate.c @@ -132,30 +132,22 @@ bool function_attribute_inlinable_p (fndecl) tree fndecl; { - bool has_machine_attr = false; - tree a; - - for (a = DECL_ATTRIBUTES (fndecl); a; a = TREE_CHAIN (a)) + if (targetm.attribute_table) { - tree name = TREE_PURPOSE (a); - int i; + tree a; - for (i = 0; targetm.attribute_table[i].name != NULL; i++) + for (a = DECL_ATTRIBUTES (fndecl); a; a = TREE_CHAIN (a)) { - if (is_attribute_p (targetm.attribute_table[i].name, name)) - { - has_machine_attr = true; - break; - } + tree name = TREE_PURPOSE (a); + int i; + + for (i = 0; targetm.attribute_table[i].name != NULL; i++) + if (is_attribute_p (targetm.attribute_table[i].name, name)) + return (*targetm.function_attribute_inlinable_p) (fndecl); } - if (has_machine_attr) - break; } - if (has_machine_attr) - return (*targetm.function_attribute_inlinable_p) (fndecl); - else - return true; + return true; } /* Zero if the current function (whose FUNCTION_DECL is FNDECL) -- 2.30.2