diff --git a/llvm/unittests/ProfileData/MemProfTest.cpp b/llvm/unittests/ProfileData/MemProfTest.cpp index 8b700673814c3..5602b8a1ec9b4 100644 --- a/llvm/unittests/ProfileData/MemProfTest.cpp +++ b/llvm/unittests/ProfileData/MemProfTest.cpp @@ -556,14 +556,12 @@ TEST(MemProf, MissingCallStackId) { } TEST(MemProf, MissingFrameId) { - IndexedAllocationInfo AI(0x222, makePartialMIB(), getHotColdSchema()); - - IndexedMemProfRecord IndexedMR; - IndexedMR.AllocSites.push_back(AI); - // An empty Frame map to trigger a mapping error. IndexedMemProfData MemProfData; - MemProfData.CallStacks.insert({0x222, {2, 3}}); + auto CSId = MemProfData.addCallStack(SmallVector{2, 3}); + + IndexedMemProfRecord IndexedMR; + IndexedMR.AllocSites.emplace_back(CSId, makePartialMIB(), getHotColdSchema()); FrameIdConverter FrameIdConv( MemProfData.Frames);