A clang tool to extract methods/functions boundaries from source files. Support c/c++/objc/objc++.
$ clang-pudge -p <build_path> -output-file <output_json_file> <source0> ...
The output JSON format is as below:
{
<file_path>: [
{
"name": <mangled_name>,
"start": <fucntion_start_line_number>,
"end": <function_end_line_number>
},
...
]
}
- Clone
llvm-project
from https://github.com/llvm/llvm-project, or you can choose apple fork version or other fork. - Create a directory named
clang-pudge
underclang/clang-tools-extra
. - Add new line
add_subdirectory(clang-pudge)
toclang-tools-extra/CMakeLists.txt
. - Follow Getting Started with LLVM to build, or you can refer to this guide