[PATCH] defer initialization of bb::context

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Currently bb::context is intialized (at -1) when the
basic block is allocated.

But this field:
1) is only used when using the sparse tools;
2) when used, it's only quite late in the process;
3) this early initialization prevents us to reuse the space
   of this field for another purpose, earlier in the process.

Change this by initializing this field much later, by the sparse tool
itself, just before needing it.

The real motivation being, of course, to be able to reuse the space
for some other upcoming field.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 linearize.c | 1 -
 sparse.c    | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/linearize.c b/linearize.c
index 6b79864ef..4e373f3f9 100644
--- a/linearize.c
+++ b/linearize.c
@@ -71,7 +71,6 @@ static struct basic_block *alloc_basic_block(struct entrypoint *ep, struct posit
 {
 	static int nr;
 	struct basic_block *bb = __alloc_basic_block(0);
-	bb->context = -1;
 	bb->pos = pos;
 	bb->ep = ep;
 	bb->nr = nr++;
diff --git a/sparse.c b/sparse.c
index bceacd94e..ef5ee4762 100644
--- a/sparse.c
+++ b/sparse.c
@@ -243,6 +243,7 @@ static void check_instructions(struct entrypoint *ep)
 {
 	struct basic_block *bb;
 	FOR_EACH_PTR(ep->bbs, bb) {
+		bb->context = -1;
 		check_bb_instructions(bb);
 	} END_FOR_EACH_PTR(bb);
 }
-- 
2.16.2

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux