From patchwork Thu Aug 6 17:27:46 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamil Dudka X-Patchwork-Id: 39653 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n76HSiXJ031863 for ; Thu, 6 Aug 2009 17:28:44 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755959AbZHFR2m (ORCPT ); Thu, 6 Aug 2009 13:28:42 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756391AbZHFR2m (ORCPT ); Thu, 6 Aug 2009 13:28:42 -0400 Received: from mx2.redhat.com ([66.187.237.31]:45989 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755959AbZHFR2l (ORCPT ); Thu, 6 Aug 2009 13:28:41 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n76HScJa004045; Thu, 6 Aug 2009 13:28:38 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n76HSFPQ003898; Thu, 6 Aug 2009 13:28:16 -0400 Received: from vpn2-8-71.ams2.redhat.com (vpn2-8-71.ams2.redhat.com [10.36.8.71]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n76HSEtg027717; Thu, 6 Aug 2009 13:28:14 -0400 From: Kamil Dudka To: Christopher Li Subject: Re: [PATCH] linearize.h: sanitize header Date: Thu, 6 Aug 2009 19:27:46 +0200 User-Agent: KMail/1.9.7 Cc: Hannes Eder , sparse References: <200908061102.14935.kdudka@redhat.com> <154e089b0908060409v4dff4785x456b5aad2460ed84@mail.gmail.com> <70318cbf0908061010w737ac3d7j1feb1f9744217df7@mail.gmail.com> In-Reply-To: <70318cbf0908061010w737ac3d7j1feb1f9744217df7@mail.gmail.com> MIME-Version: 1.0 X-Length: 4642 X-UID: 37819 Message-Id: <200908061927.47201.kdudka@redhat.com> X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org On Thursday 06 of August 2009 19:10:30 Christopher Li wrote: > I would just apply the change to the header file and related variables. > The linearize.h is consider an API header file for other sparse application > to use. So we'd better not assume too much on the sparse caller side. > > I agree with Kamil that rename variable in linearize.c offer no real > benefits. I consider it more of a personal preference thing. And it is > internal to linearize.c. At this point renaming variable will mess up with > annotations. It is not good enough reason to do it just to make > the editor happy. Well, let's make a tradeoff - we can only change the identifiers in linearize.h and the corresponding identifiers in linearize.c. I admit it could be confusing when we have different identifiers in the prototype and different identifiers in the function body. New version of the patch is attached. Kamil Acked-by: Hannes Eder From 4d4c71eb876351d53e0f8edf0f121950ec2a9a84 Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Thu, 6 Aug 2009 19:20:51 +0200 Subject: [PATCH] linearize.h: sanitize header It's unfortunate to use 'true' and 'false' as identifiers in a system header. It clashes with corresponding macros from when included before . Signed-off-by: Kamil Dudka --- linearize.c | 6 +++--- linearize.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/linearize.c b/linearize.c index 1a19214..238ee5d 100644 --- a/linearize.c +++ b/linearize.c @@ -666,7 +666,7 @@ void insert_branch(struct basic_block *bb, struct instruction *jmp, struct basic } -void insert_select(struct basic_block *bb, struct instruction *br, struct instruction *phi_node, pseudo_t true, pseudo_t false) +void insert_select(struct basic_block *bb, struct instruction *br, struct instruction *phi_node, pseudo_t if_true, pseudo_t if_false) { pseudo_t target; struct instruction *select; @@ -685,8 +685,8 @@ void insert_select(struct basic_block *bb, struct instruction *br, struct instru select->target = target; target->def = select; - use_pseudo(select, true, &select->src2); - use_pseudo(select, false, &select->src3); + use_pseudo(select, if_true, &select->src2); + use_pseudo(select, if_false, &select->src3); add_instruction(&bb->insns, select); add_instruction(&bb->insns, br); diff --git a/linearize.h b/linearize.h index 2205082..50b3601 100644 --- a/linearize.h +++ b/linearize.h @@ -328,7 +328,7 @@ struct entrypoint { struct instruction *entry; }; -extern void insert_select(struct basic_block *bb, struct instruction *br, struct instruction *phi, pseudo_t true, pseudo_t false); +extern void insert_select(struct basic_block *bb, struct instruction *br, struct instruction *phi, pseudo_t if_true, pseudo_t if_false); extern void insert_branch(struct basic_block *bb, struct instruction *br, struct basic_block *target); pseudo_t alloc_phi(struct basic_block *source, pseudo_t pseudo, int size); -- 1.6.3.3