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

David Blaikie via cfe-dev cfe-dev at lists.llvm.org
Tue Feb 18 12:06:08 PST 2020


On Mon, Feb 17, 2020 at 7:15 AM Jan Ryšavý via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> 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:
>

Why would you not want to build your utility in Release mode in any case
where performance/runtime speed of the program matters to you? Perhaps some
more context would be helpful to understand the tradeoffs you're trying to
make.


>
> 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
> >
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20200218/6fef80e2/attachment.html>


More information about the cfe-dev mailing list