[llvm] [memprof] Modernize DataAccessProfRecord (NFC) (PR #155702)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 27 14:27:11 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-pgo
Author: Kazu Hirata (kazutakahirata)
<details>
<summary>Changes</summary>
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
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;
};
``````````
</details>
https://github.com/llvm/llvm-project/pull/155702
More information about the llvm-commits
mailing list