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

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


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

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


>From 02353148efcaf05b3c100e8d0ecd1d63ce8204c7 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Sun, 26 Oct 2025 21:06:39 -0700
Subject: [PATCH] [Analysis] Use "= default" in a constructor (NFC)

Note that all of the members are properly initialized a few lines
above the constructor.
---
 llvm/include/llvm/Analysis/IR2Vec.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);



More information about the llvm-commits mailing list