[Lldb-commits] [lldb] r157214 - /lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
Sean Callanan
scallanan at apple.com
Mon May 21 15:25:52 PDT 2012
Author: spyffe
Date: Mon May 21 17:25:52 2012
New Revision: 157214
URL: http://llvm.org/viewvc/llvm-project?rev=157214&view=rev
Log:
Updated the object-pointer lookup logic to fix
Objective-C "self," which is not a regular pointer.
Modified:
lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
Modified: lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp?rev=157214&r1=157213&r2=157214&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp Mon May 21 17:25:52 2012
@@ -2196,8 +2196,11 @@
!var_sp->LocationIsValidForFrame (&frame))
return lldb::VariableSP();
- if (var_sp && type)
+ if (var_sp)
{
+ if (!type)
+ return var_sp;
+
TypeFromUser candidate_type(var_sp->GetType()->GetClangFullType(),
var_sp->GetType()->GetClangAST());
@@ -2213,30 +2216,44 @@
clang::QualType desired_qual_type = clang::QualType::getFromOpaquePtr(type->GetOpaqueQualType());
clang::QualType candidate_qual_type = clang::QualType::getFromOpaquePtr(candidate_type.GetOpaqueQualType());
+ const clang::ObjCObjectPointerType *desired_objc_ptr_type = desired_qual_type->getAs<clang::ObjCObjectPointerType>();
+ const clang::ObjCObjectPointerType *candidate_objc_ptr_type = desired_qual_type->getAs<clang::ObjCObjectPointerType>();
+
+ if (desired_objc_ptr_type && candidate_objc_ptr_type) {
+ clang::QualType desired_target_type = desired_objc_ptr_type->getPointeeType().getUnqualifiedType();
+ clang::QualType candidate_target_type = candidate_objc_ptr_type->getPointeeType().getUnqualifiedType();
+
+ if (ClangASTContext::AreTypesSame(type->GetASTContext(),
+ desired_target_type.getAsOpaquePtr(),
+ candidate_target_type.getAsOpaquePtr()))
+ return var_sp;
+ }
+
const clang::PointerType *desired_ptr_type = desired_qual_type->getAs<clang::PointerType>();
const clang::PointerType *candidate_ptr_type = candidate_qual_type->getAs<clang::PointerType>();
- if (!desired_ptr_type || !candidate_ptr_type)
- return lldb::VariableSP();
-
- clang::QualType desired_target_type = desired_ptr_type->getPointeeType().getUnqualifiedType();
- clang::QualType candidate_target_type = candidate_ptr_type->getPointeeType().getUnqualifiedType();
+ if (desired_ptr_type && candidate_ptr_type) {
+ clang::QualType desired_target_type = desired_ptr_type->getPointeeType().getUnqualifiedType();
+ clang::QualType candidate_target_type = candidate_ptr_type->getPointeeType().getUnqualifiedType();
+
+ if (ClangASTContext::AreTypesSame(type->GetASTContext(),
+ desired_target_type.getAsOpaquePtr(),
+ candidate_target_type.getAsOpaquePtr()))
+ return var_sp;
+ }
- if (!ClangASTContext::AreTypesSame(type->GetASTContext(),
- desired_target_type.getAsOpaquePtr(),
- candidate_target_type.getAsOpaquePtr()))
- return lldb::VariableSP();
+ return lldb::VariableSP();
}
else
{
- if (!ClangASTContext::AreTypesSame(type->GetASTContext(),
+ if (ClangASTContext::AreTypesSame(type->GetASTContext(),
type->GetOpaqueQualType(),
var_sp->GetType()->GetClangFullType()))
- return lldb::VariableSP();
+ return var_sp;
}
}
- return var_sp;
+ return lldb::VariableSP();
}
Symbol *
More information about the lldb-commits
mailing list