[PATCH] D42220: libcxx: Move bad_cast and bad_typeid member functions inline on Windows.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 17 18:36:08 PST 2018


pcc updated this revision to Diff 130343.
pcc added a comment.

- Use typeinfo declarations from vcruntime


https://reviews.llvm.org/D42220

Files:
  libcxx/include/typeinfo
  libcxx/src/support/runtime/exception_msvc.ipp
  libcxx/src/typeinfo.cpp


Index: libcxx/src/typeinfo.cpp
===================================================================
--- libcxx/src/typeinfo.cpp
+++ 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 @@
 // 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()
 {
Index: libcxx/src/support/runtime/exception_msvc.ipp
===================================================================
--- libcxx/src/support/runtime/exception_msvc.ipp
+++ libcxx/src/support/runtime/exception_msvc.ipp
@@ -97,6 +97,7 @@
     return "bad_array_length";
 }
 
+#if defined(_LIBCPP_NO_VCRUNTIME)
 bad_cast::bad_cast() _NOEXCEPT
 {
 }
@@ -125,7 +126,6 @@
   return "std::bad_typeid";
 }
 
-#if defined(_LIBCPP_NO_VCRUNTIME)
 exception::~exception() _NOEXCEPT
 {
 }
Index: libcxx/include/typeinfo
===================================================================
--- libcxx/include/typeinfo
+++ libcxx/include/typeinfo
@@ -69,6 +69,10 @@
 #pragma GCC system_header
 #endif
 
+#if defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_NO_VCRUNTIME)
+#include <vcruntime_typeinfo.h>
+#else
+
 #if !defined(_LIBCPP_ABI_MICROSOFT)
 #if defined(_LIBCPP_NONUNIQUE_RTTI_BIT)
 #define _LIBCPP_HAS_NONUNIQUE_TYPEINFO
@@ -219,6 +223,8 @@
 
 }  // std
 
+#endif // defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_NO_VCRUNTIME)
+
 _LIBCPP_BEGIN_NAMESPACE_STD
 _LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
 void __throw_bad_cast()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42220.130343.patch
Type: text/x-patch
Size: 2096 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180118/bd76bba3/attachment.bin>


More information about the llvm-commits mailing list