mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
[TableGen] Use std::find instead of a manual loop. NFC
llvm-svn: 258004
This commit is contained in:
parent
944463fffc
commit
280927f594
@ -169,16 +169,14 @@ FindUniqueOperandCommands(std::vector<std::string> &UniqueOperandCommands,
|
||||
|
||||
// Check to see if we already have 'Command' in UniqueOperandCommands.
|
||||
// If not, add it.
|
||||
bool FoundIt = false;
|
||||
for (unsigned idx = 0, e = UniqueOperandCommands.size(); idx != e; ++idx)
|
||||
if (UniqueOperandCommands[idx] == Command) {
|
||||
InstIdxs[i] = idx;
|
||||
InstrsForCase[idx] += ", ";
|
||||
InstrsForCase[idx] += Inst->CGI->TheDef->getName();
|
||||
FoundIt = true;
|
||||
break;
|
||||
}
|
||||
if (!FoundIt) {
|
||||
auto I = std::find(UniqueOperandCommands.begin(),
|
||||
UniqueOperandCommands.end(), Command);
|
||||
if (I != UniqueOperandCommands.end()) {
|
||||
size_t idx = I - UniqueOperandCommands.begin();
|
||||
InstIdxs[i] = idx;
|
||||
InstrsForCase[idx] += ", ";
|
||||
InstrsForCase[idx] += Inst->CGI->TheDef->getName();
|
||||
} else {
|
||||
InstIdxs[i] = UniqueOperandCommands.size();
|
||||
UniqueOperandCommands.push_back(std::move(Command));
|
||||
InstrsForCase.push_back(Inst->CGI->TheDef->getName());
|
||||
|
Loading…
Reference in New Issue
Block a user