Skip to content

Commit 79b9ed6

Browse files
committed
[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 (cherry picked from commit ca64f9a)
1 parent d92122e commit 79b9ed6

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2839,10 +2839,9 @@ void DWARFASTParserClang::ParseSingleMember(
28392839
die.GetCU()->Supports_unnamed_objc_bitfields();
28402840

28412841
if (detect_unnamed_bitfields) {
2842-
llvm::Optional<FieldInfo> unnamed_field_info;
2843-
uint64_t last_field_end = 0;
2844-
2845-
last_field_end = last_field_info.bit_offset + last_field_info.bit_size;
2842+
std::optional<FieldInfo> unnamed_field_info;
2843+
uint64_t last_field_end =
2844+
last_field_info.bit_offset + last_field_info.bit_size;
28462845

28472846
if (!last_field_info.IsBitfield()) {
28482847
// The last field was not a bit-field...
@@ -2862,10 +2861,8 @@ void DWARFASTParserClang::ParseSingleMember(
28622861
// indeed an unnamed bit-field. We currently do not have the
28632862
// machinary to track the offset of the last field of classes we
28642863
// have seen before, so we are not handling this case.
2865-
if (this_field_info.bit_offset != last_field_end &&
2866-
this_field_info.bit_offset > last_field_end &&
2867-
!(last_field_info.bit_offset == 0 &&
2868-
last_field_info.bit_size == 0 &&
2864+
if (this_field_info.bit_offset > last_field_end &&
2865+
!(last_field_info.bit_offset == 0 && last_field_info.bit_size == 0 &&
28692866
layout_info.base_offsets.size() != 0)) {
28702867
unnamed_field_info = FieldInfo{};
28712868
unnamed_field_info->bit_size =

0 commit comments

Comments
 (0)