From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Torvalds Subject: Re: sparse-llvm array size computation issue Date: Wed, 29 Mar 2017 09:41:06 -0700 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-it0-f52.google.com ([209.85.214.52]:38260 "EHLO mail-it0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752264AbdC2QlI (ORCPT ); Wed, 29 Mar 2017 12:41:08 -0400 Received: by mail-it0-f52.google.com with SMTP id y18so61754147itc.1 for ; Wed, 29 Mar 2017 09:41:07 -0700 (PDT) In-Reply-To: Sender: linux-sparse-owner@vger.kernel.org List-Id: linux-sparse@vger.kernel.org To: Dibyendu Majumdar Cc: Luc Van Oostenryck , Linux-Sparse 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. But maybe I forget some special case. Things like 'typeof() can be complicated, but we should be peeling things off so that we only ever have one level of SYM_NODE. Linus