mtag/mtag_data: re-use the same code to store data and retrieve it
I have a bunch of basically duplicate code to get the mtag and the offset.
It should just be two functions. The get_mtag_sval() funtion tells you
what __smatch_implied(&foo.x) is and the get_mtag_rl() function tells you
what __smatch_implied(foo.x) is.
The way get_mtag_rl() works is that it takes "foo.x", it adds an '&' so
it becomes "&foo.x", then it looks the mtag and offset in mtag_data and
gives you an rl. But the point of this patch is that now when we're
looking up data we can re-use the code we use to store it.
Also in get_mtag_sval(), I originally thought I could rely on
smatch_extra.c to use the implied_mtag_offset(). That would be true
if I were always accessing it through smatch_math.c but now we're calling
it directly, then we need to look it here.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>