Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 5 additions & 17 deletions lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5303,16 +5303,12 @@ lldb::Format TypeSystemClang::GetFormat(lldb::opaque_compiler_type_t type) {
return lldb::eFormatBytes;
}

static bool ObjCDeclHasIVars(clang::ObjCInterfaceDecl *class_interface_decl,
bool check_superclass) {
static bool ObjCDeclHasIVars(clang::ObjCInterfaceDecl *class_interface_decl) {
while (class_interface_decl) {
if (class_interface_decl->ivar_size() > 0)
return true;

if (check_superclass)
class_interface_decl = class_interface_decl->getSuperClass();
else
break;
class_interface_decl = class_interface_decl->getSuperClass();
}
return false;
}
Expand Down Expand Up @@ -5387,7 +5383,7 @@ TypeSystemClang::GetNumChildren(lldb::opaque_compiler_type_t type,
class_interface_decl->getSuperClass();
if (superclass_interface_decl) {
if (omit_empty_base_classes) {
if (ObjCDeclHasIVars(superclass_interface_decl, true))
if (ObjCDeclHasIVars(superclass_interface_decl))
++num_children;
} else
++num_children;
Expand Down Expand Up @@ -6841,7 +6837,7 @@ size_t TypeSystemClang::GetIndexOfChildMemberWithName(
if (ivar_decl->getName() == name_sref) {
if ((!omit_empty_base_classes && superclass_interface_decl) ||
(omit_empty_base_classes &&
ObjCDeclHasIVars(superclass_interface_decl, true)))
ObjCDeclHasIVars(superclass_interface_decl)))
++child_idx;

child_indexes.push_back(child_idx);
Expand Down Expand Up @@ -6997,7 +6993,7 @@ TypeSystemClang::GetIndexOfChildWithName(lldb::opaque_compiler_type_t type,
if (ivar_decl->getName() == name) {
if ((!omit_empty_base_classes && superclass_interface_decl) ||
(omit_empty_base_classes &&
ObjCDeclHasIVars(superclass_interface_decl, true)))
ObjCDeclHasIVars(superclass_interface_decl)))
++child_idx;

return child_idx;
Expand Down Expand Up @@ -8118,14 +8114,6 @@ bool TypeSystemClang::AddObjCClassProperty(
return true;
}

bool TypeSystemClang::IsObjCClassTypeAndHasIVars(const CompilerType &type,
bool check_superclass) {
clang::ObjCInterfaceDecl *class_interface_decl = GetAsObjCInterfaceDecl(type);
if (class_interface_decl)
return ObjCDeclHasIVars(class_interface_decl, check_superclass);
return false;
}

clang::ObjCMethodDecl *TypeSystemClang::AddMethodToObjCObjectType(
const CompilerType &type,
const char *name, // the full symbol name as seen in the symbol table
Expand Down
3 changes: 0 additions & 3 deletions lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
Original file line number Diff line number Diff line change
Expand Up @@ -687,9 +687,6 @@ class TypeSystemClang : public TypeSystem {

static bool IsObjCClassType(const CompilerType &type);

static bool IsObjCClassTypeAndHasIVars(const CompilerType &type,
bool check_superclass);

static bool IsObjCObjectOrInterfaceType(const CompilerType &type);

static bool IsObjCObjectPointerType(const CompilerType &type,
Expand Down
Loading