This is the mail archive of the 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]

Re: [C++ Patch] PR 44516


On 05/16/2012 06:02 AM, Jason Merrill wrote:
On 05/15/2012 07:56 PM, Paolo Carlini wrote:
But, speaking of incremental work: what if, post the build_min_nt_loc
chunk, we handle build_min_non_dep and build_min in a case by case way?
Thus we keep around the non-_loc variant and gradually replace each
call? With testcases (small!) checking columns too.
That sounds fine.
For sure *many* build_min_non_dep_loc and build_min_loc can be introduced without negative and with many positive effects on the testsuite.
Finally, I'm attaching my latest build_min_nt_loc patch. Turns out, in
the light of the better understanding I now have, I can't justify most
of the EXPR_LOC_OR_HERE, outside those for build_x_modify_expr which you
explicitly indicated.
I think I was wrong when I indicated that, and that EXPR_LOCATION is better there, too. EXPR_LOC_OR_HERE is good for error messages, but not for setting the location of a tree. Though it occurs to me that we're likely to use the passed in location for errors as well, so we had better make sure we're passing in a useful location.
Ok. Let's see if now I understand. This is what I did:

1- All the build_x_* callers pass EXPR_LOCATIONs (which can be UNKNOWN_LOCATION)
2- Inside the build_x_*, the passed in location is used as-is in template context to call build_min_nt_loc, and through a new LOC_OR_HERE to call build_new_op and the like (which need something meaningful for the error messages). Oh my.. at the risk of having to send another iteration, which would be identical to this one but without the LOC_OR_HERE thingy, isn't the diagnostic machinery able to cope with UNKNOWN_LOCATION? By default should be interpreted as input_location, no?

Tested x86_64-linux (I added column info to an existing testcase)



Attachment: CL_44516_19
Description: Text document

Attachment: patch_44516_19
Description: Text document

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