Re: [C++ PATCH] __builtin_source_location ()

2019-12-03 Thread Jakub Jelinek
On Tue, Dec 03, 2019 at 03:37:41PM -0500, Jason Merrill wrote: > On 11/15/19 7:28 AM, Jakub Jelinek wrote: > > + loc = LOCATION_LOCUS (loc); > ... > > + entry.loc > > += linemap_resolve_location (line_table, loc, LRK_MACRO_EXPANSION_POINT, > > + &map); > > You don't

Re: [C++ PATCH] __builtin_source_location ()

2019-12-03 Thread Jason Merrill
On 11/15/19 7:28 AM, Jakub Jelinek wrote: + loc = LOCATION_LOCUS (loc); ... + entry.loc += linemap_resolve_location (line_table, loc, LRK_MACRO_EXPANSION_POINT, + &map); You don't need LOCATION_LOCUS if you're calling linemap_resolve_location. LGTM with t

Patch ping (was Re: [C++ PATCH] __builtin_source_location ())

2019-12-03 Thread Jakub Jelinek
Hi! On Fri, Nov 15, 2019 at 01:28:17PM +0100, Jakub Jelinek wrote: > On Thu, Nov 14, 2019 at 08:34:26PM +0100, Jakub Jelinek wrote: > > The following WIP patch implements __builtin_source_location (), > > which returns const void pointer to a std::source_location::__impl > > struct that is require

Re: [C++ PATCH] __builtin_source_location ()

2019-11-15 Thread Jakub Jelinek
On Fri, Nov 15, 2019 at 09:04:17AM -0500, David Malcolm wrote: > > +/* Helper of fold_builtin_source_location, return the > > + std::source_location::__impl type after performing verification > > + on it. */ > > + > > +static tree > > +get_source_location_impl (location_t loc) > > +{ > > FWIW

Re: [C++ PATCH] __builtin_source_location ()

2019-11-15 Thread Jonathan Wakely
On 15/11/19 13:49 +0100, Jakub Jelinek wrote: On Fri, Nov 15, 2019 at 12:35:22PM +, Jonathan Wakely wrote: On 15/11/19 13:28 +0100, Jakub Jelinek wrote: > On Thu, Nov 14, 2019 at 08:34:26PM +0100, Jakub Jelinek wrote: > > The following WIP patch implements __builtin_source_location (), > > w

Re: [C++ PATCH] __builtin_source_location ()

2019-11-15 Thread David Malcolm
On Fri, 2019-11-15 at 13:28 +0100, Jakub Jelinek wrote: > On Thu, Nov 14, 2019 at 08:34:26PM +0100, Jakub Jelinek wrote: > > The following WIP patch implements __builtin_source_location (), > > which returns const void pointer to a std::source_location::__impl > > struct that is required to contain

Re: [C++ PATCH] __builtin_source_location ()

2019-11-15 Thread Jakub Jelinek
On Fri, Nov 15, 2019 at 12:35:22PM +, Jonathan Wakely wrote: > On 15/11/19 13:28 +0100, Jakub Jelinek wrote: > > On Thu, Nov 14, 2019 at 08:34:26PM +0100, Jakub Jelinek wrote: > > > The following WIP patch implements __builtin_source_location (), > > > which returns const void pointer to a std:

Re: [C++ PATCH] __builtin_source_location ()

2019-11-15 Thread Jonathan Wakely
On 15/11/19 13:28 +0100, Jakub Jelinek wrote: On Thu, Nov 14, 2019 at 08:34:26PM +0100, Jakub Jelinek wrote: The following WIP patch implements __builtin_source_location (), which returns const void pointer to a std::source_location::__impl struct that is required to contain __file, __function,

Re: [RFC C++ PATCH] __builtin_source_location ()

2019-11-15 Thread Jonathan Wakely
On 14/11/19 23:39 +0100, Jakub Jelinek wrote: On Thu, Nov 14, 2019 at 10:15:21PM +, Jonathan Wakely wrote: > namespace std { > struct source_location { >struct __impl { Will this work if the library type is actually in an inline namespace, such as std::__8::source_location::__impl (as

[C++ PATCH] __builtin_source_location ()

2019-11-15 Thread Jakub Jelinek
On Thu, Nov 14, 2019 at 08:34:26PM +0100, Jakub Jelinek wrote: > The following WIP patch implements __builtin_source_location (), > which returns const void pointer to a std::source_location::__impl > struct that is required to contain __file, __function, __line and __column > fields, the first two

Re: [RFC C++ PATCH] __builtin_source_location ()

2019-11-14 Thread Jakub Jelinek
On Thu, Nov 14, 2019 at 10:15:21PM +, Jonathan Wakely wrote: > > namespace std { > > struct source_location { > >struct __impl { > > Will this work if the library type is actually in an inline namespace, > such as std::__8::source_location::__impl (as for > --enable-symvers=gnu-versioned-

Re: [RFC C++ PATCH] __builtin_source_location ()

2019-11-14 Thread Jonathan Wakely
On 14/11/19 20:34 +0100, Jakub Jelinek wrote: Hi! The following WIP patch implements __builtin_source_location (), which returns const void pointer to a std::source_location::__impl struct that is required to contain __file, __function, __line and __column fields, the first two with const char *

[RFC C++ PATCH] __builtin_source_location ()

2019-11-14 Thread Jakub Jelinek
Hi! The following WIP patch implements __builtin_source_location (), which returns const void pointer to a std::source_location::__impl struct that is required to contain __file, __function, __line and __column fields, the first two with const char * type, the latter some integral type. I don't h