[cfe-dev] extending ClangTool libASTUnit saving and loading

mobi phil mobi at mobiphil.com
Tue Dec 16 10:20:41 PST 2014


> So, why do you want to do that? What's your use case? :)
>

does your answer mean that it is impossible to tell clang to load the ast
instead of re-parsing re-syntactic-analyzing the source?
Well, could throw back the ball and ask, why being able to save ast at all?


I use at this moment clang infra mainly to understand clang itself. I gave
the Sema.cpp as example as it is probably the hugest file (absolute size
not counting included headers). Probably with headers included lot of
compilation unit would be almost equally large. Anyway the point is that
compilation takes lot of time. Trying to understand how much potential is
in a workflow where one would generate only once the ast, and subsequent
processes would reuse the AST as mentioned earlier (code generation, static
analysis etc, refactoring experiments). Well, for applying different
optmisation strategies, the LLVM intermediate could play similar role.

As you can see, do not pretend to have a specific use case, but I also have
the opinion that even simple features would never be asked explicitly as
the threshold is a bit high, but these features would be probably used once
present.

can you also eventually confirm that simple command line
clang Sema.ast
treats Sema.ast as pch and not as ast?


thanks and best regards
mobi phil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20141216/040587cd/attachment.html>


More information about the cfe-dev mailing list