[cfe-dev] extending ClangTool libASTUnit saving and loading

mobi phil mobi at mobiphil.com
Tue Dec 9 17:05:44 PST 2014


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




rgrds,
mobi phil

being mobile, but including technology
http://mobiphil.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20141210/18fa843b/attachment.html>


More information about the cfe-dev mailing list