[llvm] [AsmPrinter] Use DenseMap instead of MapVector (NFC) (PR #214256)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 5 08:33:30 PDT 2026
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/214256
MBBSectionNumBlocks is accessed only via MapVector::operator[].
This patch changes its type to DenseMap to avoid populating the vector
portion of MapVector.
>From a7bf3e5fe1e640e0f6e7292bbf604fbabbed4d09 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Wed, 5 Aug 2026 07:53:21 -0700
Subject: [PATCH] [AsmPrinter] Use DenseMap instead of MapVector (NFC)
MBBSectionNumBlocks is accessed only via MapVector::operator[].
This patch changes its type to DenseMap to avoid populating the vector
portion of MapVector.
---
llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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