[PATCH] D70527: [clang] Fix the canonicalization of paths in -fdiagnostics-absolute-paths

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 16 14:26:03 PST 2019


rnk added a comment.

In D70527#1785552 <https://reviews.llvm.org/D70527#1785552>, @ikudrin wrote:

> Personally, I would prefer to see the file name and path to be changed as little as possible because that would help to recognize the files better. We cannot use `remove_dots()` on POSIX OSes to simplify paths, because it may return an invalid path; thus we have to use `getRealPath()`. If I understand it right, there is no similar problem with the file name itself.
>
> So, which issues this patch is going to solve?


It seems clear to me, the filename could be an absolute symlink to a real file somewhere far removed from the realpath of the parent directory. It seems reasonable that -fdiagnostics-absolute-paths would look through symlinks in this case.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70527/new/

https://reviews.llvm.org/D70527





More information about the cfe-commits mailing list