From d720635adb8965149cd75a3da692d3a0480c36c9 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 19 Jan 2026 15:31:50 +0100 Subject: 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 --- pkg/codesearch/database.go | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'pkg/codesearch/database.go') diff --git a/pkg/codesearch/database.go b/pkg/codesearch/database.go index 4757935e9..499fc73cb 100644 --- a/pkg/codesearch/database.go +++ b/pkg/codesearch/database.go @@ -14,12 +14,20 @@ type Database struct { } type Definition struct { - Kind string `json:"kind,omitempty"` - Name string `json:"name,omitempty"` - Type string `json:"type,omitempty"` - IsStatic bool `json:"is_static,omitempty"` - Body LineRange `json:"body,omitempty"` - Comment LineRange `json:"comment,omitempty"` + Kind string `json:"kind,omitempty"` + Name string `json:"name,omitempty"` + Type string `json:"type,omitempty"` + IsStatic bool `json:"is_static,omitempty"` + Body LineRange `json:"body,omitempty"` + Comment LineRange `json:"comment,omitempty"` + Refs []Reference `json:"refs,omitempty"` +} + +type Reference struct { + Kind string `json:"kind,omitempty"` + EntityKind string `json:"entity_kind,omitempty"` + Name string `json:"name,omitempty"` + Line int `json:"line,omitempty"` } type LineRange struct { -- cgit mrf-deployment