Skip to content

Commit 5cdf936

Browse files
committed
[llvm-rtdyld] Refactor to reduce indentation.
Suggested by: David Blaikie. llvm-svn: 253808
1 parent e0dbbd9 commit 5cdf936

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -247,12 +247,11 @@ static int Error(const Twine &Msg) {
247247

248248
static void loadDylibs() {
249249
for (const std::string &Dylib : Dylibs) {
250-
if (sys::fs::is_regular_file(Dylib)) {
251-
std::string ErrMsg;
252-
if (sys::DynamicLibrary::LoadLibraryPermanently(Dylib.c_str(), &ErrMsg))
253-
report_fatal_error("Error loading '" + Dylib + "': " + ErrMsg);
254-
} else
250+
if (!sys::fs::is_regular_file(Dylib))
255251
report_fatal_error("Dylib not found: '" + Dylib + "'.");
252+
std::string ErrMsg;
253+
if (sys::DynamicLibrary::LoadLibraryPermanently(Dylib.c_str(), &ErrMsg))
254+
report_fatal_error("Error loading '" + Dylib + "': " + ErrMsg);
256255
}
257256
}
258257

0 commit comments

Comments
 (0)