- Use BaseFS as the condition to judge whether to invalidate previous file managers
- Use WorkingDir as a parameter for getOrCreateFileManager
May 18 2022
May 14 2022
May 7 2022
Fix tests & runInvocation in clang-tools-extra.
May 6 2022
Reimplement ToolFileManager as a container of filemanagers which ToolInvocation takes by parameter. Also invalidate all file managers when using FileManager::setVirtualFileSystem().
Two high-level comments:
- Making these functions virtual makes it harder to reason about possible implementations, but I don't think that's necessary for what you're doing here. Why not expose ToolFileManager as a container of filemanagers which ToolInvocation takes by parameter, then calls getOrCreateFileManager() on at time of need passing relevant arguments (e.g., CWD)?
- This could also create/manage the relevant VFS instance, to which the FileManager is fundamentally tied. See also below.
- I don't think this goes far enough. The FileManager keeps state for any accessed file, which can be wrong any time the VFS changes at all, not just if the CWD is different. E.g., different -ivfsoverlay options are passed, or someone is reading from an InMemoryFileSystem vs. from disk.
- AFAICT, every call to FileManager::setVirtualFileSystem() is fundamentally unsound unless the new FS is equivalent to the old one or the filemanager hasn't been used yet.
May 5 2022
Format all overriding functions
Fix path in compile_commands.json for windows.
May 3 2022
Use different FileManager for each CWD instead. Also add a unit test.
May 2 2022
But it's possible we don't need this. If it's safe for us to update the tests and make FileManager::getFileRef always canonicalize to an absolute path, that would definitely be cleaner. FileManager::makeAbsolute can use whatever the FS's CWD is at the time of query... nice and clean.