[llvm] [memprof] Add YAML read/write support to llvm-profdata (PR #118915)

Snehasish Kumar via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 6 12:33:56 PST 2024


================
@@ -213,6 +213,19 @@ class RawMemProfReader final : public MemProfReader {
 class YAMLMemProfReader final : public MemProfReader {
 public:
   YAMLMemProfReader() = default;
+
+  // Return true if the \p DataBuffer starts "---" indicating it is a YAML file.
+  static bool hasFormat(const MemoryBuffer &DataBuffer);
+  // Return true if the file at \p Path starts with magic bytes indicating it is
+  // a raw binary memprof profile.
----------------
snehasish wrote:

Update this comment to indicate that it's just a wrapper around the other one which reads the file as a memorybuffer?

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


More information about the llvm-commits mailing list