[PATCH] D142780: [clang] NFCI: Use FileEntryRef in FileManager's UID mapping

Ben Langmuir via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 27 13:39:48 PST 2023


benlangmuir added a comment.

Iterating over `SeenFileEntries` and skipping `VirtualFileEntries` looks good to me.

I'm not sure about changing this to FileEntryRef though. The way this API works you only get one per unique file, which is well suited to `FileEntry *` which has the same uniquing behaviour. In this case you're going to get a `FileEntryRef`, but *which* ref you get is non-deterministic if there were multiple refs for the same file (depends on hash table iteration order).  Also, it will never give you a vfs mapped path since it's skipping those (`V.dyn_cast<FileEntry *>()`).

I think if we want to change this to FileEntryRef it needs to be deterministic which ref you get.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142780



More information about the cfe-commits mailing list