aboutsummaryrefslogtreecommitdiff
path: root/tools/scan_ll.py
blob: d7d420577970559c99adeeccd2908c27f3702d8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
'''
Finds why an .ll file is large by printing functions by size
'''

import os, sys

funcs = []
i = 0
for line in open(sys.argv[1]):
  i += 1
  if line.startswith('define '):
    inside = line.replace('define ', '').replace('\n', '')
    start = i
  elif line.startswith('}'):
    funcs.append((inside, i-start))

print '\n'.join(map(lambda func: str(func[1]) + ':' + func[0], sorted(funcs, key=lambda func: -func[1])))