[Lldb-commits] [PATCH] D121494: [VFS] Rename `RedirectingFileSystem::dump` to `print`

Ben Barham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Mar 11 15:35:33 PST 2022


bnbarham updated this revision to Diff 414763.
bnbarham added a comment.
Herald added a subscriber: hiraditya.

Added VFS.cpp, removed implementation from header


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121494/new/

https://reviews.llvm.org/D121494

Files:
  lldb/source/Commands/CommandObjectReproducer.cpp
  llvm/include/llvm/Support/VirtualFileSystem.h
  llvm/lib/Support/VirtualFileSystem.cpp


Index: llvm/lib/Support/VirtualFileSystem.cpp
===================================================================
--- llvm/lib/Support/VirtualFileSystem.cpp
+++ llvm/lib/Support/VirtualFileSystem.cpp
@@ -1381,14 +1381,14 @@
   return R;
 }
 
-void RedirectingFileSystem::dump(raw_ostream &OS) const {
+void RedirectingFileSystem::print(raw_ostream &OS) const {
   for (const auto &Root : Roots)
-    dumpEntry(OS, Root.get());
+    printEntry(OS, Root.get());
 }
 
-void RedirectingFileSystem::dumpEntry(raw_ostream &OS,
-                                      RedirectingFileSystem::Entry *E,
-                                      int NumSpaces) const {
+void RedirectingFileSystem::printEntry(raw_ostream &OS,
+                                       RedirectingFileSystem::Entry *E,
+                                       int NumSpaces) const {
   StringRef Name = E->getName();
   for (int i = 0, e = NumSpaces; i < e; ++i)
     OS << " ";
@@ -1401,12 +1401,12 @@
 
     for (std::unique_ptr<Entry> &SubEntry :
          llvm::make_range(DE->contents_begin(), DE->contents_end()))
-      dumpEntry(OS, SubEntry.get(), NumSpaces + 2);
+      printEntry(OS, SubEntry.get(), NumSpaces + 2);
   }
 }
 
 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
-LLVM_DUMP_METHOD void RedirectingFileSystem::dump() const { dump(dbgs()); }
+LLVM_DUMP_METHOD void RedirectingFileSystem::dump() const { print(dbgs()); }
 #endif
 
 /// A helper class to hold the common YAML parsing state.
Index: llvm/include/llvm/Support/VirtualFileSystem.h
===================================================================
--- llvm/include/llvm/Support/VirtualFileSystem.h
+++ llvm/include/llvm/Support/VirtualFileSystem.h
@@ -910,11 +910,9 @@
 
   std::vector<llvm::StringRef> getRoots() const;
 
-  void dump(raw_ostream &OS) const;
-  void dumpEntry(raw_ostream &OS, Entry *E, int NumSpaces = 0) const;
-#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
+  void print(raw_ostream &OS) const;
+  void printEntry(raw_ostream &OS, Entry *E, int NumSpaces = 0) const;
   LLVM_DUMP_METHOD void dump() const;
-#endif
 };
 
 /// Collect all pairs of <virtual path, real path> entries from the
Index: lldb/source/Commands/CommandObjectReproducer.cpp
===================================================================
--- lldb/source/Commands/CommandObjectReproducer.cpp
+++ lldb/source/Commands/CommandObjectReproducer.cpp
@@ -425,7 +425,7 @@
       // Dump the VFS to a buffer.
       std::string str;
       raw_string_ostream os(str);
-      static_cast<vfs::RedirectingFileSystem &>(*vfs).dump(os);
+      static_cast<vfs::RedirectingFileSystem &>(*vfs).print(os);
       os.flush();
 
       // Return the string.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121494.414763.patch
Type: text/x-patch
Size: 2690 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220311/0ad33976/attachment.bin>


More information about the lldb-commits mailing list