diff options
author | Alon Zakai <azakai@mozilla.com> | 2010-12-02 22:28:38 -0800 |
---|---|---|
committer | Alon Zakai <azakai@mozilla.com> | 2010-12-02 22:28:38 -0800 |
commit | 1f70fe65a943f3867c12895986bfbc63190981de (patch) | |
tree | e9e76a4256cd1fbfd3b325efae53a44ba6eb5d19 /src/parseTools.js | |
parent | 70a93a3622a27ddbf26771dfe2cac8153686e036 (diff) |
handle bitcasts etc. of call() idents +test
Diffstat (limited to 'src/parseTools.js')
-rw-r--r-- | src/parseTools.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/parseTools.js b/src/parseTools.js index d2e746ca..968550e1 100644 --- a/src/parseTools.js +++ b/src/parseTools.js @@ -341,6 +341,24 @@ function parseLLVMFunctionCall(segment) { return ret; } +// Gets an array of tokens, we parse out the first +// 'ident' - either a simple ident of one token, or +// an LLVM internal function that generates an ident. +// We shift out of the array list the tokens that +// we ate. +function eatLLVMIdent(tokens) { + var ret; + if (tokens[0].text in PARSABLE_LLVM_FUNCTIONS) { + ret = parseLLVMFunctionCall([{text: 'i0'}].concat(tokens.slice(0,2))).ident; // TODO: Handle more cases, return a full object, process it later + tokens.shift(); + tokens.shift(); + } else { + ret = tokens[0].text; + tokens.shift(); + } + return ret; +} + function cleanOutTokens(filterOut, tokens, index) { while (filterOut.indexOf(tokens[index].text) != -1) { tokens.splice(index, 1); |