All Projects → Vermeille → Clang Callgraph

Vermeille / Clang Callgraph

Licence: apache-2.0
A tool based on clang which generates a call graph from a given C++ codebase

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Clang Callgraph

Pfr
std::tuple like methods for user defined types without any macro or boilerplate code
Stars: ✭ 896 (+1278.46%)
Mutual labels:  clang
Xcodecompilationdatabase
Generate a Compilation Database from Xcode's build log - nothing more :).
Stars: ✭ 28 (-56.92%)
Mutual labels:  clang
Cxxctp
DEPRECATED. USE INSTEAD github.com/blockspacer/flextool
Stars: ✭ 58 (-10.77%)
Mutual labels:  clang
Woboq codebrowser
Woboq CodeBrowser
Stars: ✭ 837 (+1187.69%)
Mutual labels:  clang
Irony Mode
A C/C++ minor mode for Emacs powered by libclang
Stars: ✭ 851 (+1209.23%)
Mutual labels:  clang
Kfr
Fast, modern C++ DSP framework, FFT, Sample Rate Conversion, FIR/IIR/Biquad Filters (SSE, AVX, AVX-512, ARM NEON)
Stars: ✭ 985 (+1415.38%)
Mutual labels:  clang
Fib
Performance Benchmark of top Github languages
Stars: ✭ 694 (+967.69%)
Mutual labels:  clang
Optviewer Demo
Demonstration of LLVM's opt-viewer tool
Stars: ✭ 63 (-3.08%)
Mutual labels:  clang
Directxmath
DirectXMath is an all inline SIMD C++ linear algebra library for use in games and graphics apps
Stars: ✭ 859 (+1221.54%)
Mutual labels:  clang
Llvm 9.0 Learner Tutorial
A blog for LLVM(v9.0.0 or v11.0.0) beginner, step by step, with detailed documents and comments. Record the way I learn LLVM and accomplish a complete project for FPGA High-Level Synthesis with it.
Stars: ✭ 58 (-10.77%)
Mutual labels:  clang
Vim Clang Format
Vim plugin for clang-format, a formatter for C, C++, Obj-C, Java, JavaScript, TypeScript and ProtoBuf.
Stars: ✭ 837 (+1187.69%)
Mutual labels:  clang
Clif
Binding generator to wrap C++ for Python using LLVM.
Stars: ✭ 845 (+1200%)
Mutual labels:  clang
Antara Gaming Sdk
Komodo Gaming Software Development Kit
Stars: ✭ 51 (-21.54%)
Mutual labels:  clang
Cxxhttp
Asynchronous, Header-only C++ HTTP-over-(TCP|UNIX Socket|STDIO) Library
Stars: ✭ 24 (-63.08%)
Mutual labels:  clang
Zapcc
zapcc is a caching C++ compiler based on clang, designed to perform faster compilations
Stars: ✭ 1,109 (+1606.15%)
Mutual labels:  clang
Croaring
Roaring bitmaps in C (and C++)
Stars: ✭ 735 (+1030.77%)
Mutual labels:  clang
Pyc Cfg
Pyc-cfg is a pure python control flow graph builder for almost all Ansi C programming language.
Stars: ✭ 29 (-55.38%)
Mutual labels:  clang
Avalonstudio
Cross platform IDE and Shell
Stars: ✭ 1,132 (+1641.54%)
Mutual labels:  clang
Clang Blueprint
🏰 Example C++11 CMake project that incorporates awesome Clang tooling 🐉
Stars: ✭ 63 (-3.08%)
Mutual labels:  clang
C2goasm
C to Go Assembly
Stars: ✭ 1,072 (+1549.23%)
Mutual labels:  clang

clang-callgraph

A tool based on clang which generates a call graph from a given C++ codebase.

Usage

./clang-callgraph.py file.cpp|compile_commands.json [options] [extra clang args...]

Understood options are:

  • -x name1,name2: a comma separated list of excluded prefixes, like std::,boost::. All symbols starting with one of those will be hidden in the callgraph.
  • -p path1,path2: a comma separated list of excluded prefixes, like /usr. All symbols defined or used in files whose name starts with of those will be hidden in the callgraph.

The easiest way to generate the file compile_commands.json for any make based compilation chain is to use Bear and recompile with bear make.

When running the python script, after parsing all the codebase, you are prompted to type in the function's name for which you wan to obtain the callgraph

Example

$ bear make
<output omitted>
$ clang-callgraph.py compile_commands.json -p /usr/lib/llvm-3.8/lib/clang/3.8.0/include/
reading source files...
/home/vermeille/CPAsim/src/module.cpp
/home/vermeille/CPAsim/src/module/modulevalues.cpp
/home/vermeille/CPAsim/src/main.cpp
/home/vermeille/CPAsim/src/parser.cpp
> main
matching:
main(int, char **)
> main(int, char **)
main(int, char **)
  Parser::ParseModuleDef(std::istream &)
    Parser::EatWord(std::istream &, const std::string &)
      Parser::FuckSpaces(std::istream &)
      Parser::EatChar(std::istream &, char)
    Parser::ParseWord(std::istream &)
      Parser::FuckSpaces(std::istream &)
    Module::Module(const std::string &)
    Parser::FuckSpaces(std::istream &)
    Parser::EatChar(std::istream &, char)
    Parser::FuckSpaces(std::istream &)
    Parser::EatChar(std::istream &, char)
    Module::AddInput(std::unique_ptr<WireDecl>)
      WireDecl::name()
      WireDecl::name()
      WireDecl::name()
    Parser::ParseWireDecl(std::istream &)
      Parser::ParseWord(std::istream &)
      Parser::FuckSpaces(std::istream &)
      Parser::EatChar(std::istream &, char)
      Parser::FuckSpaces(std::istream &)
      Parser::ParseDecimalInt(std::istream &)
        Parser::FuckSpaces(std::istream &)
      Parser::FuckSpaces(std::istream &)
      Parser::EatChar(std::istream &, char)
      Parser::FuckSpaces(std::istream &)
      WireDecl::WireDecl(const std::string &, int)
$ clang-callgraph.py compile_commands.json -x Parser:: -p /usr/lib/llvm-3.8/lib/clang/3.8.0/include/
reading source files...
/home/vermeille/CPAsim/src/module.cpp
/home/vermeille/CPAsim/src/module/modulevalues.cpp
/home/vermeille/CPAsim/src/main.cpp
/home/vermeille/CPAsim/src/parser.cpp
> main(int, char **)
main(int, char **)
  Module::BindUsagesToDef()
    Module::BindUsagesToDef_Rec(Expr *)
      Module::BindUsagesToDef_Rec(Expr *)
        Module::BindUsagesToDef_Rec(Expr *)
        Binop::lhs()
        Module::BindUsagesToDef_Rec(Expr *)
        Binop::rhs()
        Module::BindUsagesToDef_Rec(Expr *)
        Not::rhs()
        WireUsage::name()
        WireUsage::name()
        WireUsage::SetDeclRef(WireDecl *)
        WireUsage::IsUseValid()
          WireDecl::size()
          WireDecl::size()
          WireDecl::size()
        WireUsage::name()
        WireUsage::index()
        WireUsage::index()
        WireDecl::size()
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].