diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2019-05-23 05:45:49 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2019-05-23 05:45:49 +0000 |
commit | 202dc1291eae2add93207cbf788a64f4341b1c59 (patch) | |
tree | 649c70b77357be353f48f80ab18937793a6c4996 | |
parent | 24374aef1b108028fdc588aa06c66b0d813d112a (diff) | |
download | bcm5719-llvm-202dc1291eae2add93207cbf788a64f4341b1c59.tar.gz bcm5719-llvm-202dc1291eae2add93207cbf788a64f4341b1c59.zip |
[Reproducer] Pass FileSpec by const-ref. (NFC)
Fix two functions where we were passing FileSpecs by value, while we
could pass by const reference.
llvm-svn: 361459
-rw-r--r-- | lldb/include/lldb/Utility/Reproducer.h | 4 | ||||
-rw-r--r-- | lldb/source/Utility/Reproducer.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lldb/include/lldb/Utility/Reproducer.h b/lldb/include/lldb/Utility/Reproducer.h index 60e6ffe65a5..cc50b26330d 100644 --- a/lldb/include/lldb/Utility/Reproducer.h +++ b/lldb/include/lldb/Utility/Reproducer.h @@ -113,12 +113,12 @@ private: class DataRecorder { public: - DataRecorder(FileSpec filename, std::error_code &ec) + DataRecorder(const FileSpec &filename, std::error_code &ec) : m_filename(std::move(filename)), m_os(m_filename.GetPath(), ec, llvm::sys::fs::F_Text), m_record(true) {} static llvm::Expected<std::unique_ptr<DataRecorder>> - Create(FileSpec filename); + Create(const FileSpec &filename); template <typename T> void Record(const T &t, bool newline = false) { if (!m_record) diff --git a/lldb/source/Utility/Reproducer.cpp b/lldb/source/Utility/Reproducer.cpp index 967521c4364..f5ca39cddc7 100644 --- a/lldb/source/Utility/Reproducer.cpp +++ b/lldb/source/Utility/Reproducer.cpp @@ -221,7 +221,7 @@ bool Loader::HasFile(StringRef file) { } llvm::Expected<std::unique_ptr<DataRecorder>> -DataRecorder::Create(FileSpec filename) { +DataRecorder::Create(const FileSpec &filename) { std::error_code ec; auto recorder = llvm::make_unique<DataRecorder>(std::move(filename), ec); if (ec) |