aboutsummaryrefslogtreecommitdiff
path: root/src/parseTools.js
diff options
context:
space:
mode:
authoralon@honor <none@none>2010-09-27 20:54:16 -0700
committeralon@honor <none@none>2010-09-27 20:54:16 -0700
commita13db65ea9daf3ecda49da0184ba12938c2218b4 (patch)
treecc1ea9d97db7b0cad6746c9ea5ab13c9488bace2 /src/parseTools.js
parent3172545cfb1945f96d4b9d81942f643aeab7b873 (diff)
parseLLVMFunctionCall/finalizeLLVMFunctionCall cleanup
Diffstat (limited to 'src/parseTools.js')
-rw-r--r--src/parseTools.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/parseTools.js b/src/parseTools.js
index 3d5a6f06..d27ef071 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -241,8 +241,8 @@ function parseParamTokens(params) {
ident: '_' + absIndex,
});
}
- } else if (segment[1].text in PARSABLE_FUNCTIONS) {
- ret.push(parseFunctionCall(segment));
+ } else if (segment[1].text in PARSABLE_LLVM_FUNCTIONS) {
+ ret.push(parseLLVMFunctionCall(segment));
} else {
if (segment[2] && segment[2].text == 'to') { // part of bitcast params
segment = segment.slice(0, 2);
@@ -273,13 +273,13 @@ function cleanSegment(segment) {
return segment;
}
-PARSABLE_FUNCTIONS = searchable('getelementptr', 'bitcast');
+PARSABLE_LLVM_FUNCTIONS = searchable('getelementptr', 'bitcast', 'inttoptr', 'ptrtoint');
// Parses a function call of form
// TYPE functionname MODIFIERS (...)
// e.g.
// i32* getelementptr inbounds (...)
-function parseFunctionCall(segment) {
+function parseLLVMFunctionCall(segment) {
segment = segment.slice(0);
segment = cleanSegment(segment);
// Remove additional modifiers
@@ -287,7 +287,7 @@ function parseFunctionCall(segment) {
segment.splice(2, 1);
}
assertTrue(['inreg', 'byval'].indexOf(segment[1].text) == -1);
- assert(segment[1].text in PARSABLE_FUNCTIONS);
+ assert(segment[1].text in PARSABLE_LLVM_FUNCTIONS);
var ret = {
intertype: segment[1].text,
type: segment[0],