diff options
author | Sean Callanan <scallanan@apple.com> | 2011-12-08 19:04:34 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2011-12-08 19:04:34 +0000 |
commit | 5780f9df56ec5efda7e40df8a88d8c6057663033 (patch) | |
tree | 0ce22c6287cb52428592bfa51586316a051c6dbb /lldb/source/Expression/IRForTarget.cpp | |
parent | 4d1a2d449fff9d0883f5419766c60c8c54be70be (diff) | |
download | bcm5719-llvm-5780f9df56ec5efda7e40df8a88d8c6057663033.tar.gz bcm5719-llvm-5780f9df56ec5efda7e40df8a88d8c6057663033.zip |
Added the ability to dereference an Objective-C object
pointer to make the result of an expression. LLDB now
dumps the ivars of the Objective-C object and all of
its parents. This just required fixing a bug where we
didn't distinguish between Objective-C object pointers
and regular C-style pointers.
Also added a testcase to verify that this continues to
work.
llvm-svn: 146164
Diffstat (limited to 'lldb/source/Expression/IRForTarget.cpp')
-rw-r--r-- | lldb/source/Expression/IRForTarget.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/lldb/source/Expression/IRForTarget.cpp b/lldb/source/Expression/IRForTarget.cpp index 4cf8d792f72..3722f34bd5d 100644 --- a/lldb/source/Expression/IRForTarget.cpp +++ b/lldb/source/Expression/IRForTarget.cpp @@ -631,9 +631,25 @@ IRForTarget::CreateResultVariable (llvm::Function &llvm_function) { clang::QualType pointer_qual_type = result_var->getType(); const clang::Type *pointer_type = pointer_qual_type.getTypePtr(); + const clang::PointerType *pointer_pointertype = dyn_cast<clang::PointerType>(pointer_type); + const clang::ObjCObjectPointerType *pointer_objcobjpointertype = dyn_cast<clang::ObjCObjectPointerType>(pointer_type); - if (!pointer_pointertype) + if (pointer_pointertype) + { + clang::QualType element_qual_type = pointer_pointertype->getPointeeType(); + + m_result_type = lldb_private::TypeFromParser(element_qual_type.getAsOpaquePtr(), + &result_decl->getASTContext()); + } + else if (pointer_objcobjpointertype) + { + clang::QualType element_qual_type = clang::QualType(pointer_objcobjpointertype->getObjectType(), 0); + + m_result_type = lldb_private::TypeFromParser(element_qual_type.getAsOpaquePtr(), + &result_decl->getASTContext()); + } + else { if (log) log->PutCString("Expected result to have pointer type, but it did not"); @@ -643,11 +659,6 @@ IRForTarget::CreateResultVariable (llvm::Function &llvm_function) return false; } - - clang::QualType element_qual_type = pointer_pointertype->getPointeeType(); - - m_result_type = lldb_private::TypeFromParser(element_qual_type.getAsOpaquePtr(), - &result_decl->getASTContext()); } else { |