diff --git a/lldb/include/lldb/Symbol/CompilerType.h b/lldb/include/lldb/Symbol/CompilerType.h index 1185ef3aef479..b12bb6f35d938 100644 --- a/lldb/include/lldb/Symbol/CompilerType.h +++ b/lldb/include/lldb/Symbol/CompilerType.h @@ -464,12 +464,6 @@ class CompilerType { CompilerDecl GetStaticFieldWithName(llvm::StringRef name) const; - uint32_t GetIndexOfFieldWithName(const char *name, - CompilerType *field_compiler_type = nullptr, - uint64_t *bit_offset_ptr = nullptr, - uint32_t *bitfield_bit_size_ptr = nullptr, - bool *is_bitfield_ptr = nullptr) const; - llvm::Expected GetChildCompilerTypeAtIndex( ExecutionContext *exe_ctx, size_t idx, bool transparent_pointers, bool omit_empty_base_classes, bool ignore_array_bounds, diff --git a/lldb/source/Symbol/CompilerType.cpp b/lldb/source/Symbol/CompilerType.cpp index 4eed615ad7bb3..16ac6d34712fe 100644 --- a/lldb/source/Symbol/CompilerType.cpp +++ b/lldb/source/Symbol/CompilerType.cpp @@ -941,25 +941,6 @@ CompilerDecl CompilerType::GetStaticFieldWithName(llvm::StringRef name) const { return CompilerDecl(); } -uint32_t CompilerType::GetIndexOfFieldWithName( - const char *name, CompilerType *field_compiler_type_ptr, - uint64_t *bit_offset_ptr, uint32_t *bitfield_bit_size_ptr, - bool *is_bitfield_ptr) const { - unsigned count = GetNumFields(); - std::string field_name; - for (unsigned index = 0; index < count; index++) { - CompilerType field_compiler_type( - GetFieldAtIndex(index, field_name, bit_offset_ptr, - bitfield_bit_size_ptr, is_bitfield_ptr)); - if (strcmp(field_name.c_str(), name) == 0) { - if (field_compiler_type_ptr) - *field_compiler_type_ptr = field_compiler_type; - return index; - } - } - return UINT32_MAX; -} - llvm::Expected CompilerType::GetChildCompilerTypeAtIndex( ExecutionContext *exe_ctx, size_t idx, bool transparent_pointers, bool omit_empty_base_classes, bool ignore_array_bounds, diff --git a/lldb/unittests/Platform/PlatformSiginfoTest.cpp b/lldb/unittests/Platform/PlatformSiginfoTest.cpp index 2726357e65e57..3d2cf7b974268 100644 --- a/lldb/unittests/Platform/PlatformSiginfoTest.cpp +++ b/lldb/unittests/Platform/PlatformSiginfoTest.cpp @@ -61,9 +61,12 @@ class PlatformSiginfoTest : public ::testing::Test { uint64_t total_offset = 0; for (auto field_name : llvm::split(path, '.')) { uint64_t bit_offset; - ASSERT_NE(field_type.GetIndexOfFieldWithName(field_name.str().c_str(), - &field_type, &bit_offset), - UINT32_MAX); + std::string name; + lldb_private::ExecutionContext exe_ctx{}; + field_type = field_type.GetFieldAtIndex( + field_type.GetIndexOfChildWithName(field_name, &exe_ctx, false), name, + &bit_offset, nullptr, nullptr); + ASSERT_TRUE(field_type); total_offset += bit_offset; }