diff options
author | Sam Clegg <sbc@chromium.org> | 2022-04-14 07:58:11 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-14 00:58:11 -0700 |
commit | 67c7490aea420a98bd90005cffd7544b804530a0 (patch) | |
tree | d920ff346577d01891263d2e8ba672af901d923a /test/run-spec-wasm2c.py | |
parent | 39022f8cd717ec5f219c56f4ebd07f016c457afc (diff) | |
download | wabt-67c7490aea420a98bd90005cffd7544b804530a0.tar.gz wabt-67c7490aea420a98bd90005cffd7544b804530a0.tar.bz2 wabt-67c7490aea420a98bd90005cffd7544b804530a0.zip |
Remove signature mangling from wasm2c output (#1896)
This effectively means that we no longer support imports that are
overloaded by signature only. This is not something that we need to
support in order to support the core wasm spec.
This feature is available in the JS embedding but there is no good
reason (AFAICT) to support it in wasm2c, and this simplifies the
generated code.
Fixes #1858
Diffstat (limited to 'test/run-spec-wasm2c.py')
-rwxr-xr-x | test/run-spec-wasm2c.py | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/test/run-spec-wasm2c.py b/test/run-spec-wasm2c.py index 7ecdc5f8..3e7f7574 100755 --- a/test/run-spec-wasm2c.py +++ b/test/run-spec-wasm2c.py @@ -311,24 +311,11 @@ class CWriter(object): def _CompareList(self, consts): return ' && '.join(self._Compare(num, const) for num, const in enumerate(consts)) - def _ActionSig(self, action, expected): - type_ = action['type'] - result_types = [result['type'] for result in expected] - arg_types = [arg['type'] for arg in action.get('args', [])] - if type_ == 'invoke': - return MangleTypes(result_types) + MangleTypes(arg_types) - elif type_ == 'get': - return MangleType(result_types[0]) - else: - raise Error('Unexpected action type: %s' % type_) - def _Action(self, command): action = command['action'] - expected = command['expected'] type_ = action['type'] mangled_module_name = self.GetModulePrefix(action.get('module')) - field = (mangled_module_name + MangleName(action['field']) + - MangleName(self._ActionSig(action, expected))) + field = mangled_module_name + MangleName(action['field']) if type_ == 'invoke': return '%s(%s)' % (field, self._ConstantList(action.get('args', []))) elif type_ == 'get': |