aboutsummaryrefslogtreecommitdiff
path: root/src/parseTools.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/parseTools.js')
-rw-r--r--src/parseTools.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/parseTools.js b/src/parseTools.js
index 22e9b94c..4d6d7bd3 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -463,7 +463,7 @@ function parseParamTokens(params) {
// handle 'byval' and 'byval align X'. We store the alignment in 'byVal'
byVal = QUANTUM_SIZE;
segment.splice(1, 1);
- if (segment[1] && segment[1].text === 'nocapture') {
+ if (segment[1] && (segment[1].text === 'nocapture' || segment[1].text === 'readonly')) {
segment.splice(1, 1);
}
if (segment[1] && segment[1].text === 'align') {
@@ -472,7 +472,7 @@ function parseParamTokens(params) {
segment.splice(1, 2);
}
}
- if (segment[1] && segment[1].text === 'nocapture') {
+ if (segment[1] && (segment[1].text === 'nocapture' || segment[1].text === 'readonly')) {
segment.splice(1, 1);
}
if (segment.length == 1) {
@@ -628,7 +628,7 @@ function parseLLVMSegment(segment) {
}
function cleanSegment(segment) {
- while (segment.length >= 2 && ['noalias', 'sret', 'nocapture', 'nest', 'zeroext', 'signext'].indexOf(segment[1].text) != -1) {
+ while (segment.length >= 2 && ['noalias', 'sret', 'nocapture', 'nest', 'zeroext', 'signext', 'readnone'].indexOf(segment[1].text) != -1) {
segment.splice(1, 1);
}
return segment;
@@ -1640,7 +1640,10 @@ function getFastValue(a, op, b, type) {
}
function getFastValues(list, op, type) {
- assert(op == '+');
+ assert(op === '+' && type === 'i32');
+ for (var i = 0; i < list.length; i++) {
+ if (isNumber(list[i])) list[i] = (list[i]|0) + '';
+ }
var changed = true;
while (changed) {
changed = false;
@@ -1648,6 +1651,7 @@ function getFastValues(list, op, type) {
var fast = getFastValue(list[i], op, list[i+1], type);
var raw = list[i] + op + list[i+1];
if (fast.length < raw.length || fast.indexOf(op) < 0) {
+ if (isNumber(fast)) fast = (fast|0) + '';
list[i] = fast;
list.splice(i+1, 1);
i--;