Pass specific annotation data for trees

Daniel Berlin dberlin@dberlin.org
Fri May 21 18:12:00 GMT 2004


Currently, we use the tree annotations for some pass specific data 
(in_ccp_worklist in stmt_ann_t, partition/root_index in var_ann_t, 
etc).
This is going to eventually become a problem in terms of size of 
annotations, and maintenance, and it seems smarter to head it off than 
wait till people start trying to do painful things (like reusing flags 
or something).

There are a variety of solutions, such as union of pass specific 
structures (like so):

struct stmt_ann_d
{
	<common statement stuff>
	union
	{
		struct pass_ccp *ccp_data;
		struct pass_whatever *whatever_data;
	}
}
we also have the ever common "random void pointer in structure" 
approach, and whatever else people like.

My only preference is that we don't do "random void pointer", since 
that is always a Very Bad Idea (TM).

I figured i'd start this discussion now, before people start really 
using annotations.
--Dan




More information about the Gcc mailing list