aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Linker
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-05-27 17:18:38 +0000
committerDan Gohman <gohman@apple.com>2010-05-27 17:18:38 +0000
commit95131fcb671f13b931ea3cbb6bbd3fd735f1c5dc (patch)
tree2c79a33e3b6e361db3fcf72569d9a4ef0d3378b5 /lib/Linker
parent02d5824266342ea06d7a01681fccdbd96d4afd04 (diff)
downloadexternal_llvm-95131fcb671f13b931ea3cbb6bbd3fd735f1c5dc.zip
external_llvm-95131fcb671f13b931ea3cbb6bbd3fd735f1c5dc.tar.gz
external_llvm-95131fcb671f13b931ea3cbb6bbd3fd735f1c5dc.tar.bz2
Use the return value of getMagicNumber instead of using a
separate canRead() call. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104853 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Linker')
-rw-r--r--lib/Linker/LinkItems.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/Linker/LinkItems.cpp b/lib/Linker/LinkItems.cpp
index 2c22550..f0c7b68 100644
--- a/lib/Linker/LinkItems.cpp
+++ b/lib/Linker/LinkItems.cpp
@@ -174,13 +174,11 @@ bool Linker::LinkInFile(const sys::Path &File, bool &is_native) {
return error("Cannot link stdin: " + Error);
}
- // Make sure we can at least read the file
- if (!File.canRead())
+ // Determine what variety of file it is.
+ std::string Magic;
+ if (!File.getMagicNumber(Magic, 64))
return error("Cannot find linker input '" + File.str() + "'");
- // If its an archive, try to link it in
- std::string Magic;
- File.getMagicNumber(Magic, 64);
switch (sys::IdentifyFileType(Magic.c_str(), 64)) {
default: llvm_unreachable("Bad file type identification");
case sys::Unknown_FileType: