[Lldb-commits] [clang] [clang-tools-extra] [lldb] [clang] Don't silently inherit the VFS from `FileManager` (PR #164323)

Jan Svoboda via lldb-commits lldb-commits at lists.llvm.org
Wed Oct 22 09:32:33 PDT 2025


jansvoboda11 wrote:

Good catch! There is [one place](https://github.com/llvm/llvm-project/blob/main/clang/tools/driver/cc1_main.cpp#L316-L325) in particular that made me not reset the VFS. I could call `setVirtualFileSystem()` there again, but I really wanted to have just one place where we create and set the VFS (earlier in the `cc1_main()` function). That'll make the FS sandboxing I'm working on a bit simpler.

Another factor is that I'm considering making the VFS a required argument to the `CompilerInstance` constructor, and making it impossible to swap it out. Not introducing places where it's set to `nullptr` seemed like the less disruptive solution long-term.

https://github.com/llvm/llvm-project/pull/164323


More information about the lldb-commits mailing list