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

Lubos Lunak via cfe-dev cfe-dev at lists.llvm.org
Mon Feb 17 09:59:51 PST 2020


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).

-- 
 Lubos Lunak


More information about the cfe-dev mailing list