aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/find_bigfuncs.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/tools/find_bigfuncs.py b/tools/find_bigfuncs.py
index ebff8b6e..31825544 100644
--- a/tools/find_bigfuncs.py
+++ b/tools/find_bigfuncs.py
@@ -1,15 +1,14 @@
'''
-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 = '?'
+data = []
for line in open(filename):
i += 1
if line.startswith('function '):
@@ -17,7 +16,7 @@ for line in open(filename):
curr = line
elif line.startswith('}'):
size = i - start
- if size > maxx:
- maxx = size
- maxxest = curr
-print maxx, 'lines in', maxxest
+ data.append([curr, size]);
+data.sort(lambda x, y: x[1] - y[1])
+print ''.join(['%6d : %s' % (x[1], x[0]) for x in data])
+