Skip to content

Commit 4230d21

Browse files
committed
fixed #95641 pointless string copy
1 parent b6be53d commit 4230d21

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

llvm/include/llvm/TableGen/Record.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ class BitsRecTy : public RecTy {
142142

143143
unsigned getNumBits() const { return Size; }
144144

145+
145146
std::string getAsString() const override;
146147

147148
bool typeIsConvertibleTo(const RecTy *RHS) const override;
@@ -1966,7 +1967,7 @@ class RecordKeeper {
19661967
return It == ExtraGlobals.end() ? nullptr : It->second;
19671968
}
19681969

1969-
void saveInputFilename(std::string Filename) {
1970+
void saveInputFilename(std::string && Filename) {
19701971
InputFilename = Filename;
19711972
}
19721973

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)