Document callgraph analysis code
[tor.git] / scripts / maint / generate_callgraph.sh
blobc6b33c0aea21dc014c83e980e62aed641d8eae54
1 #!/bin/sh
3 C_FILES=`echo src/common/*.c src/or/*.c src/tools/*.c`
4 CFLAGS="-Isrc/ext/trunnel -Isrc/trunnel -I. -Isrc/ext -Isrc/common -DLOCALSTATEDIR=\"\" -DSHARE_DATADIR=\"\" -Dinline="
6 mkdir -p callgraph/src/common
7 mkdir -p callgraph/src/or
8 mkdir -p callgraph/src/tools
10 for fn in $C_FILES; do
11 echo $fn
12 clang $CFLAGS -S -emit-llvm -fno-inline -o - $fn | \
13 opt -analyze -print-callgraph >/dev/null 2> "callgraph/${fn}allgraph"
14 done