diff options
author | Eric Fiselier <eric@efcs.ca> | 2017-01-24 12:26:01 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2017-01-24 12:26:01 +0000 |
commit | f9e7bf3a43fd28c9ffd1523f1c832275e80a9f85 (patch) | |
tree | 6fa1b57f29c142590a431e68a822da7b3fe2a9ec /libcxx/src | |
parent | 819da50d12c24b41c974d405319fbdb82e2c4229 (diff) | |
download | bcm5719-llvm-f9e7bf3a43fd28c9ffd1523f1c832275e80a9f85.tar.gz bcm5719-llvm-f9e7bf3a43fd28c9ffd1523f1c832275e80a9f85.zip |
Revert "[libcxx] Never use <cassert> within libc++"
This reverts commit r292883. Unfortunately <string_view> uses
_LIBCPP_ASSERT in a way which is not compatible with the C++11 dylib
build. I'll investigate more tomorrow.
llvm-svn: 292923
Diffstat (limited to 'libcxx/src')
-rw-r--r-- | libcxx/src/condition_variable.cpp | 1 | ||||
-rw-r--r-- | libcxx/src/experimental/filesystem/path.cpp | 4 | ||||
-rw-r--r-- | libcxx/src/mutex.cpp | 7 | ||||
-rw-r--r-- | libcxx/src/system_error.cpp | 4 |
4 files changed, 11 insertions, 5 deletions
diff --git a/libcxx/src/condition_variable.cpp b/libcxx/src/condition_variable.cpp index 3f607271b9e..25e66038eec 100644 --- a/libcxx/src/condition_variable.cpp +++ b/libcxx/src/condition_variable.cpp @@ -14,6 +14,7 @@ #include "condition_variable" #include "thread" #include "system_error" +#include "cassert" _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/libcxx/src/experimental/filesystem/path.cpp b/libcxx/src/experimental/filesystem/path.cpp index daf2c2bba79..96b81f7b0a7 100644 --- a/libcxx/src/experimental/filesystem/path.cpp +++ b/libcxx/src/experimental/filesystem/path.cpp @@ -6,9 +6,11 @@ // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// +#undef NDEBUG #include "experimental/filesystem" #include "string_view" #include "utility" +#include "cassert" namespace { namespace parser { @@ -111,6 +113,7 @@ public: void decrement() noexcept { const PosPtr REnd = &Path.front() - 1; const PosPtr RStart = getCurrentTokenStartPos() - 1; + assert(RStart != REnd); switch (State) { case PS_AtEnd: { @@ -319,6 +322,7 @@ string_view_t path::__root_path_raw() const auto NextCh = PP.peek(); if (NextCh && *NextCh == '/') { ++PP; + assert(PP.State == PathParser::PS_InRootDir); return createView(__pn_.data(), &PP.RawEntry.back()); } return PP.RawEntry; diff --git a/libcxx/src/mutex.cpp b/libcxx/src/mutex.cpp index b858e8877ae..338b79f2feb 100644 --- a/libcxx/src/mutex.cpp +++ b/libcxx/src/mutex.cpp @@ -11,6 +11,7 @@ #include "mutex" #include "limits" #include "system_error" +#include "cassert" #include "include/atomic_support.h" _LIBCPP_BEGIN_NAMESPACE_STD @@ -44,7 +45,7 @@ mutex::unlock() _NOEXCEPT { int ec = __libcpp_mutex_unlock(&__m_); (void)ec; - _LIBCPP_ASSERT(ec == 0, "call to mutex::unlock failed"); + assert(ec == 0); } // recursive_mutex @@ -60,7 +61,7 @@ recursive_mutex::~recursive_mutex() { int e = __libcpp_recursive_mutex_destroy(&__m_); (void)e; - _LIBCPP_ASSERT(e == 0, "call to ~recursive_mutex() failed"); + assert(e == 0); } void @@ -76,7 +77,7 @@ recursive_mutex::unlock() _NOEXCEPT { int e = __libcpp_recursive_mutex_unlock(&__m_); (void)e; - _LIBCPP_ASSERT(e == 0, "call to recursive_mutex::unlock() failed"); + assert(e == 0); } bool diff --git a/libcxx/src/system_error.cpp b/libcxx/src/system_error.cpp index cbbbb5dcd15..94114992c13 100644 --- a/libcxx/src/system_error.cpp +++ b/libcxx/src/system_error.cpp @@ -17,9 +17,9 @@ #include "cstring" #include "cstdio" #include "cstdlib" +#include "cassert" #include "string" #include "string.h" -#include "__debug" #if defined(__ANDROID__) #include <android/api-level.h> @@ -96,7 +96,7 @@ string do_strerror_r(int ev) { std::snprintf(buffer, strerror_buff_size, "Unknown error %d", ev); return string(buffer); } else { - _LIBCPP_ASSERT(new_errno == ERANGE, "unexpected error from ::strerr_r"); + assert(new_errno == ERANGE); // FIXME maybe? 'strerror_buff_size' is likely to exceed the // maximum error size so ERANGE shouldn't be returned. std::abort(); |