This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 2/2] Better system header location detection for built-in macro tokens
- From: Paolo Carlini <pcarlini at gmail dot com>
- To: Dodji Seketeli <dodji at redhat dot com>
- Cc: Jason Merrill <jason at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Tom Tromey <tromey at redhat dot com>, Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>, Greta Yorsh <Greta dot Yorsh at arm dot com>
- Date: Sat, 2 Jun 2012 18:40:04 +0200
- Subject: Re: [PATCH 2/2] Better system header location detection for built-in macro tokens
- References: <m38vglfxko.fsf@redhat.com> <4FBA5A2F.9000206@redhat.com> <m3pq9vb7p7.fsf@redhat.com> <4FBD96EE.4040101@redhat.com> <m38vg54vwg.fsf@redhat.com>
Hi,
> - /* Build the assignment expression. */
> + /* Build the assignment expression. Its default
> + location is the location of the '=' token. */
> + input_location = loc;
> expr = build_x_modify_expr (loc, expr,
> assignment_operator,
> rhs,
Now I have one more reason to be interested in this issue ;)
Background: as you may have noticed, I'm working on replacing the various build_min* functions used by the various build_x_* functions with _loc variants. One of the problems I'm facing with replacing completely one of them has to do exactly with assignment expressions and the location of the error we get for a library testcase not having the location of the left hand side, as it does now, after the patch. Thus, in short, your change here may well help me as-is ;)
That said, the tricks we are playing with the global input_location vs the loc we are passing around still confuse me quite a lot. Actually any *assignment* to input_location makes me a bit more nervous than I was already ;) Do you have any idea whether just passing down to build_x_modify_expr a different value for loc instead of assigning to input_location would also work for you? Maybe together with more throughly forwarding the loc from build_x_modify_expr itself to the build_min* functions (ie the project I mentioned above)??
In any case in a day or two I'll let you know how whether your patch as-is works well for the specific issue I'm facing and anyway I will send over the actual work in progress patch which I can't submit because of the regression it would cause.
Thanks,
Paolo