diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/find_bigfuncs.py | 23 | ||||
-rw-r--r-- | tools/shared.py | 4 |
2 files changed, 25 insertions, 2 deletions
diff --git a/tools/find_bigfuncs.py b/tools/find_bigfuncs.py new file mode 100644 index 00000000..ebff8b6e --- /dev/null +++ b/tools/find_bigfuncs.py @@ -0,0 +1,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 diff --git a/tools/shared.py b/tools/shared.py index 9010b6e2..33b0273e 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -111,7 +111,7 @@ else: config_file = config_file.replace('{{{ EMSCRIPTEN_ROOT }}}', __rootpath__) llvm_root = '/usr/bin' try: - llvm_root = os.path.dirname(Popen(['which', 'clang'], stdout=PIPE).communicate()[0].replace('\n', '')) + llvm_root = os.path.dirname(Popen(['which', 'llvm-dis'], stdout=PIPE).communicate()[0].replace('\n', '')) except: pass config_file = config_file.replace('{{{ LLVM_ROOT }}}', llvm_root) @@ -401,7 +401,7 @@ except: # Force a simple, standard target as much as possible: target 32-bit linux, and disable various flags that hint at other platforms COMPILER_OPTS = COMPILER_OPTS + ['-m32', '-U__i386__', '-U__i386', '-Ui386', '-U__SSE__', '-U__SSE_MATH__', '-U__SSE2__', '-U__SSE2_MATH__', '-U__MMX__', - '-DEMSCRIPTEN', '-U__STRICT_ANSI__', + '-DEMSCRIPTEN', '-D__EMSCRIPTEN__', '-U__STRICT_ANSI__', '-target', 'i386-pc-linux-gnu', '-D__IEEE_LITTLE_ENDIAN', '-fno-math-errno'] USE_EMSDK = not os.environ.get('EMMAKEN_NO_SDK') |