aboutsummaryrefslogtreecommitdiff
path: root/tools/find_bigfuncs.py
blob: ebff8b6ea942fe937675c62391903325c6cbb68f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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