diff options
Diffstat (limited to 'emcc')
-rwxr-xr-x | emcc | 26 |
1 files changed, 13 insertions, 13 deletions
@@ -117,7 +117,10 @@ Options that are modified or new in %s include: optimizations, and no runtime assertions or C++ exception catching (to re-enable C++ exception catching, use - -s DISABLE_EXCEPTION_CATCHING=0 ) + -s DISABLE_EXCEPTION_CATCHING=0 ). + Note: Optimizations are only done when + compiling to JavaScript, not to intermediate + bitcode. -O2 As -O1, plus the relooper (loop recreation), plus closure compiler advanced opts Warning: Compiling with this takes a long time! @@ -397,18 +400,10 @@ try: if DEBUG: print >> sys.stderr, 'emcc: assembling assembly file: ', input_file shared.Building.llvm_as(input_file, in_temp(unsuffixed_basename(input_file) + '.o')) - # Optimize, if asked to - if llvm_opt_level > 0 and not LEAVE_INPUTS_RAW: - if DEBUG: print >> sys.stderr, 'emcc: LLVM opts' - for input_file in input_files: - try: - shared.Building.llvm_opt(in_temp(unsuffixed_basename(input_file) + '.o'), LLVM_INTERNAL_OPT_LEVEL, safe=llvm_opt_level < 2) - except: - # This might be an invalid input, which will get ignored during linking later anyhow - print >> sys.stderr, 'emcc: warning: LLVM opt failed to run on %s, continuing without optimization' % input_file - # If we were just asked to generate bitcode, stop there if final_suffix not in ['js', 'html']: + if llvm_opt_level > 0: + print >> sys.stderr, 'emcc: warning: -Ox flags ignored, since not generating JavaScript' if not specified_target: for input_file in input_files: shutil.move(in_temp(unsuffixed_basename(input_file) + '.o'), unsuffixed_basename(input_file) + '.' + final_suffix) @@ -428,7 +423,7 @@ try: ## Continue on to create JavaScript - if DEBUG: print >> sys.stderr, 'emcc: generating JavaScript' + if DEBUG: print >> sys.stderr, 'emcc: will generate JavaScript' extra_files_to_link = [] @@ -473,10 +468,15 @@ try: if not LEAVE_INPUTS_RAW: shutil.move(in_temp(unsuffixed_basename(input_files[0]) + '.o'), in_temp(target_basename + '.bc')) + # Optimize, if asked to + if llvm_opt_level > 0 and not LEAVE_INPUTS_RAW: + if DEBUG: print >> sys.stderr, 'emcc: LLVM opts' + shared.Building.llvm_opt(in_temp(target_basename + '.bc'), LLVM_INTERNAL_OPT_LEVEL, safe=llvm_opt_level < 2) + # Emscripten try: if shared.Settings.RELOOP: - print >> sys.stderr, 'Warning: The relooper optimization can be very slow.' + print >> sys.stderr, 'emcc: warning: The relooper optimization can be very slow.' except: pass |