[flang-commits] [flang] 3c5509d - [flang] Use llvm::is_contained (NFC) (#102999)

via flang-commits flang-commits at lists.llvm.org
Mon Aug 12 22:53:34 PDT 2024


Author: Kazu Hirata
Date: 2024-08-12T22:53:28-07:00
New Revision: 3c5509d9ad25ee49aa68ab0c60d73d9587635b62

URL: https://github.com/llvm/llvm-project/commit/3c5509d9ad25ee49aa68ab0c60d73d9587635b62
DIFF: https://github.com/llvm/llvm-project/commit/3c5509d9ad25ee49aa68ab0c60d73d9587635b62.diff

LOG: [flang] Use llvm::is_contained (NFC) (#102999)

Added: 
    

Modified: 
    flang/lib/Evaluate/intrinsics.cpp
    flang/lib/Lower/OpenMP/OpenMP.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Evaluate/intrinsics.cpp b/flang/lib/Evaluate/intrinsics.cpp
index 039dbcb82f7452..fcedf5ec3ddf83 100644
--- a/flang/lib/Evaluate/intrinsics.cpp
+++ b/flang/lib/Evaluate/intrinsics.cpp
@@ -2628,10 +2628,7 @@ bool IntrinsicProcTable::Implementation::IsDualIntrinsic(
   static const std::string dualIntrinsic[]{
       {"etime"s}, {"getcwd"s}, {"rename"s}, {"second"s}};
 
-  return std::find_if(std::begin(dualIntrinsic), std::end(dualIntrinsic),
-             [&name](const std::string &dualName) {
-               return dualName == name;
-             }) != std::end(dualIntrinsic);
+  return llvm::is_contained(dualIntrinsic, name);
 }
 
 IntrinsicClass IntrinsicProcTable::Implementation::GetIntrinsicClass(

diff  --git a/flang/lib/Lower/OpenMP/OpenMP.cpp b/flang/lib/Lower/OpenMP/OpenMP.cpp
index 1c0e541e4a36a7..26825468df9b1d 100644
--- a/flang/lib/Lower/OpenMP/OpenMP.cpp
+++ b/flang/lib/Lower/OpenMP/OpenMP.cpp
@@ -1700,10 +1700,10 @@ genTargetOp(lower::AbstractConverter &converter, lower::SymMap &symTable,
     // map for it.
     if (const Fortran::semantics::Symbol *common =
             Fortran::semantics::FindCommonBlockContaining(sym.GetUltimate()))
-      if (llvm::find(mapSyms, common) != mapSyms.end())
+      if (llvm::is_contained(mapSyms, common))
         return;
 
-    if (llvm::find(mapSyms, &sym) == mapSyms.end()) {
+    if (!llvm::is_contained(mapSyms, &sym)) {
       mlir::Value baseOp = converter.getSymbolAddress(sym);
       if (!baseOp)
         if (const auto *details =


        


More information about the flang-commits mailing list