diff options
author | Greg Clayton <gclayton@apple.com> | 2015-09-08 18:15:05 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2015-09-08 18:15:05 +0000 |
commit | f73034f99a634ba9fa67960633753f729802b6c3 (patch) | |
tree | d2dd3872f57f667f3dfbfad09ff24e944627b386 /lldb/source/DataFormatters/NSArray.cpp | |
parent | 21a145c341e0b2825fa7b58685bc27cac1a8cbcc (diff) | |
download | bcm5719-llvm-f73034f99a634ba9fa67960633753f729802b6c3.tar.gz bcm5719-llvm-f73034f99a634ba9fa67960633753f729802b6c3.zip |
Use LLVM casting for TypeSystem so you can cast it to subclasses.
This will keep our code cleaner and it removes the need for intrusive additions to TypeSystem like:
class TypeSystem
{
virtual ClangASTContext *
AsClangASTContext() = 0;
}
As you can now just use the llvm::dyn_cast and other casts.
llvm-svn: 247041
Diffstat (limited to 'lldb/source/DataFormatters/NSArray.cpp')
-rw-r--r-- | lldb/source/DataFormatters/NSArray.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lldb/source/DataFormatters/NSArray.cpp b/lldb/source/DataFormatters/NSArray.cpp index 0bf340b1338..7630f6bcbcc 100644 --- a/lldb/source/DataFormatters/NSArray.cpp +++ b/lldb/source/DataFormatters/NSArray.cpp @@ -529,11 +529,15 @@ lldb_private::formatters::NSArrayISyntheticFrontEnd::NSArrayISyntheticFrontEnd ( m_items (0), m_data_ptr (0) { - if (valobj_sp && valobj_sp->GetCompilerType().IsValid()) + if (valobj_sp) { - ClangASTContext *ast = valobj_sp->GetCompilerType().GetTypeSystem()->AsClangASTContext(); - if (ast) - m_id_type = CompilerType(ast->getASTContext(), ast->getASTContext()->ObjCBuiltinIdTy); + 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); + } } } |