From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 2MGyF0Lo82EjewAAWB0awg (envelope-from ) for ; Fri, 28 Jan 2022 07:57:38 -0500 Received: by simark.ca (Postfix, from userid 112) id 5E68E1F3B7; Fri, 28 Jan 2022 07:57:38 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id F21AA1EE18 for ; Fri, 28 Jan 2022 07:57:37 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7F9C63947C31 for ; Fri, 28 Jan 2022 12:57:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7F9C63947C31 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1643374657; bh=NVoswjczGPvGlL/2uIVw9yR87PPKazSwgMI30imAnD8=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=t8Ug7frunLDiz9xkhma1K7Ki6cj+7Uh56dtirsvi15hEIEDRYf2hYFwQESVBOg0Ya JXYKr4+MmM5t6c69XT/diPxtg6srYBFuEzCV9XEMEz3/8Kb/FPSBDPC1bUeEHWuZ2P c2jUr0E1mZSkWXH9UWNhzxahVpgt11Muv6ElgnH4= Received: from barracuda.ebox.ca (barracuda.ebox.ca [96.127.255.19]) by sourceware.org (Postfix) with ESMTPS id 7123A385C40E for ; Fri, 28 Jan 2022 12:51:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7123A385C40E X-ASG-Debug-ID: 1643374294-0c856e06ad271ba0001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id HbC1xgX5nXWICNRN (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 28 Jan 2022 07:51:34 -0500 (EST) X-Barracuda-Envelope-From: simon.marchi@polymtl.ca X-Barracuda-RBL-Trusted-Forwarder: 96.127.255.82 Received: from simark.localdomain (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) by smtp.ebox.ca (Postfix) with ESMTP id 24B66441D69; Fri, 28 Jan 2022 07:51:34 -0500 (EST) X-Barracuda-RBL-IP: 192.222.157.6 X-Barracuda-Effective-Source-IP: 192-222-157-6.qc.cable.ebox.net[192.222.157.6] X-Barracuda-Apparent-Source-IP: 192.222.157.6 To: gdb-patches@sourceware.org Subject: [PATCH 31/33] gdb: remote SYMBOL_IS_CPLUS_TEMPLATE_FUNCTION macro Date: Fri, 28 Jan 2022 07:45:29 -0500 X-ASG-Orig-Subj: [PATCH 31/33] gdb: remote SYMBOL_IS_CPLUS_TEMPLATE_FUNCTION macro Message-Id: <20220128124531.2302941-32-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220128124531.2302941-1-simon.marchi@polymtl.ca> References: <20220128124531.2302941-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: smtp.ebox.ca[96.127.255.82] X-Barracuda-Start-Time: 1643374294 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://96.127.255.19:443/cgi-mod/mark.cgi X-Barracuda-BRTS-Status: 1 X-Virus-Scanned: by bsmtpd at ebox.ca X-Barracuda-Scan-Msg-Size: 2127 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=8.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.95629 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Cc: Simon Marchi Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" From: Simon Marchi Add a getter for a whether a symbol is a C++ template function. Remove the corresponding macro and adjust all callers. Change-Id: I89abc2802a952b77b0e0eb73a25c2306cb8e8bcc --- gdb/cp-namespace.c | 2 +- gdb/symtab.h | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c index 6130381fdd66..8fb2f71b46cc 100644 --- a/gdb/cp-namespace.c +++ b/gdb/cp-namespace.c @@ -519,7 +519,7 @@ cp_lookup_symbol_imports_or_template (const char *scope, if (function != NULL && function->language () == language_cplus) { /* Search the function's template parameters. */ - if (SYMBOL_IS_CPLUS_TEMPLATE_FUNCTION (function)) + if (function->is_cplus_template_function ()) { struct template_symbol *templ = (struct template_symbol *) function; diff --git a/gdb/symtab.h b/gdb/symtab.h index 9b7d7e35c972..a86145198fdc 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -1198,6 +1198,11 @@ struct symbol : public general_symbol_info, public allocate_on_obstack m_is_inlined = is_inlined; } + bool is_cplus_template_function () const + { + return this->subclass == SYMBOL_TEMPLATE; + } + /* Data type of value */ struct type *type = nullptr; @@ -1300,8 +1305,6 @@ struct block_symbol /* Note: There is no accessor macro for symbol.owner because it is "private". */ -#define SYMBOL_IS_CPLUS_TEMPLATE_FUNCTION(symbol) \ - (((symbol)->subclass) == SYMBOL_TEMPLATE) #define SYMBOL_TYPE(symbol) (symbol)->type #define SYMBOL_LINE(symbol) (symbol)->line #define SYMBOL_COMPUTED_OPS(symbol) ((symbol)->impl ().ops_computed) @@ -1342,7 +1345,7 @@ extern void symbol_set_symtab (struct symbol *symbol, struct symtab *symtab); /* An instance of this type is used to represent a C++ template function. A symbol is really of this type iff - SYMBOL_IS_CPLUS_TEMPLATE_FUNCTION is true. */ + symbol::is_cplus_template_function is true. */ struct template_symbol : public symbol { -- 2.34.1