[PATCH] D92160: [clang] Fix wrong FDs are used for files with same name in Tooling

Duncan P. N. Exon Smith via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 9 12:07:59 PST 2020


dexonsmith added a comment.

Thanks for your patience; I missed this when I was on holiday, and I'm just noticing it now.

Can you tell me more about the scenario this happens? Why is the `FileManager` being reused after the working directory change? Do the `FileEntry`s need to remain valid?

I'm also wondering about an alternate solution that optimizes for the common case, such as the following:

- Don't specifically track relative paths / absolute paths.
- Add an API, something like: `dropRelativePaths()`, which drops all `{File,Directory}Entry{,Ref}` that are somehow based on relative paths. This can forward to a similar function the stat cache if necessary.
- Update clients to call that if the working directory changes (you'd want to do it only if it actually changed, not always).

This would keep `FileManager` from having to growing complexity to track working directory changes.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92160



More information about the cfe-commits mailing list