extra: re-write get_long_name_sym()
The old code was pretty complicated and slightly buggy. The bug is that
it broke out of the loop the first time it found a matching symbol.
Another bug is that it doesn't swap the name properly when converting from
p = &whatever to p->foo means whatever.foo.
When I was thinking about it, what I realized is that probably the most
like like thing is that we have:
struct whatever *p = some->really->long->thing;
So something is assigned to "p" which is also the symbol. So we can
look up the symbol and get the long name from that. If p->foo is set to
3 that means some->really->long->thing->foo is set to 3.
We can use swap_name() from smatch_param_key.c to simplify the code and
because it understands addresses etc.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>