[PATCH 1/4] expand linearize_position() into linearize_initializer()

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

 



linearize_position() is a very small function doing the initialization
of EXPR_POS while for the more complex EXPR_INITIALIZER this is done
directly in linearize_initializer().

Having this code in a separate function doesn't bring substantial benefits,
on the contrary it obscure the fact that linearize_initializer() is a
recursive function and make harder the tracking of where struct access_data
are modified.

Expand linearize_position() into its caller, linearize_initializer().

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 linearize.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/linearize.c b/linearize.c
index c2010c4b6..e8d145a70 100644
--- a/linearize.c
+++ b/linearize.c
@@ -1772,14 +1772,6 @@ static pseudo_t linearize_cast(struct entrypoint *ep, struct expression *expr)
 	return cast_pseudo(ep, src, orig->ctype, expr->ctype);
 }
 
-static pseudo_t linearize_position(struct entrypoint *ep, struct expression *pos, struct access_data *ad)
-{
-	struct expression *init_expr = pos->init_expr;
-
-	ad->offset = pos->init_offset;
-	return linearize_initializer(ep, init_expr, ad);
-}
-
 static pseudo_t linearize_initializer(struct entrypoint *ep, struct expression *initializer, struct access_data *ad)
 {
 	switch (initializer->type) {
@@ -1791,7 +1783,8 @@ static pseudo_t linearize_initializer(struct entrypoint *ep, struct expression *
 		break;
 	}
 	case EXPR_POS:
-		linearize_position(ep, initializer, ad);
+		ad->offset = initializer->init_offset;
+		linearize_initializer(ep, initializer->init_expr, ad);
 		break;
 	default: {
 		pseudo_t value = linearize_expression(ep, initializer);
-- 
2.18.0

--
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