diff options
Diffstat (limited to 'lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp')
-rw-r--r-- | lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp index bbc03126ea2..f8e448ffcb6 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp @@ -1724,17 +1724,15 @@ void ClangExpressionDeclMap::AddOneGenericVariable(NameSearchContext &context, if (target == nullptr) return; - ASTContext *scratch_ast_context = - target->GetScratchClangASTContext()->getASTContext(); - - TypeFromUser user_type( - ClangASTContext::GetBasicType(scratch_ast_context, eBasicTypeVoid) - .GetPointerType() - .GetLValueReferenceType()); - TypeFromParser parser_type( - ClangASTContext::GetBasicType(m_ast_context, eBasicTypeVoid) - .GetPointerType() - .GetLValueReferenceType()); + ClangASTContext *scratch_ast_context = target->GetScratchClangASTContext(); + + TypeFromUser user_type(scratch_ast_context->GetBasicType(eBasicTypeVoid) + .GetPointerType() + .GetLValueReferenceType()); + ClangASTContext *own_context = ClangASTContext::GetASTContext(m_ast_context); + TypeFromParser parser_type(own_context->GetBasicType(eBasicTypeVoid) + .GetPointerType() + .GetLValueReferenceType()); NamedDecl *var_decl = context.AddVarDecl(parser_type); std::string decl_name(context.m_decl_name.getAsString()); @@ -2024,8 +2022,9 @@ void ClangExpressionDeclMap::AddThisType(NameSearchContext &context, if (copied_clang_type.IsAggregateType() && copied_clang_type.GetCompleteType()) { - CompilerType void_clang_type = - ClangASTContext::GetBasicType(m_ast_context, eBasicTypeVoid); + ClangASTContext *own_context = + ClangASTContext::GetASTContext(m_ast_context); + CompilerType void_clang_type = own_context->GetBasicType(eBasicTypeVoid); CompilerType void_ptr_clang_type = void_clang_type.GetPointerType(); CompilerType method_type = ClangASTContext::CreateFunctionType( |