From 317f89f548695a00f63857b50b10d325f2db80c8 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 26 Jun 2013 21:11:49 -0700 Subject: fix bug when optimizing renamed input files in emcc --- emcc | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'emcc') diff --git a/emcc b/emcc index af743e47..6e1e9e50 100755 --- a/emcc +++ b/emcc @@ -1096,14 +1096,17 @@ try: shared.Building.llvm_as(input_file, temp_file) temp_files.append(temp_file) - if not LEAVE_INPUTS_RAW: assert len(temp_files) == len(input_files) - - # Optimize source files - if llvm_opts > 0: - for input_file in input_files: - if input_file.endswith(SOURCE_SUFFIXES): - logging.debug('optimizing %s with -O%d' % (input_file, llvm_opts)) - shared.Building.llvm_opt(in_temp(unsuffixed(uniquename(input_file)) + '.o'), llvm_opts) + if not LEAVE_INPUTS_RAW: + assert len(temp_files) == len(input_files) + + # Optimize source files + if llvm_opts > 0: + for i in range(len(input_files)): + input_file = input_files[i] + if input_files[i].endswith(SOURCE_SUFFIXES): + temp_file = temp_files[i] + logging.debug('optimizing %s with -O%d' % (input_file, llvm_opts)) + shared.Building.llvm_opt(temp_file, llvm_opts) # If we were just asked to generate bitcode, stop there if final_suffix not in JS_CONTAINING_SUFFIXES: -- cgit v1.2.3-18-g5258