[PATCH] D65986: Allow setting the VFS to 'real' mode instead of default 'physical'
Jonas Devlieghere via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 8 22:19:32 PDT 2019
JDevlieghere added inline comments.
================
Comment at: clang/lib/Driver/Driver.cpp:172
+ case VFSMode::Unknown:
+ if (!this->VFS) {
+ LLVM_FALLTHROUGH;
----------------
jfb wrote:
> JDevlieghere wrote:
> > Is this really necessary?
> the `Driver` ctor takes a `VFS` parameter which some tools set (otherwise it defaults to `nullptr`), so if the command-line `VFS` isn't specified we want to leave whatever was passed in as-is. If the command line parameter is set the we'll obey that instead.
>
> So yes I think it's the right thing to do.
FWIW, I got confused by the indentation of the case element. Even though it's in the if-case it just acts like a label. While clever, I think for the sake of readability it might be worth just repeating `this->VFS = llvm::vfs::createPhysicalFileSystem().release();`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D65986/new/
https://reviews.llvm.org/D65986
More information about the cfe-commits
mailing list