This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Life time of AST elements.
- From: Frank Redeker <f dot redeker at razorcat dot de>
- To: cygwin at cygwin dot com
- Date: Mon, 12 Oct 2015 14:40:27 +0200
- Subject: Re: Life time of AST elements.
- Authentication-results: sourceware.org; auth=none
- References: <561BA976 dot 6050405 at razorcat dot de>
Am 12.10.2015 um 14:37 schrieb Frank Redeker:
> Hello all,
>
> I'm writing a tool to analyze the call hierarchy of functions (methods)
> using ClangTool.
>
> My idea is to collect the TranslationUnitDecls given to my own
> ASTCosumer's HandleTranslationUnit method and traverse them later when
> ClangTool.run() has finished.
>
> But it seems that the AST nodes are no longer valid after
> ClangTool.run() has returned. (e.g. If I call getQualifiedNameAsString()
> on a FunctionDecl object retrieved from the TranslationUnitDecl, I get
> `Assertion failed: DC && "This decl is not contained in a translation
> unit!"`)
>
> So I wonder if there is any trick to extend the life time for the AST or
> should I use ClangTool.buildAST() rather then ClangTool.run() to get the
> ASTs ?
>
Sorry,
wrong mailing list!
Frank
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple