Fix uninitialized members.

Summary: Fix uninitialized members.

Reviewers: jingham

Subscribers: jingham, lldb-commits

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

llvm-svn: 286947
This commit is contained in:
Sam McCall 2016-11-15 10:58:16 +00:00
parent a3e1125a0a
commit 6f43d9df61
3 changed files with 7 additions and 10 deletions

View File

@ -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)
};

View File

@ -277,16 +277,14 @@ void FileSpec::Resolve(llvm::SmallVectorImpl<char> &path) {
}
}
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);
}

View File

@ -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) {