aboutsummaryrefslogtreecommitdiff
path: root/emcc
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-06-26 21:11:49 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-06-26 21:11:49 -0700
commit317f89f548695a00f63857b50b10d325f2db80c8 (patch)
tree0064902314e3c02cdbd28663e49be60a2e96f7e7 /emcc
parent9c746ac5b31b46a2cf5f4f45d44838455955036b (diff)
fix bug when optimizing renamed input files in emcc
Diffstat (limited to 'emcc')
-rwxr-xr-xemcc19
1 files changed, 11 insertions, 8 deletions
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: