aboutsummaryrefslogtreecommitdiff
path: root/source/Plugins/Language/ObjC
diff options
context:
space:
mode:
authorAlex Langford <apl@fb.com>2019-08-13 19:40:36 +0000
committerAlex Langford <apl@fb.com>2019-08-13 19:40:36 +0000
commit54c912f725c78bb4b797618af1c22ad02801d39c (patch)
treece601a44e2f171b0119dc90f2d5437900b0a76ba /source/Plugins/Language/ObjC
parentca7099285cc41be3e5c84896e474aa8811030224 (diff)
downloadlldb-54c912f725c78bb4b797618af1c22ad02801d39c.tar.gz
[Symbol] Decouple clang from CompilerType
Summary: Ideally CompilerType would have no knowledge of clang or any individual TypeSystem. Decoupling clang is relatively straightforward. Differential Revision: https://reviews.llvm.org/D66102 git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@368741 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'source/Plugins/Language/ObjC')
-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 404dabf28..7219c016d 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());
}
}
}