[PATCH] D113676: WIP: [clang][lex] Fix search path usage remark with modules

Alex Hoppen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 12 07:57:49 PST 2021


ahoppen added inline comments.


================
Comment at: clang/lib/Lex/HeaderSearch.cpp:94
+      // Module map parsing initiated by header search.
+      if (HS.CurrentSearchPathIdx != ~0U)
+        HS.ModuleToSearchDirIdx[M] = HS.CurrentSearchPathIdx;
----------------
jansvoboda11 wrote:
> ahoppen wrote:
> > When would the `moduleMapModuleCreated` be called while `CurrentSearchPathIdx == ~0U`? Could this be an `assert` instead?
> This happens whenever any of the `ModuleMap` member functions that create new `Module` instances are called outside of `HeaderSearch`.
> 
> The `MMCallback` callback is basically "global" (present for the whole lifetime of `ModuleMap`), so that we don't have to repeatedly register/deregister it in `HeaderSearch::lookupModule`.
Is there any reasonable case where module maps would be created without `HeaderSearch` triggering the creation?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113676



More information about the cfe-commits mailing list