[Lldb-commits] [lldb] 95807cb - [LLDB] Remove dead code from StreamFile

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Wed Nov 13 15:13:58 PST 2019


Author: Jonas Devlieghere
Date: 2019-11-13T15:08:51-08:00
New Revision: 95807cb039c96323570e0d16a8cbafbf759f7141

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

LOG: [LLDB] Remove dead code from StreamFile

Added: 
    

Modified: 
    lldb/include/lldb/Core/StreamFile.h
    lldb/source/Core/StreamFile.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/include/lldb/Core/StreamFile.h b/lldb/include/lldb/Core/StreamFile.h
index 712b289aa8d9..bd7d6e8e6ad3 100644
--- a/lldb/include/lldb/Core/StreamFile.h
+++ b/lldb/include/lldb/Core/StreamFile.h
@@ -21,15 +21,10 @@ namespace lldb_private {
 
 class StreamFile : public Stream {
 public:
-  // Constructors and Destructors
-  StreamFile();
-
   StreamFile(uint32_t flags, uint32_t addr_size, lldb::ByteOrder byte_order);
 
   StreamFile(int fd, bool transfer_ownership);
 
-  StreamFile(const char *path);
-
   StreamFile(const char *path, File::OpenOptions options,
              uint32_t permissions = lldb::eFilePermissionsFileDefault);
 
@@ -47,7 +42,6 @@ class StreamFile : public Stream {
 
   void Flush() override;
 
-
 protected:
   // Classes that inherit from StreamFile can see and modify these
   std::shared_ptr<File> m_file_sp; // never NULL

diff  --git a/lldb/source/Core/StreamFile.cpp b/lldb/source/Core/StreamFile.cpp
index 2ddb39659d66..475c27ec4117 100644
--- a/lldb/source/Core/StreamFile.cpp
+++ b/lldb/source/Core/StreamFile.cpp
@@ -15,9 +15,6 @@
 using namespace lldb;
 using namespace lldb_private;
 
-// StreamFile constructor
-StreamFile::StreamFile() : Stream() { m_file_sp = std::make_shared<File>(); }
-
 StreamFile::StreamFile(uint32_t flags, uint32_t addr_size, ByteOrder byte_order)
     : Stream(flags, addr_size, byte_order) {
   m_file_sp = std::make_shared<File>();
@@ -32,20 +29,6 @@ StreamFile::StreamFile(FILE *fh, bool transfer_ownership) : Stream() {
   m_file_sp = std::make_shared<NativeFile>(fh, transfer_ownership);
 }
 
-StreamFile::StreamFile(const char *path) : Stream() {
-  auto file = FileSystem::Instance().Open(
-      FileSpec(path), File::eOpenOptionWrite | File::eOpenOptionCanCreate |
-                          File::eOpenOptionCloseOnExec);
-  if (file)
-    m_file_sp = std::move(file.get());
-  else {
-    // TODO refactor this so the error gets popagated up instead of logged here.
-    LLDB_LOG_ERROR(GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST), file.takeError(),
-                   "Cannot open {1}: {0}", path);
-    m_file_sp = std::make_shared<File>();
-  }
-}
-
 StreamFile::StreamFile(const char *path, File::OpenOptions options,
                        uint32_t permissions)
     : Stream() {


        


More information about the lldb-commits mailing list