diff --git a/llvm/utils/TableGen/ARMTargetDefEmitter.cpp b/llvm/utils/TableGen/ARMTargetDefEmitter.cpp index adb5f1d95b572..3b02f63e9490b 100644 --- a/llvm/utils/TableGen/ARMTargetDefEmitter.cpp +++ b/llvm/utils/TableGen/ARMTargetDefEmitter.cpp @@ -223,7 +223,7 @@ static void emitARMTargetDef(const RecordKeeper &RK, raw_ostream &OS) { // Name of the object in C++ const std::string CppSpelling = ArchInfoName(Major, Minor, ProfileUpper); OS << "inline constexpr ArchInfo " << CppSpelling << " = {\n"; - CppSpellings.push_back(CppSpelling); + CppSpellings.push_back(std::move(CppSpelling)); OS << llvm::format(" VersionTuple{%d, %d},\n", Major, Minor); OS << llvm::format(" %sProfile,\n", ProfileUpper.c_str()); diff --git a/llvm/utils/TableGen/CallingConvEmitter.cpp b/llvm/utils/TableGen/CallingConvEmitter.cpp index de20303a5bfd2..444b10719cb03 100644 --- a/llvm/utils/TableGen/CallingConvEmitter.cpp +++ b/llvm/utils/TableGen/CallingConvEmitter.cpp @@ -163,9 +163,9 @@ void CallingConvEmitter::emitAction(const Record *Action, indent Indent, O << Indent << "if (MCRegister Reg = State.AllocateReg(" << Name << ")) {\n"; if (SwiftAction) - AssignedSwiftRegsMap[CurrentAction].insert(Name); + AssignedSwiftRegsMap[CurrentAction].insert(std::move(Name)); else - AssignedRegsMap[CurrentAction].insert(Name); + AssignedRegsMap[CurrentAction].insert(std::move(Name)); } else { O << Indent << "static const MCPhysReg RegList" << ++Counter << "[] = {\n"; diff --git a/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp index 163a1a78a2ec4..b6b669f18cfbc 100644 --- a/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp +++ b/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp @@ -3183,7 +3183,8 @@ void TreePattern::dump() const { print(errs()); } CodeGenDAGPatterns::CodeGenDAGPatterns(const RecordKeeper &R, PatternRewriterFn PatternRewriter) : Records(R), Target(R), Intrinsics(R), - LegalVTS(Target.getLegalValueTypes()), PatternRewriter(PatternRewriter) { + LegalVTS(Target.getLegalValueTypes()), + PatternRewriter(std::move(PatternRewriter)) { ParseNodeInfo(); ParseNodeTransforms(); ParseComplexPatterns(); diff --git a/llvm/utils/TableGen/Common/CodeGenInstAlias.cpp b/llvm/utils/TableGen/Common/CodeGenInstAlias.cpp index 293ed76e0f502..30694ac2bb213 100644 --- a/llvm/utils/TableGen/Common/CodeGenInstAlias.cpp +++ b/llvm/utils/TableGen/Common/CodeGenInstAlias.cpp @@ -228,7 +228,7 @@ CodeGenInstAlias::CodeGenInstAlias(const Record *R, const CodeGenTarget &T) if (NumSubOps == 1 || (InstOpRec->getValue("ParserMatchClass") && InstOpRec->getValueAsDef("ParserMatchClass") ->getValueAsString("Name") != "Imm")) { - ResultOperands.push_back(ResOp); + ResultOperands.push_back(std::move(ResOp)); ResultInstOperandIndex.push_back(std::pair(i, -1)); ++AliasOpNo; diff --git a/llvm/utils/TableGen/Common/CodeGenInstruction.cpp b/llvm/utils/TableGen/Common/CodeGenInstruction.cpp index f72fe4c6fd562..344c4c15e2ebd 100644 --- a/llvm/utils/TableGen/Common/CodeGenInstruction.cpp +++ b/llvm/utils/TableGen/Common/CodeGenInstruction.cpp @@ -137,7 +137,7 @@ CGIOperandList::CGIOperandList(const Record *R) : TheDef(R) { " has the same name as a previous operand!"); OperandInfo &OpInfo = OperandList.emplace_back( - Rec, std::string(ArgName), std::string(PrintMethod), + Rec, std::string(ArgName), std::string(std::move(PrintMethod)), OperandNamespace + "::" + OperandType, MIOperandNo, NumOps, MIOpInfo); if (SubArgDag) { @@ -180,7 +180,7 @@ CGIOperandList::CGIOperandList(const Record *R) : TheDef(R) { } else if (!EncoderMethod.empty()) { // If we have no explicit sub-op dag, but have an top-level encoder // method, the single encoder will multiple sub-ops, itself. - OpInfo.EncoderMethodNames[0] = EncoderMethod; + OpInfo.EncoderMethodNames[0] = std::move(EncoderMethod); for (unsigned j = 1; j < NumOps; ++j) OpInfo.DoNotEncode[j] = true; } diff --git a/llvm/utils/TableGen/CompressInstEmitter.cpp b/llvm/utils/TableGen/CompressInstEmitter.cpp index e087ff0726638..7ebfe50a86d0f 100644 --- a/llvm/utils/TableGen/CompressInstEmitter.cpp +++ b/llvm/utils/TableGen/CompressInstEmitter.cpp @@ -115,8 +115,9 @@ class CompressInstEmitter { CompressPat(const CodeGenInstruction &S, const CodeGenInstruction &D, std::vector RF, IndexedMap &SourceMap, IndexedMap &DestMap, bool IsCompressOnly) - : Source(S), Dest(D), PatReqFeatures(RF), SourceOperandMap(SourceMap), - DestOperandMap(DestMap), IsCompressOnly(IsCompressOnly) {} + : Source(S), Dest(D), PatReqFeatures(std::move(RF)), + SourceOperandMap(SourceMap), DestOperandMap(DestMap), + IsCompressOnly(IsCompressOnly) {} }; enum EmitterType { Compress, Uncompress, CheckCompress }; const RecordKeeper &Records; @@ -485,9 +486,9 @@ void CompressInstEmitter::evaluateCompressPat(const Record *Rec) { return R->getValueAsBit("AssemblerMatcherPredicate"); }); - CompressPatterns.push_back(CompressPat(SourceInst, DestInst, PatReqFeatures, - SourceOperandMap, DestOperandMap, - Rec->getValueAsBit("isCompressOnly"))); + CompressPatterns.push_back(CompressPat( + SourceInst, DestInst, std::move(PatReqFeatures), SourceOperandMap, + DestOperandMap, Rec->getValueAsBit("isCompressOnly"))); } static void @@ -523,7 +524,7 @@ getReqFeatures(std::set> &FeaturesSet, } if (IsOr) - AnyOfFeatureSets.insert(AnyOfSet); + AnyOfFeatureSets.insert(std::move(AnyOfSet)); } } diff --git a/llvm/utils/TableGen/DecoderEmitter.cpp b/llvm/utils/TableGen/DecoderEmitter.cpp index 4d2320b31ea94..90a6d0ee8acb5 100644 --- a/llvm/utils/TableGen/DecoderEmitter.cpp +++ b/llvm/utils/TableGen/DecoderEmitter.cpp @@ -1893,7 +1893,7 @@ OperandInfo getOpInfo(const Record *TypeRecord) { bool HasCompleteDecoder = HasCompleteDecoderBit ? HasCompleteDecoderBit->getValue() : true; - return OperandInfo(Decoder, HasCompleteDecoder); + return OperandInfo(std::move(Decoder), HasCompleteDecoder); } static void parseVarLenInstOperand(const Record &Def, @@ -2024,7 +2024,7 @@ populateInstruction(const CodeGenTarget &Target, const Record &EncodingDef, EncodingDef.getValueAsBit("hasCompleteDecoder"); InsnOperands.push_back( OperandInfo(std::string(InstDecoder), HasCompleteInstDecoder)); - Operands[Opc] = InsnOperands; + Operands[Opc] = std::move(InsnOperands); return Bits.getNumBits(); } @@ -2059,7 +2059,7 @@ populateInstruction(const CodeGenTarget &Target, const Record &EncodingDef, MyName = Op.Name; TiedNames[MyName] = TiedName; - TiedNames[TiedName] = MyName; + TiedNames[TiedName] = std::move(MyName); } } } @@ -2112,7 +2112,7 @@ populateInstruction(const CodeGenTarget &Target, const Record &EncodingDef, addOneOperandFields(EncodingDef, Bits, TiedNames, SubOpName, SubOpInfo); - InsnOperands.push_back(SubOpInfo); + InsnOperands.push_back(std::move(SubOpInfo)); } continue; } @@ -2143,7 +2143,7 @@ populateInstruction(const CodeGenTarget &Target, const Record &EncodingDef, // instruction! (This is a longstanding bug, which will be addressed in an // upcoming change.) if (OpInfo.numFields() > 0) - InsnOperands.push_back(OpInfo); + InsnOperands.push_back(std::move(OpInfo)); } } Operands[Opc] = InsnOperands; diff --git a/llvm/utils/TableGen/FastISelEmitter.cpp b/llvm/utils/TableGen/FastISelEmitter.cpp index 2052222cae5e5..58d2ecc3aaebc 100644 --- a/llvm/utils/TableGen/FastISelEmitter.cpp +++ b/llvm/utils/TableGen/FastISelEmitter.cpp @@ -567,7 +567,7 @@ void FastISelMap::collectPatterns(const CodeGenDAGPatterns &CGP) { ++DstIndex; } - PhysRegInputs.push_back(PhysReg); + PhysRegInputs.push_back(std::move(PhysReg)); } if (Op->getName() != "EXTRACT_SUBREG" && DstIndex < Dst.getNumChildren()) @@ -591,7 +591,8 @@ void FastISelMap::collectPatterns(const CodeGenDAGPatterns &CGP) { // Ok, we found a pattern that we can handle. Remember it. InstructionMemo Memo(Pattern.getDstPattern().getOperator()->getName(), - DstRC, SubRegNo, PhysRegInputs, PredicateCheck); + DstRC, std::move(SubRegNo), std::move(PhysRegInputs), + PredicateCheck); int complexity = Pattern.getPatternComplexity(CGP); diff --git a/llvm/utils/TableGen/OptionParserEmitter.cpp b/llvm/utils/TableGen/OptionParserEmitter.cpp index 86e8378ad5ac5..48f5818938ae8 100644 --- a/llvm/utils/TableGen/OptionParserEmitter.cpp +++ b/llvm/utils/TableGen/OptionParserEmitter.cpp @@ -482,7 +482,7 @@ static void emitOptionParser(const RecordKeeper &Records, raw_ostream &OS) { HelpTextsForVariants.push_back(std::make_pair( VisibilityNames, VisibilityHelp->getValueAsString("Text"))); } - emitHelpTextsForVariants(OS, HelpTextsForVariants); + emitHelpTextsForVariants(OS, std::move(HelpTextsForVariants)); // The option meta-variable name. OS << ", ";