[llvm] 1e9d4f4 - [AsmPrinter] Use DenseMap instead of MapVector (NFC) (#214256)

via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 5 10:49:10 PDT 2026


Author: Kazu Hirata
Date: 2026-08-05T10:48:56-07:00
New Revision: 1e9d4f40360b0e4a67c7a0547da54a3c5caf62b6

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

LOG: [AsmPrinter] Use DenseMap instead of MapVector (NFC) (#214256)

MBBSectionNumBlocks is accessed only via MapVector::operator[].

This patch changes its type to DenseMap to avoid populating the vector
portion of MapVector.

Added: 
    

Modified: 
    llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 0580fc0f3a034..6b38991831c45 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -1534,7 +1534,7 @@ void AsmPrinter::emitBBAddrMapSection(const MachineFunction &MF) {
     OutStreamer->emitULEB128IntValue(MBBSectionRanges.size());
   }
   // Number of blocks in each MBB section.
-  MapVector<MBBSectionID, unsigned> MBBSectionNumBlocks;
+  DenseMap<MBBSectionID, unsigned> MBBSectionNumBlocks;
   const MCSymbol *PrevMBBEndSymbol = nullptr;
   if (!Features.MultiBBRange) {
     OutStreamer->AddComment("function address");


        


More information about the llvm-commits mailing list