aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/codesearch/testdata/mm
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2026-01-19 15:31:50 +0100
committerDmitry Vyukov <dvyukov@google.com>2026-01-21 13:38:45 +0000
commitd720635adb8965149cd75a3da692d3a0480c36c9 (patch)
treed9896eabd70abd266028624702bc74609ba1c9e4 /pkg/codesearch/testdata/mm
parent6984f21fcb77bdd034a489c0e552aa1d910e852f (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/mm')
-rw-r--r--pkg/codesearch/testdata/mm/refs.c6
-rw-r--r--pkg/codesearch/testdata/mm/refs.c.json23
-rw-r--r--pkg/codesearch/testdata/mm/slub.c.json1
3 files changed, 30 insertions, 0 deletions
diff --git a/pkg/codesearch/testdata/mm/refs.c b/pkg/codesearch/testdata/mm/refs.c
new file mode 100644
index 000000000..709871ab7
--- /dev/null
+++ b/pkg/codesearch/testdata/mm/refs.c
@@ -0,0 +1,6 @@
+int refs2();
+
+void ref_in_mm()
+{
+ refs2();
+}
diff --git a/pkg/codesearch/testdata/mm/refs.c.json b/pkg/codesearch/testdata/mm/refs.c.json
new file mode 100644
index 000000000..09ac87f98
--- /dev/null
+++ b/pkg/codesearch/testdata/mm/refs.c.json
@@ -0,0 +1,23 @@
+{
+ "definitions": [
+ {
+ "kind": "function",
+ "name": "ref_in_mm",
+ "type": "void ()",
+ "body": {
+ "file": "mm/refs.c",
+ "start_line": 3,
+ "end_line": 6
+ },
+ "comment": {},
+ "refs": [
+ {
+ "kind": "calls",
+ "entity_kind": "function",
+ "name": "refs2",
+ "line": 5
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/pkg/codesearch/testdata/mm/slub.c.json b/pkg/codesearch/testdata/mm/slub.c.json
new file mode 100644
index 000000000..9e26dfeeb
--- /dev/null
+++ b/pkg/codesearch/testdata/mm/slub.c.json
@@ -0,0 +1 @@
+{} \ No newline at end of file