From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dibyendu Majumdar Subject: Re: sparse-llvm array size computation issue Date: Wed, 29 Mar 2017 19:12:16 +0100 Message-ID: References: <20170328213300.zfa7yecafqvalt5u@macpro.local> <20170328222124.kjtgzrhzsnsxdtq2@macpro.local> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from mail-io0-f175.google.com ([209.85.223.175]:33762 "EHLO mail-io0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752316AbdC2SMS (ORCPT ); Wed, 29 Mar 2017 14:12:18 -0400 Received: by mail-io0-f175.google.com with SMTP id f84so4232384ioj.0 for ; Wed, 29 Mar 2017 11:12:17 -0700 (PDT) In-Reply-To: Sender: linux-sparse-owner@vger.kernel.org List-Id: linux-sparse@vger.kernel.org To: Linus Torvalds Cc: Luc Van Oostenryck , Linux-Sparse Hi Linus, On 29 March 2017 at 17:41, Linus Torvalds wrote: > On Wed, Mar 29, 2017 at 9:21 AM, Dibyendu Majumdar > wrote: >> >> I am trying out an approach. If a SYM_NODE has a base type of SYM_NODE >> then which of the nodes should be used as the source for information >> you mention? > > Does that actually happen? It shouldn't. A symbol node contains the C > name of the symbol, but you should never have a SYM_NODE that points > to another SYM_NODE, it always points to some actual type (ie ptr, > whatever). > > So the rule should be that the node can have specific information > about that particular named symbol (so: name, array size, modifiers, > address space, initializer etc), and then the node->ctype.base_type > should point to a non-NODE symbol describing the base type. > Okay thank you - that's good to know. It wasn't obvious to me looking at the code, and I thought I had seen an example where a node contained another node ... but I cannot find this now, so I may have been mistaken. I will add an assertion in sparse-llvm to check this - hopefully that way if any instance occurs I will see it. Thanks and Regards Dibyendu