From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18111 invoked by alias); 12 Oct 2015 12:36:17 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 18095 invoked by uid 89); 12 Oct 2015 12:36:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.1 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: proxy.razorcat.com Received: from proxy.razorcat.de (HELO proxy.razorcat.com) (213.23.173.139) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 12 Oct 2015 12:36:16 +0000 Received: from [192.168.0.232] (Mimir.ats-berlin.de [192.168.0.232]) by proxy.razorcat.com (8.13.8+Sun/8.13.7) with ESMTP id t9CCaCB6028481 for ; Mon, 12 Oct 2015 14:36:12 +0200 (CEST) Subject: Re: Life time of AST elements. To: cygwin@cygwin.com References: <561BA976.6050405@razorcat.de> From: Frank Redeker Message-ID: <561BAA3B.2080301@razorcat.de> Date: Mon, 12 Oct 2015 12:36:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <561BA976.6050405@razorcat.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-10/txt/msg00135.txt.bz2 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