diff options
author | Kazu Hirata <kazu@google.com> | 2023-03-15 18:06:32 -0700 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2023-03-15 18:06:32 -0700 |
commit | 398af9b43bbfbff291faac5bce524eca675d6caf (patch) | |
tree | 711f03500349e657ca0004eb02e02aa10391f609 /llvm/lib/CodeGen/CodeGenPrepare.cpp | |
parent | c7c1d531b9a77a735183f67a6d8b538691284f92 (diff) | |
download | llvm-398af9b43bbfbff291faac5bce524eca675d6caf.zip llvm-398af9b43bbfbff291faac5bce524eca675d6caf.tar.gz llvm-398af9b43bbfbff291faac5bce524eca675d6caf.tar.bz2 |
[llvm] Use *{Map,Set}::contains (NFC)
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r-- | llvm/lib/CodeGen/CodeGenPrepare.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp index 2c83d70..8d11f28 100644 --- a/llvm/lib/CodeGen/CodeGenPrepare.cpp +++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -3848,17 +3848,17 @@ private: SimplificationTracker &ST) { while (!TraverseOrder.empty()) { Value *Current = TraverseOrder.pop_back_val(); - assert(Map.find(Current) != Map.end() && "No node to fill!!!"); + assert(Map.contains(Current) && "No node to fill!!!"); Value *V = Map[Current]; if (SelectInst *Select = dyn_cast<SelectInst>(V)) { // CurrentValue also must be Select. auto *CurrentSelect = cast<SelectInst>(Current); auto *TrueValue = CurrentSelect->getTrueValue(); - assert(Map.find(TrueValue) != Map.end() && "No True Value!"); + assert(Map.contains(TrueValue) && "No True Value!"); Select->setTrueValue(ST.Get(Map[TrueValue])); auto *FalseValue = CurrentSelect->getFalseValue(); - assert(Map.find(FalseValue) != Map.end() && "No False Value!"); + assert(Map.contains(FalseValue) && "No False Value!"); Select->setFalseValue(ST.Get(Map[FalseValue])); } else { // Must be a Phi node then. @@ -3866,7 +3866,7 @@ private: // Fill the Phi node with values from predecessors. for (auto *B : predecessors(PHI->getParent())) { Value *PV = cast<PHINode>(Current)->getIncomingValueForBlock(B); - assert(Map.find(PV) != Map.end() && "No predecessor Value!"); + assert(Map.contains(PV) && "No predecessor Value!"); PHI->addIncoming(ST.Get(Map[PV]), B); } } |