From: Craig Topper Date: Fri, 8 Jan 2016 07:06:29 +0000 (+0000) Subject: [TableGen] Combine variable declaration and initialization. Move a string into a... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d028f0c94b8c0ca9e1e75717e162e95f8c886ab6;p=oota-llvm.git [TableGen] Combine variable declaration and initialization. Move a string into a vector instead of copying. NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257155 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/utils/TableGen/AsmWriterEmitter.cpp b/utils/TableGen/AsmWriterEmitter.cpp index cc74f9ebcec..7b0a2fb7929 100644 --- a/utils/TableGen/AsmWriterEmitter.cpp +++ b/utils/TableGen/AsmWriterEmitter.cpp @@ -159,11 +159,10 @@ FindUniqueOperandCommands(std::vector &UniqueOperandCommands, if (!Inst) continue; // PHI, INLINEASM, CFI_INSTRUCTION, etc. - std::string Command; if (Inst->Operands.empty()) continue; // Instruction already done. - Command = " " + Inst->Operands[0].getCode() + "\n"; + std::string Command = " " + Inst->Operands[0].getCode() + "\n"; // Check to see if we already have 'Command' in UniqueOperandCommands. // If not, add it. @@ -178,7 +177,7 @@ FindUniqueOperandCommands(std::vector &UniqueOperandCommands, } if (!FoundIt) { InstIdxs[i] = UniqueOperandCommands.size(); - UniqueOperandCommands.push_back(Command); + UniqueOperandCommands.push_back(std::move(Command)); InstrsForCase.push_back(Inst->CGI->TheDef->getName()); // This command matches one operand so far.