Re: [PATCH 1/7] Linemap infrastructure for virtual locations

2011-09-08 Thread Jason Merrill
On 09/08/2011 06:32 AM, Dodji Seketeli wrote: Below is the updated patch. OK. Jason

Re: [PATCH 1/7] Linemap infrastructure for virtual locations

2011-09-08 Thread Jason Merrill
On 09/08/2011 06:32 AM, Dodji Seketeli wrote: I have a question about this. It seems to me that adding the whitespace there improves the consistency of the code base, and I thought that it was allowed to make those changes if there are tangent to other meaningful changes done in that area. If e

Re: [PATCH 1/7] Linemap infrastructure for virtual locations

2011-09-07 Thread Jason Merrill
On 09/01/2011 06:36 AM, Dodji Seketeli wrote: +#ifdef ENABLE_CHECKING + +/* Assertion macro to be used in line-map code. */ +#define linemap_assert(EXPR) \ + do { \ +if (! (EXPR)) \ + abort ();

Re: [PATCH 1/7] Linemap infrastructure for virtual locations

2011-08-19 Thread Tom Tromey
> "Jason" == Jason Merrill writes: >> + LC_ENTER_MACRO >> + /* stringize */ >> + /* paste */ Jason> What is the purpose of these comments? That is left over from my initial hack. The new scheme doesn't (yet?) properly handle locations arising from stringizing or token pasting. Tom

Re: [PATCH 1/7] Linemap infrastructure for virtual locations

2011-08-18 Thread Jason Merrill
On 08/09/2011 10:31 AM, Dodji Seketeli wrote: -#define in_system_header (in_system_header_at (input_location)) +#define in_system_header (in_system_header_at (input_location)) Unnecessary whitespace change. struct GTY(()) cpp_macro { + /* Name of this macro. Used only for error reporting.

Re: [PATCH 1/7] Linemap infrastructure for virtual locations

2011-08-05 Thread Jason Merrill
On 08/05/2011 01:04 PM, Dodji Seketeli wrote: Jason Merrill writes: Why not 0x? I'm not sure what the rationale for using that value here: /* If the column number is ridiculous or we've allocated a huge number of source_locations, give up on column numbers.

Re: [PATCH 1/7] Linemap infrastructure for virtual locations

2011-08-04 Thread Jason Merrill
On 08/04/2011 11:27 AM, Dodji Seketeli wrote: Yes, Tom and I thought about that, and decided that, this could be an optimization that could add later when the whole thing is known to work. Makes sense. +/* This is the highest possible source location encoded within an + ordinary or macro ma

Re: [PATCH 1/7] Linemap infrastructure for virtual locations

2011-08-01 Thread Jason Merrill
On 07/16/2011 10:37 AM, Dodji Seketeli wrote: As locations of macro locations decrease monotonically we need LINEMAPS_MACRO_HIGHEST_LOCATION (used in linemap_enter_macro) for reasons that are similar to why we need LINEMAPS_ORDINARY_HIGHEST_LOCATION. Ah, I see, I was missing the use in linemap_

Re: [PATCH 1/7] Linemap infrastructure for virtual locations

2011-08-01 Thread Dodji Seketeli
Jason Merrill writes: > On 07/16/2011 07:37 AM, Dodji Seketeli wrote: >> +/* Returns the highest location [of a token resulting from macro >> + expansion] encoded in this line table. */ >> +#define LINEMAPS_MACRO_HIGHEST_LOCATION(SET) \ >> + LINEMAPS_HIGHEST_LOCATION(SET, true) >> + >> +/* Re

Re: [PATCH 1/7] Linemap infrastructure for virtual locations

2011-07-31 Thread Jason Merrill
On 07/16/2011 07:37 AM, Dodji Seketeli wrote: -extern void linemap_init (struct line_maps *); +void linemap_init (struct line_maps *); -/* Free a line map set. */ -extern void linemap_free (struct line_maps *); +/* Free a line map set. This should be called only if maps have NOT + been alloc

Re: [PATCH 1/7] Linemap infrastructure for virtual locations

2011-07-29 Thread Jason Merrill
On 07/16/2011 07:37 AM, Dodji Seketeli wrote: +/* Returns the highest location [of a token resulting from macro + expansion] encoded in this line table. */ +#define LINEMAPS_MACRO_HIGHEST_LOCATION(SET) \ + LINEMAPS_HIGHEST_LOCATION(SET, true) + +/* Returns the location of the begining of the

Re: [PATCH 1/7] Linemap infrastructure for virtual locations

2011-07-19 Thread Jason Merrill
On 07/16/2011 10:37 AM, Dodji Seketeli wrote: test12.c:9:15: erreur: called object ‘var’ is not a function test12.c:4:16: note: in expansion of macro 'C' test12.c:3:14: note: expanded from here test12.c:3:16: note: in expansion of macro 'B' test12.c:2:14: note: expanded from here test12.c:2:16: n

Re: [PATCH 1/7] Linemap infrastructure for virtual locations

2011-07-19 Thread Dodji Seketeli
Jason Merrill writes: > On 07/19/2011 05:42 AM, Dodji Seketeli wrote: >> If you are talking about the case of a macro A that can have (among the >> tokens of its replacement list) a token B that itself is a macro, then >> this is supported by the current setup. > > I was more thinking of the case

Re: [PATCH 1/7] Linemap infrastructure for virtual locations

2011-07-19 Thread Jason Merrill
On 07/19/2011 05:42 AM, Dodji Seketeli wrote: If you are talking about the case of a macro A that can have (among the tokens of its replacement list) a token B that itself is a macro, then this is supported by the current setup. I was more thinking of the case of a macro A with a parameter X wh

Re: [PATCH 1/7] Linemap infrastructure for virtual locations

2011-07-19 Thread Dodji Seketeli
Jason Merrill writes: > On 07/16/2011 10:37 AM, Dodji Seketeli wrote: >> + /* This array of location is actually an array of pairs of >> + locations. The elements inside it thus look like: >> + >> + x0,y0, x1,y1, x2,y2, , xn,yn. > > Pairs of locations still seems limited, give

Re: [PATCH 1/7] Linemap infrastructure for virtual locations

2011-07-18 Thread Jason Merrill
On 07/16/2011 10:37 AM, Dodji Seketeli wrote: + /* This array of location is actually an array of pairs of + locations. The elements inside it thus look like: + + x0,y0, x1,y1, x2,y2, , xn,yn. Pairs of locations still seems limited, given the flexibility of macro expansion;