3 ms·
Build times of the Linux kernel with clang are dominated by the front end. 30 years of crufty headers is a lot to parse. What we actually need is tooling to he
by ndesaulniers 3y ago
Build times of the Linux kernel with clang are dominated by the front end. 30 years of crufty headers is a lot to parse.
What we actually need is tooling to help recommend how to refactor or split headers in a way to reduce having to parse a ton of dead code.
Or even better, tooling that would generate one off headers per TU. I think it could be done.
- nine_k 3y agoClang supports precompiled headers (pch). Does this not help?
- ndesaulniers 3y agoI'll have to figure out how best to wire it up into the kernel's build system, kbuild. I haven't tried yet. Anyone have experience with PCHs? Good or bad?
- ra1231963 3y agoHe mentions some tools at the bottom (ClangBuildAnalyzer, Build Insights in Visual Studio, include-what-you-use). Looks like https://include-what-you-use.org/ https://include-what-you-use.org/ might do that.
- ndesaulniers 3y agoI'm having an intern start in the fall to work on integrating IWYU into the kernel's build system, kbuild. One major deficiency in IWYU that we will have to solve is that IWYU only understands post-preprocessed sources. If you have preprocessor guards for some code (as is done extensively in the Linux kernel) IWYU can recommend changes that break the build for other configurations than the one used when running IWYU.