aboutsummaryrefslogtreecommitdiff
path: root/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h
diff options
context:
space:
mode:
authorAlex Langford <apl@fb.com>2019-06-08 18:45:00 +0000
committerAlex Langford <apl@fb.com>2019-06-08 18:45:00 +0000
commite02e322d8ff20c7ee8244c0f24508803efbf1b47 (patch)
tree5cfca5ef07a37594b3983bf8a57d8a43885a63ae /source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h
parent0bc178903b01fbf12240028c3847f6ec7e097cbe (diff)
downloadlldb-e02e322d8ff20c7ee8244c0f24508803efbf1b47.tar.gz
[LanguageRuntime] Introduce LLVM-style casts
Summary: Using llvm-style rtti gives us stronger guarantees around casting LanguageRuntimes. As discussed in D62755 Differential Revision: https://reviews.llvm.org/D62934 git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@362884 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h')
-rw-r--r--source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h
index dc588526f..358f9a918 100644
--- a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h
+++ b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h
@@ -35,13 +35,14 @@ public:
static lldb_private::ConstString GetPluginNameStatic();
- static bool classof(const ObjCLanguageRuntime *runtime) {
- switch (runtime->GetRuntimeVersion()) {
- case ObjCRuntimeVersions::eAppleObjC_V2:
- return true;
- default:
- return false;
- }
+ static char ID;
+
+ bool isA(const void *ClassID) const override {
+ return ClassID == &ID || AppleObjCRuntime::isA(ClassID);
+ }
+
+ static bool classof(const LanguageRuntime *runtime) {
+ return runtime->isA(&ID);
}
// These are generic runtime functions: