[llvm-branch-commits] [llvm] 5501b92 - [IR, CodeGen] Use llvm::is_contained (NFC)

Kazu Hirata via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Dec 16 21:36:20 PST 2020


Author: Kazu Hirata
Date: 2020-12-16T21:30:44-08:00
New Revision: 5501b9295762ab824ae11cf64b33b16e314bb7d2

URL: https://github.com/llvm/llvm-project/commit/5501b9295762ab824ae11cf64b33b16e314bb7d2
DIFF: https://github.com/llvm/llvm-project/commit/5501b9295762ab824ae11cf64b33b16e314bb7d2.diff

LOG: [IR, CodeGen] Use llvm::is_contained (NFC)

Added: 
    

Modified: 
    llvm/include/llvm/IR/DataLayout.h
    llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/IR/DataLayout.h b/llvm/include/llvm/IR/DataLayout.h
index 7ed7f37e3364..abac4f98882c 100644
--- a/llvm/include/llvm/IR/DataLayout.h
+++ b/llvm/include/llvm/IR/DataLayout.h
@@ -388,7 +388,7 @@ class DataLayout {
 
   bool isNonIntegralAddressSpace(unsigned AddrSpace) const {
     ArrayRef<unsigned> NonIntegralSpaces = getNonIntegralAddressSpaces();
-    return find(NonIntegralSpaces, AddrSpace) != NonIntegralSpaces.end();
+    return is_contained(NonIntegralSpaces, AddrSpace);
   }
 
   bool isNonIntegralPointerType(PointerType *PT) const {

diff  --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 0d0da6a401ba..13fb018f9db2 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -2353,7 +2353,7 @@ void SelectionDAGISel::UpdateChains(
 
       // If the node became dead and we haven't already seen it, delete it.
       if (ChainNode != NodeToMatch && ChainNode->use_empty() &&
-          !std::count(NowDeadNodes.begin(), NowDeadNodes.end(), ChainNode))
+          !llvm::is_contained(NowDeadNodes, ChainNode))
         NowDeadNodes.push_back(ChainNode);
     }
   }


        


More information about the llvm-branch-commits mailing list