[llvm] 4f1ddf7 - [CommandLine] Remove unused variable 'NearestHandler' (fixup for #74811)

Igor Kudrin via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 13 20:13:24 PST 2023


Author: Igor Kudrin
Date: 2023-12-13T20:12:33-08:00
New Revision: 4f1ddf7523c0bbb4075b1682dbe2278080642eee

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

LOG: [CommandLine] Remove unused variable 'NearestHandler' (fixup for #74811)

Buildbots reported:
.../CommandLine.cpp:1626:13: error: variable 'NearestHandler' set but not used [-Werror,-Wunused-but-set-variable]

Added: 
    

Modified: 
    llvm/lib/Support/CommandLine.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp
index bac48ffb5ed95..088b4e4d755cb 100644
--- a/llvm/lib/Support/CommandLine.cpp
+++ b/llvm/lib/Support/CommandLine.cpp
@@ -1623,7 +1623,6 @@ bool CommandLineParser::ParseCommandLineOptions(int argc,
   bool DashDashFound = false; // Have we read '--'?
   for (int i = FirstArg; i < argc; ++i) {
     Option *Handler = nullptr;
-    Option *NearestHandler = nullptr;
     std::string NearestHandlerString;
     StringRef Value;
     StringRef ArgName = "";
@@ -1703,8 +1702,7 @@ bool CommandLineParser::ParseCommandLineOptions(int argc,
       // Otherwise, look for the closest available option to report to the user
       // in the upcoming error.
       if (!Handler && SinkOpts.empty())
-        NearestHandler =
-            LookupNearestOption(ArgName, OptionsMap, NearestHandlerString);
+        LookupNearestOption(ArgName, OptionsMap, NearestHandlerString);
     }
 
     if (!Handler) {


        


More information about the llvm-commits mailing list