From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 109492 invoked by alias); 28 Apr 2016 14:13:13 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 109477 invoked by uid 89); 28 Apr 2016 14:13:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=patrick@parcs.ath.cx, patrickparcsathcx, Hx-languages-length:1550 X-HELO: mail-ob0-f176.google.com Received: from mail-ob0-f176.google.com (HELO mail-ob0-f176.google.com) (209.85.214.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 28 Apr 2016 14:13:01 +0000 Received: by mail-ob0-f176.google.com with SMTP id n10so34675983obb.2 for ; Thu, 28 Apr 2016 07:13:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=g9LlASWpXyFnv/QoJWNRz/d2d/e5PxYpgPUrH46orF8=; b=kV/Ze4iXW7VHIhLnNLcnVLBjmiPkH/B/DZfof36npPe8VZqOwPVWdmv3f05RguwKRh I0Zle+/271h5KaNN9jueoB2Mq2O0Lni2xrMdYqd0C8qdJpTlYFFpZkdBubBKjG0XGUhz dytEFiWsHgAg2E4EsFJpteo+prTJjRcjL4e3UZoNrxaWbtWEk5amrpnYo4i7hQhDLO6p w5uZaxUMBOx7emr0MD9Rc37rHUGBBUzLHkHqJggQgEIJvxEstRiJzeJlsIgmnUDaRs61 WiAYLNWp3g0nOr0fJazXA0mCDctRI9922xeDnGstWoJ8AFgAYNEs0hxiOL/Ce9GlHpxt Iucg== X-Gm-Message-State: AOPr4FXgWGlZrSZZ8wabrgNxnG8Kmptx+JT9r9+DR+RhVhZplylclOBkqrBj/99MlDhY6J4j/kLAikz+EzjJPw== X-Received: by 10.182.123.5 with SMTP id lw5mr6665346obb.3.1461852779927; Thu, 28 Apr 2016 07:12:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.102.105 with HTTP; Thu, 28 Apr 2016 07:12:40 -0700 (PDT) In-Reply-To: References: <20160428135011.2719-1-patrick@parcs.ath.cx> From: Patrick Palka Date: Thu, 28 Apr 2016 14:13:00 -0000 Message-ID: Subject: Re: [PATCH] Mark predicates generated by genmatch as static To: Richard Biener Cc: GCC Patches Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2016-04/txt/msg01839.txt.bz2 On Thu, Apr 28, 2016 at 10:02 AM, Richard Biener wrote: > On Thu, Apr 28, 2016 at 3:50 PM, Patrick Palka wrote: >> The predicate functions emitted by genmatch are expected to only be used >> locally within {gimple,generic}-match.c, so this patch marks them as >> static. Does this look OK to commit after bootstrap and regtest? > > Actually the idea was to for example generate predicates in match.pd > format for things like vectorizer pattern recog (I've done this for a few, > need to search for (partial) patches on my disk), so they are supposed > to be externally visible. > > Of course we might want to make that explicit in some way with > a (extern_match ...) [or by prefixing local ones with a '*' ...]. Oh, I see. That sounds useful. > > Richard. > >> gcc/ChangeLog: >> >> * genmatch.c (write_predicate): Mark the emitted function as >> static. >> --- >> gcc/genmatch.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/gcc/genmatch.c b/gcc/genmatch.c >> index ce964fa..2f5147f 100644 >> --- a/gcc/genmatch.c >> +++ b/gcc/genmatch.c >> @@ -3552,7 +3552,7 @@ decision_tree::gen (FILE *f, bool gimple) >> void >> write_predicate (FILE *f, predicate_id *p, decision_tree &dt, bool gimple) >> { >> - fprintf (f, "\nbool\n" >> + fprintf (f, "\nstatic bool\n" >> "%s%s (tree t%s%s)\n" >> "{\n", gimple ? "gimple_" : "tree_", p->id, >> p->nargs > 0 ? ", tree *res_ops" : "", >> -- >> 2.8.1.361.g2fbef4c >>