[llvm] [memprof] Make InstrProfwriter::addMemProfRecord and its friends private (NFC) (PR #119831)

via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 12 23:30:35 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-pgo

Author: Kazu Hirata (kazutakahirata)

<details>
<summary>Changes</summary>

This patch makes the following functions private:

- InstrProfWriter::addMemProfRecord
- InstrProfWriter::addMemProfFrame
- InstrProfWriter::addMemProfCallStack

These days, we add MemProf profile to the writer context via
addMemProfData.  We no longer add individual items.


---
Full diff: https://github.com/llvm/llvm-project/pull/119831.diff


1 Files Affected:

- (modified) llvm/include/llvm/ProfileData/InstrProfWriter.h (+15-15) 


``````````diff
diff --git a/llvm/include/llvm/ProfileData/InstrProfWriter.h b/llvm/include/llvm/ProfileData/InstrProfWriter.h
index 117fddb5729e40..67d85daa816237 100644
--- a/llvm/include/llvm/ProfileData/InstrProfWriter.h
+++ b/llvm/include/llvm/ProfileData/InstrProfWriter.h
@@ -115,21 +115,6 @@ class InstrProfWriter {
   void addTemporalProfileTraces(SmallVectorImpl<TemporalProfTraceTy> &SrcTraces,
                                 uint64_t SrcStreamSize);
 
-  /// Add a memprof record for a function identified by its \p Id.
-  void addMemProfRecord(const GlobalValue::GUID Id,
-                        const memprof::IndexedMemProfRecord &Record);
-
-  /// Add a memprof frame identified by the hash of the contents of the frame in
-  /// \p FrameId.
-  bool addMemProfFrame(const memprof::FrameId, const memprof::Frame &F,
-                       function_ref<void(Error)> Warn);
-
-  /// Add a call stack identified by the hash of the contents of the call stack
-  /// in \p CallStack.
-  bool addMemProfCallStack(const memprof::CallStackId CSId,
-                           const llvm::SmallVector<memprof::FrameId> &CallStack,
-                           function_ref<void(Error)> Warn);
-
   /// Add the entire MemProfData \p Incoming to the writer context.
   bool addMemProfData(memprof::IndexedMemProfData Incoming,
                       function_ref<void(Error)> Warn);
@@ -229,6 +214,21 @@ class InstrProfWriter {
   /// Add \p Trace using reservoir sampling.
   void addTemporalProfileTrace(TemporalProfTraceTy Trace);
 
+  /// Add a memprof record for a function identified by its \p Id.
+  void addMemProfRecord(const GlobalValue::GUID Id,
+                        const memprof::IndexedMemProfRecord &Record);
+
+  /// Add a memprof frame identified by the hash of the contents of the frame in
+  /// \p FrameId.
+  bool addMemProfFrame(const memprof::FrameId, const memprof::Frame &F,
+                       function_ref<void(Error)> Warn);
+
+  /// Add a call stack identified by the hash of the contents of the call stack
+  /// in \p CallStack.
+  bool addMemProfCallStack(const memprof::CallStackId CSId,
+                           const llvm::SmallVector<memprof::FrameId> &CallStack,
+                           function_ref<void(Error)> Warn);
+
   Error writeImpl(ProfOStream &OS);
 
   // Writes known header fields and reserves space for fields whose value are

``````````

</details>


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


More information about the llvm-commits mailing list