diff gcc/ipa-type-escape.c @ 67:f6334be47118

update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
author nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
date Tue, 22 Mar 2011 17:18:12 +0900
parents b7f97abdc517
children
line wrap: on
line diff
--- a/gcc/ipa-type-escape.c	Tue May 25 18:58:51 2010 +0900
+++ b/gcc/ipa-type-escape.c	Tue Mar 22 17:18:12 2011 +0900
@@ -485,18 +485,13 @@
     }
 
   uid = TYPE_UID (type);
-  if (bitmap_bit_p (map, uid))
+  if (!bitmap_set_bit (map, uid))
     return type;
-  else
-    {
-      bitmap_set_bit (map, uid);
-      if (escape_status == FULL_ESCAPE)
-	{
-	  /* Efficiency hack. When things are bad, do not mess around
-	     with this type anymore.  */
-	  bitmap_set_bit (global_types_exposed_parameter, uid);
-	}
-    }
+  else if (escape_status == FULL_ESCAPE)
+    /* Efficiency hack. When things are bad, do not mess around
+       with this type anymore.  */
+    bitmap_set_bit (global_types_exposed_parameter, uid);
+
   return type;
 }
 
@@ -1030,7 +1025,7 @@
 {
   tree arg;
 
-  if (TYPE_ARG_TYPES (TREE_TYPE (fn)))
+  if (prototype_p (TREE_TYPE (fn)))
     {
       for (arg = TYPE_ARG_TYPES (TREE_TYPE (fn));
 	   arg && TREE_VALUE (arg) != void_type_node;
@@ -1048,7 +1043,7 @@
 	 from the TYPE_ARG_LIST. However, Geoff is wrong, this code
 	 does seem to be live.  */
 
-      for (arg = DECL_ARGUMENTS (fn); arg; arg = TREE_CHAIN (arg))
+      for (arg = DECL_ARGUMENTS (fn); arg; arg = DECL_CHAIN (arg))
 	{
 	  tree type = get_canon_type (TREE_TYPE (arg), false, false);
 	  if (escapes)
@@ -1241,7 +1236,7 @@
 {
   unsigned int cast = 0;
 
-  if (is_gimple_cast (t) || TREE_CODE (t) == VIEW_CONVERT_EXPR)
+  if (CONVERT_EXPR_P (t) || TREE_CODE (t) == VIEW_CONVERT_EXPR)
     {
       tree castfromvar = TREE_OPERAND (t, 0);
       cast = cast | check_cast (TREE_TYPE (t), castfromvar);
@@ -1338,7 +1333,7 @@
 
       /* Check that there are no implicit casts in the passing of
 	 parameters.  */
-      if (TYPE_ARG_TYPES (TREE_TYPE (callee_t)))
+      if (prototype_p (TREE_TYPE (callee_t)))
 	{
 	  for (arg_type = TYPE_ARG_TYPES (TREE_TYPE (callee_t)), i = 0;
 	       arg_type && TREE_VALUE (arg_type) != void_type_node
@@ -1676,12 +1671,11 @@
   /* There may be const decls with interesting right hand sides.  */
   if (DECL_STRUCT_FUNCTION (decl))
     {
-      tree step;
-      for (step = DECL_STRUCT_FUNCTION (decl)->local_decls;
-	   step;
-	   step = TREE_CHAIN (step))
+      tree var;
+      unsigned ix;
+
+      FOR_EACH_LOCAL_DECL (DECL_STRUCT_FUNCTION (decl), ix, var)
 	{
-	  tree var = TREE_VALUE (step);
 	  if (TREE_CODE (var) == VAR_DECL
 	      && DECL_INITIAL (var)
 	      && !TREE_STATIC (var))
@@ -1747,9 +1741,8 @@
 
   uid = TYPE_UID (type);
 
-  if (bitmap_bit_p (been_there_done_that, uid))
+  if (!bitmap_set_bit (been_there_done_that, uid))
     return;
-  bitmap_set_bit (been_there_done_that, uid);
 
   /* If we are doing a language with a type hierarchy, mark all of
      the superclasses.  */
@@ -1768,7 +1761,7 @@
      subfields.  */
   for (field = TYPE_FIELDS (type);
        field;
-       field = TREE_CHAIN (field))
+       field = DECL_CHAIN (field))
     {
       tree field_type;
       if (TREE_CODE (field) != FIELD_DECL)
@@ -1797,9 +1790,8 @@
   uid = TYPE_UID (type);
   gcc_assert (!POINTER_TYPE_P (type));
 
-  if (bitmap_bit_p (been_there_done_that, uid))
+  if (!bitmap_set_bit (been_there_done_that, uid))
     return;
-  bitmap_set_bit (been_there_done_that, uid);
 
   /* If the field is a struct or union type, mark all of the
      subfields.  */
@@ -1852,9 +1844,8 @@
     return;
   uid = TYPE_UID (type);
 
-  if (bitmap_bit_p (been_there_done_that, uid))
+  if (!bitmap_set_bit (been_there_done_that, uid))
     return;
-  bitmap_set_bit (been_there_done_that, uid);
 
   subtype_map = subtype_map_for_uid (uid, false);
 
@@ -1930,9 +1921,8 @@
   else
     return NULL;
 
-  if (bitmap_bit_p (been_there_done_that, uid))
+  if (!bitmap_set_bit (been_there_done_that, uid))
     return map;
-  bitmap_set_bit (been_there_done_that, uid);
 
   /* If the type escapes, get rid of the addressof map, it will not be
      needed.  */