This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Pass specific annotation data for trees
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: gcc at gcc dot gnu dot org list <gcc at gcc dot gnu dot org>
- Date: Fri, 21 May 2004 14:12:24 -0400
- Subject: 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