[llvm] [memprof] Use a new constructor of IndexedAllocationInfo (NFC) (PR #116920)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 19 21:50:14 PST 2024


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/116920

IndexedAllocationInfo now has a new constructor that allows us to omit
the inline call stack, which is going away soon.  This patch migrates
away from the old constructor.


>From 075c5d46f9fdc78b27d1c6efc339669f0ba9a819 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Tue, 19 Nov 2024 20:43:10 -0800
Subject: [PATCH] [memprof] Use a new constructor of IndexedAllocationInfo
 (NFC)

IndexedAllocationInfo now has a new constructor that allows us to omit
the inline call stack, which is going away soon.  This patch migrates
away from the old constructor.
---
 llvm/unittests/Transforms/Instrumentation/MemProfUseTest.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/unittests/Transforms/Instrumentation/MemProfUseTest.cpp b/llvm/unittests/Transforms/Instrumentation/MemProfUseTest.cpp
index ec81d2e5609163..f0d978674f3242 100644
--- a/llvm/unittests/Transforms/Instrumentation/MemProfUseTest.cpp
+++ b/llvm/unittests/Transforms/Instrumentation/MemProfUseTest.cpp
@@ -323,7 +323,7 @@ makeRecordV2(std::initializer_list<::llvm::memprof::CallStackId> AllocFrames,
   for (const auto &CSId : AllocFrames) {
     // We don't populate IndexedAllocationInfo::CallStack because we use it only
     // in Version1.
-    MR.AllocSites.push_back({{}, CSId, Block, Schema});
+    MR.AllocSites.emplace_back(CSId, Block, Schema);
   }
   for (const auto &CSId : CallSiteFrames)
     MR.CallSiteIds.push_back(CSId);



More information about the llvm-commits mailing list