Michael137 created this revision. Michael137 added a reviewer: aprantl. Herald added a reviewer: shafik. Herald added a project: All. Michael137 requested review of this revision. Herald added a project: LLDB. Herald added a subscriber: lldb-commits.
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 Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D150589 Files: lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp +++ lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp @@ -2881,9 +2881,8 @@ 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... @@ -2903,10 +2902,8 @@ // 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 =
Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp +++ lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp @@ -2881,9 +2881,8 @@ 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... @@ -2903,10 +2902,8 @@ // 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 =
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits