OSDN Git Service

Daily bump.
[pf3gnuchains/gcc-fork.git] / gcc / tree.c
index 95680ba..33ab8b7 100644 (file)
@@ -343,6 +343,8 @@ init_ttree (void)
   tree_contains_struct[CONST_DECL][TS_CONST_DECL] = 1;
   tree_contains_struct[TYPE_DECL][TS_TYPE_DECL] = 1;
   tree_contains_struct[FUNCTION_DECL][TS_FUNCTION_DECL] = 1;
+  tree_contains_struct[IMPORTED_DECL][TS_DECL_MINIMAL] = 1;
+  tree_contains_struct[IMPORTED_DECL][TS_DECL_COMMON] = 1;
 
   lang_hooks.init_ts ();
 }
@@ -2492,6 +2494,11 @@ contains_placeholder_p (const_tree exp)
                  || CONTAINS_PLACEHOLDER_P (TREE_OPERAND (exp, 1))
                  || CONTAINS_PLACEHOLDER_P (TREE_OPERAND (exp, 2)));
 
+       case SAVE_EXPR:
+         /* The save_expr function never wraps anything containing
+            a PLACEHOLDER_EXPR. */
+         return 0;
+
        default:
          break;
        }
@@ -3584,7 +3591,7 @@ set_expr_locus (tree node, source_location *loc)
 
 void protected_set_expr_location (tree t, location_t loc)
 {
-  if (t && t != error_mark_node && CAN_HAVE_LOCATION_P (t))
+  if (t && CAN_HAVE_LOCATION_P (t))
     SET_EXPR_LOCATION (t, loc);
 }
 \f
@@ -5925,7 +5932,12 @@ build_function_type_skip_args (tree orig_type, bitmap args_to_skip)
       TYPE_ARG_TYPES (new_type) = new_reversed;
     }
   else
-    new_type = build_function_type (TREE_TYPE (orig_type), new_reversed);
+    {
+      new_type
+        = build_distinct_type_copy (build_function_type (TREE_TYPE (orig_type),
+                                                        new_reversed));
+      TYPE_CONTEXT (new_type) = TYPE_CONTEXT (orig_type);
+    }
 
   /* This is a new type, not a copy of an old type.  Need to reassociate
      variants.  We can handle everything except the main variant lazily.  */
@@ -5959,7 +5971,12 @@ build_function_decl_skip_args (tree orig_decl, bitmap args_to_skip)
   new_type = TREE_TYPE (orig_decl);
   if (prototype_p (new_type))
     new_type = build_function_type_skip_args (new_type, args_to_skip);
-  TREE_TYPE (orig_decl) = new_type;
+  TREE_TYPE (new_decl) = new_type;
+
+  /* For declarations setting DECL_VINDEX (i.e. methods)
+     we expect first argument to be THIS pointer.   */
+  if (bitmap_bit_p (args_to_skip, 0))
+    DECL_VINDEX (new_decl) = NULL_TREE;
   return new_decl;
 }
 
@@ -6760,9 +6777,8 @@ get_callee_fndecl (const_tree call)
       && TREE_CODE (TREE_OPERAND (addr, 0)) == FUNCTION_DECL)
     return TREE_OPERAND (addr, 0);
 
-  /* We couldn't figure out what was being called.  Maybe the front
-     end has some idea.  */
-  return lang_hooks.lang_get_callee_fndecl (call);
+  /* We couldn't figure out what was being called.  */
+  return NULL_TREE;
 }
 
 /* Print debugging information about tree nodes generated during the compile,