update libcxx, libcxxabi, libunwind, and tsan to llvm 13 rc1

This commit is contained in:
Andrew Kelley
2021-08-16 23:30:18 -07:00
parent 1b8f0d8b56
commit 92b69215e6
581 changed files with 37738 additions and 24433 deletions

View File

@@ -108,7 +108,7 @@ namespace std
{
unexpected_handler
set_unexpected(unexpected_handler func) _NOEXCEPT
set_unexpected(unexpected_handler func) noexcept
{
if (func == 0)
func = default_unexpected_handler;
@@ -117,7 +117,7 @@ set_unexpected(unexpected_handler func) _NOEXCEPT
}
terminate_handler
set_terminate(terminate_handler func) _NOEXCEPT
set_terminate(terminate_handler func) noexcept
{
if (func == 0)
func = default_terminate_handler;

View File

@@ -20,7 +20,7 @@
#include "include/atomic_support.h"
#if __has_feature(address_sanitizer)
extern "C" void __asan_handle_no_return(void);
#include <sanitizer/asan_interface.h>
#endif
// +---------------------------+-----------------------------+---------------+
@@ -384,7 +384,7 @@ asm (
" bl abort\n"
" .popsection"
);
#endif // defined(_LIBCXXABI_ARM_EHABI)
#endif // defined(_LIBCXXABI_ARM_EHABI)
/*
This routine can catch foreign or native exceptions. If native, the exception

View File

@@ -161,4 +161,4 @@ extern "C" _LIBCXXABI_FUNC_VIS void __cxa_free_dependent_exception (void * depen
} // namespace __cxxabiv1
#endif // _CXA_EXCEPTION_H
#endif // _CXA_EXCEPTION_H

View File

@@ -23,7 +23,7 @@ namespace std
{
unexpected_handler
get_unexpected() _NOEXCEPT
get_unexpected() noexcept
{
return __libcpp_atomic_load(&__cxa_unexpected_handler, _AO_Acquire);
}
@@ -44,18 +44,18 @@ unexpected()
}
terminate_handler
get_terminate() _NOEXCEPT
get_terminate() noexcept
{
return __libcpp_atomic_load(&__cxa_terminate_handler, _AO_Acquire);
}
void
__terminate(terminate_handler func) _NOEXCEPT
__terminate(terminate_handler func) noexcept
{
#ifndef _LIBCXXABI_NO_EXCEPTIONS
try
{
#endif // _LIBCXXABI_NO_EXCEPTIONS
#endif // _LIBCXXABI_NO_EXCEPTIONS
func();
// handler should not return
abort_message("terminate_handler unexpectedly returned");
@@ -66,12 +66,12 @@ __terminate(terminate_handler func) _NOEXCEPT
// handler should not throw exception
abort_message("terminate_handler unexpectedly threw an exception");
}
#endif // _LIBCXXABI_NO_EXCEPTIONS
#endif // _LIBCXXABI_NO_EXCEPTIONS
}
__attribute__((noreturn))
void
terminate() _NOEXCEPT
terminate() noexcept
{
#ifndef _LIBCXXABI_NO_EXCEPTIONS
// If there might be an uncaught exception
@@ -97,13 +97,13 @@ new_handler __cxa_new_handler = 0;
}
new_handler
set_new_handler(new_handler handler) _NOEXCEPT
set_new_handler(new_handler handler) noexcept
{
return __libcpp_atomic_exchange(&__cxa_new_handler, handler, _AO_Acq_Rel);
}
new_handler
get_new_handler() _NOEXCEPT
get_new_handler() noexcept
{
return __libcpp_atomic_load(&__cxa_new_handler, _AO_Acquire);
}

View File

@@ -25,7 +25,7 @@ __unexpected(unexpected_handler func);
_LIBCXXABI_HIDDEN _LIBCXXABI_NORETURN
void
__terminate(terminate_handler func) _NOEXCEPT;
__terminate(terminate_handler func) noexcept;
} // std
@@ -52,4 +52,4 @@ _LIBCXXABI_DATA_VIS extern void (*__cxa_new_handler)();
} // extern "C"
#endif // _CXA_HANDLERS_H
#endif // _CXA_HANDLERS_H

View File

@@ -88,7 +88,7 @@ extern "C" EXCEPTION_DISPOSITION _GCC_specific_handler(PEXCEPTION_RECORD,
| +-------------+---------------------------------+------------------------------+ |
| ... |
+----------------------------------------------------------------------------------+
#endif // __USING_SJLJ_EXCEPTIONS__
#endif // __USING_SJLJ_EXCEPTIONS__
+---------------------------------------------------------------------+
| Beginning of Action Table ttypeIndex == 0 : cleanup |
| ... ttypeIndex > 0 : catch |
@@ -241,10 +241,11 @@ readSLEB128(const uint8_t** data)
/// @link http://dwarfstd.org/Dwarf3.pdf @unlink
/// @param data reference variable holding memory pointer to decode from
/// @param encoding dwarf encoding type
/// @param base for adding relative offset, default to 0
/// @returns decoded value
static
uintptr_t
readEncodedPointer(const uint8_t** data, uint8_t encoding)
readEncodedPointer(const uint8_t** data, uint8_t encoding, uintptr_t base = 0)
{
uintptr_t result = 0;
if (encoding == DW_EH_PE_omit)
@@ -295,8 +296,12 @@ readEncodedPointer(const uint8_t** data, uint8_t encoding)
if (result)
result += (uintptr_t)(*data);
break;
case DW_EH_PE_textrel:
case DW_EH_PE_datarel:
assert((base != 0) && "DW_EH_PE_datarel is invalid with a base of 0");
if (result)
result += base;
break;
case DW_EH_PE_textrel:
case DW_EH_PE_funcrel:
case DW_EH_PE_aligned:
default:
@@ -348,7 +353,7 @@ static const void* read_target2_value(const void* ptr)
static const __shim_type_info*
get_shim_type_info(uint64_t ttypeIndex, const uint8_t* classInfo,
uint8_t ttypeEncoding, bool native_exception,
_Unwind_Exception* unwind_exception)
_Unwind_Exception* unwind_exception, uintptr_t /*base*/ = 0)
{
if (classInfo == 0)
{
@@ -371,7 +376,7 @@ static
const __shim_type_info*
get_shim_type_info(uint64_t ttypeIndex, const uint8_t* classInfo,
uint8_t ttypeEncoding, bool native_exception,
_Unwind_Exception* unwind_exception)
_Unwind_Exception* unwind_exception, uintptr_t base = 0)
{
if (classInfo == 0)
{
@@ -400,7 +405,8 @@ get_shim_type_info(uint64_t ttypeIndex, const uint8_t* classInfo,
call_terminate(native_exception, unwind_exception);
}
classInfo -= ttypeIndex;
return (const __shim_type_info*)readEncodedPointer(&classInfo, ttypeEncoding);
return (const __shim_type_info*)readEncodedPointer(&classInfo,
ttypeEncoding, base);
}
#endif // !defined(_LIBCXXABI_ARM_EHABI)
@@ -418,7 +424,8 @@ static
bool
exception_spec_can_catch(int64_t specIndex, const uint8_t* classInfo,
uint8_t ttypeEncoding, const __shim_type_info* excpType,
void* adjustedPtr, _Unwind_Exception* unwind_exception)
void* adjustedPtr, _Unwind_Exception* unwind_exception,
uintptr_t /*base*/ = 0)
{
if (classInfo == 0)
{
@@ -463,7 +470,8 @@ static
bool
exception_spec_can_catch(int64_t specIndex, const uint8_t* classInfo,
uint8_t ttypeEncoding, const __shim_type_info* excpType,
void* adjustedPtr, _Unwind_Exception* unwind_exception)
void* adjustedPtr, _Unwind_Exception* unwind_exception,
uintptr_t base = 0)
{
if (classInfo == 0)
{
@@ -485,7 +493,8 @@ exception_spec_can_catch(int64_t specIndex, const uint8_t* classInfo,
classInfo,
ttypeEncoding,
true,
unwind_exception);
unwind_exception,
base);
void* tempPtr = adjustedPtr;
if (catchType->can_catch(excpType, tempPtr))
return false;
@@ -531,6 +540,9 @@ set_registers(_Unwind_Exception* unwind_exception, _Unwind_Context* context,
{
#if defined(__USING_SJLJ_EXCEPTIONS__)
#define __builtin_eh_return_data_regno(regno) regno
#elif defined(__ibmxl__)
// IBM xlclang++ compiler does not support __builtin_eh_return_data_regno.
#define __builtin_eh_return_data_regno(regno) regno + 3
#endif
_Unwind_SetGR(context, __builtin_eh_return_data_regno(0),
reinterpret_cast<uintptr_t>(unwind_exception));
@@ -610,6 +622,11 @@ static void scan_eh_tab(scan_results &results, _Unwind_Action actions,
return;
}
results.languageSpecificData = lsda;
#if defined(_AIX)
uintptr_t base = _Unwind_GetDataRelBase(context);
#else
uintptr_t base = 0;
#endif
// Get the current instruction pointer and offset it before next
// instruction in the current frame which threw the exception.
uintptr_t ip = _Unwind_GetIP(context) - 1;
@@ -628,13 +645,14 @@ static void scan_eh_tab(scan_results &results, _Unwind_Action actions,
// ip is 1-based index into call site table
#else // !__USING_SJLJ_EXCEPTIONS__
uintptr_t ipOffset = ip - funcStart;
#endif // !defined(_USING_SLJL_EXCEPTIONS__)
#endif // !defined(_USING_SLJL_EXCEPTIONS__)
const uint8_t* classInfo = NULL;
// Note: See JITDwarfEmitter::EmitExceptionTable(...) for corresponding
// dwarf emission
// Parse LSDA header.
uint8_t lpStartEncoding = *lsda++;
const uint8_t* lpStart = (const uint8_t*)readEncodedPointer(&lsda, lpStartEncoding);
const uint8_t* lpStart =
(const uint8_t*)readEncodedPointer(&lsda, lpStartEncoding, base);
if (lpStart == 0)
lpStart = (const uint8_t*)funcStart;
uint8_t ttypeEncoding = *lsda++;
@@ -673,7 +691,7 @@ static void scan_eh_tab(scan_results &results, _Unwind_Action actions,
uintptr_t landingPad = readULEB128(&callSitePtr);
uintptr_t actionEntry = readULEB128(&callSitePtr);
if (--ip == 0)
#endif // __USING_SJLJ_EXCEPTIONS__
#endif // __USING_SJLJ_EXCEPTIONS__
{
// Found the call site containing ip.
#ifndef __USING_SJLJ_EXCEPTIONS__
@@ -687,7 +705,7 @@ static void scan_eh_tab(scan_results &results, _Unwind_Action actions,
results.landingPad = landingPad;
#else // __USING_SJLJ_EXCEPTIONS__
++landingPad;
#endif // __USING_SJLJ_EXCEPTIONS__
#endif // __USING_SJLJ_EXCEPTIONS__
if (actionEntry == 0)
{
// Found a cleanup
@@ -711,7 +729,8 @@ static void scan_eh_tab(scan_results &results, _Unwind_Action actions,
const __shim_type_info* catchType =
get_shim_type_info(static_cast<uint64_t>(ttypeIndex),
classInfo, ttypeEncoding,
native_exception, unwind_exception);
native_exception, unwind_exception,
base);
if (catchType == 0)
{
// Found catch (...) catches everything, including
@@ -772,7 +791,8 @@ static void scan_eh_tab(scan_results &results, _Unwind_Action actions,
}
if (exception_spec_can_catch(ttypeIndex, classInfo,
ttypeEncoding, excpType,
adjustedPtr, unwind_exception))
adjustedPtr,
unwind_exception, base))
{
// Native exception caught by exception
// specification.
@@ -820,7 +840,7 @@ static void scan_eh_tab(scan_results &results, _Unwind_Action actions,
// Possible stack corruption.
call_terminate(native_exception, unwind_exception);
}
#endif // !__USING_SJLJ_EXCEPTIONS__
#endif // !__USING_SJLJ_EXCEPTIONS__
} // there might be some tricky cases which break out of this loop
// It is possible that no eh table entry specify how to handle
@@ -911,6 +931,15 @@ __gxx_personality_v0
// Jump to the handler.
set_registers(unwind_exception, context, results);
// Cache base for calculating the address of ttype in
// __cxa_call_unexpected.
if (results.ttypeIndex < 0) {
#if defined(_AIX)
exception_header->catchTemp = (void *)_Unwind_GetDataRelBase(context);
#else
exception_header->catchTemp = 0;
#endif
}
return _URC_INSTALL_CONTEXT;
}
@@ -940,6 +969,16 @@ __gxx_personality_v0
assert(actions & _UA_CLEANUP_PHASE);
assert(results.reason == _URC_HANDLER_FOUND);
set_registers(unwind_exception, context, results);
// Cache base for calculating the address of ttype in __cxa_call_unexpected.
if (results.ttypeIndex < 0) {
__cxa_exception* exception_header =
(__cxa_exception*)(unwind_exception + 1) - 1;
#if defined(_AIX)
exception_header->catchTemp = (void *)_Unwind_GetDataRelBase(context);
#else
exception_header->catchTemp = 0;
#endif
}
return _URC_INSTALL_CONTEXT;
}
@@ -1114,6 +1153,8 @@ __cxa_call_unexpected(void* arg)
__cxa_exception* old_exception_header = 0;
int64_t ttypeIndex;
const uint8_t* lsda;
uintptr_t base = 0;
if (native_old_exception)
{
old_exception_header = (__cxa_exception*)(unwind_exception+1) - 1;
@@ -1127,6 +1168,7 @@ __cxa_call_unexpected(void* arg)
#else
ttypeIndex = old_exception_header->handlerSwitchValue;
lsda = old_exception_header->languageSpecificData;
base = (uintptr_t)old_exception_header->catchTemp;
#endif
}
else
@@ -1150,11 +1192,13 @@ __cxa_call_unexpected(void* arg)
// Have:
// old_exception_header->languageSpecificData
// old_exception_header->actionRecord
// old_exception_header->catchTemp, base for calculating ttype
// Need
// const uint8_t* classInfo
// uint8_t ttypeEncoding
uint8_t lpStartEncoding = *lsda++;
const uint8_t* lpStart = (const uint8_t*)readEncodedPointer(&lsda, lpStartEncoding);
const uint8_t* lpStart =
(const uint8_t*)readEncodedPointer(&lsda, lpStartEncoding, base);
(void)lpStart; // purposefully unused. Just needed to increment lsda.
uint8_t ttypeEncoding = *lsda++;
if (ttypeEncoding == DW_EH_PE_omit)
@@ -1181,7 +1225,8 @@ __cxa_call_unexpected(void* arg)
((__cxa_dependent_exception*)new_exception_header)->primaryException :
new_exception_header + 1;
if (!exception_spec_can_catch(ttypeIndex, classInfo, ttypeEncoding,
excpType, adjustedPtr, unwind_exception))
excpType, adjustedPtr,
unwind_exception, base))
{
// We need to __cxa_end_catch, but for the old exception,
// not the new one. This is a little tricky ...
@@ -1210,7 +1255,8 @@ __cxa_call_unexpected(void* arg)
std::bad_exception be;
adjustedPtr = &be;
if (!exception_spec_can_catch(ttypeIndex, classInfo, ttypeEncoding,
excpType, adjustedPtr, unwind_exception))
excpType, adjustedPtr,
unwind_exception, base))
{
// We need to __cxa_end_catch for both the old exception and the
// new exception. Technically we should do it in that order.
@@ -1226,6 +1272,15 @@ __cxa_call_unexpected(void* arg)
std::__terminate(t_handler);
}
#if defined(_AIX)
// Personality routine for EH using the range table. Make it an alias of
// __gxx_personality_v0().
_LIBCXXABI_FUNC_VIS _Unwind_Reason_Code __xlcxx_personality_v1(
int version, _Unwind_Action actions, uint64_t exceptionClass,
_Unwind_Exception* unwind_exception, _Unwind_Context* context)
__attribute__((__alias__("__gxx_personality_v0")));
#endif
} // extern "C"
} // __cxxabiv1

View File

@@ -280,17 +280,20 @@ public:
class VendorExtQualType final : public Node {
const Node *Ty;
StringView Ext;
const Node *TA;
public:
VendorExtQualType(const Node *Ty_, StringView Ext_)
: Node(KVendorExtQualType), Ty(Ty_), Ext(Ext_) {}
VendorExtQualType(const Node *Ty_, StringView Ext_, const Node *TA_)
: Node(KVendorExtQualType), Ty(Ty_), Ext(Ext_), TA(TA_) {}
template<typename Fn> void match(Fn F) const { F(Ty, Ext); }
template <typename Fn> void match(Fn F) const { F(Ty, Ext, TA); }
void printLeft(OutputStream &S) const override {
Ty->print(S);
S += " ";
S += Ext;
if (TA != nullptr)
TA->print(S);
}
};
@@ -3680,8 +3683,6 @@ Node *AbstractManglingParser<Derived, Alloc>::parseQualifiedType() {
if (Qual.empty())
return nullptr;
// FIXME parse the optional <template-args> here!
// extension ::= U <objc-name> <objc-type> # objc-type<identifier>
if (Qual.startsWith("objcproto")) {
StringView ProtoSourceName = Qual.dropFront(std::strlen("objcproto"));
@@ -3699,10 +3700,17 @@ Node *AbstractManglingParser<Derived, Alloc>::parseQualifiedType() {
return make<ObjCProtoName>(Child, Proto);
}
Node *TA = nullptr;
if (look() == 'I') {
TA = getDerived().parseTemplateArgs();
if (TA == nullptr)
return nullptr;
}
Node *Child = getDerived().parseQualifiedType();
if (Child == nullptr)
return nullptr;
return make<VendorExtQualType>(Child, Qual);
return make<VendorExtQualType>(Child, Qual, TA);
}
Qualifiers Quals = parseCVQualifiers();
@@ -3875,7 +3883,7 @@ Node *AbstractManglingParser<Derived, Alloc>::parseType() {
// ::= Dh # IEEE 754r half-precision floating point (16 bits)
case 'h':
First += 2;
return make<NameType>("decimal16");
return make<NameType>("half");
// ::= Di # char32_t
case 'i':
First += 2;
@@ -5227,14 +5235,18 @@ Node *AbstractManglingParser<Derived, Alloc>::parseEncoding() {
class SaveTemplateParams {
AbstractManglingParser *Parser;
decltype(TemplateParams) OldParams;
decltype(OuterTemplateParams) OldOuterParams;
public:
SaveTemplateParams(AbstractManglingParser *TheParser) : Parser(TheParser) {
OldParams = std::move(Parser->TemplateParams);
OldOuterParams = std::move(Parser->OuterTemplateParams);
Parser->TemplateParams.clear();
Parser->OuterTemplateParams.clear();
}
~SaveTemplateParams() {
Parser->TemplateParams = std::move(OldParams);
Parser->OuterTemplateParams = std::move(OldOuterParams);
}
} SaveTemplateParams(this);

View File

@@ -36,8 +36,9 @@ public:
StringView(const char *Str) : First(Str), Last(Str + std::strlen(Str)) {}
StringView() : First(nullptr), Last(nullptr) {}
StringView substr(size_t From) const {
return StringView(begin() + From, size() - From);
StringView substr(size_t Pos, size_t Len = npos) const {
assert(Pos <= size());
return StringView(begin() + Pos, std::min(Len, size() - Pos));
}
size_t find(char C, size_t From = 0) const {
@@ -51,14 +52,6 @@ public:
return npos;
}
StringView substr(size_t From, size_t To) const {
if (To >= size())
To = size() - 1;
if (From >= size())
From = size() - 1;
return StringView(First + From, First + To);
}
StringView dropFront(size_t N = 1) const {
if (N >= size())
N = size();

View File

@@ -679,7 +679,7 @@ __dynamic_cast(const void *static_ptr, const __class_type_info *static_type,
info.number_of_dst_type = 1;
dynamic_type->search_above_dst(&info, dynamic_ptr, dynamic_ptr, public_path, true);
}
#endif // _LIBCXXABI_FORGIVING_DYNAMIC_CAST
#endif // _LIBCXXABI_FORGIVING_DYNAMIC_CAST
// Query the search.
if (info.path_dst_ptr_to_static_ptr == public_path)
dst_ptr = dynamic_ptr;
@@ -707,7 +707,7 @@ __dynamic_cast(const void *static_ptr, const __class_type_info *static_type,
info = {dst_type, static_ptr, static_type, src2dst_offset, 0};
dynamic_type->search_below_dst(&info, dynamic_ptr, public_path, true);
}
#endif // _LIBCXXABI_FORGIVING_DYNAMIC_CAST
#endif // _LIBCXXABI_FORGIVING_DYNAMIC_CAST
// Query the search.
switch (info.number_to_static_ptr)
{

View File

@@ -248,4 +248,4 @@ public:
} // __cxxabiv1
#endif // __PRIVATE_TYPEINFO_H_
#endif // __PRIVATE_TYPEINFO_H_

View File

@@ -14,22 +14,22 @@ namespace std
// exception
exception::~exception() _NOEXCEPT
exception::~exception() noexcept
{
}
const char* exception::what() const _NOEXCEPT
const char* exception::what() const noexcept
{
return "std::exception";
}
// bad_exception
bad_exception::~bad_exception() _NOEXCEPT
bad_exception::~bad_exception() noexcept
{
}
const char* bad_exception::what() const _NOEXCEPT
const char* bad_exception::what() const noexcept
{
return "std::bad_exception";
}
@@ -37,32 +37,32 @@ const char* bad_exception::what() const _NOEXCEPT
// bad_alloc
bad_alloc::bad_alloc() _NOEXCEPT
bad_alloc::bad_alloc() noexcept
{
}
bad_alloc::~bad_alloc() _NOEXCEPT
bad_alloc::~bad_alloc() noexcept
{
}
const char*
bad_alloc::what() const _NOEXCEPT
bad_alloc::what() const noexcept
{
return "std::bad_alloc";
}
// bad_array_new_length
bad_array_new_length::bad_array_new_length() _NOEXCEPT
bad_array_new_length::bad_array_new_length() noexcept
{
}
bad_array_new_length::~bad_array_new_length() _NOEXCEPT
bad_array_new_length::~bad_array_new_length() noexcept
{
}
const char*
bad_array_new_length::what() const _NOEXCEPT
bad_array_new_length::what() const noexcept
{
return "bad_array_new_length";
}

View File

@@ -12,8 +12,8 @@
#include <new>
#include <cstdlib>
#if !defined(_THROW_BAD_ALLOC) || !defined(_NOEXCEPT) || !defined(_LIBCXXABI_WEAK)
#error The _THROW_BAD_ALLOC, _NOEXCEPT, and _LIBCXXABI_WEAK libc++ macros must \
#if !defined(_THROW_BAD_ALLOC) || !defined(_LIBCXXABI_WEAK)
#error The _THROW_BAD_ALLOC and _LIBCXXABI_WEAK libc++ macros must \
already be defined by libc++.
#endif
// Implement all new and delete operators as weak definitions
@@ -46,20 +46,20 @@ operator new(std::size_t size) _THROW_BAD_ALLOC
_LIBCXXABI_WEAK
void*
operator new(size_t size, const std::nothrow_t&) _NOEXCEPT
operator new(size_t size, const std::nothrow_t&) noexcept
{
void* p = nullptr;
#ifndef _LIBCXXABI_NO_EXCEPTIONS
try
{
#endif // _LIBCXXABI_NO_EXCEPTIONS
#endif // _LIBCXXABI_NO_EXCEPTIONS
p = ::operator new(size);
#ifndef _LIBCXXABI_NO_EXCEPTIONS
}
catch (...)
{
}
#endif // _LIBCXXABI_NO_EXCEPTIONS
#endif // _LIBCXXABI_NO_EXCEPTIONS
return p;
}
@@ -72,61 +72,61 @@ operator new[](size_t size) _THROW_BAD_ALLOC
_LIBCXXABI_WEAK
void*
operator new[](size_t size, const std::nothrow_t&) _NOEXCEPT
operator new[](size_t size, const std::nothrow_t&) noexcept
{
void* p = nullptr;
#ifndef _LIBCXXABI_NO_EXCEPTIONS
try
{
#endif // _LIBCXXABI_NO_EXCEPTIONS
#endif // _LIBCXXABI_NO_EXCEPTIONS
p = ::operator new[](size);
#ifndef _LIBCXXABI_NO_EXCEPTIONS
}
catch (...)
{
}
#endif // _LIBCXXABI_NO_EXCEPTIONS
#endif // _LIBCXXABI_NO_EXCEPTIONS
return p;
}
_LIBCXXABI_WEAK
void
operator delete(void* ptr) _NOEXCEPT
operator delete(void* ptr) noexcept
{
::free(ptr);
}
_LIBCXXABI_WEAK
void
operator delete(void* ptr, const std::nothrow_t&) _NOEXCEPT
operator delete(void* ptr, const std::nothrow_t&) noexcept
{
::operator delete(ptr);
}
_LIBCXXABI_WEAK
void
operator delete(void* ptr, size_t) _NOEXCEPT
operator delete(void* ptr, size_t) noexcept
{
::operator delete(ptr);
}
_LIBCXXABI_WEAK
void
operator delete[] (void* ptr) _NOEXCEPT
operator delete[] (void* ptr) noexcept
{
::operator delete(ptr);
}
_LIBCXXABI_WEAK
void
operator delete[] (void* ptr, const std::nothrow_t&) _NOEXCEPT
operator delete[] (void* ptr, const std::nothrow_t&) noexcept
{
::operator delete[](ptr);
}
_LIBCXXABI_WEAK
void
operator delete[] (void* ptr, size_t) _NOEXCEPT
operator delete[] (void* ptr, size_t) noexcept
{
::operator delete[](ptr);
}
@@ -167,20 +167,20 @@ operator new(std::size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC
_LIBCXXABI_WEAK
void*
operator new(size_t size, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT
operator new(size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept
{
void* p = nullptr;
#ifndef _LIBCXXABI_NO_EXCEPTIONS
try
{
#endif // _LIBCXXABI_NO_EXCEPTIONS
#endif // _LIBCXXABI_NO_EXCEPTIONS
p = ::operator new(size, alignment);
#ifndef _LIBCXXABI_NO_EXCEPTIONS
}
catch (...)
{
}
#endif // _LIBCXXABI_NO_EXCEPTIONS
#endif // _LIBCXXABI_NO_EXCEPTIONS
return p;
}
@@ -193,61 +193,61 @@ operator new[](size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC
_LIBCXXABI_WEAK
void*
operator new[](size_t size, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT
operator new[](size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept
{
void* p = nullptr;
#ifndef _LIBCXXABI_NO_EXCEPTIONS
try
{
#endif // _LIBCXXABI_NO_EXCEPTIONS
#endif // _LIBCXXABI_NO_EXCEPTIONS
p = ::operator new[](size, alignment);
#ifndef _LIBCXXABI_NO_EXCEPTIONS
}
catch (...)
{
}
#endif // _LIBCXXABI_NO_EXCEPTIONS
#endif // _LIBCXXABI_NO_EXCEPTIONS
return p;
}
_LIBCXXABI_WEAK
void
operator delete(void* ptr, std::align_val_t) _NOEXCEPT
operator delete(void* ptr, std::align_val_t) noexcept
{
std::__libcpp_aligned_free(ptr);
}
_LIBCXXABI_WEAK
void
operator delete(void* ptr, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT
operator delete(void* ptr, std::align_val_t alignment, const std::nothrow_t&) noexcept
{
::operator delete(ptr, alignment);
}
_LIBCXXABI_WEAK
void
operator delete(void* ptr, size_t, std::align_val_t alignment) _NOEXCEPT
operator delete(void* ptr, size_t, std::align_val_t alignment) noexcept
{
::operator delete(ptr, alignment);
}
_LIBCXXABI_WEAK
void
operator delete[] (void* ptr, std::align_val_t alignment) _NOEXCEPT
operator delete[] (void* ptr, std::align_val_t alignment) noexcept
{
::operator delete(ptr, alignment);
}
_LIBCXXABI_WEAK
void
operator delete[] (void* ptr, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT
operator delete[] (void* ptr, std::align_val_t alignment, const std::nothrow_t&) noexcept
{
::operator delete[](ptr, alignment);
}
_LIBCXXABI_WEAK
void
operator delete[] (void* ptr, size_t, std::align_val_t alignment) _NOEXCEPT
operator delete[] (void* ptr, size_t, std::align_val_t alignment) noexcept
{
::operator delete[](ptr, alignment);
}

View File

@@ -6,7 +6,6 @@
//
//===----------------------------------------------------------------------===//
#include "../../libcxx/src/include/refstring.h"
#include "stdexcept"
#include "new"
#include <cstdlib>
@@ -14,34 +13,37 @@
#include <cstdint>
#include <cstddef>
// This includes an implementation file from libc++.
#include "../../libcxx/src/include/refstring.h"
static_assert(sizeof(std::__libcpp_refstring) == sizeof(const char *), "");
namespace std // purposefully not using versioning namespace
{
logic_error::~logic_error() _NOEXCEPT {}
logic_error::~logic_error() noexcept {}
const char*
logic_error::what() const _NOEXCEPT
logic_error::what() const noexcept
{
return __imp_.c_str();
}
runtime_error::~runtime_error() _NOEXCEPT {}
runtime_error::~runtime_error() noexcept {}
const char*
runtime_error::what() const _NOEXCEPT
runtime_error::what() const noexcept
{
return __imp_.c_str();
}
domain_error::~domain_error() _NOEXCEPT {}
invalid_argument::~invalid_argument() _NOEXCEPT {}
length_error::~length_error() _NOEXCEPT {}
out_of_range::~out_of_range() _NOEXCEPT {}
domain_error::~domain_error() noexcept {}
invalid_argument::~invalid_argument() noexcept {}
length_error::~length_error() noexcept {}
out_of_range::~out_of_range() noexcept {}
range_error::~range_error() _NOEXCEPT {}
overflow_error::~overflow_error() _NOEXCEPT {}
underflow_error::~underflow_error() _NOEXCEPT {}
range_error::~range_error() noexcept {}
overflow_error::~overflow_error() noexcept {}
underflow_error::~underflow_error() noexcept {}
} // std

View File

@@ -19,32 +19,32 @@ type_info::~type_info()
// bad_cast
bad_cast::bad_cast() _NOEXCEPT
bad_cast::bad_cast() noexcept
{
}
bad_cast::~bad_cast() _NOEXCEPT
bad_cast::~bad_cast() noexcept
{
}
const char*
bad_cast::what() const _NOEXCEPT
bad_cast::what() const noexcept
{
return "std::bad_cast";
}
// bad_typeid
bad_typeid::bad_typeid() _NOEXCEPT
bad_typeid::bad_typeid() noexcept
{
}
bad_typeid::~bad_typeid() _NOEXCEPT
bad_typeid::~bad_typeid() noexcept
{
}
const char*
bad_typeid::what() const _NOEXCEPT
bad_typeid::what() const noexcept
{
return "std::bad_typeid";
}