[PATCH] D51641: [VFS] Cache the current working directory for the real FS.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 4 09:28:00 PDT 2018


sammccall added inline comments.


================
Comment at: lib/Basic/VirtualFileSystem.cpp:275
     return EC;
-  return Dir.str().str();
+  CWDCache = Dir.str();
+  return CWDCache;
----------------
Doesn't this need to be guarded by a lock? I know the current version is thread-hostile in principle but this seems likely to lead to corruption in multithreaded programs.
(I suspect clangd tests would fail under TSan for example)


Repository:
  rC Clang

https://reviews.llvm.org/D51641





More information about the cfe-commits mailing list