[cfe-dev] Speed up debug version of LibTooling AST parsing

Jan Ryšavý via cfe-dev cfe-dev at lists.llvm.org
Fri Feb 21 10:07:57 PST 2020


Thank you, -include-pch file.pch is exactly what I was looking for!

The debug version now takes 10 seconds instead of 20.

Best regards
Jan Rysavy

On 17.02.2020 18:59, Lubos Lunak via cfe-dev wrote:
> On Monday 17 of February 2020, Jan Ryšavý via cfe-dev wrote:
>> We are using Clang LibTooling for source-to-source conversion. Size of
>> converted headers is around 10MB.
>>
>> Release version of our conversion utility works fine, but debug version is
>> spending 20 seconds in clang::ParseAST.
>>
>> Is there any chance how to speed up parsing, for example using precompiled
>> headers (or storing parsed AST)?
>>
>> Could you please point me in the right direction?
> 
>   You can normally add -include-pch file.pch to the args passed to the tooling
> call, we do it in LibreOffice
> (https://cgit.freedesktop.org/libreoffice/core/tree/compilerplugins/clang/sharedvisitor/analyzer.cxx?id=9ab2703d5c212746c961dcb238a4c3025d3a2587#n274).
> 


More information about the cfe-dev mailing list