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/testdata/refs.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 pkg/codesearch/testdata/refs.c (limited to 'pkg/codesearch/testdata/refs.c') diff --git a/pkg/codesearch/testdata/refs.c b/pkg/codesearch/testdata/refs.c new file mode 100644 index 000000000..9b6b2633f --- /dev/null +++ b/pkg/codesearch/testdata/refs.c @@ -0,0 +1,34 @@ +// Copyright 2025 syzkaller project authors. All rights reserved. +// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. + +int refs0() +{ + return 0; +} + +void refs1() +{ +} + +void refs2(void (*)(), int) +{ +} + +void refs3() +{ + refs2(refs1, refs0()); + (void)refs2; +} + +void long_func_with_ref() +{ + refs0(); + refs1(); + refs0(); + refs1(); + refs2(refs1, refs0()); + refs0(); + refs1(); + refs0(); + refs1(); +} -- cgit mrf-deployment