diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-03-25 14:13:53 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-03-25 14:13:53 -0700 |
commit | 74acbe73a850d25022e54cbe1c2d4adb6c9223fa (patch) | |
tree | 43e5512afac3726152afcbf44d6f5d5a96e319dc | |
parent | f86c81b9cd775a62dac77dfe70371de3daf3ede1 (diff) |
--llvm-lto option to disable lto
-rwxr-xr-x | emcc | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -174,6 +174,12 @@ Options that are modified or new in %s include: 2: -O2 LLVM optimizations 3: -O3 LLVM optimizations (default in -O2+) + --llvm-lto <level> 0: No LLVM LTO (default in -O0) + 1: LLVM LTO (default in -O1+) + Note: If LLVM optimizations are not run + (see --llvm-opts), setting this to 1 has no + effect. + --closure <on> 0: No closure compiler (default in -O0, -O1) 1: Run closure compiler (default in -O2, -O3) @@ -401,6 +407,7 @@ try: opt_level = 0 llvm_opts = None + llvm_lto = None closure = None js_transform = None pre_js = None @@ -427,6 +434,11 @@ try: llvm_opts = eval(newargs[i+1]) newargs[i] = '' newargs[i+1] = '' + elif newargs[i].startswith('--llvm-lto'): + check_bad_eq(newargs[i]) + llvm_lto = eval(newargs[i+1]) + newargs[i] = '' + newargs[i+1] = '' elif newargs[i].startswith('--closure'): check_bad_eq(newargs[i]) closure = int(newargs[i+1]) @@ -491,6 +503,7 @@ try: newargs = [ arg for arg in newargs if arg is not '' ] if llvm_opts is None: llvm_opts = LLVM_OPT_LEVEL[opt_level] + if llvm_lto is None: llvm_lto = llvm_opts > 0 if closure is None: closure = 1 if opt_level >= 2 else 0 if minify_whitespace is None: minify_whitespace = closure # if closure is run, minify whitespace @@ -776,7 +789,7 @@ try: 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 shared.Building.can_use_unsafe_opts() and shared.Building.can_build_standalone(): + if llvm_lto and shared.Building.can_use_unsafe_opts() and shared.Building.can_build_standalone(): lto_opts = [] if not shared.Building.can_inline(): lto_opts.append('-disable-inlining') lto_opts.append('-std-link-opts') |