benlangmuir wrote:

> I can see a situation where we ask FileManager about the same relative path 
> before and after setting the parsed FileSystemOptions. The second call would 
> blindly return the cached result, effectively ignoring -working-directory for 
> that file.

The driver calls `VFS->setCurrentWorkingDirectory` using the value of 
`-working-directory`. So in general relative paths will be resolved 
consistently with `-working-directory` if they're seen before configuring the 
`FileManager`.  Now, a fair question is why are we changing both the VFS 
working directory *and* making paths absolute in the FileManager for 
`-working-directory`, which seems redundant, but I'm not looking to change that 
behaviour -- this PR should make scanning behave more consistently with 
compilation.

To be clear this situation with mismatched relative paths would **currently** 
be broken, because the way we were setting `FSOpts.WorkingDir` was not using 
the value of `-working-directory` before this change.

https://github.com/llvm/llvm-project/pull/84525
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to