From e58f7408d086adbcb280f45893e70ce62d3c1b8d Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 28 Jul 2006 22:52:11 +0000 Subject: [PATCH] Remove a redundant syscall. llvm-svn: 29405 --- llvm/lib/Linker/Linker.cpp | 40 +++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/llvm/lib/Linker/Linker.cpp b/llvm/lib/Linker/Linker.cpp index 8b8cddc98054..80b85caaee12 100644 --- a/llvm/lib/Linker/Linker.cpp +++ b/llvm/lib/Linker/Linker.cpp @@ -119,31 +119,27 @@ static inline sys::Path IsLibrary(const std::string& Name, sys::Path FullPath(Directory); - // Make sure the directory actually is a directory in the file system. - if (FullPath.isDirectory()) - { - // Try the libX.a form - FullPath.appendComponent("lib" + Name); - FullPath.appendSuffix("a"); - if (FullPath.isArchive()) - return FullPath; + // Try the libX.a form + FullPath.appendComponent("lib" + Name); + FullPath.appendSuffix("a"); + if (FullPath.isArchive()) + return FullPath; - // Try the libX.bca form - FullPath.eraseSuffix(); - FullPath.appendSuffix("bca"); - if (FullPath.isArchive()) - return FullPath; + // Try the libX.bca form + FullPath.eraseSuffix(); + FullPath.appendSuffix("bca"); + if (FullPath.isArchive()) + return FullPath; - // Try the libX.so (or .dylib) form - FullPath.eraseSuffix(); - FullPath.appendSuffix(&(LTDL_SHLIB_EXT[1])); - if (FullPath.isDynamicLibrary()) // Native shared library? - return FullPath; - if (FullPath.isBytecodeFile()) // .so file containing bytecode? - return FullPath; + // Try the libX.so (or .dylib) form + FullPath.eraseSuffix(); + FullPath.appendSuffix(&(LTDL_SHLIB_EXT[1])); + if (FullPath.isDynamicLibrary()) // Native shared library? + return FullPath; + if (FullPath.isBytecodeFile()) // .so file containing bytecode? + return FullPath; - // Not found .. fall through - } + // Not found .. fall through // Indicate that the library was not found in the directory. FullPath.clear();