I would like to start “touching” a bit the code, trying to create some functionalities, but I have no idea where to start, and I will need many trials/tests…
So, one thing I was expecting is fast times to try (Modify-Compile-Run).
I did:
make clang
and it needed like 3-4 hours. I am ok with that.
Then, I add some “stupid” statement like ‘int a = 3;’ somewhere in llvm/tools/clang/lib/Frontend/Rewrite/FixItRewriter.cpp (FixitRewriter::Diag), and it needed:
6.57s. to compile the target (‘make clangRewriteFrontend’).
4min 36.36s to link and build clang (make clang).
In both cases it spends almost all the time linking (first to a static lib, then to the clang binary itself).
This is really a lot of time to try bit a bit without knowledge of the whole clang, compiling process, etc. Waiting up to is just really time consuming.
What would you do to try the modifications faster?
Any recomendation/blog/guide to follow as a starter trying to modify a bit the codebase of clang?
I personally took most of the advices from the last blog posts:
- Ninja, use Clang to build
- for Debug builds: -DBUILD_SHARED_LIBS=ON -DLLVM_USE_SPLIT_DWARF=ON -DLLVM_OPTIMIZED_TABLEGEN=ON