[PATCH] D116750: [clang][lex] Keep search directory indices up-to-date

Jan Svoboda via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 7 05:48:29 PST 2022


jansvoboda11 added a comment.

Yeah, in some cases, we'd be just replacing the index-based indirection with address-based indirection (e.g. when working with `SearchDirToHSEntry`).

However, most existing `HeaderSearch` algorithms already work with the index and use that to get the `DirectoryLookup` from `SearchDirs`. We'd be adding another level of indirection for them: first they'd need to get `DirectoryLookup *` from `SearchDirs` with the index and then dereference the pointer. Maybe that's not very important from performance perspective (especially if we bump-ptr-allocate them), but something to be aware of IMO.

The `SearchDirsUsage` member is a bit-vector that's being inserted into the same way `SearchDirs` is, so no need to fiddle with indices there. As for `ModuleToSearchDirIdx`: yes, we'd need to update indices the same way we do here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116750



More information about the cfe-commits mailing list