[PATCH] D91368: Frontend: Split out addVFSOverlays from createVFSFromCompilerInvocation, NFC

Duncan P. N. Exon Smith via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 12 10:19:31 PST 2020


dexonsmith created this revision.
dexonsmith added reviewers: JDevlieghere, jansvoboda11, akyrtzi.
Herald added a subscriber: ributzka.
dexonsmith requested review of this revision.

This is a prep patch to reduce noise in a follow-up, which will add
another layer.


https://reviews.llvm.org/D91368

Files:
  clang/lib/Frontend/CompilerInvocation.cpp


Index: clang/lib/Frontend/CompilerInvocation.cpp
===================================================================
--- clang/lib/Frontend/CompilerInvocation.cpp
+++ clang/lib/Frontend/CompilerInvocation.cpp
@@ -4028,10 +4028,9 @@
                                          llvm::vfs::getRealFileSystem());
 }
 
-IntrusiveRefCntPtr<llvm::vfs::FileSystem>
-clang::createVFSFromCompilerInvocation(
-    const CompilerInvocation &CI, DiagnosticsEngine &Diags,
-    IntrusiveRefCntPtr<llvm::vfs::FileSystem> BaseFS) {
+static IntrusiveRefCntPtr<llvm::vfs::FileSystem>
+addVFSOverlays(const CompilerInvocation &CI, DiagnosticsEngine &Diags,
+               IntrusiveRefCntPtr<llvm::vfs::FileSystem> BaseFS) {
   if (CI.getHeaderSearchOpts().VFSOverlayFiles.empty())
     return BaseFS;
 
@@ -4057,3 +4056,12 @@
   }
   return Result;
 }
+
+IntrusiveRefCntPtr<llvm::vfs::FileSystem>
+clang::createVFSFromCompilerInvocation(
+    const CompilerInvocation &CI, DiagnosticsEngine &Diags,
+    IntrusiveRefCntPtr<llvm::vfs::FileSystem> BaseFS) {
+  IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS = std::move(BaseFS);
+  FS = addVFSOverlays(CI, Diags, std::move(FS));
+  return FS;
+}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91368.304891.patch
Type: text/x-patch
Size: 1172 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201112/c7069bc7/attachment.bin>


More information about the cfe-commits mailing list