diff options
Diffstat (limited to 'tools/find_bigfuncs.py')
-rw-r--r-- | tools/find_bigfuncs.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tools/find_bigfuncs.py b/tools/find_bigfuncs.py index ebff8b6e..6fdec3a9 100644 --- a/tools/find_bigfuncs.py +++ b/tools/find_bigfuncs.py @@ -1,23 +1,23 @@ ''' -Simple tool to find big functions in an .ll file. Anything over i64 is of interest. +Simple tool to find big functions in an .ll file. ''' import os, sys, re filename = sys.argv[1] i = 0 -maxx = -1 -maxxest = '?' start = -1 -curr = '?' +curr = None +data = [] for line in open(filename): i += 1 if line.startswith('function '): start = i curr = line - elif line.startswith('}'): + elif line.startswith('}') and curr: size = i - start - if size > maxx: - maxx = size - maxxest = curr -print maxx, 'lines in', maxxest + data.append([curr, size]) + curr = None +data.sort(lambda x, y: x[1] - y[1]) +print ''.join(['%6d : %s' % (x[1], x[0]) for x in data]) + |