PR21391: pruning unused debugging types (c++ bits)

Richard Henderson rth@redhat.com
Thu May 4 21:12:00 GMT 2006


On Thu, May 04, 2006 at 03:40:53PM -0400, Aldy Hernandez wrote:
> Perhaps:
> 	if (POINTER_TYPE_P (t))
> 		t = TREE_TYPE (t);
> 	...
> 
> What we want is to put "struct foo" into the used hash table, not
> "struct foo *" in the case where we have a cast to "(struct foo *)".
> 
> Would this be acceptable?

I think you want to unwrap both pointers and arrays.

	while (POINTER_TYPE_P (t) || TREE_TYPE (t) == ARRAY_TYPE)
		t = TREE_TYPE (t);

And you may well want to also do

	t = TYPE_MAIN_VARIANT (t);

so that you don't record "const struct foo".


r~



More information about the Gcc-patches mailing list