Create a call graph for a file with clang
Is there a way to create a call graph with clang that can reasonably fit on a page? i.e. given: #include<iostream> using namespace std; int main() { int a; cin>>a; cout<<a; cout<<a; return 0; } I current get by using: $ clang++ main.cpp -S -emit-llvm -o - | opt -analyze -std-link-opts -dot-callgraph $ cat callgraph.dot | c++filt | sed 's,>,\\>,g; s,-\\>,->,g; s,<,\\<,g' | gawk '/external node/{id=$1}$1!=id' | dot -Tpng -ocallgraph.png (which seems like a lot of effort to do something that I would not have expected to be so difficult). I would like to get something that is a bit more reasonable