[Lldb-commits] [lldb] r286947 - Fix uninitialized members.

Sam McCall via lldb-commits lldb-commits at lists.llvm.org
Tue Nov 15 02:58:17 PST 2016


Author: sammccall
Date: Tue Nov 15 04:58:16 2016
New Revision: 286947

URL: http://llvm.org/viewvc/llvm-project?rev=286947&view=rev
Log:
Fix uninitialized members.

Summary: Fix uninitialized members.

Reviewers: jingham

Subscribers: jingham, lldb-commits

Differential Revision: https://reviews.llvm.org/D26528

Modified:
    lldb/trunk/include/lldb/Host/FileSpec.h
    lldb/trunk/source/Host/common/FileSpec.cpp
    lldb/trunk/source/Target/Process.cpp

Modified: lldb/trunk/include/lldb/Host/FileSpec.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/FileSpec.h?rev=286947&r1=286946&r2=286947&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Host/FileSpec.h (original)
+++ lldb/trunk/include/lldb/Host/FileSpec.h Tue Nov 15 04:58:16 2016
@@ -745,9 +745,9 @@ protected:
   //------------------------------------------------------------------
   // Member variables
   //------------------------------------------------------------------
-  ConstString m_directory;    ///< The uniqued directory path
-  ConstString m_filename;     ///< The uniqued filename path
-  mutable bool m_is_resolved; ///< True if this path has been resolved.
+  ConstString m_directory;            ///< The uniqued directory path
+  ConstString m_filename;             ///< The uniqued filename path
+  mutable bool m_is_resolved = false; ///< True if this path has been resolved.
   PathSyntax
       m_syntax; ///< The syntax that this path uses (e.g. Windows / Posix)
 };

Modified: lldb/trunk/source/Host/common/FileSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/FileSpec.cpp?rev=286947&r1=286946&r2=286947&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/FileSpec.cpp (original)
+++ lldb/trunk/source/Host/common/FileSpec.cpp Tue Nov 15 04:58:16 2016
@@ -277,16 +277,14 @@ void FileSpec::Resolve(llvm::SmallVector
   }
 }
 
-FileSpec::FileSpec()
-    : m_directory(), m_filename(), m_syntax(FileSystem::GetNativePathSyntax()) {
-}
+FileSpec::FileSpec() : m_syntax(FileSystem::GetNativePathSyntax()) {}
 
 //------------------------------------------------------------------
 // Default constructor that can take an optional full path to a
 // file on disk.
 //------------------------------------------------------------------
 FileSpec::FileSpec(llvm::StringRef path, bool resolve_path, PathSyntax syntax)
-    : m_directory(), m_filename(), m_is_resolved(false), m_syntax(syntax) {
+    : m_syntax(syntax) {
   SetFile(path, resolve_path, syntax);
 }
 

Modified: lldb/trunk/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=286947&r1=286946&r2=286947&view=diff
==============================================================================
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Tue Nov 15 04:58:16 2016
@@ -4577,8 +4577,7 @@ public:
   IOHandlerProcessSTDIO(Process *process, int write_fd)
       : IOHandler(process->GetTarget().GetDebugger(),
                   IOHandler::Type::ProcessIO),
-        m_process(process), m_read_file(), m_write_file(write_fd, false),
-        m_pipe() {
+        m_process(process), m_write_file(write_fd, false) {
     m_pipe.CreateNew(false);
     m_read_file.SetDescriptor(GetInputFD(), false);
   }
@@ -4710,7 +4709,7 @@ protected:
   File m_write_file; // Write to this file (usually the master pty for getting
                      // io to debuggee)
   Pipe m_pipe;
-  std::atomic<bool> m_is_running;
+  std::atomic<bool> m_is_running{false};
 };
 
 void Process::SetSTDIOFileDescriptor(int fd) {




More information about the lldb-commits mailing list