aboutsummaryrefslogtreecommitdiff
path: root/src/intertyper.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-10-17 16:21:23 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-10-18 13:00:49 -0700
commit0b6d165a18823af90a65d9d24ee3006d372d7964 (patch)
tree822ee746f89f92b3d6c5b72a155b9663ee620c29 /src/intertyper.js
parente7176852da4f67f61019a53e4b5b4413fe24394e (diff)
stubs for insertelement and shufflevector
Diffstat (limited to 'src/intertyper.js')
-rw-r--r--src/intertyper.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/intertyper.js b/src/intertyper.js
index 41fba007..4c842b18 100644
--- a/src/intertyper.js
+++ b/src/intertyper.js
@@ -312,6 +312,10 @@ function intertyper(lines, sidePass, baseLineNums) {
return va_argHandler(item);
if (tokensLength >= 3 && token0Text == 'landingpad')
return landingpadHandler(item);
+ if (token0Text === 'insertelement')
+ return insertElementHandler(item);
+ if (token0Text === 'shufflevector')
+ return shuffleVectorHandler(item);
if (token0Text == 'fence')
return null;
} else if (item.indent === 0) {
@@ -752,6 +756,28 @@ function intertyper(lines, sidePass, baseLineNums) {
Types.needAnalysis[item.type] = 0;
return item;
}
+ function insertElementHandler(item) {
+ var last = getTokenIndexByText(item.tokens, ';');
+ item.intertype = 'insertelement';
+ item.type = item.tokens[1].text; // Of the origin aggregate, as well as the result
+ Types.needAnalysis[item.type] = 0;
+ item.ident = toNiceIdent(item.tokens[2].text);
+ var segments = splitTokenList(item.tokens.slice(4, last));
+ item.value = parseLLVMSegment(segments[0]);
+ item.index = parseLLVMSegment(segments[1]);
+ return item;
+ }
+ function shuffleVectorHandler(item) {
+ var last = getTokenIndexByText(item.tokens, ';');
+ item.intertype = 'shufflevector';
+ item.type = item.tokens[1].text; // Of the origin aggregate, as well as the result
+ Types.needAnalysis[item.type] = 0;
+ item.ident = toNiceIdent(item.tokens[2].text);
+ var segments = splitTokenList(item.tokens.slice(4, last));
+ item.value = parseLLVMSegment(segments[0]);
+ item.mask = parseLLVMSegment(segments[1]);
+ return item;
+ }
// 'alloca'
function allocaHandler(item) {
item.intertype = 'alloca';