diff options
author | Craig Topper <craig.topper@sifive.com> | 2021-01-30 13:14:46 -0800 |
---|---|---|
committer | Craig Topper <craig.topper@sifive.com> | 2021-01-30 13:16:39 -0800 |
commit | b5e3a5785dab0d0c7aa68cc65c2dd348488e72d1 (patch) | |
tree | 51723d6e2c4dc40be91b348a402eaa9fe3e872e3 /llvm/utils/TableGen/CodeGenDAGPatterns.cpp | |
parent | 4e04a535d8f836804d39e8861ae17d7817293c5a (diff) | |
download | llvm-b5e3a5785dab0d0c7aa68cc65c2dd348488e72d1.zip llvm-b5e3a5785dab0d0c7aa68cc65c2dd348488e72d1.tar.gz llvm-b5e3a5785dab0d0c7aa68cc65c2dd348488e72d1.tar.bz2 |
[TableGen] Use emplace_back to add to PatternsToMatch in GenerateVariants. Use std::move when adding to PatternsToMatch in AddPatternToMatch.
We already used emplace_back in at least one other place so be
consistent.
AddPatternToMatch already took PTM as an rvalue reference, but
we need to use std::move again to move it into the PatternToMatch
vector.
Diffstat (limited to 'llvm/utils/TableGen/CodeGenDAGPatterns.cpp')
-rw-r--r-- | llvm/utils/TableGen/CodeGenDAGPatterns.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp index d4409db..52c47f5 100644 --- a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp +++ b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp @@ -3958,7 +3958,7 @@ void CodeGenDAGPatterns::AddPatternToMatch(TreePattern *Pattern, SrcNames[Entry.first].second == 1) Pattern->error("Pattern has dead named input: $" + Entry.first); - PatternsToMatch.push_back(PTM); + PatternsToMatch.push_back(std::move(PTM)); } void CodeGenDAGPatterns::InferInstructionFlags() { @@ -4719,11 +4719,11 @@ void CodeGenDAGPatterns::GenerateVariants() { if (AlreadyExists) continue; // Otherwise, add it to the list of patterns we have. - PatternsToMatch.push_back(PatternToMatch( + PatternsToMatch.emplace_back( PatternsToMatch[i].getSrcRecord(), PatternsToMatch[i].getPredicates(), Variant, PatternsToMatch[i].getDstPatternShared(), PatternsToMatch[i].getDstRegs(), - PatternsToMatch[i].getAddedComplexity(), Record::getNewUID())); + PatternsToMatch[i].getAddedComplexity(), Record::getNewUID()); MatchedPredicates.push_back(Matches); // Add a new match the same as this pattern. |