#include "llvm/Support/AlignOf.h"
#include "llvm/Support/Errno.h"
#include "llvm/Support/Error.h"
-#include "llvm/Support/Mutex.h"
#include "llvm/Support/Path.h"
#include <atomic>
#include <condition_variable>
#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>
void removeFile(StringRef File);
private:
- llvm::sys::SmartMutex<false> Mutex;
+ std::mutex Mutex;
llvm::StringSet<> Files;
};
}
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");
#include "llvm/Support/Format.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/MemoryBuffer.h"
-#include "llvm/Support/Mutex.h"
#include "llvm/Support/Program.h"
#include "llvm/Support/SaveAndRestore.h"
#include "llvm/Support/Signals.h"
#include "llvm/Support/Threading.h"
#include "llvm/Support/Timer.h"
#include "llvm/Support/raw_ostream.h"
+#include <mutex>
#if LLVM_ENABLE_THREADS != 0 && defined(__APPLE__)
#define USE_DARWIN_THREADS
return *this;
}
-static llvm::ManagedStatic<llvm::sys::Mutex> LoggingMutex;
+static llvm::ManagedStatic<std::mutex> LoggingMutex;
cxindex::Logger::~Logger() {
- llvm::sys::ScopedLock L(*LoggingMutex);
+ std::lock_guard<std::mutex> L(*LoggingMutex);
static llvm::TimeRecord sBeginTR = llvm::TimeRecord::getCurrentTime();
#include "clang-c/Index.h"
#include "clang/Frontend/PCHContainerOperations.h"
#include "llvm/ADT/STLExtras.h"
-#include "llvm/Support/Mutex.h"
#include <utility>
namespace llvm {
#include "clang/DirectoryWatcher/DirectoryWatcher.h"
#include "llvm/Support/FileSystem.h"
-#include "llvm/Support/Mutex.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/raw_ostream.h"
#include "gtest/gtest.h"