@@ -426,38 +426,28 @@ bool VerifyModule(llvm::Module *module) {
426426}
427427
428428std::unique_ptr<llvm::Module> LoadModuleFromFile (llvm::LLVMContext *context,
429- std::filesystem::path path )
429+ std::filesystem::path file_name )
430430{
431- // NOTE(lukas): Calling deprecated function, once it is remove its body
432- // will be more or less inlined.
433- return LoadModuleFromFile (context, path.string (), true );
434- }
435-
436- // Reads an LLVM module from a file.
437- std::unique_ptr<llvm::Module> LoadModuleFromFile (llvm::LLVMContext *context,
438- std::string_view file_name_,
439- bool allow_failure) {
440431 llvm::SMDiagnostic err;
441- llvm::StringRef file_name (file_name_.data (), file_name_.size ());
442- auto module = llvm::parseIRFile (file_name, err, *context);
432+ auto module = llvm::parseIRFile (file_name.string (), err, *context);
443433
444434 if (!module ) {
445- LOG_IF (FATAL, !allow_failure )
446- << " Unable to parse module file " << file_name_ << " : "
435+ LOG (ERROR )
436+ << " Unable to parse module file " << file_name << " : "
447437 << err.getMessage ().str ();
448438 return {};
449439 }
450440
451441 auto ec = module ->materializeAll (); // Just in case.
452442 if (ec) {
453- LOG_IF (FATAL, !allow_failure )
454- << " Unable to materialize everything from " << file_name_ ;
443+ LOG (ERROR )
444+ << " Unable to materialize everything from " << file_name ;
455445 return {};
456446 }
457447
458448 if (!VerifyModule (module .get ())) {
459- LOG_IF (FATAL, !allow_failure )
460- << " Error verifying module read from file " << file_name_ ;
449+ LOG (ERROR )
450+ << " Error verifying module read from file " << file_name ;
461451 return {};
462452 }
463453
0 commit comments