diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-12-24 20:49:27 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-12-24 20:49:27 -0800 |
commit | cbf61df3d0542f5ee91e93835cc8e9cc87446035 (patch) | |
tree | 68d4872dcc8563e8ee948525f4cab1823adc7c61 | |
parent | 86eb2f8e1ece2370a74e0d6984b048d6beedb150 (diff) |
move llvm opt debug messages
-rwxr-xr-x | emcc | 2 | ||||
-rw-r--r-- | tools/shared.py | 1 |
2 files changed, 1 insertions, 2 deletions
@@ -1050,7 +1050,6 @@ try: if not LEAVE_INPUTS_RAW: link_opts = [] if keep_debug else ['-strip-debug'] if llvm_opts > 0: - 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) @@ -1063,7 +1062,6 @@ try: else: # At minimum remove dead functions etc., this potentially saves a lot in the size of the generated code (and the time to compile it) link_opts += shared.Building.get_safe_internalize() + ['-globaldce'] - if DEBUG: print >> sys.stderr, 'emcc: LLVM linktime:', link_opts shared.Building.llvm_opt(in_temp(target_basename + '.bc'), link_opts) if DEBUG: save_intermediate('linktime', 'bc') diff --git a/tools/shared.py b/tools/shared.py index 8c0583f6..780e0057 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -819,6 +819,7 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)''' % { 'winfix': '' if not WINDOWS e def llvm_opt(filename, opts): if type(opts) is int: opts = Building.pick_llvm_opts(opts) + if DEBUG: print >> sys.stderr, 'emcc: LLVM opts:', opts output = Popen([LLVM_OPT, filename] + opts + ['-o=' + filename + '.opt.bc'], stdout=PIPE).communicate()[0] assert os.path.exists(filename + '.opt.bc'), 'Failed to run llvm optimizations: ' + output shutil.move(filename + '.opt.bc', filename) |