Skip to content

Commit f14375b

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

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

llvm/include/llvm/TableGen/Record.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1966,9 +1966,7 @@ class RecordKeeper {
19661966
return It == ExtraGlobals.end() ? nullptr : It->second;
19671967
}
19681968

1969-
void saveInputFilename(std::string Filename) {
1970-
InputFilename = Filename;
1971-
}
1969+
void saveInputFilename(std::string &&Filename) { InputFilename = Filename; }
19721970

19731971
void addClass(std::unique_ptr<Record> R) {
19741972
bool Ins =

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)