[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

Chuanqi Xu via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 6 02:18:37 PDT 2024


================

----------------
ChuanqiXu9 wrote:

> I think that needs to happen eventually as well

Agreed.

> similar to preambles supporting in-memory storage, and it's actually not that hard, GenerateModuleInterfaceAction already has an overrideable CreateOutputFile method.

I am slightly confused. Do you say to move the IO to the memory instead of on-disk files? If true, we're close to that since we can write them to /tmp directories. I thought you're saying we need to get rid of the reading and writing process for module files.

> Also this comment is not solely about virtiualizing CDB, but also about the way we're setting up tests. I don't think we need any of the compile flags you're explicitly setting in the tests. The whole purpose of current implementation is to rely on new module paths we provide into the header-search-options. So there isn't any value in spelling those out explicitly, rendering test setup more complicated. 

Agreed. In the new added test, I meant to use `TestTU` with `AdditionalFiles` to mimic a multiple module units project, but it fails. It looks like it can only accept headers. I feel there are a lot of spaces to improve. But I think it may be fine to leave it as is and improve this later. My plan after this patch is to make the module files reusable. I think the functionality to support modules in clangd is at least usable after that.

https://github.com/llvm/llvm-project/pull/66462


More information about the cfe-commits mailing list