[llvm] 74cc7fd - [MC] Use DenseMap for ConstantPool::CachedEntries. NFC. (#208728)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 10 09:16:15 PDT 2026
Author: Jay Foad
Date: 2026-07-10T17:16:10+01:00
New Revision: 74cc7fdcc850416b5760b8245c6f80e468220732
URL: https://github.com/llvm/llvm-project/commit/74cc7fdcc850416b5760b8245c6f80e468220732
DIFF: https://github.com/llvm/llvm-project/commit/74cc7fdcc850416b5760b8245c6f80e468220732.diff
LOG: [MC] Use DenseMap for ConstantPool::CachedEntries. NFC. (#208728)
This is mostly just a revert of:
3d0f9507d5e3 "[MC] Fix constant pools with DenseMap sentinel values"
although the key type has changed in the mean time. DenseMap no longer
uses sentinels so the reasons for avoiding it no longer apply.
Added:
Modified:
llvm/include/llvm/MC/ConstantPools.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/MC/ConstantPools.h b/llvm/include/llvm/MC/ConstantPools.h
index 2ce9cb25fd5be..43e17e9a2cd35 100644
--- a/llvm/include/llvm/MC/ConstantPools.h
+++ b/llvm/include/llvm/MC/ConstantPools.h
@@ -17,7 +17,6 @@
#include "llvm/ADT/SmallVector.h"
#include "llvm/Support/SMLoc.h"
#include <cstdint>
-#include <map>
namespace llvm {
@@ -46,7 +45,7 @@ class ConstantPool {
// Caches of entries that already exist, indexed by their contents
// and also the size of the constant.
- std::map<std::pair<int64_t, unsigned>, const MCSymbolRefExpr *>
+ DenseMap<std::pair<int64_t, unsigned>, const MCSymbolRefExpr *>
CachedConstantEntries;
DenseMap<std::pair<const MCSymbol *, unsigned>, const MCSymbolRefExpr *>
CachedSymbolEntries;
More information about the llvm-commits
mailing list