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

2019-01-10 Thread Pavel Labath via Phabricator via cfe-commits
labath added a comment. In D51641#1352782 , @sammccall wrote: > > In fact, it still happens now, because the VFS is so bad at having a local > > CWD. So, the only reason we actually discovered this was because > > VFS->getCurrentWorkingDirectory

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

2019-01-10 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. In D51641#1351283 , @labath wrote: > I wholeheartedly support an openat(2) based VFS, as the current one falls > short of the expectations you have of it and is pretty broken right now. Let me bait-and-switch then... D56545

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

2019-01-09 Thread Pavel Labath via Phabricator via cfe-commits
labath added a comment. I wholeheartedly support an openat(2) based VFS, as the current one falls short of the expectations you have of it and is pretty broken right now. As for your assumption #2, I think that depends on what does one want to get out of the VFS. I can certainly see a use for

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

2019-01-09 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. In D51641#1338004 , @labath wrote: > Might I ask what was the motivation for this change? Performance > optimalization? Yes, this was for performance. IIRC the problem was something like calling `VFS->makeAbsolute(P)` for

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

2018-12-20 Thread Pavel Labath via Phabricator via cfe-commits
labath added subscribers: JDevlieghere, labath. labath added a comment. Might I ask what was the motivation for this change? Performance optimalization? I am asking this because this makes the RealFileSystem return bogus values for the CWD if it changes through means other than the

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

2018-09-05 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC341455: [VFS] Cache the current working directory for the real FS. (authored by ioeric, committed by ). Changed prior to commit: https://reviews.llvm.org/D51641?vs=163986=163994#toc Repository: rC

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

2018-09-05 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 163986. ioeric marked an inline comment as done. ioeric added a comment. - s/Mutex/CWDMutex/ Repository: rC Clang https://reviews.llvm.org/D51641 Files: lib/Basic/VirtualFileSystem.cpp Index: lib/Basic/VirtualFileSystem.cpp

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

2018-09-05 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision. sammccall added inline comments. This revision is now accepted and ready to land. Comment at: lib/Basic/VirtualFileSystem.cpp:248 +private: + // Make sure `CWDCache` update is thread safe in `getCurrentWorkingDirectory`. + mutable std::mutex

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

2018-09-04 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: lib/Basic/VirtualFileSystem.cpp:275 return EC; - return Dir.str().str(); + CWDCache = Dir.str(); + return CWDCache; sammccall wrote: > Doesn't this need to be guarded by a lock? I know the current version is >

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

2018-09-04 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 163858. ioeric marked an inline comment as done. ioeric added a comment. - Guard CWDCache with mutex. Repository: rC Clang https://reviews.llvm.org/D51641 Files: lib/Basic/VirtualFileSystem.cpp Index: lib/Basic/VirtualFileSystem.cpp

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

2018-09-04 Thread Sam McCall via Phabricator via cfe-commits
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

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

2018-09-04 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: sammccall. Herald added a subscriber: cfe-commits. Repository: rC Clang https://reviews.llvm.org/D51641 Files: lib/Basic/VirtualFileSystem.cpp Index: lib/Basic/VirtualFileSystem.cpp