diff --git a/llvm/unittests/ProfileData/MemProfTest.cpp b/llvm/unittests/ProfileData/MemProfTest.cpp index af801d0ff5e1e..2cb4725ab89e3 100644 --- a/llvm/unittests/ProfileData/MemProfTest.cpp +++ b/llvm/unittests/ProfileData/MemProfTest.cpp @@ -422,7 +422,7 @@ TEST(MemProf, BaseMemProfReader) { Block.AllocCount = 1U, Block.TotalAccessDensity = 4, Block.TotalLifetime = 200001; FakeRecord.AllocSites.emplace_back(/*CSId=*/CSId, /*MB=*/Block); - MemProfData.Records.insert({F1.hash(), FakeRecord}); + MemProfData.Records.try_emplace(0x1234, std::move(FakeRecord)); MemProfReader Reader(std::move(MemProfData)); @@ -454,7 +454,7 @@ TEST(MemProf, BaseMemProfReaderWithCSIdMap) { Block.AllocCount = 1U, Block.TotalAccessDensity = 4, Block.TotalLifetime = 200001; FakeRecord.AllocSites.emplace_back(/*CSId=*/CSId, /*MB=*/Block); - MemProfData.Records.insert({F1.hash(), FakeRecord}); + MemProfData.Records.try_emplace(0x1234, std::move(FakeRecord)); MemProfReader Reader(std::move(MemProfData));