[lld][WebAssembly] Allow ctors functions that return values
authorSam Clegg <sbc@chromium.org>
Tue, 16 Jun 2020 19:23:25 +0000 (12:23 -0700)
committerSam Clegg <sbc@chromium.org>
Thu, 18 Jun 2020 20:11:40 +0000 (13:11 -0700)
commit21e14cce23582fcd622b97d643a4e9b2f10a0583
tree94cb68354f4d5c06f19f9f074fded0c679633c31
parent25cbfa0788846c7ec06affb9c0e0d4a87b510c02
[lld][WebAssembly] Allow ctors functions that return values

Some projects use the constructor attribute on functions that also
return values.  In this case we just ignore them.

The error was reported in the libgpg-error project that marks
gpg_err_init with the `__constructor__` attribute.

Differential Revision: https://reviews.llvm.org/D81962
lld/test/wasm/ctor_return_value.s [new file with mode: 0644]
lld/wasm/Writer.cpp