param_set/clear: Use memset() of struct members
commit07d92a38d283f20cc489ec11af73fe406be4f710
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 10 Feb 2021 11:38:58 +0000 (10 14:38 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Thu, 11 Feb 2021 11:28:10 +0000 (11 14:28 +0300)
tree399099716d1d36b6cb9d24d1fe8766abd4d5e336
parent266f8475136517bbf85f8f1aac727e48fe52632c
param_set/clear: Use memset() of struct members

What this is is, imagine you have a function which memset as struct member:

void one(struct outer *outer)
{
        memset(&outer->foo, 0, sizeof(outer->foo));
}

That data is recorded in the database but we also record it as a series of
assignments.

outer->foo.a = 0;
outer->foo.b = 0;

It's a waste of space to record this duplicate information.  Originally
this param_clear was not used in smatch_struct_assignment.c but now we
can use the gen_expr_from_param_key() function to do it easily.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch.h
smatch_extra.h
smatch_param_cleared.c
smatch_param_set.c
smatch_ranges.c
smatch_struct_assignment.c