[llvm-branch-commits] [clang] f40ed13 - [Driver] Use StringSet::contains (NFC)

Kazu Hirata via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Oct 25 20:44:26 PDT 2023


Author: Kazu Hirata
Date: 2023-10-25T20:14:35-07:00
New Revision: f40ed134b485db5f950f51a0d175caffe607b2f1

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

LOG: [Driver] Use StringSet::contains (NFC)

Added: 
    

Modified: 
    clang/lib/Driver/Driver.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index f5fd900a6447fe3..bbbb30ae2201ab8 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -2593,7 +2593,7 @@ void Driver::BuildInputs(const ToolChain &TC, DerivedArgList &Args,
   // Warn -x after last input file has no effect
   auto LastXArg = Args.getLastArgValue(options::OPT_x);
   const llvm::StringSet<> ValidXArgs = {"cuda", "hip", "cui", "hipi"};
-  if (!IsCLMode() || ValidXArgs.find(LastXArg) != ValidXArgs.end()) {
+  if (!IsCLMode() || ValidXArgs.contains(LastXArg)) {
     Arg *LastXArg = Args.getLastArgNoClaim(options::OPT_x);
     Arg *LastInputArg = Args.getLastArgNoClaim(options::OPT_INPUT);
     if (LastXArg && LastInputArg &&


        


More information about the llvm-branch-commits mailing list