Open
Description
Compiling SourceCodeTest.cpp currently takes >50s (with clang 18 as host compiler). The reason is that it has 12 different subclasses of RecursiveASTVisitor. I believe this is also the root cause for a few other clang files with long compile times.
The basic problem is that RecursiveASTVisitor
is a CRTP construction, which means that every subclass requires a completely separate instantiation of the visitor implementation -- which is huge. LLVM takes a long time to chew through that.
I'm not entirely sure how this can be fixed -- I'd expect that using virtual methods would make it too slow. Maybe there is some kind of middle ground.