Caller QN of the first C-LSP resolution whose callee QN ends in ". ". */
| 7846 | |
| 7847 | /* Caller QN of the first C-LSP resolution whose callee QN ends in ".<leaf>". */ |
| 7848 | static const char *c1_lsp_caller(CBMFileResult *r, const char *leaf) { |
| 7849 | size_t ll = strlen(leaf); |
| 7850 | for (int i = 0; i < r->resolved_calls.count; i++) { |
| 7851 | const CBMResolvedCall *rc = &r->resolved_calls.items[i]; |
| 7852 | size_t cl = rc->callee_qn ? strlen(rc->callee_qn) : 0; |
| 7853 | if (cl > ll && rc->callee_qn[cl - ll - 1] == '.' && |
| 7854 | strcmp(rc->callee_qn + cl - ll, leaf) == 0) { |
| 7855 | return rc->caller_qn ? rc->caller_qn : ""; |
| 7856 | } |
| 7857 | } |
| 7858 | return ""; |
| 7859 | } |
| 7860 | |
| 7861 | /* xxhash.h shape: `XXH_PUBLIC_API <RetT> name(...)` has one leading identifier more than |
| 7862 | * the grammar admits. tree-sitter-cpp (every .h is C++) recovers it as `RetT::name` with a |