integrate.c (function_attribute_inlinable_p): Simplify.
authorNeil Booth <neil@daikokuya.demon.co.uk>
Thu, 25 Apr 2002 18:55:48 +0000 (18:55 +0000)
committerNeil Booth <neil@gcc.gnu.org>
Thu, 25 Apr 2002 18:55:48 +0000 (18:55 +0000)
* integrate.c (function_attribute_inlinable_p): Simplify.
Check the table pointer is not NULL.

From-SVN: r52763

gcc/ChangeLog
gcc/integrate.c

index 47b953c15e91730ce969d571c991977188986581..77741da95b330915d3c47a21ed7b7c890c751987 100644 (file)
@@ -1,3 +1,8 @@
+2002-04-25  Neil Booth  <neil@daikokuya.demon.co.uk>
+
+       * integrate.c (function_attribute_inlinable_p): Simplify.
+       Check the table pointer is not NULL.
+
 2002-04-25  Steven Bosscher  <S.Bosscher@student.tudelft.nl>
 
        * doc/c-tree.texi: Fix typo in introduction.
index db540c9b596e50adfe020f5239e9419ac15436bb..66be25bd6836625236f00d72fe4649ddd447f6b5 100644 (file)
@@ -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)