[Support] Add support RTTI support for open class hierarchies.
authorLang Hames <lhames@gmail.com>
Sat, 11 Apr 2020 00:23:20 +0000 (17:23 -0700)
committerLang Hames <lhames@gmail.com>
Mon, 13 Apr 2020 19:52:44 +0000 (12:52 -0700)
commite823068306e98e91f726c58a2112784f5ead245b
tree98b530d81fe2c93fad12ba1ab3f6f39877f41869
parentec99d6e62f0a3b1146bf670e90cd8f48c62be41e
[Support] Add support RTTI support for open class hierarchies.

This patch extracts the RTTI part of llvm::ErrorInfo into its own class
(RTTIExtends) so that it can be used in other non-error hierarchies, and makes
it compatible with the existing LLVM RTTI function templates (isa, cast,
dyn_cast, dyn_cast_or_null) by adding the classof method.

Differential Revision: https://reviews.llvm.org/D39111
llvm/docs/HowToSetUpLLVMStyleRTTI.rst
llvm/include/llvm/Support/ExtensibleRTTI.h [new file with mode: 0644]
llvm/lib/Support/CMakeLists.txt
llvm/unittests/Support/CMakeLists.txt
llvm/unittests/Support/ExtensibleRTTITest.cpp [new file with mode: 0644]