[libc++] Disentangle the 3 implementations of type_info
authorLouis Dionne <ldionne@apple.com>
Fri, 1 Feb 2019 20:00:13 +0000 (20:00 +0000)
committerLouis Dionne <ldionne@apple.com>
Fri, 1 Feb 2019 20:00:13 +0000 (20:00 +0000)
commit6b653fc70ffdc3ec685a435b42c45611e21d407c
treef56ca76150bd9a4aadf12447f78d695d7f1d480f
parent8b323f53eb4037e06c61f4b3479959056a4ca166
[libc++] Disentangle the 3 implementations of type_info

Summary:
We currently have effectively 3 implementations of type_info: one for
the Microsoft ABI, one that does not assume that there's a unique copy
of each RTTI in a progran, and one that assumes a unique copy.

Those 3 implementations are entangled into the same class with nested
ifdefs, which makes it very difficult to understand. Furthermore, the
benefit of doing this is rather small since the code that is duplicated
across implementations is just a couple of trivial lines.

This patch stamps out the 3 versions of type_info explicitly to increase
readability. It also explains what's going on with short comments, because
it's far from obvious.

Reviewers: EricWF, mclow.lists

Subscribers: christof, jkorous, dexonsmith

Differential Revision: https://reviews.llvm.org/D57606

llvm-svn: 352905
libcxx/include/typeinfo