[llvm-commits] [llvm] r104853 - /llvm/trunk/lib/Linker/LinkItems.cpp
Dan Gohman
gohman at apple.com
Thu May 27 10:18:38 PDT 2010
Author: djg
Date: Thu May 27 12:18:38 2010
New Revision: 104853
URL: http://llvm.org/viewvc/llvm-project?rev=104853&view=rev
Log:
Use the return value of getMagicNumber instead of using a
separate canRead() call.
Modified:
llvm/trunk/lib/Linker/LinkItems.cpp
Modified: llvm/trunk/lib/Linker/LinkItems.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkItems.cpp?rev=104853&r1=104852&r2=104853&view=diff
==============================================================================
--- llvm/trunk/lib/Linker/LinkItems.cpp (original)
+++ llvm/trunk/lib/Linker/LinkItems.cpp Thu May 27 12:18:38 2010
@@ -174,13 +174,11 @@
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:
More information about the llvm-commits
mailing list