This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, TREE_LIST removal] remove calls to build_constructor_from_list from coverage.c
On Thu, May 13, 2010 at 09:13:29AM -0600, Tom Tromey wrote:
> >>>>> "Nathan" == Nathan Froyd <froydnj@codesourcery.com> writes:
> Nathan> There are two ways to fix this:
>
> Nathan> - Modify java-tree.h:START_RECORD_CONSTRUCTOR to set
> Nathan> TREE_CONSTANT to 0on the new constructor; or
>
> Nathan> - Make build_constructor set TREE_CONSTANT to 0 when handed a 0-length
> Nathan> vector.
>
> These macros in gcj are just a convenience wrapper to make it simpler to
> build constructors. AFAICT all the uses of these macros are of the form
> START_RECORD_CONSTRUCTOR, followed by PUSH_* calls, followed by
> FINISH_RECORD_CONSTRUCTOR.
>
> So I think another approach would be to change START_RECORD_CONSTRUCTOR
> to simply initialize the VEC, then modify PUSH_FIELD_VALUE, PUSH_SUPER_VALUE,
> and FINISH_RECORD_CONSTRUCTOR to do the right thing -- in particular,
> delaying the build_constructor call to FINISH_RECORD_CONSTRUCTOR.
Indeed. I took the quick-hack approach to fix this (set TREE_CONSTANT
in the gcj macros); I'm happy to implement Tom's suggestion if that's
deemed "better" by the reviewers.
-Nathan