[PATCH] D137304: [clang] Store filename per include instead of mutating filename

Duncan P. N. Exon Smith via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 2 17:15:00 PDT 2022


dexonsmith added a comment.

> Consider making the FileEntryRef changes here the default -- it doesn't make sense to me that FileEntryRef == or DenseMap would match FileEntry pointer semantics instead of filename semantics.

Yeah, that was something I added, and I agree it's unfortunate / hard to reason about. It was a concession to make it easier to replace `FileEntry*` with `FileEntryRef` seamlessly in lots of places with NFC; the logic is "we want only one entry FileEntry in this map; let the first one win". Maybe most places would prefer a functionality change though, and, either way, the DenseMaps that need this unique-by-`FileEntry*` behaviour should probably be the ones using a custom DenseMapInfo.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137304



More information about the cfe-commits mailing list