This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Extending gcjx visitor pattern
- From: Tom Tromey <tromey at redhat dot com>
- To: Mike Emmel <mike dot emmel at gmail dot com>
- Cc: java at gcc dot gnu dot org
- Date: 06 Dec 2005 13:41:36 -0700
- Subject: Re: Extending gcjx visitor pattern
- References: <3e9035250512040558t44c30074x4f6122b5c06b1e89@mail.gmail.com> <3e9035250512040609n12cb76f1kb7b77ed64be21bf7@mail.gmail.com>
- Reply-to: tromey at redhat dot com
>>>>> "Mike" == Mike Emmel <mike.emmel@gmail.com> writes:
Mike> I was wondering what people would think about extending the gcjx
Mike> visitor to also forward user data.
Mike> visit_method (model_method * method,
Mike> const list<ref_variable_decl> & params,
Mike> const ref_block &block, void * visitorData );
The reason I didn't do this is type safety. I didn't want to add
casts all over to handle the user data.
Mike> On a similar note it would also be nice to annotate the gcjx tree with
Mike> some of my data. There is the aot class but it so far does not seem to
Mike> be the right answer.
I just use a std::map or the like for this kind of thing. It is less
handy in some ways but has other advantages -- it is type safe and it
lets each back end maintain its own state.
Tom