[PATCH] D120147: [memprof] Remove packed qualifier for MemprofRecord::Frame.

Snehasish Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 18 10:37:51 PST 2022


snehasish created this revision.
snehasish added reviewers: davidxl, tejohnson.
snehasish requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Now that we use dedicated serialize and deserialize methods in order to
ensure consistency across big and small endian systems. The packed
qualifier on the Frame struct can be removed.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D120147

Files:
  llvm/include/llvm/ProfileData/MemProf.h


Index: llvm/include/llvm/ProfileData/MemProf.h
===================================================================
--- llvm/include/llvm/ProfileData/MemProf.h
+++ llvm/include/llvm/ProfileData/MemProf.h
@@ -138,7 +138,7 @@
   // Describes a call frame for a dynamic allocation context. The contents of
   // the frame are populated by symbolizing the stack depot call frame from the
   // compiler runtime.
-  PACKED(struct Frame {
+  struct Frame {
     // A uuid (uint64_t) identifying the function. It is obtained by
     // llvm::md5(FunctionName) which returns the lower 64 bits.
     GlobalValue::GUID Function;
@@ -194,7 +194,7 @@
       return sizeof(Frame::Function) + sizeof(Frame::LineOffset) +
              sizeof(Frame::Column) + sizeof(Frame::IsInlineFrame);
     }
-  });
+  };
 
   // The dynamic calling context for the allocation.
   std::vector<Frame> CallStack;
@@ -208,7 +208,8 @@
 
   size_t serializedSize() const {
     return sizeof(uint64_t) + // The number of frames to serialize.
-           sizeof(Frame) * CallStack.size() + // The contents of the frames.
+           Frame::serializedSize() *
+               CallStack.size() + // The contents of the frames.
            PortableMemInfoBlock::serializedSize(); // The size of the payload.
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120147.409973.patch
Type: text/x-patch
Size: 1278 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220218/d3465e93/attachment.bin>


More information about the llvm-commits mailing list