Skip to content

Commit b273386

Browse files
mstorsjotstellar
authored andcommitted
[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 014e5c8)
1 parent b9857e6 commit b273386

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

llvm/tools/llvm-rc/llvm-rc.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ struct RcOptions {
218218
std::string OutputFile;
219219
Format OutputFormat = Res;
220220

221+
bool IsWindres = false;
221222
bool BeVerbose = false;
222223
WriterParams Params;
223224
bool AppendNull = false;
@@ -238,9 +239,12 @@ bool preprocess(StringRef Src, StringRef Dst, const RcOptions &Opts,
238239
} else {
239240
errs() << "llvm-rc: Unable to find clang, skipping preprocessing."
240241
<< "\n";
241-
errs() << "Pass -no-cpp to disable preprocessing. This will be an error "
242-
"in the future."
243-
<< "\n";
242+
StringRef OptionName =
243+
Opts.IsWindres ? "--no-preprocess" : "-no-preprocess";
244+
errs()
245+
<< "Pass " << OptionName
246+
<< " to disable preprocessing. This will be an error in the future."
247+
<< "\n";
244248
return false;
245249
}
246250
}
@@ -365,6 +369,8 @@ RcOptions parseWindresOptions(ArrayRef<const char *> ArgsArr,
365369
unsigned MAI, MAC;
366370
opt::InputArgList InputArgs = T.ParseArgs(ArgsArr, MAI, MAC);
367371

372+
Opts.IsWindres = true;
373+
368374
// The tool prints nothing when invoked with no command-line arguments.
369375
if (InputArgs.hasArg(WINDRES_help)) {
370376
T.printHelp(outs(), "windres [options] file...",

0 commit comments

Comments
 (0)