[llvm] [Analysis] Use "= default" in a constructor (NFC) (PR #165395)

via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 28 07:10:46 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-analysis

Author: Kazu Hirata (kazutakahirata)

<details>
<summary>Changes</summary>

Note that all of the members are properly initialized a few lines
above the constructor.


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


1 Files Affected:

- (modified) llvm/include/llvm/Analysis/IR2Vec.h (+1-1) 


``````````diff
diff --git a/llvm/include/llvm/Analysis/IR2Vec.h b/llvm/include/llvm/Analysis/IR2Vec.h
index 5ad62880a779c..71055dd16a378 100644
--- a/llvm/include/llvm/Analysis/IR2Vec.h
+++ b/llvm/include/llvm/Analysis/IR2Vec.h
@@ -161,7 +161,7 @@ class VocabStorage {
 
 public:
   /// Default constructor creates empty storage (invalid state)
-  VocabStorage() : Sections(), TotalSize(0), Dimension(0) {}
+  VocabStorage() = default;
 
   /// Create a VocabStorage with pre-organized section data
   VocabStorage(std::vector<std::vector<Embedding>> &&SectionData);

``````````

</details>


https://github.com/llvm/llvm-project/pull/165395


More information about the llvm-commits mailing list