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
diff --git a/lldb/source/Symbol/CompilerDeclContext.cpp b/lldb/source/Symbol/CompilerDeclContext.cpp
index 948ee74..23fba4f 100644
--- a/lldb/source/Symbol/CompilerDeclContext.cpp
+++ b/lldb/source/Symbol/CompilerDeclContext.cpp
@@ -15,7 +15,7 @@
bool
CompilerDeclContext::IsClang () const
{
- return IsValid() && m_type_system->AsClangASTContext() != nullptr;
+ return IsValid() && m_type_system->getKind() == TypeSystem::eKindClang;
}
ConstString