diff --git a/llvm/include/llvm/DebugInfo/GSYM/GsymCreator.h b/llvm/include/llvm/DebugInfo/GSYM/GsymCreator.h --- a/llvm/include/llvm/DebugInfo/GSYM/GsymCreator.h +++ b/llvm/include/llvm/DebugInfo/GSYM/GsymCreator.h @@ -133,7 +133,7 @@ /// of FunctionInfo objects, see "llvm/DebugInfo/GSYM/FunctionInfo.h". class GsymCreator { // Private member variables require Mutex protections - mutable std::recursive_mutex Mutex; + mutable std::mutex Mutex; std::vector Funcs; StringTableBuilder StrTab; StringSet<> StringStorage; diff --git a/llvm/lib/DebugInfo/GSYM/GsymCreator.cpp b/llvm/lib/DebugInfo/GSYM/GsymCreator.cpp --- a/llvm/lib/DebugInfo/GSYM/GsymCreator.cpp +++ b/llvm/lib/DebugInfo/GSYM/GsymCreator.cpp @@ -35,7 +35,7 @@ const uint32_t Base = insertString(filename); FileEntry FE(Dir, Base); - std::lock_guard Guard(Mutex); + std::lock_guard Guard(Mutex); const auto NextIndex = Files.size(); // Find FE in hash map and insert if not present. auto R = FileEntryToIndex.insert(std::make_pair(FE, NextIndex)); @@ -55,7 +55,7 @@ } llvm::Error GsymCreator::encode(FileWriter &O) const { - std::lock_guard Guard(Mutex); + std::lock_guard Guard(Mutex); if (Funcs.empty()) return createStringError(std::errc::invalid_argument, "no functions to encode"); @@ -188,7 +188,7 @@ } llvm::Error GsymCreator::finalize(llvm::raw_ostream &OS) { - std::lock_guard Guard(Mutex); + std::lock_guard Guard(Mutex); if (Finalized) return createStringError(std::errc::invalid_argument, "already finalized"); Finalized = true; @@ -296,7 +296,7 @@ // The hash can be calculated outside the lock. CachedHashStringRef CHStr(S); - std::lock_guard Guard(Mutex); + std::lock_guard Guard(Mutex); if (Copy) { // We need to provide backing storage for the string if requested // since StringTableBuilder stores references to strings. Any string @@ -312,14 +312,14 @@ } void GsymCreator::addFunctionInfo(FunctionInfo &&FI) { - std::lock_guard Guard(Mutex); + std::lock_guard Guard(Mutex); Ranges.insert(FI.Range); Funcs.emplace_back(std::move(FI)); } void GsymCreator::forEachFunctionInfo( std::function const &Callback) { - std::lock_guard Guard(Mutex); + std::lock_guard Guard(Mutex); for (auto &FI : Funcs) { if (!Callback(FI)) break; @@ -328,7 +328,7 @@ void GsymCreator::forEachFunctionInfo( std::function const &Callback) const { - std::lock_guard Guard(Mutex); + std::lock_guard Guard(Mutex); for (const auto &FI : Funcs) { if (!Callback(FI)) break; @@ -336,7 +336,7 @@ } size_t GsymCreator::getNumFunctionInfos() const { - std::lock_guard Guard(Mutex); + std::lock_guard Guard(Mutex); return Funcs.size(); } @@ -347,6 +347,6 @@ } bool GsymCreator::hasFunctionInfoForAddress(uint64_t Addr) const { - std::lock_guard Guard(Mutex); + std::lock_guard Guard(Mutex); return Ranges.contains(Addr); }