From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24012 invoked by alias); 11 May 2012 14:41:38 -0000 Received: (qmail 24002 invoked by uid 22791); 11 May 2012 14:41:37 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 11 May 2012 14:41:13 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q4BEfDxE023893 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 11 May 2012 10:41:13 -0400 Received: from host2.jankratochvil.net (ovpn-116-17.ams2.redhat.com [10.36.116.17]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q4BEf9As028713 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 11 May 2012 10:41:12 -0400 Date: Fri, 11 May 2012 14:41:00 -0000 From: Jan Kratochvil To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [7/10] keep track of dependencies Message-ID: <20120511144109.GA30659@host2.jankratochvil.net> References: <87zk9zabho.fsf@fleche.redhat.com> <20120426202743.GA23244@host2.jankratochvil.net> <87obpwox1y.fsf@fleche.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87obpwox1y.fsf@fleche.redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-05/txt/msg00409.txt.bz2 On Thu, 10 May 2012 17:50:01 +0200, Tom Tromey wrote: > Jan> Why is RESULT_CHILDREN used here at all? Would not it be > Jan> sufficient to just call htab_traverse for ALL_CHILDREN? > > Maybe it isn't a great reason, but it lets us easily avoid adding CUs > without symbol tables. See recursively_compute_inclusions: > > if (get_symtab (per_cu) != NULL) > VEC_safe_push (dwarf2_per_cu_ptr, *result, per_cu); > > So, RESULT_CHILDREN and ALL_CHILDREN do not have identical contents. The 'get_symtab (per_cu) != NULL' conditional evaluation is "zero-cost", it can be moved to the RESULT_CHILDREN processing (therefore to unify it as ALL_CHILDREN processing), just one has to do one pre-scan instead of just VEC_length. Thanks, Jan