[llvm] 087ef34 - [ObjCopy][NFC] Remove unneeded zero initialization

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Wed May 18 09:42:35 PDT 2022


Author: Fangrui Song
Date: 2022-05-18T09:42:31-07:00
New Revision: 087ef34fffb27de8aacce4aa56d5c2deb53bdd0b

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

LOG: [ObjCopy][NFC] Remove unneeded zero initialization

getNewMemBuffer has called memset.

Reviewed By: alexander-shaposhnikov

Differential Revision: https://reviews.llvm.org/D125833

Added: 
    

Modified: 
    llvm/lib/ObjCopy/MachO/MachOWriter.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/ObjCopy/MachO/MachOWriter.cpp b/llvm/lib/ObjCopy/MachO/MachOWriter.cpp
index 307b2ac0b70ad..a94764a9a0349 100644
--- a/llvm/lib/ObjCopy/MachO/MachOWriter.cpp
+++ b/llvm/lib/ObjCopy/MachO/MachOWriter.cpp
@@ -651,7 +651,6 @@ Error MachOWriter::write() {
     return createStringError(errc::not_enough_memory,
                              "failed to allocate memory buffer of " +
                                  Twine::utohexstr(TotalSize) + " bytes");
-  memset(Buf->getBufferStart(), 0, totalSize());
   writeHeader();
   writeLoadCommands();
   writeSections();


        


More information about the llvm-commits mailing list