[PATCH] D62271: [Driver] Fix -working-directory issues

Michael Spencer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 22 15:36:05 PDT 2019


Bigcheese created this revision.
Bigcheese added reviewers: dexonsmith, arphaman, jkorous.
Herald added a project: clang.

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.


Repository:
  rC Clang

https://reviews.llvm.org/D62271

Files:
  include/clang/Basic/DiagnosticDriverKinds.td
  lib/Driver/Driver.cpp
  lib/Driver/ToolChains/Clang.cpp
  test/Driver/working-directory.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62271.200830.patch
Type: text/x-patch
Size: 5375 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190522/1e4e76e4/attachment.bin>


More information about the cfe-commits mailing list