aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/intertyper.js6
-rw-r--r--src/modules.js1
2 files changed, 4 insertions, 3 deletions
diff --git a/src/intertyper.js b/src/intertyper.js
index 6cb2a341..806dd3ce 100644
--- a/src/intertyper.js
+++ b/src/intertyper.js
@@ -384,7 +384,7 @@ function intertyper(data, parseFunctions, baseLineNum) {
funcHeader = substrate.addActor('FuncHeader', {
processItem: function(item) {
item.tokens = item.tokens.filter(function(token) {
- return !(token.text in LLVM.LINKAGES || token.text in set('noalias', 'hidden', 'signext', 'zeroext', 'nounwind', 'define', 'inlinehint', '{') || token.text in LLVM.CALLING_CONVENTIONS);
+ return !(token.text in LLVM.LINKAGES || token.text in LLVM.PARAM_ATTR || token.text in set('hidden', 'nounwind', 'define', 'inlinehint', '{') || token.text in LLVM.CALLING_CONVENTIONS);
});
var ret = {
intertype: 'function',
@@ -521,7 +521,7 @@ function intertyper(data, parseFunctions, baseLineNum) {
item.tokens.splice(0, 1);
}
assertEq(item.tokens[0].text, 'call');
- while (['signext', 'zeroext', 'noalias'].indexOf(item.tokens[1].text) != -1 || item.tokens[1].text in LLVM.CALLING_CONVENTIONS) {
+ while (item.tokens[1].text in LLVM.PARAM_ATTR || item.tokens[1].text in LLVM.CALLING_CONVENTIONS) {
item.tokens.splice(1, 1);
}
item.type = item.tokens[1].text;
@@ -737,7 +737,7 @@ function intertyper(data, parseFunctions, baseLineNum) {
// external function stub
substrate.addActor('External', {
processItem: function(item) {
- if (item.tokens[1].text == 'noalias') {
+ if (item.tokens[1].text in LLVM.LINKAGES || item.tokens[1].text in LLVM.PARAM_ATTR) {
item.tokens.splice(1, 1);
}
return [{
diff --git a/src/modules.js b/src/modules.js
index 4019116f..235683f8 100644
--- a/src/modules.js
+++ b/src/modules.js
@@ -6,6 +6,7 @@ var LLVM = {
LINKAGES: set('private', 'linker_private', 'linker_private_weak', 'linker_private_weak_def_auto', 'internal',
'available_externally', 'linkonce', 'common', 'weak', 'appending', 'extern_weak', 'linkonce_odr',
'weak_odr', 'externally_visible', 'dllimport', 'dllexport'),
+ PARAM_ATTR: set('noalias', 'signext', 'zeroext', 'inreg', 'byval', 'sret', 'nocapture', 'nest'),
CALLING_CONVENTIONS: set('ccc', 'fastcc', 'coldcc', 'cc10')
};
LLVM.GLOBAL_MODIFIERS = set(keys(LLVM.LINKAGES).concat(['constant', 'global', 'hidden']));