To find out whether a function is called in conditional.
We have some functions, which have special requirements, that they cannot be called in conditional. For example, bar is called depends on the value of variable cond. So we need to find out such functions like bar.
void foo(bool cond) {
if (cond) {
bar();
}
}
One implementation uses libclang, which is the C Interface to Clang.
To build:
git clone [email protected]:decodable/called_if.git
cd called_if/lib-clang
mkdir build
cd build
cmake ..
make
One implementation as a clang tool.
To build:
git clone [email protected]:decodable/called_if.git
cd called_if/clang-tools/called_if
docker build .
Compiled and tested in the docker clang_dev.