This project was deprecated, please go to Drafter
clang-mapper
is a standalone tool build for automatic generate Call Graph in iOS project
You can just use the pre-compiled binary file in the relaese
folder (Build with Clang5.0.0). Or you can compile the source code in clang-mapper
folder by yourself
Follow the guide in Tutorial for building tools using LibTooling and LibASTMatchers.
- Download the
LLVM
andClang
source code, then copy the folderclang-mapper
tollvm/tools/clang/tools/
. - Edit the file
llvm/tools/clang/tools/CMakeLists.txt
and addadd_clang_subdirectory(clang-mapper)
to the end. - Then build it with cmake and you will get a binary file
clang-mapper
in thebin
folder, now copy it to/usr/local/bin/
Before you use clang-mapper
, make sure you have installed Graphviz
.
clang-mapper
accept an arbitrary number of file or folder arguments, then it wil automatically deal with all code files and generate Call Graph in current path.
For example, i make a folder CallGraph in the same path as AFNetworking
$ mkdir CallGraph
Then run command in CallGraph folder
$ cd CallGraph
$ clang-mapper ../AFNetworking --
The clang-mapper
will traverse the ../AFNetworking folder and generate all Call Graph in CallGraph folder
- -graph-only : Only generate .png files, this is a default option
- -dot-only : Only generate .dot files
- -dot-graph : Generate both .png and .dot files
- -ignore-header : Ignore .h file in the given folder