~ubuntu-branches/ubuntu/vivid/emscripten/vivid

« back to all changes in this revision

Viewing changes to tools/find_bigfuncs.py

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2013-05-02 13:11:51 UTC
  • Revision ID: package-import@ubuntu.com-20130502131151-q8dvteqr1ef2x7xz
Tags: upstream-1.4.1~20130504~adb56cb
ImportĀ upstreamĀ versionĀ 1.4.1~20130504~adb56cb

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
'''
 
2
Simple tool to find big functions in an .ll file. Anything over i64 is of interest.
 
3
'''
 
4
 
 
5
import os, sys, re
 
6
 
 
7
filename = sys.argv[1]
 
8
i = 0
 
9
maxx = -1
 
10
maxxest = '?'
 
11
start = -1
 
12
curr = '?'
 
13
for line in open(filename):
 
14
  i += 1
 
15
  if line.startswith('function '):
 
16
    start = i
 
17
    curr = line
 
18
  elif line.startswith('}'):
 
19
    size = i - start
 
20
    if size > maxx:
 
21
      maxx = size
 
22
      maxxest = curr
 
23
print maxx, 'lines in', maxxest