[llvm] 8e8c455 - ELFObjectWriter: Use DenseMap+SmallVector. NFC

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 1 10:15:33 PDT 2024


Author: Fangrui Song
Date: 2024-07-01T10:15:29-07:00
New Revision: 8e8c455a0660576f170b4c00f3707d179b6bc82a

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

LOG: ELFObjectWriter: Use DenseMap+SmallVector. NFC

Added: 
    

Modified: 
    llvm/lib/MC/ELFObjectWriter.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp
index aaeafb3e05b0a..a451c707b306b 100644
--- a/llvm/lib/MC/ELFObjectWriter.cpp
+++ b/llvm/lib/MC/ELFObjectWriter.cpp
@@ -1075,7 +1075,7 @@ uint64_t ELFWriter::writeObject(MCAssembler &Asm) {
   RevGroupMapTy RevGroupMap;
   SectionIndexMapTy SectionIndexMap;
 
-  std::map<const MCSymbol *, std::vector<const MCSectionELF *>> GroupMembers;
+  DenseMap<const MCSymbol *, SmallVector<const MCSectionELF *, 0>> GroupMembers;
 
   // Write out the ELF header ...
   writeHeader(Asm);
@@ -1111,7 +1111,7 @@ uint64_t ELFWriter::writeObject(MCAssembler &Asm) {
         Group->setAlignment(Align(4));
         Groups.push_back(Group);
       }
-      std::vector<const MCSectionELF *> &Members =
+      SmallVector<const MCSectionELF *, 0> &Members =
           GroupMembers[SignatureSymbol];
       Members.push_back(&Section);
       if (RelSection)


        


More information about the llvm-commits mailing list