[llvm] cc63ae4 - [VFS] Rename `RedirectingFileSystem::dump` to `print`
Ben Barham via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 14 11:44:19 PDT 2022
Author: Ben Barham
Date: 2022-03-14T11:44:07-07:00
New Revision: cc63ae42d77200ed85dd0d57f1d5c5800a67683c
URL: https://github.com/llvm/llvm-project/commit/cc63ae42d77200ed85dd0d57f1d5c5800a67683c
DIFF: https://github.com/llvm/llvm-project/commit/cc63ae42d77200ed85dd0d57f1d5c5800a67683c.diff
LOG: [VFS] Rename `RedirectingFileSystem::dump` to `print`
The rest of LLVM uses `print` for the method taking the `raw_ostream`
and `dump` only for the method with no parameters. Use the same for
`RedirectingFileSystem`.
Differential Revision: https://reviews.llvm.org/D121494
Added:
Modified:
lldb/source/Commands/CommandObjectReproducer.cpp
llvm/include/llvm/Support/VirtualFileSystem.h
llvm/lib/Support/VirtualFileSystem.cpp
Removed:
################################################################################
diff --git a/lldb/source/Commands/CommandObjectReproducer.cpp b/lldb/source/Commands/CommandObjectReproducer.cpp
index 143712134feeb..f7ff0662b2d1e 100644
--- a/lldb/source/Commands/CommandObjectReproducer.cpp
+++ b/lldb/source/Commands/CommandObjectReproducer.cpp
@@ -425,7 +425,7 @@ class CommandObjectReproducerDump : public CommandObjectParsed {
// 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.
diff --git a/llvm/include/llvm/Support/VirtualFileSystem.h b/llvm/include/llvm/Support/VirtualFileSystem.h
index 182a5c1b3cdba..64b4d4dcd35af 100644
--- a/llvm/include/llvm/Support/VirtualFileSystem.h
+++ b/llvm/include/llvm/Support/VirtualFileSystem.h
@@ -910,8 +910,9 @@ class RedirectingFileSystem : public vfs::FileSystem {
std::vector<llvm::StringRef> getRoots() const;
- void dump(raw_ostream &OS) const;
- void dumpEntry(raw_ostream &OS, Entry *E, int NumSpaces = 0) const;
+ void print(raw_ostream &OS) const;
+ void printEntry(raw_ostream &OS, Entry *E, int NumSpaces = 0) const;
+
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
LLVM_DUMP_METHOD void dump() const;
#endif
diff --git a/llvm/lib/Support/VirtualFileSystem.cpp b/llvm/lib/Support/VirtualFileSystem.cpp
index 590bc1902fbe4..1ca18e4b82cb9 100644
--- a/llvm/lib/Support/VirtualFileSystem.cpp
+++ b/llvm/lib/Support/VirtualFileSystem.cpp
@@ -1381,14 +1381,14 @@ std::vector<StringRef> RedirectingFileSystem::getRoots() const {
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 @@ void RedirectingFileSystem::dumpEntry(raw_ostream &OS,
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()); }
+void RedirectingFileSystem::dump() const { print(dbgs()); }
#endif
/// A helper class to hold the common YAML parsing state.
More information about the llvm-commits
mailing list