X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=djaQjmahFl6AGCI4 iXK1CfNm5CrIIPxE9DrnNhs0zyjUkVqS748fgvfw0EgKezXjMvTKcvUjot+pLZ/e tNlikNTFDv2ZlaXrShMl1LoM2edH4AU+L9qdipqAcs11LYnCMc4+rZtbbeR3XnS1 SQAaqXWVrVRaivt3IbfwHmKyAjQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=Q+VggzSuCE9asWYueuVAeN soGTc=; b=KTiQsLdurm4k7PPsuCVEMLQHWzXtXK8t4OX+GUcHJQF4oJKN1QD7bC t6wV8cnIZilCkP1cPRmsPAzhQDtnmQIFPforKQkB6uu9F5Wp1nl27N6nqU/XboYj 1s6JfLcFucmO3s1I424615KcfQkXFoL42V5mHV/ywQk/wsZztzns0= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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 Subject: Re: Life time of AST elements. To: cygwin AT cygwin DOT com References: <561BA976 DOT 6050405 AT razorcat DOT de> From: Frank Redeker Message-ID: <561BAA3B.2080301@razorcat.de> Date: Mon, 12 Oct 2015 14:40:27 +0200 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 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