diff options
author | Kazu Hirata <kazu@google.com> | 2024-12-12 07:55:07 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-12 07:55:07 -0800 |
commit | fda80a4fcad8bab67fc1f522d68012e572866066 (patch) | |
tree | dff7f1a0a2bf85243bc10b4f17badc9a8eadf588 /llvm/unittests/ProfileData/MemProfTest.cpp | |
parent | 2f8238f849c4836b333082f387d91408234ea73b (diff) | |
download | llvm-fda80a4fcad8bab67fc1f522d68012e572866066.zip llvm-fda80a4fcad8bab67fc1f522d68012e572866066.tar.gz llvm-fda80a4fcad8bab67fc1f522d68012e572866066.tar.bz2 |
[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.
Diffstat (limited to 'llvm/unittests/ProfileData/MemProfTest.cpp')
-rw-r--r-- | llvm/unittests/ProfileData/MemProfTest.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
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<FrameId>{2, 3}); + + IndexedMemProfRecord IndexedMR; + IndexedMR.AllocSites.emplace_back(CSId, makePartialMIB(), getHotColdSchema()); FrameIdConverter<decltype(MemProfData.Frames)> FrameIdConv( MemProfData.Frames); |