[libc++] Fix and document visibility attributes for Clang, GCC and Windows.
authorEric Fiselier <eric@efcs.ca>
Thu, 15 Sep 2016 22:27:07 +0000 (22:27 +0000)
committerEric Fiselier <eric@efcs.ca>
Thu, 15 Sep 2016 22:27:07 +0000 (22:27 +0000)
commit49e2967f2709b6333ae9373cf304af97a3ea785f
tree8869f0b5cefc466e2fb340b9e3ecc07e3c0bb616
parent8da42cc5d31384361de9abf645c2e6f95c94198c
[libc++] Fix and document visibility attributes for Clang, GCC and Windows.

Summary:
This patch fixes a number of problems with the visibility macros across GCC (on Unix) and Windows (DLL import/export semantics). All of the visibility macros are now documented under `DesignDocs/VisibilityMacros.rst`. Now I'll no longer forget the subtleties of each!

This patch adds two new visibility macros:

* `_LIBCPP_ENUM_VIS` for controlling the typeinfo of enum types. Only Clang supports this.
* `_LIBCPP_EXTERN_TEMPLATE_TYPE_VIS` for redefining visibility on explicit instantiation declarations. Clang and Windows require this.

After applying this patch GCC only emits one -Wattribute warning opposed to 30+.

Reviewers: mclow.lists, EricWF

Subscribers: beanz, mgorny, cfe-commits

Differential Revision: https://reviews.llvm.org/D24602

llvm-svn: 281673
13 files changed:
libcxx/CMakeLists.txt
libcxx/docs/DesignDocs/VisibilityMacros.rst [new file with mode: 0644]
libcxx/docs/index.rst
libcxx/include/__config
libcxx/include/__locale
libcxx/include/__string
libcxx/include/experimental/filesystem
libcxx/include/istream
libcxx/include/locale
libcxx/include/ostream
libcxx/include/streambuf
libcxx/include/string
libcxx/include/vector