From 5d9bb9cc4fa5eff75c2c36aec0eea464f59fac1f Mon Sep 17 00:00:00 2001 From: Dave Lee Date: Thu, 29 May 2025 15:47:59 -0700 Subject: [PATCH] [lldb] Remove dead code in TypeSystemClang (NFC) --- .../TypeSystem/Clang/TypeSystemClang.cpp | 22 +++++-------------- .../TypeSystem/Clang/TypeSystemClang.h | 3 --- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp index 41f5f96074f65..6db2a057c257c 100644 --- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp +++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp @@ -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; } @@ -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; @@ -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); @@ -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; @@ -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 diff --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h index 285748719390c..b9e78cc377f04 100644 --- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h +++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h @@ -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,