jansvoboda11 added a comment.

In D116750#3227143 <https://reviews.llvm.org/D116750#3227143>, @ahoppen wrote:

> Adjusting the indices seem pretty fragile to me. Any reason why you wanted to 
> stick with indices as keys instead of switching to something else like I 
> suggested here <https://reviews.llvm.org/D113676#3137288>?

I've implemented your suggestion locally like so:

  llvm::SpecificBumpPtrAllocator<DirectoryLookup> SearchDirsAlloc;
  std::vector<DirectoryLookup *> SearchDirs;
  llvm::DenseMap<const DirectoryLookup *, unsigned> SearchDirToHSEntry;
  ...

In the end, I decided to stick with just updating the indices to avoid creating 
unnecessary indirection (and replacing `.` with `->` everywhere).

I don't have any preference though, so if you feel strongly about the 
fragility, I can use addresses to refer to `DirectoryLookup` objects instead of 
indices.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116750

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to