diff options
-rw-r--r-- | src/intertyper.js | 2 | ||||
-rw-r--r-- | src/modules.js | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/src/intertyper.js b/src/intertyper.js index 4e2c17e3..42dee437 100644 --- a/src/intertyper.js +++ b/src/intertyper.js @@ -837,7 +837,7 @@ function intertyper(data, sidePass, baseLineNums) { if (item.op === 'select') { assert(item.params[1].type === item.params[2].type); item.type = item.params[1].type; - } else if (item.op === 'inttoptr' || item.op === 'ptrtoint' || item.op === 'uitofp' || item.op === 'sitofp') { + } else if (item.op in LLVM.CONVERSIONS) { item.type = item.params[1].type; } else { item.type = item.params[0].type; diff --git a/src/modules.js b/src/modules.js index d517ac70..5e2b324e 100644 --- a/src/modules.js +++ b/src/modules.js @@ -16,6 +16,7 @@ var LLVM = { PHI_REACHERS: set('branch', 'switch', 'invoke', 'indirectbr'), EXTENDS: set('sext', 'zext'), COMPS: set('icmp', 'fcmp'), + CONVERSIONS: set('inttoptr', 'ptrtoint', 'uitofp', 'sitofp', 'fptosi', 'fptoui'), 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'])); |