summaryrefslogtreecommitdiff
path: root/lib/Linker/Linker.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-07-28 22:52:11 +0000
committerChris Lattner <sabre@nondot.org>2006-07-28 22:52:11 +0000
commit501d529ccc77a092ca7fc1b21db72933a4c5859a (patch)
tree30a44fc168ebb27276ded349e0409e7c2ed75af2 /lib/Linker/Linker.cpp
parentb6ee7f73e58adbd5c5c8b923cce818b69d059a42 (diff)
downloadllvm-501d529ccc77a092ca7fc1b21db72933a4c5859a.tar.gz
llvm-501d529ccc77a092ca7fc1b21db72933a4c5859a.tar.bz2
llvm-501d529ccc77a092ca7fc1b21db72933a4c5859a.tar.xz
Remove a redundant syscall.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29405 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Linker/Linker.cpp')
-rw-r--r--lib/Linker/Linker.cpp46
1 files changed, 21 insertions, 25 deletions
diff --git a/lib/Linker/Linker.cpp b/lib/Linker/Linker.cpp
index 8b8cddc980..80b85caaee 100644
--- a/lib/Linker/Linker.cpp
+++ b/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.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;
-
- // Not found .. fall through
- }
+ // 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.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
// Indicate that the library was not found in the directory.
FullPath.clear();