diff options
author | Michael Buch <michaelbuch12@gmail.com> | 2023-05-15 15:04:07 +0100 |
---|---|---|
committer | Michael Buch <michaelbuch12@gmail.com> | 2023-05-16 11:18:09 +0100 |
commit | ca64f9af04472a27656d84c06f4e332ebbf14b4d (patch) | |
tree | ac29613f2ac5bf38619449c5a5870cff29701311 /lldb | |
parent | c2d55ef563a96933db8c171a7b624a75b67c2a0f (diff) | |
download | llvm-ca64f9af04472a27656d84c06f4e332ebbf14b4d.tar.gz |
[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
Diffstat (limited to 'lldb')
-rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp index 1090e15370dd..7f67d25f58ae 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp @@ -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 = |