Re: [libcpp] maybe canonicalize system paths in line-map

2012-04-30 Thread Jason Merrill
OK. Jason

Re: [libcpp] maybe canonicalize system paths in line-map

2012-04-29 Thread Dodji Seketeli
Manuel López-Ibáñez a écrit: > PR 5297 > * libcpp/files.c (maybe_shorter_path): New. > (find_file_in_dir): Use it. I can't approve or deny this patch, but for what it's worth, I find it fine. Thanks. -- Dodji

Re: [libcpp] maybe canonicalize system paths in line-map

2012-04-29 Thread Manuel López-Ibáñez
New version of the patch. Bootstrapped and regression tested. Is this version OK? 2012-04-29 Manuel López-Ibáñez Dodji Seketeli PR 5297 * libcpp/files.c (maybe_shorter_path): New. (find_file_in_dir): Use it. pr52974.diff Description: Binary data

Re: [libcpp] maybe canonicalize system paths in line-map

2012-04-27 Thread Dodji Seketeli
Manuel López-Ibáñez a écrit: > Another drawback I didn't realize until now is that in this way the > canonicalize every path, instead of only touching those that belong to > system headers. Ah. Good catch. I guess file->dir->sysp should tell us if we are in a system directory, so that we can a

Re: [libcpp] maybe canonicalize system paths in line-map

2012-04-27 Thread Manuel López-Ibáñez
On 26 April 2012 12:12, Dodji Seketeli wrote: > Manuel López-Ibáñez a écrit: > >> On 21 April 2012 14:56, Jason Merrill wrote: >>> It seems like we'll do this for every line in the header, which could lead >>> to a lot of leaked memory.  Instead, we should canonicalize when setting >>> ORDINARY_

Re: [libcpp] maybe canonicalize system paths in line-map

2012-04-26 Thread Manuel López-Ibáñez
On 26 April 2012 20:56, Dodji Seketeli wrote: > Manuel López-Ibáñez a écrit: > >> On 26 April 2012 20:11, Dodji Seketeli wrote: >>> Manuel López-Ibáñez a écrit: >>> Why not remove this comment and free file here with XDELETEVEC (file) ? > +  canonical_path = maybe_shorter_path (pa

Re: [libcpp] maybe canonicalize system paths in line-map

2012-04-26 Thread Dodji Seketeli
Manuel López-Ibáñez a écrit: > On 26 April 2012 20:11, Dodji Seketeli wrote: >> Manuel López-Ibáñez a écrit: >> >>> Why not remove this comment and free file here with XDELETEVEC (file) ? >>> +  canonical_path = maybe_shorter_path (path); +  if (canonical_path != NULL && canonical_pat

Re: [libcpp] maybe canonicalize system paths in line-map

2012-04-26 Thread Manuel López-Ibáñez
On 26 April 2012 20:11, Dodji Seketeli wrote: > Manuel López-Ibáñez a écrit: > >> Why not remove this comment and free file here with XDELETEVEC (file) ? >> >>> +  canonical_path = maybe_shorter_path (path); >>> +  if (canonical_path != NULL && canonical_path != path) >>> +    { >>> +      /* The

Re: [libcpp] maybe canonicalize system paths in line-map

2012-04-26 Thread Dodji Seketeli
Manuel López-Ibáñez a écrit: > Why not remove this comment and free file here with XDELETEVEC (file) ? > >> +  canonical_path = maybe_shorter_path (path); >> +  if (canonical_path != NULL && canonical_path != path) >> +    { >> +      /* The canonical path was newly allocated.  Let's free the >>

Re: [libcpp] maybe canonicalize system paths in line-map

2012-04-26 Thread Dodji Seketeli
Jonathan Wakely a écrit: > On 26 April 2012 11:12, Dodji Seketeli wrote: >> >> So maybe it'd be better to canonicalize the _cpp_file::path when it's >> first build?  One drawback of that approach would be that >> _cpp_file::path will then permanently loose the information about the >> current dir

Re: [libcpp] maybe canonicalize system paths in line-map

2012-04-26 Thread Manuel López-Ibáñez
On 26 April 2012 12:12, Dodji Seketeli wrote: > > So maybe it'd be better to canonicalize the _cpp_file::path when it's > first build?  One drawback of that approach would be that > _cpp_file::path will then permanently loose the information about the > current directory, that is indirectly encode

Re: [libcpp] maybe canonicalize system paths in line-map

2012-04-26 Thread Jonathan Wakely
On 26 April 2012 11:12, Dodji Seketeli wrote: > > So maybe it'd be better to canonicalize the _cpp_file::path when it's > first build?  One drawback of that approach would be that > _cpp_file::path will then permanently loose the information about the > current directory, that is indirectly encoded

Re: [libcpp] maybe canonicalize system paths in line-map

2012-04-26 Thread Dodji Seketeli
Jason Merrill a écrit: > It seems like we'll do this for every line in the header, which could > lead to a lot of leaked memory. Instead, we should canonicalize when > setting ORDINARY_MAP_FILE_NAME. [...] Manuel López-Ibáñez a écrit: > On 21 April 2012 14:56, Jason Merrill wrote: >> It see

Re: [libcpp] maybe canonicalize system paths in line-map

2012-04-21 Thread Manuel López-Ibáñez
On 21 April 2012 14:56, Jason Merrill wrote: > It seems like we'll do this for every line in the header, which could lead > to a lot of leaked memory.  Instead, we should canonicalize when setting > ORDINARY_MAP_FILE_NAME. Hum, my understanding of the code is that this is exactly what I implement

Re: [libcpp] maybe canonicalize system paths in line-map

2012-04-21 Thread Jason Merrill
It seems like we'll do this for every line in the header, which could lead to a lot of leaked memory. Instead, we should canonicalize when setting ORDINARY_MAP_FILE_NAME. Jason

Re: [libcpp] maybe canonicalize system paths in line-map

2012-04-21 Thread Jonathan Wakely
I think this patch is a *huge* improvement for C++ diagnostics that refer to standard library files, I really hope it will be approved in some form. On 21 April 2012 12:58, Manuel López-Ibáñez wrote: > Ping: http://gcc.gnu.org/ml/gcc-patches/2012-04/msg00903.html > > On 15 April 2012 20:44, Manu

Re: [libcpp] maybe canonicalize system paths in line-map

2012-04-21 Thread Manuel López-Ibáñez
Ping: http://gcc.gnu.org/ml/gcc-patches/2012-04/msg00903.html On 15 April 2012 20:44, Manuel López-Ibáñez wrote: > This patch tries to store the shortest form of a path to a system > file, either the original given or the canonical form returned by > realpath. User files are left untouched. This