clang-tags icon indicating copy to clipboard operation
clang-tags copied to clipboard

clang-tags missing some uses of a function

Open nrnrnr opened this issue 5 years ago • 0 comments

After using clang-tags successfully for some years, I had to rebuild it after a major OS upgrade. Now I have noticed some difficulty: it is not identifying every use of a function. Putting together a minimal test case might take several hours, but if there is a chance of the issue being fixed, I will do so. Meanwhile, here is some evidence.

clang-tags grep finds declaration, definition, and two uses of function topframe. I'm not sure why the uses are listed twice:

nr@homedog /t/b/p/uschemeplus> clang-tags grep c:@F@topframe
Server response:
all.h:434:Frame *topframe(Stack s);  // NULL if empty
context-stack.c:36:Frame *topframe (Stack s) {
eval-stack.c:153:topframe(evalstack)->syntax = e;
eval-stack.c:153:topframe(evalstack)->syntax = e;
eval-stack.c:216:fr = topframe(evalstack);
eval-stack.c:216:fr = topframe(evalstack);

The number of actual uses is found by grep:

nr@homedog /t/b/p/uschemeplus> grep -nw topframe *.h *.c
all.h:434:Frame *topframe(Stack s);  // NULL if empty
context-stack.c:36:Frame *topframe (Stack s) {
eval-stack.c:106:fr = topframe(evalstack);
eval-stack.c:133:fr = topframe(evalstack);
eval-stack.c:153:topframe(evalstack)->syntax = e;
eval-stack.c:216:fr = topframe(evalstack);
eval-stack.c:387:  fr = topframe(evalstack);   // fr now points to the next youngest frame
eval-stack.c:435:    Frame *f = optimize_tail_calls ? topframe(s) : NULL;
stack-debug.c:33:        if (topframe(s)) 

Efforts to use clang-tags find-def at that location produce only eval, which is the function containing the call.

nrnrnr avatar Nov 15 '19 14:11 nrnrnr