Skip to content

Commit

Permalink
move llvm opt debug messages
Browse files Browse the repository at this point in the history
  • Loading branch information
kripken committed Dec 25, 2012
1 parent 86eb2f8 commit cbf61df
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 0 additions & 2 deletions emcc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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')

Expand Down
1 change: 1 addition & 0 deletions tools/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,7 @@ def ll_opts(filename):
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)
Expand Down

0 comments on commit cbf61df

Please sign in to comment.