Call Graph - Twiggy🌱 (original) (raw)
- Introduction
- 1. 📦 Install
- 2. 💡 Concepts
- 3. 🏋️♀️ Usage
- 4. 🔎 Supported Binary Formats
- 5. 🙌 Contributing to Twiggy
Twiggy🌱
Call Graph
Consider the following functions:
#![allow(unused)]
fn main() {
pub fn shred() {
gnar_gnar();
bluebird();
}
fn gnar_gnar() {
weather_report();
pow();
}
fn bluebird() {
weather_report();
}
fn weather_report() {
shred();
}
fn pow() {
fluffy();
soft();
}
fn fluffy() {}
fn soft() {}
pub fn baker() {
hood();
}
fn hood() {}
}
If we treat every function as a vertex in a graph, and if we add an edge_from A to B if function A calls function B, then we get the following_call graph: