diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-09-04 00:15:13 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-09-04 00:15:13 -0700 |
commit | 30cc97c85c1579de20d682d830349504230356bb (patch) | |
tree | 724847d3543ffbaa7b3c5e72fbae3b594c693e18 | |
parent | 7a7ab766e560b812de639c772e1d1d43ad847157 (diff) |
stubs for lifecycle intrinsics, and do not generate calls to stubs
-rw-r--r-- | src/jsifier.js | 1 | ||||
-rw-r--r-- | src/library.js | 5 | ||||
-rw-r--r-- | src/modules.js | 5 | ||||
-rw-r--r-- | tests/runner.py | 2 |
4 files changed, 10 insertions, 3 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index f20bd680..8dac45e5 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -832,6 +832,7 @@ function JSify(data, functionsOnly, givenFunctions, givenGlobalVariables) { } makeFuncLineActor('getelementptr', function(item) { return finalizeLLVMFunctionCall(item) }); makeFuncLineActor('call', function(item) { + if (LibraryManager.isStubFunction(item.ident)) return ';'; return makeFunctionCall(item.ident, item.params, item.funcData) + (item.standalone ? ';' : ''); }); diff --git a/src/library.js b/src/library.js index 529a5d3f..05f59290 100644 --- a/src/library.js +++ b/src/library.js @@ -4047,9 +4047,12 @@ LibraryManager.library = { }, llvm_expect_i32: function(x, y) { - return x == y; + return x == y; // TODO: inline this }, + llvm_lifetime_start: function() {}, + llvm_lifetime_end: function() {}, + // ========================================================================== // iostream.h // ========================================================================== diff --git a/src/modules.js b/src/modules.js index f83e3ce3..70499bcc 100644 --- a/src/modules.js +++ b/src/modules.js @@ -269,6 +269,11 @@ var LibraryManager = { ret = LibraryManager.library[ret]; } return last; + }, + + isStubFunction: function(ident) { + var libCall = LibraryManager.library[ident.substr(1)]; + return typeof libCall === 'function' && libCall.toString().replace(/\s/g, '') === 'function(){}'; } }; diff --git a/tests/runner.py b/tests/runner.py index 4dca5f63..19e703f1 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -2925,8 +2925,6 @@ if 'benchmark' not in str(sys.argv): self.do_test(path_from_root('tests', 'gl'), '*?*', main_file='sdl_ogl.c', post_build=post) def test_libcxx(self): - return self.skip('Fails to run llvm-as due to llvm bug 10850') - self.do_test(path_from_root('tests', 'libcxx'), 'june -> 30\nPrevious (in alphabetical order) is july\nNext (in alphabetical order) is march', main_file='main.cpp', additional_files=['hash.cpp']) |