diff --git a/libcxxabi/src/cxa_new_delete.cpp b/libcxxabi/src/cxa_new_delete.cpp index 7435bac82447..6352001b66fe 100644 --- a/libcxxabi/src/cxa_new_delete.cpp +++ b/libcxxabi/src/cxa_new_delete.cpp @@ -192,3 +192,40 @@ operator delete[] (void* ptr, const std::nothrow_t&) { ::operator delete[](ptr); } + +namespace std +{ + +// bad_alloc + +bad_alloc::bad_alloc() _NOEXCEPT +{ +} + +bad_alloc::~bad_alloc() _NOEXCEPT +{ +} + +const char* +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 +{ +} + +const char* +bad_array_new_length::what() const _NOEXCEPT +{ + return "bad_array_new_length"; +} + +} // std diff --git a/libcxxabi/src/private_typeinfo.cpp b/libcxxabi/src/private_typeinfo.cpp index cbe4cdaa6f01..e6cafd7b00a1 100644 --- a/libcxxabi/src/private_typeinfo.cpp +++ b/libcxxabi/src/private_typeinfo.cpp @@ -7,11 +7,11 @@ // //===----------------------------------------------------------------------===// -#define __name __type_name - #include "private_typeinfo.h" +#ifdef DEBUG #include +#endif namespace __cxxabiv1 { @@ -34,66 +34,92 @@ __fundamental_type_info::~__fundamental_type_info() { } -void -__fundamental_type_info::display() const -{ - std::cout << "__fundamental_type_info " << __type_name << '\n'; -} - // __array_type_info __array_type_info::~__array_type_info() { } -void -__array_type_info::display() const -{ - std::cout << "__array_type_info " << __type_name << '\n'; -} - // __function_type_info __function_type_info::~__function_type_info() { } -void -__function_type_info::display() const -{ - std::cout << "__function_type_info " << __type_name << '\n'; -} - // __enum_type_info __enum_type_info::~__enum_type_info() { } -void -__enum_type_info::display() const -{ - std::cout << "__enum_type_info " << __type_name << '\n'; -} - // __class_type_info __class_type_info::~__class_type_info() { } -void -__class_type_info::display() const -{ - std::cout << "__class_type_info " << __type_name << '\n'; -} - // __si_class_type_info __si_class_type_info::~__si_class_type_info() { } +// __vmi_class_type_info + +__vmi_class_type_info::~__vmi_class_type_info() +{ +} + +// __pbase_type_info + +__pbase_type_info::~__pbase_type_info() +{ +} + +// __pointer_type_info + +__pointer_type_info::~__pointer_type_info() +{ +} + +// __pointer_to_member_type_info + +__pointer_to_member_type_info::~__pointer_to_member_type_info() +{ +} + +#ifdef DEBUG + +void +__fundamental_type_info::display() const +{ + std::cout << "__fundamental_type_info " << __type_name << '\n'; +} + +void +__array_type_info::display() const +{ + std::cout << "__array_type_info " << __type_name << '\n'; +} + +void +__function_type_info::display() const +{ + std::cout << "__function_type_info " << __type_name << '\n'; +} + +void +__enum_type_info::display() const +{ + std::cout << "__enum_type_info " << __type_name << '\n'; +} + +void +__class_type_info::display() const +{ + std::cout << "__class_type_info " << __type_name << '\n'; +} + void __si_class_type_info::display() const { @@ -102,12 +128,6 @@ __si_class_type_info::display() const __base_type->display(); } -// __vmi_class_type_info - -__vmi_class_type_info::~__vmi_class_type_info() -{ -} - void __vmi_class_type_info::display() const { @@ -129,18 +149,6 @@ __base_class_type_info::display() const __base_type->display(); } -// __pbase_type_info - -__pbase_type_info::~__pbase_type_info() -{ -} - -// __pointer_type_info - -__pointer_type_info::~__pointer_type_info() -{ -} - void __pointer_type_info::display() const { @@ -159,12 +167,6 @@ __pointer_type_info::display() const __pointee->display(); } -// __pointer_to_member_type_info - -__pointer_to_member_type_info::~__pointer_to_member_type_info() -{ -} - void __pointer_to_member_type_info::display() const { @@ -185,6 +187,8 @@ __pointer_to_member_type_info::display() const __pointee->display(); } +#endif + // can_catch // A handler is a match for an exception object of type E if diff --git a/libcxxabi/src/private_typeinfo.h b/libcxxabi/src/private_typeinfo.h index 9bbd97e677c0..b6c875e0b049 100644 --- a/libcxxabi/src/private_typeinfo.h +++ b/libcxxabi/src/private_typeinfo.h @@ -25,7 +25,9 @@ public: virtual ~__shim_type_info(); virtual bool can_catch(const __shim_type_info* thrown_type, void*& adjustedPtr) const; +#ifdef DEBUG virtual void display() const = 0; +#endif }; class __fundamental_type_info @@ -34,7 +36,9 @@ class __fundamental_type_info public: virtual ~__fundamental_type_info(); virtual bool can_catch(const __shim_type_info*, void*&) const; +#ifdef DEBUG virtual void display() const; +#endif }; class __array_type_info @@ -43,7 +47,9 @@ class __array_type_info public: virtual ~__array_type_info(); virtual bool can_catch(const __shim_type_info*, void*&) const; +#ifdef DEBUG virtual void display() const; +#endif }; class __function_type_info @@ -52,7 +58,9 @@ class __function_type_info public: virtual ~__function_type_info(); virtual bool can_catch(const __shim_type_info*, void*&) const; +#ifdef DEBUG virtual void display() const; +#endif }; class __enum_type_info @@ -61,7 +69,9 @@ class __enum_type_info public: virtual ~__enum_type_info(); virtual bool can_catch(const __shim_type_info*, void*&) const; +#ifdef DEBUG virtual void display() const; +#endif }; enum @@ -136,7 +146,9 @@ public: virtual void search_below_dst(__dynamic_cast_info*, const void*, int) const; virtual bool can_catch(const __shim_type_info*, void*&) const; virtual void has_unambiguous_public_base(__dynamic_cast_info*, void*, int) const; +#ifdef DEBUG virtual void display() const; +#endif }; // Has one non-virtual public base class at offset zero @@ -151,7 +163,9 @@ public: virtual void search_above_dst(__dynamic_cast_info*, const void*, const void*, int) const; virtual void search_below_dst(__dynamic_cast_info*, const void*, int) const; virtual void has_unambiguous_public_base(__dynamic_cast_info*, void*, int) const; +#ifdef DEBUG virtual void display() const; +#endif }; struct __base_class_type_info @@ -170,7 +184,9 @@ public: void search_above_dst(__dynamic_cast_info*, const void*, const void*, int) const; void search_below_dst(__dynamic_cast_info*, const void*, int) const; void has_unambiguous_public_base(__dynamic_cast_info*, void*, int) const; +#ifdef DEBUG void display() const; +#endif }; // Has one or more base classes @@ -195,7 +211,9 @@ public: virtual void search_above_dst(__dynamic_cast_info*, const void*, const void*, int) const; virtual void search_below_dst(__dynamic_cast_info*, const void*, int) const; virtual void has_unambiguous_public_base(__dynamic_cast_info*, void*, int) const; +#ifdef DEBUG virtual void display() const; +#endif }; class __pbase_type_info @@ -224,7 +242,9 @@ class __pointer_type_info public: virtual ~__pointer_type_info(); virtual bool can_catch(const __shim_type_info*, void*&) const; +#ifdef DEBUG virtual void display() const; +#endif }; class __pointer_to_member_type_info @@ -234,7 +254,9 @@ public: const __class_type_info* __context; virtual ~__pointer_to_member_type_info(); +#ifdef DEBUG virtual void display() const; +#endif }; #pragma GCC visibility pop