Revision 84f01eb74ec336f97645ddeb2315a08b737cfd6b authored by Dan Gohman on 04 March 2014, 08:09:11 UTC, committed by Dan Gohman on 04 March 2014, 08:09:11 UTC
1 parent a7f7be8
Raw File
scan_ll.py
'''
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])))

back to top