TYPE_UID (t) = next_type_uid++;
TYPE_ALIGN (t) = 1;
TYPE_MAIN_VARIANT (t) = t;
+ TYPE_OBSTACK (t) = obstack;
break;
case 'c':
if (TREE_CODE_CLASS (code) == 'd')
DECL_UID (t) = next_decl_uid++;
else if (TREE_CODE_CLASS (code) == 't')
- TYPE_UID (t) = next_type_uid++;
+ {
+ TYPE_UID (t) = next_type_uid++;
+ TYPE_OBSTACK (t) = current_obstack;
+ }
TREE_PERMANENT (t) = (current_obstack == &permanent_obstack);
return t;
/* We need a new one. */
- current_obstack
- = TREE_PERMANENT (type) ? &permanent_obstack : saveable_obstack;
+ current_obstack = TYPE_OBSTACK (type);
t = copy_node (type);
+ current_obstack = ambient_obstack;
+
TYPE_READONLY (t) = constp;
TYPE_VOLATILE (t) = volatilep;
TYPE_POINTER_TO (t) = 0;
TYPE_NEXT_VARIANT (t) = TYPE_NEXT_VARIANT (m);
TYPE_NEXT_VARIANT (m) = t;
- current_obstack = ambient_obstack;
return t;
}
register tree t, m = TYPE_MAIN_VARIANT (type);
register struct obstack *ambient_obstack = current_obstack;
- current_obstack
- = TREE_PERMANENT (type) ? &permanent_obstack : saveable_obstack;
-
+ current_obstack = TYPE_OBSTACK (type);
t = copy_node (type);
+ current_obstack = ambient_obstack;
+
TYPE_POINTER_TO (t) = 0;
TYPE_REFERENCE_TO (t) = 0;
TYPE_NEXT_VARIANT (t) = TYPE_NEXT_VARIANT (m);
TYPE_NEXT_VARIANT (m) = t;
- current_obstack = ambient_obstack;
return t;
}
\f
tree to_type;
{
register tree t = TYPE_POINTER_TO (to_type);
- register struct obstack *ambient_obstack = current_obstack;
- register struct obstack *ambient_saveable_obstack = saveable_obstack;
/* First, if we already have a type for pointers to TO_TYPE, use it. */
if (t)
return t;
- /* We need a new one. If TO_TYPE is permanent, make this permanent too. */
- if (TREE_PERMANENT (to_type))
- {
- current_obstack = &permanent_obstack;
- saveable_obstack = &permanent_obstack;
- }
-
+ /* We need a new one. Put this in the same obstack as TO_TYPE. */
+ push_obstacks (TYPE_OBSTACK (to_type), TYPE_OBSTACK (to_type));
t = make_node (POINTER_TYPE);
+ pop_obstacks ();
+
TREE_TYPE (t) = to_type;
/* Record this type as the pointer to TO_TYPE. */
/* Lay out the type. This function has many callers that are concerned
with expression-construction, and this simplifies them all.
- Also, it guarantees the TYPE_SIZE is permanent if the type is. */
+ Also, it guarantees the TYPE_SIZE is in the same obstack as the type. */
layout_type (t);
- current_obstack = ambient_obstack;
- saveable_obstack = ambient_saveable_obstack;
return t;
}