[llvm] [memprof] Use return values from addFrame and addCallStack (NFC) (PR #119676)

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 12 07:30:05 PST 2024


================
@@ -443,19 +443,17 @@ TEST(MemProf, BaseMemProfReaderWithCSIdMap) {
            /*Column=*/5, /*IsInlineFrame=*/true);
   Frame F2(/*Hash=*/IndexedMemProfRecord::getGUID("bar"), /*LineOffset=*/10,
            /*Column=*/2, /*IsInlineFrame=*/false);
-  MemProfData.addFrame(F1);
-  MemProfData.addFrame(F2);
+  auto F1Id = MemProfData.addFrame(F1);
+  auto F2Id = MemProfData.addFrame(F2);
 
-  llvm::SmallVector<FrameId> CallStack = {F1.hash(), F2.hash()};
-  MemProfData.addCallStack(CallStack);
+  llvm::SmallVector<FrameId> CallStack = {F1Id, F2Id};
+  auto CSId = MemProfData.addCallStack(CallStack);
----------------
teresajohnson wrote:

Can we / should we std::move CallStack here and in other places that you have modified, like you are on line 418, since it looks like we may no l longer need the callstacks now after addCallStack??

https://github.com/llvm/llvm-project/pull/119676


More information about the llvm-commits mailing list