[llvm] 0772a0b - Revert "[memprof] Update YAML traits for writer purposes (#118720)"

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 5 01:54:35 PST 2024


Author: Florian Hahn
Date: 2024-12-05T09:54:07Z
New Revision: 0772a0bd29afa33520abf1c5a8bae09a718954b2

URL: https://github.com/llvm/llvm-project/commit/0772a0bd29afa33520abf1c5a8bae09a718954b2
DIFF: https://github.com/llvm/llvm-project/commit/0772a0bd29afa33520abf1c5a8bae09a718954b2.diff

LOG: Revert "[memprof] Update YAML traits for writer purposes (#118720)"

This reverts commit 7b8cf147addf7d3fb4630475c40153226f5fdbd0.

Breaks building on macOS
    https://lab.llvm.org/buildbot/#/builders/190/builds/10737
    https://lab.llvm.org/buildbot/#/builders/23/builds/5491
    https://green.lab.llvm.org/job/llvm.org/job/clang-stage1-cmake-RA-incremental/6076/

Added: 
    

Modified: 
    llvm/include/llvm/ProfileData/MemProf.h
    llvm/unittests/ProfileData/MemProfTest.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ProfileData/MemProf.h b/llvm/include/llvm/ProfileData/MemProf.h
index e77cf2c5666af7..9aaa2af335a239 100644
--- a/llvm/include/llvm/ProfileData/MemProf.h
+++ b/llvm/include/llvm/ProfileData/MemProf.h
@@ -1183,10 +1183,6 @@ template <> struct MappingTraits<memprof::Frame> {
     (void)Column;
     (void)IsInlineFrame;
   }
-
-  // Request the inline notation for brevity:
-  //   { Function: 123, LineOffset: 11, Column: 10; IsInlineFrame: true }
-  static const bool flow = true;
 };
 
 template <> struct CustomMappingTraits<memprof::PortableMemInfoBlock> {
@@ -1211,13 +1207,8 @@ template <> struct CustomMappingTraits<memprof::PortableMemInfoBlock> {
     Io.setError("Key is not a valid validation event");
   }
 
-  static void output(IO &Io, memprof::PortableMemInfoBlock &MIB) {
-    auto Schema = MIB.getSchema();
-#define MIBEntryDef(NameTag, Name, Type)                                       \
-  if (Schema.test(llvm::to_underlying(memprof::Meta::Name)))                   \
-    Io.mapRequired(#Name, MIB.Name);
-#include "llvm/ProfileData/MIBEntryDef.inc"
-#undef MIBEntryDef
+  static void output(IO &Io, memprof::PortableMemInfoBlock &VI) {
+    llvm_unreachable("To be implemented");
   }
 };
 

diff  --git a/llvm/unittests/ProfileData/MemProfTest.cpp b/llvm/unittests/ProfileData/MemProfTest.cpp
index 99f95dd83e009d..3ac64dcac0abed 100644
--- a/llvm/unittests/ProfileData/MemProfTest.cpp
+++ b/llvm/unittests/ProfileData/MemProfTest.cpp
@@ -807,40 +807,4 @@ TEST(MemProf, YAMLParser) {
   EXPECT_THAT(Record.CallSiteIds,
               ElementsAre(hashCallStack(CS3), hashCallStack(CS4)));
 }
-
-template <typename T> std::string serializeInYAML(T &Val) {
-  std::string Out;
-  llvm::raw_string_ostream OS(Out);
-  llvm::yaml::Output Yout(OS);
-  Yout << Val;
-  return Out;
-}
-
-TEST(MemProf, YAMLWriterFrame) {
-  Frame F(11, 22, 33, true);
-
-  std::string Out = serializeInYAML(F);
-  EXPECT_EQ(Out, R"YAML(---
-{ Function: 11, LineOffset: 22, Column: 33, Inline: true }
-...
-)YAML");
-}
-
-TEST(MemProf, YAMLWriterMIB) {
-  MemInfoBlock MIB;
-  MIB.AllocCount = 111;
-  MIB.TotalSize = 222;
-  MIB.TotalLifetime = 333;
-  MIB.TotalLifetimeAccessDensity = 444;
-  PortableMemInfoBlock PMIB(MIB, llvm::memprof::getHotColdSchema());
-
-  std::string Out = serializeInYAML(PMIB);
-  EXPECT_EQ(Out, R"YAML(---
-AllocCount:      111
-TotalSize:       222
-TotalLifetime:   333
-TotalLifetimeAccessDensity: 444
-...
-)YAML");
-}
 } // namespace


        


More information about the llvm-commits mailing list