From patchwork Wed Sep 22 15:56:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Palka X-Patchwork-Id: 1531315 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=eiVJG8aO; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.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 (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HF2yq704Sz9sRf for ; Thu, 23 Sep 2021 01:58:43 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BBF1E3858005 for ; Wed, 22 Sep 2021 15:58:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BBF1E3858005 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1632326321; bh=uc/KoZq/t9hba5TmRtOB2oDnqCxWoTkkW36ll/iaBwI=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=eiVJG8aOpUqJvZS4x0PwjOYpuczABpp5gBkxnhyiiaqF0olXTxwnrQ16vpn7zpBpY +rTe1tHHno1LHgMFF9zFUcDaM7uo5St6sqg2FIR3SOdQMl+OwA4PM0lJ//JBlTkDAo ht2glhNfOb4XZFJ+udh0u88KME7VspKm7qfM5KYA= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id DAFE43858002 for ; Wed, 22 Sep 2021 15:57:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DAFE43858002 Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-381-8elpzIDLO0W2S6c79msMZQ-1; Wed, 22 Sep 2021 11:57:04 -0400 X-MC-Unique: 8elpzIDLO0W2S6c79msMZQ-1 Received: by mail-qv1-f70.google.com with SMTP id e6-20020a0cb446000000b0037eeb9851dfso12097506qvf.17 for ; Wed, 22 Sep 2021 08:57:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=uc/KoZq/t9hba5TmRtOB2oDnqCxWoTkkW36ll/iaBwI=; b=VY/A6m8H9MUxtpTZ41DUyYkaHjEKUMMqxuFUdZ1Z+sc2xGDw93lc2ODvjthpvC0AX4 hn3agKQQo5Afscjm9lQ757mXD1IYKz2OyQSAN2Ut5u4hcilo7tyT6Lz/6UerWW9UOTQ6 ofKQSXyUrspD+jZ3sMohapgg8mepb39vNVx967lBxyr60YrcshIlv76dxGQDp90V2hnC /kO94GK/Fl6jZj18XPsdjfgmnn81ZyPzA11JhDNcEj+mERIZahe+FbUZT+XzqKm+jAFz G0bfyi0rvBlwTvf8oJOgtwxPKnlK/gfTjl6heeIQUpOdLHvMHo8oSTseuYk1vccfv9kf ce6Q== X-Gm-Message-State: AOAM531JY3GvxH2qTcFXULzE3pjvdUCJRPfZp6MTBmMv57tHm7HZMGnP Ow4uTySb22andACryHOKhpxsT/sLzKGyWjL7Eg1edlVmNJz9sz/gjOXMQrb8b5NbMOtTdm/OARR LfGMUdsmHY3ddQMpuwOKuY4JmSkgMTSva2H+3TDq0iimwEqSAZnjNG9vJ0eD+9aWl+0U= X-Received: by 2002:ac8:7f45:: with SMTP id g5mr210188qtk.93.1632326223657; Wed, 22 Sep 2021 08:57:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJFSYnqB09PRC+zl5Y6/Q+ggDlSxbAPzOfzFoy+hGVfJ1bLHFb2BeB4vQl8E6EvKlKcCKl5Q== X-Received: by 2002:ac8:7f45:: with SMTP id g5mr210149qtk.93.1632326223265; Wed, 22 Sep 2021 08:57:03 -0700 (PDT) Received: from localhost.localdomain (ool-457d493a.dyn.optonline.net. [69.125.73.58]) by smtp.gmail.com with ESMTPSA id y15sm1884545qko.78.2021.09.22.08.57.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Sep 2021 08:57:02 -0700 (PDT) To: gcc-patches@gcc.gnu.org Subject: [PATCH] c++: improve dumping of templated decls Date: Wed, 22 Sep 2021 11:56:57 -0400 Message-Id: <20210922155657.3279594-1-ppalka@redhat.com> X-Mailer: git-send-email 2.33.0.514.g99c99ed825 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-16.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Patrick Palka via Gcc-patches From: Patrick Palka Reply-To: Patrick Palka Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" This makes the dumping routines output more information for templated decls, to help streamline debugging. Tested on x86_64-pc-linux-gnu, does this look OK for trunk? gcc/cp/ChangeLog: * ptree.c (cxx_print_decl): Dump the DECL_TEMPLATE_RESULT of a TEMPLATE_DECL. Dump the DECL_TEMPLATE_INFO rather than just printing its pointer. --- gcc/cp/ptree.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/gcc/cp/ptree.c b/gcc/cp/ptree.c index 7f140f5f06b..1dcd764af01 100644 --- a/gcc/cp/ptree.c +++ b/gcc/cp/ptree.c @@ -51,6 +51,7 @@ cxx_print_decl (FILE *file, tree node, int indent) } else if (TREE_CODE (node) == TEMPLATE_DECL) { + print_node (file, "result", DECL_TEMPLATE_RESULT (node), indent + 4); print_node (file, "parms", DECL_TEMPLATE_PARMS (node), indent + 4); indent_to (file, indent + 3); fprintf (file, " full-name \"%s\"", @@ -115,13 +116,8 @@ cxx_print_decl (FILE *file, tree node, int indent) if (VAR_OR_FUNCTION_DECL_P (node) && DECL_TEMPLATE_INFO (node)) - { - if (need_indent) - indent_to (file, indent + 3); - fprintf (file, " template-info %p", - (void *) DECL_TEMPLATE_INFO (node)); - need_indent = false; - } + print_node (file, "template-info", DECL_TEMPLATE_INFO (node), + indent + 4); } void