summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2016-01-08 07:06:29 +0000
committerCraig Topper <craig.topper@gmail.com>2016-01-08 07:06:29 +0000
commit1993e3b7b28198207517e26aab62937b38202e99 (patch)
treec1d6b7022cf9b18e26805526f8104103c3832930
parentd5ec65ba338493c3a615219cf8b2ad3fb75b5377 (diff)
downloadbcm5719-llvm-1993e3b7b28198207517e26aab62937b38202e99.tar.gz
bcm5719-llvm-1993e3b7b28198207517e26aab62937b38202e99.zip
[TableGen] Combine variable declaration and initialization. Move a string into a vector instead of copying. NFC
llvm-svn: 257155
-rw-r--r--llvm/utils/TableGen/AsmWriterEmitter.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/utils/TableGen/AsmWriterEmitter.cpp b/llvm/utils/TableGen/AsmWriterEmitter.cpp
index cc74f9ebcec..7b0a2fb7929 100644
--- a/llvm/utils/TableGen/AsmWriterEmitter.cpp
+++ b/llvm/utils/TableGen/AsmWriterEmitter.cpp
@@ -159,11 +159,10 @@ FindUniqueOperandCommands(std::vector<std::string> &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<std::string> &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.
OpenPOWER on IntegriCloud