We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7be6ea1 commit 7dfaedfCopy full SHA for 7dfaedf
llvm/utils/TableGen/DAGISelMatcherEmitter.cpp
@@ -71,9 +71,9 @@ class MatcherTableEmitter {
71
MapVector<std::string, unsigned, StringMap<unsigned>> VecPatterns;
72
73
unsigned getPatternIdxFromTable(std::string &&P, std::string &&include_loc) {
74
- const auto It = VecPatterns.find(P);
75
- if (It == VecPatterns.end()) {
76
- VecPatterns.insert(std::pair(std::move(P), VecPatterns.size()));
+ const auto [It, Inserted] =
+ VecPatterns.try_emplace(std::move(P), VecPatterns.size());
+ if (Inserted) {
77
VecIncludeStrings.push_back(std::move(include_loc));
78
return VecIncludeStrings.size() - 1;
79
}
0 commit comments