[llvm] [memprof] Update YAML traits for writer purposes (PR #118720)

Snehasish Kumar via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 4 16:31:24 PST 2024


================
@@ -807,4 +807,38 @@ TEST(MemProf, YAMLParser) {
   EXPECT_THAT(Record.CallSiteIds,
               ElementsAre(hashCallStack(CS3), hashCallStack(CS4)));
 }
+
+TEST(MemProf, YAMLWriterFrame) {
+  Frame F(12, 34, 56, true);
+
+  std::string Out;
+  llvm::raw_string_ostream OS(Out);
+  llvm::yaml::Output Yout(OS);
+  Yout << F;
----------------
snehasish wrote:

You could refactor this out into a little helper (templated to the type being serialized) that can be reused across the tests.

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


More information about the llvm-commits mailing list