[Lldb-commits] [lldb] [lldb] Remove CompilerType::GetIndexOfFieldWithName (PR #135963)

Charles Zablit via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 17 03:03:54 PDT 2025


charles-zablit wrote:

> I think the test can just do this:
> 
> ```
>       uint64_t bit_offset;
>       std::string name;
>       field_type = field_type.GetFieldAtIndex(
>               field_type.GetIndexOfChildWithName(field_name, /*omit_empty_base_classes=*/false),
>               name, &bit_offset, nullptr, nullptr);
>       ASSERT_TRUE(field_type);
> ```

Tested this locally and the tests pass, I have updated the commit.

> Instead of using `CompilerType::GetIndexOfFieldWithName` (though I haven't actually tried to compile/run this)
> 
> Don't have a strong opinion on whether to remove or extend the API. Personally I prefer removing it just because we already have so many similarly named APIs across CompilerType/TypeSystemClang that do things slightly differently, that it would be nice to get rid of at least one of them.

Ended up removing the API and used your suggestion to define the test without the API. Thanks!



https://github.com/llvm/llvm-project/pull/135963


More information about the lldb-commits mailing list