Suggested by: David Blaikie.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253808
91177308-0d34-0410-b5e6-
96231b3b80d8
static void loadDylibs() {
for (const std::string &Dylib : Dylibs) {
- if (sys::fs::is_regular_file(Dylib)) {
- std::string ErrMsg;
- if (sys::DynamicLibrary::LoadLibraryPermanently(Dylib.c_str(), &ErrMsg))
- report_fatal_error("Error loading '" + Dylib + "': " + ErrMsg);
- } else
+ if (!sys::fs::is_regular_file(Dylib))
report_fatal_error("Dylib not found: '" + Dylib + "'.");
+ std::string ErrMsg;
+ if (sys::DynamicLibrary::LoadLibraryPermanently(Dylib.c_str(), &ErrMsg))
+ report_fatal_error("Error loading '" + Dylib + "': " + ErrMsg);
}
}