rsmith added a comment.

Header modules are part of the C++20 standard (where they are called "header 
units"), and module maps are an intended way for Clang to provide this 
functionality in C++20 mode. I don't think turning this off by default in C++20 
is the right forward-looking plan; rather, I think we should be thinking about 
moving towards header modules simply always being something that Clang can do, 
with no flag to control that.

That said: this new flag is not actually turning off header modules -- we'll 
still treat headers listed in module maps as having modular semantics with this 
flag specified (especially if `-fmodules-local-submodule-visibility` is 
enabled, but some modules semantics such as checking for undeclared 
dependencies are applied regardless). Rather, this flag will cause us to parse 
header modules on the fly, as part of the same parsing action, rather than 
building and importing a separate AST for them. And I think that is a 
reasonable thing to have a flag for. Maybe `-fheader-modules=parse` (to parse 
them on the fly) versus `-fheader-modules=import` (to import them from a `pcm` 
file)? This would also leave the door open for being able to specify whether 
modular semantics are enabled for header modules or not, as a different value 
for the same flag.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125773

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

Reply via email to