From: Kamil Dudka <kdudka@redhat.com>
To: Christopher Li <sparse@chrisli.org>
Cc: Hannes Eder <hannes@hanneseder.net>,
sparse <linux-sparse@vger.kernel.org>
Subject: Re: [PATCH] linearize.h: sanitize header
Date: Thu, 6 Aug 2009 19:27:46 +0200 [thread overview]
Message-ID: <200908061927.47201.kdudka@redhat.com> (raw)
In-Reply-To: <70318cbf0908061010w737ac3d7j1feb1f9744217df7@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 903 bytes --]
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
[-- Attachment #2: 0001-linearize.h-sanitize-header.patch --]
[-- Type: text/x-diff, Size: 2161 bytes --]
From 4d4c71eb876351d53e0f8edf0f121950ec2a9a84 Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
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 <stdbool.h> when
included before <sparse/linearize.h>.
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
---
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
next prev parent reply other threads:[~2009-08-06 17:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-06 9:02 [PATCH] linearize.h: sanitize header Kamil Dudka
2009-08-06 9:23 ` Hannes Eder
2009-08-06 9:30 ` Kamil Dudka
2009-08-06 9:39 ` Hannes Eder
2009-08-06 9:51 ` Kamil Dudka
2009-08-06 11:09 ` Hannes Eder
2009-08-06 17:10 ` Christopher Li
2009-08-06 17:27 ` Kamil Dudka [this message]
2009-08-06 17:49 ` Hannes Eder
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200908061927.47201.kdudka@redhat.com \
--to=kdudka@redhat.com \
--cc=hannes@hanneseder.net \
--cc=linux-sparse@vger.kernel.org \
--cc=sparse@chrisli.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).