From 67c7490aea420a98bd90005cffd7544b804530a0 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Thu, 14 Apr 2022 07:58:11 +0000 Subject: 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 --- test/run-spec-wasm2c.py | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'test/run-spec-wasm2c.py') 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': -- cgit v1.2.3