diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-04-22 17:59:13 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-04-22 17:59:13 -0700 |
commit | 29a9d8b2c5d5032ef6c980b5256982f66ac23d5b (patch) | |
tree | 11399568835ddf3b7949c99d47341a836242b9a0 | |
parent | f6f4ccf638f3e97bf370a4005cb783d8c7208b34 (diff) |
big function finder tool
-rw-r--r-- | tools/find_bigfuncs.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tools/find_bigfuncs.py b/tools/find_bigfuncs.py new file mode 100644 index 00000000..ebff8b6e --- /dev/null +++ b/tools/find_bigfuncs.py @@ -0,0 +1,23 @@ +''' +Simple tool to find big functions in an .ll file. Anything over i64 is of interest. +''' + +import os, sys, re + +filename = sys.argv[1] +i = 0 +maxx = -1 +maxxest = '?' +start = -1 +curr = '?' +for line in open(filename): + i += 1 + if line.startswith('function '): + start = i + curr = line + elif line.startswith('}'): + size = i - start + if size > maxx: + maxx = size + maxxest = curr +print maxx, 'lines in', maxxest |