[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:
parent
24374aef1b
commit
202dc1291e
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue