[llvm] [BOLT][DWARF][NFC] Fix DebugStrOffsetsWriter (PR #100672)

Alexander Yermolovich via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 26 13:55:44 PDT 2024


================
@@ -906,6 +906,8 @@ void DebugStrOffsetsWriter::finalizeSection(DWARFUnit &Unit,
   }
 
   StrOffsetSectionWasModified = false;
+  assert(DebugStrOffsetFinalized.insert(Unit.getOffset()).second == true &&
----------------
ayermolo wrote:

I think you can just do:
DebugStrOffsetFinalized.insert(Unit.getOffset()).second
maybe add "for a CU" to error message.
Also add assert in updateAddressMap to check we don't call it on already finalized CU. 

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


More information about the llvm-commits mailing list