[llvm-branch-commits] [llvm] b273386 - [llvm-rc] Fix the reference to the option for disabling preprocessing in a message

Tom Stellard via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Apr 4 10:56:05 PDT 2023


Author: Martin Storsjö
Date: 2023-04-04T10:55:36-07:00
New Revision: b27338656d7db712ba6f37295b26f181ab2e043d

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

LOG: [llvm-rc] Fix the reference to the option for disabling preprocessing in a message

This was the original option name from the first iteration of the patch
that added the feature, but during review, a different name was suggested
and preferred - but the reference in the helpful message was missed.

Differential Revision: https://reviews.llvm.org/D146796

(cherry picked from commit 014e5c8d39c172a5b4bb1e1c75ced9bcb9ff2115)

Added: 
    

Modified: 
    llvm/tools/llvm-rc/llvm-rc.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-rc/llvm-rc.cpp b/llvm/tools/llvm-rc/llvm-rc.cpp
index 30c1569bc956e..8864bbb4b0f3e 100644
--- a/llvm/tools/llvm-rc/llvm-rc.cpp
+++ b/llvm/tools/llvm-rc/llvm-rc.cpp
@@ -218,6 +218,7 @@ struct RcOptions {
   std::string OutputFile;
   Format OutputFormat = Res;
 
+  bool IsWindres = false;
   bool BeVerbose = false;
   WriterParams Params;
   bool AppendNull = false;
@@ -238,9 +239,12 @@ bool preprocess(StringRef Src, StringRef Dst, const RcOptions &Opts,
     } else {
       errs() << "llvm-rc: Unable to find clang, skipping preprocessing."
              << "\n";
-      errs() << "Pass -no-cpp to disable preprocessing. This will be an error "
-                "in the future."
-             << "\n";
+      StringRef OptionName =
+          Opts.IsWindres ? "--no-preprocess" : "-no-preprocess";
+      errs()
+          << "Pass " << OptionName
+          << " to disable preprocessing. This will be an error in the future."
+          << "\n";
       return false;
     }
   }
@@ -365,6 +369,8 @@ RcOptions parseWindresOptions(ArrayRef<const char *> ArgsArr,
   unsigned MAI, MAC;
   opt::InputArgList InputArgs = T.ParseArgs(ArgsArr, MAI, MAC);
 
+  Opts.IsWindres = true;
+
   // The tool prints nothing when invoked with no command-line arguments.
   if (InputArgs.hasArg(WINDRES_help)) {
     T.printHelp(outs(), "windres [options] file...",


        


More information about the llvm-branch-commits mailing list