Skip to content

Conversation

@kazutakahirata
Copy link
Contributor

It's a bit safer to keep the initialization attached to the member
variable.

It's a bit safer to keep the initialization attached to the member
variable.
@llvmbot llvmbot added the PGO Profile Guided Optimizations label Aug 27, 2025
@llvmbot
Copy link
Member

llvmbot commented Aug 27, 2025

@llvm/pr-subscribers-pgo

Author: Kazu Hirata (kazutakahirata)

Changes

It's a bit safer to keep the initialization attached to the member
variable.


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

1 Files Affected:

  • (modified) llvm/include/llvm/ProfileData/DataAccessProf.h (+2-2)
diff --git a/llvm/include/llvm/ProfileData/DataAccessProf.h b/llvm/include/llvm/ProfileData/DataAccessProf.h
index f410096d83f5e..07230f23f3385 100644
--- a/llvm/include/llvm/ProfileData/DataAccessProf.h
+++ b/llvm/include/llvm/ProfileData/DataAccessProf.h
@@ -116,9 +116,9 @@ struct DataAccessProfRecord {
       Locations.emplace_back(Loc.FileName, Loc.Line);
   }
   // Empty constructor is used in yaml conversion.
-  DataAccessProfRecord() : AccessCount(0) {}
+  DataAccessProfRecord() = default;
   SymbolHandle SymHandle;
-  uint64_t AccessCount;
+  uint64_t AccessCount = 0;
   // The locations of data in the source code. Optional.
   SmallVector<SourceLocation> Locations;
 };

@kazutakahirata kazutakahirata merged commit 2e75710 into llvm:main Aug 27, 2025
11 checks passed
@kazutakahirata kazutakahirata deleted the memprof_DataAccessProfRecord branch August 27, 2025 22:37
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