summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression/ClangASTSource.cpp
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2015-06-08 22:27:10 +0000
committerPavel Labath <labath@google.com>2015-06-08 22:27:10 +0000
commitc33ae024a64962cb38b64073a035a5fc36aa2214 (patch)
tree4fff2e0f0c816610b412c932fbbb0a6b54ac861c /lldb/source/Expression/ClangASTSource.cpp
parente6eea5d055d06db7aefdfa879ae052a2d34ab464 (diff)
downloadbcm5719-llvm-c33ae024a64962cb38b64073a035a5fc36aa2214.tar.gz
bcm5719-llvm-c33ae024a64962cb38b64073a035a5fc36aa2214.zip
Introduce a TypeSystem interface to support adding non-clang languages.
Reviewers: clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8712 Original Author: Ryan Brown <ribrdb@google.com> llvm-svn: 239360
Diffstat (limited to 'lldb/source/Expression/ClangASTSource.cpp')
-rw-r--r--lldb/source/Expression/ClangASTSource.cpp28
1 files changed, 20 insertions, 8 deletions
diff --git a/lldb/source/Expression/ClangASTSource.cpp b/lldb/source/Expression/ClangASTSource.cpp
index 3988cd674af..b6ea7a870de 100644
--- a/lldb/source/Expression/ClangASTSource.cpp
+++ b/lldb/source/Expression/ClangASTSource.cpp
@@ -277,7 +277,7 @@ ClangASTSource::CompleteType (TagDecl *tag_decl)
if (!clang_type)
continue;
- const TagType *tag_type = clang_type.GetQualType()->getAs<TagType>();
+ const TagType *tag_type = ClangASTContext::GetQualType(clang_type)->getAs<TagType>();
if (!tag_type)
continue;
@@ -316,7 +316,7 @@ ClangASTSource::CompleteType (TagDecl *tag_decl)
if (!clang_type)
continue;
- const TagType *tag_type = clang_type.GetQualType()->getAs<TagType>();
+ const TagType *tag_type = ClangASTContext::GetQualType(clang_type)->getAs<TagType>();
if (!tag_type)
continue;
@@ -1886,9 +1886,13 @@ ClangASTSource::GuardedCopyType (const ClangASTType &src_type)
{
ClangASTMetrics::RegisterLLDBImport();
+ ClangASTContext* src_ast = src_type.GetTypeSystem()->AsClangASTContext();
+ if (!src_ast)
+ return ClangASTType();
+
SetImportInProgress(true);
- QualType copied_qual_type = m_ast_importer->CopyType (m_ast_context, src_type.GetASTContext(), src_type.GetQualType());
+ QualType copied_qual_type = m_ast_importer->CopyType (m_ast_context, src_ast->getASTContext(), ClangASTContext::GetQualType(src_type));
SetImportInProgress(false);
@@ -1908,16 +1912,20 @@ NameSearchContext::AddVarDecl(const ClangASTType &type)
if (!type.IsValid())
return NULL;
+ ClangASTContext* lldb_ast = type.GetTypeSystem()->AsClangASTContext();
+ if (!lldb_ast)
+ return NULL;
+
IdentifierInfo *ii = m_decl_name.getAsIdentifierInfo();
- clang::ASTContext *ast = type.GetASTContext();
+ clang::ASTContext *ast = lldb_ast->getASTContext();
clang::NamedDecl *Decl = VarDecl::Create(*ast,
const_cast<DeclContext*>(m_decl_context),
SourceLocation(),
SourceLocation(),
ii,
- type.GetQualType(),
+ ClangASTContext::GetQualType(type),
0,
SC_Static);
m_decls.push_back(Decl);
@@ -1935,12 +1943,16 @@ NameSearchContext::AddFunDecl (const ClangASTType &type, bool extern_c)
if (m_function_types.count(type))
return NULL;
+
+ ClangASTContext* lldb_ast = type.GetTypeSystem()->AsClangASTContext();
+ if (!lldb_ast)
+ return NULL;
m_function_types.insert(type);
- QualType qual_type (type.GetQualType());
+ QualType qual_type (ClangASTContext::GetQualType(type));
- clang::ASTContext *ast = type.GetASTContext();
+ clang::ASTContext *ast = lldb_ast->getASTContext();
const bool isInlineSpecified = false;
const bool hasWrittenPrototype = true;
@@ -2031,7 +2043,7 @@ NameSearchContext::AddTypeDecl(const ClangASTType &clang_type)
{
if (clang_type)
{
- QualType qual_type = clang_type.GetQualType();
+ QualType qual_type = ClangASTContext::GetQualType(clang_type);
if (const TypedefType *typedef_type = llvm::dyn_cast<TypedefType>(qual_type))
{
OpenPOWER on IntegriCloud