From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by sourceware.org (Postfix) with ESMTP id B3FE6386FC22 for ; Fri, 21 May 2021 21:47:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B3FE6386FC22 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=segher@kernel.crashing.org Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 14LLkgx5004872; Fri, 21 May 2021 16:46:42 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 14LLkg7Q004871; Fri, 21 May 2021 16:46:42 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Fri, 21 May 2021 16:46:42 -0500 From: Segher Boessenkool To: Bill Schmidt Cc: gcc-patches@gcc.gnu.org, jakub@redhat.com, jlaw@tachyum.com, dje.gcc@gmail.com Subject: Re: [PATCH 09/57] rs6000: Add functions for matching types, part 3 of 3 Message-ID: <20210521214642.GE10366@gate.crashing.org> References: <4cecf1cf86aae210b878f8c9b997f9eeea035fb0.1619537141.git.wschmidt@linux.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4cecf1cf86aae210b878f8c9b997f9eeea035fb0.1619537141.git.wschmidt@linux.ibm.com> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, KAM_NUMSUBJECT, TXREP, T_SPF_HELO_PERMERROR, T_SPF_PERMERROR autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-List-Received-Date: Fri, 21 May 2021 21:47:44 -0000 On Tue, Apr 27, 2021 at 10:32:44AM -0500, Bill Schmidt via Gcc-patches wrote: > static int > match_const_restriction (typeinfo *typedata) > { > + int oldpos = pos; > + if (linebuf[pos] == '<') > + else if (linebuf[pos] == '{') > + assert (linebuf[pos] == '['); Can you factor this please? The three cases do exactly the same? And if not, it would be much clearer if you make the difference explicit. Pass the two '<', '>' as arguments, and you can use that to differentiate then, even. Okay for trunk either way. Thanks! Segher