diff options
author | alon@honor <none@none> | 2010-09-29 22:28:27 -0700 |
---|---|---|
committer | alon@honor <none@none> | 2010-09-29 22:28:27 -0700 |
commit | 0923eaec251fb7af9f9bf642e06d2f17fdf0f250 (patch) | |
tree | fe6dac1470d8f42b71f7258e49d0c4f568ccc776 /src/jsifier.js | |
parent | 335bd8e73d093b10c38036072186254531e8c099 (diff) |
nicer llvm parameter parsing tools, used in 'store'
Diffstat (limited to 'src/jsifier.js')
-rw-r--r-- | src/jsifier.js | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index 3fd6506a..7df0ba86 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -384,14 +384,9 @@ function JSify(data) { }); } makeFuncLineZyme('store', function(item) { - //print('// zzqqzz ' + dump(item.value) + ' :::: ' + dump(item.pointer) + ' :::: '); var ident = toNiceIdent(item.ident); var value; - if (item.value.intertype in PARSABLE_LLVM_FUNCTIONS) { - value = finalizeLLVMFunctionCall(item.value); - } else { - value = toNiceIdent(item.value.ident); - } + value = finalizeLLVMParameter(item.value); if (pointingLevels(item.pointerType.text) == 1) { value = parseNumerical(value, removePointing(item.pointerType.text)); } @@ -639,6 +634,15 @@ function JSify(data) { } } + // From parseLLVMSegment + function finalizeLLVMParameter(param) { + if (param.intertype in PARSABLE_LLVM_FUNCTIONS) { + return finalizeLLVMFunctionCall(param); + } else { + return parseNumerical(param.ident); + } + } + makeFuncLineZyme('bitcast', function(item) { // XXX Don't we need to copy ptr - i.e. create new ones (at least if uses > just the next line)? // XXX hardcoded ptr impl - as ptrs are ints, we don't need to copy |