diff options
author | Eric Fiselier <eric@efcs.ca> | 2017-03-02 02:59:34 +0300 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2017-03-02 02:59:34 +0300 |
commit | 378122744886d5d6450839b30c7f4aadf4823a25 (patch) | |
tree | 7f199f3dfd4b6abdb2d4aa27acef6b31be575c77 /libcxxabi/src/stdlib_exception.cpp | |
parent | b3fd276555cb96a9c70fb3fa8031ce3a4f812a0b (diff) |
Cleanup new/delete definitions
This patch cleans up how libc++abi handles the definitions for new/delete.
It is in preperation for upcoming changes to fix how both libc++ and libc++abi
handle new/delete.
The primary changes in this patch are:
* Move the definitions for bad_array_length and bad_new_array_length
into stdlib_exception.cpp. This way stdlib_new_delete.cpp only
contains new/delete.
* Rename cxa_new_delete.cpp -> stdlib_new_delete.cpp for consistency
with other files.
* Add a FIXME regarding when stdlib_new_delete.cpp is actually compiled
as part of the dylib.
llvm-svn: 296715
Diffstat (limited to 'libcxxabi/src/stdlib_exception.cpp')
-rw-r--r-- | libcxxabi/src/stdlib_exception.cpp | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/libcxxabi/src/stdlib_exception.cpp b/libcxxabi/src/stdlib_exception.cpp index fce6e8a79949..a8f71ab0ecc7 100644 --- a/libcxxabi/src/stdlib_exception.cpp +++ b/libcxxabi/src/stdlib_exception.cpp @@ -7,6 +7,9 @@ // //===----------------------------------------------------------------------===// +#define _LIBCPP_BUILDING_LIBRARY +#define _LIBCPP_BUILDING_NEW +#include <new> #include <exception> namespace std @@ -34,4 +37,67 @@ const char* bad_exception::what() const _NOEXCEPT return "std::bad_exception"; } + +// 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"; +} + +// bad_array_length + +#ifndef _LIBCPP_BAD_ARRAY_LENGTH_DEFINED + +class _LIBCPP_EXCEPTION_ABI bad_array_length + : public bad_alloc +{ +public: + bad_array_length() _NOEXCEPT; + virtual ~bad_array_length() _NOEXCEPT; + virtual const char* what() const _NOEXCEPT; +}; + +#endif // _LIBCPP_BAD_ARRAY_LENGTH_DEFINED + +bad_array_length::bad_array_length() _NOEXCEPT +{ +} + +bad_array_length::~bad_array_length() _NOEXCEPT +{ +} + +const char* +bad_array_length::what() const _NOEXCEPT +{ + return "bad_array_length"; +} + + } // std |