summaryrefslogtreecommitdiffstats
path: root/libcxx/docs/DesignDocs
diff options
context:
space:
mode:
authorShoaib Meenai <smeenai@fb.com>2016-11-16 22:18:10 +0000
committerShoaib Meenai <smeenai@fb.com>2016-11-16 22:18:10 +0000
commitdce4218df7baa24f11a28611f3cc11fc34898e87 (patch)
treecd9d9b66ca80f9481fc19acde091c68025d9c5d1 /libcxx/docs/DesignDocs
parent7fa40c9f2b176fde3f99a96f6eb952f590f9d694 (diff)
downloadbcm5719-llvm-dce4218df7baa24f11a28611f3cc11fc34898e87.tar.gz
bcm5719-llvm-dce4218df7baa24f11a28611f3cc11fc34898e87.zip
[libc++] Introduce `_LIBCPP_OVERRIDABLE_FUNC_VIS`
This is a generalization of `_LIBCPP_NEW_DELETE_VIS`; the new macro name captures the semantics better, and also allows us to get rid of the `_WIN32` check in `include/new`. No functional change. Differential Revision: https://reviews.llvm.org/D26702 llvm-svn: 287164
Diffstat (limited to 'libcxx/docs/DesignDocs')
-rw-r--r--libcxx/docs/DesignDocs/VisibilityMacros.rst26
1 files changed, 12 insertions, 14 deletions
diff --git a/libcxx/docs/DesignDocs/VisibilityMacros.rst b/libcxx/docs/DesignDocs/VisibilityMacros.rst
index 861cc04ac45..2ee07142d85 100644
--- a/libcxx/docs/DesignDocs/VisibilityMacros.rst
+++ b/libcxx/docs/DesignDocs/VisibilityMacros.rst
@@ -22,6 +22,18 @@ Visibility Macros
Mark a symbol as being exported by the libc++ library. This attribute must
be applied to the declaration of all functions exported by the libc++ dylib.
+**_LIBCPP_OVERRIDABLE_FUNC_VIS**
+ Mark a symbol as being exported by the libc++ library, but allow it to be
+ overridden locally. On non-Windows, this is equivalent to `_LIBCPP_FUNC_VIS`.
+ This macro is applied to all `operator new` and `operator delete` overloads.
+
+ **Windows Behavior**: Any symbol marked `dllimport` cannot be overridden
+ locally, since `dllimport` indicates the symbol should be bound to a separate
+ DLL. All `operator new` and `operator delete` overloads are required to be
+ locally overridable, and therefore must not be marked `dllimport`. On Windows,
+ this macro therefore expands to `__declspec(dllexport)` when building the
+ library and has an empty definition otherwise.
+
**_LIBCPP_INLINE_VISIBILITY**
Mark a function as hidden and force inlining whenever possible.
@@ -107,20 +119,6 @@ Visibility Macros
versioning namespace. This allows throwing and catching some exception types
between libc++ and libstdc++.
-**_LIBCPP_NEW_DELETE_VIS**
- Mark a symbol as being exported by the libc++ library. This macro must be
- applied to all `operator new` and `operator delete` overloads.
-
- **Windows Behavior**: The `operator new` and `operator delete` overloads
- should not be marked as `dllimport`; if they were, source files including the
- `<new>` header (either directly or transitively) would lose the ability to use
- local overloads of `operator new` and `operator delete`. On Windows, this
- macro therefore expands to `__declspec(dllexport)` when building the library
- and has an empty definition otherwise. A related caveat is that libc++ must be
- included on the link line before `msvcrt.lib`, otherwise Microsoft's
- definitions of `operator new` and `operator delete` inside `msvcrt.lib` will
- end up being used instead of libc++'s.
-
Links
=====
OpenPOWER on IntegriCloud