Skip to content

Commit a886870

Browse files
committed
[TableGen] Use std::map::try_emplace to simplify code in GlobalISelEmitter. NFC
1 parent 13c2514 commit a886870

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

llvm/utils/TableGen/GlobalISelEmitter.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2520,9 +2520,7 @@ void GlobalISelEmitter::run(raw_ostream &OS) {
25202520
}
25212521

25222522
void GlobalISelEmitter::declareSubtargetFeature(Record *Predicate) {
2523-
if (SubtargetFeatures.count(Predicate) == 0)
2524-
SubtargetFeatures.emplace(
2525-
Predicate, SubtargetFeatureInfo(Predicate, SubtargetFeatures.size()));
2523+
SubtargetFeatures.try_emplace(Predicate, Predicate, SubtargetFeatures.size());
25262524
}
25272525

25282526
} // end anonymous namespace

0 commit comments

Comments
 (0)