Skip to content

Commit 538a31b

Browse files
committed
#95641 pointless string copy
1 parent b6be53d commit 538a31b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

llvm/include/llvm/TableGen/Record.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1967,7 +1967,7 @@ class RecordKeeper {
19671967
}
19681968

19691969
void saveInputFilename(std::string Filename) {
1970-
InputFilename = Filename;
1970+
InputFilename = std::move(Filename);
19711971
}
19721972

19731973
void addClass(std::unique_ptr<Record> R) {

llvm/lib/TableGen/Main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ int llvm::TableGenMain(const char *argv0,
113113
return reportError(argv0, "Could not open input file '" + InputFilename +
114114
"': " + EC.message() + "\n");
115115

116-
Records.saveInputFilename(InputFilename);
116+
Records.saveInputFilename(std::move(InputFilename));
117117

118118
// Tell SrcMgr about this buffer, which is what TGParser will pick up.
119119
SrcMgr.AddNewSourceBuffer(std::move(*FileOrErr), SMLoc());

0 commit comments

Comments
 (0)