diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-01-14 18:42:53 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-01-14 18:42:53 -0800 |
commit | 45e9f31eae4f754ebaf1af11a2bf2f34226102c6 (patch) | |
tree | 514e13622774889e05c2fd1c0451c3c607bd4e2c /src | |
parent | 3daa26d56809509c495dd3f74e9f9718ec3dcfcd (diff) |
fix type of [i|f]cmp
Diffstat (limited to 'src')
-rw-r--r-- | src/intertyper.js | 2 | ||||
-rw-r--r-- | src/modules.js | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/src/intertyper.js b/src/intertyper.js index 5bca9236..00d504f5 100644 --- a/src/intertyper.js +++ b/src/intertyper.js @@ -851,6 +851,8 @@ function intertyper(data, sidePass, baseLineNums) { item.type = item.params[1].ident; item.params[0].type = item.params[1].type; // TODO: also remove 2nd param? + } else if (item.op in LLVM.COMPS) { + item.type = 'i1'; } if (USE_TYPED_ARRAYS == 2) { // Some specific corrections, since 'i64' is special diff --git a/src/modules.js b/src/modules.js index b5a30866..2e4b206d 100644 --- a/src/modules.js +++ b/src/modules.js @@ -15,6 +15,7 @@ var LLVM = { SHIFTS: set('ashr', 'lshr', 'shl'), PHI_REACHERS: set('branch', 'switch', 'invoke'), EXTENDS: set('sext', 'zext'), + COMPS: set('icmp', 'fcmp'), INTRINSICS_32: set('_llvm_memcpy_p0i8_p0i8_i64', '_llvm_memmove_p0i8_p0i8_i64', '_llvm_memset_p0i8_i64'), // intrinsics that need args converted to i32 in USE_TYPED_ARRAYS == 2 }; LLVM.GLOBAL_MODIFIERS = set(keys(LLVM.LINKAGES).concat(['constant', 'global', 'hidden'])); |