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

via cfe-commits cfe-commits at lists.llvm.org
Sat Jul 13 03:13:29 PDT 2024


guijiyang wrote:

> > > @sam-mccall gentle ping~
> > 
> > 
> > @ChuanqiXu9 hi, can your patch add support msvc module with *.ixx suffix source? I use xmake to generate compile database, clangd cant work properly.
> 
> hi, did you meet problems when testing this? I took a quick look and I don't see I treated suffix specially. This patch find module interface unit by scanning instead of by suffixes.

hi, clangd got error 
`
I[17:59:54.146] Scanning modules dependencies for C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.39.33519\modules\std.ixx failed: error: no such file or directory: '/ifcOutput'
error: no such file or directory: '/interface'
error: cannot specify '/Fobuild\.objs\test\windows\x64\debug\0aee06d009cc4e4b8a8427a06257c7f1\std.ixx.obj' when compiling multiple source files
`
'/ifcOutput' and  '/interface' are flags to msvc cl,why clangd ocurr this error,
and compile_commands.json like this:
`
{
  "directory": "d:\\Code\\MyProject\\guis",
  "arguments": ["C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\VC\\Tools\\MSVC\\14.39.33519\\bin\\HostX64\\x64\\cl.exe", "/c", "/nologo", "/Zi", "/FS", "/Fdbuild\\windows\\x64\\debug\\compile.test.pdb", "/W3", "/WX", "/Od", "/std:c++latest", "/MDd", "/EHsc", "/TP", "/ifcOutput", "build\\.gens\\test\\windows\\x64\\debug\\rules\\bmi\\cache\\modules\\1382cb37\\std.ifc", "/interface", "/Fobuild\\.objs\\test\\windows\\x64\\debug\\0aee06d009cc4e4b8a8427a06257c7f1\\std.ixx.obj", "C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\VC\\Tools\\MSVC\\14.39.33519\\modules\\std.ixx", "-imsvc", "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\cppwinrt", "-imsvc", "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\shared", "-imsvc", "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\ucrt", "-imsvc", "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\um", "-imsvc", "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\winrt", "-imsvc", "C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\VC\\Tools\\MSVC\\14.39.33519\\include"],
  "file": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\VC\\Tools\\MSVC\\14.39.33519\\modules\\std.ixx"
}
`

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


More information about the cfe-commits mailing list