Skip to content

Commit 76af93f

Browse files
Partially revert "[TableGen] Avoid repeated hash lookups (NFC) (#122586)"
This partially reverts commit 07ff786. The hunk being reverted in this patch seems to break: tools/llvm-gsymutil/ARM_AArch64/macho-merged-funcs-dwarf.yaml under LLVM_ENABLE_EXPENSIVE_CHECKS.
1 parent 36c3466 commit 76af93f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/utils/TableGen/Common/CodeGenSchedule.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,9 +415,9 @@ void CodeGenSchedModels::collectSTIPredicates() {
415415
for (const Record *R : Records.getAllDerivedDefinitions("STIPredicate")) {
416416
const Record *Decl = R->getValueAsDef("Declaration");
417417

418-
const auto [It, Inserted] =
419-
Decl2Index.try_emplace(Decl, STIPredicates.size());
420-
if (Inserted) {
418+
const auto It = Decl2Index.find(Decl);
419+
if (It == Decl2Index.end()) {
420+
Decl2Index[Decl] = STIPredicates.size();
421421
STIPredicateFunction Predicate(Decl);
422422
Predicate.addDefinition(R);
423423
STIPredicates.emplace_back(std::move(Predicate));

0 commit comments

Comments
 (0)