================
@@ -10,9 +10,68 @@
#include "llvm/ADT/SmallString.h"
#include "llvm/Support/VirtualFileSystem.h"
#include "gtest/gtest.h"
+#include <atomic>
+#include <condition_variable>
+#include <mutex>
+#include <thread>
using namespace clang::dependencies;
+namespace {
+
+/// VFS proxy that counts operations using atomic counters, suitable for use
+/// from concurrent tests where `llvm::vfs::TracingFileSystem`'s plain
+/// `std::size_t` counters would race.
+class AtomicTracingFileSystem : public llvm::vfs::ProxyFileSystem {
----------------
jansvoboda11 wrote:
Could we just make the existing `llvm::vfs::TracingFileSystem` a template that
can be instantiated to either use plain or atomic integers as counters?
https://github.com/llvm/llvm-project/pull/199680
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits