[llvm] ad74adb - [Analysis] Modernize CallStackTrie (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 16 12:12:20 PDT 2023


Author: Kazu Hirata
Date: 2023-04-16T12:12:08-07:00
New Revision: ad74adbd33c0df4da6a5922f4925234c738eea3a

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

LOG: [Analysis] Modernize CallStackTrie (NFC)

Identified with modernize-use-default-member-init.

Added: 
    

Modified: 
    llvm/include/llvm/Analysis/MemoryProfileInfo.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Analysis/MemoryProfileInfo.h b/llvm/include/llvm/Analysis/MemoryProfileInfo.h
index 51fc6e02788a8..9a97c76a4dd04 100644
--- a/llvm/include/llvm/Analysis/MemoryProfileInfo.h
+++ b/llvm/include/llvm/Analysis/MemoryProfileInfo.h
@@ -58,9 +58,9 @@ class CallStackTrie {
   };
 
   // The node for the allocation at the root.
-  CallStackTrieNode *Alloc;
+  CallStackTrieNode *Alloc = nullptr;
   // The allocation's leaf stack id.
-  uint64_t AllocStackId;
+  uint64_t AllocStackId = 0;
 
   void deleteTrieNode(CallStackTrieNode *Node) {
     if (!Node)
@@ -77,7 +77,7 @@ class CallStackTrie {
                      bool CalleeHasAmbiguousCallerContext);
 
 public:
-  CallStackTrie() : Alloc(nullptr), AllocStackId(0) {}
+  CallStackTrie() = default;
   ~CallStackTrie() { deleteTrieNode(Alloc); }
 
   bool empty() const { return Alloc == nullptr; }


        


More information about the llvm-commits mailing list