Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CountFnQty

Using LLVM, it counts the number of functions (function definitions) and function calls in C/C++ source files. I just wanted to learn how to use LLVM for source code analysis. Nothing special. >v<

Build

meson setup builddir --native-file clang.ini
meson compile -C builddir

Run

(Note: Adjust the include path and language standard according to your environment.)

cd builddir
./src/CountFnQty ../test/is_prime.cpp -- -I/usr/lib/clang/21/include -std=c++17
./src/CountFnQty ../test/is_prime.c -- -I/usr/lib/clang/21/include

Example Output

$ ./src/CountFnQty ../test/is_prime.c -- -I/usr/lib/clang/21/include

Number of function declarations: 2
Number of function calls: 6

About

Counts the number of functions and their calls in C/C++ source files, using LLVM.

Topics

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages