[llvm] [memprof] Use IndexedMemProfRecord in MemProfReader (NFC) (PR #117613)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 26 13:02:16 PST 2024


================
@@ -97,28 +82,18 @@ class MemProfReader {
   virtual ~MemProfReader() = default;
 
   // Initialize the MemProfReader with the given MemProf profile.
-  MemProfReader(IndexedMemProfData MemProfData) {
-    for (const auto &[FrameId, F] : MemProfData.Frames)
-      IdToFrame.try_emplace(FrameId, F);
-    for (const auto &[CSId, CS] : MemProfData.CallStacks)
-      CSIdToCallStack.try_emplace(CSId, CS);
-    FunctionProfileData = std::move(MemProfData.Records);
-  }
+  MemProfReader(IndexedMemProfData MemProfData)
----------------
kazutakahirata wrote:

Fixed in the latest iteration.  I added `std::move` to a couple of places in `llvm/unittests/ProfileData/MemProfTest.cpp`.

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


More information about the llvm-commits mailing list