diff options
Diffstat (limited to 'lldb/source')
-rw-r--r-- | lldb/source/Expression/ClangExpressionDeclMap.cpp | 13 | ||||
-rw-r--r-- | lldb/source/Symbol/ClangASTContext.cpp | 16 |
2 files changed, 23 insertions, 6 deletions
diff --git a/lldb/source/Expression/ClangExpressionDeclMap.cpp b/lldb/source/Expression/ClangExpressionDeclMap.cpp index 4e52d8f528c..02c93cb18f3 100644 --- a/lldb/source/Expression/ClangExpressionDeclMap.cpp +++ b/lldb/source/Expression/ClangExpressionDeclMap.cpp @@ -1208,9 +1208,12 @@ ClangExpressionDeclMap::GetObjectPointer return false; } + const bool ignore_const = true; + VariableSP object_ptr_var = FindVariableInScope (*frame, object_name, - (suppress_type_check ? NULL : &m_struct_vars->m_object_pointer_type)); + (suppress_type_check ? NULL : &m_struct_vars->m_object_pointer_type), + ignore_const); if (!object_ptr_var) { @@ -2158,7 +2161,8 @@ ClangExpressionDeclMap::FindVariableInScope ( StackFrame &frame, const ConstString &name, - TypeFromUser *type + TypeFromUser *type, + bool ignore_const ) { lldb::LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS)); @@ -2183,7 +2187,10 @@ ClangExpressionDeclMap::FindVariableInScope { if (type->GetASTContext() == var_sp->GetType()->GetClangAST()) { - if (!ClangASTContext::AreTypesSame(type->GetASTContext(), type->GetOpaqueQualType(), var_sp->GetType()->GetClangFullType())) + if (!ClangASTContext::AreTypesSame(type->GetASTContext(), + type->GetOpaqueQualType(), + var_sp->GetType()->GetClangFullType(), + ignore_const)) return lldb::VariableSP(); } else diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp index 740ad23f021..9bb893ced20 100644 --- a/lldb/source/Symbol/ClangASTContext.cpp +++ b/lldb/source/Symbol/ClangASTContext.cpp @@ -1031,10 +1031,20 @@ ClangASTContext::CopyDecl (ASTContext *dst_ast, bool ClangASTContext::AreTypesSame(ASTContext *ast, clang_type_t type1, - clang_type_t type2) + clang_type_t type2, + bool ignore_qualifiers) { - return ast->hasSameType (QualType::getFromOpaquePtr(type1), - QualType::getFromOpaquePtr(type2)); + QualType type1_qual = QualType::getFromOpaquePtr(type1); + QualType type2_qual = QualType::getFromOpaquePtr(type2); + + if (ignore_qualifiers) + { + type1_qual = type1_qual.getUnqualifiedType(); + type2_qual = type2_qual.getUnqualifiedType(); + } + + return ast->hasSameType (type1_qual, + type2_qual); } #pragma mark CVR modifiers |