aboutsummaryrefslogtreecommitdiffstats
path: root/source/Plugins/Language/ObjC/NSArray.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Plugins/Language/ObjC/NSArray.cpp')
-rw-r--r--source/Plugins/Language/ObjC/NSArray.cpp26
1 files changed, 14 insertions, 12 deletions
diff --git a/source/Plugins/Language/ObjC/NSArray.cpp b/source/Plugins/Language/ObjC/NSArray.cpp
index 404dabf2870c..7219c016dfd1 100644
--- a/source/Plugins/Language/ObjC/NSArray.cpp
+++ b/source/Plugins/Language/ObjC/NSArray.cpp
@@ -461,12 +461,13 @@ lldb_private::formatters::NSArrayMSyntheticFrontEndBase::NSArrayMSyntheticFrontE
: SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(), m_ptr_size(8),
m_id_type() {
if (valobj_sp) {
- clang::ASTContext *ast = valobj_sp->GetExecutionContextRef()
- .GetTargetSP()
- ->GetScratchClangASTContext()
- ->getASTContext();
- if (ast)
- m_id_type = CompilerType(ast, ast->ObjCBuiltinIdTy);
+ auto *clang_ast_context = valobj_sp->GetExecutionContextRef()
+ .GetTargetSP()
+ ->GetScratchClangASTContext();
+ if (clang_ast_context)
+ m_id_type = CompilerType(
+ clang_ast_context,
+ clang_ast_context->getASTContext()->ObjCBuiltinIdTy.getAsOpaquePtr());
if (valobj_sp->GetProcessSP())
m_ptr_size = valobj_sp->GetProcessSP()->GetAddressByteSize();
}
@@ -609,12 +610,13 @@ lldb_private::formatters::GenericNSArrayISyntheticFrontEnd<D32, D64, Inline>::
if (valobj_sp) {
CompilerType type = valobj_sp->GetCompilerType();
if (type) {
- ClangASTContext *ast = valobj_sp->GetExecutionContextRef()
- .GetTargetSP()
- ->GetScratchClangASTContext();
- if (ast)
- m_id_type = CompilerType(ast->getASTContext(),
- ast->getASTContext()->ObjCBuiltinIdTy);
+ auto *clang_ast_context = valobj_sp->GetExecutionContextRef()
+ .GetTargetSP()
+ ->GetScratchClangASTContext();
+ if (clang_ast_context)
+ m_id_type = CompilerType(clang_ast_context,
+ clang_ast_context->getASTContext()
+ ->ObjCBuiltinIdTy.getAsOpaquePtr());
}
}
}