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

Snehasish Kumar via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 26 12:19:09 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)
----------------
snehasish wrote:

Should this be `IndexedMemProfData&&`?

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


More information about the llvm-commits mailing list