aboutsummaryrefslogtreecommitdiff
path: root/src/jsifier.js
diff options
context:
space:
mode:
authoralon@honor <none@none>2010-10-08 20:12:01 -0700
committeralon@honor <none@none>2010-10-08 20:12:01 -0700
commit7ae56ec8ee8e7c1166afaa7c7305fd73996c483f (patch)
tree285196ff1d78bf1d1be5dbe57788c0d3249a589f /src/jsifier.js
parent8e37aa593df856af80c4186633084a2d01fc995a (diff)
initial support for |extractvalue|
Diffstat (limited to 'src/jsifier.js')
-rw-r--r--src/jsifier.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index 12017e2a..cd118644 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -533,7 +533,6 @@ function JSify(data) {
return ret;
});
makeFuncLineZyme('load', function(item) {
- //print('// zz LOAD ' + dump(item) + ' :: ' + dump(item.tokens));
var ident = toNiceIdent(item.ident);
var impl = getVarData(item.funcData, item.ident);
switch (impl) {
@@ -544,6 +543,11 @@ function JSify(data) {
default: return "unknown [load] impl: " + impl;
}
});
+ makeFuncLineZyme('extractvalue', function(item) {
+ assert(item.indexes.length == 1); // TODO: use getelementptr parsing stuff, for depth. For now, we assume that LLVM aggregates are flat,
+ // and we emulate them using simple JS objects { f1: , f2: , } etc., for speed
+ return item.ident + '.f' + item.indexes[0][0].text;
+ });
makeFuncLineZyme('alloca', function(item) {
dprint('alloca', dump(item));
if (pointingLevels(item.allocatedType.text) == 0 && isStructType(item.allocatedType.text)) {