generate_callgraph.sh 421 B

12345678910111213
  1. #!/bin/sh
  2. C_FILES=`echo src/common/*.c src/or/*.c src/tools/*.c`
  3. CFLAGS="-Isrc/ext/trunnel -Isrc/trunnel -I. -Isrc/ext -Isrc/common -DLOCALSTATEDIR=\"\" -DSHARE_DATADIR=\"\" -Dinline="
  4. mkdir -p callgraph/src/common
  5. mkdir -p callgraph/src/or
  6. mkdir -p callgraph/src/tools
  7. for fn in $C_FILES; do
  8. clang $CFLAGS -S -emit-llvm -fno-inline -o - $fn | \
  9. opt -analyze -print-callgraph 2> "callgraph/${fn}allgraph"
  10. done