[llvm] a5cff6a - [VFS] Add back setFallthrough for downstream users

Keith Smiley via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 3 13:46:52 PST 2022


Author: Ben Barham
Date: 2022-02-03T13:46:18-08:00
New Revision: a5cff6af1d342e1523daae26231aeccb0ca17e39

URL: https://github.com/llvm/llvm-project/commit/a5cff6af1d342e1523daae26231aeccb0ca17e39
DIFF: https://github.com/llvm/llvm-project/commit/a5cff6af1d342e1523daae26231aeccb0ca17e39.diff

LOG: [VFS] Add back setFallthrough for downstream users

This fixes lldb's build. We can remove this in the future if we want but
for now this will be nicer to existing consumers.

Added: 
    

Modified: 
    llvm/include/llvm/Support/VirtualFileSystem.h
    llvm/lib/Support/VirtualFileSystem.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Support/VirtualFileSystem.h b/llvm/include/llvm/Support/VirtualFileSystem.h
index 3cfb71aa497d..182a5c1b3cdb 100644
--- a/llvm/include/llvm/Support/VirtualFileSystem.h
+++ b/llvm/include/llvm/Support/VirtualFileSystem.h
@@ -902,6 +902,10 @@ class RedirectingFileSystem : public vfs::FileSystem {
 
   StringRef getExternalContentsPrefixDir() const;
 
+  /// Sets the redirection kind to \c Fallthrough if true or \c RedirectOnly
+  /// otherwise. Will removed in the future, use \c setRedirection instead.
+  void setFallthrough(bool Fallthrough);
+
   void setRedirection(RedirectingFileSystem::RedirectKind Kind);
 
   std::vector<llvm::StringRef> getRoots() const;

diff  --git a/llvm/lib/Support/VirtualFileSystem.cpp b/llvm/lib/Support/VirtualFileSystem.cpp
index 8573c3a294e3..49151682624d 100644
--- a/llvm/lib/Support/VirtualFileSystem.cpp
+++ b/llvm/lib/Support/VirtualFileSystem.cpp
@@ -1363,6 +1363,14 @@ StringRef RedirectingFileSystem::getExternalContentsPrefixDir() const {
   return ExternalContentsPrefixDir;
 }
 
+void RedirectingFileSystem::setFallthrough(bool Fallthrough) {
+  if (Fallthrough) {
+    Redirection = RedirectingFileSystem::RedirectKind::Fallthrough;
+  } else {
+    Redirection = RedirectingFileSystem::RedirectKind::RedirectOnly;
+  }
+}
+
 void RedirectingFileSystem::setRedirection(
     RedirectingFileSystem::RedirectKind Kind) {
   Redirection = Kind;


        


More information about the llvm-commits mailing list