diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-06-26 18:17:03 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-06-26 18:17:03 -0700 |
commit | 30c5db3696ff9b45da570eb9d5c19cc1cbb1d01c (patch) | |
tree | e2bf381ea45c7866b894aefd19320b1b8ddb67a2 /src/parseTools.js | |
parent | 1f78e3d974142071e03768ada5c14dfd26ed0058 (diff) |
cleanup: do indexizeFunctions inside finalizeLLVMParameter
Diffstat (limited to 'src/parseTools.js')
-rw-r--r-- | src/parseTools.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/parseTools.js b/src/parseTools.js index 39537ab2..530bf54b 100644 --- a/src/parseTools.js +++ b/src/parseTools.js @@ -1040,19 +1040,21 @@ function handleOverflow(text, bits) { // From parseLLVMSegment function finalizeLLVMParameter(param) { + var ret; if (isNumber(param)) { return param; } else if (typeof param === 'string') { - return toNiceIdentCarefully(param); + ret = toNiceIdentCarefully(param); } else if (param.intertype in PARSABLE_LLVM_FUNCTIONS) { - return finalizeLLVMFunctionCall(param); + ret = finalizeLLVMFunctionCall(param); } else if (param.intertype == 'value') { - return parseNumerical(param.ident); + ret = parseNumerical(param.ident); } else if (param.intertype == 'structvalue') { - return param.values.map(finalizeLLVMParameter); + ret = param.values.map(finalizeLLVMParameter); } else { throw 'invalid llvm parameter: ' + param.intertype; } + return indexizeFunctions(ret); } function makeSignOp(value, type, op) { @@ -1104,7 +1106,7 @@ function isSignedOp(op, variant) { function processMathop(item) { with(item) { for (var i = 1; i <= 4; i++) { if (item['param'+i]) { - item['ident'+i] = indexizeFunctions(finalizeLLVMParameter(item['param'+i])); + item['ident'+i] = finalizeLLVMParameter(item['param'+i]); if (!isNumber(item['ident'+i])) { item['ident'+i] = '(' + item['ident'+i] + ')'; // we may have nested expressions. So enforce the order of operations we want } |