[clang] 4db8b64 - [clang][bytecode][NFC] Remove redundant initialization (#153400)

via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 13 11:39:48 PDT 2025


Author: Victor Chernyakin
Date: 2025-08-13T11:39:45-07:00
New Revision: 4db8b64850fe8e8ceda91f287cf0b1d6223e953b

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

LOG: [clang][bytecode][NFC] Remove redundant initialization (#153400)

`std::make_unique` value-initializes array elements, so we don't need to
zero them out manually.

Added: 
    

Modified: 
    clang/lib/AST/ByteCode/Descriptor.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/ByteCode/Descriptor.cpp b/clang/lib/AST/ByteCode/Descriptor.cpp
index 234fa2c8cd8fb..9ecc7b673cf28 100644
--- a/clang/lib/AST/ByteCode/Descriptor.cpp
+++ b/clang/lib/AST/ByteCode/Descriptor.cpp
@@ -473,9 +473,7 @@ bool Descriptor::hasTrivialDtor() const {
 bool Descriptor::isUnion() const { return isRecord() && ElemRecord->isUnion(); }
 
 InitMap::InitMap(unsigned N)
-    : UninitFields(N), Data(std::make_unique<T[]>(numFields(N))) {
-  std::fill_n(data(), numFields(N), 0);
-}
+    : UninitFields(N), Data(std::make_unique<T[]>(numFields(N))) {}
 
 bool InitMap::initializeElement(unsigned I) {
   unsigned Bucket = I / PER_FIELD;


        


More information about the cfe-commits mailing list