|
@@ -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");
|