diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-04-22 17:11:08 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-04-22 17:11:14 -0700 |
commit | 90940429ead09459cc29e8dda86b3d47a7dd20a0 (patch) | |
tree | 7f4dacbce4c72eb8ff072d01fbacc9c222f91653 /src | |
parent | ce5021b9577feacb25474914a796ec4b6f5ff76d (diff) |
ignore readnone in params
Diffstat (limited to 'src')
-rw-r--r-- | src/modules.js | 1 | ||||
-rw-r--r-- | src/parseTools.js | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/modules.js b/src/modules.js index 2d2a75d0..fd5c23cd 100644 --- a/src/modules.js +++ b/src/modules.js @@ -21,6 +21,7 @@ var LLVM = { CONVERSIONS: set('inttoptr', 'ptrtoint', 'uitofp', 'sitofp', 'fptosi', 'fptoui', 'fpext', 'fptrunc'), 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 MATHOP_IGNORABLES: set('exact', 'nnan', 'ninf', 'nsz', 'arcp', 'fast'), + PARAM_IGNORABLES: set('nocapture', 'readonly', 'readnone'), }; LLVM.GLOBAL_MODIFIERS = set(keys(LLVM.LINKAGES).concat(['constant', 'global', 'hidden'])); diff --git a/src/parseTools.js b/src/parseTools.js index 4fb76196..4396abd9 100644 --- a/src/parseTools.js +++ b/src/parseTools.js @@ -467,7 +467,7 @@ function parseParamTokens(params) { // handle 'byval' and 'byval align X'. We store the alignment in 'byVal' byVal = QUANTUM_SIZE; segment.splice(1, 1); - if (segment[1] && (segment[1].text === 'nocapture' || segment[1].text === 'readonly')) { + if (segment[1] && (segment[1].text in LLVM.PARAM_IGNORABLES)) { segment.splice(1, 1); } if (segment[1] && segment[1].text === 'align') { @@ -476,7 +476,7 @@ function parseParamTokens(params) { segment.splice(1, 2); } } - if (segment[1] && (segment[1].text === 'nocapture' || segment[1].text === 'readonly')) { + if (segment[1] && (segment[1].text in LLVM.PARAM_IGNORABLES)) { segment.splice(1, 1); } if (segment.length == 1) { |