Add an overload of RedirectingFileSystem::create that builds a
redirecting filesystem off of a simple vector of string pairs. This is
intended to be used to support clang::arcmt::FileRemapper and
clang::PreprocessorOptions::RemappedFiles.
Details
Diff Detail
Event Timeline
llvm/include/llvm/Support/VirtualFileSystem.h | ||
---|---|---|
735 |
|
llvm/include/llvm/Support/VirtualFileSystem.h | ||
---|---|---|
735 | For my use case it doesn't matter what kind of FileSystem is returned; I figure this could be convenient for a future client. I would tend toward keeping it this type to match the other overload of RedirectingFileSystem::create, but happy to change it if you disagree. Regarding unique_ptr, I chose that as a sounder alternative to the raw pointer above; leaves options open to clients if they do want unique ownership, which seems nice to support since it's trivial. My use case will ultimately assign it to an IntrusiveRefCntPtr so if you disagree I can change it. |
llvm/include/llvm/Support/VirtualFileSystem.h | ||
---|---|---|
735 | It does seem nicer to be consistent, so I just sent out https://reviews.llvm.org/D92888, which allows constructing an IntrusiveRefCntPtr from a moved unique_ptr, and https://reviews.llvm.org/D92890, which update existing APIs to use unique_ptr. |