Skip to content

Commit a93b77c

Browse files
[memprof] Fix IndexedMemProfRecord::clear (#118533)
This patch ensures that IndexedMemProfRecord::clear clears every field of IndexedMemProfRecord. This fix is not critical at the moment. The only use of this function is in RecordWriterTrait::EmitData to release the memory we are done with. That is, we never clear the data structure for the purpose of reusing it.
1 parent e08e5e2 commit a93b77c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/include/llvm/ProfileData/MemProf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ struct IndexedMemProfRecord {
416416
// the last entry in the list with the same function GUID.
417417
llvm::SmallVector<CallStackId> CallSiteIds;
418418

419-
void clear() { AllocSites.clear(); }
419+
void clear() { *this = IndexedMemProfRecord(); }
420420

421421
void merge(const IndexedMemProfRecord &Other) {
422422
// TODO: Filter out duplicates which may occur if multiple memprof

0 commit comments

Comments
 (0)