Author: ericwf Date: Fri Nov 18 03:54:49 2016 New Revision: 287327 URL: http://llvm.org/viewvc/llvm-project?rev=287327&view=rev Log: Rename TU names to not conflict with libc++.
In order to easily merge libc++ and libc++abi static archives it's important that none of the source files share the same name. (See http://stackoverflow.com/questions/3821916/how-to-merge-two-ar-static-libraries-into-one) This patch renames source files which share a name with libc++ sources. Added: libcxxabi/trunk/src/stdlib_exception.cpp libcxxabi/trunk/src/stdlib_stdexcept.cpp libcxxabi/trunk/src/stdlib_typeinfo.cpp Removed: libcxxabi/trunk/src/exception.cpp libcxxabi/trunk/src/stdexcept.cpp libcxxabi/trunk/src/typeinfo.cpp Modified: libcxxabi/trunk/src/CMakeLists.txt Modified: libcxxabi/trunk/src/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/CMakeLists.txt?rev=287327&r1=287326&r2=287327&view=diff ============================================================================== --- libcxxabi/trunk/src/CMakeLists.txt (original) +++ libcxxabi/trunk/src/CMakeLists.txt Fri Nov 18 03:54:49 2016 @@ -1,6 +1,6 @@ # Get sources set(LIBCXXABI_SOURCES - abort_message.cpp + # C++ABI files cxa_aux_runtime.cpp cxa_default_handlers.cpp cxa_demangle.cpp @@ -11,11 +11,14 @@ set(LIBCXXABI_SOURCES cxa_unexpected.cpp cxa_vector.cpp cxa_virtual.cpp - exception.cpp + # C++ STL files + stdlib_exception.cpp + stdlib_stdexcept.cpp + stdlib_typeinfo.cpp + # Internal files + abort_message.cpp fallback_malloc.cpp private_typeinfo.cpp - stdexcept.cpp - typeinfo.cpp ) if (LIBCXXABI_ENABLE_EXCEPTIONS) Removed: libcxxabi/trunk/src/exception.cpp URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/exception.cpp?rev=287326&view=auto ============================================================================== --- libcxxabi/trunk/src/exception.cpp (original) +++ libcxxabi/trunk/src/exception.cpp (removed) @@ -1,41 +0,0 @@ -//===---------------------------- exception.cpp ---------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include <exception> - -#pragma GCC visibility push(default) - -namespace std -{ - -// exception - -exception::~exception() _NOEXCEPT -{ -} - -const char* exception::what() const _NOEXCEPT -{ - return "std::exception"; -} - -// bad_exception - -bad_exception::~bad_exception() _NOEXCEPT -{ -} - -const char* bad_exception::what() const _NOEXCEPT -{ - return "std::bad_exception"; -} - -} // std - -#pragma GCC visibility pop Removed: libcxxabi/trunk/src/stdexcept.cpp URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/stdexcept.cpp?rev=287326&view=auto ============================================================================== --- libcxxabi/trunk/src/stdexcept.cpp (original) +++ libcxxabi/trunk/src/stdexcept.cpp (removed) @@ -1,48 +0,0 @@ -//===------------------------ stdexcept.cpp -------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "__refstring" -#include "stdexcept" -#include "new" -#include <cstdlib> -#include <cstring> -#include <cstdint> -#include <cstddef> - -static_assert(sizeof(std::__libcpp_refstring) == sizeof(const char *), ""); - -namespace std // purposefully not using versioning namespace -{ - -logic_error::~logic_error() _NOEXCEPT {} - -const char* -logic_error::what() const _NOEXCEPT -{ - return __imp_.c_str(); -} - -runtime_error::~runtime_error() _NOEXCEPT {} - -const char* -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 {} - -range_error::~range_error() _NOEXCEPT {} -overflow_error::~overflow_error() _NOEXCEPT {} -underflow_error::~underflow_error() _NOEXCEPT {} - -} // std Added: libcxxabi/trunk/src/stdlib_exception.cpp URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/stdlib_exception.cpp?rev=287327&view=auto ============================================================================== --- libcxxabi/trunk/src/stdlib_exception.cpp (added) +++ libcxxabi/trunk/src/stdlib_exception.cpp Fri Nov 18 03:54:49 2016 @@ -0,0 +1,41 @@ +//===---------------------------- exception.cpp ---------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include <exception> + +#pragma GCC visibility push(default) + +namespace std +{ + +// exception + +exception::~exception() _NOEXCEPT +{ +} + +const char* exception::what() const _NOEXCEPT +{ + return "std::exception"; +} + +// bad_exception + +bad_exception::~bad_exception() _NOEXCEPT +{ +} + +const char* bad_exception::what() const _NOEXCEPT +{ + return "std::bad_exception"; +} + +} // std + +#pragma GCC visibility pop Added: libcxxabi/trunk/src/stdlib_stdexcept.cpp URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/stdlib_stdexcept.cpp?rev=287327&view=auto ============================================================================== --- libcxxabi/trunk/src/stdlib_stdexcept.cpp (added) +++ libcxxabi/trunk/src/stdlib_stdexcept.cpp Fri Nov 18 03:54:49 2016 @@ -0,0 +1,48 @@ +//===------------------------ stdexcept.cpp -------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "__refstring" +#include "stdexcept" +#include "new" +#include <cstdlib> +#include <cstring> +#include <cstdint> +#include <cstddef> + +static_assert(sizeof(std::__libcpp_refstring) == sizeof(const char *), ""); + +namespace std // purposefully not using versioning namespace +{ + +logic_error::~logic_error() _NOEXCEPT {} + +const char* +logic_error::what() const _NOEXCEPT +{ + return __imp_.c_str(); +} + +runtime_error::~runtime_error() _NOEXCEPT {} + +const char* +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 {} + +range_error::~range_error() _NOEXCEPT {} +overflow_error::~overflow_error() _NOEXCEPT {} +underflow_error::~underflow_error() _NOEXCEPT {} + +} // std Added: libcxxabi/trunk/src/stdlib_typeinfo.cpp URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/stdlib_typeinfo.cpp?rev=287327&view=auto ============================================================================== --- libcxxabi/trunk/src/stdlib_typeinfo.cpp (added) +++ libcxxabi/trunk/src/stdlib_typeinfo.cpp Fri Nov 18 03:54:49 2016 @@ -0,0 +1,53 @@ +//===----------------------------- typeinfo.cpp ---------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include <typeinfo> + +namespace std +{ + +// type_info + +type_info::~type_info() +{ +} + +// bad_cast + +bad_cast::bad_cast() _NOEXCEPT +{ +} + +bad_cast::~bad_cast() _NOEXCEPT +{ +} + +const char* +bad_cast::what() const _NOEXCEPT +{ + return "std::bad_cast"; +} + +// bad_typeid + +bad_typeid::bad_typeid() _NOEXCEPT +{ +} + +bad_typeid::~bad_typeid() _NOEXCEPT +{ +} + +const char* +bad_typeid::what() const _NOEXCEPT +{ + return "std::bad_typeid"; +} + +} // std Removed: libcxxabi/trunk/src/typeinfo.cpp URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/typeinfo.cpp?rev=287326&view=auto ============================================================================== --- libcxxabi/trunk/src/typeinfo.cpp (original) +++ libcxxabi/trunk/src/typeinfo.cpp (removed) @@ -1,53 +0,0 @@ -//===----------------------------- typeinfo.cpp ---------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include <typeinfo> - -namespace std -{ - -// type_info - -type_info::~type_info() -{ -} - -// bad_cast - -bad_cast::bad_cast() _NOEXCEPT -{ -} - -bad_cast::~bad_cast() _NOEXCEPT -{ -} - -const char* -bad_cast::what() const _NOEXCEPT -{ - return "std::bad_cast"; -} - -// bad_typeid - -bad_typeid::bad_typeid() _NOEXCEPT -{ -} - -bad_typeid::~bad_typeid() _NOEXCEPT -{ -} - -const char* -bad_typeid::what() const _NOEXCEPT -{ - return "std::bad_typeid"; -} - -} // std _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits