diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2018-01-26 01:22:17 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2018-01-26 01:22:17 +0000 |
commit | 1634c15e3c7e57bf95bb2bab7f5ea6a8a353d7c8 (patch) | |
tree | 39f515d0864dd8293668356310632516d64ce08a /libcxx/src | |
parent | 0aa71a4f86b933e728b9bc02c409e4b21f671502 (diff) | |
download | bcm5719-llvm-1634c15e3c7e57bf95bb2bab7f5ea6a8a353d7c8.tar.gz bcm5719-llvm-1634c15e3c7e57bf95bb2bab7f5ea6a8a353d7c8.zip |
libcxx: Use vcruntime declarations for typeinfo on Windows.
We need to use the vcruntime declarations on Windows to avoid an
ODR violation involving rtti.obj, which provides the definition of
the runtime function implementing dynamic_cast and depends on the
vcruntime implementations of bad_cast and bad_typeid.
Differential Revision: https://reviews.llvm.org/D42220
llvm-svn: 323491
Diffstat (limited to 'libcxx/src')
-rw-r--r-- | libcxx/src/support/runtime/exception_msvc.ipp | 2 | ||||
-rw-r--r-- | libcxx/src/typeinfo.cpp | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/libcxx/src/support/runtime/exception_msvc.ipp b/libcxx/src/support/runtime/exception_msvc.ipp index 854d3864f79..87d5a66fc8f 100644 --- a/libcxx/src/support/runtime/exception_msvc.ipp +++ b/libcxx/src/support/runtime/exception_msvc.ipp @@ -97,6 +97,7 @@ bad_array_length::what() const _NOEXCEPT return "bad_array_length"; } +#if defined(_LIBCPP_NO_VCRUNTIME) bad_cast::bad_cast() _NOEXCEPT { } @@ -125,7 +126,6 @@ bad_typeid::what() const _NOEXCEPT return "std::bad_typeid"; } -#if defined(_LIBCPP_NO_VCRUNTIME) exception::~exception() _NOEXCEPT { } diff --git a/libcxx/src/typeinfo.cpp b/libcxx/src/typeinfo.cpp index 0cb193b77d9..42ff9351ed2 100644 --- a/libcxx/src/typeinfo.cpp +++ b/libcxx/src/typeinfo.cpp @@ -9,7 +9,7 @@ #include "typeinfo" -#if defined(_LIBCPP_ABI_MICROSOFT) +#if defined(_LIBCPP_ABI_MICROSOFT) && defined(_LIBCPP_NO_VCRUNTIME) #include <string.h> int std::type_info::__compare(const type_info &__rhs) const _NOEXCEPT { @@ -49,7 +49,8 @@ size_t std::type_info::hash_code() const _NOEXCEPT { // FIXME: Remove __APPLE__ default here once buildit is gone. // FIXME: Remove the _LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY configuration. #if (!defined(LIBCXX_BUILDING_LIBCXXABI) && !defined(LIBCXXRT) && \ - !defined(__GLIBCXX__) && !defined(__APPLE__)) || \ + !defined(__GLIBCXX__) && !defined(__APPLE__) && \ + !(defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_NO_VCRUNTIME))) || \ defined(_LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY) std::type_info::~type_info() { |