[llvm] [memprof] Move YAML traits to MemProf.h (NFC) (PR #118668)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 4 10:23:05 PST 2024


================
@@ -1145,6 +1146,95 @@ template <typename FrameIdTy> class CallStackRadixTreeBuilder {
   }
 };
 } // namespace memprof
+
+namespace yaml {
+template <> struct MappingTraits<memprof::Frame> {
+  static void mapping(IO &Io, memprof::Frame &F) {
+    Io.mapRequired("Function", F.Function);
+    Io.mapRequired("LineOffset", F.LineOffset);
+    Io.mapRequired("Column", F.Column);
+    Io.mapRequired("Inline", F.IsInlineFrame);
----------------
kazutakahirata wrote:

I borrowed the name from `Frame::printYAML`, which uses `"Inline"` for `IsInlineFrame`, but yes, I'm going to update it in a separate patch.  I think it's best to keep a move and a renaming separate.

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


More information about the llvm-commits mailing list