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 f4b1335 commit ecccc6aCopy full SHA for ecccc6a
llvm/lib/Transforms/Coroutines/SpillUtils.cpp
@@ -397,13 +397,11 @@ struct AllocaUseVisitor : PtrUseVisitor<AllocaUseVisitor> {
397
if (!IsOffsetKnown) {
398
AliasOffetMap[&I].reset();
399
} else {
400
- auto Itr = AliasOffetMap.find(&I);
401
- if (Itr == AliasOffetMap.end()) {
402
- AliasOffetMap[&I] = Offset;
403
- } else if (Itr->second && *Itr->second != Offset) {
+ auto [Itr, Inserted] = AliasOffetMap.try_emplace(&I, Offset);
+ if (!Inserted && Itr->second && *Itr->second != Offset) {
404
// If we have seen two different possible values for this alias, we set
405
// it to empty.
406
- AliasOffetMap[&I].reset();
+ Itr->second.reset();
407
}
408
409
0 commit comments