[PATCH] D112915: WIP: [clang][modules] Granular tracking of includes

Jan Svoboda via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 1 02:37:59 PDT 2021


jansvoboda11 added a comment.

I'm interested in hearing some feedback whether the direction I'm taking here makes sense.

There are a couple of TODOs (mostly on optimizing away unnecessary maps) and a few modules-ts tests are failing.

@rsmith left a suggestion on D104344 <https://reviews.llvm.org/D104344> to track this information in `Preprocessor::SubmoduleState`, which has similar semantics to what I'm doing with `Preprocessor::IncludeMap` (dividing the state during submodule compilation). The issue is that it (`Preprocessor::Submodules`) is really only enabled when Clang gets invoked with `-fmodules-local-submodule-visibility`. To keep its current semantics and make it usable for our use-case (which needs to work even without the flag), I think we'd need to **always** track the submodule state and conditionally **merge** the outer and local macro states as we now do for `IncludeMap` in `PPLexerChange.cpp`. I'm not really sure this is correct/feasible.

Any opinions on this?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112915



More information about the cfe-commits mailing list