Skip to content

Commit b5102fe

Browse files
committed
Address comments
1 parent bceecf2 commit b5102fe

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

llvm/lib/Transforms/Instrumentation/MemProfUse.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -416,18 +416,19 @@ handleAllocSite(Instruction &I, CallBase *CI,
416416
DenseMap<uint64_t, const AllocationInfo *> UniqueFullContextIdAllocInfo;
417417
for (auto *AllocInfo : AllocInfoSet) {
418418
auto FullStackId = computeFullStackId(AllocInfo->CallStack);
419-
auto Insert = UniqueFullContextIdAllocInfo.insert({FullStackId, AllocInfo});
419+
auto [It, Inserted] =
420+
UniqueFullContextIdAllocInfo.insert({FullStackId, AllocInfo});
420421
// If inserted entry, done.
421-
if (Insert.second)
422+
if (Inserted)
422423
continue;
423424
// Keep the larger one, or the noncold one if they are the same size.
424-
auto CurSize = Insert.first->second->Info.getTotalSize();
425+
auto CurSize = It->second->Info.getTotalSize();
425426
auto NewSize = AllocInfo->Info.getTotalSize();
426427
if ((CurSize > NewSize) ||
427428
(CurSize == NewSize &&
428429
getAllocType(AllocInfo) != AllocationType::NotCold))
429430
continue;
430-
Insert.first->second = AllocInfo;
431+
It->second = AllocInfo;
431432
}
432433
// We may match this instruction's location list to multiple MIB
433434
// contexts. Add them to a Trie specialized for trimming the contexts to

0 commit comments

Comments
 (0)