diff options
author | alon@honor <none@none> | 2010-09-03 20:08:40 -0700 |
---|---|---|
committer | alon@honor <none@none> | 2010-09-03 20:08:40 -0700 |
commit | 61c4ab0f3bf9a110cb624365f6b727ad4486d03d (patch) | |
tree | 0af9015869b325e43fcc1bdaa4ee46b7b09b9d1c /src | |
parent | a0a31c81d8b7f17eccbafdf2c8741deabf08499a (diff) |
fptrunc and inttoptr
Diffstat (limited to 'src')
-rw-r--r-- | src/parser.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/parser.js b/src/parser.js index 3e9e36b1..66341a90 100644 --- a/src/parser.js +++ b/src/parser.js @@ -713,7 +713,7 @@ function intertyper(data) { // mathops substrate.addZyme('Mathops', { selectItem: function(item) { return item.indent === -1 && item.tokens && item.tokens.length >= 3 && - ['add', 'sub', 'sdiv', 'mul', 'icmp', 'zext', 'urem', 'srem', 'fadd', 'fsub', 'fmul', 'fdiv', 'fcmp', 'uitofp', 'sitofp', 'fpext', 'fptoui', 'fptosi', 'trunc', 'sext', 'select', 'shl', 'shr', 'ashl', 'ashr', 'lshr', 'lshl', 'xor', 'or', 'and', 'ptrtoint'] + ['add', 'sub', 'sdiv', 'mul', 'icmp', 'zext', 'urem', 'srem', 'fadd', 'fsub', 'fmul', 'fdiv', 'fcmp', 'uitofp', 'sitofp', 'fpext', 'fptrunc', 'fptoui', 'fptosi', 'trunc', 'sext', 'select', 'shl', 'shr', 'ashl', 'ashr', 'lshr', 'lshl', 'xor', 'or', 'and', 'ptrtoint', 'inttoptr'] .indexOf(item.tokens[0].text) != -1 && !item.intertype }, processItem: function(item) { item.intertype = 'mathop'; @@ -2270,12 +2270,16 @@ function JSify(data) { default: throw 'Unknown fcmp variant: ' + variant } } - case 'zext': case 'fpext': case 'trunc': case 'sext': return ident; + case 'zext': case 'fpext': case 'trunc': case 'sext': case 'fptrunc': return ident; case 'select': return '(' + ident + ' ? ' + ident3 + ' : ' + ident4 + ')'; case 'ptrtoint': { if (type.text != 'i8*') print('// XXX Warning: Risky ptrtoint operation on line ' + lineNum); return ident; } + case 'inttoptr': { + print('// XXX Warning: inttoptr operation on line ' + lineNum); + return ident; + } default: throw 'Unknown mathcmp op: ' + item.op } } }); |