[llvm] 25ac7a0 - [llvm] Use SmallDenseMap::contains (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 27 00:18:29 PDT 2023
Author: Kazu Hirata
Date: 2023-08-27T00:18:16-07:00
New Revision: 25ac7a0d11a9da1df983d19898fdc161ac08f977
URL: https://github.com/llvm/llvm-project/commit/25ac7a0d11a9da1df983d19898fdc161ac08f977
DIFF: https://github.com/llvm/llvm-project/commit/25ac7a0d11a9da1df983d19898fdc161ac08f977.diff
LOG: [llvm] Use SmallDenseMap::contains (NFC)
Added:
Modified:
llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
llvm/lib/ProfileData/ItaniumManglingCanonicalizer.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
index 57df9b67fd0263..b2c2b40139eda6 100644
--- a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
+++ b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
@@ -2543,7 +2543,7 @@ void InstrRefBasedLDV::placeMLocPHIs(
for (unsigned int I = 0; I < OrderToBB.size(); ++I) {
MachineBasicBlock *MBB = OrderToBB[I];
const auto &TransferFunc = MLocTransfer[MBB->getNumber()];
- if (TransferFunc.find(L) != TransferFunc.end())
+ if (TransferFunc.contains(L))
DefBlocks.insert(MBB);
}
diff --git a/llvm/lib/ProfileData/ItaniumManglingCanonicalizer.cpp b/llvm/lib/ProfileData/ItaniumManglingCanonicalizer.cpp
index afbb09ed35fc15..593677214e5823 100644
--- a/llvm/lib/ProfileData/ItaniumManglingCanonicalizer.cpp
+++ b/llvm/lib/ProfileData/ItaniumManglingCanonicalizer.cpp
@@ -149,7 +149,7 @@ class CanonicalizerAllocator : public FoldingNodeAllocator {
// Node is pre-existing; check if it's in our remapping table.
if (auto *N = Remappings.lookup(Result.first)) {
Result.first = N;
- assert(Remappings.find(Result.first) == Remappings.end() &&
+ assert(!Remappings.contains(Result.first) &&
"should never need multiple remap steps");
}
if (Result.first == TrackedNode)
More information about the llvm-commits
mailing list