aboutsummaryrefslogtreecommitdiff
path: root/src/analyzer.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-08-26 21:42:49 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-08-26 21:42:49 -0700
commit71ce3922336051978d9fc1aa3be642b68e522d1c (patch)
tree94ba1a4383704137f1212b64170c65d13a0cacd5 /src/analyzer.js
parent0269efbd05ddad154e55a8802172eb9ddd701b3e (diff)
handle structural constants in calls
Diffstat (limited to 'src/analyzer.js')
-rw-r--r--src/analyzer.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/analyzer.js b/src/analyzer.js
index 2a7d64f5..97ca880c 100644
--- a/src/analyzer.js
+++ b/src/analyzer.js
@@ -281,6 +281,16 @@ function analyzer(data, sidePass) {
Array.prototype.splice.apply(params, [i, 1].concat(toAdd));
i += toAdd.length;
continue;
+ } else if (param.intertype == 'structvalue') {
+ // 'flatten' out the struct into scalars
+ var toAdd = param.params;
+ toAdd.forEach(function(param) {
+ assert(param.intertype == 'value' && (param.type in Runtime.FLOAT_TYPES || getNumIntChunks(param.type) == 1), param.type);
+ param.byval = 0;
+ });
+ Array.prototype.splice.apply(params, [i, 1].concat(toAdd));
+ i += toAdd.length;
+ continue;
}
i++;
}