clangql

Query C/C++ files using SQL-like syntax for code analysis

brewmacoslinux
Try with needOr install directly
Source

About

Run a SQL like language to perform queries on C/C++ files

Commands

clangql

Examples

Find all function definitions in a C file$ clangql 'SELECT * FROM functions' file.c
Query all variable declarations matching a pattern$ clangql 'SELECT name FROM variables WHERE type LIKE "int*"' source.cpp
Find function calls to a specific function$ clangql 'SELECT * FROM calls WHERE callee = "malloc"' program.c