[llvm] [BOLT][DWARF][NFC] Move common access outside of parallel function (PR #99728)

Alexander Yermolovich via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 23 14:11:47 PDT 2024


================
@@ -759,8 +751,16 @@ void DWARFRewriter::updateDebugInfo() {
       DebugRangesSectionWriter *TempRangesSectionWriter =
           CU->getVersion() >= 5 ? RangeListsWritersByCU[*DWOId].get()
                                 : LegacyRangesWritersByCU[*DWOId].get();
+      std::string DWOName = "";
+      std::optional<std::string> DwarfOutputPath =
+          opts::DwarfOutputPath.empty()
+              ? std::nullopt
+              : std::optional<std::string>(opts::DwarfOutputPath.c_str());
+      std::lock_guard<std::mutex> Lock(AccessMutex);
+      DWOName = DIEBlder.updateDWONameCompDir(*StrOffstsWriter, *StrWriter, *CU,
----------------
ayermolo wrote:

move definition here. Previously it was there because we were setting it in different scope due to a lock.

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


More information about the llvm-commits mailing list