generate_callgraph.sh 443 B

1234567891011121314
  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. echo $fn
  9. clang $CFLAGS -S -emit-llvm -fno-inline -o - $fn | \
  10. opt -analyze -print-callgraph >/dev/null 2> "callgraph/${fn}allgraph"
  11. done