]> granicus.if.org Git - clang/commit
[Driver] Fix -working-directory issues
authorMichael J. Spencer <bigcheesegs@gmail.com>
Tue, 28 May 2019 22:21:47 +0000 (22:21 +0000)
committerMichael J. Spencer <bigcheesegs@gmail.com>
Tue, 28 May 2019 22:21:47 +0000 (22:21 +0000)
commit1d6f4f1664c3a334f31d0546014a11a1f25385a7
tree8d1912ef5307f9df4900ea5458ae5dd182a79625
parentb02a79e8d08f9feeba075e41162adf1566f0cbbc
[Driver] Fix -working-directory issues

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@361885 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticDriverKinds.td
lib/Driver/Driver.cpp
lib/Driver/ToolChains/Clang.cpp
test/Driver/working-directory.c