@@ -290,8 +290,8 @@ static void runNewPMPasses(const Config &Conf, Module &Mod, TargetMachine *TM,
290290 if (!Conf.AAPipeline .empty ()) {
291291 AAManager AA;
292292 if (auto Err = PB.parseAAPipeline (AA, Conf.AAPipeline )) {
293- report_fatal_error (Twine (" unable to parse AA pipeline description '" ) +
294- Conf.AAPipeline + " ': " + toString (std::move (Err)));
293+ reportFatalUsageError (Twine (" unable to parse AA pipeline description '" ) +
294+ Conf.AAPipeline + " ': " + toString (std::move (Err)));
295295 }
296296 // Register the AA manager first so that our version is the one used.
297297 FAM.registerPass ([&] { return std::move (AA); });
@@ -331,8 +331,9 @@ static void runNewPMPasses(const Config &Conf, Module &Mod, TargetMachine *TM,
331331 // Parse a custom pipeline if asked to.
332332 if (!Conf.OptPipeline .empty ()) {
333333 if (auto Err = PB.parsePassPipeline (MPM, Conf.OptPipeline )) {
334- report_fatal_error (Twine (" unable to parse pass pipeline description '" ) +
335- Conf.OptPipeline + " ': " + toString (std::move (Err)));
334+ reportFatalUsageError (
335+ Twine (" unable to parse pass pipeline description '" ) +
336+ Conf.OptPipeline + " ': " + toString (std::move (Err)));
336337 }
337338 } else if (IsThinLTO) {
338339 MPM.addPass (PB.buildThinLTODefaultPipeline (OL, ImportSummary));
@@ -415,8 +416,8 @@ static void codegen(const Config &Conf, TargetMachine *TM,
415416 if (!Conf.DwoDir .empty ()) {
416417 std::error_code EC;
417418 if (auto EC = llvm::sys::fs::create_directories (Conf.DwoDir ))
418- report_fatal_error (Twine (" Failed to create directory " ) + Conf.DwoDir +
419- " : " + EC.message ());
419+ reportFatalUsageError (Twine (" Failed to create directory " ) + Conf.DwoDir +
420+ " : " + EC.message ());
420421
421422 DwoFile = Conf.DwoDir ;
422423 sys::path::append (DwoFile, std::to_string (Task) + " .dwo" );
@@ -428,14 +429,14 @@ static void codegen(const Config &Conf, TargetMachine *TM,
428429 std::error_code EC;
429430 DwoOut = std::make_unique<ToolOutputFile>(DwoFile, EC, sys::fs::OF_None);
430431 if (EC)
431- report_fatal_error (Twine (" Failed to open " ) + DwoFile + " : " +
432- EC.message ());
432+ reportFatalUsageError (Twine (" Failed to open " ) + DwoFile + " : " +
433+ EC.message ());
433434 }
434435
435436 Expected<std::unique_ptr<CachedFileStream>> StreamOrErr =
436437 AddStream (Task, Mod.getModuleIdentifier ());
437438 if (Error Err = StreamOrErr.takeError ())
438- report_fatal_error (std::move (Err));
439+ reportFatalUsageError (std::move (Err));
439440 std::unique_ptr<CachedFileStream> &Stream = *StreamOrErr;
440441 TM->Options .ObjectFilenameForDebug = Stream->ObjectPathName ;
441442
0 commit comments