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

Jan Ryšavý via cfe-dev cfe-dev at lists.llvm.org
Mon Feb 17 07:15:14 PST 2020


Thank you for this idea. Trouble with LibTooling in Release build is we must use Release build also for our utility (Windows executable), otherwise we are receiving following RTL conflicts:

1>clangAST.lib(DeclarationName.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in CmdLineUtils.obj
1>clangAST.lib(ASTTypeTraits.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in CmdLineUtils.obj
etc.

Of course we can turn off optimizations and debug in Release build...

Best regards
Jan Rysavy

On 17.02.2020 15:13, Whisperity wrote:
> Unless you need the actual Debug build for anything, maybe try sticking to assertions and a release build? (-DLLVM_ENABLE_ASSERTIONS=ON -DCMAKE_BUILD_TYPE=Release) Release build is fast, small, and with enough assertions (and maybe putting "llvm/Support/Debug.h" into the file and calling the frontend with -debug?) you could get most of the stuff you need for debugging.
> 
> Jan Ryšavý via cfe-dev <cfe-dev at lists.llvm.org <mailto:cfe-dev at lists.llvm.org>> ezt írta (időpont: 2020. febr. 17., H, 10:19):
> 
>     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?
> 
>     Best regards
>     Jan Rysavy
>     _______________________________________________
>     cfe-dev mailing list
>     cfe-dev at lists.llvm.org <mailto:cfe-dev at lists.llvm.org>
>     https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
> 


More information about the cfe-dev mailing list