From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9708 invoked by alias); 14 Feb 2014 13:40:49 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 9695 invoked by uid 89); 14 Feb 2014 13:40:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wi0-f175.google.com Received: from mail-wi0-f175.google.com (HELO mail-wi0-f175.google.com) (209.85.212.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 14 Feb 2014 13:40:47 +0000 Received: by mail-wi0-f175.google.com with SMTP id hm4so476561wib.2 for ; Fri, 14 Feb 2014 05:40:44 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.180.109.77 with SMTP id hq13mr2408148wib.0.1392385244360; Fri, 14 Feb 2014 05:40:44 -0800 (PST) Received: by 10.194.62.111 with HTTP; Fri, 14 Feb 2014 05:40:44 -0800 (PST) In-Reply-To: <20140214085908.GA5228@linux.vnet.ibm.com> References: <20140214085908.GA5228@linux.vnet.ibm.com> Date: Fri, 14 Feb 2014 13:40:00 -0000 Message-ID: Subject: Re: Need help: Is a VAR_DECL type builtin or not? From: Richard Biener To: vogt@linux.vnet.ibm.com Cc: GCC Development Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2014-02/txt/msg00203.txt.bz2 On Fri, Feb 14, 2014 at 9:59 AM, Dominik Vogt wrote: > Given a specific VAR_DECL tree node, I need to find out whether > its type is built in or not. Up to now I have > > tree tn = TYPE_NAME (TREE_TYPE (var_decl)); > if (tn != NULL_TREE && TREE_CODE (tn) == TYPE_DECL && DECL_NAME (tn)) > { > ... > } > > This if-condition is true for both, > > int x; > const int x; > ... > > and > > typedef int i_t; > i_t x; > const i_t x; > ... > > I need to weed out the class of VAR_DECLs that directly use built > in types. Try DECL_IS_BUILTIN. But I question how you define "builtin" here? Richard. > Ciao > > Dominik ^_^ ^_^ > > -- > > Dominik Vogt > IBM Germany >