]> gcc.gnu.org Git - gcc.git/commitdiff
calls.c (flags_from_decl_or_type): Factor and remove redundant conditional tests.
authorRoger Sayle <roger@eyesopen.com>
Fri, 14 Mar 2003 01:59:16 +0000 (01:59 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Fri, 14 Mar 2003 01:59:16 +0000 (01:59 +0000)
* calls.c (flags_from_decl_or_type): Factor and remove redundant
conditional tests.

From-SVN: r64347

gcc/ChangeLog
gcc/calls.c

index 0b3f89542b25ffa6217224fb6ba76b3fbbf745f2..5e7a19bf44034b3c9151429429de75251dda3276 100644 (file)
@@ -1,3 +1,8 @@
+2002-03-13  Roger Sayle  <roger@eyesopen.com>
+
+       * calls.c (flags_from_decl_or_type): Factor and remove redundant
+       conditional tests.
+
 2003-03-13  Mike Stump  <mrs@apple.com>
 
        * ggc-page.c (struct page_entry): Remove varray.h header.
index cab6571f328b40694467a529f77c1ecda7fbbd28..f23b9397d596b46ad8288ece84331544ba4f8367 100644 (file)
@@ -796,23 +796,26 @@ flags_from_decl_or_type (exp)
 {
   int flags = 0;
   tree type = exp;
-  /* ??? We can't set IS_MALLOC for function types?  */
+
   if (DECL_P (exp))
     {
       struct cgraph_rtl_info *i = cgraph_rtl_info (exp);
       type = TREE_TYPE (exp);
 
-      if (i && i->pure_function)
-       flags |= ECF_PURE | ECF_LIBCALL_BLOCK;
-      if (i && i->const_function)
-       flags |= ECF_CONST | ECF_LIBCALL_BLOCK;
+      if (i)
+       {
+         if (i->pure_function)
+           flags |= ECF_PURE | ECF_LIBCALL_BLOCK;
+         if (i->const_function)
+           flags |= ECF_CONST | ECF_LIBCALL_BLOCK;
+       }
 
       /* The function exp may have the `malloc' attribute.  */
-      if (DECL_P (exp) && DECL_IS_MALLOC (exp))
+      if (DECL_IS_MALLOC (exp))
        flags |= ECF_MALLOC;
 
       /* The function exp may have the `pure' attribute.  */
-      if (DECL_P (exp) && DECL_IS_PURE (exp))
+      if (DECL_IS_PURE (exp))
        flags |= ECF_PURE | ECF_LIBCALL_BLOCK;
 
       if (TREE_NOTHROW (exp))
This page took 0.081212 seconds and 5 git commands to generate.