summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression/ClangASTSource.cpp
diff options
context:
space:
mode:
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 32fbb88d8c5..4632d4f452d 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;
@@ -1881,9 +1881,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);
@@ -1903,16 +1907,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);
@@ -1930,12 +1938,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;
@@ -2026,7 +2038,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