[llvm] [BOLT][DWARF][NFC] Add parallelization for processing of DWO debug information (PR #100282)

Alexander Yermolovich via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 8 11:21:35 PDT 2024


================
@@ -744,9 +753,19 @@ void DWARFRewriter::updateDebugInfo() {
           *DWODIEBuildersByCU.emplace_back(std::move(DWODIEBuilderPtr)).get();
       if (CU->getVersion() >= 5)
         StrOffstsWriter->finalizeSection(*CU, DIEBlder);
-      processSplitCU(*CU, **SplitCU, DIEBlder, *TempRangesSectionWriter,
-                     AddressWriter, DWOName, DwarfOutputPath, DWODIEBuilder);
+      // Important to dereference CU and SplitCU here, otherwise when the thread
+      // is executed at some point after the current iteration of the loop,
+      // dereferencing CU/SplitCU in the call to processSplitCU means it will
+      // dereference a different variable than the one intended, causing a seg
+      // fault.
+      DWARFUnit &CURef = *CU;
----------------
ayermolo wrote:

Fine to capture by value, just having a comment is fine.

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


More information about the llvm-commits mailing list