We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent df25511 commit af6c699Copy full SHA for af6c699
llvm/utils/TableGen/Common/CodeGenSchedule.cpp
@@ -413,9 +413,9 @@ void CodeGenSchedModels::collectSTIPredicates() {
413
for (const Record *R : Records.getAllDerivedDefinitions("STIPredicate")) {
414
const Record *Decl = R->getValueAsDef("Declaration");
415
416
- const auto It = Decl2Index.find(Decl);
417
- if (It == Decl2Index.end()) {
418
- Decl2Index[Decl] = STIPredicates.size();
+ const auto [It, Inserted] =
+ Decl2Index.try_emplace(Decl, STIPredicates.size());
+ if (Inserted) {
419
STIPredicateFunction Predicate(Decl);
420
Predicate.addDefinition(R);
421
STIPredicates.emplace_back(std::move(Predicate));
0 commit comments