Skip to content

Commit 3c8fc21

Browse files
author
Snehasish Kumar
committed
[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
1 parent deb73a2 commit 3c8fc21

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

llvm/include/llvm/ProfileData/MemProf.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ struct MemProfRecord {
138138
// Describes a call frame for a dynamic allocation context. The contents of
139139
// the frame are populated by symbolizing the stack depot call frame from the
140140
// compiler runtime.
141-
PACKED(struct Frame {
141+
struct Frame {
142142
// A uuid (uint64_t) identifying the function. It is obtained by
143143
// llvm::md5(FunctionName) which returns the lower 64 bits.
144144
GlobalValue::GUID Function;
@@ -194,7 +194,7 @@ struct MemProfRecord {
194194
return sizeof(Frame::Function) + sizeof(Frame::LineOffset) +
195195
sizeof(Frame::Column) + sizeof(Frame::IsInlineFrame);
196196
}
197-
});
197+
};
198198

199199
// The dynamic calling context for the allocation.
200200
std::vector<Frame> CallStack;
@@ -208,7 +208,8 @@ struct MemProfRecord {
208208

209209
size_t serializedSize() const {
210210
return sizeof(uint64_t) + // The number of frames to serialize.
211-
sizeof(Frame) * CallStack.size() + // The contents of the frames.
211+
Frame::serializedSize() *
212+
CallStack.size() + // The contents of the frames.
212213
PortableMemInfoBlock::serializedSize(); // The size of the payload.
213214
}
214215

0 commit comments

Comments
 (0)