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

kadir çetinkaya via cfe-commits cfe-commits at lists.llvm.org
Fri May 31 06:42:07 PDT 2024


================
@@ -25,6 +25,8 @@
 namespace clang {
 namespace clangd {
 
+class ProjectModules;
----------------
kadircet wrote:

as others have also pointed out, this forward declaration is working around a cyclic dependency. can we restructure this a little by:
- moving definition of ProjectModules interface into `GlobalCompilationDatabase.h`, it's pretty thin, has only 2 methods.
- replacing `ProjectModules::create`, which is the reason why we have the cyclic dependency, with a new header `ScanningProjectModules.h` and `std::unique_ptr<ProjectModules> scanningProjectModules(std::shared_ptr<const clang::tooling::CompilationDatabase> CDB, const ThreadsafeFS &TFS);`. This way we can also safely postpone the discussion around passing the wrong global-cdb into projectmodules, and can run the extra resource-dir injection on top of the vanilla tooling-cdb. moreover, we avoid making a full copy of the source file names in the project.

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


More information about the cfe-commits mailing list