[llvm] d548b0d - [ADT] Use default member initialization in IndexedMap (NFC) (#164754)

via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 22 23:42:08 PDT 2025


Author: Kazu Hirata
Date: 2025-10-22T23:42:05-07:00
New Revision: d548b0de1c5033f5fd396ee0afbeb244f9e025c4

URL: https://github.com/llvm/llvm-project/commit/d548b0de1c5033f5fd396ee0afbeb244f9e025c4
DIFF: https://github.com/llvm/llvm-project/commit/d548b0de1c5033f5fd396ee0afbeb244f9e025c4.diff

LOG: [ADT] Use default member initialization in IndexedMap (NFC) (#164754)

Added: 
    

Modified: 
    llvm/include/llvm/ADT/IndexedMap.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ADT/IndexedMap.h b/llvm/include/llvm/ADT/IndexedMap.h
index 638fe14bfe797..55935a7afdab4 100644
--- a/llvm/include/llvm/ADT/IndexedMap.h
+++ b/llvm/include/llvm/ADT/IndexedMap.h
@@ -44,11 +44,11 @@ class IndexedMap {
   using StorageT = SmallVector<T, 0>;
 
   StorageT storage_;
-  T nullVal_;
+  T nullVal_ = T();
   ToIndexT toIndex_;
 
 public:
-  IndexedMap() : nullVal_(T()) {}
+  IndexedMap() = default;
 
   explicit IndexedMap(const T &val) : nullVal_(val) {}
 


        


More information about the llvm-commits mailing list