diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-12-15 15:38:26 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-12-15 17:07:31 -0800 |
commit | 6259358a5a125b64a90651ab1ee535e919339b68 (patch) | |
tree | cbc28b6b1abba72c488531eeb2269f437b14fbd4 /src/jsifier.js | |
parent | ad34dff9ae485eafab64d68a61a193f82f3b1988 (diff) |
rewrite variable analysis code. eliminate unused variables without side effects, and improve nativization logic.
Diffstat (limited to 'src/jsifier.js')
-rw-r--r-- | src/jsifier.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index 98460492..0f90ade1 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -706,6 +706,9 @@ function JSify(data, functionsOnly, givenFunctions) { } }); } + makeFuncLineActor('noop', function(item) { + return ';'; + }); makeFuncLineActor('var', function(item) { // assigns into phis become simple vars when MICRO_OPTS return 'var ' + item.ident + ';'; }); @@ -953,7 +956,7 @@ function JSify(data, functionsOnly, givenFunctions) { return ret + item.ident + '.f' + item.indexes[0][0].text + ' = ' + finalizeLLVMParameter(item.value) + ', ' + item.ident + ')'; }); makeFuncLineActor('indirectbr', function(item) { - return makeBranch(finalizeLLVMParameter(item.pointer), item.currLabelId, true); + return makeBranch(finalizeLLVMParameter(item.value), item.currLabelId, true); }); makeFuncLineActor('alloca', function(item) { if (typeof item.allocatedIndex === 'number') { |