From patchwork Mon Nov 7 19:34:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 692040 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tCN1y6Yn1z9t0X for ; Tue, 8 Nov 2016 06:34:57 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Jq7WhHwI"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=e7AcR9je4EoX54Z60Fp9253m7Psb/PkDVaac3TGrAdDf4E PughQcAPn3GnQucVwa/klg0xQ8CaGxPdtRIEWzwHnJ31dQAE1PFW9JP2/lTHEwDi TJSm0Yjr0ARaTuudDoIGyYeIjkKDb1M9ehqsWEJOIANSs60y2SvvotNZ51wsg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; s= default; bh=PF0ADMRdX05YogTyJ1JTd4NomVU=; b=Jq7WhHwI7UmmPpmDPO0m iPcggvazMaH+R7yclL+ocKUGvbXOuEk+pRW77zwSiAznw4WwtsObzV9xSE++JvTy dV0cRCqOObpKaHynOKu/bdy/G9s9gkXyvbvjxMznkFa/3umTwZcwixwe+G4CGyr+ ChMRiSL8PRl8pIozEx6Exrs= Received: (qmail 24867 invoked by alias); 7 Nov 2016 19:34:49 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 24840 invoked by uid 89); 7 Nov 2016 19:34:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=sk:announc, Hx-languages-length:1187, U*jason X-HELO: mail-yw0-f172.google.com Received: from mail-yw0-f172.google.com (HELO mail-yw0-f172.google.com) (209.85.161.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 07 Nov 2016 19:34:47 +0000 Received: by mail-yw0-f172.google.com with SMTP id l124so151581445ywb.3 for ; Mon, 07 Nov 2016 11:34:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=SS8WP3NHYuJiDYhoRIQezyo4Nt4glMNST8AURBGnbNk=; b=hkP8bkgGFeuoHIXZx3TokE7hI24yUoFBooi8PiAmod7blcuNvvKCw0KaabjdVeElSh xdO7os9zrWBEkQcUP6GTJ4l4lnAxYe3P/qgL2Mm/hQJ1QzoanIJRscCpoZpJ+ZtyFiRZ BmHm+9wZ61AZZEk/3z2SGglGNaO0LGGRSdUcyLGg10y4KKdI1ep13LVwQh3Ta4Uo0OK4 eZx7Zey5Zt8K/YbFgjuYb9xtW9EM5uNOrfknkY6iebf7K0EONuh3s9Vs+HRNOSv+0S4z o4i7PEQONk4Byw08DsUwxdKiba9aVX5x8nrAnvk18zddjDXlzkObeCe/8aprkfLchr1n zgSA== X-Gm-Message-State: ABUngvezOQWYnrhE7onTDYKXtv4wgGO5eiuMBxNXqSlxCKo3w9SBbLLdyNkLtYwkvCGDTCIvxDyw/y+mnBDiJ8J7 X-Received: by 10.157.46.149 with SMTP id w21mr3772998ota.219.1478547285226; Mon, 07 Nov 2016 11:34:45 -0800 (PST) MIME-Version: 1.0 Received: by 10.183.13.228 with HTTP; Mon, 7 Nov 2016 11:34:24 -0800 (PST) From: Jason Merrill Date: Mon, 7 Nov 2016 11:34:24 -0800 Message-ID: Subject: C++ PATCH to announce template instantiations if not -quiet To: gcc-patches List X-IsSubscribed: yes It occurred to me that a simple trace of template instantiations would fit simply into the stream of function declarations that announce_function prints when -quiet is not specified to the compiler. Tested x86_64-pc-linux-gnu, applying to trunk. commit ae7b4a929fbd05de433451a1d92794d962366646 Author: Jason Merrill Date: Fri Nov 4 09:22:32 2016 -0400 Add template instantiations to the announce_function stream. * pt.c (push_tinst_level_loc): Add template instantiations to the announce_function stream. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index c8d4a06..f910d40 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -9170,6 +9170,13 @@ push_tinst_level_loc (tree d, location_t loc) if (limit_bad_template_recursion (d)) return false; + /* When not -quiet, dump template instantiations other than functions, since + announce_function will take care of those. */ + if (!quiet_flag + && TREE_CODE (d) != TREE_LIST + && TREE_CODE (d) != FUNCTION_DECL) + fprintf (stderr, " %s", decl_as_string (d, TFF_DECL_SPECIFIERS)); + new_level = ggc_alloc (); new_level->decl = d; new_level->locus = loc;