aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/clangtool/tooltest
Commit message (Collapse)AuthorAgeFilesLines
* pkg/aflow/tool/codesearcher: add end-to-end testsDmitry Vyukov2026-02-191-6/+6
| | | | Update #6811
* pkg/clangtool/tooltest: run clang tools tests only on linuxDmitry Vyukov2026-02-171-0/+5
| | | | | | | Currently only linux can build the clang tools, so skip tests on other OSes. syz-ci instances are currently broken on syz-agent build, but when they get past that they will likely hit test faililures.
* tools/clang: compile clang tools into the binaryDmitry Vyukov2026-02-061-11/+5
| | | | | | | | | | | | | | | | | | Compiled clang tools into Go binaries using cgo. This significantly simplifies building and deployment. This also enables unit testing of clang tools. Now raw go test for clang tools will build them, run, and verify output. Each clang tool is still started as a subprocess. I've experimented with running them in-process, but this makes stdout/stderr interception extremly complicated, and it seems that clang tools still use unsynchronized global state, which breaks when invoked multiple times. Subprocesses also make it safer in the face of potential memory leaks, or memory corruptions in clang tools. Fixes #6645
* pkg/codesearch: reduce memory consumption when building indexDmitry Vyukov2026-01-221-2/+4
| | | | | | | | | | | | | | | | | | With all references in the index, it become quite big. Merge and dedup the resulting index on the fly. Also intern all strings b/c there are tons of duplicates. This also removes unnecessary duplicates (effectively ODR violations in the kernel) due to use of BUILD_BUG_ON. The macro produces different function calls in different translations units, so the same function may contain __compiletime_assert_N1 call in one TU and __compiletime_assert_N2 in another. Over this reduces resource consumption of index building from: time:296.11s user:16993.71s sys:6661.03s memory:82707MB to: time:194.28s user:16860.01s sys:6647.01s memory: 3243MB 25x reduction in memory consumption.
* pkg/codesearch: support searching for referencesDmitry Vyukov2026-01-211-1/+8
| | | | | | | | | 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/clangtool: allow final verification of outputDmitry Vyukov2025-11-201-1/+3
| | | | | | | Let tools verify that all source file names, line numbers, etc are valid/present. If there are any bogus entries, it's better to detect them early, than to crash/error much later when the info is used.
* pkg/clangtool/tooltest: add LoadOutput helperDmitry Vyukov2025-11-171-0/+13
| | | | | Add LoadOutput helper to use in future commits, and switch to osutil.ReadJSON helper.
* pkg/clangtool/tooltest: add packageDmitry Vyukov2025-11-171-0/+103
Factor out common clang tool testing helpers from the declextract tool test.