diff --git a/llvm/tools/llvm-rc/llvm-rc.cpp b/llvm/tools/llvm-rc/llvm-rc.cpp --- a/llvm/tools/llvm-rc/llvm-rc.cpp +++ b/llvm/tools/llvm-rc/llvm-rc.cpp @@ -219,6 +219,7 @@ std::string OutputFile; Format OutputFormat = Res; + bool IsWindres = false; bool BeVerbose = false; WriterParams Params; bool AppendNull = false; @@ -239,9 +240,12 @@ } 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; } } @@ -366,6 +370,8 @@ 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...",