summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/Process.cpp
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
commit056f6f1856513209b46f68ca119e6fcf09aae604 (patch)
tree2432d841afeff8e8f7f84e9516b827cf768c28c6 /lldb/source/Target/Process.cpp
parent6ddd7aa4c3015e45b6624eb1f1e166a4fcf9cec7 (diff)
downloadbcm5719-llvm-056f6f1856513209b46f68ca119e6fcf09aae604.tar.gz
bcm5719-llvm-056f6f1856513209b46f68ca119e6fcf09aae604.zip
[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 llvm-svn: 362884
Diffstat (limited to 'lldb/source/Target/Process.cpp')
-rw-r--r--lldb/source/Target/Process.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp
index b46ded442b4..9f7215619e9 100644
--- a/lldb/source/Target/Process.cpp
+++ b/lldb/source/Target/Process.cpp
@@ -1602,10 +1602,7 @@ ObjCLanguageRuntime *Process::GetObjCLanguageRuntime(bool retry_if_null) {
std::lock_guard<std::recursive_mutex> guard(m_language_runtimes_mutex);
LanguageRuntime *runtime =
GetLanguageRuntime(eLanguageTypeObjC, retry_if_null);
- if (!runtime)
- return nullptr;
-
- return static_cast<ObjCLanguageRuntime *>(runtime);
+ return llvm::cast_or_null<ObjCLanguageRuntime>(runtime);
}
bool Process::IsPossibleDynamicValue(ValueObject &in_value) {
OpenPOWER on IntegriCloud