[PATCH] D103797: [clang] Use resolved path for headers in decluse diagnostics

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 30 00:22:25 PDT 2021


sammccall added a comment.

We discussed this a bit offline, and IIUC the plan is not to push this through at least for now. Notes:

- path to a file is more accurate/informative than spelling, since it really is the file rather than the name that is restricted
- however in practice the spelling probably isn't ambiguous and is more readable, so this is probably a regression overall for display
- our motivation here is to be able to unambiguously extract the path programmatically.
  - Adding a `struct { string; FileEntry*; }` as a diagnostic argument kind is another (somewhat intrusive) way out.
  - The (private) codebase we're experimenting on expresses most `#include`s relative to a single root, so we can probably just live without this at least for a while
- If we do this getName() is probably indeed better than tryGetRealPathName, resolving symlinks may have some bad effects


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103797



More information about the cfe-commits mailing list