[TableGen] Return const std::string& in InstrMap getName()/getFilterClass() methods. NFCI.

Avoid temp std::string instances - we're never keeping these around, just printing them to streams, converting to StringRef etc.
This commit is contained in:
Simon Pilgrim 2020-12-17 15:22:52 +00:00
parent 01089c876b
commit bd343d2681
1 changed files with 3 additions and 3 deletions

View File

@ -144,9 +144,9 @@ public:
}
}
std::string getName() const { return Name; }
const std::string &getName() const { return Name; }
std::string getFilterClass() const { return FilterClass; }
const std::string &getFilterClass() const { return FilterClass; }
ListInit *getRowFields() const { return RowFields; }
@ -190,7 +190,7 @@ private:
public:
MapTableEmitter(CodeGenTarget &Target, RecordKeeper &Records, Record *IMRec):
Target(Target), InstrMapDesc(IMRec) {
const std::string FilterClass = InstrMapDesc.getFilterClass();
const std::string &FilterClass = InstrMapDesc.getFilterClass();
InstrDefs = Records.getAllDerivedDefinitions(FilterClass);
}