aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Gohman <sunfish@google.com>2014-02-09 11:42:49 -0800
committerDan Gohman <sunfish@google.com>2014-02-10 16:40:31 -0800
commit6342cd7fbcc63e544b4e7a3e7602a3a44e162385 (patch)
tree9f5eb3c69520635edffb9e34c1fa5c66963f5cb9
parent72c1b9a2f9c355515fb98993c2cb25db3c0a25d6 (diff)
Use -mllvm -disable-llvm-optzns.
The -O options affect the clang front-end in a variety of ways, so allow them to be passed through to clang. To disable just the optimization passes, use -mllvm -disable-llvm-optzns.
-rwxr-xr-xemcc6
1 files changed, 5 insertions, 1 deletions
diff --git a/emcc b/emcc
index 7686e818..854a04d4 100755
--- a/emcc
+++ b/emcc
@@ -853,7 +853,11 @@ try:
requested_level = 2
settings_changes.append('INLINING_LIMIT=50')
opt_level = validate_arg_level(requested_level, 3, 'Invalid optimization level: ' + newargs[i])
- newargs[i] = ''
+ # We leave the -O option in place so that the clang front-end runs in that
+ # optimization mode, but we disable the actual optimization passes, as we'll
+ # run them seperately.
+ newargs.append('-mllvm')
+ newargs.append('-disable-llvm-optzns');
elif newargs[i].startswith('--js-opts'):
check_bad_eq(newargs[i])
js_opts = eval(newargs[i+1])