Author: ericwf Date: Tue Jan 19 17:40:49 2016 New Revision: 258228 URL: http://llvm.org/viewvc/llvm-project?rev=258228&view=rev Log: Revert r258222 because it's missing files. Will re-commit complete patch
Modified: libcxxabi/trunk/src/private_typeinfo.cpp Modified: libcxxabi/trunk/src/private_typeinfo.cpp URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/private_typeinfo.cpp?rev=258228&r1=258227&r2=258228&view=diff ============================================================================== --- libcxxabi/trunk/src/private_typeinfo.cpp (original) +++ libcxxabi/trunk/src/private_typeinfo.cpp Tue Jan 19 17:40:49 2016 @@ -34,12 +34,9 @@ // // _LIBCXX_DYNAMIC_FALLBACK is currently off by default. - -#include <string.h> - - #ifdef _LIBCXX_DYNAMIC_FALLBACK #include "abort_message.h" +#include <string.h> #include <sys/syslog.h> #endif @@ -60,19 +57,31 @@ namespace __cxxabiv1 #pragma GCC visibility push(hidden) +#ifdef _LIBCXX_DYNAMIC_FALLBACK + inline bool is_equal(const std::type_info* x, const std::type_info* y, bool use_strcmp) { -#ifndef _WIN32 if (!use_strcmp) return x == y; return strcmp(x->name(), y->name()) == 0; +} + +#else // !_LIBCXX_DYNAMIC_FALLBACK + +inline +bool +is_equal(const std::type_info* x, const std::type_info* y, bool) +{ +#ifndef _WIN32 + return x == y; #else return (x == y) || (strcmp(x->name(), y->name()) == 0); -#endif +#endif } +#endif // _LIBCXX_DYNAMIC_FALLBACK // __shim_type_info @@ -342,17 +351,8 @@ bool __pbase_type_info::can_catch(const __shim_type_info* thrown_type, void*&) const { - if (is_equal(thrown_type, &typeid(std::nullptr_t), false)) return true; - bool use_strcmp = this->__flags & (__incomplete_class_mask | - __incomplete_mask); - if (!use_strcmp) { - const __pbase_type_info* thrown_pbase = dynamic_cast<const __pbase_type_info*>( - thrown_type); - if (!thrown_pbase) return false; - use_strcmp = thrown_pbase->__flags & (__incomplete_class_mask | - __incomplete_mask); - } - return is_equal(this, thrown_type, use_strcmp); + return is_equal(this, thrown_type, false) || + is_equal(thrown_type, &typeid(std::nullptr_t), false); } #ifdef __clang__ _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits