From fda80a4fcad8bab67fc1f522d68012e572866066 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Thu, 12 Dec 2024 07:55:07 -0800 Subject: [memprof] Use addCallStack in a unit test (NFC) (#119651) Here IndexedMemProfRecord just needs to reference a CallStackID, so we can use addCallStack for a real hash-based CallStackId instead of a fake value like 0x222. --- llvm/unittests/ProfileData/MemProfTest.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'llvm/unittests/ProfileData/MemProfTest.cpp') diff --git a/llvm/unittests/ProfileData/MemProfTest.cpp b/llvm/unittests/ProfileData/MemProfTest.cpp index db69686..dbaf32d 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); -- cgit v1.1