[Lldb-commits] [lldb] r361459 - [Reproducer] Pass FileSpec by const-ref. (NFC)
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Wed May 22 22:45:49 PDT 2019
Author: jdevlieghere
Date: Wed May 22 22:45:49 2019
New Revision: 361459
URL: http://llvm.org/viewvc/llvm-project?rev=361459&view=rev
Log:
[Reproducer] Pass FileSpec by const-ref. (NFC)
Fix two functions where we were passing FileSpecs by value, while we
could pass by const reference.
Modified:
lldb/trunk/include/lldb/Utility/Reproducer.h
lldb/trunk/source/Utility/Reproducer.cpp
Modified: lldb/trunk/include/lldb/Utility/Reproducer.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/Reproducer.h?rev=361459&r1=361458&r2=361459&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Utility/Reproducer.h (original)
+++ lldb/trunk/include/lldb/Utility/Reproducer.h Wed May 22 22:45:49 2019
@@ -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)
Modified: lldb/trunk/source/Utility/Reproducer.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/Reproducer.cpp?rev=361459&r1=361458&r2=361459&view=diff
==============================================================================
--- lldb/trunk/source/Utility/Reproducer.cpp (original)
+++ lldb/trunk/source/Utility/Reproducer.cpp Wed May 22 22:45:49 2019
@@ -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)
More information about the lldb-commits
mailing list