[llvm] 8483bf4 - [SPIRV] Use llvm::is_contained (NFC) (#155136)

via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 23 22:20:17 PDT 2025


Author: Kazu Hirata
Date: 2025-08-23T22:20:15-07:00
New Revision: 8483bf442e2afa0c052463f9f18ee270b0f7e54d

URL: https://github.com/llvm/llvm-project/commit/8483bf442e2afa0c052463f9f18ee270b0f7e54d
DIFF: https://github.com/llvm/llvm-project/commit/8483bf442e2afa0c052463f9f18ee270b0f7e54d.diff

LOG: [SPIRV] Use llvm::is_contained (NFC) (#155136)

We can pass a range to llvm::is_contained.

Added: 
    

Modified: 
    llvm/lib/Target/SPIRV/SPIRVCommandLine.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/SPIRV/SPIRVCommandLine.cpp b/llvm/lib/Target/SPIRV/SPIRVCommandLine.cpp
index 9f64eeb0088e2..e7da5504b2d58 100644
--- a/llvm/lib/Target/SPIRV/SPIRVCommandLine.cpp
+++ b/llvm/lib/Target/SPIRV/SPIRVCommandLine.cpp
@@ -228,7 +228,7 @@ SPIRVExtensionsParser::getValidExtensions(const Triple &TT) {
         SPIRV::OperandCategory::OperandCategory::ExtensionOperand,
         ExtensionEnum);
 
-    if (std::count(AllowedEnv.begin(), AllowedEnv.end(), CurrentEnvironment))
+    if (llvm::is_contained(AllowedEnv, CurrentEnvironment))
       R.insert(ExtensionEnum);
   }
 


        


More information about the llvm-commits mailing list