diff options
author | Sean Callanan <scallanan@apple.com> | 2013-01-19 01:49:02 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2013-01-19 01:49:02 +0000 |
commit | a2868d4c2e612aad10bfff144bf80441132e0857 (patch) | |
tree | dcfdf3c969398e4d57b3851e268b7b2a58bddaa1 /lldb/source/Expression/ClangExpressionDeclMap.cpp | |
parent | 97e77abf8389e65f5eb935033cf1f71a69b4e00a (diff) | |
download | bcm5719-llvm-a2868d4c2e612aad10bfff144bf80441132e0857.tar.gz bcm5719-llvm-a2868d4c2e612aad10bfff144bf80441132e0857.zip |
Extended LLDB to handle blocks capturing 'self'
in an Objective-C class method. Before, errors
of the form
error: cannot find interface declaration for '$__lldb_objc_class'
would appear when running any expression when
the current frame is a block that captures 'self'
from an Objective-C class method.
<rdar://problem/12905561>
llvm-svn: 172880
Diffstat (limited to 'lldb/source/Expression/ClangExpressionDeclMap.cpp')
-rw-r--r-- | lldb/source/Expression/ClangExpressionDeclMap.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lldb/source/Expression/ClangExpressionDeclMap.cpp b/lldb/source/Expression/ClangExpressionDeclMap.cpp index f11b73ee239..ce6404dbd69 100644 --- a/lldb/source/Expression/ClangExpressionDeclMap.cpp +++ b/lldb/source/Expression/ClangExpressionDeclMap.cpp @@ -2758,7 +2758,6 @@ ClangExpressionDeclMap::FindExternalVisibleDecls (NameSearchContext &context, if (method_decl) { - ObjCInterfaceDecl* self_interface = method_decl->getClassInterface(); if (!self_interface) @@ -2822,10 +2821,15 @@ ClangExpressionDeclMap::FindExternalVisibleDecls (NameSearchContext &context, return; QualType self_qual_type = QualType::getFromOpaquePtr(self_type->GetClangFullType()); - const ObjCObjectPointerType *class_pointer_type = self_qual_type->getAs<ObjCObjectPointerType>(); - if (class_pointer_type) + if (self_qual_type->isObjCClassType()) + { + return; + } + else if (self_qual_type->isObjCObjectPointerType()) { + const ObjCObjectPointerType *class_pointer_type = self_qual_type->getAs<ObjCObjectPointerType>(); + QualType class_type = class_pointer_type->getPointeeType(); if (log) @@ -2835,10 +2839,10 @@ ClangExpressionDeclMap::FindExternalVisibleDecls (NameSearchContext &context, } TypeFromUser class_user_type (class_type.getAsOpaquePtr(), - self_type->GetClangAST()); + self_type->GetClangAST()); + AddOneType(context, class_user_type, current_id, false); - TypeFromUser self_user_type(self_type->GetClangFullType(), self_type->GetClangAST()); |