[WebAssembly] WebAssembly doesn't support "protected" visibility

Implement the `hasProtectedVisibility()` hook to indicate that, like
Darwin, WebAssembly doesn't support "protected" visibility.

On ELF, "protected" visibility is intended to be an optimization, however
in practice it often [isn't], and ELF documentation generally ranges from
[not mentioning it at all] to [strongly discouraging its use].

[isn't]: https://www.airs.com/blog/archives/307
[not mentioning it at all]: https://gcc.gnu.org/wiki/Visibility
[strongly discouraging its use]: https://www.akkadia.org/drepper/dsohowto.pdf

While here, also mention the new Reactor support in the release notes.
This commit is contained in:
Dan Gohman
2020-06-09 17:34:55 -07:00
parent a27d0dcf65
commit 6604295959
2 changed files with 14 additions and 1 deletions

View File

@@ -132,7 +132,14 @@ private:
}
bool hasExtIntType() const override { return true; }
bool hasProtectedVisibility() const override {
// TODO: For now, continue to advertise "protected" support for
// Emscripten targets.
return getTriple().isOSEmscripten();
}
};
class LLVM_LIBRARY_VISIBILITY WebAssembly32TargetInfo
: public WebAssemblyTargetInfo {
public:

View File

@@ -144,8 +144,14 @@ Changes to the AVR Target
Changes to the WebAssembly Target
---------------------------------
During this release ...
* Programs which don't have a "main" function, called "reactors" are now
properly supported, with a new `-mexec-model=reactor` flag. Programs which
previously used `-Wl,--no-entry` to avoid having a main function should
switch to this new flag, so that static initialization is properly
performed.
* `__attribute__((visibility("protected")))` now evokes a warning, as
WebAssembly does not support "protected" visibility.
Changes to the OCaml bindings
-----------------------------