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 @@ -228,7 +228,7 @@ unsigned LangId = (/*PrimaryLangId*/ 0x09) | (/*SubLangId*/ 0x01 << 10); }; -bool preprocess(StringRef Src, StringRef Dst, const RcOptions &Opts, +void preprocess(StringRef Src, StringRef Dst, const RcOptions &Opts, const char *Argv0) { std::string Clang; if (Opts.PrintCmdAndExit || !Opts.PreprocessCmd.empty()) { @@ -238,15 +238,12 @@ if (ClangOrErr) { Clang = *ClangOrErr; } else { - errs() << "llvm-rc: Unable to find clang, skipping preprocessing." + errs() << "llvm-rc: Unable to find clang for preprocessing." << "\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; + errs() << "Pass " << OptionName << " to disable preprocessing.\n"; + fatalError("llvm-rc: Unable to preprocess."); } } @@ -278,7 +275,6 @@ if (Res) { fatalError("llvm-rc: Preprocessing failed."); } - return true; } static std::pair isWindres(llvm::StringRef Argv0) { @@ -612,8 +608,8 @@ if (Opts.Preprocess) { std::string OutFile = createTempFile("preproc", "rc"); TempPreprocFile.setFile(OutFile); - if (preprocess(Src, OutFile, Opts, Argv0)) - PreprocessedFile = OutFile; + preprocess(Src, OutFile, Opts, Argv0); + PreprocessedFile = OutFile; } // Read and tokenize the input file.