jansvoboda11 added a comment.

In D113676#3168219 <https://reviews.llvm.org/D113676#3168219>, @Bigcheese wrote:

> Can we not consider a modulemap used when we load an AST that depends on that 
> modulemap? It's possible this breaks if the module only includes textual 
> headers though.

I don't think that would be 100% correct. I think it's possible for `Module` 
instances (created by parsing a modulemap file) to have semantic meaning even 
without their AST being loaded. One example (that I just made up but sounds 
plausible enough to me) is that we could have a fixit for an `@import` of 
non-existent module that suggests importing another available module 
(discovered through header search) with the most similar name. We don't need 
the AST file for that, but removing search paths could change the diagnostic 
output.

> It really feels like we should have a single place where we actually know if 
> a module is used or not. Long term I would really like to separate modulemap 
> parsing from `Module` creation, which would be a great place to actually do 
> this.

Agreed. But I'm afraid that's a big undertaking. Do you have any other ideas on 
how to detect module usage with the current state of things?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113676

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D113676: WIP: [clang][... Jan Svoboda via Phabricator via cfe-commits

Reply via email to