impossible: handle switch statements
One common situation is that you have a switch statement with no:
default:
return -EINVAL;
or whatever, so it looks like you could have a path through the code where
some bad thing happened. The programmer knows that's impossible but Smatch
was not marking it that way.
This patch tries to fix that.
First of all no one was using the CASE_HOOK and there was a comment that I
was thinking about deleting it because it was passing nonsense data anyway.
I have repurposed it to pass the range list of the switch expression. That
meant I had to move it from smatch_flow.c to smatch_implied.c. If the
range_list it empty that means the case is impossible.
The other thing that I did is that if there is a switch statement with no
default case, then just fake one at the end.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>