[llvm-rtdyld] Fail early if we can't load dynamic libraries.
authorDavide Italiano <davide@freebsd.org>
Sat, 21 Nov 2015 05:58:19 +0000 (05:58 +0000)
committerDavide Italiano <davide@freebsd.org>
Sat, 21 Nov 2015 05:58:19 +0000 (05:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253767 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-rtdyld/llvm-rtdyld.cpp

index d0e4a44..97a9b28 100644 (file)
@@ -250,10 +250,9 @@ static void loadDylibs() {
     if (sys::fs::is_regular_file(Dylib)) {
       std::string ErrMsg;
       if (sys::DynamicLibrary::LoadLibraryPermanently(Dylib.c_str(), &ErrMsg))
     if (sys::fs::is_regular_file(Dylib)) {
       std::string ErrMsg;
       if (sys::DynamicLibrary::LoadLibraryPermanently(Dylib.c_str(), &ErrMsg))
-        llvm::errs() << "Error loading '" << Dylib << "': "
-                     << ErrMsg << "\n";
+        report_fatal_error("Error loading '" + Dylib + "': " + ErrMsg);
     } else
     } else
-      llvm::errs() << "Dylib not found: '" << Dylib << "'.\n";
+      report_fatal_error("Dylib not found: '" + Dylib + "'.");
   }
 }
 
   }
 }