From 3c8fc215cc28533c52212037dcb7b8028b0aeae5 Mon Sep 17 00:00:00 2001 From: Snehasish Kumar Date: Fri, 18 Feb 2022 10:35:40 -0800 Subject: [PATCH] [memprof] Remove packed qualifier for MemprofRecord::Frame. 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. Reviewed By: davidxl, tejohnson Differential Revision: https://reviews.llvm.org/D120147 --- llvm/include/llvm/ProfileData/MemProf.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/llvm/include/llvm/ProfileData/MemProf.h b/llvm/include/llvm/ProfileData/MemProf.h index 784927e..a18033f 100644 --- a/llvm/include/llvm/ProfileData/MemProf.h +++ b/llvm/include/llvm/ProfileData/MemProf.h @@ -138,7 +138,7 @@ struct MemProfRecord { // 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 @@ struct MemProfRecord { return sizeof(Frame::Function) + sizeof(Frame::LineOffset) + sizeof(Frame::Column) + sizeof(Frame::IsInlineFrame); } - }); + }; // The dynamic calling context for the allocation. std::vector CallStack; @@ -208,7 +208,8 @@ struct MemProfRecord { 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. } -- 2.7.4