Hi. I opened this pull request. I was informed to first try gather consensus here.
In this pull request, I have added partial support for scanning less support of C++20 modules and header-units in the LLVM repo. The end goal of my effort is much faster compilation of C++ code using my tool and C++20 header-units at low adoption costs. As a first step, I will compile Boost followed by other major projects. In the process, I expect some teams to adopt this model permanently instead of the current compilation model.
The support from the Clang requires Clang supporting this paper. I wrote an accompanying C++ library to facilitate the implementation of this feature. I wanted to compile this library as a 3rd party library with the clang code but I could not find a separate directory to place this. So, I placed it inside the clang/lib directory. This library does not follow LLVM code conventions. However, it is a high quality library with good API and 100% code coverage.
My pull request is quite big but the size is mostly from my library. Other code is adding 3 flags noScanIPC, translateInclude and findIncludes as mentioned in my paper. It is modifying the CMake to add the library and the test. The only prominent source-code change is in function findOrCompileModuleAndReadAST where the library is used.
In my library, I run the CMake target BuildSystemTest to completely test the library. You can review the BuildSystemTest.cpp file to learn about code coverage, qulaity and the desing of the API. This might make the full review of the pull request a bit easier. This file is not included in the LLVM repo. There is setup.py that needs to be run which copies my library files in the LLVM repo and also adjusts the header includes in these files.
This completes the first step of adding the feature. The secode step would be to use sendCTBLastMessage. CTBLastMessage will contain the logical-name of an exported module and header-files discovered the compilation. This will allow me to work on my tool HMake to add modules support.
The third step would be to add receiveBTCNonModule. After which I will add header-units support in HMake and try compile Boost with header-units.
I am 100% confident to be able to add this in HMake. I am as much confident to add 2 phase compilation in a single process using this approach and Hash of Declarations, a paper by
@ChuanqiXu. However, these changes will need to be supported by my library(a small change).
I am not considering other approaches for now like using libClang.so. As I feel I am already quite forward and with my implementation other compiler vendors also get an implementation.
I plan to add this API in my paper besides the message format.