[cfe-dev] extending ClangTool libASTUnit saving and loading

Manuel Klimek klimek at google.com
Mon Dec 15 04:58:20 PST 2014


On Wed Dec 10 2014 at 3:25:00 AM mobi phil <mobi at mobiphil.com> wrote:

> Hi,
>
> wonder if it makes sense to extend ClangTool to facilitate saving, loading
> of ASTUnit for refactoring class of applications.
>
> ASTUnit::save seems to be straightforward with one string (filename),
> however the LoadFromASTFile seems to be rather complex
>
>
> std::unique_ptr<ASTUnit> ASTUnit::LoadFromASTFile(
>     const std::string &Filename, IntrusiveRefCntPtr<DiagnosticsEngine>
> Diags,
>     const FileSystemOptions &FileSystemOpts, bool OnlyLocalDecls,
>     ArrayRef<RemappedFile> RemappedFiles, bool CaptureDiagnostics,
>     bool AllowPCHWithCompilerErrors, bool UserFilesAreVolatile)
>
> for most of AST manipulation, all those details are probably not important
> and should be deduced or defaults should be used, or?
>
> In all this reasoning I assumed that once AST created it can be saved to
> file and re-loaded in another execution of the tool to further process the
> AST. Hopefully I am not wrong
>

Multiple questions:
1. You should already be able to use ASTUnit to save and load ASTs - why do
you need integration with ClangTool?
2. What are you trying to do? Why do you want to store the AST?


>
>
>
>
> rgrds,
> mobi phil
>
> being mobile, but including technology
> http://mobiphil.com
>  _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20141215/6bb94b25/attachment.html>


More information about the cfe-dev mailing list