Revert r361885 "[Driver] Fix -working-directory issues"
authorHans Wennborg <hans@hanshq.net>
Thu, 5 Sep 2019 08:43:00 +0000 (08:43 +0000)
committerHans Wennborg <hans@hanshq.net>
Thu, 5 Sep 2019 08:43:00 +0000 (08:43 +0000)
commit999f8a7416f8edc54ef92e715fd23c532bcc74d4
treedb5ca48ae04b29d9cc1125b85dfe8cf269e2a3c6
parentfaa2a089875c0b5db9e8ad07654fe16b8aefafb1
Revert r361885 "[Driver] Fix -working-directory issues"

This made clang unable to open files using relative paths on network shares on
Windows (PR43204). On the bug it was pointed out that createPhysicalFileSystem()
is not terribly mature, and using it is risky. Reverting for now until there's
a clear way forward.

> Currently the `-working-directory` option does not actually impact the working
> directory for all of the clang driver, it only impacts how files are looked up
> to make sure they exist.  This means that that clang passes the wrong paths
> to -fdebug-compilation-dir and -coverage-notes-file.
>
> This patch fixes that by changing all the places in the driver where we convert
> to absolute paths to use the VFS, and then calling setCurrentWorkingDirectory on
> the VFS.  This also changes the default VFS for `Driver` to use a virtualized
> working directory, instead of changing the process's working directory.
>
> Differential Revision: https://reviews.llvm.org/D62271

This also revertes the part of r369938 which checked that -working-directory works.

llvm-svn: 371027
clang/include/clang/Basic/DiagnosticDriverKinds.td
clang/lib/Driver/Driver.cpp
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/gen-cdb-fragment.c
clang/test/Driver/working-directory.c