diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-01-31 19:09:32 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-01-31 19:09:32 -0800 |
commit | 1204c42f4f7f5b5658fce74e0e29e0f09ca44029 (patch) | |
tree | d57a7991baea412aebfb3bb354808c7ca1d6cf09 /emcc | |
parent | 88c3f163048d7f9107f314c98fc94abc9271d641 (diff) |
fix usage of llvm opt level in emcc, and test_emcc fixes
Diffstat (limited to 'emcc')
-rwxr-xr-x | emcc | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -153,8 +153,10 @@ Options that are modified or new in %s include: --typed-arrays <mode> 0: No typed arrays 1: Parallel typed arrays 2: Shared (C-like) typed arrays (default) - --llvm-opts <on> 0: No LLVM optimizations (default in -O0) - 1: LLVM optimizations (default in -O1 +) + --llvm-opts <level> 0: No LLVM optimizations (default in -O0) + 1: -O1 LLVM optimizations (default in -O1) + 2: -O2 LLVM optimizations + 3: -O3 LLVM optimizations (default in -O2+) --closure <on> 0: No closure compiler (default in -O0, -O1) 1: Run closure compiler (default in -O2, -O3) --js-transform <cmd> <cmd> will be called on the generated code @@ -348,7 +350,7 @@ try: newargs[i+1] = '' newargs = [ arg for arg in newargs if arg is not '' ] - if llvm_opts is None: llvm_opts = 1 if opt_level >= 1 else 0 + if llvm_opts is None: llvm_opts = LLVM_OPT_LEVEL[opt_level] if closure is None: closure = 1 if opt_level >= 2 else 0 if compress_whitespace is None: compress_whitespace = closure # if closure is run, compress whitespace @@ -561,9 +563,9 @@ try: if not LEAVE_INPUTS_RAW: save_intermediate('basebc', 'bc') # Optimize, if asked to - if llvm_opts > 0 and opt_level > 0 and not LEAVE_INPUTS_RAW: - if DEBUG: print >> sys.stderr, 'emcc: LLVM -O%d' % LLVM_OPT_LEVEL[opt_level] - shared.Building.llvm_opt(in_temp(target_basename + '.bc'), LLVM_OPT_LEVEL[opt_level]) + if llvm_opts > 0 and not LEAVE_INPUTS_RAW: + if DEBUG: print >> sys.stderr, 'emcc: LLVM -O%d' % llvm_opts + shared.Building.llvm_opt(in_temp(target_basename + '.bc'), llvm_opts) if DEBUG: save_intermediate('opt', 'bc') # Do LTO in a separate pass to work around LLVM bug XXX (see failure e.g. in cubescript) if not shared.Settings.BUILD_AS_SHARED_LIB and not shared.Settings.LINKABLE: |