Re: [C++ PATCH] Improve location info [1/many]

2014-08-12 Thread Jason Merrill
On 08/12/2014 01:10 PM, Manuel López-Ibáñez wrote: Wouldn't the folding that already occurs in the FEs prevent this anyway? Currently, probably. But we're planning to delay that folding for other reasons. In any case, we don't need to fix location info for constants/decls in order to fix l

Re: [C++ PATCH] Improve location info [1/many]

2014-08-12 Thread Manuel López-Ibáñez
> On Tue, 12 Aug 2014, Jason Merrill wrote: > >> On 08/12/2014 11:09 AM, Marek Polacek wrote: >> > One possibility (and I think you mentioned this at Cauldron) would be to >> > create a new tree code, called e.g. LOCATION_EXPR. >> >> I don't think it needs a new code: I think we can use VIEW_CONVER

Re: [C++ PATCH] Improve location info [1/many]

2014-08-12 Thread Jason Merrill
On 08/12/2014 12:22 PM, Paolo Carlini wrote: why wrapping ("somebody" also suggested a NOP_EXPR at some point ;) instead of simply changing integer_cst & co to natively have a location?!? That also seems like a possibility, though I don't know to what extent different parts of the compiler rel

Re: [C++ PATCH] Improve location info [1/many]

2014-08-12 Thread Jason Merrill
On 08/12/2014 12:48 PM, Joseph S. Myers wrote: For C, it is definitely expected within the front end that anything that is an integer constant expression is an INTEGER_CST and that a NOP_EXPR wrapping an INTEGER_CST is something folded to an integer constant that is neither an integer constant ex

Re: [C++ PATCH] Improve location info [1/many]

2014-08-12 Thread Joseph S. Myers
On Tue, 12 Aug 2014, Jason Merrill wrote: > On 08/12/2014 11:09 AM, Marek Polacek wrote: > > One possibility (and I think you mentioned this at Cauldron) would be to > > create a new tree code, called e.g. LOCATION_EXPR. > > I don't think it needs a new code: I think we can use VIEW_CONVERT_EXPR

Re: [C++ PATCH] Improve location info [1/many]

2014-08-12 Thread Paolo Carlini
Hi, On 08/12/2014 05:09 PM, Marek Polacek wrote: Furthermore, the arguments should have their own locations in EXPR_LOCATION; I don't think we need to track them separately. If their locations are wrong that's something to fix directly, rather than adding a special case for function arguments.

Re: [C++ PATCH] Improve location info [1/many]

2014-08-12 Thread Jason Merrill
On 08/12/2014 11:09 AM, Marek Polacek wrote: One possibility (and I think you mentioned this at Cauldron) would be to create a new tree code, called e.g. LOCATION_EXPR. I don't think it needs a new code: I think we can use VIEW_CONVERT_EXPR for decls and NOP_EXPR for constants. There will pro

Re: [C++ PATCH] Improve location info [1/many]

2014-08-12 Thread Marek Polacek
On Mon, Aug 11, 2014 at 01:25:37PM -0400, Jason Merrill wrote: > >+convert_like_real (location_t loc, conversion *convs, tree expr, tree fn, > >+ int argnum, int inner, bool issue_conversion_warnings, > >bool c_cast_p, tsubst_flags_t complain) > > { > >tree totype

Re: [C++ PATCH] Improve location info [1/many]

2014-08-11 Thread Jason Merrill
On 08/01/2014 07:59 AM, Marek Polacek wrote: Thanks for taking this on, sorry it's taken so long to respond. +convert_like_real (location_t loc, conversion *convs, tree expr, tree fn, + int argnum, int inner, bool issue_conversion_warnings, bool c_cast_p, tsu

Re: [C++ PATCH] Improve location info [1/many]

2014-08-09 Thread Marek Polacek
Ping. On Fri, Aug 01, 2014 at 01:59:42PM +0200, Marek Polacek wrote: > This is the first patch in a series that strives to improve C++ location info. > > The following is more like a base for another improvements, thus it contains > only one small test. It adds a location_t parameter and a vecto

[C++ PATCH] Improve location info [1/many]

2014-08-01 Thread Marek Polacek
This is the first patch in a series that strives to improve C++ location info. The following is more like a base for another improvements, thus it contains only one small test. It adds a location_t parameter and a vector of location_t of arguments to finish_call_expr - so functions such as build_