aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-02-10 21:11:01 -0800
committerAlon Zakai <alonzakai@gmail.com>2014-02-10 21:11:01 -0800
commitf1bba83e5e8233fe7424e0f7a33d8feda78c8894 (patch)
tree905706abf95e5c938fbc49b097dc8fc5c07e2605
parent99634e23408315efe0633cd1917794081f4ec4ba (diff)
parentbf2ff7290aa65659e9e3ec7fd48e818f98b82832 (diff)
Merge pull request #2091 from sunfishcode/incoming
Use -mllvm -disable-llvm-optzns.
-rwxr-xr-xemcc6
-rw-r--r--tests/test_core.py5
-rw-r--r--tools/js-optimizer.js2
3 files changed, 9 insertions, 4 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])
diff --git a/tests/test_core.py b/tests/test_core.py
index 70f12c7a..b9b617db 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -4720,7 +4720,7 @@ return malloc(size);
def test_gcc_unmangler(self):
if os.environ.get('EMCC_FAST_COMPILER') != '1': Settings.NAMED_GLOBALS = 1 # test coverage for this; fastcomp never names globals
- Building.COMPILER_TEST_OPTS += ['-I' + path_from_root('third_party')]
+ Building.COMPILER_TEST_OPTS += ['-I' + path_from_root('third_party'), '-Wno-warn-absolute-paths']
self.do_run(open(path_from_root('third_party', 'gcc_demangler.c')).read(), '*d_demangle(char const*, int, unsigned int*)*', args=['_ZL10d_demanglePKciPj'])
@@ -4909,6 +4909,7 @@ def process(filename):
Building.COMPILER_TEST_OPTS += [
'-I' + path_from_root('tests', 'freetype', 'include'),
'-I' + path_from_root('tests', 'poppler', 'include'),
+ '-Wno-warn-absolute-paths'
]
Settings.INVOKE_RUN = 0 # We append code that does run() ourselves
@@ -5164,7 +5165,7 @@ def process(filename):
def test_fuzz(self):
if Settings.USE_TYPED_ARRAYS != 2: return self.skip('needs ta2')
- Building.COMPILER_TEST_OPTS += ['-I' + path_from_root('tests', 'fuzz')]
+ Building.COMPILER_TEST_OPTS += ['-I' + path_from_root('tests', 'fuzz'), '-Wno-warn-absolute-paths']
def run_all(x):
print x
diff --git a/tools/js-optimizer.js b/tools/js-optimizer.js
index fc8b0561..f9be66df 100644
--- a/tools/js-optimizer.js
+++ b/tools/js-optimizer.js
@@ -5127,7 +5127,7 @@ function fixDotZero(js) {
function asmLastOpts(ast) {
traverseGeneratedFunctions(ast, function(fun) {
traverse(fun, function(node, type) {
- if (type === 'while' && node[1][0] === 'num' && node[1][1] === 1 && node[2][0] === 'block') {
+ if (type === 'while' && node[1][0] === 'num' && node[1][1] === 1 && node[2][0] === 'block' && node[2].length == 2) {
// This is at the end of the pipeline, we can assume all other optimizations are done, and we modify loops
// into shapes that might confuse other passes