[TableGen] Use std::move where possible in InstructionMemo constructor. NFCI.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 28 Aug 2018 11:10:27 +0000 (11:10 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 28 Aug 2018 11:10:27 +0000 (11:10 +0000)
Requested in post-commit review for rL339670

llvm-svn: 340819

llvm/utils/TableGen/FastISelEmitter.cpp

index b1ae683..9d18623 100644 (file)
@@ -39,12 +39,12 @@ struct InstructionMemo {
   std::vector<std::string> PhysRegs;
   std::string PredicateCheck;
 
-  InstructionMemo(const std::string &Name, const CodeGenRegisterClass *RC,
-                  const std::string &SubRegNo,
-                  const std::vector<std::string> &PhysRegs,
-                  const std::string &PredicateCheck)
-      : Name(Name), RC(RC), SubRegNo(SubRegNo), PhysRegs(PhysRegs),
-        PredicateCheck(PredicateCheck) {}
+  InstructionMemo(StringRef Name, const CodeGenRegisterClass *RC,
+                  std::string SubRegNo, std::vector<std::string> PhysRegs,
+                  std::string PredicateCheck)
+      : Name(Name), RC(RC), SubRegNo(std::move(SubRegNo)),
+        PhysRegs(std::move(PhysRegs)),
+        PredicateCheck(std::move(PredicateCheck)) {}
 
   // Make sure we do not copy InstructionMemo.
   InstructionMemo(const InstructionMemo &Other) = delete;