Skip to content

[memprof] Rename Inline to IsInlineFrame in YAML #118901

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 6, 2024

Conversation

kazutakahirata
Copy link
Contributor

This patch makes the YAML field name match the struct field name.

This patch makes the YAML field name match the struct field name.
@llvmbot llvmbot added the PGO Profile Guided Optimizations label Dec 6, 2024
@llvmbot
Copy link
Member

llvmbot commented Dec 6, 2024

@llvm/pr-subscribers-pgo

Author: Kazu Hirata (kazutakahirata)

Changes

This patch makes the YAML field name match the struct field name.


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

2 Files Affected:

  • (modified) llvm/include/llvm/ProfileData/MemProf.h (+1-1)
  • (modified) llvm/unittests/ProfileData/MemProfTest.cpp (+9-9)
diff --git a/llvm/include/llvm/ProfileData/MemProf.h b/llvm/include/llvm/ProfileData/MemProf.h
index a007baa7f1d51c..51f012cdaed3ac 100644
--- a/llvm/include/llvm/ProfileData/MemProf.h
+++ b/llvm/include/llvm/ProfileData/MemProf.h
@@ -1159,7 +1159,7 @@ template <> struct MappingTraits<memprof::Frame> {
     Io.mapRequired("Function", F.Function);
     Io.mapRequired("LineOffset", F.LineOffset);
     Io.mapRequired("Column", F.Column);
-    Io.mapRequired("Inline", F.IsInlineFrame);
+    Io.mapRequired("IsInlineFrame", F.IsInlineFrame);
 
     // Assert that the definition of Frame matches what we expect.  The
     // structured bindings below detect changes to the number of fields.
diff --git a/llvm/unittests/ProfileData/MemProfTest.cpp b/llvm/unittests/ProfileData/MemProfTest.cpp
index 99f95dd83e009d..f0567d0707fef0 100644
--- a/llvm/unittests/ProfileData/MemProfTest.cpp
+++ b/llvm/unittests/ProfileData/MemProfTest.cpp
@@ -743,22 +743,22 @@ TEST(MemProf, YAMLParser) {
 - GUID: 0xdeadbeef12345678
   AllocSites:
   - Callstack:
-    - {Function: 0x100, LineOffset: 11, Column: 10, Inline: true}
-    - {Function: 0x200, LineOffset: 22, Column: 20, Inline: false}
+    - {Function: 0x100, LineOffset: 11, Column: 10, IsInlineFrame: true}
+    - {Function: 0x200, LineOffset: 22, Column: 20, IsInlineFrame: false}
     MemInfoBlock:
       AllocCount: 777
       TotalSize: 888
   - Callstack:
-    - {Function: 0x300, LineOffset: 33, Column: 30, Inline: false}
-    - {Function: 0x400, LineOffset: 44, Column: 40, Inline: true}
+    - {Function: 0x300, LineOffset: 33, Column: 30, IsInlineFrame: false}
+    - {Function: 0x400, LineOffset: 44, Column: 40, IsInlineFrame: true}
     MemInfoBlock:
       AllocCount: 666
       TotalSize: 555
   CallSites:
-  - - {Function: 0x500, LineOffset: 55, Column: 50, Inline: true}
-    - {Function: 0x600, LineOffset: 66, Column: 60, Inline: false}
-  - - {Function: 0x700, LineOffset: 77, Column: 70, Inline: true}
-    - {Function: 0x800, LineOffset: 88, Column: 80, Inline: false}
+  - - {Function: 0x500, LineOffset: 55, Column: 50, IsInlineFrame: true}
+    - {Function: 0x600, LineOffset: 66, Column: 60, IsInlineFrame: false}
+  - - {Function: 0x700, LineOffset: 77, Column: 70, IsInlineFrame: true}
+    - {Function: 0x800, LineOffset: 88, Column: 80, IsInlineFrame: false}
 )YAML";
 
   llvm::memprof::YAMLMemProfReader YAMLReader;
@@ -821,7 +821,7 @@ TEST(MemProf, YAMLWriterFrame) {
 
   std::string Out = serializeInYAML(F);
   EXPECT_EQ(Out, R"YAML(---
-{ Function: 11, LineOffset: 22, Column: 33, Inline: true }
+{ Function: 11, LineOffset: 22, Column: 33, IsInlineFrame: true }
 ...
 )YAML");
 }

Copy link
Contributor

@snehasish snehasish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@kazutakahirata kazutakahirata merged commit d88a0c7 into llvm:main Dec 6, 2024
10 checks passed
@kazutakahirata kazutakahirata deleted the memprof_IsInline branch December 6, 2024 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PGO Profile Guided Optimizations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants