[lldb][DWARFASTParserClang][NFC] Simplify unnamed bitfield condition

Minor cleanup of redundant variable initialization and
if-condition. These are leftovers/oversights from previous
cleanup in this area:
* https://reviews.llvm.org/D72953
* https://reviews.llvm.org/D76808

Differential Revision: https://reviews.llvm.org/D150589
This commit is contained in:
Michael Buch 2023-05-15 15:04:07 +01:00
parent c2d55ef563
commit ca64f9af04

View File

@ -2880,9 +2880,8 @@ void DWARFASTParserClang::ParseSingleMember(
if (detect_unnamed_bitfields) {
std::optional<FieldInfo> unnamed_field_info;
uint64_t last_field_end = 0;
last_field_end = last_field_info.bit_offset + last_field_info.bit_size;
uint64_t last_field_end =
last_field_info.bit_offset + last_field_info.bit_size;
if (!last_field_info.IsBitfield()) {
// The last field was not a bit-field...
@ -2902,10 +2901,8 @@ void DWARFASTParserClang::ParseSingleMember(
// indeed an unnamed bit-field. We currently do not have the
// machinary to track the offset of the last field of classes we
// have seen before, so we are not handling this case.
if (this_field_info.bit_offset != last_field_end &&
this_field_info.bit_offset > last_field_end &&
!(last_field_info.bit_offset == 0 &&
last_field_info.bit_size == 0 &&
if (this_field_info.bit_offset > last_field_end &&
!(last_field_info.bit_offset == 0 && last_field_info.bit_size == 0 &&
layout_info.base_offsets.size() != 0)) {
unnamed_field_info = FieldInfo{};
unnamed_field_info->bit_size =