helper: cache get_member_name()
commit7edae857e5ccb79ce37d2c9468df84849f29be85
authorDan Carpenter <dan.carpenter@linaro.org>
Mon, 8 Apr 2024 15:28:01 +0000 (8 18:28 +0300)
committerDan Carpenter <dan.carpenter@linaro.org>
Mon, 8 Apr 2024 15:28:01 +0000 (8 18:28 +0300)
tree54707ce24a9684c35c8015c8dbbd360a1f67c7b3
parente24c21dd3eaaa688477d26391333e9f585c32d86
helper: cache get_member_name()

I've been calling get_member_name() more and more often so it's worth
caching the results.  That means that instead of allocating a permanent
string, I need to allocate and sname string which is not freed until the
end of the function.  The callers used to be responsible for freeing the
returned string but now they must leave it alone.

Some of the callers return the string again, so sometimes I just allocate
a new string in that situation.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
check_debug.c
check_implicit_dependencies.c
check_implicit_dependencies_tester.c
smatch_array_values.c
smatch_buf_size.c
smatch_constraints.c
smatch_function_ptrs.c
smatch_helper.c
smatch_type_val.c
smatch_units.c