Skip to content

Commit 6977ee7

Browse files
committed
Revert r256322 (and follow-up 256323), the test it added does not pass on OS X.
llvm-svn: 257896
1 parent f7d5e40 commit 6977ee7

File tree

2 files changed

+17
-179
lines changed

2 files changed

+17
-179
lines changed

libcxxabi/src/private_typeinfo.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,9 @@
3434
//
3535
// _LIBCXX_DYNAMIC_FALLBACK is currently off by default.
3636

37-
38-
#include <string.h>
39-
40-
4137
#ifdef _LIBCXX_DYNAMIC_FALLBACK
4238
#include "abort_message.h"
39+
#include <string.h>
4340
#include <sys/syslog.h>
4441
#endif
4542

@@ -60,19 +57,31 @@ namespace __cxxabiv1
6057

6158
#pragma GCC visibility push(hidden)
6259

60+
#ifdef _LIBCXX_DYNAMIC_FALLBACK
61+
6362
inline
6463
bool
6564
is_equal(const std::type_info* x, const std::type_info* y, bool use_strcmp)
6665
{
67-
#ifndef _WIN32
6866
if (!use_strcmp)
6967
return x == y;
7068
return strcmp(x->name(), y->name()) == 0;
69+
}
70+
71+
#else // !_LIBCXX_DYNAMIC_FALLBACK
72+
73+
inline
74+
bool
75+
is_equal(const std::type_info* x, const std::type_info* y, bool)
76+
{
77+
#ifndef _WIN32
78+
return x == y;
7179
#else
7280
return (x == y) || (strcmp(x->name(), y->name()) == 0);
73-
#endif
81+
#endif
7482
}
7583

84+
#endif // _LIBCXX_DYNAMIC_FALLBACK
7685

7786
// __shim_type_info
7887

@@ -342,17 +351,8 @@ bool
342351
__pbase_type_info::can_catch(const __shim_type_info* thrown_type,
343352
void*&) const
344353
{
345-
if (is_equal(thrown_type, &typeid(std::nullptr_t), false)) return true;
346-
bool use_strcmp = this->__flags & (__incomplete_class_mask |
347-
__incomplete_mask);
348-
if (!use_strcmp) {
349-
const __pbase_type_info* thrown_pbase = dynamic_cast<const __pbase_type_info*>(
350-
thrown_type);
351-
if (!thrown_pbase) return false;
352-
use_strcmp = thrown_pbase->__flags & (__incomplete_class_mask |
353-
__incomplete_mask);
354-
}
355-
return is_equal(this, thrown_type, use_strcmp);
354+
return is_equal(this, thrown_type, false) ||
355+
is_equal(thrown_type, &typeid(std::nullptr_t), false);
356356
}
357357

358358
#ifdef __clang__

libcxxabi/test/incomplete_type.sh.cpp

Lines changed: 0 additions & 162 deletions
This file was deleted.

0 commit comments

Comments
 (0)