flow: delete out of scope variables for compound statement assignments
commitc1fdd0550421d8ce6e8dad3303e28a737ca4bc35
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 1 Nov 2017 13:33:02 +0000 (1 16:33 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Wed, 1 Nov 2017 13:33:02 +0000 (1 16:33 +0300)
treec1dbc69dafb36a7c019c62d5599f7daf5531da4a
parent0e466489ffa6a6ae3406cf311c4d12998e0c4146
flow: delete out of scope variables for compound statement assignments

On my system it takes around 6 minutes to parse block/blk-settings.c but
after this patch is applied, then it takes 3 minutes.  The problem is that
parsing blk_stack_limits() takes a long time.  It has a bunch of
statements like this:

t->max_sectors = min_not_zero(t->max_sectors, b->max_sectors);

The issue is that min_not_zero() declares several variables, and we're
supposed to forget about them afterward.  But the smatch_scope.c doesn't
ever see the compound statement, because we do some fakery in
smatch_conditions.c.  We can fix this by passing it to the hook.

Reported-by: Bart Van Assche <Bart.VanAssche@wdc.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch_conditions.c