Close https://github.com/llvm/llvm-project/issues/51792
Close https://github.com/llvm/llvm-project/issues/56770
This patch adds ClangScanDeps support for C++20 Named Modules in P1689 format. We can find the P1689 format at: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1689r5.html. As the demo (https://github.com/ChuanqiXu9/llvm-project/tree/MyP1689-ClangScanDeps) shows, with the patch and the one-phase compilation patch (https://reviews.llvm.org/D137059), we're able to compile C++20 Named Modules with CMake! And although P1689 is written by kitware people, other build systems should be able to use the format to compile C++20 Named Modules too.
TODO: Support header units in P1689 Format.
TODO2: Support C++20 Modules in the full dependency format of ClangScanDeps. We also want to support C++20 Modules and clang modules together according to https://discourse.llvm.org/t/how-should-we-support-dependency-scanner-for-c-20-modules/66027. But P1689 format cares about C++20 Modules only for now. So let's focus on C++ Modules and P1689 format. And look at the full dependency format later.
I'll add the ReleaseNotes and Documentations after the patch get landed.
I thought to add the P1689 format here. But many places assume that there're only two DependencyOutputFormat. And the P1689 is different from the Make and NMake since it only cares about the modules. So I decided to add the StdC++ModuleDependencyFormat separate.