diff options
| author | Eric Fiselier <eric@efcs.ca> | 2017-01-24 04:57:33 +0000 |
|---|---|---|
| committer | Eric Fiselier <eric@efcs.ca> | 2017-01-24 04:57:33 +0000 |
| commit | d5fd7d7ea152be8e0c6bed31be690cb020e9d96b (patch) | |
| tree | 5704a5675eb760f8d63661974c3b114d2fc28c7e /libcxx/src/mutex.cpp | |
| parent | 5a6826ebc488e9b21edd5e4f4d25bc209e809614 (diff) | |
| download | bcm5719-llvm-d5fd7d7ea152be8e0c6bed31be690cb020e9d96b.tar.gz bcm5719-llvm-d5fd7d7ea152be8e0c6bed31be690cb020e9d96b.zip | |
[libcxx] Never use <cassert> within libc++
Summary:
It is my opinion that libc++ should never use `<cassert>`, including in the `dylib`. This patch remove all uses of `assert` from within libc++ and replaces most of them with `_LIBCPP_ASSERT` instead.
Additionally this patch turn `LIBCXX_ENABLE_ASSERTIONS` off by default, because the standard library should not be aborting user programs unless explicitly asked to.
Reviewers: mclow.lists, compnerd, smeenai
Reviewed By: mclow.lists
Subscribers: mgorny, cfe-commits
Differential Revision: https://reviews.llvm.org/D29063
llvm-svn: 292883
Diffstat (limited to 'libcxx/src/mutex.cpp')
| -rw-r--r-- | libcxx/src/mutex.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libcxx/src/mutex.cpp b/libcxx/src/mutex.cpp index 338b79f2feb..b858e8877ae 100644 --- a/libcxx/src/mutex.cpp +++ b/libcxx/src/mutex.cpp @@ -11,7 +11,6 @@ #include "mutex" #include "limits" #include "system_error" -#include "cassert" #include "include/atomic_support.h" _LIBCPP_BEGIN_NAMESPACE_STD @@ -45,7 +44,7 @@ mutex::unlock() _NOEXCEPT { int ec = __libcpp_mutex_unlock(&__m_); (void)ec; - assert(ec == 0); + _LIBCPP_ASSERT(ec == 0, "call to mutex::unlock failed"); } // recursive_mutex @@ -61,7 +60,7 @@ recursive_mutex::~recursive_mutex() { int e = __libcpp_recursive_mutex_destroy(&__m_); (void)e; - assert(e == 0); + _LIBCPP_ASSERT(e == 0, "call to ~recursive_mutex() failed"); } void @@ -77,7 +76,7 @@ recursive_mutex::unlock() _NOEXCEPT { int e = __libcpp_recursive_mutex_unlock(&__m_); (void)e; - assert(e == 0); + _LIBCPP_ASSERT(e == 0, "call to recursive_mutex::unlock() failed"); } bool |

