diff options
-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'])); |