diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2026-01-19 15:31:50 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2026-01-21 13:38:45 +0000 |
| commit | d720635adb8965149cd75a3da692d3a0480c36c9 (patch) | |
| tree | d9896eabd70abd266028624702bc74609ba1c9e4 /pkg/codesearch/testdata/query-find-references-context-limit | |
| parent | 6984f21fcb77bdd034a489c0e552aa1d910e852f (diff) | |
pkg/codesearch: support searching for references
Extend codesearch clang tool to export info about function references
(calls, takes-address-of).
Add pkg/codesearch command find-references.
Export find-references in pkg/aflow/tools/codesearcher to LLMs.
Update #6469
Diffstat (limited to 'pkg/codesearch/testdata/query-find-references-context-limit')
| -rw-r--r-- | pkg/codesearch/testdata/query-find-references-context-limit | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/pkg/codesearch/testdata/query-find-references-context-limit b/pkg/codesearch/testdata/query-find-references-context-limit new file mode 100644 index 000000000..5d230c28a --- /dev/null +++ b/pkg/codesearch/testdata/query-find-references-context-limit @@ -0,0 +1,42 @@ +find-references refs.c refs2 "" 10000 10 + +refs2 has 4 references: + +function long_func_with_ref calls it at refs.c:29 + 23: void long_func_with_ref() + 24: { + 25: refs0(); + 26: refs1(); + 27: refs0(); + 28: refs1(); + 29: refs2(refs1, refs0()); + 30: refs0(); + 31: refs1(); + 32: refs0(); + 33: refs1(); + 34: } + + +function ref_in_mm calls it at mm/refs.c:5 + 3: void ref_in_mm() + 4: { + 5: refs2(); + 6: } + + +function refs3 calls it at refs.c:19 + 17: void refs3() + 18: { + 19: refs2(refs1, refs0()); + 20: (void)refs2; + 21: } + + +function refs3 takes-address-of it at refs.c:20 + 17: void refs3() + 18: { + 19: refs2(refs1, refs0()); + 20: (void)refs2; + 21: } + + |
