diff options
author | Davide Italiano <davide@freebsd.org> | 2015-11-22 01:58:33 +0000 |
---|---|---|
committer | Davide Italiano <davide@freebsd.org> | 2015-11-22 01:58:33 +0000 |
commit | e5dedf932d787530b7204c86e9da879f84d90f62 (patch) | |
tree | 209f33198134007ad46c343e59e556e9e6985775 /tools | |
parent | 085776b0a391431a941f2f3189864b5abbb5b45c (diff) |
[llvm-rtdyld] Refactor to reduce indentation.
Suggested by: David Blaikie.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253808 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/llvm-rtdyld/llvm-rtdyld.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/tools/llvm-rtdyld/llvm-rtdyld.cpp b/tools/llvm-rtdyld/llvm-rtdyld.cpp index 97a9b28863e..385cd1bd5ca 100644 --- a/tools/llvm-rtdyld/llvm-rtdyld.cpp +++ b/tools/llvm-rtdyld/llvm-rtdyld.cpp @@ -247,12 +247,11 @@ static int Error(const Twine &Msg) { 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); } } |