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

2022-01-07 Thread Jan Svoboda via Phabricator via cfe-commits
jansvoboda11 updated this revision to Diff 398135. jansvoboda11 added a comment. Use pointers instead of indices to identify `DirectoryLookup` objects. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116750/new/ https://reviews.llvm.org/D116750 File

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

2022-01-07 Thread Jan Svoboda via Phabricator via cfe-commits
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 `DirectoryLook

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

2022-01-07 Thread Alex Hoppen via Phabricator via cfe-commits
ahoppen added a comment. I would prefer to use `std::shared_ptr` instead of `unsigned`. IIUC we already basically have a level of indirection because if we want to get the `DirectoryLookup`, we need to find it by its index in `SearchDirs`. And updating the indices just seems like a hack to me t

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

2022-01-07 Thread Jan Svoboda via Phabricator via cfe-commits
jansvoboda11 added a comment. In 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

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

2022-01-07 Thread Alex Hoppen via Phabricator via cfe-commits
ahoppen added a comment. 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 ? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST A

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

2022-01-06 Thread Jan Svoboda via Phabricator via cfe-commits
jansvoboda11 created this revision. jansvoboda11 added reviewers: Bigcheese, dexonsmith, ahoppen. Herald added a subscriber: mgorny. jansvoboda11 requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. The `HeaderSearch::SearchDirToHSEntry` map ref