This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Pass specific annotation data for trees


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]