aboutsummaryrefslogtreecommitdiff
path: root/src/parseTools.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-10-17 16:59:48 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-10-18 13:00:49 -0700
commit775e1fa06246a6724bd9573ba8104439998c4163 (patch)
tree19a251d938bbe24de34ad4469c1bb5c4caabb2f1 /src/parseTools.js
parent0567f279ad1477779bc92eef5615b2e167824dcf (diff)
define vector literal type
Diffstat (limited to 'src/parseTools.js')
-rw-r--r--src/parseTools.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/parseTools.js b/src/parseTools.js
index c7beac53..3456e18d 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -585,6 +585,16 @@ function parseLLVMSegment(segment) {
return parseBlockAddress(segment);
} else {
type = segment[0].text;
+ if (type[type.length-1] === '>' && segment[1].text[0] === '<') {
+ // vector literal
+ return {
+ intertype: 'vector',
+ idents: splitTokenList(segment[1].tokens).map(function(pair) {
+ return pair[1].text;
+ }),
+ type: type
+ };
+ }
Types.needAnalysis[type] = 0;
return {
intertype: 'value',
@@ -1981,6 +1991,8 @@ function finalizeLLVMParameter(param, noIndexizeFunctions) {
return param.ident; // we don't really want the type here
} else if (param.intertype == 'mathop') {
return processMathop(param);
+ } else if (param.intertype === 'vector') {
+ return 'float32x4(' + param.idents.join(',') + ')';
} else {
throw 'invalid llvm parameter: ' + param.intertype;
}