diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2019-08-07 14:44:40 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2019-08-07 14:44:40 +0000 |
commit | 762bc3351f29b5a71dca31ddd114034a383ff0bd (patch) | |
tree | 017755428a2656945f8bbefcf080e61dcfff776c /clang/lib/Frontend/PrecompiledPreamble.cpp | |
parent | a06155ddc4edb22f44425f2cf6a2038f4e4c4546 (diff) | |
download | bcm5719-llvm-762bc3351f29b5a71dca31ddd114034a383ff0bd.tar.gz bcm5719-llvm-762bc3351f29b5a71dca31ddd114034a383ff0bd.zip |
Remove LLVM mutexes from clang in favor of std::mutex
None of those need to be recursive mutexes. No functionality change
intended.
llvm-svn: 368173
Diffstat (limited to 'clang/lib/Frontend/PrecompiledPreamble.cpp')
-rw-r--r-- | clang/lib/Frontend/PrecompiledPreamble.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/clang/lib/Frontend/PrecompiledPreamble.cpp b/clang/lib/Frontend/PrecompiledPreamble.cpp index 93f19294dc0..6b174065d11 100644 --- a/clang/lib/Frontend/PrecompiledPreamble.cpp +++ b/clang/lib/Frontend/PrecompiledPreamble.cpp @@ -27,7 +27,6 @@ #include "llvm/Config/llvm-config.h" #include "llvm/Support/CrashRecoveryContext.h" #include "llvm/Support/FileSystem.h" -#include "llvm/Support/Mutex.h" #include "llvm/Support/Process.h" #include "llvm/Support/VirtualFileSystem.h" #include <limits> @@ -96,7 +95,7 @@ public: void removeFile(StringRef File); private: - llvm::sys::SmartMutex<false> Mutex; + std::mutex Mutex; llvm::StringSet<> Files; }; @@ -106,20 +105,20 @@ TemporaryFiles &TemporaryFiles::getInstance() { } TemporaryFiles::~TemporaryFiles() { - std::lock_guard<llvm::sys::Mutex> Guard(Mutex); + std::lock_guard<std::mutex> Guard(Mutex); for (const auto &File : Files) llvm::sys::fs::remove(File.getKey()); } void TemporaryFiles::addFile(StringRef File) { - std::lock_guard<llvm::sys::Mutex> Guard(Mutex); + std::lock_guard<std::mutex> Guard(Mutex); auto IsInserted = Files.insert(File).second; (void)IsInserted; assert(IsInserted && "File has already been added"); } void TemporaryFiles::removeFile(StringRef File) { - std::lock_guard<llvm::sys::Mutex> Guard(Mutex); + std::lock_guard<std::mutex> Guard(Mutex); auto WasPresent = Files.erase(File); (void)WasPresent; assert(WasPresent && "File was not tracked"); |