summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Language
diff options
context:
space:
mode:
authorRaphael Isemann <teemperor@gmail.com>2019-12-21 22:40:52 +0100
committerRaphael Isemann <teemperor@gmail.com>2019-12-21 22:51:35 +0100
commitf9f49d3594bc7584cc5cb96125ca08f2ad97662c (patch)
tree9055539f626cc2ce798d895434b6092a9123cf3e /lldb/source/Plugins/Language
parentbf03e17c570171c7a52117fe63ace89d58f328d5 (diff)
downloadbcm5719-llvm-f9f49d3594bc7584cc5cb96125ca08f2ad97662c.tar.gz
bcm5719-llvm-f9f49d3594bc7584cc5cb96125ca08f2ad97662c.zip
[lldb][NFC] Return a reference from ClangASTContext::getASTContext and remove dead nullptr checks
ClangASTContext::getASTContext() currently returns a ptr but we have an assert there since a while that the ASTContext is not a nullptr. This causes that we still have a lot of code that is doing nullptr checks on the result of getASTContext() which is all unreachable code. This patch changes the return value to a reference to make it clear this can't be a nullptr and deletes all the nullptr checks.
Diffstat (limited to 'lldb/source/Plugins/Language')
-rw-r--r--lldb/source/Plugins/Language/ObjC/NSArray.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Language/ObjC/NSArray.cpp b/lldb/source/Plugins/Language/ObjC/NSArray.cpp
index 3498c9dd23c..64461fc2bc0 100644
--- a/lldb/source/Plugins/Language/ObjC/NSArray.cpp
+++ b/lldb/source/Plugins/Language/ObjC/NSArray.cpp
@@ -466,7 +466,7 @@ lldb_private::formatters::NSArrayMSyntheticFrontEndBase::NSArrayMSyntheticFrontE
if (clang_ast_context)
m_id_type = CompilerType(
clang_ast_context,
- clang_ast_context->getASTContext()->ObjCBuiltinIdTy.getAsOpaquePtr());
+ clang_ast_context->getASTContext().ObjCBuiltinIdTy.getAsOpaquePtr());
if (valobj_sp->GetProcessSP())
m_ptr_size = valobj_sp->GetProcessSP()->GetAddressByteSize();
}
@@ -614,7 +614,7 @@ lldb_private::formatters::GenericNSArrayISyntheticFrontEnd<D32, D64, Inline>::
if (clang_ast_context)
m_id_type = CompilerType(clang_ast_context,
clang_ast_context->getASTContext()
- ->ObjCBuiltinIdTy.getAsOpaquePtr());
+ .ObjCBuiltinIdTy.getAsOpaquePtr());
}
}
}
OpenPOWER on IntegriCloud