[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
This commit is contained in:
Jonas Devlieghere 2019-05-23 05:45:49 +00:00
parent 24374aef1b
commit 202dc1291e
2 changed files with 3 additions and 3 deletions

View File

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

View File

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