mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 18:16:42 +00:00
[libc++] Document that internal aliases should be marked _LIBCPP_NODEBUG (#122175)
In #118710 we've added ``_LIBCPP_NODEBUG`` to all internal aliases, but didn't actually document it. This patch adds documentation by adding the new requirement and reasoning to the coding guidelines.
This commit is contained in:
parent
659e66e2b3
commit
48b2ce9c12
@ -184,3 +184,13 @@ headers (which is sometimes required for ``constexpr`` support).
|
||||
|
||||
When defining a function at the ABI boundary, it can also be useful to consider which attributes (like ``[[gnu::pure]]``
|
||||
and ``[[clang::noescape]]``) can be added to the function to improve the compiler's ability to optimize.
|
||||
|
||||
Library-internal type aliases should be annotated with ``_LIBCPP_NODEBUG``
|
||||
==========================================================================
|
||||
|
||||
Libc++ has lots of internal type aliases. Accumulated, these can result in significant amounts of debug information that
|
||||
users generally don't care about, since users don't try to debug standard library facilities in most cases. For that
|
||||
reason, all library-internal type aliases that aren't function-local should be annotated with ``_LIBCPP_NODEBUG`` to
|
||||
prevent compilers from generating said debug information.
|
||||
|
||||
This is enforced by the clang-tidy check ``libcpp-nodebug-on-aliases``.
|
||||
|
Loading…
x
Reference in New Issue
Block a user